content
stringlengths 4
1.04M
| input_ids
sequencelengths 2
1.02k
| attention_mask
sequencelengths 2
1.02k
|
---|---|---|
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_exception
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.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_abapgit_not_found.
ENDIF.
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.
zcx_abapgit_exception=>raise( 'error from TYPD_GET_OBJECT' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
rv_user = c_user_unknown. " todo
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_objname TYPE rsedd0-ddobjname.
lv_objname = ms_item-obj_name.
CALL FUNCTION 'RS_DD_DELETE_OBJ'
EXPORTING
no_ask = abap_true
objname = lv_objname
objtype = 'G'
EXCEPTIONS
not_executed = 1
object_not_found = 2
object_not_specified = 3
permission_failure = 4
dialog_needed = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error deleting TYPE' ).
ENDIF.
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.
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( ).
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,
1069,
4516,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
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,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1,
1,
1,
1,
1,
1
] |
REPORT zabap_test_0054 NO STANDARD PAGE HEADING.
DATA: lv_string TYPE string,
lt_tab TYPE TABLE OF string.
APPEND 'hello' TO lt_tab.
APPEND 'world' TO lt_tab.
CONCATENATE LINES OF lt_tab INTO lv_string SEPARATED BY space.
WRITE: / lv_string.
| [
2200,
15490,
1976,
397,
499,
62,
9288,
62,
405,
4051,
8005,
49053,
9795,
48488,
39837,
2751,
13,
198,
198,
26947,
25,
300,
85,
62,
8841,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
300,
83,
62,
8658,
220,
220,
220,
41876,
43679,
3963,
4731,
13,
198,
198,
24805,
10619,
705,
31373,
6,
5390,
300,
83,
62,
8658,
13,
198,
24805,
10619,
705,
6894,
6,
5390,
300,
83,
62,
8658,
13,
198,
198,
10943,
34,
1404,
1677,
6158,
43277,
1546,
3963,
300,
83,
62,
8658,
39319,
300,
85,
62,
8841,
7946,
27082,
11617,
11050,
2272,
13,
198,
18564,
12709,
25,
1220,
300,
85,
62,
8841,
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
] |
*&---------------------------------------------------------------------*
*& Report YJRS_ABAP_0002
*&---------------------------------------------------------------------*
* This programs will show the problem of use a BINARY search on unsorted
* table.
REPORT YJRS_ABAP_0002.
START-OF-SELECTION.
PERFORM start_of_selection.
*&---------------------------------------------------------------------*
*& Form START_OF_SELECTION
*&---------------------------------------------------------------------*
FORM start_of_selection .
TYPES: BEGIN OF lt_unsorted,
number TYPE i,
END OF lt_unsorted.
DATA: li_unsorted TYPE STANDARD TABLE OF lt_unsorted
WITH HEADER LINE.
li_unsorted-number = 1.
APPEND li_unsorted.
li_unsorted-number = 3.
APPEND li_unsorted.
li_unsorted-number = 2.
APPEND li_unsorted.
READ TABLE li_unsorted WITH KEY number = 2
BINARY SEARCH.
WRITE: / 'SY-SUBRC is:', sy-subrc.
ENDFORM.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
575,
41,
6998,
62,
6242,
2969,
62,
34215,
198,
9,
5,
10097,
30934,
9,
198,
9,
770,
4056,
481,
905,
262,
1917,
286,
779,
257,
347,
1268,
13153,
2989,
319,
5576,
9741,
198,
9,
3084,
13,
198,
2200,
15490,
575,
41,
6998,
62,
6242,
2969,
62,
34215,
13,
198,
198,
2257,
7227,
12,
19238,
12,
46506,
2849,
13,
198,
220,
19878,
21389,
923,
62,
1659,
62,
49283,
13,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
5178,
33303,
62,
19238,
62,
46506,
2849,
198,
9,
5,
10097,
30934,
9,
198,
21389,
923,
62,
1659,
62,
49283,
764,
198,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
300,
83,
62,
13271,
9741,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1271,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
300,
83,
62,
13271,
9741,
13,
628,
220,
42865,
25,
7649,
62,
13271,
9741,
41876,
49053,
9795,
43679,
3963,
300,
83,
62,
13271,
9741,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
39837,
1137,
48920,
13,
628,
220,
7649,
62,
13271,
9741,
12,
17618,
796,
352,
13,
198,
220,
43504,
10619,
7649,
62,
13271,
9741,
13,
198,
220,
7649,
62,
13271,
9741,
12,
17618,
796,
513,
13,
198,
220,
43504,
10619,
7649,
62,
13271,
9741,
13,
198,
220,
7649,
62,
13271,
9741,
12,
17618,
796,
362,
13,
198,
220,
43504,
10619,
7649,
62,
13271,
9741,
13,
628,
220,
20832,
43679,
7649,
62,
13271,
9741,
13315,
35374,
1271,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
1268,
13153,
7946,
31315,
13,
628,
220,
44423,
25,
1220,
705,
23060,
12,
50,
10526,
7397,
318,
25,
3256,
827,
12,
7266,
6015,
13,
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
] |
class ZCA_OO_TUT_PERS_DEMO definition
public
inheriting from ZCB_OO_TUT_PERS_DEMO
final
create private .
public section.
*"* public components of class ZCA_OO_TUT_PERS_DEMO
*"* do not include other source files here!!!
class-data AGENT type ref to ZCA_OO_TUT_PERS_DEMO read-only .
class-methods CLASS_CONSTRUCTOR .
protected section.
*"* protected components of class ZCA_OO_TUT_PERS_DEMO
*"* do not include other source files here!!!
private section.
*"* private components of class ZCA_OO_TUT_PERS_DEMO
*"* do not include other source files here!!!
ENDCLASS.
CLASS ZCA_OO_TUT_PERS_DEMO IMPLEMENTATION.
method CLASS_CONSTRUCTOR.
***BUILD 090501
************************************************************************
* Purpose : Initialize the 'class'.
*
* Version : 2.0
*
* Precondition : -
*
* Postcondition : Singleton is created.
*
* OO Exceptions : -
*
* Implementation : -
*
************************************************************************
* Changelog:
* - 1999-09-20 : (OS) Initial Version
* - 2000-03-06 : (BGR) 2.0 modified REGISTER_CLASS_AGENT
************************************************************************
* GENERATED: Do not modify
************************************************************************
create object AGENT.
call method AGENT->REGISTER_CLASS_AGENT
exporting
I_CLASS_NAME = 'ZCL_OO_TUT_PERS_DEMO'
I_CLASS_AGENT_NAME = 'ZCA_OO_TUT_PERS_DEMO'
I_CLASS_GUID = '001B7708C0801DDE9C9413B5B4C1C5A7'
I_CLASS_AGENT_GUID = '001B7708C0801DDE9C9413B5B4C345A7'
I_AGENT = AGENT
I_STORAGE_LOCATION = 'SFLIGHT'
I_CLASS_AGENT_VERSION = '2.0'.
"CLASS_CONSTRUCTOR
endmethod.
ENDCLASS.
| [
4871,
1168,
8141,
62,
6684,
62,
51,
3843,
62,
47,
4877,
62,
39429,
46,
6770,
198,
220,
1171,
198,
220,
10639,
1780,
422,
1168,
23199,
62,
6684,
62,
51,
3843,
62,
47,
4877,
62,
39429,
46,
198,
220,
2457,
198,
220,
2251,
2839,
764,
198,
198,
11377,
2665,
13,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1168,
8141,
62,
6684,
62,
51,
3843,
62,
47,
4877,
62,
39429,
46,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
628,
220,
1398,
12,
7890,
13077,
3525,
2099,
1006,
284,
1168,
8141,
62,
6684,
62,
51,
3843,
62,
47,
4877,
62,
39429,
46,
1100,
12,
8807,
764,
628,
220,
1398,
12,
24396,
82,
42715,
62,
10943,
46126,
1581,
764,
198,
24326,
2665,
13,
198,
9,
1,
9,
6861,
6805,
286,
1398,
1168,
8141,
62,
6684,
62,
51,
3843,
62,
47,
4877,
62,
39429,
46,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
19734,
2665,
13,
198,
9,
1,
9,
2839,
6805,
286,
1398,
1168,
8141,
62,
6684,
62,
51,
3843,
62,
47,
4877,
62,
39429,
46,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
8141,
62,
6684,
62,
51,
3843,
62,
47,
4877,
62,
39429,
46,
30023,
2538,
10979,
6234,
13,
628,
198,
24396,
42715,
62,
10943,
46126,
1581,
13,
198,
8162,
19499,
26761,
7769,
2713,
486,
198,
17174,
17174,
4557,
198,
9,
32039,
220,
220,
220,
220,
220,
220,
220,
1058,
20768,
1096,
262,
705,
4871,
4458,
198,
9,
198,
9,
10628,
220,
220,
220,
220,
220,
220,
220,
1058,
362,
13,
15,
198,
9,
198,
9,
3771,
31448,
220,
220,
1058,
532,
198,
9,
198,
9,
2947,
31448,
220,
1058,
5573,
10565,
318,
2727,
13,
198,
9,
198,
9,
440,
46,
1475,
11755,
220,
1058,
532,
198,
9,
198,
9,
46333,
1058,
532,
198,
9,
198,
17174,
17174,
4557,
198,
9,
609,
8368,
519,
25,
198,
9,
532,
7358,
12,
2931,
12,
1238,
220,
220,
1058,
357,
2640,
8,
20768,
10628,
198,
9,
532,
4751,
12,
3070,
12,
3312,
220,
220,
1058,
357,
33,
10761,
8,
362,
13,
15,
9518,
23337,
41517,
62,
31631,
62,
4760,
3525,
198,
17174,
17174,
4557,
198,
9,
24700,
1137,
11617,
25,
2141,
407,
13096,
198,
17174,
17174,
4557,
628,
220,
2251,
2134,
13077,
3525,
13,
628,
220,
869,
2446,
13077,
3525,
3784,
31553,
41517,
62,
31631,
62,
4760,
3525,
198,
220,
220,
220,
39133,
198,
220,
220,
220,
220,
220,
314,
62,
31631,
62,
20608,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
57,
5097,
62,
6684,
62,
51,
3843,
62,
47,
4877,
62,
39429,
46,
6,
198,
220,
220,
220,
220,
220,
314,
62,
31631,
62,
4760,
3525,
62,
20608,
220,
220,
220,
796,
705,
57,
8141,
62,
6684,
62,
51,
3843,
62,
47,
4877,
62,
39429,
46,
6,
198,
220,
220,
220,
220,
220,
314,
62,
31631,
62,
38,
27586,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
8298,
33,
22,
32583,
34,
2919,
486,
35,
7206,
24,
34,
5824,
1485,
33,
20,
33,
19,
34,
16,
34,
20,
32,
22,
6,
198,
220,
220,
220,
220,
220,
314,
62,
31631,
62,
4760,
3525,
62,
38,
27586,
220,
220,
220,
796,
705,
8298,
33,
22,
32583,
34,
2919,
486,
35,
7206,
24,
34,
5824,
1485,
33,
20,
33,
19,
34,
27712,
32,
22,
6,
198,
220,
220,
220,
220,
220,
314,
62,
4760,
3525,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
13077,
3525,
198,
220,
220,
220,
220,
220,
314,
62,
2257,
1581,
11879,
62,
29701,
6234,
220,
220,
220,
796,
705,
50,
3697,
9947,
6,
198,
220,
220,
220,
220,
220,
314,
62,
31631,
62,
4760,
3525,
62,
43717,
796,
705,
17,
13,
15,
4458,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
31631,
62,
10943,
46126,
1581,
198,
437,
24396,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS y_check_check_stmnt_position DEFINITION
PUBLIC
INHERITING FROM y_check_base
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor .
PROTECTED SECTION.
METHODS inspect_tokens REDEFINITION.
METHODS execute_check REDEFINITION.
PRIVATE SECTION.
DATA statement_index TYPE i VALUE 0 ##NO_TEXT.
METHODS is_token_excluded
IMPORTING
!token_str TYPE stokesx-str
RETURNING
VALUE(result) TYPE abap_bool .
ENDCLASS.
CLASS Y_CHECK_CHECK_STMNT_POSITION IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
description = 'CHECK Statement Position'(001).
category = 'Y_CHECK_CATEGORY'.
position = '060'.
version = '0000'.
has_documentation = abap_true.
settings-pseudo_comment = '"#EC CHECK_POSITION' ##NO_TEXT.
settings-disable_threshold_selection = abap_true.
settings-threshold = 0.
settings-documentation = |{ c_docs_path-checks }check-statement-position.md|.
y_message_registration=>add_message(
EXPORTING
check_name = me->myname
text = '[Clean Code]: "CHECK" Statement should be the very first statement.'(102)
pseudo_comment = settings-pseudo_comment
CHANGING
messages = me->scimessages ).
ENDMETHOD. "CONSTRUCTOR
METHOD execute_check.
LOOP AT ref_scan_manager->get_structures( ) ASSIGNING FIELD-SYMBOL(<structure>)
WHERE stmnt_type EQ scan_struc_stmnt_type-form
OR stmnt_type EQ scan_struc_stmnt_type-method
OR stmnt_type EQ scan_struc_stmnt_type-function
OR stmnt_type EQ scan_struc_stmnt_type-module
OR type EQ scan_struc_type-event.
is_testcode = test_code_detector->is_testcode( <structure> ).
TRY.
DATA(check_configuration) = check_configurations[ apply_on_testcode = abap_true ].
CATCH cx_sy_itab_line_not_found.
IF is_testcode EQ abap_true.
CONTINUE.
ENDIF.
ENDTRY.
DATA(index) = <structure>-stmnt_from.
statement_index = 0.
LOOP AT ref_scan_manager->get_statements( ) ASSIGNING FIELD-SYMBOL(<statement>)
FROM <structure>-stmnt_from TO <structure>-stmnt_to.
inspect_tokens( index = index
statement = <statement> ).
index = index + 1.
ENDLOOP.
ENDLOOP.
ENDMETHOD.
METHOD inspect_tokens.
LOOP AT ref_scan_manager->get_tokens( ) ASSIGNING FIELD-SYMBOL(<token>)
FROM statement-from TO statement-from
WHERE type NE scan_token_type-comment AND
type NE scan_token_type-pragma.
IF is_token_excluded( <token>-str ) EQ abap_true.
RETURN.
ENDIF.
ENDLOOP.
IF sy-subrc NE 0.
RETURN.
ENDIF.
statement_index = statement_index + 1.
IF statement_index GT 1 AND get_token_abs( statement-from ) EQ 'CHECK'.
DATA(check_configuration) = detect_check_configuration( statement ).
IF check_configuration IS INITIAL.
RETURN.
ENDIF.
raise_error( statement_level = statement-level
statement_index = index
statement_from = statement-from
error_priority = check_configuration-prio ).
ENDIF.
ENDMETHOD.
METHOD is_token_excluded.
result = xsdbool( token_str EQ 'METHOD' OR
token_str EQ 'FORM' OR
token_str EQ 'FUNCTION' OR
token_str EQ 'MODULE' OR
token_str EQ 'DATA' OR
token_str EQ 'TYPES' OR
token_str CP 'DATA(*)' OR
( token_str EQ 'CHECK' AND statement_index EQ 0 ) ).
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
62,
9122,
62,
9122,
62,
301,
76,
429,
62,
9150,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
331,
62,
9122,
62,
8692,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
23772,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
10104,
62,
83,
482,
641,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
12260,
62,
9122,
23848,
36,
20032,
17941,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
42865,
2643,
62,
9630,
41876,
1312,
26173,
8924,
657,
22492,
15285,
62,
32541,
13,
628,
220,
220,
220,
337,
36252,
50,
318,
62,
30001,
62,
1069,
10341,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
30001,
62,
2536,
220,
220,
220,
41876,
336,
3369,
87,
12,
2536,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
575,
62,
50084,
62,
50084,
62,
2257,
44,
11251,
62,
37997,
17941,
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,
6764,
796,
705,
50084,
21983,
23158,
6,
7,
8298,
737,
198,
220,
220,
220,
6536,
220,
220,
220,
796,
705,
56,
62,
50084,
62,
34,
6158,
38,
15513,
4458,
198,
220,
220,
220,
2292,
796,
705,
41322,
4458,
198,
220,
220,
220,
2196,
796,
705,
2388,
4458,
198,
220,
220,
220,
468,
62,
22897,
341,
796,
450,
499,
62,
7942,
13,
628,
220,
220,
220,
6460,
12,
7752,
12003,
62,
23893,
796,
705,
1,
2,
2943,
5870,
25171,
62,
37997,
17941,
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,
9122,
12,
26090,
12,
9150,
13,
9132,
91,
13,
628,
220,
220,
220,
331,
62,
20500,
62,
2301,
33397,
14804,
2860,
62,
20500,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
2198,
62,
3672,
220,
220,
220,
220,
796,
502,
3784,
1820,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
2420,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
44438,
32657,
6127,
5974,
366,
50084,
1,
21983,
815,
307,
262,
845,
717,
2643,
2637,
7,
15377,
8,
198,
220,
220,
220,
220,
220,
220,
220,
24543,
62,
23893,
796,
6460,
12,
7752,
12003,
62,
23893,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
6218,
220,
220,
220,
220,
220,
220,
796,
502,
3784,
1416,
320,
408,
1095,
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,
10943,
46126,
1581,
628,
198,
220,
337,
36252,
12260,
62,
9122,
13,
198,
220,
220,
220,
17579,
3185,
5161,
1006,
62,
35836,
62,
37153,
3784,
1136,
62,
7249,
942,
7,
1267,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
301,
5620,
43734,
198,
220,
220,
220,
220,
220,
33411,
336,
76,
429,
62,
4906,
36529,
9367,
62,
19554,
66,
62,
301,
76,
429,
62,
4906,
12,
687,
198,
220,
220,
220,
220,
220,
220,
220,
220,
6375,
336,
76,
429,
62,
4906,
36529,
9367,
62,
19554,
66,
62,
301,
76,
429,
62,
4906,
12,
24396,
198,
220,
220,
220,
220,
220,
220,
220,
220,
6375,
336,
76,
429,
62,
4906,
36529,
9367,
62,
19554,
66,
62,
301,
76,
429,
62,
4906,
12,
8818,
198,
220,
220,
220,
220,
220,
220,
220,
220,
6375,
336,
76,
429,
62,
4906,
36529,
9367,
62,
19554,
66,
62,
301,
76,
429,
62,
4906,
12,
21412,
198,
220,
220,
220,
220,
220,
220,
220,
220,
6375,
2099,
36529,
9367,
62,
19554,
66,
62,
4906,
12,
15596,
13,
628,
220,
220,
220,
220,
220,
318,
62,
9288,
8189,
796,
1332,
62,
8189,
62,
15255,
9250,
3784,
271,
62,
9288,
8189,
7,
1279,
301,
5620,
29,
6739,
628,
220,
220,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
9122,
62,
11250,
3924,
8,
796,
2198,
62,
11250,
20074,
58,
4174,
62,
261,
62,
9288,
8189,
796,
450,
499,
62,
7942,
20740,
198,
220,
220,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
1837,
62,
270,
397,
62,
1370,
62,
1662,
62,
9275,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16876,
318,
62,
9288,
8189,
36529,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43659,
8924,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
220,
220,
23578,
40405,
13,
628,
220,
220,
220,
220,
220,
42865,
7,
9630,
8,
796,
1279,
301,
5620,
29,
12,
301,
76,
429,
62,
6738,
13,
198,
220,
220,
220,
220,
220,
2643,
62,
9630,
796,
657,
13,
628,
220,
220,
220,
220,
220,
17579,
3185,
5161,
1006,
62,
35836,
62,
37153,
3784,
1136,
62,
14269,
3196,
7,
1267,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
26090,
43734,
198,
220,
220,
220,
220,
220,
220,
220,
16034,
1279,
301,
5620,
29,
12,
301,
76,
429,
62,
6738,
5390,
1279,
301,
5620,
29,
12,
301,
76,
429,
62,
1462,
13,
628,
220,
220,
220,
220,
220,
220,
220,
10104,
62,
83,
482,
641,
7,
6376,
796,
6376,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2643,
796,
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
] |
class ZCL_MQBA_SAM_WORKFLOW_EVENT definition
public
create public .
public section.
interfaces ZIF_MQBA_SUBSCRIBER .
protected section.
constants C_PARAM1_USAGE type STRING value 'BUS1006' ##NO_TEXT.
constants C_PARAM2_USAGE type STRING value '100000' ##NO_TEXT.
constants C_PARAM3_USAGE type STRING value 'CHANGED' ##NO_TEXT.
private section.
ENDCLASS.
CLASS ZCL_MQBA_SAM_WORKFLOW_EVENT IMPLEMENTATION.
METHOD zif_mqba_subscriber~process.
* ------ local data and macros
DATA: lv_objtype TYPE swo_objtyp.
DATA: lv_objkey TYPE swo_typeid.
DATA: lv_event TYPE swo_event.
DATA: lv_evtid TYPE swe_evtid.
DATA: lv_count TYPE swe_evtid.
DEFINE get_config.
&1 = CONV &2( is_context-sub_act_cfg-&3 ).
IF is_context-sub_cfg-&3 IS NOT INITIAL.
&1 = is_context-sub_cfg-&3.
ENDIF.
END-OF-DEFINITION.
* ------ init
rv_msg_type = 'X'.
* ------ param 1 -> objtype
get_config lv_objtype string param1.
IF lv_objtype IS INITIAL.
rv_msg_type = 'A'. " wrong config, no restart
RETURN.
ENDIF.
* ------ param 2 -> objkey
get_config lv_objkey string param2.
IF lv_objkey IS INITIAL.
rv_msg_type = 'A'. " wrong config, no restart
RETURN.
ENDIF.
* ------ param 3 -> event
get_config lv_event string param3.
IF lv_event IS INITIAL.
rv_msg_type = 'A'. " wrong config, no restart
RETURN.
ENDIF.
* ------ call workflow api
CALL FUNCTION 'SWE_EVENT_CREATE'
EXPORTING
objtype = lv_objtype
objkey = lv_objkey
event = lv_event
* CREATOR = ' '
* TAKE_WORKITEM_REQUESTER = ' '
* START_WITH_DELAY = ' '
* START_RECFB_SYNCHRON = ' '
* NO_COMMIT_FOR_QUEUE = ' '
* DEBUG_FLAG = ' '
* NO_LOGGING = ' '
* IDENT =
IMPORTING
event_id = lv_evtid
receiver_count = lv_count
* TABLES
* EVENT_CONTAINER =
EXCEPTIONS
objtype_not_found = 1
OTHERS = 2.
CASE sy-subrc.
WHEN 0.
IF lv_count EQ 0.
rv_msg_type = 'W'. " warn, no receiver
ELSE.
rv_msg_type = 'S'. " success, at least 1 receiver
ENDIF.
WHEN 1.
rv_msg_type = 'A'. " config error
WHEN 2.
rv_msg_type = 'E'. " unknown, try again later
WHEN OTHERS.
rv_msg_type = 'X'. " invalid, dump
ENDCASE.
ENDMETHOD.
ENDCLASS.
| [
4871,
1168,
5097,
62,
49215,
4339,
62,
49302,
62,
33249,
3697,
3913,
62,
20114,
3525,
6770,
198,
220,
1171,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
20314,
1168,
5064,
62,
49215,
4339,
62,
12564,
4462,
34,
7112,
13246,
764,
198,
24326,
2665,
13,
628,
220,
38491,
327,
62,
27082,
2390,
16,
62,
2937,
11879,
2099,
19269,
2751,
1988,
705,
45346,
3064,
21,
6,
22492,
15285,
62,
32541,
13,
198,
220,
38491,
327,
62,
27082,
2390,
17,
62,
2937,
11879,
2099,
19269,
2751,
1988,
705,
3064,
830,
6,
22492,
15285,
62,
32541,
13,
198,
220,
38491,
327,
62,
27082,
2390,
18,
62,
2937,
11879,
2099,
19269,
2751,
1988,
705,
3398,
15567,
1961,
6,
22492,
15285,
62,
32541,
13,
198,
19734,
2665,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
49215,
4339,
62,
49302,
62,
33249,
3697,
3913,
62,
20114,
3525,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
76,
80,
7012,
62,
7266,
1416,
24735,
93,
14681,
13,
198,
198,
9,
40103,
1957,
1366,
290,
34749,
198,
220,
220,
220,
42865,
25,
300,
85,
62,
26801,
4906,
220,
220,
41876,
1509,
78,
62,
26801,
28004,
13,
198,
220,
220,
220,
42865,
25,
300,
85,
62,
26801,
2539,
220,
220,
220,
41876,
1509,
78,
62,
4906,
312,
13,
198,
220,
220,
220,
42865,
25,
300,
85,
62,
15596,
220,
220,
220,
220,
41876,
1509,
78,
62,
15596,
13,
198,
220,
220,
220,
42865,
25,
300,
85,
62,
1990,
83,
312,
220,
220,
220,
220,
41876,
3490,
62,
1990,
83,
312,
13,
198,
220,
220,
220,
42865,
25,
300,
85,
62,
9127,
220,
220,
220,
220,
41876,
3490,
62,
1990,
83,
312,
13,
628,
220,
220,
220,
23449,
8881,
651,
62,
11250,
13,
198,
220,
220,
220,
220,
220,
1222,
16,
796,
7102,
53,
1222,
17,
7,
318,
62,
22866,
12,
7266,
62,
529,
62,
37581,
12,
5,
18,
6739,
198,
220,
220,
220,
220,
220,
16876,
318,
62,
22866,
12,
7266,
62,
37581,
12,
5,
18,
3180,
5626,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1222,
16,
796,
318,
62,
22866,
12,
7266,
62,
37581,
12,
5,
18,
13,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
12,
19238,
12,
7206,
20032,
17941,
13,
628,
198,
9,
40103,
2315,
198,
220,
220,
220,
374,
85,
62,
19662,
62,
4906,
796,
705,
55,
4458,
628,
198,
9,
40103,
5772,
352,
4613,
26181,
4906,
198,
220,
220,
220,
651,
62,
11250,
300,
85,
62,
26801,
4906,
4731,
5772,
16,
13,
198,
220,
220,
220,
16876,
300,
85,
62,
26801,
4906,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
19662,
62,
4906,
796,
705,
32,
4458,
220,
366,
2642,
4566,
11,
645,
15765,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
198,
9,
40103,
5772,
362,
4613,
26181,
2539,
198,
220,
220,
220,
651,
62,
11250,
300,
85,
62,
26801,
2539,
4731,
5772,
17,
13,
198,
220,
220,
220,
16876,
300,
85,
62,
26801,
2539,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
19662,
62,
4906,
796,
705,
32,
4458,
220,
366,
2642,
4566,
11,
645,
15765,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
198,
9,
40103,
5772,
513,
4613,
1785,
198,
220,
220,
220,
651,
62,
11250,
300,
85,
62,
15596,
4731,
5772,
18,
13,
198,
220,
220,
220,
16876,
300,
85,
62,
15596,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
19662,
62,
4906,
796,
705,
32,
4458,
220,
366,
2642,
4566,
11,
645,
15765,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
198,
9,
40103,
869,
30798,
40391,
198,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
50,
8845,
62,
20114,
3525,
62,
43387,
6158,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
26181,
4906,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
26801,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
26181,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
26801,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
1785,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
15596,
198,
9,
220,
220,
220,
220,
220,
220,
29244,
25633,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
705,
198,
9,
220,
220,
220,
220,
220,
220,
21664,
7336,
62,
33249,
2043,
3620,
62,
2200,
10917,
1546,
5781,
220,
220,
220,
220,
220,
220,
796,
705,
705,
198,
9,
220,
220,
220,
220,
220,
220,
33303,
62,
54,
10554,
62,
35,
3698,
4792,
220,
796,
705,
705,
198,
9,
220,
220,
220,
220,
220,
220,
33303,
62,
2200,
22495,
33,
62,
23060,
45,
37846,
1340,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
705,
198,
9,
220,
220,
220,
220,
220,
220,
8005,
62,
9858,
36393,
62,
13775,
62,
48,
8924,
8924,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
705,
198,
9,
220,
220,
220,
220,
220,
220,
16959,
62,
38948,
220,
220,
220,
220,
220,
220,
220,
796,
705,
705,
198,
9,
220,
220,
220,
220,
220,
220,
8005,
62,
25294,
38,
2751,
220,
220,
220,
220,
220,
220,
220,
796,
705,
705,
198,
9,
220,
220,
220,
220,
220,
220,
4522,
3525,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1785,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
1990,
83,
312,
198,
220,
220,
220,
220,
220,
220,
220,
9733,
62,
9127,
220,
220,
220,
796,
300,
85,
62,
9127,
198,
9,
220,
220,
220,
220,
309,
6242,
28378,
198,
9,
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,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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
] |
CLASS zcl_abapgit_background DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
TYPES: BEGIN OF ty_methods,
class TYPE seoclsname,
description TYPE string,
END OF ty_methods.
TYPES: ty_methods_tt TYPE SORTED TABLE OF ty_methods WITH UNIQUE KEY class.
CLASS-METHODS run
RAISING
zcx_abapgit_exception .
CLASS-METHODS list_methods
RETURNING VALUE(rt_methods) TYPE ty_methods_tt.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_ABAPGIT_BACKGROUND IMPLEMENTATION.
METHOD list_methods.
DATA: ls_method LIKE LINE OF rt_methods,
ls_key TYPE seoclskey,
lt_implementing TYPE seor_implementing_keys,
ls_implementing LIKE LINE OF lt_implementing.
FIELD-SYMBOLS: <ls_method> LIKE LINE OF rt_methods.
* in order to handle local classes in the compiled report
ls_method-class = 'ZCL_ABAPGIT_BACKGROUND_PULL'.
INSERT ls_method INTO TABLE rt_methods.
ls_method-class = 'ZCL_ABAPGIT_BACKGROUND_PUSH_AU'.
INSERT ls_method INTO TABLE rt_methods.
ls_method-class = 'ZCL_ABAPGIT_BACKGROUND_PUSH_FI'.
INSERT ls_method INTO TABLE rt_methods.
ls_key-clsname = 'ZIF_ABAPGIT_BACKGROUND'.
CALL FUNCTION 'SEO_INTERFACE_IMPLEM_GET_ALL'
EXPORTING
intkey = ls_key
IMPORTING
impkeys = lt_implementing
EXCEPTIONS
not_existing = 1
OTHERS = 2 ##FM_SUBRC_OK.
LOOP AT lt_implementing INTO ls_implementing.
ls_method-class = ls_implementing-clsname.
INSERT ls_method INTO TABLE rt_methods.
ENDLOOP.
LOOP AT rt_methods ASSIGNING <ls_method>.
CALL METHOD (<ls_method>-class)=>zif_abapgit_background~get_description
RECEIVING
rv_description = <ls_method>-description.
ENDLOOP.
ENDMETHOD.
METHOD run.
CONSTANTS: lc_enq_type TYPE c LENGTH 12 VALUE 'BACKGROUND'.
DATA: lo_per TYPE REF TO zcl_abapgit_persist_background,
lo_repo TYPE REF TO zcl_abapgit_repo_online,
lt_list TYPE zcl_abapgit_persist_background=>tt_background,
li_background TYPE REF TO zif_abapgit_background,
lo_log TYPE REF TO zcl_abapgit_log,
lv_repo_name TYPE string.
FIELD-SYMBOLS: <ls_list> LIKE LINE OF lt_list.
CALL FUNCTION 'ENQUEUE_EZABAPGIT'
EXPORTING
mode_zabapgit = 'E'
type = lc_enq_type
_scope = '3'
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE: / 'Another intance of the program is already running' ##NO_TEXT.
RETURN.
ENDIF.
CREATE OBJECT lo_per.
lt_list = lo_per->list( ).
WRITE: / 'Background mode' ##NO_TEXT.
LOOP AT lt_list ASSIGNING <ls_list>.
lo_repo ?= zcl_abapgit_repo_srv=>get_instance( )->get( <ls_list>-key ).
lv_repo_name = lo_repo->get_name( ).
WRITE: / <ls_list>-method, lv_repo_name.
zcl_abapgit_login_manager=>set(
iv_uri = lo_repo->get_url( )
iv_username = <ls_list>-username
iv_password = <ls_list>-password ).
CREATE OBJECT lo_log.
CREATE OBJECT li_background TYPE (<ls_list>-method).
li_background->run(
io_repo = lo_repo
io_log = lo_log
it_settings = <ls_list>-settings ).
lo_log->write( ).
ENDLOOP.
IF lines( lt_list ) = 0.
WRITE: / 'Nothing configured' ##NO_TEXT.
ENDIF.
CALL FUNCTION 'DEQUEUE_EZABAPGIT'
EXPORTING
type = lc_enq_type.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
25249,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
24396,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1398,
220,
220,
220,
220,
220,
220,
41876,
384,
420,
7278,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6764,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
24396,
82,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
1259,
62,
24396,
82,
62,
926,
41876,
311,
9863,
1961,
43679,
3963,
1259,
62,
24396,
82,
13315,
4725,
33866,
8924,
35374,
1398,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
1057,
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,
1351,
62,
24396,
82,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
24396,
82,
8,
41876,
1259,
62,
24396,
82,
62,
926,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
31098,
46025,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1351,
62,
24396,
82,
13,
628,
220,
220,
220,
42865,
25,
43979,
62,
24396,
220,
220,
220,
220,
220,
220,
34178,
48920,
3963,
374,
83,
62,
24396,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
384,
420,
7278,
2539,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
320,
26908,
278,
41876,
384,
273,
62,
320,
26908,
278,
62,
13083,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
320,
26908,
278,
34178,
48920,
3963,
300,
83,
62,
320,
26908,
278,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
24396,
29,
34178,
48920,
3963,
374,
83,
62,
24396,
82,
13,
628,
198,
9,
287,
1502,
284,
5412,
1957,
6097,
287,
262,
14102,
989,
198,
220,
220,
220,
43979,
62,
24396,
12,
4871,
796,
705,
57,
5097,
62,
6242,
2969,
38,
2043,
62,
31098,
46025,
62,
5105,
3069,
4458,
198,
220,
220,
220,
29194,
17395,
43979,
62,
24396,
39319,
43679,
374,
83,
62,
24396,
82,
13,
198,
220,
220,
220,
43979,
62,
24396,
12,
4871,
796,
705,
57,
5097,
62,
6242,
2969,
38,
2043,
62,
31098,
46025,
62,
47,
27143,
62,
26830,
4458,
198,
220,
220,
220,
29194,
17395,
43979,
62,
24396,
39319,
43679,
374,
83,
62,
24396,
82,
13,
198,
220,
220,
220,
43979,
62,
24396,
12,
4871,
796,
705,
57,
5097,
62,
6242,
2969,
38,
2043,
62,
31098,
46025,
62,
47,
27143,
62,
11674,
4458,
198,
220,
220,
220,
29194,
17395,
43979,
62,
24396,
39319,
43679,
374,
83,
62,
24396,
82,
13,
628,
220,
220,
220,
43979,
62,
2539,
12,
565,
82,
3672,
796,
705,
57,
5064,
62,
6242,
2969,
38,
2043,
62,
31098,
46025,
4458,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
50,
4720,
62,
41358,
49836,
62,
3955,
16437,
44,
62,
18851,
62,
7036,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
493,
2539,
220,
220,
220,
220,
220,
220,
796,
43979,
62,
2539,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
848,
13083,
220,
220,
220,
220,
220,
796,
300,
83,
62,
320,
26908,
278,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
407,
62,
25687,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
796,
362,
22492,
23264,
62,
50,
10526,
7397,
62,
11380,
13,
198,
220,
220,
220,
17579,
3185,
5161,
300,
83,
62,
320,
26908,
278,
39319,
43979,
62,
320,
26908,
278,
13,
198,
220,
220,
220,
220,
220,
43979,
62,
24396,
12,
4871,
796,
43979,
62,
320,
26908,
278,
12,
565,
82,
3672,
13,
198,
220,
220,
220,
220,
220,
29194,
17395,
43979,
62,
24396,
39319,
43679,
374,
83,
62,
24396,
82,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
17579,
3185,
5161,
374,
83,
62,
24396,
82,
24994,
3528,
15871,
1279,
7278,
62,
24396,
28401,
198,
220,
220,
220,
220,
220,
42815,
337,
36252,
38155,
7278,
62,
24396,
29,
12,
4871,
8,
14804,
89,
361,
62,
397,
499,
18300,
62,
25249,
93,
1136,
62,
11213,
198,
220,
220,
220,
220,
220,
220,
220,
19644,
36,
3824,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
85,
62,
11213,
796,
1279,
7278,
62,
24396,
29,
12,
11213,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1057,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
300,
66,
62,
268,
80,
62,
4906,
41876,
269,
406,
49494,
1105,
26173,
8924,
705,
31098,
46025,
4458,
628,
220,
220,
220,
42865,
25,
2376,
62,
525,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
19276,
396,
62,
25249,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
260,
7501,
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,
300,
83,
62,
4868,
220,
220,
220,
220,
220,
220,
41876,
1976,
565,
62,
397,
499,
18300,
62,
19276,
396,
62,
25249,
14804,
926,
62,
25249,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7649,
62,
25249,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
25249,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
6404,
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,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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
] |
* See https://github.com/se38/abapFaker
********************************************************************************
* The MIT License (MIT)
*
* Copyright (c) 2018 abapFaker Contributors
*
* 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.
********************************************************************************
CLASS zcl_faker_generator DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
CONSTANTS __locale_default TYPE string VALUE 'DEFAULT'.
CLASS-METHODS create
IMPORTING i_type TYPE string
i_locale TYPE string
i_faker TYPE REF TO zcl_faker
RETURNING VALUE(r_result) TYPE REF TO zcl_faker_provider.
ENDCLASS.
CLASS zcl_faker_generator IMPLEMENTATION.
METHOD create.
DATA(class_name) = |ZCL_FAKER_{ i_type }_{ i_locale CASE = UPPER }|.
TRY.
CREATE OBJECT r_result TYPE (class_name)
EXPORTING i_faker = i_faker.
CATCH cx_sy_create_object_error.
class_name = |ZCL_FAKER_{ i_type }_{ __locale_default CASE = UPPER }|.
CREATE OBJECT r_result TYPE (class_name)
EXPORTING i_faker = i_faker.
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
9,
4091,
3740,
1378,
12567,
13,
785,
14,
325,
2548,
14,
397,
499,
37,
3110,
198,
198,
17174,
17174,
8412,
198,
9,
383,
17168,
13789,
357,
36393,
8,
198,
9,
198,
9,
15069,
357,
66,
8,
2864,
450,
499,
37,
3110,
25767,
669,
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,
31631,
1976,
565,
62,
69,
3110,
62,
8612,
1352,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
11593,
17946,
1000,
62,
12286,
41876,
4731,
26173,
8924,
705,
7206,
38865,
4458,
628,
220,
220,
220,
42715,
12,
49273,
50,
2251,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
1312,
62,
4906,
220,
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,
1312,
62,
17946,
1000,
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,
1312,
62,
69,
3110,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
69,
3110,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
69,
3110,
62,
15234,
1304,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
69,
3110,
62,
8612,
1352,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
2251,
13,
198,
220,
220,
220,
42865,
7,
4871,
62,
3672,
8,
796,
930,
57,
5097,
62,
7708,
42839,
23330,
1312,
62,
4906,
1782,
23330,
1312,
62,
17946,
1000,
42001,
796,
471,
10246,
1137,
1782,
91,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
374,
62,
20274,
41876,
357,
4871,
62,
3672,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
1312,
62,
69,
3110,
796,
1312,
62,
69,
3110,
13,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
1837,
62,
17953,
62,
15252,
62,
18224,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1398,
62,
3672,
796,
930,
57,
5097,
62,
7708,
42839,
23330,
1312,
62,
4906,
1782,
23330,
11593,
17946,
1000,
62,
12286,
42001,
796,
471,
10246,
1137,
1782,
91,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
374,
62,
20274,
41876,
357,
4871,
62,
3672,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,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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
] |
CLASS ltcl_time_test DEFINITION FINAL
FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS get_unix FOR TESTING RAISING cx_static_check.
METHODS get_utc FOR TESTING.
ENDCLASS.
CLASS ltcl_time_test IMPLEMENTATION.
METHOD get_unix.
DATA: lv_unix TYPE zcl_abapgit_time=>ty_unixtime,
lv_tz TYPE tznzone,
lv_utcdiff TYPE tznutcdiff,
lv_utcsign TYPE tznutcsign.
CALL FUNCTION 'TZON_GET_OS_TIMEZONE'
IMPORTING
ef_timezone = lv_tz.
CALL FUNCTION 'TZON_GET_OFFSET'
EXPORTING
if_timezone = lv_tz
if_local_date = sy-datum
if_local_time = sy-uzeit
IMPORTING
ef_utcdiff = lv_utcdiff
ef_utcsign = lv_utcsign
EXCEPTIONS
conversion_error = 1
OTHERS = 2.
lv_unix = '1574605521'.
lv_unix+11 = lv_utcsign.
lv_unix+12 = lv_utcdiff.
cl_abap_unit_assert=>assert_equals(
act = zcl_abapgit_time=>get_unix( iv_date = '20191124'
iv_time = '152521' )
exp = lv_unix ). " User-specific test!
ENDMETHOD.
METHOD get_utc.
DATA: lv_date TYPE sydatum,
lv_time TYPE syuzeit,
lv_tz TYPE tznzone,
lv_utcdiff TYPE tznutcdiff,
lv_utcsign TYPE tznutcsign.
CALL FUNCTION 'TZON_GET_OS_TIMEZONE'
IMPORTING
ef_timezone = lv_tz.
CALL FUNCTION 'TZON_GET_OFFSET'
EXPORTING
if_timezone = lv_tz
if_local_date = sy-datum
if_local_time = sy-uzeit
IMPORTING
ef_utcdiff = lv_utcdiff
ef_utcsign = lv_utcsign
EXCEPTIONS
conversion_error = 1
OTHERS = 2.
zcl_abapgit_time=>get_utc( EXPORTING iv_unix = '1574605521'
IMPORTING ev_date = lv_date
ev_time = lv_time ).
cl_abap_unit_assert=>assert_equals(
act = lv_date
exp = '20191124' ).
CASE lv_utcsign.
WHEN '+'.
lv_time = lv_time + lv_utcdiff.
WHEN '-'.
lv_time = lv_time - lv_utcdiff.
ENDCASE.
cl_abap_unit_assert=>assert_equals(
act = lv_time
exp = '152521' ). " This is GMT +1. Please provide the expected value by your timezone!
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
83,
565,
62,
2435,
62,
9288,
5550,
20032,
17941,
25261,
198,
220,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
403,
844,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
315,
66,
7473,
43001,
2751,
13,
198,
10619,
31631,
13,
628,
198,
31631,
300,
83,
565,
62,
2435,
62,
9288,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
651,
62,
403,
844,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
403,
844,
220,
220,
220,
41876,
1976,
565,
62,
397,
499,
18300,
62,
2435,
14804,
774,
62,
403,
6346,
524,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
22877,
220,
220,
220,
220,
220,
41876,
256,
47347,
11340,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
315,
10210,
733,
41876,
256,
89,
14930,
10210,
733,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
315,
6359,
570,
41876,
256,
89,
14930,
6359,
570,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
51,
57,
1340,
62,
18851,
62,
2640,
62,
34694,
57,
11651,
6,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
304,
69,
62,
2435,
11340,
796,
300,
85,
62,
22877,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
51,
57,
1340,
62,
18851,
62,
27977,
28480,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
611,
62,
2435,
11340,
220,
220,
220,
220,
220,
796,
300,
85,
62,
22877,
198,
220,
220,
220,
220,
220,
220,
220,
611,
62,
12001,
62,
4475,
220,
220,
220,
796,
827,
12,
19608,
388,
198,
220,
220,
220,
220,
220,
220,
220,
611,
62,
12001,
62,
2435,
220,
220,
220,
796,
827,
12,
84,
2736,
270,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
304,
69,
62,
315,
10210,
733,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
315,
10210,
733,
198,
220,
220,
220,
220,
220,
220,
220,
304,
69,
62,
315,
6359,
570,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
315,
6359,
570,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
11315,
62,
18224,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
362,
13,
628,
220,
220,
220,
300,
85,
62,
403,
844,
796,
705,
1314,
4524,
1899,
2816,
2481,
4458,
198,
220,
220,
220,
300,
85,
62,
403,
844,
10,
1157,
796,
300,
85,
62,
315,
6359,
570,
13,
198,
220,
220,
220,
300,
85,
62,
403,
844,
10,
1065,
796,
300,
85,
62,
315,
10210,
733,
13,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
719,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
1976,
565,
62,
397,
499,
18300,
62,
2435,
14804,
1136,
62,
403,
844,
7,
21628,
62,
4475,
796,
705,
1264,
6420,
17464,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
2435,
796,
705,
1314,
1495,
2481,
6,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1033,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
403,
844,
6739,
366,
11787,
12,
11423,
1332,
0,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
315,
66,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
4475,
220,
220,
220,
41876,
827,
19608,
388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
2435,
220,
220,
220,
41876,
827,
84,
2736,
270,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
22877,
220,
220,
220,
220,
220,
41876,
256,
47347,
11340,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
315,
10210,
733,
41876,
256,
89,
14930,
10210,
733,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
315,
6359,
570,
41876,
256,
89,
14930,
6359,
570,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
51,
57,
1340,
62,
18851,
62,
2640,
62,
34694,
57,
11651,
6,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
304,
69,
62,
2435,
11340,
796,
300,
85,
62,
22877,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
51,
57,
1340,
62,
18851,
62,
27977,
28480,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
611,
62,
2435,
11340,
220,
220,
220,
220,
220,
796,
300,
85,
62,
22877,
198,
220,
220,
220,
220,
220,
220,
220,
611,
62,
12001,
62,
4475,
220,
220,
220,
796,
827,
12,
19608,
388,
198,
220,
220,
220,
220,
220,
220,
220,
611,
62,
12001,
62,
2435,
220,
220,
220,
796,
827,
12,
84,
2736,
270,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
304,
69,
62,
315,
10210,
733,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
315,
10210,
733,
198,
220,
220,
220,
220,
220,
220,
220,
304,
69,
62,
315,
6359,
570,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
315,
6359,
570,
198,
220,
220,
220,
220,
220,
7788
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_background_push_au DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_background .
PROTECTED SECTION.
DATA mi_log TYPE REF TO zif_abapgit_log .
METHODS build_comment
IMPORTING
!is_files TYPE zif_abapgit_definitions=>ty_stage_files
RETURNING
VALUE(rv_comment) TYPE string .
METHODS push_auto
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo_online
RAISING
zcx_abapgit_exception .
METHODS determine_user_details
IMPORTING
!iv_changed_by TYPE xubname
RETURNING
VALUE(rs_user) TYPE zif_abapgit_definitions=>ty_git_user .
METHODS push_deletions
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo_online
!is_files TYPE zif_abapgit_definitions=>ty_stage_files
RAISING
zcx_abapgit_exception .
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_abapgit_background_push_au IMPLEMENTATION.
METHOD build_comment.
DATA: lt_objects TYPE STANDARD TABLE OF string WITH DEFAULT KEY,
lv_str TYPE string.
FIELD-SYMBOLS: <ls_local> LIKE LINE OF is_files-local.
LOOP AT is_files-local ASSIGNING <ls_local>.
lv_str = |{ <ls_local>-item-obj_type } { <ls_local>-item-obj_name }|.
APPEND lv_str TO lt_objects.
ENDLOOP.
SORT lt_objects AS TEXT.
DELETE ADJACENT DUPLICATES FROM lt_objects.
IF lines( lt_objects ) = 1.
rv_comment = |BG: { lv_str }|.
ELSE.
rv_comment = 'BG: Multiple objects'.
LOOP AT lt_objects INTO lv_str.
CONCATENATE rv_comment zif_abapgit_definitions=>c_newline lv_str INTO rv_comment.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD determine_user_details.
DATA: lo_user_record TYPE REF TO zcl_abapgit_user_record.
lo_user_record = zcl_abapgit_user_record=>get_instance( iv_changed_by ).
rs_user-name = lo_user_record->get_name( ).
rs_user-email = lo_user_record->get_email( ).
* If no email, fall back to localhost/default email
IF rs_user-email IS INITIAL.
rs_user-email = |{ iv_changed_by }@localhost|.
ENDIF.
* If no full name maintained, just use changed by user name
IF rs_user-name IS INITIAL.
rs_user-name = iv_changed_by.
ENDIF.
ENDMETHOD.
METHOD push_auto.
TYPES: BEGIN OF ty_changed,
filename TYPE string,
path TYPE string,
changed_by TYPE xubname,
END OF ty_changed.
DATA: ls_comment TYPE zif_abapgit_definitions=>ty_comment,
ls_files TYPE zif_abapgit_definitions=>ty_stage_files,
lt_changed TYPE STANDARD TABLE OF ty_changed WITH DEFAULT KEY,
lt_users TYPE STANDARD TABLE OF xubname WITH DEFAULT KEY,
ls_user_files LIKE ls_files,
lv_changed_by LIKE LINE OF lt_users,
lo_stage TYPE REF TO zcl_abapgit_stage.
FIELD-SYMBOLS: <ls_changed> LIKE LINE OF lt_changed,
<ls_remote> LIKE LINE OF ls_files-remote,
<ls_local> LIKE LINE OF ls_files-local.
ls_files = zcl_abapgit_factory=>get_stage_logic( )->get( io_repo ).
LOOP AT ls_files-local ASSIGNING <ls_local>.
lv_changed_by = zcl_abapgit_objects=>changed_by( <ls_local>-item ).
APPEND lv_changed_by TO lt_users.
APPEND INITIAL LINE TO lt_changed ASSIGNING <ls_changed>.
<ls_changed>-changed_by = lv_changed_by.
<ls_changed>-filename = <ls_local>-file-filename.
<ls_changed>-path = <ls_local>-file-path.
ENDLOOP.
SORT lt_users ASCENDING.
DELETE ADJACENT DUPLICATES FROM lt_users.
LOOP AT lt_users INTO lv_changed_by.
CLEAR: ls_comment.
* Fill user details
ls_comment-committer = determine_user_details( lv_changed_by ).
lo_stage = NEW #( ).
CLEAR ls_user_files.
LOOP AT ls_files-local ASSIGNING <ls_local>.
READ TABLE lt_changed WITH KEY
path = <ls_local>-file-path
filename = <ls_local>-file-filename
changed_by = lv_changed_by
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
mi_log->add_info( |stage: {
ls_comment-committer-name } {
<ls_local>-file-path } {
<ls_local>-file-filename }| ).
lo_stage->add( iv_path = <ls_local>-file-path
iv_filename = <ls_local>-file-filename
iv_data = <ls_local>-file-data ).
APPEND <ls_local> TO ls_user_files-local.
LOOP AT ls_files-remote ASSIGNING <ls_remote>
USING KEY file
WHERE filename = <ls_local>-file-filename
AND path <> <ls_local>-file-path
AND filename <> 'package.devc.xml'.
mi_log->add_info( |rm: { <ls_remote>-path } { <ls_remote>-filename }| ).
* rm old file when object has moved
lo_stage->rm(
iv_path = <ls_remote>-path
iv_filename = <ls_remote>-filename ).
EXIT. " assumption: only one file
ENDLOOP.
ENDIF.
ENDLOOP.
ls_comment-comment = build_comment( ls_user_files ).
io_repo->push( is_comment = ls_comment
io_stage = lo_stage ).
ENDLOOP.
IF lines( ls_files-remote ) > 0.
push_deletions( io_repo = io_repo
is_files = ls_files ).
ENDIF.
ENDMETHOD.
METHOD push_deletions.
DATA: lo_stage TYPE REF TO zcl_abapgit_stage,
ls_comment TYPE zif_abapgit_definitions=>ty_comment.
FIELD-SYMBOLS: <ls_remote> LIKE LINE OF is_files-remote.
ASSERT lines( is_files-remote ) > 0.
lo_stage = NEW #( ).
ls_comment-comment = 'BG: Deletion'.
LOOP AT is_files-remote ASSIGNING <ls_remote>.
mi_log->add_info( |removed: { <ls_remote>-path } { <ls_remote>-filename }| ).
lo_stage->rm( iv_path = <ls_remote>-path
iv_filename = <ls_remote>-filename ).
CONCATENATE ls_comment-comment zif_abapgit_definitions=>c_newline <ls_remote>-filename
INTO ls_comment-comment.
ENDLOOP.
ls_comment-committer-name = 'Deletion'.
ls_comment-committer-email = 'deletion@localhost'.
io_repo->push( is_comment = ls_comment
io_stage = lo_stage ).
ENDMETHOD.
METHOD zif_abapgit_background~get_description.
rv_description = 'Automatic push, auto author'.
ENDMETHOD.
METHOD zif_abapgit_background~get_settings.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_background~run.
DATA: ls_files TYPE zif_abapgit_definitions=>ty_stage_files.
mi_log = ii_log.
ls_files = zcl_abapgit_factory=>get_stage_logic( )->get( io_repo ).
IF lines( ls_files-local ) = 0 AND lines( ls_files-remote ) = 0.
ii_log->add_info( 'Nothing to stage' ).
RETURN.
ENDIF.
push_auto( io_repo ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
25249,
62,
14689,
62,
559,
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,
25249,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
42865,
21504,
62,
6404,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
764,
628,
220,
220,
220,
337,
36252,
50,
1382,
62,
23893,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
16624,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
14247,
62,
16624,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
23893,
8,
41876,
4731,
764,
198,
220,
220,
220,
337,
36252,
50,
4574,
62,
23736,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
260,
7501,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
5004,
62,
7220,
62,
36604,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
40985,
62,
1525,
41876,
2124,
549,
3672,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
7220,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
18300,
62,
7220,
764,
198,
220,
220,
220,
337,
36252,
50,
4574,
62,
2934,
1616,
507,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
260,
7501,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
16624,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
14247,
62,
16624,
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,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
25249,
62,
14689,
62,
559,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1382,
62,
23893,
13,
628,
220,
220,
220,
42865,
25,
300,
83,
62,
48205,
41876,
49053,
9795,
43679,
3963,
4731,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
2536,
220,
220,
220,
220,
41876,
4731,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
12001,
29,
34178,
48920,
3963,
318,
62,
16624,
12,
12001,
13,
628,
198,
220,
220,
220,
17579,
3185,
5161,
318,
62,
16624,
12,
12001,
24994,
3528,
15871,
1279,
7278,
62,
12001,
28401,
198,
220,
220,
220,
220,
220,
300,
85,
62,
2536,
796,
930,
90,
1279,
7278,
62,
12001,
29,
12,
9186,
12,
26801,
62,
4906,
1782,
1391,
1279,
7278,
62,
12001,
29,
12,
9186,
12,
26801,
62,
3672,
1782,
91,
13,
198,
220,
220,
220,
220,
220,
43504,
10619,
300,
85,
62,
2536,
5390,
300,
83,
62,
48205,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
311,
9863,
300,
83,
62,
48205,
7054,
40383,
13,
198,
220,
220,
220,
5550,
2538,
9328,
5984,
41,
2246,
3525,
35480,
31484,
29462,
16034,
300,
83,
62,
48205,
13,
628,
220,
220,
220,
16876,
3951,
7,
300,
83,
62,
48205,
1267,
796,
352,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
23893,
796,
930,
40469,
25,
1391,
300,
85,
62,
2536,
1782,
91,
13,
198,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
23893,
796,
705,
40469,
25,
20401,
5563,
4458,
198,
220,
220,
220,
220,
220,
17579,
3185,
5161,
300,
83,
62,
48205,
39319,
300,
85,
62,
2536,
13,
198,
220,
220,
220,
220,
220,
220,
220,
39962,
1404,
1677,
6158,
374,
85,
62,
23893,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
66,
62,
3605,
1370,
300,
85,
62,
2536,
39319,
374,
85,
62,
23893,
13,
198,
220,
220,
220,
220,
220,
23578,
21982,
3185,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
5004,
62,
7220,
62,
36604,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
7220,
62,
22105,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
7220,
62,
22105,
13,
628,
198,
220,
220,
220,
2376,
62,
7220,
62,
22105,
796,
1976,
565,
62,
397,
499,
18300,
62,
7220,
62,
22105,
14804,
1136,
62,
39098,
7,
21628,
62,
40985,
62,
1525,
6739,
198,
220,
220,
220,
44608,
62,
7220,
12,
3672,
796,
2376,
62,
7220,
62,
22105,
3784,
1136,
62,
3672,
7,
6739,
198,
220,
220,
220,
44608,
62,
7220,
12,
12888,
796,
2376,
62,
7220,
62,
22105,
3784,
1136,
62,
12888,
7,
6739,
198,
198,
9,
220,
220,
1002,
645,
3053,
11,
2121,
736,
284,
1957,
4774,
14,
12286,
3053,
198,
220,
220,
220,
16876,
44608,
62,
7220,
12,
12888,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
44608,
62,
7220,
12,
12888,
796,
930,
90,
21628,
62,
40985,
62,
1525,
1782,
31,
36750,
91,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
198,
9,
220,
220,
1002,
645,
1336,
1438,
9456,
11,
655,
779,
3421,
416,
2836,
1438,
198,
220,
220,
220,
16876,
44608,
62,
7220,
12,
3672,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
44608,
62,
7220,
12,
3672,
220,
796,
21628,
62,
40985,
62,
1525,
13,
198,
220,
220,
220,
23578,
5064
] | [
1,
1,
1,
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POOL ZMONSTER_GOLF_SCORES. "MESSAGE-ID ..
* INCLUDE LZMONSTER_GOLF_SCORESD... " Local class definition
| [
42296,
4177,
2849,
12,
16402,
3535,
1168,
27857,
41809,
62,
38,
3535,
37,
62,
6173,
1581,
1546,
13,
220,
220,
220,
220,
220,
220,
220,
220,
366,
44,
1546,
4090,
8264,
12,
2389,
11485,
198,
198,
9,
3268,
5097,
52,
7206,
406,
57,
27857,
41809,
62,
38,
3535,
37,
62,
6173,
1581,
1546,
35,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
10714,
1398,
6770,
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
] |
CLASS zcl_abapgit_object_enho_wdyc DEFINITION PUBLIC.
PUBLIC SECTION.
METHODS: constructor
IMPORTING
is_item TYPE zif_abapgit_definitions=>ty_item
io_files TYPE REF TO zcl_abapgit_objects_files.
INTERFACES: zif_abapgit_object_enho.
PRIVATE SECTION.
DATA: ms_item TYPE zif_abapgit_definitions=>ty_item.
ENDCLASS.
CLASS zcl_abapgit_object_enho_wdyc IMPLEMENTATION.
METHOD constructor.
ms_item = is_item.
ENDMETHOD. "constructor
METHOD zif_abapgit_object_enho~deserialize.
DATA: lv_enhname TYPE enhname,
lo_wdyconf TYPE REF TO cl_wdr_cfg_enhancement,
li_tool TYPE REF TO if_enh_tool,
ls_obj TYPE wdy_config_key,
lv_package TYPE devclass.
io_xml->read( EXPORTING iv_name = 'ORIGINAL_OBJECT'
CHANGING cg_data = ls_obj ).
lv_enhname = ms_item-obj_name.
lv_package = iv_package.
TRY.
cl_enh_factory=>create_enhancement(
EXPORTING
enhname = lv_enhname
enhtype = ''
enhtooltype = cl_wdr_cfg_enhancement=>tooltype
IMPORTING
enhancement = li_tool
CHANGING
devclass = lv_package ).
lo_wdyconf ?= li_tool.
* todo
* io_xml->read_xml()
* CL_WDR_CFG_PERSISTENCE_UTILS=>COMP_XML_TO_TABLES( )
* lo_wdyconf->set_enhancement_data( )
ASSERT 0 = 1.
lo_wdyconf->if_enh_object~save( ).
lo_wdyconf->if_enh_object~unlock( ).
CATCH cx_enh_root.
zcx_abapgit_exception=>raise( 'error deserializing ENHO wdyconf' ).
ENDTRY.
ENDMETHOD. "zif_abapgit_object_enho~deserialize
METHOD zif_abapgit_object_enho~serialize.
DATA: lo_wdyconf TYPE REF TO cl_wdr_cfg_enhancement,
lt_data TYPE wdy_cfg_expl_data_tab,
ls_outline TYPE wdy_cfg_outline_data,
ls_obj TYPE wdy_config_key,
li_document TYPE REF TO if_ixml_document,
li_element TYPE REF TO if_ixml_element.
lo_wdyconf ?= ii_enh_tool.
ls_obj = lo_wdyconf->get_original_object( ).
io_xml->add( iv_name = 'TOOL'
ig_data = ii_enh_tool->get_tool( ) ).
io_xml->add( iv_name = 'ORIGINAL_OBJECT'
ig_data = ls_obj ).
* only works on new ABAP versions, parameters differ between versions
CALL METHOD lo_wdyconf->('GET_ENHANCEMENT_DATA')
EXPORTING
p_scope = 1
IMPORTING
p_enh_data = lt_data.
CALL METHOD cl_wdr_cfg_persistence_utils=>('COMP_TABLES_TO_XML')
EXPORTING
outline_data = ls_outline
expl_data_tab = lt_data
IMPORTING
element = li_element
CHANGING
document = li_document.
io_xml->add_xml( iv_name = 'ENHANCEMENT_DATA'
ii_xml = li_element ).
ENDMETHOD. "zif_abapgit_object_enho~serialize
ENDCLASS. "zcl_abapgit_object_enho_wdyconf IMPLEMENTATION
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
62,
86,
9892,
66,
5550,
20032,
17941,
44731,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
318,
62,
9186,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
16624,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16624,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
25,
1976,
361,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
13845,
62,
9186,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
62,
86,
9892,
66,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
13845,
62,
9186,
796,
318,
62,
9186,
13,
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,
41571,
273,
628,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
93,
8906,
48499,
1096,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
16550,
3672,
41876,
5881,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
86,
9892,
10414,
41876,
4526,
37,
5390,
537,
62,
86,
7109,
62,
37581,
62,
16550,
590,
434,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7649,
62,
25981,
220,
220,
220,
41876,
4526,
37,
5390,
611,
62,
16550,
62,
25981,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
26801,
220,
220,
220,
220,
41876,
266,
9892,
62,
11250,
62,
2539,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
26495,
41876,
1614,
4871,
13,
628,
198,
220,
220,
220,
33245,
62,
19875,
3784,
961,
7,
7788,
15490,
2751,
21628,
62,
3672,
796,
705,
1581,
3528,
17961,
62,
9864,
23680,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
269,
70,
62,
7890,
220,
796,
43979,
62,
26801,
6739,
628,
220,
220,
220,
300,
85,
62,
16550,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
198,
220,
220,
220,
300,
85,
62,
26495,
796,
21628,
62,
26495,
13,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
537,
62,
16550,
62,
69,
9548,
14804,
17953,
62,
16550,
590,
434,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5881,
3672,
220,
220,
220,
220,
796,
300,
85,
62,
16550,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5881,
4906,
220,
220,
220,
220,
796,
10148,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
551,
4352,
970,
4906,
796,
537,
62,
86,
7109,
62,
37581,
62,
16550,
590,
434,
14804,
25981,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28554,
796,
7649,
62,
25981,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1614,
4871,
220,
220,
220,
796,
300,
85,
62,
26495,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
86,
9892,
10414,
5633,
28,
7649,
62,
25981,
13,
198,
198,
9,
284,
4598,
198,
9,
33245,
62,
19875,
3784,
961,
62,
19875,
3419,
198,
9,
7852,
62,
54,
7707,
62,
22495,
38,
62,
47,
4877,
8808,
18310,
62,
3843,
45484,
14804,
9858,
47,
62,
55,
5805,
62,
10468,
62,
5603,
9148,
1546,
7,
1267,
198,
9,
2376,
62,
86,
9892,
10414,
3784,
2617,
62,
16550,
590,
434,
62,
7890,
7,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
24994,
17395,
657,
796,
352,
13,
628,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
86,
9892,
10414,
3784,
361,
62,
16550,
62,
15252,
93,
21928,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
86,
9892,
10414,
3784,
361,
62,
16550,
62,
15252,
93,
403,
5354,
7,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
16550,
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,
18224,
748,
48499,
2890,
12964,
32298,
266,
9892,
10414,
6,
6739,
198,
220,
220,
220,
23578,
40405,
13,
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,
89,
361,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
93,
8906,
48499,
1096,
628,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
93,
46911,
1096,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
86,
9892,
10414,
220,
41876,
4526,
37,
5390,
537,
62,
86,
7109,
62,
37581,
62,
16550,
590,
434,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
7890,
220,
220,
220,
220,
41876,
266,
9892,
62,
37581,
62,
20676,
62,
7890,
62,
8658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
448,
1370,
220,
41876,
266,
9892,
62,
37581,
62,
448,
1370,
62,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
26801,
220,
220,
220,
220,
220,
41876,
266,
9892,
62,
11250,
62,
2539,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7649,
62,
22897,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
22897,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_gol_main DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor
IMPORTING
i_settings TYPE REF TO zcl_gol_settings
i_world TYPE REF TO zif_gol_world.
METHODS main
RETURNING
VALUE(new_world) TYPE REF TO zif_gol_world.
METHODS get_size
EXPORTING
e_width TYPE i
e_height TYPE i.
METHODS calc_new_state
IMPORTING
neighbours TYPE i
state TYPE zif_gol_world=>t_state
RETURNING
VALUE(r_result) TYPE zif_gol_world=>t_state.
METHODS init_with_random.
METHODS get_world
RETURNING
VALUE(r_result) TYPE REF TO zif_gol_world.
PROTECTED SECTION.
PRIVATE SECTION.
DATA:
m_max_x TYPE i,
m_max_y TYPE i,
m_world TYPE REF TO zif_gol_world.
ENDCLASS.
CLASS ZCL_GOL_MAIN IMPLEMENTATION.
METHOD calc_new_state.
CASE neighbours.
WHEN 2.
r_result = state.
WHEN 3.
r_result = abap_true.
WHEN OTHERS.
r_result = abap_false.
ENDCASE.
ENDMETHOD.
METHOD constructor.
CALL METHOD i_settings->get
IMPORTING
e_width = m_max_x
e_height = m_max_y.
m_world = i_world.
ENDMETHOD.
METHOD get_size.
e_height = m_max_y.
e_width = m_max_x.
ENDMETHOD.
METHOD get_world.
r_result = m_world.
ENDMETHOD.
METHOD init_with_random.
DATA(lr_random) = CAST if_random_number( NEW cl_random_number( ) ).
lr_random->init( ).
DATA(l_threshold) = CONV float( 1 ) / 3.
DO m_max_y TIMES.
DATA(l_y) = sy-index.
DO m_max_x TIMES.
DATA(l_x) = sy-index.
IF l_threshold < lr_random->get_random_float( ).
m_world->set_state( x = l_x y = l_y state = abap_true ).
ENDIF.
ENDDO.
ENDDO.
ENDMETHOD.
METHOD main.
new_world = m_world->clone( ).
DO m_max_x TIMES.
DATA(l_x) = sy-index.
DO m_max_y TIMES.
DATA(l_y) = sy-index.
new_world->set_state( x = l_x
y = l_y
state = calc_new_state( neighbours = m_world->get_neighbours( x = l_x y = l_y )
state = m_world->get_state( x = l_x y = l_y ) ) ).
ENDDO.
ENDDO.
m_world = new_world.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
70,
349,
62,
12417,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
33692,
41876,
4526,
37,
5390,
1976,
565,
62,
70,
349,
62,
33692,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
6894,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
70,
349,
62,
6894,
13,
198,
220,
220,
220,
337,
36252,
50,
1388,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3605,
62,
6894,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
70,
349,
62,
6894,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
7857,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
304,
62,
10394,
220,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
304,
62,
17015,
41876,
1312,
13,
198,
220,
220,
220,
337,
36252,
50,
42302,
62,
3605,
62,
5219,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
23788,
220,
220,
220,
220,
220,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
1181,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
70,
349,
62,
6894,
14804,
83,
62,
5219,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
1976,
361,
62,
70,
349,
62,
6894,
14804,
83,
62,
5219,
13,
198,
220,
220,
220,
337,
36252,
50,
2315,
62,
4480,
62,
25120,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
6894,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
70,
349,
62,
6894,
13,
198,
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,
62,
9806,
62,
87,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
285,
62,
9806,
62,
88,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
285,
62,
6894,
41876,
4526,
37,
5390,
1976,
361,
62,
70,
349,
62,
6894,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
38,
3535,
62,
5673,
1268,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
42302,
62,
3605,
62,
5219,
13,
198,
220,
220,
220,
42001,
23788,
13,
198,
220,
220,
220,
220,
220,
42099,
362,
13,
198,
220,
220,
220,
220,
220,
220,
220,
374,
62,
20274,
796,
1181,
13,
198,
220,
220,
220,
220,
220,
42099,
513,
13,
198,
220,
220,
220,
220,
220,
220,
220,
374,
62,
20274,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
42099,
440,
4221,
4877,
13,
198,
220,
220,
220,
220,
220,
220,
220,
374,
62,
20274,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
23578,
34,
11159,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
42815,
337,
36252,
1312,
62,
33692,
3784,
1136,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
304,
62,
10394,
220,
796,
285,
62,
9806,
62,
87,
198,
220,
220,
220,
220,
220,
220,
220,
304,
62,
17015,
796,
285,
62,
9806,
62,
88,
13,
198,
220,
220,
220,
285,
62,
6894,
796,
1312,
62,
6894,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
7857,
13,
198,
220,
220,
220,
304,
62,
17015,
796,
285,
62,
9806,
62,
88,
13,
198,
220,
220,
220,
304,
62,
10394,
796,
285,
62,
9806,
62,
87,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
6894,
13,
198,
220,
220,
220,
374,
62,
20274,
796,
285,
62,
6894,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
2315,
62,
4480,
62,
25120,
13,
628,
220,
220,
220,
42865,
7,
14050,
62,
25120,
8,
796,
327,
11262,
611,
62,
25120,
62,
17618,
7,
12682,
537,
62,
25120,
62,
17618,
7,
1267,
6739,
198,
220,
220,
220,
300,
81,
62,
25120,
3784,
15003,
7,
6739,
198,
220,
220,
220,
42865,
7,
75,
62,
400,
10126,
8,
796,
7102,
53,
12178,
7,
352,
1267,
1220,
513,
13,
198,
220,
220,
220,
8410,
285,
62,
9806,
62,
88,
31742,
1546,
13,
198,
220,
220,
220,
220,
220,
42865,
7,
75,
62,
88,
8,
796,
827,
12,
9630,
13,
198,
220,
220,
220,
220,
220,
8410,
285,
62,
9806,
62,
87,
31742,
1546,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
75,
62,
87,
8,
796,
827,
12,
9630,
13,
198,
220,
220,
220,
220,
220,
220,
220,
16876,
220,
300,
62,
400,
10126,
1279,
300,
81,
62,
25120,
3784,
1136,
62,
25120,
62,
22468,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
62,
6894,
3784,
2617,
62,
5219,
7,
2124,
796,
300,
62,
87,
331,
796,
300,
62,
88,
1181,
796,
450,
499,
62,
7942,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
220,
220,
23578,
18227,
13,
198,
220,
220,
220,
23578,
18227,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1388,
13,
628,
220,
220,
220,
649,
62,
6894,
796,
285,
62,
6894,
3784,
21018,
7,
6739,
198,
220,
220,
220,
8410,
285,
62,
9806,
62,
87,
31742,
1546,
13,
198,
220,
220,
220,
220,
220,
42865,
7,
75,
62,
87,
8,
796,
827,
12,
9630,
13,
198,
220,
220,
220,
220,
220,
8410,
285,
62,
9806,
62,
88,
31742,
1546,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
75,
62,
88,
8,
796,
827,
12,
9630,
13,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
6894,
3784
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
"! <p class="shorttext synchronized" lang="en">Test execution for a custom query</p>
CLASS zcl_dbbr_custom_query_tester DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
"! <p class="shorttext synchronized" lang="en">Tests the given query string</p>
CLASS-METHODS test_query
IMPORTING
iv_query_string TYPE string.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_dbbr_custom_query_tester IMPLEMENTATION.
METHOD test_query.
" create and start selection controller
DATA(lr_controller) = zcl_dbbr_selection_controller=>create_controller(
VALUE #(
entity_type = zif_dbbr_c_selscreen_mode=>query
query_string = iv_query_string
technical_infos = CORRESPONDING #( zcl_dbbr_usersettings_factory=>get_settings( ) )
exclude_function = VALUE #(
( zif_dbbr_c_selection_functions=>leave_screen_with_layout )
( zif_dbbr_c_selection_functions=>transfer_filter_values )
( zif_dbbr_c_selection_functions=>open_in_sql_console )
)
)
).
lr_controller->execute_selection( ).
ENDMETHOD.
ENDCLASS.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
14402,
9706,
329,
257,
2183,
12405,
3556,
79,
29,
198,
31631,
1976,
565,
62,
9945,
1671,
62,
23144,
62,
22766,
62,
4879,
353,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
51,
3558,
262,
1813,
12405,
4731,
3556,
79,
29,
198,
220,
220,
220,
42715,
12,
49273,
50,
1332,
62,
22766,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
22766,
62,
8841,
41876,
4731,
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,
9945,
1671,
62,
23144,
62,
22766,
62,
4879,
353,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
1332,
62,
22766,
13,
198,
220,
220,
220,
366,
2251,
290,
923,
6356,
10444,
198,
220,
220,
220,
42865,
7,
14050,
62,
36500,
8,
796,
1976,
565,
62,
9945,
1671,
62,
49283,
62,
36500,
14804,
17953,
62,
36500,
7,
198,
220,
220,
220,
220,
220,
26173,
8924,
1303,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
9312,
62,
4906,
220,
220,
220,
220,
220,
220,
220,
796,
1976,
361,
62,
9945,
1671,
62,
66,
62,
741,
9612,
62,
14171,
14804,
22766,
198,
220,
220,
220,
220,
220,
220,
220,
220,
12405,
62,
8841,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
22766,
62,
8841,
198,
220,
220,
220,
220,
220,
220,
220,
220,
6276,
62,
10745,
418,
220,
220,
220,
796,
23929,
19535,
47,
18672,
2751,
1303,
7,
1976,
565,
62,
9945,
1671,
62,
18417,
12374,
62,
69,
9548,
14804,
1136,
62,
33692,
7,
1267,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
19607,
62,
8818,
220,
220,
796,
26173,
8924,
1303,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
1976,
361,
62,
9945,
1671,
62,
66,
62,
49283,
62,
12543,
2733,
14804,
47408,
62,
9612,
62,
4480,
62,
39786,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
1976,
361,
62,
9945,
1671,
62,
66,
62,
49283,
62,
12543,
2733,
14804,
39437,
62,
24455,
62,
27160,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
1976,
361,
62,
9945,
1671,
62,
66,
62,
49283,
62,
12543,
2733,
14804,
9654,
62,
259,
62,
25410,
62,
41947,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
6739,
628,
220,
220,
220,
300,
81,
62,
36500,
3784,
41049,
62,
49283,
7,
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,
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
FUNCTION CONVERSION_EXIT_YDK40_INPUT .
*"--------------------------------------------------------------------
*"*"Локальный интерфейс:
*" IMPORTING
*" REFERENCE(INPUT)
*" EXPORTING
*" REFERENCE(OUTPUT)
*"--------------------------------------------------------------------
* see FM YDK_CONVERSION_EXIT_REGISTER
PERFORM input USING '40' input CHANGING output.
ENDFUNCTION.
| [
42296,
4177,
2849,
7102,
43717,
62,
6369,
2043,
62,
35755,
42,
1821,
62,
1268,
30076,
764,
198,
9,
1,
10097,
650,
198,
9,
1,
9,
1,
140,
249,
25443,
118,
16142,
30143,
45367,
22177,
45035,
140,
117,
12466,
116,
22177,
20375,
16843,
21169,
141,
226,
16843,
140,
117,
21727,
25,
198,
9,
1,
220,
30023,
9863,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
1268,
30076,
8,
198,
9,
1,
220,
7788,
15490,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
2606,
7250,
3843,
8,
198,
9,
1,
10097,
650,
198,
9,
766,
18695,
575,
48510,
62,
10943,
43717,
62,
6369,
2043,
62,
31553,
41517,
198,
220,
19878,
21389,
5128,
1294,
2751,
705,
1821,
6,
5128,
5870,
15567,
2751,
5072,
13,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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">Repository Access</p>
CLASS zcl_i18nchk_rep_access DEFINITION
PUBLIC
FINAL
CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES:
zif_i18nchk_rep_access.
METHODS:
constructor
IMPORTING
bsp_name TYPE o2applname.
PROTECTED SECTION.
PRIVATE SECTION.
ALIASES:
get_file_content FOR zif_i18nchk_rep_access~get_file_content.
CONSTANTS:
c_ui5_mapping_file_name TYPE string VALUE 'UI5RepositoryPathMapping.xml'.
DATA:
repo_pers_layer TYPE REF TO /ui5/if_ui5_rep_persistence.
ENDCLASS.
CLASS zcl_i18nchk_rep_access IMPLEMENTATION.
METHOD constructor.
repo_pers_layer = NEW /ui5/cl_ui5_rep_persistence( iv_bsp_repo_name = bsp_name ).
ENDMETHOD.
METHOD zif_i18nchk_rep_access~get_bsp_description.
result = repo_pers_layer->repository_info-description.
ENDMETHOD.
METHOD zif_i18nchk_rep_access~get_ui5_app_map_entries.
" read UI5 Repository Mapping XML file
repo_pers_layer->read_bsp_page(
EXPORTING p_pagekey = VALUE #(
applname = repo_pers_layer->repository_info-name
pagekey = to_upper( c_ui5_mapping_file_name ) )
IMPORTING p_source = DATA(mapping_file_source_table)
ev_sy_subrc = DATA(sy_subrc) ).
CASE sy_subrc.
WHEN 0.
DATA(mapping_file_source) = /ui5/cl_ui5_rep_utility=>code_tab_2_code_string( mapping_file_source_table ).
WHEN OTHERS.
" if xml file doesn't exist the source are empty
" TODO: raise exception
RETURN.
ENDCASE.
" create path mapper instance
DATA(path_mapper) = NEW /ui5/cl_ui5_rep_path_mapper( mapping_file_source ).
result = path_mapper->get_mapping_entries( ).
ENDMETHOD.
METHOD zif_i18nchk_rep_access~get_file_content.
TRY.
CASE map_entry-internal_rep.
WHEN /ui5/cl_ui5_rep_utility=>c_internal_target_rep_mime.
repo_pers_layer->read_mime_object(
EXPORTING is_path_mapping = map_entry
IMPORTING ev_file_content = DATA(file_raw) ).
DATA(file_content_string) = /ui5/cl_ui5_rep_utility=>convert_xstring_2_string( file_raw ).
result = /ui5/cl_ui5_rep_utility=>code_string_2_code_tab( file_content_string ).
WHEN /ui5/cl_ui5_rep_utility=>c_internal_target_rep_bsp.
repo_pers_layer->read_bsp_page(
EXPORTING p_pagekey = VALUE #(
applname = repo_pers_layer->repository_info-name
pagekey = to_upper( map_entry-internal_rep_path ) )
IMPORTING p_source = DATA(file_content_tab) ).
file_content_string = /ui5/cl_ui5_rep_utility=>code_tab_2_code_string( it_src_tab = file_content_tab ).
SPLIT file_content_string AT cl_abap_char_utilities=>cr_lf INTO TABLE result.
ENDCASE.
IF remove_empty_lines = abap_true.
DELETE result WHERE table_line IS INITIAL.
ENDIF.
IF condense_lines = abap_true OR
( remove_comments = abap_true AND comment_pattern_range IS NOT INITIAL ).
LOOP AT result ASSIGNING FIELD-SYMBOL(<result_line>).
IF condense_lines = abap_true.
CONDENSE <result_line>.
ENDIF.
IF remove_comments = abap_true AND <result_line> IN comment_pattern_range.
DELETE result.
ENDIF.
ENDLOOP.
ENDIF.
CATCH /ui5/cx_ui5_rep_dt.
"handle exception
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
6207,
13264,
8798,
3556,
79,
29,
198,
31631,
1976,
565,
62,
72,
1507,
77,
354,
74,
62,
7856,
62,
15526,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
25,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
72,
1507,
77,
354,
74,
62,
7856,
62,
15526,
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,
275,
2777,
62,
3672,
41876,
267,
17,
1324,
75,
3672,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
8355,
43429,
1546,
25,
198,
220,
220,
220,
220,
220,
651,
62,
7753,
62,
11299,
7473,
1976,
361,
62,
72,
1507,
77,
354,
74,
62,
7856,
62,
15526,
93,
1136,
62,
7753,
62,
11299,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
269,
62,
9019,
20,
62,
76,
5912,
62,
7753,
62,
3672,
41876,
4731,
26173,
8924,
705,
10080,
20,
6207,
13264,
15235,
44,
5912,
13,
19875,
4458,
628,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
29924,
62,
19276,
62,
29289,
41876,
4526,
37,
5390,
1220,
9019,
20,
14,
361,
62,
9019,
20,
62,
7856,
62,
19276,
13274,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
72,
1507,
77,
354,
74,
62,
7856,
62,
15526,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
29924,
62,
19276,
62,
29289,
796,
12682,
1220,
9019,
20,
14,
565,
62,
9019,
20,
62,
7856,
62,
19276,
13274,
7,
21628,
62,
24145,
62,
260,
7501,
62,
3672,
796,
275,
2777,
62,
3672,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
72,
1507,
77,
354,
74,
62,
7856,
62,
15526,
93,
1136,
62,
24145,
62,
11213,
13,
198,
220,
220,
220,
1255,
796,
29924,
62,
19276,
62,
29289,
3784,
260,
1930,
37765,
62,
10951,
12,
11213,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
72,
1507,
77,
354,
74,
62,
7856,
62,
15526,
93,
1136,
62,
9019,
20,
62,
1324,
62,
8899,
62,
298,
1678,
13,
198,
220,
220,
220,
366,
1100,
12454,
20,
1432,
13264,
337,
5912,
23735,
2393,
198,
220,
220,
220,
29924,
62,
19276,
62,
29289,
3784,
961,
62,
24145,
62,
7700,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
279,
62,
7700,
2539,
220,
220,
796,
26173,
8924,
1303,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3680,
3672,
796,
29924,
62,
19276,
62,
29289,
3784,
260,
1930,
37765,
62,
10951,
12,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2443,
2539,
220,
796,
284,
62,
45828,
7,
269,
62,
9019,
20,
62,
76,
5912,
62,
7753,
62,
3672,
1267,
1267,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
279,
62,
10459,
220,
220,
220,
796,
42865,
7,
76,
5912,
62,
7753,
62,
10459,
62,
11487,
8,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
819,
62,
1837,
62,
7266,
6015,
796,
42865,
7,
1837,
62,
7266,
6015,
8,
6739,
628,
220,
220,
220,
42001,
827,
62,
7266,
6015,
13,
198,
220,
220,
220,
220,
220,
42099,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
76,
5912,
62,
7753,
62,
10459,
8,
796,
1220,
9019,
20,
14,
565,
62,
9019,
20,
62,
7856,
62,
315,
879,
14804,
8189,
62,
8658,
62,
17,
62,
8189,
62,
8841,
7,
16855,
62,
7753,
62,
10459,
62,
11487,
6739,
628,
220,
220,
220,
220,
220,
42099,
440,
4221,
4877,
13,
198,
220,
220,
220,
220,
220,
220,
220,
366,
611,
35555,
2393,
1595,
470,
2152,
262,
2723,
389,
6565,
198,
220,
220,
220,
220,
220,
220,
220,
366,
16926,
46,
25,
5298,
6631,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
34,
11159,
13,
628,
220,
220,
220,
366,
2251,
3108,
285,
11463,
4554,
198,
220,
220,
220,
42865,
7,
6978,
62,
76,
11463,
8,
796,
12682,
1220,
9019,
20,
14,
565,
62,
9019,
20,
62,
7856,
62,
6978,
62,
76,
11463,
7,
16855,
62,
7753,
62,
10459,
6739,
198,
220,
220,
220,
1255,
796,
3108,
62,
76,
11463,
3784,
1136,
62,
76,
5912,
62,
298,
1678,
7,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
72,
1507,
77,
354,
74,
62,
7856,
62,
15526,
93,
1136,
62,
7753,
62,
11299,
13,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42001,
3975,
62,
13000,
12,
32538,
62,
7856,
13,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42099,
1220,
9019,
20,
14,
565,
62,
9019,
20,
62,
7856,
62,
315,
879,
14804,
66,
62,
32538,
62,
16793,
62,
7856,
62,
76,
524,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
29924,
62,
19276,
62,
29289,
3784,
961,
62,
76,
524,
62,
15252,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
318,
62,
6978,
62,
76,
5912,
220,
796,
3975,
62,
13000,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
819,
62,
7753,
62,
11299,
220,
796,
42865,
7,
7753,
62,
1831,
8,
6739,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
7753,
62,
11299,
62,
8841,
8,
796,
1220,
9019,
20,
14,
565,
62,
9019,
20,
62,
7856,
62,
315,
879,
14804,
1102,
1851,
62,
87,
8841,
62,
17,
62,
8841,
7,
2393,
62,
1831,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
1220,
9019
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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ION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS ltcl_test DEFINITION FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS
FINAL.
PRIVATE SECTION.
* ================
DATA: mt_code TYPE string_table,
mt_tokens TYPE stokesx_tab,
mt_statements TYPE sstmnt_tab,
mt_levels TYPE slevel_tab,
mt_structures TYPE zcl_aoc_super=>ty_structures_tt.
METHODS:
build01 FOR TESTING,
build02 FOR TESTING.
METHODS: parse.
ENDCLASS. "lcl_Test
*----------------------------------------------------------------------*
* CLASS lcl_Test IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS ltcl_test IMPLEMENTATION.
* ==============================
DEFINE _code.
APPEND &1 TO mt_code.
END-OF-DEFINITION.
METHOD parse.
SCAN ABAP-SOURCE mt_code
TOKENS INTO mt_tokens
STATEMENTS INTO mt_statements
LEVELS INTO mt_levels
STRUCTURES INTO mt_structures
WITH ANALYSIS
WITH COMMENTS.
ENDMETHOD. "parse
METHOD build01.
DATA: lt_string TYPE zcl_aoc_structure=>ty_string_tt,
lo_stru TYPE REF TO zcl_aoc_structure.
_code 'DATA: lv_foo TYPE i, lv_bar TYPE i.'.
_code 'WRITE lv_foo.'.
_code 'IF lv_foo = lv_bar.'.
_code ' WRITE lv_foo.'.
_code ' WRITE lv_foo.'.
_code 'ELSEIF lv_foo = lv_bar.'.
_code ' WRITE lv_foo.'.
_code 'ELSE.'.
_code ' WRITE lv_foo.'.
_code 'ENDIF.'.
_code 'WRITE lv_foo.'.
parse( ).
lo_stru = zcl_aoc_structure=>build(
it_tokens = mt_tokens
it_statements = mt_statements
it_structures = mt_structures ).
lt_string = zcl_aoc_structure=>to_string( lo_stru ).
cl_abap_unit_assert=>assert_not_initial( lt_string ).
cl_abap_unit_assert=>assert_equals(
act = lines( lt_string )
exp = 14 ).
ENDMETHOD. "build
METHOD build02.
DATA: lt_string TYPE zcl_aoc_structure=>ty_string_tt,
lo_stru TYPE REF TO zcl_aoc_structure.
_code 'CASE lv_foo.'.
_code ' WHEN ''a''.'.
_code ' lv_moo = lv_boo.'.
_code ' WHEN OTHERS.'.
_code ' lv_moo = lv_boo.'.
_code 'ENDCASE.'.
parse( ).
lo_stru = zcl_aoc_structure=>build(
it_tokens = mt_tokens
it_statements = mt_statements
it_structures = mt_structures ).
lt_string = zcl_aoc_structure=>to_string( lo_stru ).
cl_abap_unit_assert=>assert_not_initial( lt_string ).
cl_abap_unit_assert=>assert_equals(
act = lines( lt_string )
exp = 6 ).
ENDMETHOD.
ENDCLASS. "lcl_Test
| [
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
565,
62,
14402,
5550,
20032,
17941,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
31631,
300,
83,
565,
62,
9288,
5550,
20032,
17941,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
198,
220,
25261,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
9,
796,
25609,
18604,
628,
220,
220,
220,
42865,
25,
45079,
62,
8189,
220,
220,
220,
220,
220,
220,
41876,
4731,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45079,
62,
83,
482,
641,
220,
220,
220,
220,
41876,
336,
3369,
87,
62,
8658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45079,
62,
14269,
3196,
41876,
264,
301,
76,
429,
62,
8658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45079,
62,
46170,
220,
220,
220,
220,
41876,
3133,
626,
62,
8658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
45079,
62,
7249,
942,
41876,
1976,
565,
62,
64,
420,
62,
16668,
14804,
774,
62,
7249,
942,
62,
926,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
1382,
486,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1382,
2999,
7473,
43001,
2751,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
21136,
13,
198,
198,
10619,
31631,
13,
220,
220,
220,
220,
220,
220,
366,
75,
565,
62,
14402,
198,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
565,
62,
14402,
30023,
2538,
10979,
6234,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
31631,
300,
83,
565,
62,
9288,
30023,
2538,
10979,
6234,
13,
198,
9,
36658,
25609,
28,
628,
220,
23449,
8881,
4808,
8189,
13,
198,
220,
220,
220,
43504,
10619,
1222,
16,
5390,
45079,
62,
8189,
13,
198,
220,
23578,
12,
19238,
12,
7206,
20032,
17941,
13,
628,
220,
337,
36252,
21136,
13,
198,
220,
220,
220,
6374,
1565,
9564,
2969,
12,
47690,
45079,
62,
8189,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5390,
42,
16938,
220,
220,
220,
220,
220,
220,
220,
220,
220,
39319,
45079,
62,
83,
482,
641,
198,
220,
220,
220,
220,
220,
220,
220,
220,
15486,
12529,
50,
220,
220,
220,
220,
220,
39319,
45079,
62,
14269,
3196,
198,
220,
220,
220,
220,
220,
220,
220,
220,
49277,
50,
220,
220,
220,
220,
220,
220,
220,
220,
220,
39319,
45079,
62,
46170,
198,
220,
220,
220,
220,
220,
220,
220,
220,
19269,
18415,
29514,
220,
220,
220,
220,
220,
39319,
45079,
62,
7249,
942,
198,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
3537,
1847,
16309,
1797,
198,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
9440,
28957,
13,
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,
29572,
628,
220,
337,
36252,
1382,
486,
13,
628,
220,
220,
220,
42865,
25,
300,
83,
62,
8841,
41876,
1976,
565,
62,
64,
420,
62,
301,
5620,
14804,
774,
62,
8841,
62,
926,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
19554,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
301,
5620,
13,
628,
198,
220,
220,
220,
4808,
8189,
705,
26947,
25,
300,
85,
62,
21943,
41876,
1312,
11,
300,
85,
62,
5657,
41876,
1312,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
18564,
12709,
300,
85,
62,
21943,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
5064,
300,
85,
62,
21943,
796,
300,
85,
62,
5657,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
220,
44423,
300,
85,
62,
21943,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
220,
44423,
300,
85,
62,
21943,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
3698,
5188,
5064,
300,
85,
62,
21943,
796,
300,
85,
62,
5657,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
220,
44423,
300,
85,
62,
21943,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
3698,
5188,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
220,
44423,
300,
85,
62,
21943,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
10619,
5064,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
18564,
12709,
300,
85,
62,
21943,
2637,
13,
628,
220,
220,
220,
21136,
7,
6739,
628,
220,
220,
220,
2376,
62,
19554,
796,
1976,
565,
62,
64,
420,
62,
301,
5620,
14804,
11249,
7,
198,
220,
220,
220,
220,
220,
340,
62,
83,
482,
641,
220,
220,
220,
220,
796,
45079,
62,
83,
482,
641,
198,
220,
220,
220,
220,
220,
340,
62,
14269,
3196,
796,
45079,
62,
14269,
3196,
198,
220,
220,
220,
220,
220,
340,
62,
7249,
942,
796,
45079,
62,
7249,
942,
6739,
628,
220,
220,
220,
300,
83,
62,
8841,
796,
1976,
565,
62,
64,
420,
62,
301,
5620,
14804,
1462,
62,
8841,
7,
2376,
62,
19554,
6739,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
1662,
62,
36733,
7,
300,
83,
62,
8841,
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,
3951,
7,
300,
83,
62,
8841,
1267,
198,
220,
220,
220,
220,
220,
1033,
796,
1478,
6739,
628,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
366,
11249,
628,
220,
337,
36252,
1382,
2999,
13,
628,
220,
220,
220,
42865,
25,
300,
83,
62,
8841,
41876,
1976,
565,
62,
64,
420,
62,
301,
5620,
14804,
774,
62,
8841,
62,
926,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
19554,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
301,
5620,
13,
628,
198,
220,
220,
220,
4808,
8189,
705,
34,
11159,
300,
85,
62,
21943,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
220,
42099,
10148,
64,
7061,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
REPORT zaoc_clearance.
* abapOpenChecks
* https://github.com/larshp/abapOpenChecks
* MIT License
* Finds objects that are not statically referenced
TABLES: tadir.
TYPES: BEGIN OF ty_output,
object TYPE tadir-object,
obj_name TYPE tadir-obj_name,
devclass TYPE tadir-devclass,
created_on TYPE tadir-created_on,
END OF ty_output.
TYPES: ty_output_tt TYPE STANDARD TABLE OF ty_output WITH DEFAULT KEY.
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: s_devcla FOR tadir-devclass OBLIGATORY,
s_name FOR tadir-obj_name,
s_type FOR tadir-object,
s_cdat FOR tadir-created_on.
SELECTION-SCREEN END OF BLOCK b1.
*----------------------------------------------------------------------*
* CLASS lcl_app DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_data DEFINITION FINAL.
PUBLIC SECTION.
CLASS-METHODS:
fetch
RETURNING VALUE(rt_data) TYPE ty_output_tt.
PRIVATE SECTION.
CLASS-METHODS:
show_progress
IMPORTING
iv_current TYPE i
iv_total TYPE i,
check_doma
IMPORTING
is_tadir TYPE ty_output
RETURNING
VALUE(rv_obsolete) TYPE abap_bool,
check_dtel
IMPORTING
is_tadir TYPE ty_output
RETURNING
VALUE(rv_obsolete) TYPE abap_bool,
check_ttyp
IMPORTING
is_tadir TYPE ty_output
RETURNING
VALUE(rv_obsolete) TYPE abap_bool,
check_tabl
IMPORTING
is_tadir TYPE ty_output
RETURNING
VALUE(rv_obsolete) TYPE abap_bool,
check_clas
IMPORTING
is_tadir TYPE ty_output
RETURNING
VALUE(rv_obsolete) TYPE abap_bool,
check_intf
IMPORTING
is_tadir TYPE ty_output
RETURNING
VALUE(rv_obsolete) TYPE abap_bool.
ENDCLASS. "lcl_app DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_app IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_data IMPLEMENTATION.
METHOD show_progress.
DATA: lv_percentage TYPE i,
lv_text TYPE string.
lv_percentage = ( iv_current * 100 ) / iv_total.
lv_text = |{ iv_current }/{ iv_total }|.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = lv_percentage
text = lv_text.
ENDMETHOD.
METHOD fetch.
DATA: lt_tadir TYPE ty_output_tt,
lv_lines TYPE i,
lv_obsolete TYPE abap_bool.
FIELD-SYMBOLS: <ls_data> LIKE LINE OF rt_data,
<ls_tadir> LIKE LINE OF lt_tadir.
SELECT object obj_name devclass created_on
FROM tadir
INTO TABLE lt_tadir
WHERE pgmid = 'R3TR'
AND ( object = 'DOMA'
OR object = 'TABL'
OR object = 'INTF'
OR object = 'TTYP'
OR object = 'CLAS'
OR object = 'DTEL' )
AND object IN s_type
AND obj_name IN s_name
AND created_on IN s_cdat
AND delflag = abap_false
AND devclass IN s_devcla. "#EC CI_SUBRC "#EC CI_GENBUFF
lv_lines = lines( lt_tadir ).
LOOP AT lt_tadir ASSIGNING <ls_tadir>.
IF sy-tabix MOD 50 = 0 OR sy-tabix = 1.
show_progress( iv_current = sy-tabix
iv_total = lv_lines ).
ENDIF.
CASE <ls_tadir>-object.
WHEN 'DOMA'.
lv_obsolete = check_doma( <ls_tadir> ).
WHEN 'DTEL'.
lv_obsolete = check_dtel( <ls_tadir> ).
WHEN 'TABL'.
lv_obsolete = check_tabl( <ls_tadir> ).
WHEN 'INTF'.
lv_obsolete = check_intf( <ls_tadir> ).
WHEN 'CLAS'.
lv_obsolete = check_clas( <ls_tadir> ).
WHEN 'TTYP'.
lv_obsolete = check_ttyp( <ls_tadir> ).
WHEN OTHERS.
ASSERT 1 = 0.
ENDCASE.
IF lv_obsolete = abap_true.
APPEND INITIAL LINE TO rt_data ASSIGNING <ls_data>.
MOVE-CORRESPONDING <ls_tadir> TO <ls_data>.
ENDIF.
ENDLOOP.
ENDMETHOD. "run
METHOD check_clas.
DATA: lv_name TYPE wbcrossgt-name.
SELECT SINGLE name FROM wbcrossgt
INTO lv_name
WHERE otype = 'TY'
AND name = is_tadir-obj_name
AND direct = 'X'.
IF sy-subrc <> 0.
rv_obsolete = abap_true.
ENDIF.
ENDMETHOD.
METHOD check_intf.
DATA: lv_name TYPE wbcrossgt-name.
SELECT SINGLE name FROM wbcrossgt INTO lv_name
WHERE otype = 'TY'
AND name = is_tadir-obj_name.
IF sy-subrc <> 0.
rv_obsolete = abap_true.
ENDIF.
ENDMETHOD.
METHOD check_ttyp.
DATA: lt_find TYPE TABLE OF rsfind,
ls_find LIKE LINE OF lt_find.
ls_find-object = is_tadir-obj_name.
APPEND ls_find TO lt_find.
CALL FUNCTION 'RS_EU_CROSSREF'
EXPORTING
i_find_obj_cls = 'DA'
rekursiv = abap_true
no_dialog = abap_true
TABLES
i_findstrings = lt_find
EXCEPTIONS
not_executed = 1
not_found = 2
illegal_object = 3
no_cross_for_this_object = 4
batch = 5
batchjob_error = 6
wrong_type = 7
object_not_exist = 8
OTHERS = 9.
IF sy-subrc = 2.
rv_obsolete = abap_true.
ENDIF.
ENDMETHOD.
METHOD check_tabl.
DATA: lt_find TYPE TABLE OF rsfind,
lv_tabclass TYPE dd02l-tabclass,
ls_find LIKE LINE OF lt_find.
SELECT SINGLE tabclass FROM dd02l INTO lv_tabclass
WHERE tabname = is_tadir-obj_name
AND as4local = 'A'
AND as4vers = '000'. "#EC CI_SUBRC
IF lv_tabclass = 'APPEND'.
RETURN.
ENDIF.
ls_find-object = is_tadir-obj_name.
APPEND ls_find TO lt_find.
CALL FUNCTION 'RS_EU_CROSSREF'
EXPORTING
i_find_obj_cls = 'DS'
rekursiv = abap_true
no_dialog = abap_true
TABLES
i_findstrings = lt_find
EXCEPTIONS
not_executed = 1
not_found = 2
illegal_object = 3
no_cross_for_this_object = 4
batch = 5
batchjob_error = 6
wrong_type = 7
object_not_exist = 8
OTHERS = 9.
IF sy-subrc = 2.
rv_obsolete = abap_true.
ENDIF.
ENDMETHOD.
METHOD check_dtel.
DATA: lt_find TYPE TABLE OF rsfind,
ls_find LIKE LINE OF lt_find.
ls_find-object = is_tadir-obj_name.
APPEND ls_find TO lt_find.
CALL FUNCTION 'RS_EU_CROSSREF'
EXPORTING
i_find_obj_cls = 'DE'
rekursiv = abap_true
no_dialog = abap_true
TABLES
i_findstrings = lt_find
EXCEPTIONS
not_executed = 1
not_found = 2
illegal_object = 3
no_cross_for_this_object = 4
batch = 5
batchjob_error = 6
wrong_type = 7
object_not_exist = 8
OTHERS = 9.
IF sy-subrc = 2.
rv_obsolete = abap_true.
ENDIF.
ENDMETHOD.
METHOD check_doma.
DATA: lv_domname TYPE dd01l-domname,
lv_rollname TYPE dd04l-rollname.
lv_domname = is_tadir-obj_name.
SELECT SINGLE rollname FROM dd04l INTO lv_rollname
WHERE domname = lv_domname
AND ( refkind = '' OR refkind = 'D' )
AND as4local = 'A' ##WARN_OK.
IF sy-subrc = 0.
RETURN. " in use
ENDIF.
SELECT SINGLE domname FROM dd01l INTO lv_domname
WHERE domname = lv_domname
AND as4local = 'A'
AND as4vers = '0000'.
IF sy-subrc <> 0.
RETURN. " does not exist
ENDIF.
rv_obsolete = abap_true.
ENDMETHOD.
ENDCLASS. "lcl_app IMPLEMENTATION
*----------------------------------------------------------------------*
* CLASS lcl_alv DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_alv DEFINITION FINAL.
PUBLIC SECTION.
CLASS-METHODS:
show
IMPORTING it_table TYPE ty_output_tt
RAISING cx_salv_error.
PRIVATE SECTION.
CLASS-DATA:
gt_table TYPE ty_output_tt.
CLASS-METHODS:
navigate
IMPORTING
is_data TYPE ty_output,
on_link_click
FOR EVENT link_click OF cl_salv_events_table
IMPORTING
row
column.
ENDCLASS. "lcl_alv DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_alv IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_alv IMPLEMENTATION.
METHOD show.
DATA: lo_column TYPE REF TO cl_salv_column_list,
lo_events TYPE REF TO cl_salv_events_table,
lo_alv TYPE REF TO cl_salv_table.
gt_table = it_table.
cl_salv_table=>factory(
IMPORTING
r_salv_table = lo_alv
CHANGING
t_table = gt_table ).
lo_alv->get_columns( )->set_optimize( ).
lo_column ?= lo_alv->get_columns( )->get_column( 'OBJ_NAME' ).
lo_column->set_cell_type( if_salv_c_cell_type=>hotspot ).
lo_alv->get_functions( )->set_all( ).
lo_events = lo_alv->get_event( ).
SET HANDLER lcl_alv=>on_link_click FOR lo_events.
lo_alv->display( ).
ENDMETHOD. "show
METHOD on_link_click.
DATA: ls_data LIKE LINE OF gt_table.
READ TABLE gt_table INTO ls_data INDEX row.
IF sy-subrc <> 0.
RETURN.
ENDIF.
CASE column.
WHEN 'OBJ_NAME'.
navigate( ls_data ).
ENDCASE.
ENDMETHOD. "on_link_click
METHOD navigate.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = is_data-obj_name
object_type = is_data-object
EXCEPTIONS
not_executed = 1
invalid_object_type = 2
OTHERS = 3.
IF sy-subrc <> 0.
ASSERT 1 = 0.
ENDIF.
ENDMETHOD. "on_link_click
ENDCLASS.
START-OF-SELECTION.
lcl_alv=>show( lcl_data=>fetch( ) ).
| [
2200,
15490,
1976,
64,
420,
62,
20063,
590,
13,
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,
198,
198,
9,
9938,
82,
5563,
326,
389,
407,
47746,
20717,
198,
198,
5603,
9148,
1546,
25,
36264,
343,
13,
198,
198,
9936,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
22915,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
2134,
220,
220,
220,
220,
41876,
36264,
343,
12,
15252,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
26181,
62,
3672,
220,
220,
41876,
36264,
343,
12,
26801,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
1614,
4871,
220,
220,
41876,
36264,
343,
12,
7959,
4871,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
2727,
62,
261,
41876,
36264,
343,
12,
25598,
62,
261,
11,
198,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
22915,
13,
198,
198,
9936,
47,
1546,
25,
1259,
62,
22915,
62,
926,
41876,
49053,
9795,
43679,
3963,
1259,
62,
22915,
13315,
5550,
38865,
35374,
13,
198,
198,
46506,
2849,
12,
6173,
2200,
1677,
347,
43312,
3963,
9878,
11290,
275,
16,
13315,
8782,
10067,
37977,
2538,
40383,
12,
8298,
13,
198,
46506,
12,
3185,
51,
11053,
25,
264,
62,
7959,
565,
64,
7473,
36264,
343,
12,
7959,
4871,
440,
9148,
3528,
1404,
15513,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
62,
3672,
220,
220,
7473,
36264,
343,
12,
26801,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
62,
4906,
220,
220,
7473,
36264,
343,
12,
15252,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
62,
10210,
265,
220,
220,
7473,
36264,
343,
12,
25598,
62,
261,
13,
198,
46506,
2849,
12,
6173,
2200,
1677,
23578,
3963,
9878,
11290,
275,
16,
13,
198,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
565,
62,
1324,
5550,
20032,
17941,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
31631,
300,
565,
62,
7890,
5550,
20032,
17941,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
25,
198,
220,
220,
220,
220,
220,
21207,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
7890,
8,
41876,
1259,
62,
22915,
62,
926,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
25,
198,
220,
220,
220,
220,
220,
905,
62,
33723,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
14421,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
23350,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
2198,
62,
3438,
64,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
83,
324,
343,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
22915,
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,
672,
23869,
8,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
2198,
62,
28664,
417,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
83,
324,
343,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
22915,
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,
672,
23869,
8,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
2198,
62,
83,
28004,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
83,
324,
343,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
22915,
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,
672,
23869,
8,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
2198,
62,
8658,
75,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
83,
324,
343,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
22915,
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,
672,
23869,
8,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
2198,
62,
565,
292,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
83,
324,
343,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
22915,
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,
672,
23869,
8,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
2198,
62,
600,
69,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
83,
324,
343,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
22915,
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,
672,
23869,
8,
41876,
450,
499,
62,
30388,
13,
198,
198,
10619,
31631,
13,
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,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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
] |
class ZCX_CLONENOTSUPPORTED definition
public
inheriting from ZCX_RUNTIMEEXCEPTION
final
create public .
public section.
constants ZCX_CLONENOTSUPPORTED type SOTR_CONC value '00155D334B0D1EE2B8FD3A94F7EE2991'. "#EC NOTEXT
methods CONSTRUCTOR
importing
!TEXTID like TEXTID optional
!PREVIOUS like PREVIOUS optional
!MESSAGE type STRING optional .
protected section.
private section.
ENDCLASS.
CLASS ZCX_CLONENOTSUPPORTED IMPLEMENTATION.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCX_CLONENOTSUPPORTED->CONSTRUCTOR
* +-------------------------------------------------------------------------------------------------+
* | [--->] TEXTID LIKE TEXTID(optional)
* | [--->] PREVIOUS LIKE PREVIOUS(optional)
* | [--->] MESSAGE TYPE STRING(optional)
* +--------------------------------------------------------------------------------------</SIGNATURE>
method CONSTRUCTOR.
CALL METHOD SUPER->CONSTRUCTOR
EXPORTING
TEXTID = TEXTID
PREVIOUS = PREVIOUS
MESSAGE = MESSAGE
.
IF textid IS INITIAL.
me->textid = ZCX_CLONENOTSUPPORTED .
ENDIF.
endmethod.
ENDCLASS.
| [
4871,
1168,
34,
55,
62,
5097,
1340,
1677,
33472,
8577,
15490,
1961,
6770,
201,
198,
220,
1171,
201,
198,
220,
10639,
1780,
422,
1168,
34,
55,
62,
49,
4944,
34694,
6369,
42006,
2849,
201,
198,
220,
2457,
201,
198,
220,
2251,
1171,
764,
201,
198,
201,
198,
11377,
2665,
13,
201,
198,
201,
198,
220,
38491,
1168,
34,
55,
62,
5097,
1340,
1677,
33472,
8577,
15490,
1961,
2099,
311,
2394,
49,
62,
10943,
34,
1988,
705,
405,
18742,
35,
31380,
33,
15,
35,
16,
6500,
17,
33,
23,
26009,
18,
32,
5824,
37,
22,
6500,
1959,
6420,
4458,
25113,
2943,
5626,
13918,
201,
198,
201,
198,
220,
5050,
7102,
46126,
1581,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
32541,
2389,
588,
40383,
2389,
11902,
201,
198,
220,
220,
220,
220,
220,
5145,
46437,
12861,
20958,
588,
22814,
12861,
20958,
11902,
201,
198,
220,
220,
220,
220,
220,
5145,
44,
1546,
4090,
8264,
2099,
19269,
2751,
11902,
764,
201,
198,
24326,
2665,
13,
201,
198,
19734,
2665,
13,
201,
198,
10619,
31631,
13,
201,
198,
201,
198,
201,
198,
201,
198,
31631,
1168,
34,
55,
62,
5097,
1340,
1677,
33472,
8577,
15490,
1961,
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,
34,
55,
62,
5097,
1340,
1677,
33472,
8577,
15490,
1961,
3784,
10943,
46126,
1581,
201,
198,
9,
1343,
10097,
3880,
19529,
201,
198,
9,
930,
685,
438,
3784,
60,
40383,
2389,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34178,
220,
220,
220,
220,
220,
220,
220,
40383,
2389,
7,
25968,
8,
201,
198,
9,
930,
685,
438,
3784,
60,
22814,
12861,
20958,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34178,
220,
220,
220,
220,
220,
220,
220,
22814,
12861,
20958,
7,
25968,
8,
201,
198,
9,
930,
685,
438,
3784,
60,
337,
1546,
4090,
8264,
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,
7,
25968,
8,
201,
198,
9,
1343,
10097,
19351,
438,
3556,
46224,
40086,
29,
201,
198,
24396,
7102,
46126,
1581,
13,
201,
198,
34,
7036,
337,
36252,
33088,
3784,
10943,
46126,
1581,
201,
198,
6369,
15490,
2751,
201,
198,
32541,
2389,
796,
40383,
2389,
201,
198,
46437,
12861,
20958,
796,
22814,
12861,
20958,
201,
198,
44,
1546,
4090,
8264,
796,
337,
1546,
4090,
8264,
201,
198,
13,
201,
198,
16876,
2420,
312,
3180,
3268,
2043,
12576,
13,
201,
198,
220,
220,
502,
3784,
5239,
312,
796,
1168,
34,
55,
62,
5097,
1340,
1677,
33472,
8577,
15490,
1961,
764,
201,
198,
23578,
5064,
13,
201,
198,
437,
24396,
13,
201,
198,
10619,
31631,
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,
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
] |
CLASS zcl_abapgit_background_push_fi DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_background .
PROTECTED SECTION.
CONSTANTS:
BEGIN OF c_settings,
name TYPE string VALUE 'NAME',
email TYPE string VALUE 'EMAIL',
END OF c_settings .
DATA mi_log TYPE REF TO zif_abapgit_log .
METHODS build_comment
IMPORTING
!is_files TYPE zif_abapgit_definitions=>ty_stage_files
RETURNING
VALUE(rv_comment) TYPE string .
METHODS push_fixed
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo_online
!iv_name TYPE string
!iv_email TYPE string
RAISING
zcx_abapgit_exception .
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_ABAPGIT_BACKGROUND_PUSH_FI IMPLEMENTATION.
METHOD build_comment.
DATA: lt_objects TYPE STANDARD TABLE OF string WITH DEFAULT KEY,
lv_str TYPE string.
FIELD-SYMBOLS: <ls_local> LIKE LINE OF is_files-local.
LOOP AT is_files-local ASSIGNING <ls_local>.
lv_str = |{ <ls_local>-item-obj_type } { <ls_local>-item-obj_name }|.
APPEND lv_str TO lt_objects.
ENDLOOP.
SORT lt_objects AS TEXT.
DELETE ADJACENT DUPLICATES FROM lt_objects.
IF lines( lt_objects ) = 1.
rv_comment = |BG: { lv_str }|.
ELSE.
rv_comment = 'BG: Multiple objects'.
LOOP AT lt_objects INTO lv_str.
CONCATENATE rv_comment zif_abapgit_definitions=>c_newline lv_str INTO rv_comment.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD push_fixed.
DATA: ls_comment TYPE zif_abapgit_definitions=>ty_comment,
ls_files TYPE zif_abapgit_definitions=>ty_stage_files,
lo_stage TYPE REF TO zcl_abapgit_stage.
FIELD-SYMBOLS: <ls_local> LIKE LINE OF ls_files-local,
<ls_remote> LIKE LINE OF ls_files-remote.
ls_files = zcl_abapgit_factory=>get_stage_logic( )->get( io_repo ).
ASSERT lines( ls_files-local ) > 0
OR lines( ls_files-remote ) > 0.
lo_stage = NEW #( ).
LOOP AT ls_files-local ASSIGNING <ls_local>.
mi_log->add_info( |stage: { <ls_local>-file-path } { <ls_local>-file-filename }| ).
lo_stage->add( iv_path = <ls_local>-file-path
iv_filename = <ls_local>-file-filename
iv_data = <ls_local>-file-data ).
ENDLOOP.
LOOP AT ls_files-remote ASSIGNING <ls_remote>.
mi_log->add_info( |removed: { <ls_remote>-path } { <ls_remote>-filename }| ).
lo_stage->rm( iv_path = <ls_remote>-path
iv_filename = <ls_remote>-filename ).
ENDLOOP.
ls_comment-committer-name = iv_name.
ls_comment-committer-email = iv_email.
ls_comment-comment = build_comment( ls_files ).
io_repo->push( is_comment = ls_comment
io_stage = lo_stage ).
ENDMETHOD.
METHOD zif_abapgit_background~get_description.
rv_description = 'Automatic push, fixed author'.
ENDMETHOD.
METHOD zif_abapgit_background~get_settings.
DATA: ls_setting LIKE LINE OF ct_settings.
READ TABLE ct_settings WITH KEY key = c_settings-name INTO ls_setting.
IF sy-subrc <> 0.
ls_setting-key = c_settings-name.
ls_setting-value = 'foobar'.
APPEND ls_setting TO ct_settings.
ENDIF.
READ TABLE ct_settings WITH KEY key = c_settings-email INTO ls_setting.
IF sy-subrc <> 0.
ls_setting-key = c_settings-email.
ls_setting-value = 'foobar@localhost'.
APPEND ls_setting TO ct_settings.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_background~run.
DATA: ls_files TYPE zif_abapgit_definitions=>ty_stage_files,
ls_setting LIKE LINE OF it_settings,
lv_name TYPE string,
lv_email TYPE string.
mi_log = ii_log.
ls_files = zcl_abapgit_factory=>get_stage_logic( )->get( io_repo ).
IF lines( ls_files-local ) = 0 AND lines( ls_files-remote ) = 0.
ii_log->add_info( 'Nothing to stage' ).
RETURN.
ENDIF.
READ TABLE it_settings WITH KEY key = c_settings-name INTO ls_setting. "#EC CI_SUBRC
lv_name = ls_setting-value.
READ TABLE it_settings WITH KEY key = c_settings-email INTO ls_setting. "#EC CI_SUBRC
lv_email = ls_setting-value.
push_fixed(
io_repo = io_repo
iv_name = lv_name
iv_email = lv_email ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
25249,
62,
14689,
62,
12463,
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,
25249,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
41876,
4731,
26173,
8924,
705,
20608,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
3053,
41876,
4731,
26173,
8924,
705,
27630,
4146,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
33692,
764,
198,
220,
220,
220,
42865,
21504,
62,
6404,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
764,
628,
220,
220,
220,
337,
36252,
50,
1382,
62,
23893,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
16624,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
14247,
62,
16624,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
23893,
8,
41876,
4731,
764,
198,
220,
220,
220,
337,
36252,
50,
4574,
62,
34021,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
260,
7501,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
3672,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
12888,
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,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
31098,
46025,
62,
47,
27143,
62,
11674,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1382,
62,
23893,
13,
628,
220,
220,
220,
42865,
25,
300,
83,
62,
48205,
41876,
49053,
9795,
43679,
3963,
4731,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
2536,
220,
220,
220,
220,
41876,
4731,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
12001,
29,
34178,
48920,
3963,
318,
62,
16624,
12,
12001,
13,
628,
198,
220,
220,
220,
17579,
3185,
5161,
318,
62,
16624,
12,
12001,
24994,
3528,
15871,
1279,
7278,
62,
12001,
28401,
198,
220,
220,
220,
220,
220,
300,
85,
62,
2536,
796,
930,
90,
1279,
7278,
62,
12001,
29,
12,
9186,
12,
26801,
62,
4906,
1782,
1391,
1279,
7278,
62,
12001,
29,
12,
9186,
12,
26801,
62,
3672,
1782,
91,
13,
198,
220,
220,
220,
220,
220,
43504,
10619,
300,
85,
62,
2536,
5390,
300,
83,
62,
48205,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
311,
9863,
300,
83,
62,
48205,
7054,
40383,
13,
198,
220,
220,
220,
5550,
2538,
9328,
5984,
41,
2246,
3525,
35480,
31484,
29462,
16034,
300,
83,
62,
48205,
13,
628,
220,
220,
220,
16876,
3951,
7,
300,
83,
62,
48205,
1267,
796,
352,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
23893,
796,
930,
40469,
25,
1391,
300,
85,
62,
2536,
1782,
91,
13,
198,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
23893,
796,
705,
40469,
25,
20401,
5563,
4458,
198,
220,
220,
220,
220,
220,
17579,
3185,
5161,
300,
83,
62,
48205,
39319,
300,
85,
62,
2536,
13,
198,
220,
220,
220,
220,
220,
220,
220,
39962,
1404,
1677,
6158,
374,
85,
62,
23893,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
66,
62,
3605,
1370,
300,
85,
62,
2536,
39319,
374,
85,
62,
23893,
13,
198,
220,
220,
220,
220,
220,
23578,
21982,
3185,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
4574,
62,
34021,
13,
628,
220,
220,
220,
42865,
25,
43979,
62,
23893,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
23893,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
16624,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
14247,
62,
16624,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
14247,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
14247,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
12001,
29,
220,
34178,
48920,
3963,
43979,
62,
16624,
12,
12001,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7278,
62,
47960,
29,
34178,
48920,
3963,
43979,
62,
16624,
12,
47960,
13,
628,
198,
220,
220,
220,
43979,
62,
16624,
796,
1976,
565,
62,
397,
499,
18300,
62,
69,
9548,
14804,
1136,
62,
14247,
62,
6404,
291,
7,
1267,
3784,
1136,
7,
33245,
62,
260,
7501,
6739,
198,
220,
220,
220,
24994,
17395,
3951,
7,
43979,
62,
16624,
12,
12001,
1267,
1875,
657,
198,
220,
220,
220,
220,
220,
220,
220,
6375,
3951,
7,
43979,
62,
16624,
12,
47960,
1267,
1875,
657,
13,
628,
220,
220,
220,
2376,
62,
14247,
796,
12682,
1303,
7,
6739,
628,
220,
220,
220,
17579,
3185,
5161,
43979,
62,
16624,
12,
12001,
24994,
3528,
15871,
1279,
7278,
62,
12001,
28401,
198,
220,
220,
220,
220,
220,
21504,
62,
6404,
3784,
2860,
62,
10951,
7,
930,
14247,
25,
1391,
1279,
7278,
62,
12001,
29,
12,
7753,
12,
6978,
1782,
1391,
1279,
7278,
62,
12001,
29,
12,
7753,
12,
34345,
1782,
91,
6739,
198,
220,
220,
220,
220,
220,
2376,
62,
14247,
3784,
2860,
7,
21628,
62,
6978,
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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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 /GAL/COLOR_RGB definition
public
inheriting from /GAL/COLOR
create public .
public section.
type-pools ABAP .
data R type F read-only .
data G type F read-only .
data B type F read-only .
class-methods FROM_RGB24_HEX
importing
!RGB24_HEX type XSEQUENCE
!LITTLE_ENDIAN type ABAP_BOOL default ABAP_FALSE
returning
value(COLOR_RGB) type ref to /GAL/COLOR_RGB .
class-methods FROM_RGB24_INT
importing
!RGB24_INT type I
!LITTLE_ENDIAN type ABAP_BOOL default ABAP_TRUE
returning
value(COLOR_RGB) type ref to /GAL/COLOR_RGB .
methods CONSTRUCTOR
importing
!R type NUMERIC
!G type NUMERIC
!B type NUMERIC .
methods GET_COLOR_FOR_CSS
returning
value(COLOR) type STRING .
methods MIX
importing
!COLOR_RGB type ref to /GAL/COLOR_RGB
!RATIO type NUMERIC default '0.5'
returning
value(RESULT) type ref to /GAL/COLOR_RGB .
methods TO_RGB24_HEX
importing
!LITTLE_ENDIAN type ABAP_BOOL default ABAP_FALSE
returning
value(RGB24_HEX) type /GAL/COLOR_RGB24_HEX .
methods TO_RGB24_INT
importing
!LITTLE_ENDIAN type ABAP_BOOL default ABAP_TRUE
returning
value(RGB24_INT) type I .
protected section.
private section.
ENDCLASS.
CLASS /GAL/COLOR_RGB IMPLEMENTATION.
METHOD constructor.
DATA l_type TYPE c.
super->constructor( ).
DESCRIBE FIELD r TYPE l_type.
IF l_type CA 'BSI'.
me->r = r / 255. "#EC NUMBER_OK
ELSE.
me->r = r.
ENDIF.
IF me->r < 0.
me->r = 0.
ELSEIF me->r > 1.
me->r = 1.
ENDIF.
DESCRIBE FIELD g TYPE l_type.
IF l_type CA 'BSI'.
me->g = g / 255. "#EC NUMBER_OK
ELSE.
me->g = g.
ENDIF.
IF me->g < 0.
me->g = 0.
ELSEIF me->g > 1.
me->g = 1.
ENDIF.
DESCRIBE FIELD b TYPE l_type.
IF l_type CA 'BSI'.
me->b = b / 255. "#EC NUMBER_OK
ELSE.
me->b = b.
ENDIF.
IF me->b < 0.
me->b = 0.
ELSEIF me->b > 1.
me->b = 1.
ENDIF.
ENDMETHOD.
METHOD from_rgb24_hex.
DATA l_hex(3) TYPE x.
DATA l_offset TYPE i.
DATA l_r TYPE i.
DATA l_g TYPE i.
DATA l_b TYPE i.
l_offset = xstrlen( rgb24_hex ) - 3.
IF l_offset > 0.
l_hex = rgb24_hex+l_offset.
ELSE.
l_hex = rgb24_hex.
ENDIF.
IF little_endian = abap_true.
l_r = l_hex+2(1).
l_g = l_hex+1(1).
l_b = l_hex(1).
ELSE.
l_r = l_hex(1).
l_g = l_hex+1(1).
l_b = l_hex+2(1).
ENDIF.
CREATE OBJECT color_rgb
EXPORTING
r = l_r
g = l_g
b = l_b.
ENDMETHOD.
METHOD from_rgb24_int.
DATA l_hex(4) TYPE x.
l_hex = rgb24_int.
color_rgb = from_rgb24_hex( rgb24_hex = l_hex
little_endian = little_endian ).
ENDMETHOD.
METHOD get_color_for_css.
DATA l_rgb24_hex TYPE /gal/color_rgb24_hex.
l_rgb24_hex = to_rgb24_hex( ).
color = l_rgb24_hex.
CONCATENATE `#` color INTO color.
TRANSLATE color TO LOWER CASE.
ENDMETHOD.
METHOD mix.
DATA l_f1 TYPE f.
DATA l_f2 TYPE f.
DATA l_r TYPE f.
DATA l_g TYPE f.
DATA l_b TYPE f.
IF ratio < 0.
l_f1 = 0.
ELSEIF ratio > 1.
l_f1 = 1.
ELSE.
l_f1 = ratio.
ENDIF.
l_f2 = 1 - l_f1.
l_r = r * l_f1 + color_rgb->r * l_f2.
l_g = g * l_f1 + color_rgb->g * l_f2.
l_b = b * l_f1 + color_rgb->b * l_f2.
CREATE OBJECT result
EXPORTING
r = l_r
g = l_g
b = l_b.
ENDMETHOD.
METHOD to_rgb24_hex.
DATA l_rf TYPE f.
DATA l_gf TYPE f.
DATA l_bf TYPE f.
DATA l_rx TYPE x.
DATA l_gx TYPE x.
DATA l_bx TYPE x.
* Convert RGB values to floats between 0 and 1
IF r < 0.
l_rf = 0.
ELSEIF r > 1.
l_rf = 1.
ELSE.
l_rf = r.
ENDIF.
IF g < 0.
l_gf = 0.
ELSEIF g > 1.
l_gf = 1.
ELSE.
l_gf = g.
ENDIF.
IF b < 0.
l_bf = 0.
ELSEIF b > 1.
l_bf = 1.
ELSE.
l_bf = b.
ENDIF.
* Convert float values to hey byte
l_rx = l_rf * 255. "#EC NUMBER_OK
l_gx = l_gf * 255. "#EC NUMBER_OK
l_bx = l_bf * 255. "#EC NUMBER_OK
* Build hext RGB value
IF little_endian = abap_true.
rgb24_hex+2(1) = l_rx.
rgb24_hex+1(1) = l_gx.
rgb24_hex(1) = l_bx.
ELSE.
rgb24_hex(1) = l_rx.
rgb24_hex+1(1) = l_gx.
rgb24_hex+2(1) = l_bx.
ENDIF.
ENDMETHOD.
METHOD to_rgb24_int.
DATA l_rgb24_hex TYPE /gal/color_rgb24_hex.
l_RGB24_hex = to_rgb24_hex( little_endian = little_endian ).
rgb24_int = l_rgb24_hex.
ENDMETHOD.
ENDCLASS.
| [
4871,
1220,
38,
1847,
14,
46786,
62,
36982,
6770,
198,
220,
1171,
198,
220,
10639,
1780,
422,
1220,
38,
1847,
14,
46786,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
198,
220,
2099,
12,
7742,
82,
9564,
2969,
764,
628,
220,
1366,
371,
2099,
376,
1100,
12,
8807,
764,
198,
220,
1366,
402,
2099,
376,
1100,
12,
8807,
764,
198,
220,
1366,
347,
2099,
376,
1100,
12,
8807,
764,
628,
220,
1398,
12,
24396,
82,
16034,
62,
36982,
1731,
62,
39,
6369,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
36982,
1731,
62,
39,
6369,
2099,
1395,
5188,
10917,
18310,
198,
220,
220,
220,
220,
220,
5145,
43,
22470,
2538,
62,
10619,
16868,
2099,
9564,
2969,
62,
8202,
3535,
4277,
9564,
2969,
62,
37,
23719,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
46786,
62,
36982,
8,
2099,
1006,
284,
1220,
38,
1847,
14,
46786,
62,
36982,
764,
198,
220,
1398,
12,
24396,
82,
16034,
62,
36982,
1731,
62,
12394,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
36982,
1731,
62,
12394,
2099,
314,
198,
220,
220,
220,
220,
220,
5145,
43,
22470,
2538,
62,
10619,
16868,
2099,
9564,
2969,
62,
8202,
3535,
4277,
9564,
2969,
62,
5446,
8924,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
46786,
62,
36982,
8,
2099,
1006,
284,
1220,
38,
1847,
14,
46786,
62,
36982,
764,
198,
220,
5050,
7102,
46126,
1581,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
49,
2099,
36871,
1137,
2149,
198,
220,
220,
220,
220,
220,
5145,
38,
2099,
36871,
1137,
2149,
198,
220,
220,
220,
220,
220,
5145,
33,
2099,
36871,
1137,
2149,
764,
198,
220,
5050,
17151,
62,
46786,
62,
13775,
62,
49155,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
46786,
8,
2099,
19269,
2751,
764,
198,
220,
5050,
337,
10426,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
46786,
62,
36982,
2099,
1006,
284,
1220,
38,
1847,
14,
46786,
62,
36982,
198,
220,
220,
220,
220,
220,
5145,
49,
1404,
9399,
2099,
36871,
1137,
2149,
4277,
705,
15,
13,
20,
6,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
19535,
16724,
8,
2099,
1006,
284,
1220,
38,
1847,
14,
46786,
62,
36982,
764,
198,
220,
5050,
5390,
62,
36982,
1731,
62,
39,
6369,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
43,
22470,
2538,
62,
10619,
16868,
2099,
9564,
2969,
62,
8202,
3535,
4277,
9564,
2969,
62,
37,
23719,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
36982,
1731,
62,
39,
6369,
8,
2099,
1220,
38,
1847,
14,
46786,
62,
36982,
1731,
62,
39,
6369,
764,
198,
220,
5050,
5390,
62,
36982,
1731,
62,
12394,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
43,
22470,
2538,
62,
10619,
16868,
2099,
9564,
2969,
62,
8202,
3535,
4277,
9564,
2969,
62,
5446,
8924,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
36982,
1731,
62,
12394,
8,
2099,
314,
764,
198,
24326,
2665,
13,
198,
19734,
2665,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1220,
38,
1847,
14,
46786,
62,
36982,
30023,
2538,
10979,
6234,
13,
628,
198,
49273,
23772,
13,
198,
220,
42865,
300,
62,
4906,
41876,
269,
13,
628,
220,
2208,
3784,
41571,
273,
7,
6739,
628,
220,
22196,
34,
7112,
12473,
18930,
24639,
374,
41876,
300,
62,
4906,
13,
628,
220,
16876,
300,
62,
4906,
7257,
705,
4462,
40,
4458,
198,
220,
220,
220,
502,
3784,
81,
796,
374,
1220,
14280,
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,
25113,
2943,
36871,
13246,
62,
11380,
198,
220,
17852,
5188,
13,
198,
220,
220,
220,
502,
3784,
81,
796,
374,
13,
198,
220,
23578,
5064,
13,
628,
220,
16876,
502,
3784,
81,
1279,
657,
13,
198,
220,
220,
220,
502,
3784,
81,
796,
657,
13,
198,
220,
17852,
5188,
5064,
502,
3784,
81,
1875,
352,
13,
198,
220,
220,
220,
502,
3784,
81,
796,
352,
13,
198,
220,
23578,
5064,
13,
628,
220,
22196,
34,
7112,
12473,
18930,
24639,
308,
41876,
300,
62,
4906,
13,
628,
220,
16876,
300,
62,
4906,
7257,
705,
4462,
40,
4458,
198,
220,
220,
220,
502,
3784,
70,
796,
308,
1220,
14280,
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,
25113,
2943,
36871,
13246,
62,
11380,
198,
220,
17852,
5188,
13,
198,
220,
220,
220,
502,
3784,
70,
796,
308,
13,
198,
220,
23578,
5064,
13,
628,
220,
16876,
502,
3784,
70,
1279,
657,
13,
198,
220,
220,
220,
502,
3784,
70,
796,
657,
13,
198,
220,
17852,
5188,
5064,
502,
3784,
70,
1875,
352,
13,
198,
220,
220,
220,
502,
3784,
70,
796,
352,
13,
198,
220,
23578,
5064,
13,
628,
220,
22196,
34,
7112,
12473,
18930,
24639,
275,
41876,
300,
62,
4906,
13,
628,
220,
16876,
300,
62,
4906,
7257,
705,
4462,
40,
4458,
198,
220,
220,
220,
502,
3784,
65,
796,
275,
1220,
14280,
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,
25113,
2943,
36871,
13246,
62,
11380,
198,
220,
17852,
5188,
13,
198,
220,
220,
220,
502,
3784,
65,
796,
275,
13,
198,
220,
23578,
5064,
13,
628,
220,
16876,
502,
3784,
65,
1279,
657,
13,
198,
220,
220,
220,
502,
3784,
65,
796,
657,
13,
198,
220,
17852,
5188,
5064,
502,
3784,
65,
1875,
352,
13,
198,
220,
220,
220,
502,
3784,
65,
796,
352,
13,
198,
220,
23578,
5064,
13,
198,
10619,
49273,
13,
628,
198,
49273,
422,
62,
81,
22296,
1731,
62,
33095
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abappgp_packet_06 DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abappgp_packet .
ALIASES from_stream
FOR zif_abappgp_packet~from_stream .
ALIASES get_name
FOR zif_abappgp_packet~get_name .
ALIASES get_tag
FOR zif_abappgp_packet~get_tag .
ALIASES to_stream
FOR zif_abappgp_packet~to_stream .
METHODS constructor
IMPORTING
!iv_version TYPE zif_abappgp_constants=>ty_version
!iv_time TYPE i
!iv_algorithm TYPE zif_abappgp_constants=>ty_algorithm_pub
!io_key TYPE REF TO zcl_abappgp_rsa_public_key .
PROTECTED SECTION.
DATA mo_key TYPE REF TO zcl_abappgp_rsa_public_key .
DATA mv_algorithm TYPE zif_abappgp_constants=>ty_algorithm_pub .
DATA mv_time TYPE i .
DATA mv_version TYPE zif_abappgp_constants=>ty_version .
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_ABAPPGP_PACKET_06 IMPLEMENTATION.
METHOD constructor.
mo_key = io_key.
mv_algorithm = iv_algorithm.
mv_time = iv_time.
mv_version = iv_version.
ENDMETHOD.
METHOD zif_abappgp_packet~dump.
rv_dump = |{ get_name( )
}(tag { get_tag( )
})({ to_stream( )->get_length( ) } bytes)\n\tVersion\t{
mv_version }\n\tTime\t\t{
zcl_abappgp_time=>format_unix( mv_time ) }\n\tAlgorithm\t{
mv_algorithm }\n\tRSA n\t\t{
mo_key->get_n( )->get_binary_length( ) } bits\n\tRSA e\t\t{
mo_key->get_e( )->get_binary_length( ) } bits\n|.
ENDMETHOD.
METHOD zif_abappgp_packet~from_stream.
DATA: lv_version TYPE x LENGTH 1,
lv_algorithm TYPE x LENGTH 1,
lv_time TYPE i,
lo_key TYPE REF TO zcl_abappgp_rsa_public_key,
lo_n TYPE REF TO zcl_abappgp_integer,
lo_e TYPE REF TO zcl_abappgp_integer.
lv_version = io_stream->eat_octet( ).
ASSERT lv_version = zif_abappgp_constants=>c_version-version04.
lv_time = io_stream->eat_time( ).
lv_algorithm = io_stream->eat_octet( ).
ASSERT lv_algorithm = zif_abappgp_constants=>c_algorithm_pub-rsa.
lo_n = io_stream->eat_mpi( ).
lo_e = io_stream->eat_mpi( ).
CREATE OBJECT lo_key
EXPORTING
io_n = lo_n
io_e = lo_e.
CREATE OBJECT ri_packet
TYPE zcl_abappgp_packet_06
EXPORTING
iv_version = lv_version
iv_time = lv_time
iv_algorithm = lv_algorithm
io_key = lo_key.
ENDMETHOD.
METHOD zif_abappgp_packet~get_name.
rv_name = 'Public-Key Packet'(001).
ENDMETHOD.
METHOD zif_abappgp_packet~get_tag.
rv_tag = zif_abappgp_constants=>c_tag-public_key.
ENDMETHOD.
METHOD zif_abappgp_packet~to_stream.
CREATE OBJECT ro_stream.
ro_stream->write_octet( mv_version ).
ro_stream->write_time( mv_time ).
ro_stream->write_octet( mv_algorithm ).
ro_stream->write_mpi( mo_key->get_n( ) ).
ro_stream->write_mpi( mo_key->get_e( ) ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
1324,
31197,
62,
8002,
316,
62,
3312,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
764,
628,
220,
220,
220,
8355,
43429,
1546,
422,
62,
5532,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
93,
6738,
62,
5532,
764,
198,
220,
220,
220,
8355,
43429,
1546,
651,
62,
3672,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
93,
1136,
62,
3672,
764,
198,
220,
220,
220,
8355,
43429,
1546,
651,
62,
12985,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
93,
1136,
62,
12985,
764,
198,
220,
220,
220,
8355,
43429,
1546,
284,
62,
5532,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
93,
1462,
62,
5532,
764,
628,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
9641,
220,
220,
41876,
1976,
361,
62,
397,
1324,
31197,
62,
9979,
1187,
14804,
774,
62,
9641,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
2435,
220,
220,
220,
220,
220,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
282,
42289,
41876,
1976,
361,
62,
397,
1324,
31197,
62,
9979,
1187,
14804,
774,
62,
282,
42289,
62,
12984,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
2539,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
1324,
31197,
62,
3808,
64,
62,
11377,
62,
2539,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
42865,
6941,
62,
2539,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
1324,
31197,
62,
3808,
64,
62,
11377,
62,
2539,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
282,
42289,
41876,
1976,
361,
62,
397,
1324,
31197,
62,
9979,
1187,
14804,
774,
62,
282,
42289,
62,
12984,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
2435,
41876,
1312,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
9641,
41876,
1976,
361,
62,
397,
1324,
31197,
62,
9979,
1187,
14804,
774,
62,
9641,
764,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
6968,
47,
62,
47,
8120,
2767,
62,
3312,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
6941,
62,
2539,
220,
220,
220,
220,
220,
220,
796,
33245,
62,
2539,
13,
198,
220,
220,
220,
285,
85,
62,
282,
42289,
796,
21628,
62,
282,
42289,
13,
198,
220,
220,
220,
285,
85,
62,
2435,
220,
220,
220,
220,
220,
796,
21628,
62,
2435,
13,
198,
220,
220,
220,
285,
85,
62,
9641,
220,
220,
796,
21628,
62,
9641,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
93,
39455,
13,
628,
220,
220,
220,
374,
85,
62,
39455,
796,
930,
90,
651,
62,
3672,
7,
1267,
198,
220,
220,
220,
220,
220,
1782,
7,
12985,
1391,
651,
62,
12985,
7,
1267,
198,
220,
220,
220,
220,
220,
1782,
5769,
90,
284,
62,
5532,
7,
1267,
3784,
1136,
62,
13664,
7,
1267,
1782,
9881,
19415,
77,
59,
83,
14815,
59,
83,
90,
198,
220,
220,
220,
220,
220,
285,
85,
62,
9641,
1782,
59,
77,
59,
83,
7575,
59,
83,
59,
83,
90,
198,
220,
220,
220,
220,
220,
1976,
565,
62,
397,
1324,
31197,
62,
2435,
14804,
18982,
62,
403,
844,
7,
285,
85,
62,
2435,
1267,
1782,
59,
77,
59,
83,
2348,
42289,
59,
83,
90,
198,
220,
220,
220,
220,
220,
285,
85,
62,
282,
42289,
1782,
59,
77,
59,
83,
49,
4090,
299,
59,
83,
59,
83,
90,
198,
220,
220,
220,
220,
220,
6941,
62,
2539,
3784,
1136,
62,
77,
7,
1267,
3784,
1136,
62,
39491,
62,
13664,
7,
1267,
1782,
10340,
59,
77,
59,
83,
49,
4090,
304,
59,
83,
59,
83,
90,
198,
220,
220,
220,
220,
220,
6941,
62,
2539,
3784,
1136,
62,
68,
7,
1267,
3784,
1136,
62,
39491,
62,
13664,
7,
1267,
1782,
10340,
59,
77,
91,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
93,
6738,
62,
5532,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
9641,
220,
220,
41876,
2124,
406,
49494,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
282,
42289,
41876,
2124,
406,
49494,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
2435,
220,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
2539,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
1324,
31197,
62,
3808,
64,
62,
11377,
62,
2539,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
77,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
1324,
31197,
62,
41433,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
68,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
1324,
31197,
62,
41433,
13,
628,
198,
220,
220,
220,
300,
85,
62,
9641,
796,
33245,
62,
5532,
3784,
4098,
62,
38441,
316,
7,
6739,
198,
220,
220,
220,
24994,
17395,
300,
85,
62,
9641,
796,
1976,
361,
62,
397,
1324,
31197,
62,
9979,
1187,
14804,
66,
62,
9641,
12,
9641,
3023,
13,
628,
220,
220,
220,
300,
85,
62,
2435,
796,
33245,
62,
5532,
3784,
4098,
62,
2435,
7,
6739,
628,
220,
220,
220,
300,
85,
62,
282,
42289,
796,
33245,
62,
5532,
3784,
4098,
62,
38441,
316,
7,
6739,
198,
220,
220,
220,
24994,
17395,
300,
85,
62,
282,
42289,
796,
1976,
361,
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,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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
] |
CLASS ycl_abapgit_tag_popups DEFINITION
PUBLIC
FINAL
CREATE PRIVATE
GLOBAL FRIENDS ycl_abapgit_ui_factory.
PUBLIC SECTION.
INTERFACES: yif_abapgit_tag_popups.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_tag_out.
INCLUDE TYPE yif_abapgit_definitions=>ty_git_tag.
TYPES: body_icon TYPE icon_d,
END OF ty_tag_out,
tty_tag_out TYPE STANDARD TABLE OF ty_tag_out
WITH NON-UNIQUE DEFAULT KEY.
DATA:
mt_tags TYPE tty_tag_out,
mo_docking_container TYPE REF TO cl_gui_docking_container,
mo_text_control TYPE REF TO cl_gui_textedit.
METHODS:
on_double_click FOR EVENT double_click OF cl_salv_events_table
IMPORTING row column,
prepare_tags_for_display
IMPORTING
it_tags TYPE yif_abapgit_definitions=>ty_git_tag_list_tt
RETURNING
VALUE(rt_tags_out) TYPE ycl_abapgit_tag_popups=>tty_tag_out,
clean_up,
show_docking_container_with
IMPORTING
iv_text TYPE string.
ENDCLASS.
CLASS ycl_abapgit_tag_popups IMPLEMENTATION.
METHOD clean_up.
IF mo_text_control IS BOUND.
mo_text_control->finalize( ).
mo_text_control->free(
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3 ).
ASSERT sy-subrc = 0.
CLEAR: mo_text_control.
ENDIF.
IF mo_docking_container IS BOUND.
mo_docking_container->finalize( ).
mo_docking_container->free(
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
OTHERS = 3 ).
ASSERT sy-subrc = 0.
CLEAR: mo_docking_container.
ENDIF.
ENDMETHOD.
METHOD on_double_click.
FIELD-SYMBOLS: <ls_tag> TYPE ycl_abapgit_tag_popups=>ty_tag_out.
READ TABLE mt_tags ASSIGNING <ls_tag>
INDEX row.
IF sy-subrc <> 0 OR <ls_tag>-body IS INITIAL.
RETURN.
ENDIF.
show_docking_container_with( <ls_tag>-body ).
ENDMETHOD.
METHOD prepare_tags_for_display.
DATA: ls_tag_out LIKE LINE OF rt_tags_out.
FIELD-SYMBOLS: <ls_tag> TYPE yif_abapgit_definitions=>ty_git_tag.
LOOP AT it_tags ASSIGNING <ls_tag>.
CLEAR: ls_tag_out.
MOVE-CORRESPONDING <ls_tag> TO ls_tag_out.
ls_tag_out-name = ycl_abapgit_tag=>remove_tag_prefix( ls_tag_out-name ).
IF ls_tag_out-body IS NOT INITIAL.
ls_tag_out-body_icon = |{ icon_display_text }|.
ENDIF.
INSERT ls_tag_out INTO TABLE rt_tags_out.
ENDLOOP.
ENDMETHOD.
METHOD show_docking_container_with.
IF mo_docking_container IS NOT BOUND.
CREATE OBJECT mo_docking_container
EXPORTING
side = cl_gui_docking_container=>dock_at_bottom
extension = 120
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6.
ASSERT sy-subrc = 0.
ENDIF.
IF mo_text_control IS NOT BOUND.
CREATE OBJECT mo_text_control
EXPORTING
parent = mo_docking_container
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
gui_type_not_supported = 5
OTHERS = 6.
ASSERT sy-subrc = 0.
mo_text_control->set_readonly_mode(
EXCEPTIONS
error_cntl_call_method = 1
invalid_parameter = 2
OTHERS = 3 ).
ASSERT sy-subrc = 0.
ENDIF.
mo_text_control->set_textstream(
EXPORTING
text = iv_text
EXCEPTIONS
error_cntl_call_method = 1
not_supported_by_gui = 2
OTHERS = 3 ).
ASSERT sy-subrc = 0.
ENDMETHOD.
METHOD yif_abapgit_tag_popups~tag_list_popup.
DATA: lo_alv TYPE REF TO cl_salv_table,
lo_table_header TYPE REF TO cl_salv_form_header_info,
lo_columns TYPE REF TO cl_salv_columns_table,
lx_alv TYPE REF TO cx_salv_error,
lt_tags TYPE yif_abapgit_definitions=>ty_git_tag_list_tt,
lo_event TYPE REF TO cl_salv_events_table.
CLEAR: mt_tags.
lt_tags = ycl_abapgit_factory=>get_branch_overview( io_repo = io_repo )->get_tags( ).
IF lines( lt_tags ) = 0.
ycx_abapgit_exception=>raise( `There are no tags for this repository` ).
ENDIF.
mt_tags = prepare_tags_for_display( lt_tags ).
TRY.
cl_salv_table=>factory(
IMPORTING
r_salv_table = lo_alv
CHANGING
t_table = mt_tags ).
lo_columns = lo_alv->get_columns( ).
lo_columns->get_column( `TYPE` )->set_technical( ).
lo_columns->get_column( `DISPLAY_NAME` )->set_technical( ).
lo_columns->get_column( `BODY` )->set_technical( ).
lo_columns->get_column( `NAME` )->set_medium_text( 'Tag name' ).
lo_columns->set_column_position( columnname = 'NAME'
position = 1 ).
lo_columns->get_column( `TAGGER_NAME` )->set_medium_text( 'Tagger' ).
lo_columns->set_column_position( columnname = 'TAGGER_NAME'
position = 2 ).
lo_columns->get_column( `TAGGER_EMAIL` )->set_medium_text( 'Tagger E-Mail' ).
lo_columns->set_column_position( columnname = 'TAGGER_EMAIL'
position = 3 ).
lo_columns->get_column( `MESSAGE` )->set_medium_text( 'Tag message' ).
lo_columns->set_column_position( columnname = 'MESSAGE'
position = 4 ).
lo_columns->get_column( `BODY_ICON` )->set_medium_text( 'Body' ).
lo_columns->get_column( `BODY_ICON` )->set_output_length( 4 ).
lo_columns->set_column_position( columnname = 'BODY_ICON'
position = 5 ).
lo_columns->get_column( `SHA1` )->set_output_length( 15 ).
lo_columns->get_column( `SHA1` )->set_medium_text( 'SHA' ).
lo_columns->set_column_position( columnname = 'SHA1'
position = 6 ).
lo_columns->get_column( `OBJECT` )->set_output_length( 15 ).
lo_columns->get_column( `OBJECT` )->set_medium_text( 'Object' ).
lo_columns->set_column_position( columnname = 'OBJECT'
position = 7 ).
lo_columns->set_optimize( ).
lo_alv->set_screen_popup( start_column = 7
end_column = 200
start_line = 1
end_line = 25 ).
CREATE OBJECT lo_table_header
EXPORTING
text = `Tags`.
lo_alv->set_top_of_list( lo_table_header ).
lo_event = lo_alv->get_event( ).
SET HANDLER on_double_click FOR lo_event.
lo_alv->display( ).
CATCH cx_salv_error INTO lx_alv.
ycx_abapgit_exception=>raise( lx_alv->get_text( ) ).
ENDTRY.
clean_up( ).
ENDMETHOD.
METHOD yif_abapgit_tag_popups~tag_select_popup.
DATA: lt_tags TYPE yif_abapgit_definitions=>ty_git_tag_list_tt,
lv_answer TYPE c LENGTH 1,
lt_selection TYPE TABLE OF spopli,
lv_name_with_prefix TYPE string.
FIELD-SYMBOLS: <ls_sel> LIKE LINE OF lt_selection,
<ls_tag> LIKE LINE OF lt_tags.
lt_tags = ycl_abapgit_factory=>get_branch_overview( io_repo = io_repo )->get_tags( ).
IF lines( lt_tags ) = 0.
ycx_abapgit_exception=>raise( `There are no tags for this repository` ).
ENDIF.
LOOP AT lt_tags ASSIGNING <ls_tag>.
INSERT INITIAL LINE INTO lt_selection INDEX 1 ASSIGNING <ls_sel>.
<ls_sel>-varoption = ycl_abapgit_tag=>remove_tag_prefix( <ls_tag>-name ).
ENDLOOP.
CALL FUNCTION 'POPUP_TO_DECIDE_LIST'
EXPORTING
textline1 = 'Select tag'
titel = 'Select tag'
start_col = 30
start_row = 5
IMPORTING
answer = lv_answer
TABLES
t_spopli = lt_selection
EXCEPTIONS
not_enough_answers = 1
too_much_answers = 2
too_much_marks = 3
OTHERS = 4.
IF sy-subrc <> 0.
ycx_abapgit_exception=>raise( 'Error from POPUP_TO_DECIDE_LIST' ).
ENDIF.
IF lv_answer = 'A'.
RETURN.
ENDIF.
READ TABLE lt_selection ASSIGNING <ls_sel> WITH KEY selflag = abap_true.
ASSERT sy-subrc = 0.
lv_name_with_prefix = ycl_abapgit_tag=>add_tag_prefix( <ls_sel>-varoption ).
READ TABLE lt_tags ASSIGNING <ls_tag> WITH KEY name = lv_name_with_prefix.
ASSERT sy-subrc = 0.
rs_tag = <ls_tag>.
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
565,
62,
397,
499,
18300,
62,
12985,
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,
331,
565,
62,
397,
499,
18300,
62,
9019,
62,
69,
9548,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
25,
331,
361,
62,
397,
499,
18300,
62,
12985,
62,
12924,
4739,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
12985,
62,
448,
13,
198,
220,
220,
220,
220,
220,
220,
220,
3268,
5097,
52,
7206,
41876,
331,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
18300,
62,
12985,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
1767,
62,
4749,
41876,
7196,
62,
67,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
12985,
62,
448,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
774,
62,
12985,
62,
448,
41876,
49053,
9795,
43679,
3963,
1259,
62,
12985,
62,
448,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
13,
628,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
45079,
62,
31499,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
256,
774,
62,
12985,
62,
448,
11,
198,
220,
220,
220,
220,
220,
6941,
62,
67,
8629,
62,
34924,
41876,
4526,
37,
5390,
537,
62,
48317,
62,
67,
8629,
62,
34924,
11,
198,
220,
220,
220,
220,
220,
6941,
62,
5239,
62,
13716,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
537,
62,
48317,
62,
5239,
19312,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
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,
5752,
5721,
11,
628,
220,
220,
220,
220,
220,
8335,
62,
31499,
62,
1640,
62,
13812,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
31499,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
331,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
18300,
62,
12985,
62,
4868,
62,
926,
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,
31499,
62,
448,
8,
41876,
331,
565,
62,
397,
499,
18300,
62,
12985,
62,
12924,
4739,
14804,
42852,
62,
12985,
62,
448,
11,
628,
220,
220,
220,
220,
220,
3424,
62,
929,
11,
628,
220,
220,
220,
220,
220,
905,
62,
67,
8629,
62,
34924,
62,
4480,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
5239,
41876,
4731,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
331,
565,
62,
397,
499,
18300,
62,
12985,
62,
12924,
4739,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
3424,
62,
929,
13,
628,
220,
220,
220,
16876,
6941,
62,
5239,
62,
13716,
3180,
347,
15919,
13,
628,
220,
220,
220,
220,
220,
6941,
62,
5239,
62,
13716,
3784,
20311,
1096,
7,
6739,
198,
220,
220,
220,
220,
220,
6941,
62,
5239,
62,
13716,
3784,
5787,
7,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
429,
75,
62,
18224,
220,
220,
220,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
429,
75,
62,
10057,
62,
18224,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
513,
6739,
198,
220,
220,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
628,
220,
220,
220,
220,
220,
30301,
1503,
25,
6941,
62,
5239,
62,
13716,
13,
628,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
16876,
6941,
62,
67,
8629,
62,
34924,
3180,
347,
15919,
13,
628,
220,
220,
220,
220,
220,
6941,
62,
67,
8629,
62,
34924,
3784,
20311,
1096,
7,
6739,
198,
220,
220,
220,
220,
220,
6941,
62,
67,
8629,
62,
34924,
3784,
5787,
7,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
429,
75,
62,
18224,
220,
220,
220,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
429,
75,
62,
10057,
62,
18224,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
513,
6739,
198,
220,
220,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
628,
220,
220,
220,
220,
220,
30301,
1503,
25,
6941,
62,
67,
8629,
62,
34924,
13,
628,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
319,
62,
23352,
62,
12976,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
12985,
29,
41876,
331,
565,
62,
397,
499,
18300,
62,
12985,
62,
12924,
4739,
14804,
774,
62,
12985,
62,
448,
13,
628,
220,
220,
220,
20832,
43679,
45079,
62,
31499,
24994,
3528,
15871,
1279,
7278,
62,
12985,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
24413,
6369,
5752,
13,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
6375,
1279,
7278,
62,
12985,
29,
12,
2618,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
30826,
27064,
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,
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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
] |
CLASS ltcl_demo DEFINITION FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS
.
*?<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
*?<asx:values>
*?<TESTCLASS_OPTIONS>
*?<TEST_CLASS>ltcl_Demo
*?</TEST_CLASS>
*?<TEST_MEMBER>f_Cut
*?</TEST_MEMBER>
*?<OBJECT_UNDER_TEST>ZCL_TRCKTRSR_CONVERSION_EXIT
*?</OBJECT_UNDER_TEST>
*?<OBJECT_IS_LOCAL/>
*?<GENERATE_FIXTURE/>
*?<GENERATE_CLASS_FIXTURE/>
*?<GENERATE_INVOCATION/>
*?<GENERATE_ASSERT_EQUAL>X
*?</GENERATE_ASSERT_EQUAL>
*?</TESTCLASS_OPTIONS>
*?</asx:values>
*?</asx:abap>
PRIVATE SECTION.
METHODS number_input_output_alpha FOR TESTING.
METHODS number_output_input_alpha FOR TESTING.
METHODS char_input_output_alpha FOR TESTING.
METHODS char_output_input_alpha FOR TESTING.
ENDCLASS. "ltcl_Demo
CLASS ltcl_demo IMPLEMENTATION.
METHOD number_input_output_alpha.
cl_abap_unit_assert=>assert_equals(
act = zcl_trcktrsr_conversion_exit=>for_rollname( 'VBELN' )->output( '0000012345' )
exp = '12345' ).
ENDMETHOD.
METHOD number_output_input_alpha.
cl_abap_unit_assert=>assert_equals(
act = zcl_trcktrsr_conversion_exit=>for_rollname( 'VBELN' )->input( '12345' )
exp = '0000012345' ).
ENDMETHOD.
METHOD char_input_output_alpha.
cl_abap_unit_assert=>assert_equals(
act = zcl_trcktrsr_conversion_exit=>for_rollname( 'VBELN' )->output( 'ABC' )
exp = 'ABC' ).
ENDMETHOD.
METHOD char_output_input_alpha.
cl_abap_unit_assert=>assert_equals(
act = zcl_trcktrsr_conversion_exit=>for_rollname( 'VBELN' )->input( 'ABC' )
exp = 'ABC' ).
ENDMETHOD.
ENDCLASS.
| [
198,
31631,
300,
83,
565,
62,
9536,
78,
5550,
20032,
17941,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
198,
13,
198,
9,
30,
171,
119,
123,
27,
292,
87,
25,
397,
499,
35555,
5907,
25,
292,
87,
2625,
4023,
1378,
2503,
13,
82,
499,
13,
785,
14,
397,
499,
19875,
1,
2196,
2625,
16,
13,
15,
5320,
198,
9,
30,
27,
292,
87,
25,
27160,
29,
198,
9,
30,
27,
51,
1546,
4825,
43,
10705,
62,
3185,
51,
11053,
29,
198,
9,
30,
27,
51,
6465,
62,
31631,
29,
2528,
565,
62,
11522,
78,
198,
9,
30,
3556,
51,
6465,
62,
31631,
29,
198,
9,
30,
27,
51,
6465,
62,
44,
28952,
29,
69,
62,
26254,
198,
9,
30,
3556,
51,
6465,
62,
44,
28952,
29,
198,
9,
30,
27,
9864,
23680,
62,
4944,
14418,
62,
51,
6465,
29,
57,
5097,
62,
5446,
34,
42,
5446,
12562,
62,
10943,
43717,
62,
6369,
2043,
198,
9,
30,
3556,
9864,
23680,
62,
4944,
14418,
62,
51,
6465,
29,
198,
9,
30,
27,
9864,
23680,
62,
1797,
62,
29701,
1847,
15913,
198,
9,
30,
27,
35353,
1137,
6158,
62,
47084,
51,
11335,
15913,
198,
9,
30,
27,
35353,
1137,
6158,
62,
31631,
62,
47084,
51,
11335,
15913,
198,
9,
30,
27,
35353,
1137,
6158,
62,
1268,
53,
4503,
6234,
15913,
198,
9,
30,
27,
35353,
1137,
6158,
62,
10705,
17395,
62,
36,
10917,
1847,
29,
55,
198,
9,
30,
3556,
35353,
1137,
6158,
62,
10705,
17395,
62,
36,
10917,
1847,
29,
198,
9,
30,
3556,
51,
1546,
4825,
43,
10705,
62,
3185,
51,
11053,
29,
198,
9,
30,
3556,
292,
87,
25,
27160,
29,
198,
9,
30,
3556,
292,
87,
25,
397,
499,
29,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
1271,
62,
15414,
62,
22915,
62,
26591,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
1271,
62,
22915,
62,
15414,
62,
26591,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
1149,
62,
15414,
62,
22915,
62,
26591,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
1149,
62,
22915,
62,
15414,
62,
26591,
7473,
43001,
2751,
13,
198,
198,
10619,
31631,
13,
220,
220,
220,
220,
220,
220,
366,
2528,
565,
62,
11522,
78,
628,
198,
31631,
300,
83,
565,
62,
9536,
78,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
1271,
62,
15414,
62,
22915,
62,
26591,
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,
220,
220,
796,
1976,
565,
62,
2213,
694,
2213,
27891,
62,
1102,
9641,
62,
37023,
14804,
1640,
62,
2487,
3672,
7,
705,
44526,
3698,
45,
6,
1267,
3784,
22915,
7,
705,
2388,
486,
1954,
2231,
6,
1267,
198,
220,
220,
220,
220,
220,
1033,
220,
220,
796,
705,
10163,
2231,
6,
220,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1271,
62,
22915,
62,
15414,
62,
26591,
13,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
198,
220,
220,
220,
719,
220,
220,
796,
1976,
565,
62,
2213,
694,
2213,
27891,
62,
1102,
9641,
62,
37023,
14804,
1640,
62,
2487,
3672,
7,
705,
44526,
3698,
45,
6,
1267,
3784,
15414,
7,
705,
10163,
2231,
6,
1267,
198,
220,
220,
220,
1033,
220,
220,
796,
705,
2388,
486,
1954,
2231,
6,
220,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1149,
62,
15414,
62,
22915,
62,
26591,
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,
220,
220,
796,
1976,
565,
62,
2213,
694,
2213,
27891,
62,
1102,
9641,
62,
37023,
14804,
1640,
62,
2487,
3672,
7,
705,
44526,
3698,
45,
6,
1267,
3784,
22915,
7,
705,
24694,
6,
1267,
198,
220,
220,
220,
220,
220,
1033,
220,
220,
796,
705,
24694,
6,
220,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1149,
62,
22915,
62,
15414,
62,
26591,
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,
220,
220,
796,
1976,
565,
62,
2213,
694,
2213,
27891,
62,
1102,
9641,
62,
37023,
14804,
1640,
62,
2487,
3672,
7,
705,
44526,
3698,
45,
6,
1267,
3784,
15414,
7,
705,
24694,
6,
1267,
198,
220,
220,
220,
220,
220,
1033,
220,
220,
796,
705,
24694,
6,
220,
6739,
198,
220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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 ZDBGL_SNAPSHOTS
*& This sample reports shows how to create and use snapshots
*& in ABAP unit testing.
*&---------------------------------------------------------------------*
REPORT ZDBGL_SNAPSHOTS.
CLASS test_snapshot DEFINITION FOR TESTING
DURATION SHORT RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS flight_test FOR TESTING
RAISING zcx_dbgl_snapshot.
ENDCLASS.
CLASS test_snapshot IMPLEMENTATION.
METHOD flight_test.
DATA(snapshot_manager) = CAST zif_dbgl_snapshots(
NEW zdbgl_snapshots_tdc( key_tdc_variant =
VALUE #( name = 'ZDBGL_TEST_SNAPSHOT1' version = 1 variant_name = 'ECATTDEFAULT' )
)
).
DATA(carrier) = VALUE scarr_tab(
( carrid = 'SAP' carrname = 'SAP Flights' )
( carrid = 'IN' carrname = 'Internat. Airways' )
).
DATA(flight) = VALUE sflight( carrid = 'SAP' connid = 700 fldate = '20201231' ).
snapshot_manager->compare_or_record( name = 'CARRIER' actual = carrier ).
snapshot_manager->compare_or_record( name = 'FLIGHT' actual = flight ).
" can be omitted, when autosave = abap_true in constructor
snapshot_manager->commit_changes( ).
ENDMETHOD.
ENDCLASS.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
220,
1168,
11012,
8763,
62,
15571,
2969,
9693,
33472,
198,
9,
5,
770,
6291,
3136,
2523,
703,
284,
2251,
290,
779,
47787,
198,
9,
5,
287,
9564,
2969,
4326,
4856,
13,
198,
9,
5,
10097,
30934,
9,
198,
2200,
15490,
1168,
11012,
8763,
62,
15571,
2969,
9693,
33472,
13,
198,
198,
31631,
1332,
62,
45380,
9442,
5550,
20032,
17941,
7473,
43001,
2751,
198,
220,
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,
5474,
62,
9288,
7473,
43001,
2751,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
1976,
66,
87,
62,
9945,
4743,
62,
45380,
9442,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
1332,
62,
45380,
9442,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
5474,
62,
9288,
13,
628,
220,
220,
220,
42865,
7,
45380,
9442,
62,
37153,
8,
796,
327,
11262,
1976,
361,
62,
9945,
4743,
62,
45380,
20910,
7,
198,
220,
220,
220,
220,
220,
12682,
1976,
9945,
4743,
62,
45380,
20910,
62,
8671,
66,
7,
1994,
62,
8671,
66,
62,
25641,
415,
796,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
1303,
7,
1438,
796,
705,
57,
11012,
8763,
62,
51,
6465,
62,
15571,
2969,
9693,
2394,
16,
6,
2196,
796,
352,
15304,
62,
3672,
796,
705,
2943,
17139,
7206,
38865,
6,
1267,
198,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
6739,
628,
220,
220,
220,
42865,
7,
7718,
5277,
8,
796,
26173,
8924,
629,
3258,
62,
8658,
7,
198,
220,
220,
220,
220,
220,
357,
1097,
6058,
796,
705,
50,
2969,
6,
1097,
81,
3672,
796,
705,
50,
2969,
1610,
2337,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
1097,
6058,
796,
705,
1268,
6,
1097,
81,
3672,
796,
705,
15865,
265,
13,
40020,
6,
1267,
198,
220,
220,
220,
6739,
198,
220,
220,
220,
42865,
7,
22560,
8,
796,
26173,
8924,
264,
22560,
7,
1097,
6058,
796,
705,
50,
2969,
6,
48260,
312,
796,
13037,
277,
335,
378,
796,
705,
1238,
1264,
25667,
6,
6739,
628,
220,
220,
220,
27479,
62,
37153,
3784,
5589,
533,
62,
273,
62,
22105,
7,
1438,
796,
705,
20034,
7112,
1137,
6,
4036,
796,
11920,
6739,
198,
220,
220,
220,
27479,
62,
37153,
3784,
5589,
533,
62,
273,
62,
22105,
7,
1438,
796,
705,
3697,
9947,
6,
4036,
796,
5474,
6739,
628,
220,
220,
220,
366,
460,
307,
22532,
11,
618,
44619,
1015,
796,
450,
499,
62,
7942,
287,
23772,
198,
220,
220,
220,
27479,
62,
37153,
3784,
41509,
62,
36653,
7,
6739,
628,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_ex_pckage DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_gui_component
FINAL
CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES zif_abapgit_gui_event_handler.
INTERFACES zif_abapgit_gui_renderable.
CLASS-METHODS create
RETURNING
VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable
RAISING
zcx_abapgit_exception.
METHODS constructor
RAISING
zcx_abapgit_exception.
PROTECTED SECTION.
PRIVATE SECTION.
CONSTANTS:
BEGIN OF c_id,
package TYPE string VALUE 'package',
folder_logic TYPE string VALUE 'folder_logic',
main_lang_only TYPE string VALUE 'main_lang_only',
END OF c_id.
CONSTANTS:
BEGIN OF c_event,
go_back TYPE string VALUE 'go-back',
export_package TYPE string VALUE 'export-package',
choose_package TYPE string VALUE 'choose-object-type',
END OF c_event.
DATA mo_form TYPE REF TO zcl_abapgit_html_form.
DATA mo_form_data TYPE REF TO zcl_abapgit_string_map.
DATA mo_validation_log TYPE REF TO zcl_abapgit_string_map.
DATA mo_form_util TYPE REF TO zcl_abapgit_html_form_utils.
METHODS get_form_schema
RETURNING
VALUE(ro_form) TYPE REF TO zcl_abapgit_html_form.
METHODS export_package
RAISING
zcx_abapgit_exception.
ENDCLASS.
CLASS zcl_abapgit_gui_page_ex_pckage IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
CREATE OBJECT mo_validation_log.
CREATE OBJECT mo_form_data.
mo_form = get_form_schema( ).
mo_form_util = zcl_abapgit_html_form_utils=>create( mo_form ).
ENDMETHOD.
METHOD create.
DATA lo_component TYPE REF TO zcl_abapgit_gui_page_ex_pckage.
CREATE OBJECT lo_component.
ri_page = zcl_abapgit_gui_page_hoc=>create(
iv_page_title = 'Export Package to ZIP'
ii_child_component = lo_component ).
ENDMETHOD.
METHOD get_form_schema.
ro_form = zcl_abapgit_html_form=>create( iv_form_id = 'export-package-to-files' ).
ro_form->text(
iv_name = c_id-package
iv_label = 'Package'
iv_required = abap_true
iv_upper_case = abap_true
iv_side_action = c_event-choose_package
)->radio(
iv_name = c_id-folder_logic
iv_label = 'Folder Logic'
iv_default_value = zif_abapgit_dot_abapgit=>c_folder_logic-prefix
iv_hint = 'Define how package folders are named in repository'
)->option(
iv_label = 'Prefix'
iv_value = zif_abapgit_dot_abapgit=>c_folder_logic-prefix
)->option(
iv_label = 'Full'
iv_value = zif_abapgit_dot_abapgit=>c_folder_logic-full
)->checkbox(
iv_name = c_id-main_lang_only
iv_label = 'Serialize Main Language Only'
iv_hint = 'Ignore translations, serialize just main language'
)->command(
iv_label = 'Export Package to ZIP'
iv_action = c_event-export_package
iv_cmd_type = zif_abapgit_html_form=>c_cmd_type-input_main
)->command(
iv_label = 'Back'
iv_action = c_event-go_back ).
ENDMETHOD.
METHOD zif_abapgit_gui_renderable~render.
gui_services( )->register_event_handler( me ).
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->add( mo_form->render(
io_values = mo_form_data
io_validation_log = mo_validation_log ) ).
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
mo_form_data = mo_form_util->normalize( ii_event->form_data( ) ).
CASE ii_event->mv_action.
WHEN c_event-go_back.
rs_handled-state = zcl_abapgit_gui=>c_event_state-go_back.
WHEN c_event-export_package.
mo_validation_log = mo_form_util->validate( mo_form_data ).
IF mo_validation_log->is_empty( ) = abap_false.
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
ELSE.
export_package( ).
MESSAGE 'Package successfully exported' TYPE 'S'.
rs_handled-state = zcl_abapgit_gui=>c_event_state-go_back.
ENDIF.
WHEN c_event-choose_package.
mo_form_data->set(
iv_key = c_id-package
iv_val = zcl_abapgit_ui_factory=>get_popups( )->popup_search_help( 'TDEVC-DEVCLASS' ) ).
IF mo_form_data->get( c_id-package ) IS NOT INITIAL.
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
ELSE.
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
ENDIF.
ENDCASE.
ENDMETHOD.
METHOD export_package.
DATA lv_package TYPE devclass.
DATA lv_folder_logic TYPE string.
DATA lv_main_lang_only TYPE abap_bool.
lv_package = mo_form_data->get( c_id-package ).
lv_folder_logic = mo_form_data->get( c_id-folder_logic ).
lv_main_lang_only = mo_form_data->get( c_id-main_lang_only ).
zcl_abapgit_zip=>export_package(
iv_package = lv_package
iv_folder_logic = lv_folder_logic
iv_main_lang_only = lv_main_lang_only ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
1069,
62,
79,
694,
496,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
42895,
198,
220,
25261,
198,
220,
29244,
6158,
4810,
3824,
6158,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
62,
30281,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
13287,
540,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
2251,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
7700,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
13287,
540,
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,
23772,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
5301,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
26495,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
9483,
62,
6404,
291,
220,
220,
41876,
4731,
26173,
8924,
705,
43551,
62,
6404,
291,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
1388,
62,
17204,
62,
8807,
41876,
4731,
26173,
8924,
705,
12417,
62,
17204,
62,
8807,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
312,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
15596,
11,
198,
220,
220,
220,
220,
220,
220,
220,
467,
62,
1891,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
2188,
12,
1891,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
10784,
62,
26495,
41876,
4731,
26173,
8924,
705,
39344,
12,
26495,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
3853,
62,
26495,
41876,
4731,
26173,
8924,
705,
6679,
577,
12,
15252,
12,
4906,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
15596,
13,
628,
198,
220,
220,
220,
42865,
6941,
62,
687,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
687,
13,
198,
220,
220,
220,
42865,
6941,
62,
687,
62,
7890,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
8841,
62,
8899,
13,
198,
220,
220,
220,
42865,
6941,
62,
12102,
341,
62,
6404,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
8841,
62,
8899,
13,
198,
220,
220,
220,
42865,
6941,
62,
687,
62,
22602,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
687,
62,
26791,
13,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
687,
62,
15952,
2611,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
687,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
687,
13,
628,
220,
220,
220,
337,
36252,
50,
10784,
62,
26495,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
10619,
31631,
13,
628,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
1069,
62,
79,
694,
496,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
6739,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
6941,
62,
12102,
341,
62,
6404,
13,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
6941,
62,
687,
62,
7890,
13,
198,
220,
220,
220,
6941,
62,
687,
796,
651,
62,
687,
62,
15952,
2611,
7,
6739,
198,
220,
220,
220,
6941,
62,
687,
62,
22602,
796,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
687,
62,
26791,
14804,
17953,
7,
6941,
62,
687,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
2251,
13,
198,
220,
220,
220,
42865,
2376,
62,
42895,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
1069,
62,
79,
694,
496,
13,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
2376,
62,
42895,
13,
628,
220,
220,
220,
374,
72,
62,
7700,
796,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
71,
420,
14804,
17953,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
7700,
62,
7839,
220,
220,
220,
220,
220,
796,
705,
43834,
15717,
284,
42977,
6,
198,
220,
220,
220,
220,
220,
21065,
62,
9410,
62,
42895,
796,
2376,
62,
42895,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
687,
62,
15952,
2611,
13,
198,
220,
220,
220,
686,
62,
687,
796,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
687,
14804,
17953,
7,
21628,
62,
687,
62,
312,
796,
705,
39344,
12,
26495,
12,
1462,
12,
16624,
6,
6739,
628,
220,
220,
220,
686,
62,
687,
3784,
5239,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
269,
62,
312,
12,
26495,
198,
220,
220,
220,
220,
220,
21628,
62,
18242,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
27813,
6,
198,
220,
220,
220,
220,
220,
21628,
62,
35827,
220,
220,
220,
220,
220,
796,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
21628,
62,
45828,
62,
7442,
220,
220,
220,
796,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
21628,
62,
1589,
62,
2673,
220,
220,
796,
269,
62,
15596
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
*&---------------------------------------------------------------------*
*& Report YDK_RFC_TABDATAS_TRANSFER
*& Table copy stream
*&---------------------------------------------------------------------*
*& The program runs in the background, planning is performed
*& by the program YDK_RFC_TABDATA_TRANSFER_RN
*&---------------------------------------------------------------------*
*& Developed by Kiyanov Dmitry in 2016 year.
*& MIT License
*&---------------------------------------------------------------------*
REPORT ydk_rfc_tabdata_transfer_th.
PARAMETERS: rfcdest TYPE ydk_transfer-rfcdest OBLIGATORY.
PARAMETERS: ldate TYPE ydk_transfer-ldate OBLIGATORY.
PARAMETERS: ltime TYPE ydk_transfer-ltime OBLIGATORY.
PARAMETERS: clrdata TYPE ydk_transfer_clr_mode.
PARAMETERS: ignmode AS CHECKBOX.
PARAMETERS: where TYPE string LOWER CASE.
DATA: ittab TYPE STANDARD TABLE OF dd02l-tabname WITH HEADER LINE.
DATA: itetab TYPE STANDARD TABLE OF dd02l-tabname WITH HEADER LINE.
DATA: logsys TYPE logsys.
START-OF-SELECTION.
PERFORM mainproc.
FORM process.
DATA: cttab TYPE i.
DATA: ok TYPE c.
DATA: cterr TYPE i.
cttab = lines( ittab ).
WRITE: / 'Selected for processing'(001), cttab, 'tables'(002).
LOOP AT ittab.
PERFORM lock_tab USING ittab ok.
IF ok <> 'X'.
WRITE: / sy-uzeit, ittab, 'omitted - processed by another process'(003).
CONTINUE.
ENDIF.
PERFORM transfer_tab USING ittab ok.
PERFORM unlock_tab USING ittab.
IF ok <> 'X'.
ADD 1 TO cterr.
APPEND ittab TO itetab.
ELSE.
CLEAR cterr.
ENDIF.
CASE cterr.
WHEN 5 OR 10 OR 15. " может это временный лаг
WAIT UP TO 120 SECONDS.
WHEN 20.
WRITE: / 'The execution was interrupted because'(004), cterr, 'errors were in a row'(005).
STOP.
ENDCASE.
ENDLOOP.
WRITE: / 'Processing completed'(006).
ENDFORM.
FORM mainproc.
DATA: last_tab TYPE dd02l-tabname.
SELECT SINGLE logsys INTO logsys
FROM t000
WHERE mandt = sy-mandt.
SELECT tabname INTO TABLE ittab
FROM ydk_transfer
WHERE rfcdest = rfcdest
AND ldate = ldate
AND ltime = ltime.
IF ittab[] IS INITIAL.
WRITE: / 'No tables selected'(007).
EXIT.
ENDIF.
SORT ittab.
READ TABLE ittab INDEX lines( ittab ).
last_tab = ittab.
PERFORM process.
* ещё раз обрабатываем ошибочные
IF ( NOT itetab[] IS INITIAL ) AND ( ittab[] <> itetab[] ) AND ( lines( itetab ) < 300 ).
ittab[] = itetab[].
WRITE: / 'Error handling of this thread'(008).
PERFORM process.
ENDIF.
* Определяем последний ли поток.
DATA: dkt TYPE ydk_transfer.
SELECT SINGLE FOR UPDATE * INTO dkt " Создаём блокировку БД на последней таблице
FROM ydk_transfer
WHERE tabname = last_tab
AND rfcdest = rfcdest
AND ldate = ldate
AND ltime = ltime.
DATA: jobname TYPE tbtco-jobname.
DATA: ctact TYPE i.
jobname = 'YDK_TRANSFER' && '_' && ldate && '_' && ltime.
SELECT COUNT( * ) INTO ctact " Считаем количество активных процессов
FROM tbtco
WHERE jobname = jobname
AND status = 'R'.
CHECK ctact = 1.
COMMIT WORK. " Снимаем блокировку БД
* ещё раз обрабатываем все ошибочные (в результате всех процессов)
SELECT tabname INTO TABLE ittab
FROM ydk_transfer
WHERE rfcdest = rfcdest
AND ldate = ldate
AND ltime = ltime
AND status = 'E'.
IF NOT ittab[] IS INITIAL.
WRITE: / 'Processing errors from all threads'(009).
SORT ittab.
PERFORM process.
ENDIF.
* Выполняем пост обработку
DATA: postproc TYPE flag.
SELECT tabname INTO TABLE ittab
FROM ydk_transfer
WHERE rfcdest = rfcdest
AND ldate = ldate
AND ltime = ltime
AND status = 'Z'.
LOOP AT ittab.
WRITE: / 'Post-processing'(010), ittab.
CALL FUNCTION 'YDK_RFC_TRANSFER_POSTPROC' DESTINATION rfcdest
EXPORTING
tabname = ittab
test = ' '
IMPORTING
ok = postproc.
WRITE: postproc.
ENDLOOP.
ENDFORM.
FORM lock_tab USING tabname ok.
* Блокируем если получилось
* Считываем статус - если = I - ok = 'X'
CLEAR ok.
CALL FUNCTION 'ENQUEUE_EYDK_TRANSFER'
EXPORTING
* MODE_YDK_TRANSFER = 'E'
* MANDT = SY-MANDT
tabname = tabname
rfcdest = rfcdest
* X_TABNAME = ' '
* X_RFCDEST = ' '
* _SCOPE = '2'
* _WAIT = ' '
* _COLLECT = ' '
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
CHECK sy-subrc = 0.
DATA: status TYPE ydk_transfer-status.
SELECT SINGLE status INTO status
FROM ydk_transfer
WHERE tabname = tabname
AND rfcdest = rfcdest.
IF status CA 'IE'.
ok = 'X'.
RETURN.
ENDIF.
PERFORM unlock_tab USING tabname.
ENDFORM.
FORM unlock_tab USING tabname.
CALL FUNCTION 'DEQUEUE_EYDK_TRANSFER'
EXPORTING
* MODE_YDK_TRANSFER = 'E'
* MANDT = SY-MANDT
tabname = tabname
rfcdest = rfcdest
* X_TABNAME = ' '
* X_RFCDEST = ' '
* _SCOPE = '3'
* _SYNCHRON = ' '
* _COLLECT = ' '
.
ENDFORM.
FORM transfer_tab USING tabname ok.
DATA: msg TYPE string.
DATA: rowsize TYPE i.
DATA: rowcount TYPE i.
DATA: trtab TYPE ydk_transfer.
DATA: tabop TYPE ydk_transfer_tab.
DATA: xclrdata TYPE c.
DATA: postproc TYPE flag.
CLEAR ok.
WRITE: / sy-uzeit, tabname, 'started'(011).
SELECT SINGLE * INTO tabop
FROM ydk_transfer_tab
WHERE tabname = tabname.
SELECT SINGLE * INTO trtab
FROM ydk_transfer
WHERE tabname = tabname
AND rfcdest = rfcdest.
trtab-lcount = 0.
trtab-err = ''.
trtab-status = 'P'.
trtab-sdate = sy-datum.
trtab-stime = sy-uzeit.
trtab-etime = sy-uzeit.
trtab-duration = 0.
IF tabop-cmode = 'СС'. " Копировать если изменилось количество - проверяем количество
SELECT COUNT( * ) INTO rowcount
FROM (tabname).
IF trtab-ocount = rowcount.
trtab-lcount = rowcount.
trtab-status = 'S'.
MODIFY ydk_transfer FROM trtab.
COMMIT WORK.
EXIT.
ENDIF.
ENDIF.
xclrdata = clrdata.
IF tabop-cmode = 'СL' AND ignmode IS INITIAL. " Не отчищать таблицу
CLEAR xclrdata.
ENDIF.
MODIFY ydk_transfer FROM trtab.
COMMIT WORK.
FREE MEMORY ID 'YDK_RFC_TABDATA_TRANSFER'.
SUBMIT ydk_rfc_tabdata_transfer AND RETURN
WITH tabname = tabname
WITH rfcdest = rfcdest
WITH clrdata = xclrdata
WITH logsys = logsys
WITH where = where.
IMPORT msg rowsize rowcount FROM MEMORY ID 'YDK_RFC_TABDATA_TRANSFER'.
FREE MEMORY ID 'YDK_RFC_TABDATA_TRANSFER'.
IF msg IS INITIAL.
msg = 'no result - there''s probably a dump'(012).
ENDIF.
IF xclrdata = 'H' AND msg CS '(metod H)'.
* Обнаружена коллизия при передачи, передаём таблицу с зачисткой данных
SUBMIT ydk_rfc_tabdata_transfer AND RETURN
WITH tabname = tabname
WITH rfcdest = rfcdest
WITH clrdata = 'X'
WITH logsys = logsys
WITH where = where.
IMPORT msg rowsize rowcount FROM MEMORY ID 'YDK_RFC_TABDATA_TRANSFER'.
FREE MEMORY ID 'YDK_RFC_TABDATA_TRANSFER'.
ENDIF.
GET TIME.
trtab-rowsize = rowsize.
trtab-lcount = rowcount.
trtab-etime = sy-uzeit.
IF trtab-sdate = sy-datum.
trtab-duration = trtab-etime - trtab-stime.
ELSE.
DATA: tb TYPE t.
DATA: te TYPE t.
te = '240000'.
trtab-duration = ( te - trtab-stime ) + ( trtab-etime - tb ) + ( sy-datum - trtab-sdate - 1 ) * 24 * 60 * 60.
ENDIF.
IF msg = 'OK'.
ok = 'X'.
trtab-status = 'O'.
IF trtab-ocount <> trtab-lcount OR trtab-odate CO ' 0'.
trtab-ocount = trtab-lcount.
trtab-odate = ldate.
trtab-oduration = trtab-duration.
ENDIF.
ELSE.
trtab-err = msg.
trtab-status = 'E'.
ENDIF.
IF trtab-status = 'O'.
CALL FUNCTION 'YDK_RFC_TRANSFER_POSTPROC' " Вызываем локально - чтоб узнать нужнали после этой таблицы постобработка
EXPORTING
tabname = tabname
test = 'X'
IMPORTING
ok = postproc.
IF postproc = 'X'.
trtab-status = 'Z'.
ENDIF.
ENDIF.
MODIFY ydk_transfer FROM trtab.
COMMIT WORK.
WRITE: / sy-uzeit, tabname, msg.
ENDFORM.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
220,
575,
48510,
62,
41150,
62,
5603,
14529,
1404,
1921,
62,
5446,
15037,
24302,
198,
9,
5,
8655,
4866,
4269,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
383,
1430,
4539,
287,
262,
4469,
11,
5410,
318,
6157,
198,
9,
5,
416,
262,
1430,
575,
48510,
62,
41150,
62,
5603,
14529,
13563,
62,
5446,
15037,
24302,
62,
42336,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
6013,
276,
416,
21927,
4121,
709,
45181,
287,
1584,
614,
13,
198,
9,
5,
17168,
13789,
198,
9,
5,
10097,
30934,
9,
198,
198,
2200,
15490,
331,
34388,
62,
81,
16072,
62,
8658,
7890,
62,
39437,
62,
400,
13,
198,
198,
27082,
2390,
2767,
4877,
25,
374,
69,
10210,
395,
41876,
331,
34388,
62,
39437,
12,
41871,
10210,
395,
440,
9148,
3528,
1404,
15513,
13,
198,
27082,
2390,
2767,
4877,
25,
300,
4475,
220,
220,
41876,
331,
34388,
62,
39437,
12,
335,
378,
220,
220,
440,
9148,
3528,
1404,
15513,
13,
198,
27082,
2390,
2767,
4877,
25,
300,
2435,
220,
220,
41876,
331,
34388,
62,
39437,
12,
75,
2435,
220,
220,
440,
9148,
3528,
1404,
15513,
13,
198,
198,
27082,
2390,
2767,
4877,
25,
537,
4372,
1045,
41876,
331,
34388,
62,
39437,
62,
565,
81,
62,
14171,
13,
198,
27082,
2390,
2767,
4877,
25,
3627,
14171,
7054,
5870,
25171,
39758,
13,
198,
27082,
2390,
2767,
4877,
25,
810,
220,
220,
41876,
4731,
406,
36048,
42001,
13,
198,
198,
26947,
25,
340,
8658,
220,
220,
41876,
49053,
9795,
43679,
3963,
49427,
2999,
75,
12,
8658,
3672,
13315,
39837,
1137,
48920,
13,
198,
26947,
25,
340,
316,
397,
220,
41876,
49053,
9795,
43679,
3963,
49427,
2999,
75,
12,
8658,
3672,
13315,
39837,
1137,
48920,
13,
198,
198,
26947,
25,
17259,
893,
41876,
17259,
893,
13,
198,
198,
2257,
7227,
12,
19238,
12,
46506,
2849,
13,
198,
220,
19878,
21389,
1388,
36942,
13,
198,
198,
21389,
1429,
13,
198,
220,
42865,
25,
269,
926,
397,
41876,
1312,
13,
198,
220,
42865,
25,
12876,
41876,
269,
13,
198,
220,
42865,
25,
269,
353,
81,
41876,
1312,
13,
628,
220,
269,
926,
397,
796,
3951,
7,
340,
8658,
6739,
198,
220,
44423,
25,
1220,
705,
4653,
12609,
329,
7587,
6,
7,
8298,
828,
269,
926,
397,
11,
705,
83,
2977,
6,
7,
21601,
737,
628,
220,
17579,
3185,
5161,
340,
8658,
13,
198,
220,
220,
220,
19878,
21389,
5793,
62,
8658,
1294,
2751,
340,
8658,
12876,
13,
198,
220,
220,
220,
16876,
12876,
1279,
29,
705,
55,
4458,
198,
220,
220,
220,
220,
220,
44423,
25,
1220,
827,
12,
84,
2736,
270,
11,
340,
8658,
11,
705,
296,
2175,
532,
13686,
416,
1194,
1429,
6,
7,
11245,
737,
198,
220,
220,
220,
220,
220,
43659,
8924,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
19878,
21389,
4351,
62,
8658,
1294,
2751,
340,
8658,
12876,
13,
628,
220,
220,
220,
19878,
21389,
12116,
62,
8658,
1294,
2751,
340,
8658,
13,
628,
220,
220,
220,
16876,
12876,
1279,
29,
705,
55,
4458,
198,
220,
220,
220,
220,
220,
27841,
352,
5390,
269,
353,
81,
13,
198,
220,
220,
220,
220,
220,
43504,
10619,
340,
8658,
5390,
340,
316,
397,
13,
198,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
30301,
1503,
269,
353,
81,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
42001,
269,
353,
81,
13,
198,
220,
220,
220,
220,
220,
42099,
642,
6375,
838,
6375,
1315,
13,
366,
12466,
120,
25443,
114,
16843,
20375,
220,
141,
235,
20375,
15166,
12466,
110,
21169,
16843,
43108,
16843,
22177,
22177,
45035,
140,
117,
12466,
119,
16142,
140,
111,
198,
220,
220,
220,
220,
220,
220,
220,
16400,
2043,
15958,
5390,
7982,
10729,
1340,
5258,
13,
198,
220,
220,
220,
220,
220,
42099,
1160,
13,
198,
220,
220,
220,
220,
220,
220,
220,
44423,
25,
1220,
705,
464,
9706,
373,
19072,
780,
6,
7,
22914,
828,
269,
353,
81,
11,
705,
48277,
547,
287,
257,
5752,
6,
7,
22544,
737,
198,
220,
220,
220,
220,
220,
220,
220,
44934,
13,
198,
220,
220,
220,
23578,
34,
11159,
13,
198,
220,
23578,
21982,
3185,
13,
628,
220,
44423,
25,
1220,
705,
18709,
278,
5668,
6,
7,
28041,
737,
198,
1677,
8068,
1581,
44,
13,
198,
198,
21389,
1388,
36942,
13,
198,
220,
42865,
25,
938,
62,
8658,
41876,
49427,
2999,
75,
12,
8658,
3672,
13,
628,
220,
33493,
311,
2751,
2538,
17259,
893,
39319,
17259,
893,
198,
220,
220,
220,
16034,
256,
830,
198,
220,
220,
33411,
6855,
83,
796,
827,
12,
22249,
83,
13,
628,
220,
33493,
7400,
3672,
39319,
43679,
340,
8658,
198,
220,
220,
220,
16034,
331,
34388,
62,
39437,
198,
220,
220,
33411,
374,
69,
10210,
395,
796,
374,
69,
10210,
395,
198,
220,
220,
220,
220,
5357,
300,
4475,
220,
220,
796,
300,
4475,
198,
220,
220,
220,
220,
5357,
300,
2435,
220,
220,
796,
300,
2435,
13,
628,
220,
16876,
340,
8658,
21737,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
44423,
25,
1220,
705,
2949,
8893,
6163,
6,
7,
25816,
737,
198,
220,
220,
220,
7788,
2043,
13,
198,
220,
23578,
5064,
13,
628,
220,
311,
9863,
340,
8658,
13,
198,
220,
20832,
43679,
340,
8658,
24413,
6369,
3951,
7,
340,
8658,
6739,
198,
220,
938,
62,
8658,
796,
340,
8658,
13,
628,
220,
19878,
21389,
1429,
13,
198,
198,
9,
12466,
113,
141,
231,
141,
239,
220,
21169,
16142,
140,
115,
12466,
122,
140,
109,
21169,
16142,
140,
109,
16142,
20375,
45035,
38857,
16142,
16843,
43108,
12466,
122,
141,
230,
18849,
140,
109,
15166,
141,
229,
22177,
45035,
16843,
198,
220,
16876,
357,
5626,
340,
316,
397,
21737,
3180,
3268,
2043,
12576,
1267,
5357,
357,
340,
8658,
21737,
1279,
29,
340,
316,
397,
21737,
1267,
5357,
357,
3951,
7,
340,
316,
397,
1267,
1279,
5867,
6739,
198,
220,
220,
220,
340,
8658,
21737,
796,
340,
316,
397,
58,
4083,
198,
220,
220,
220,
44423,
25,
1220,
705,
12331,
9041,
286,
428,
4704,
6,
7,
25257,
737,
198,
220,
220,
220,
19878,
21389,
1429,
13,
198,
220,
23578,
5064,
13,
198,
198,
9,
12466,
252,
140
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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:
constructor
IMPORTING datatype_processor TYPE REF TO zif_datatype_iterator_ext,
iterate
IMPORTING name TYPE csequence DEFAULT 'ROOT'
data TYPE any.
PROTECTED SECTION.
PRIVATE SECTION.
METHODS:
execute_abaptype_process
IMPORTING name TYPE csequence
data TYPE any
type_descr TYPE REF TO cl_abap_typedescr,
process_table
IMPORTING name TYPE csequence
data TYPE any
type_descr TYPE REF TO cl_abap_typedescr,
process_struct
IMPORTING name TYPE csequence
data TYPE any
type_descr TYPE REF TO cl_abap_typedescr,
process_elem
IMPORTING name TYPE csequence
data TYPE any
type_descr TYPE REF TO cl_abap_typedescr,
process_ref
IMPORTING name TYPE csequence
data TYPE any
type_descr TYPE REF TO cl_abap_typedescr.
ENDCLASS.
CLASS zcl_datatype_iterator IMPLEMENTATION.
METHOD constructor.
me->datatype_processor = datatype_processor.
ENDMETHOD.
METHOD execute_abaptype_process.
CASE type_descr->kind.
WHEN cl_abap_typedescr=>kind_table.
process_table( name = name
data = data
type_descr = type_descr ).
WHEN cl_abap_typedescr=>kind_struct.
process_struct( name = name
data = data
type_descr = type_descr ).
WHEN cl_abap_typedescr=>kind_elem.
process_elem( name = name
data = data
type_descr = type_descr ).
WHEN cl_abap_typedescr=>kind_ref.
process_ref( name = name
data = data
type_descr = type_descr ).
ENDCASE.
ENDMETHOD.
METHOD iterate.
DATA: type_descr TYPE REF TO cl_abap_typedescr.
type_descr ?= cl_abap_typedescr=>describe_by_data( data ).
execute_abaptype_process( name = name
data = data
type_descr = type_descr ).
ENDMETHOD.
METHOD process_elem.
DATA: type TYPE REF TO cl_abap_elemdescr.
type ?= type_descr.
me->datatype_processor->before_elem(
EXPORTING
name = name
type_descr = type
).
me->datatype_processor->on_element(
EXPORTING
name = name
type_descr = type
).
me->datatype_processor->after_elem(
EXPORTING
name = name
type_descr = type
).
ENDMETHOD.
METHOD process_ref.
DATA: type TYPE REF TO cl_abap_refdescr.
type ?= type_descr.
me->datatype_processor->before_ref(
EXPORTING
name = name
type_descr = type
).
me->execute_abaptype_process(
EXPORTING
name = name
data = data
type_descr = type
).
me->datatype_processor->on_ref(
EXPORTING
name = name
type_descr = type
).
me->datatype_processor->after_ref(
EXPORTING
name = name
type_descr = type
).
ENDMETHOD.
METHOD process_struct.
DATA: type TYPE REF TO cl_abap_structdescr.
FIELD-SYMBOLS: <comp> LIKE LINE OF type->components,
<value> TYPE any.
type ?= type_descr.
me->datatype_processor->before_struct(
EXPORTING
name = name
type_descr = type
).
DATA: elem TYPE REF TO cl_abap_typedescr.
LOOP AT type->components ASSIGNING <comp>.
ASSIGN COMPONENT <comp>-name OF STRUCTURE data TO <value>.
elem = type->get_component_type( p_name = <comp>-name ).
me->execute_abaptype_process(
EXPORTING
name = <comp>-name
data = <value>
type_descr = elem
).
me->datatype_processor->on_struct(
EXPORTING
name = <comp>-name
type_descr = elem
).
ENDLOOP.
me->datatype_processor->after_struct(
EXPORTING
name = name
type_descr = type
).
ENDMETHOD.
METHOD process_table.
DATA: type TYPE REF TO cl_abap_tabledescr,
table_line TYPE REF TO cl_abap_datadescr,
struct_ref TYPE REF TO data.
FIELD-SYMBOLS: <table> TYPE table,
<struct> TYPE any.
type ?= type_descr.
me->datatype_processor->before_table(
EXPORTING
name = name
type_descr = type
).
ASSIGN data TO <table>.
CREATE DATA struct_ref LIKE LINE OF <table>.
ASSIGN struct_ref->* TO <struct>.
table_line = type->get_table_line_type( ).
me->execute_abaptype_process(
EXPORTING
name = 'TLINE'
data = <struct>
type_descr = table_line
).
LOOP AT <table> ASSIGNING <struct>.
me->datatype_processor->on_table_item(
EXPORTING
name = 'TDATA'
type_descr = table_line
).
ENDLOOP.
me->datatype_processor->after_table(
EXPORTING
name = name
type_descr = type
).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
19608,
265,
2981,
62,
48727,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
42865,
25,
4818,
265,
2981,
62,
41341,
41876,
4526,
37,
5390,
1976,
361,
62,
19608,
265,
2981,
62,
48727,
62,
2302,
20832,
12,
1340,
11319,
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,
4818,
265,
2981,
62,
41341,
41876,
4526,
37,
5390,
1976,
361,
62,
19608,
265,
2981,
62,
48727,
62,
2302,
11,
628,
220,
220,
220,
220,
220,
11629,
378,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
1438,
41876,
269,
43167,
5550,
38865,
705,
13252,
2394,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
41876,
597,
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,
12260,
62,
397,
2373,
2981,
62,
14681,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
1438,
220,
220,
220,
220,
220,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
220,
220,
220,
220,
220,
220,
41876,
597,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
20147,
81,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
774,
9124,
3798,
81,
11,
198,
220,
220,
220,
220,
220,
1429,
62,
11487,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
1438,
220,
220,
220,
220,
220,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
220,
220,
220,
220,
220,
220,
41876,
597,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
20147,
81,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
774,
9124,
3798,
81,
11,
198,
220,
220,
220,
220,
220,
1429,
62,
7249,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
1438,
220,
220,
220,
220,
220,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
220,
220,
220,
220,
220,
220,
41876,
597,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
20147,
81,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
774,
9124,
3798,
81,
11,
198,
220,
220,
220,
220,
220,
1429,
62,
68,
10671,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
1438,
220,
220,
220,
220,
220,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
220,
220,
220,
220,
220,
220,
41876,
597,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
20147,
81,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
774,
9124,
3798,
81,
11,
198,
220,
220,
220,
220,
220,
1429,
62,
5420,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
1438,
220,
220,
220,
220,
220,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
220,
220,
220,
220,
220,
220,
41876,
597,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
20147,
81,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
774,
9124,
3798,
81,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
19608,
265,
2981,
62,
48727,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
502,
3784,
19608,
265,
2981,
62,
41341,
796,
4818,
265,
2981,
62,
41341,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
12260,
62,
397,
2373,
2981,
62,
14681,
13,
628,
220,
220,
220,
42001,
2099,
62,
20147,
81,
3784,
11031,
13,
198,
220,
220,
220,
220,
220,
42099,
537,
62,
397,
499,
62,
774,
9124,
3798,
81,
14804,
11031,
62,
11487,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1429,
62,
11487,
7,
1438,
220,
220,
220,
220,
220,
220,
796,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
220,
220,
220,
220,
220,
220,
796,
1366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
20147,
81,
796,
2099,
62,
20147,
81,
6739,
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,
1429,
62,
7249,
7,
1438,
220,
220,
220,
220,
220,
220,
796,
1438,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
220,
220,
220,
220,
220,
220,
796,
1366,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
20147,
81,
796,
2099,
62,
20147,
81,
6739,
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,
1429,
62,
68,
10671,
7,
1438,
220,
220,
220,
220,
220,
220,
796,
1438,
198,
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,
1,
1,
1,
1
] |
DATA: itab TYPE STANDARD TABLE OF zempleados_ap329,
wa_emp TYPE zempleados_ap329,
gv_reg TYPE i.
SELECTION-SCREEN BEGIN OF BLOCK id.
PARAMETERS: pa_id TYPE i DEFAULT gv_reg.
SELECTION-SCREEN END OF BLOCK id.
SELECTION-SCREEN BEGIN OF BLOCK balta WITH FRAME TITLE text-002.
PARAMETERS:
pa_nom TYPE znombre_ap00329 MODIF ID b1,
pa_ape1 TYPE zapellido1_ap00329 MODIF ID b1,
pa_ape2 TYPE zapellido2_ap00329 MODIF ID b1,
pa_dni TYPE zdni_ap00329 MODIF ID b1 OBLIGATORY,
pa_tel TYPE asld2tel MODIF ID b1,
pa_dpto TYPE zdpto_ap00329 MODIF ID b1.
*Introducir otro parametro con fecha de alta.
SELECTION-SCREEN END OF BLOCK balta.
wa_emp-id = gv_reg.
wa_emp-nombre = pa_nom.
wa_emp-apellido1 = pa_ape1.
wa_emp-apellido2 = pa_ape2.
wa_emp-dni = pa_dni.
wa_emp-telefono = pa_tel.
wa_emp-departamento = pa_dpto.
INITIALIZATION.
SELECT * FROM zempleados_ap329
INTO TABLE itab.
*Número de registros en la tabla -> ID
IF sy-subrc EQ 0.
DESCRIBE TABLE itab LINES gv_reg.
ENDIF.
pa_id = gv_reg + 1.
TRY.
IF wa_emp-id IS NOT INITIAL.
IF sy-subrc EQ 0.
INSERT zempleados_ap329 FROM wa_emp.
IF sy-subrc EQ 0.
FORMAT COLOR COL_POSITIVE INVERSE ON.
WRITE: / 'Registro insertado correctamente.',
/ wa_emp-id,
/ wa_emp-nombre,
/ wa_emp-apellido1,
/ wa_emp-apellido2,
/ wa_emp-dni,
/ wa_emp-telefono.
ELSE.
FORMAT COLOR COL_NEGATIVE INVERSE ON.
WRITE: / 'Error al insertar registro'.
ENDIF.
ENDIF.
ELSE.
WRITE: / 'No se ha indicado el identificador de usuario.'.
ENDIF.
CATCH cx_root.
ENDTRY.
| [
26947,
25,
340,
397,
41876,
49053,
9795,
43679,
3963,
1976,
368,
1154,
22484,
62,
499,
37967,
11,
198,
220,
220,
220,
220,
220,
2082,
62,
45787,
41876,
1976,
368,
1154,
22484,
62,
499,
37967,
11,
198,
220,
220,
220,
220,
220,
308,
85,
62,
2301,
41876,
1312,
13,
198,
198,
46506,
2849,
12,
6173,
2200,
1677,
347,
43312,
3963,
9878,
11290,
4686,
13,
198,
220,
220,
220,
29463,
2390,
2767,
4877,
25,
14187,
62,
312,
41876,
1312,
5550,
38865,
308,
85,
62,
2301,
13,
198,
220,
220,
220,
33493,
2849,
12,
6173,
2200,
1677,
23578,
3963,
9878,
11290,
4686,
13,
198,
220,
220,
220,
33493,
2849,
12,
6173,
2200,
1677,
347,
43312,
3963,
9878,
11290,
275,
2501,
64,
13315,
8782,
10067,
37977,
2538,
2420,
12,
21601,
13,
198,
220,
220,
220,
29463,
2390,
2767,
4877,
25,
198,
220,
220,
220,
14187,
62,
26601,
220,
41876,
1976,
77,
2381,
260,
62,
499,
11245,
1959,
220,
220,
220,
19164,
5064,
4522,
275,
16,
11,
198,
220,
220,
220,
14187,
62,
1758,
16,
41876,
1976,
1758,
297,
17305,
16,
62,
499,
11245,
1959,
19164,
5064,
4522,
275,
16,
11,
198,
220,
220,
220,
14187,
62,
1758,
17,
41876,
1976,
1758,
297,
17305,
17,
62,
499,
11245,
1959,
19164,
5064,
4522,
275,
16,
11,
198,
220,
220,
220,
14187,
62,
67,
8461,
220,
41876,
1976,
67,
8461,
62,
499,
11245,
1959,
220,
220,
220,
220,
220,
220,
19164,
5064,
4522,
275,
16,
440,
9148,
3528,
1404,
15513,
11,
198,
220,
220,
220,
14187,
62,
37524,
220,
41876,
355,
335,
17,
37524,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19164,
5064,
4522,
275,
16,
11,
198,
220,
220,
220,
14187,
62,
67,
457,
78,
41876,
1976,
67,
457,
78,
62,
499,
11245,
1959,
220,
220,
220,
220,
220,
19164,
5064,
4522,
275,
16,
13,
198,
9,
15005,
66,
343,
267,
23528,
5772,
316,
305,
369,
730,
11693,
390,
5988,
64,
13,
198,
220,
220,
220,
33493,
2849,
12,
6173,
2200,
1677,
23578,
3963,
9878,
11290,
275,
2501,
64,
13,
628,
220,
220,
220,
2082,
62,
45787,
12,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
308,
85,
62,
2301,
13,
198,
220,
220,
220,
2082,
62,
45787,
12,
77,
2381,
260,
220,
220,
220,
220,
220,
220,
796,
14187,
62,
26601,
13,
198,
220,
220,
220,
2082,
62,
45787,
12,
1758,
297,
17305,
16,
220,
220,
220,
796,
14187,
62,
1758,
16,
13,
198,
220,
220,
220,
2082,
62,
45787,
12,
1758,
297,
17305,
17,
220,
220,
220,
796,
14187,
62,
1758,
17,
13,
198,
220,
220,
220,
2082,
62,
45787,
12,
67,
8461,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
14187,
62,
67,
8461,
13,
198,
220,
220,
220,
2082,
62,
45787,
12,
46813,
69,
29941,
220,
220,
220,
220,
796,
14187,
62,
37524,
13,
198,
220,
220,
220,
2082,
62,
45787,
12,
10378,
433,
3263,
78,
796,
14187,
62,
67,
457,
78,
13,
198,
198,
1268,
2043,
12576,
14887,
6234,
13,
198,
220,
33493,
1635,
16034,
1976,
368,
1154,
22484,
62,
499,
37967,
198,
220,
39319,
43679,
340,
397,
13,
198,
9,
45,
21356,
647,
78,
390,
4214,
4951,
551,
8591,
7400,
5031,
4613,
4522,
198,
220,
16876,
827,
12,
7266,
6015,
36529,
657,
13,
198,
220,
220,
220,
22196,
34,
7112,
12473,
43679,
340,
397,
43277,
1546,
308,
85,
62,
2301,
13,
198,
220,
23578,
5064,
13,
198,
220,
14187,
62,
312,
220,
796,
308,
85,
62,
2301,
1343,
352,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16876,
2082,
62,
45787,
12,
312,
3180,
5626,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
36529,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
29194,
17395,
1976,
368,
1154,
22484,
62,
499,
37967,
16034,
2082,
62,
45787,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
36529,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
41636,
20444,
1581,
20444,
62,
37997,
2043,
9306,
3268,
28884,
36,
6177,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44423,
25,
1220,
705,
8081,
396,
305,
7550,
4533,
3376,
3263,
68,
2637,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1220,
2082,
62,
45787,
12,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1220,
2082,
62,
45787,
12,
77,
2381,
260,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1220,
2082,
62,
45787,
12,
1758,
297,
17305,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1220,
2082,
62,
45787,
12,
1758,
297,
17305,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1220,
2082,
62,
45787,
12,
67,
8461,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1220,
2082,
62,
45787,
12,
46813,
69,
29941,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
41636,
20444,
1581,
20444,
62,
45,
7156,
37045,
3268,
28884,
36,
6177,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44423,
25,
1220,
705,
12331,
435,
7550,
283,
4214,
305,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_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' ##NO_TEXT.
CONSTANTS: lc_node_text TYPE string VALUE '#text' ##NO_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,
tty_id_mapping 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 tty_id_mapping,
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 me->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 me->gt_range_node_codes.
ls_range_node_code-low = 'GTYPES'.
INSERT ls_range_node_code INTO TABLE me->gt_range_node_codes.
ls_range_node_code-low = 'GCODING'.
INSERT ls_range_node_code INTO TABLE me->gt_range_node_codes.
ls_range_node_code-low = 'FCODING'.
INSERT ls_range_node_code INTO TABLE me->gt_range_node_codes.
ENDIF.
rt_range_node_codes = me->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 AND sy-subrc <> 1.
zcx_abapgit_exception=>raise( 'Error from FB_DELETE_FORM' ).
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.
CREATE OBJECT lo_sf.
* 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 = 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( ).
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 = boolc( 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,
lv_within_code_section TYPE abap_bool.
li_ixml = cl_ixml=>create( ).
li_xml_doc = li_ixml->create_document( ).
CREATE OBJECT lo_sf.
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' ). "#EC NOTEXT
li_element->set_attribute(
name = 'xmlns'
value = 'urn:sap-com:sdixml-ifr:2000' ). "#EC NOTEXT
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,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
5432,
6080,
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,
6,
22492,
15285,
62,
32541,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
300,
66,
62,
17440,
62,
5239,
41876,
4731,
26173,
8924,
705,
2,
5239,
6,
22492,
15285,
62,
32541,
13,
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,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
INTERFACE zif_abapgit_xml_output
PUBLIC .
TYPES:
BEGIN OF ty_i18n_params,
serialize_master_lang_only TYPE abap_bool,
END OF ty_i18n_params.
METHODS add
IMPORTING
!iv_name TYPE clike
!ig_data TYPE any
RAISING
zcx_abapgit_exception .
METHODS set_raw
IMPORTING
!ii_raw TYPE REF TO if_ixml_element .
METHODS add_xml
IMPORTING
!iv_name TYPE clike
!ii_xml TYPE REF TO if_ixml_element .
METHODS render
IMPORTING
!iv_normalize TYPE abap_bool DEFAULT abap_true
!is_metadata TYPE zif_abapgit_definitions=>ty_metadata OPTIONAL
RETURNING
VALUE(rv_xml) TYPE string .
METHODS i18n_params
IMPORTING
iv_serialize_master_lang_only TYPE ty_i18n_params-serialize_master_lang_only OPTIONAL
RETURNING
VALUE(rs_params) TYPE ty_i18n_params.
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
397,
499,
18300,
62,
19875,
62,
22915,
198,
220,
44731,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
72,
1507,
77,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
11389,
1096,
62,
9866,
62,
17204,
62,
8807,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
23578,
3963,
1259,
62,
72,
1507,
77,
62,
37266,
13,
628,
220,
337,
36252,
50,
751,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
3672,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
5145,
328,
62,
7890,
41876,
597,
198,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
337,
36252,
50,
900,
62,
1831,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
4178,
62,
1831,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
764,
198,
220,
337,
36252,
50,
751,
62,
19875,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
3672,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
5145,
4178,
62,
19875,
220,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
764,
198,
220,
337,
36252,
50,
8543,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
11265,
1096,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
5145,
271,
62,
38993,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
38993,
39852,
2849,
1847,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
19875,
8,
41876,
4731,
764,
198,
220,
337,
36252,
50,
1312,
1507,
77,
62,
37266,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
21628,
62,
46911,
1096,
62,
9866,
62,
17204,
62,
8807,
41876,
1259,
62,
72,
1507,
77,
62,
37266,
12,
46911,
1096,
62,
9866,
62,
17204,
62,
8807,
39852,
2849,
1847,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
37266,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
72,
1507,
77,
62,
37266,
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,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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
] |
*"* use this source file for your ABAP unit test classes
CLASS ltc_main DEFINITION DEFERRED.
CLASS ltc_action DEFINITION DEFERRED.
CLASS ltc_first_sets DEFINITION DEFERRED.
CLASS zcl_ctxfreegram2 DEFINITION LOCAL FRIENDS ltc_main ltc_action ltc_first_sets.
*CLASS lcl_non_terminal DEFINITION FRIENDS ltc_main.
CLASS ltc_main DEFINITION
FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS missing_start_rule FOR TESTING.
METHODS lhs_not_bound FOR TESTING.
METHODS start_rule_twice FOR TESTING.
METHODS unique_rule_one_character FOR TESTING.
METHODS unique_rule_two_characters FOR TESTING.
METHODS optional FOR TESTING.
METHODS recursive_rule FOR TESTING.
METHODS item_sets_transitions FOR TESTING.
METHODS circular_1 FOR TESTING.
METHODS circular_2 FOR TESTING.
METHODS test FOR TESTING.
METHODS test2 FOR TESTING.
ENDCLASS.
CLASS ltc_main IMPLEMENTATION.
METHOD missing_start_rule.
* DATA(factory) = NEW zcl_ctxfreegram_factory( ).
* DATA(start) = factory->new_nonterminal( 'start' ).
* TRY.
* DATA(grammar) = NEW zcl_ctxfreegram2( start_rule = start rules = VALUE #( ) ).
* CATCH zcx_ctxfreegram INTO DATA(lx).
* ENDTRY.
*
* IF lx IS NOT BOUND OR lx->error <> zcx_ctxfreegram=>c_error-missing_start_rule.
* cl_abap_unit_assert=>fail( msg = 'Exception "start rule missing" expected' ).
* ENDIF.
ENDMETHOD.
METHOD lhs_not_bound.
* DATA(factory) = NEW zcl_ctxfreegram_factory( ).
* DATA(start) = factory->new_nonterminal( 'start' ).
* TRY.
* DATA(grammar) = NEW zcl_ctxfreegram2( start_rule = start rules = VALUE #( ( ) ) ).
* CATCH zcx_ctxfreegram INTO DATA(lx).
* ENDTRY.
*
* IF lx IS NOT BOUND OR lx->error <> zcx_ctxfreegram=>c_error-lhs_element_not_bound.
* cl_abap_unit_assert=>fail( msg = 'Exception "missing LHS" expected' ).
* ENDIF.
ENDMETHOD.
METHOD start_rule_twice.
* DATA(factory) = NEW zcl_ctxfreegram_factory( ).
* DATA(start) = factory->new_nonterminal( 'start' ).
* TRY.
* DATA(grammar) = NEW zcl_ctxfreegram2( start_rule = start rules = VALUE #(
* ( lhs = start )
* ( lhs = start ) ) ).
* CATCH zcx_ctxfreegram INTO DATA(lx).
* ENDTRY.
*
* IF lx IS NOT BOUND OR lx->error <> zcx_ctxfreegram=>c_error-start_rule_must_appear_once.
* cl_abap_unit_assert=>fail( msg = 'Exception "start rule must appear once" expected' ).
* ENDIF.
ENDMETHOD.
METHOD unique_rule_one_character.
* DATA(factory) = NEW zcl_ctxfreegram_factory( ).
* DATA(start) = factory->new_nonterminal( 'start' ).
* DATA(letter_a) = factory->new_terminal( 'a' ).
* DATA(grammar) = NEW zcl_ctxfreegram2( start_rule = start rules = VALUE #(
* ( lhs = start rhs = letter_a ) ) ).
*
* DATA(itemsets) = grammar->render_itemsets( ).
* DATA(transitions) = grammar->render_transitions( ).
* DATA(action_goto_tables) = grammar->render_action_goto_tables( ).
*
* cl_abap_unit_assert=>assert_equals( act = itemsets exp =
* |* Item set 1:\n| &
* |** Item kernel: start = ◆ 'a'\n| &
* |* Item set 2:\n| &
* |** Item kernel: start = 'a' ◆\n| ).
* cl_abap_unit_assert=>assert_equals( act = transitions exp =
* | '$' 'a' start \n| &
* |1 2 \n| &
* |2 \n| ).
* cl_abap_unit_assert=>assert_equals( act = action_goto_tables exp =
* | '$' 'a' start \n| &
* |1 s2 \n| &
* |2 acc \n| ).
ENDMETHOD.
METHOD unique_rule_two_characters.
* DATA(factory) = NEW zcl_ctxfreegram_factory( ).
* DATA(start) = factory->new_nonterminal( 'start' ).
* DATA(letter_a) = factory->new_terminal( 'a' ).
* DATA(grammar) = NEW zcl_ctxfreegram2( start_rule = start rules = VALUE #(
* ( lhs = start rhs = factory->new_sequence( VALUE #( ( letter_a ) ( letter_a ) ) ) ) ) ).
*
* DATA(itemsets) = grammar->render_itemsets( ).
* DATA(transitions) = grammar->render_transitions( ).
* DATA(action_goto_tables) = grammar->render_action_goto_tables( ).
*
* cl_abap_unit_assert=>assert_equals( act = itemsets exp =
* |* Item set 1:\n| &
* |** Item kernel: start = ◆ 'a' 'a'\n| &
* |* Item set 2:\n| &
* |** Item kernel: start = 'a' ◆ 'a'\n| &
* |* Item set 3:\n| &
* |** Item kernel: start = 'a' 'a' ◆\n| ).
* cl_abap_unit_assert=>assert_equals( act = transitions exp =
* | '$' 'a' start \n| &
* |1 2 \n| &
* |2 3 \n| &
* |3 \n| ).
* cl_abap_unit_assert=>assert_equals( act = action_goto_tables exp =
* | '$' 'a' start \n| &
* |1 s2 \n| &
* |2 s3 \n| &
* |3 acc \n| ).
ENDMETHOD.
METHOD optional.
* DATA(factory) = NEW zcl_ctxfreegram_factory( ).
* DATA(start) = factory->new_nonterminal( 'start' ).
* DATA(optional) = factory->new_nonterminal( 'optional' ).
* DATA(letter_a) = factory->new_terminal( 'a' ).
* DATA(grammar) = NEW zcl_ctxfreegram2( start_rule = start rules = VALUE #(
* ( lhs = start rhs = optional )
* ( lhs = optional rhs = letter_a )
* ( lhs = optional ) ) ).
*
* DATA(itemsets) = grammar->render_itemsets( ).
* DATA(transitions) = grammar->render_transitions( ).
* DATA(action_goto_tables) = grammar->render_action_goto_tables( ).
*
* cl_abap_unit_assert=>assert_equals( act = itemsets exp =
* |* Item set 1:\n| &
* |** Item kernel: start = ◆ 'a' 'a'\n| &
* |* Item set 2:\n| &
* |** Item kernel: start = 'a' ◆ 'a'\n| &
* |* Item set 3:\n| &
* |** Item kernel: start = 'a' 'a' ◆\n| ).
* cl_abap_unit_assert=>assert_equals( act = transitions exp =
* | '$' 'a' start \n| &
* |1 2 \n| &
* |2 3 \n| &
* |3 \n| ).
* cl_abap_unit_assert=>assert_equals( act = action_goto_tables exp =
* | '$' 'a' start \n| &
* |1 s2 \n| &
* |2 s3 \n| &
* |3 acc \n| ).
ENDMETHOD.
METHOD recursive_rule.
* DATA(factory) = NEW zcl_ctxfreegram_factory( ).
* DATA(start) = factory->new_nonterminal( 'start' ).
* TRY.
* DATA(grammar) = NEW zcl_ctxfreegram2( start_rule = start rules = VALUE #( ( lhs = start rhs = start ) ) ).
* CATCH zcx_ctxfreegram INTO DATA(lx).
* ENDTRY.
*
* IF lx IS NOT BOUND OR lx->error <> zcx_ctxfreegram=>c_error-missing_start_rule.
* cl_abap_unit_assert=>fail( msg = 'Exception "start rule missing" expected' ).
* ENDIF.
*
**cl_abap_unit_assert=>assert_equals( act = act exp = exp msg = 'msg' ).
ENDMETHOD.
METHOD circular_1.
DATA(grammar) = NEW zcl_ctxfreegram2( ).
grammar->load_rules(
rules = VALUE #(
LET start = NEW lcl_non_terminal( 'start' ) IN
( NEW lcl_rule( lhs = start rhs = VALUE #( ( start ) ) ) ) ) ).
TRY.
grammar->create_first_sets( ).
cl_abap_unit_assert=>fail( msg = 'should have failed' ).
CATCH zcx_ctxfreegram INTO DATA(lx).
cl_abap_unit_assert=>assert_equals( act = lx->error exp = lx->c_error-rules_circular_reference ).
ENDTRY.
ENDMETHOD.
METHOD circular_2.
DATA(grammar) = NEW zcl_ctxfreegram2( ).
grammar->load_rules(
rules = VALUE #(
LET start = NEW lcl_non_terminal( 'start' )
e = NEW lcl_non_terminal( 'E' ) IN
( NEW lcl_rule( lhs = start rhs = VALUE #( ( e ) ) ) )
( NEW lcl_rule( lhs = e rhs = VALUE #( ( start ) ) ) ) ) ).
TRY.
grammar->create_first_sets( ).
cl_abap_unit_assert=>fail( msg = 'should have failed' ).
CATCH zcx_ctxfreegram INTO DATA(lx).
cl_abap_unit_assert=>assert_equals( act = lx->error exp = lx->c_error-rules_circular_reference ).
ENDTRY.
ENDMETHOD.
METHOD item_sets_transitions.
* DATA(factory) = NEW zcl_ctxfreegram_factory( ).
DATA(grammar) = NEW zcl_ctxfreegram2( ).
grammar->load_rules(
rules = VALUE #(
LET start = NEW lcl_non_terminal( 'start' )
e = NEW lcl_non_terminal( 'E' )
b = NEW lcl_non_terminal( 'B' )
star = NEW lcl_terminal( '*' )
plus = NEW lcl_terminal( '+' )
_0 = NEW lcl_terminal( '0' )
_1 = NEW lcl_terminal( '1' ) IN
( NEW lcl_rule( lhs = start rhs = VALUE #( ( e ) ) ) )
( NEW lcl_rule( lhs = e rhs = VALUE #( ( e ) ( star ) ( b ) ) ) )
( NEW lcl_rule( lhs = e rhs = VALUE #( ( e ) ( plus ) ( b ) ) ) )
( NEW lcl_rule( lhs = e rhs = VALUE #( ( b ) ) ) )
( NEW lcl_rule( lhs = b rhs = VALUE #( ( _0 ) ) ) )
( NEW lcl_rule( lhs = b rhs = VALUE #( ( _1 ) ) ) ) ) ).
grammar->create_item_set_transit_tables( ).
DATA(item_sets) = grammar->render_item_sets( ).
cl_abap_unit_assert=>assert_equals( act = item_sets exp =
|* Item set 1:\n| &
|** Item kernel: start = ◆ E\n| &
|** Item closure: E = ◆ E '*' B\n| &
|** Item closure: E = ◆ E '+' B\n| &
|** Item closure: E = ◆ B\n| &
|** Item closure: B = ◆ '0'\n| &
|** Item closure: B = ◆ '1'\n| &
|* Item set 2:\n| &
|** Item kernel: start = E ◆\n| &
|** Item kernel: E = E ◆ '*' B\n| &
|** Item kernel: E = E ◆ '+' B\n| &
|* Item set 3:\n| &
|** Item kernel: E = B ◆\n| &
|* Item set 4:\n| &
|** Item kernel: B = '0' ◆\n| &
|* Item set 5:\n| &
|** Item kernel: B = '1' ◆\n| &
|* Item set 6:\n| &
|** Item kernel: E = E '*' ◆ B\n| &
|** Item closure: B = ◆ '0'\n| &
|** Item closure: B = ◆ '1'\n| &
|* Item set 7:\n| &
|** Item kernel: E = E '+' ◆ B\n| &
|** Item closure: B = ◆ '0'\n| &
|** Item closure: B = ◆ '1'\n| &
|* Item set 8:\n| &
|** Item kernel: E = E '*' B ◆\n| &
|* Item set 9:\n| &
|** Item kernel: E = E '+' B ◆\n| ).
DATA(transitions) = grammar->render_transitions( ).
cl_abap_unit_assert=>assert_equals( act = transitions exp =
| '*' '+' '0' '1' E B \n| &
|1 4 5 2 3 \n| &
|2 6 7 \n| &
|3 \n| &
|4 \n| &
|5 \n| &
|6 4 5 8 \n| &
|7 4 5 9 \n| &
|8 \n| &
|9 \n| ).
grammar->create_first_sets( ).
DATA(first_sets) = grammar->render_first_sets( ).
cl_abap_unit_assert=>assert_equals( act = first_sets exp =
|NON_TERMINAL T_1 T_2 \n| &
|B '0' '1' \n| &
|E '0' '1' \n| &
|start '0' '1' \n| ).
grammar->create_follow_sets( ).
DATA(follow_sets) = grammar->render_follow_sets( ).
cl_abap_unit_assert=>assert_equals( act = follow_sets exp =
|SYMBOL T_1 T_2 T_3 \n| &
|start 'EOF' \n| &
|E 'EOF' '*' '+' \n| &
|B 'EOF' '*' '+' \n| &
|'0' 'EOF' '*' '+' \n| &
|'1' 'EOF' '*' '+' \n| &
|'*' '0' '1' \n| &
|'+' '0' '1' \n| ).
ENDMETHOD.
METHOD test.
* " start: E
* " E: E '*' B
* " E: E '+' B
* " E: B
* " B: '0'
* " B: '1'
* DATA(factory) = NEW zcl_ctxfreegram_factory( ).
* DATA(start) = factory->new_nonterminal( 'start' ).
* DATA(e) = factory->new_nonterminal( 'E' ).
* DATA(b) = factory->new_nonterminal( 'B' ).
* DATA(star) = factory->new_terminal( '*' ).
* DATA(plus) = factory->new_terminal( '+' ).
* DATA(_0) = factory->new_terminal( '0' ).
* DATA(_1) = factory->new_terminal( '1' ).
*
* DATA(grammar) = NEW zcl_ctxfreegram2(
* start_rule = start
* rules = VALUE #(
* ( lhs = start rhs = e )
* ( lhs = e rhs = factory->new_sequence( VALUE #( ( e ) ( star ) ( b ) ) ) )
* ( lhs = e rhs = factory->new_sequence( VALUE #( ( e ) ( plus ) ( b ) ) ) )
* ( lhs = e rhs = b )
* ( lhs = b rhs = _0 )
* ( lhs = b rhs = _1 ) ) ).
*
* DATA(itemsets) = grammar->render_itemsets( ).
* DATA(transitions) = grammar->render_transitions( ).
* DATA(action_goto_tables) = grammar->render_action_goto_tables( ).
*
* DATA(output) = grammar->render_rules( ) && |\n\n| && grammar->render_action_goto_tables( ).
ENDMETHOD.
METHOD test2.
* " start: while
* " while: 'while' condition
* " condition: variable '=' number
* " variable: 'regex:[a-zA-Z_][a-zA-Z_0-9]*'
* " number: 'regex:[0-9][0-9]*'
*
* DATA(factory) = NEW zcl_ctxfreegram_factory( ).
* DATA(start) = factory->new_nonterminal( 'start' ).
* DATA(while) = factory->new_nonterminal( 'while' ).
* DATA(condition) = factory->new_nonterminal( 'condition' ).
* DATA(_while) = factory->new_terminal( 'while' ).
* DATA(variable) = factory->new_nonterminal( 'variable' ).
* DATA(variable_regex) = factory->new_terminal_regex( '[a-zA-Z_][a-zA-Z_0-9]*' ).
* DATA(equal) = factory->new_terminal( '=' ).
* DATA(number) = factory->new_nonterminal( 'number' ).
* DATA(number_regex) = factory->new_terminal_regex( '[0-9][0-9]*' ).
*
* DATA(grammar) = NEW zcl_ctxfreegram2(
* start_rule = start
* rules = VALUE #(
* ( lhs = start rhs = while )
* ( lhs = while rhs = factory->new_sequence( VALUE #( ( _while ) ( condition ) ) ) )
* ( lhs = condition rhs = factory->new_sequence( VALUE #( ( variable ) ( equal ) ( number ) ) ) )
* ( lhs = variable rhs = variable_regex )
* ( lhs = number rhs = number_regex ) ) ).
*
* DATA(itemsets) = grammar->render_itemsets( ).
* DATA(transitions) = grammar->render_transitions( ).
* DATA(action_goto_tables) = grammar->render_action_goto_tables( ).
ENDMETHOD.
ENDCLASS.
CLASS ltc_first_sets DEFINITION FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PUBLIC SECTION.
METHODS test FOR TESTING.
ENDCLASS.
CLASS ltc_first_sets IMPLEMENTATION.
METHOD test.
* data(grammar) = new zcl_ctxfreegram2( ).
** grammar->dataprovider = new ltcl_dataprovider( ).
*data(transitions) = VALUE ty_xx(
* ( ) ).
*data(item_sets) = VALUE ty_xx(
* ( ) ).
*data(action_table) = grammar->create_action_table( item_sets = item_sets transitions = transitions ).
ENDMETHOD.
ENDCLASS.
CLASS ltc_action DEFINITION FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PUBLIC SECTION.
METHODS test FOR TESTING.
ENDCLASS.
CLASS ltc_action IMPLEMENTATION.
METHOD test.
* data(grammar) = new zcl_ctxfreegram2( ).
** grammar->dataprovider = new ltcl_dataprovider( ).
*data(transitions) = VALUE ty_xx(
* ( ) ).
*data(item_sets) = VALUE ty_xx(
* ( ) ).
*data(action_table) = grammar->create_action_table( item_sets = item_sets transitions = transitions ).
* " Part 1 of action determination = list of SHIFT
* " SIMPLEST WAY : VIA THE TRANSITION TABLE
* " (maybe this other solution :
* " - there's no SHIFT if dot is at the end of RHS
* " - If dot is not at the end of RHS:
* " - if symbol at dot is a terminal, it's this terminal
* " - if it's a nonterminal, there's a shift for all symbols of the First Set of this nonterminal except "$"
* " )
* LOOP AT aut_transition ASSIGNING <ls_transition>
* WHERE s_symbol-type = zcl_ctxfreegram=>lcs_symbol_type-terminal.
* APPEND INITIAL LINE TO aut_action ASSIGNING <ls_action>.
* <ls_action>-state = <ls_transition>-itemset_index.
* <ls_action>-terminal_index = <ls_transition>-s_symbol-index.
* <ls_action>-action = lcs_action-shift.
* <ls_action>-index = <ls_transition>-goto_itemset_index.
* ENDLOOP.
*
* " Part 2 of action determination = list of REDUCE
* " - if the dot is at the end of RHS
* " - there's no REDUCE
* " - else
* " - if symbol at dot is a terminal, it's REDUCE of this terminal
* " - if it's a nonterminal, take all symbols of the First Set of this nonterminal except "$"
* LOOP AT aut_itemset ASSIGNING <ls_itemset>.
* LOOP AT <ls_itemset>-t_item ASSIGNING <ls_item>
* WHERE type = lcs_item_type-kernel
* AND s_dot_symbol-type = zcl_ctxfreegram=>lcs_symbol_type-nonterminal.
* LOOP AT aut_rule ASSIGNING <ls_rule>
* WHERE lhs_nonterm_index = <ls_item>-s_dot_symbol-index
* AND t_symbol IS INITIAL.
* EXIT.
* ENDLOOP.
* IF sy-subrc = 0 AND 0 = lines( <ls_rule>-t_symbol ).
* LOOP AT aut_follow_set ASSIGNING <ls_follow_set> WHERE symbol = <ls_item>-s_dot_symbol.
* LOOP AT <ls_follow_set>-t_follow_symbol ASSIGNING <ls_symbol>.
* APPEND INITIAL LINE TO aut_action ASSIGNING <ls_action>.
* <ls_action>-state = <ls_itemset>-index.
* <ls_action>-terminal_index = <ls_symbol>-index.
* <ls_action>-action = lcs_action-reduce.
* <ls_action>-index = <ls_rule>-index.
* ENDLOOP.
* ENDLOOP.
* ENDIF.
* ENDLOOP.
*
* LOOP AT <ls_itemset>-t_item ASSIGNING <ls_item>
* WHERE type = lcs_item_type-kernel
* AND dot_at_the_end = abap_true.
* READ TABLE aut_follow_set ASSIGNING <ls_follow_set>
* WITH KEY symbol-type = zcl_ctxfreegram=>lcs_symbol_type-nonterminal
* symbol-index = <ls_item>-lhs_nonterm_index.
* ASSERT sy-subrc = 0.
* LOOP AT <ls_follow_set>-t_follow_symbol ASSIGNING <ls_symbol>.
* APPEND INITIAL LINE TO aut_action ASSIGNING <ls_action>.
* <ls_action>-state = <ls_itemset>-index.
* <ls_action>-terminal_index = <ls_symbol>-index.
* IF <ls_item>-rule_index = 1.
* <ls_action>-action = lcs_action-accept.
* <ls_action>-index = 0.
* ELSE.
* <ls_action>-action = lcs_action-reduce.
* <ls_action>-index = <ls_item>-rule_index.
* ENDIF.
* ENDLOOP.
* ENDLOOP.
* ENDLOOP.
*
* " if both SHIFT and reduce are possible, then keep SHIFT
* LOOP AT aut_action ASSIGNING <ls_action> WHERE action = lcs_action-reduce.
* READ TABLE aut_action WITH KEY state = <ls_action>-state
* terminal_index = <ls_action>-terminal_index
* action = lcs_action-shift
* TRANSPORTING NO FIELDS.
* IF sy-subrc = 0.
* DELETE aut_action.
* ENDIF.
* ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
9,
1,
9,
779,
428,
2723,
2393,
329,
534,
9564,
2969,
4326,
1332,
6097,
198,
198,
31631,
300,
23047,
62,
12417,
5550,
20032,
17941,
23449,
1137,
22083,
13,
198,
31631,
300,
23047,
62,
2673,
5550,
20032,
17941,
23449,
1137,
22083,
13,
198,
31631,
300,
23047,
62,
11085,
62,
28709,
5550,
20032,
17941,
23449,
1137,
22083,
13,
198,
31631,
1976,
565,
62,
49464,
5787,
4546,
17,
5550,
20032,
17941,
37347,
1847,
48167,
1677,
5258,
300,
23047,
62,
12417,
300,
23047,
62,
2673,
300,
23047,
62,
11085,
62,
28709,
13,
198,
9,
31631,
300,
565,
62,
13159,
62,
23705,
282,
5550,
20032,
17941,
48167,
1677,
5258,
300,
23047,
62,
12417,
13,
198,
198,
31631,
300,
23047,
62,
12417,
5550,
20032,
17941,
198,
220,
220,
220,
220,
220,
7473,
43001,
2751,
198,
220,
220,
220,
220,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
220,
220,
220,
220,
45698,
42,
49277,
43638,
5805,
7597,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
4814,
62,
9688,
62,
25135,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
300,
11994,
62,
1662,
62,
7784,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
923,
62,
25135,
62,
4246,
501,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
3748,
62,
25135,
62,
505,
62,
22769,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
3748,
62,
25135,
62,
11545,
62,
10641,
19858,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
11902,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
45115,
62,
25135,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
2378,
62,
28709,
62,
7645,
1756,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
18620,
62,
16,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
18620,
62,
17,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
17,
7473,
43001,
2751,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
23047,
62,
12417,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
4814,
62,
9688,
62,
25135,
13,
198,
198,
9,
220,
220,
220,
42865,
7,
69,
9548,
8,
796,
12682,
1976,
565,
62,
49464,
5787,
4546,
62,
69,
9548,
7,
6739,
198,
9,
220,
220,
220,
42865,
7,
9688,
8,
796,
8860,
3784,
3605,
62,
13159,
23705,
282,
7,
705,
9688,
6,
6739,
198,
9,
220,
220,
220,
7579,
56,
13,
198,
9,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
4546,
3876,
8,
796,
12682,
1976,
565,
62,
49464,
5787,
4546,
17,
7,
923,
62,
25135,
796,
923,
3173,
796,
26173,
8924,
1303,
7,
1267,
6739,
198,
9,
220,
220,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
49464,
5787,
4546,
39319,
42865,
7,
75,
87,
737,
198,
9,
220,
220,
220,
23578,
40405,
13,
198,
9,
198,
9,
220,
220,
220,
16876,
300,
87,
3180,
5626,
347,
15919,
6375,
300,
87,
3784,
18224,
1279,
29,
1976,
66,
87,
62,
49464,
5787,
4546,
14804,
66,
62,
18224,
12,
45688,
62,
9688,
62,
25135,
13,
198,
9,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
31456,
796,
705,
16922,
366,
9688,
3896,
4814,
1,
2938,
6,
6739,
198,
9,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
300,
11994,
62,
1662,
62,
7784,
13,
198,
198,
9,
220,
220,
220,
42865,
7,
69,
9548,
8,
796,
12682,
1976,
565,
62,
49464,
5787,
4546,
62,
69,
9548,
7,
6739,
198,
9,
220,
220,
220,
42865,
7,
9688,
8,
796,
8860,
3784,
3605,
62,
13159,
23705,
282,
7,
705,
9688,
6,
6739,
198,
9,
220,
220,
220,
7579,
56,
13,
198,
9,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
4546,
3876,
8,
796,
12682,
1976,
565,
62,
49464,
5787,
4546,
17,
7,
923,
62,
25135,
796,
923,
3173,
796,
26173,
8924,
1303,
7,
357,
1267,
1267,
6739,
198,
9,
220,
220,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
49464,
5787,
4546,
39319,
42865,
7,
75,
87,
737,
198,
9,
220,
220,
220,
23578,
40405,
13,
198,
9,
198,
9,
220,
220,
220,
16876,
300,
87,
3180,
5626,
347,
15919,
6375,
300,
87,
3784,
18224,
1279,
29,
1976,
66,
87,
62,
49464,
5787,
4546,
14804,
66,
62,
18224,
12,
75,
11994,
62,
30854,
62,
1662,
62,
7784,
13,
198,
9,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
31456,
796,
705,
16922,
366,
45688,
406,
7998,
1,
2938,
6,
6739,
198,
9,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
923,
62,
25135,
62,
4246,
501,
13,
198,
198,
9,
220,
220,
220,
42865,
7,
69,
9548,
8,
796,
12682,
1976,
565,
62,
49464,
5787,
4546,
62,
69,
9548,
7,
6739,
198,
9,
220,
220,
220,
42865,
7,
9688,
8,
796,
8860,
3784,
3605,
62,
13159,
23705,
282,
7,
705,
9688,
6,
6739,
198,
9,
220,
220,
220,
7579,
56,
13,
198,
9,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
4546,
3876,
8,
796,
12682,
1976,
565,
62,
49464,
5787,
4546,
17,
7,
923,
62,
25135,
796,
923,
3173,
796,
26173,
8924,
1303,
7,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
300,
11994,
796,
923,
1267,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
300,
11994,
796,
923,
1267,
1267,
6739,
198,
9,
220,
220,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
49464,
5787,
4546,
39319,
42865,
7,
75,
87,
737,
198,
9,
220,
220,
220,
23578,
40405,
13,
198,
9,
198,
9,
220,
220,
220,
16876,
300,
87,
3180,
5626,
347,
15919,
6375,
300,
87,
3784,
18224,
1279,
29,
1976,
66,
87,
62,
49464,
5787,
4546,
14804,
66,
62,
18224,
12,
9688,
62,
25135,
62,
27238,
62,
1324,
451,
62,
27078,
13,
198,
9,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
31456,
796
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_repo_online DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_repo
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_git_operations .
ALIASES create_branch
FOR zif_abapgit_git_operations~create_branch .
ALIASES push
FOR zif_abapgit_git_operations~push .
METHODS get_url
RETURNING
VALUE(rv_url) TYPE zif_abapgit_persistence=>ty_repo-url .
METHODS get_branch_name
RETURNING
VALUE(rv_name) TYPE zif_abapgit_persistence=>ty_repo-branch_name .
METHODS set_url
IMPORTING
!iv_url TYPE zif_abapgit_persistence=>ty_repo-url
RAISING
zcx_abapgit_exception .
METHODS set_branch_name
IMPORTING
!iv_branch_name TYPE zif_abapgit_persistence=>ty_repo-branch_name
RAISING
zcx_abapgit_exception .
METHODS get_sha1_remote
RETURNING
VALUE(rv_sha1) TYPE zif_abapgit_definitions=>ty_sha1
RAISING
zcx_abapgit_exception .
METHODS get_objects
RETURNING
VALUE(rt_objects) TYPE zif_abapgit_definitions=>ty_objects_tt
RAISING
zcx_abapgit_exception .
METHODS get_files_remote
REDEFINITION .
METHODS get_name
REDEFINITION .
METHODS has_remote_source
REDEFINITION .
METHODS rebuild_local_checksums
REDEFINITION .
PROTECTED SECTION.
PRIVATE SECTION.
DATA mt_objects TYPE zif_abapgit_definitions=>ty_objects_tt .
DATA mv_branch TYPE zif_abapgit_definitions=>ty_sha1 .
METHODS handle_stage_ignore
IMPORTING
!io_stage TYPE REF TO zcl_abapgit_stage
RAISING
zcx_abapgit_exception .
METHODS set_objects
IMPORTING
!it_objects TYPE zif_abapgit_definitions=>ty_objects_tt
RAISING
zcx_abapgit_exception .
METHODS fetch_remote
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS ZCL_ABAPGIT_REPO_ONLINE IMPLEMENTATION.
METHOD fetch_remote.
DATA: li_progress TYPE REF TO zif_abapgit_progress,
ls_pull TYPE zcl_abapgit_git_porcelain=>ty_pull_result.
IF mv_request_remote_refresh = abap_false.
RETURN.
ENDIF.
li_progress = zcl_abapgit_progress=>get_instance( 1 ).
li_progress->show( iv_current = 1
iv_text = 'Fetch remote files' ) ##NO_TEXT.
ls_pull = zcl_abapgit_git_porcelain=>pull(
iv_url = get_url( )
iv_branch_name = get_branch_name( ) ).
set_files_remote( ls_pull-files ).
set_objects( ls_pull-objects ).
mv_branch = ls_pull-branch.
ENDMETHOD.
METHOD get_branch_name.
rv_name = ms_data-branch_name.
ENDMETHOD.
METHOD get_files_remote.
fetch_remote( ).
rt_files = super->get_files_remote( ).
ENDMETHOD.
METHOD get_name.
rv_name = super->get_name( ).
IF rv_name IS INITIAL.
rv_name = zcl_abapgit_url=>name( ms_data-url ).
rv_name = cl_http_utility=>if_http_utility~unescape_url( rv_name ).
ENDIF.
ENDMETHOD.
METHOD get_objects.
fetch_remote( ).
rt_objects = mt_objects.
ENDMETHOD.
METHOD get_sha1_remote.
fetch_remote( ).
rv_sha1 = mv_branch.
ENDMETHOD.
METHOD get_url.
rv_url = ms_data-url.
ENDMETHOD.
METHOD handle_stage_ignore.
DATA: lv_add TYPE abap_bool,
lo_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit,
lt_stage TYPE zif_abapgit_definitions=>ty_stage_tt.
FIELD-SYMBOLS: <ls_stage> LIKE LINE OF lt_stage.
lo_dot_abapgit = get_dot_abapgit( ).
lt_stage = io_stage->get_all( ).
LOOP AT lt_stage ASSIGNING <ls_stage> WHERE method = zif_abapgit_definitions=>c_method-ignore.
lo_dot_abapgit->add_ignore(
iv_path = <ls_stage>-file-path
iv_filename = <ls_stage>-file-filename ).
" remove it from the staging object, as the action is handled here
io_stage->reset( iv_path = <ls_stage>-file-path
iv_filename = <ls_stage>-file-filename ).
lv_add = abap_true.
ENDLOOP.
IF lv_add = abap_true.
io_stage->add(
iv_path = zif_abapgit_definitions=>c_root_dir
iv_filename = zif_abapgit_definitions=>c_dot_abapgit
iv_data = lo_dot_abapgit->serialize( ) ).
set_dot_abapgit( lo_dot_abapgit ).
ENDIF.
ENDMETHOD.
METHOD has_remote_source.
rv_yes = abap_true.
ENDMETHOD.
METHOD rebuild_local_checksums.
" TODO: method unify to base class !
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_file_sig> LIKE LINE OF <ls_checksum>-files,
<ls_remote> LIKE LINE OF lt_remote,
<ls_local> LIKE LINE OF lt_local.
lt_local = get_files_local( ).
DELETE lt_local " Remove non-code related files except .abapgit
WHERE item IS INITIAL
AND NOT ( file-path = zif_abapgit_definitions=>c_root_dir
AND file-filename = zif_abapgit_definitions=>c_dot_abapgit ).
SORT lt_local BY item.
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.
READ TABLE lt_remote ASSIGNING <ls_remote>
WITH KEY path = <ls_local>-file-path filename = <ls_local>-file-filename
BINARY SEARCH.
CHECK sy-subrc = 0. " Ignore new local ones
APPEND INITIAL LINE TO <ls_checksum>-files ASSIGNING <ls_file_sig>.
MOVE-CORRESPONDING <ls_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 <ls_local>-file-sha1 <> <ls_remote>-sha1.
<ls_file_sig>-sha1 = <ls_remote>-sha1.
ENDIF.
ENDLOOP.
set( it_checksums = lt_checksums ).
reset_status( ).
ENDMETHOD.
METHOD set_branch_name.
reset_remote( ).
set( iv_branch_name = iv_branch_name ).
ENDMETHOD.
METHOD set_objects.
mt_objects = it_objects.
ENDMETHOD.
METHOD set_url.
reset_remote( ).
set( iv_url = iv_url ).
ENDMETHOD.
METHOD zif_abapgit_git_operations~create_branch.
DATA: lv_sha1 TYPE zif_abapgit_definitions=>ty_sha1.
ASSERT iv_name CP 'refs/heads/+*'.
IF iv_from IS INITIAL.
lv_sha1 = get_sha1_remote( ).
ELSE.
lv_sha1 = iv_from.
ENDIF.
zcl_abapgit_git_porcelain=>create_branch(
iv_url = get_url( )
iv_name = iv_name
iv_from = lv_sha1 ).
" automatically switch to new branch
set_branch_name( iv_name ).
ENDMETHOD.
METHOD zif_abapgit_git_operations~push.
* assumption: PUSH is done on top of the currently selected branch
DATA: ls_push TYPE zcl_abapgit_git_porcelain=>ty_push_result,
lv_text TYPE string.
IF ms_data-branch_name CP 'refs/tags*'.
lv_text = |You're working on a tag. Currently it's not |
&& |possible to push on tags. Consider creating a branch instead|.
zcx_abapgit_exception=>raise( lv_text ).
ENDIF.
IF ms_data-local_settings-block_commit = abap_true
AND zcl_abapgit_factory=>get_code_inspector( get_package( )
)->is_successful( ) = abap_false.
zcx_abapgit_exception=>raise( |A successful code inspection is required| ).
ENDIF.
handle_stage_ignore( io_stage ).
ls_push = zcl_abapgit_git_porcelain=>push(
is_comment = is_comment
io_stage = io_stage
iv_branch_name = get_branch_name( )
iv_url = get_url( )
iv_parent = get_sha1_remote( )
it_old_objects = get_objects( ) ).
set_objects( ls_push-new_objects ).
set_files_remote( ls_push-new_files ).
mv_branch = ls_push-branch.
update_local_checksums( ls_push-updated_files ).
reset_status( ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
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,
18300,
62,
3575,
602,
764,
628,
220,
220,
220,
8355,
43429,
1546,
2251,
62,
1671,
3702,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
18300,
62,
3575,
602,
93,
17953,
62,
1671,
3702,
764,
198,
220,
220,
220,
8355,
43429,
1546,
4574,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
18300,
62,
3575,
602,
93,
14689,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
6371,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
6371,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
6371,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
1671,
3702,
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,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
1671,
3702,
62,
3672,
764,
198,
220,
220,
220,
337,
36252,
50,
900,
62,
6371,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
6371,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
6371,
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,
1671,
3702,
62,
3672,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
1671,
3702,
62,
3672,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
1671,
3702,
62,
3672,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
26270,
16,
62,
47960,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
26270,
16,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
26270,
16,
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,
48205,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
48205,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
48205,
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,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
16624,
62,
47960,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
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,
468,
62,
47960,
62,
10459,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
220,
220,
337,
36252,
50,
17884,
62,
12001,
62,
42116,
5700,
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,
42865,
45079,
62,
48205,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
48205,
62,
926,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
1671,
3702,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
26270,
16,
764,
628,
220,
220,
220,
337,
36252,
50,
5412,
62,
14247,
62,
46430,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
14247,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
14247,
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,
48205,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
48205,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
48205,
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,
21207,
62,
47960,
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,
2200,
16402,
62,
1340,
24027,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
21207,
62,
47960,
13,
628,
220,
220,
220,
42865,
25,
7649,
62,
33723,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
33723,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
31216,
220,
220,
220,
220,
41876,
1976,
565,
62,
397,
499,
18300,
62,
18300,
62,
1819,
5276,
391,
14804,
774,
62,
31216,
62,
20274,
13,
628,
220,
220,
220,
16876,
285,
85,
62,
25927,
62,
47960,
62,
5420,
3447,
796
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
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.
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 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 get_local_checksums_per_file
RETURNING
VALUE(rt_checksums) TYPE zif_abapgit_definitions=>ty_file_signatures_tt .
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 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 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 .
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_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.
" 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( ).
refresh( iv_drop_log = abap_false ).
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.
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.
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(
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_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,
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,
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,
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,
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,
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,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
748,
48499,
1096,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
42116,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
8906,
48499,
1096,
62,
42116,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
6404,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
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,
4296,
62,
12001,
62,
42116,
5700,
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
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_folder_logic DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
METHODS package_to_path
IMPORTING
!iv_top TYPE devclass
!io_dot TYPE REF TO zcl_abapgit_dot_abapgit
!iv_package TYPE devclass
RETURNING
VALUE(rv_path) TYPE string
RAISING
zcx_abapgit_exception .
METHODS path_to_package
IMPORTING
!iv_top TYPE devclass
!io_dot TYPE REF TO zcl_abapgit_dot_abapgit
!iv_path TYPE string
!iv_create_if_not_exists TYPE abap_bool DEFAULT abap_true
RETURNING
VALUE(rv_package) TYPE devclass
RAISING
zcx_abapgit_exception .
CLASS-METHODS get_instance
RETURNING
VALUE(ro_instance) TYPE REF TO zcl_abapgit_folder_logic .
PROTECTED SECTION.
METHODS get_parent
IMPORTING
!iv_package TYPE devclass
RETURNING
VALUE(r_parent) TYPE devclass.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_devclass_info,
devclass TYPE devclass,
namespace TYPE namespace,
parentcl TYPE parentcl,
END OF ty_devclass_info .
TYPES:
ty_devclass_info_tt TYPE SORTED TABLE OF ty_devclass_info
WITH UNIQUE KEY devclass .
DATA mt_parent TYPE ty_devclass_info_tt .
ENDCLASS.
CLASS ZCL_ABAPGIT_FOLDER_LOGIC IMPLEMENTATION.
METHOD get_instance.
CREATE OBJECT ro_instance.
ENDMETHOD.
METHOD get_parent.
DATA: st_parent LIKE LINE OF mt_parent.
"Determine Parent Package
READ TABLE mt_parent INTO st_parent
WITH TABLE KEY devclass = iv_package.
IF sy-subrc <> 0.
r_parent = zcl_abapgit_factory=>get_sap_package( iv_package )->read_parent( ).
st_parent-devclass = iv_package.
st_parent-parentcl = r_parent.
INSERT st_parent INTO TABLE mt_parent.
ELSE.
r_parent = st_parent-parentcl.
ENDIF.
ENDMETHOD.
METHOD package_to_path.
DATA: lv_len TYPE i,
lv_path TYPE string,
lv_message TYPE string,
lv_parentcl TYPE tdevc-parentcl,
lv_folder_logic TYPE string.
IF iv_top = iv_package.
rv_path = io_dot->get_starting_folder( ).
ELSE.
lv_parentcl = get_parent( iv_package ).
IF lv_parentcl IS INITIAL.
zcx_abapgit_exception=>raise( |error, expected parent package, { iv_package }| ).
ELSE.
lv_folder_logic = io_dot->get_folder_logic( ).
CASE lv_folder_logic.
WHEN zif_abapgit_dot_abapgit=>c_folder_logic-full.
lv_len = 0.
IF iv_package(1) = '$'.
lv_len = 1.
ENDIF.
WHEN zif_abapgit_dot_abapgit=>c_folder_logic-prefix.
lv_len = strlen( lv_parentcl ).
IF iv_package(lv_len) <> lv_parentcl.
* if abapGit project is installed in package ZZZ, all subpackages should be named
* ZZZ_something. This will define the folder name in the zip file to be "something",
* similarily with online projects. Alternatively change to FULL folder logic
lv_message = 'PREFIX: Unexpected package naming (' && iv_package && ')'
&& 'you might switch to FULL folder logic' ##no_text.
zcx_abapgit_exception=>raise( lv_message ).
ENDIF.
WHEN OTHERS.
zcx_abapgit_exception=>raise( |Invalid folder logic: { lv_folder_logic }| ).
ENDCASE.
lv_path = iv_package+lv_len.
IF strlen( lv_path ) = 0.
zcx_abapgit_exception=>raise( |Folder logic: length = 0, parent: {
lv_parentcl }, child: { iv_package }| ).
ENDIF.
IF lv_path(1) = '_'.
lv_path = lv_path+1.
ENDIF.
IF strlen( lv_path ) = 0.
zcx_abapgit_exception=>raise( |Folder logic: length = 0, parent: {
lv_parentcl }, child: { iv_package }| ).
ENDIF.
TRANSLATE lv_path USING '/#'.
TRANSLATE lv_path TO LOWER CASE.
CONCATENATE lv_path '/' INTO lv_path.
rv_path = package_to_path( iv_top = iv_top
io_dot = io_dot
iv_package = lv_parentcl ).
CONCATENATE rv_path lv_path INTO rv_path.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD path_to_package.
DATA: lv_length TYPE i,
lv_parent TYPE devclass,
lv_new TYPE string,
lv_path TYPE string,
lv_top TYPE devclass.
lv_top = iv_top.
lv_length = strlen( io_dot->get_starting_folder( ) ).
IF lv_length > strlen( iv_path ).
* treat as not existing locally
RETURN.
ENDIF.
lv_path = iv_path+lv_length.
lv_parent = lv_top.
rv_package = lv_top.
WHILE lv_path CA '/'.
SPLIT lv_path AT '/' INTO lv_new lv_path.
CASE io_dot->get_folder_logic( ).
WHEN zif_abapgit_dot_abapgit=>c_folder_logic-full.
rv_package = lv_new.
TRANSLATE rv_package USING '#/'.
IF iv_top(1) = '$'.
CONCATENATE '$' rv_package INTO rv_package.
ENDIF.
WHEN zif_abapgit_dot_abapgit=>c_folder_logic-prefix.
CONCATENATE rv_package '_' lv_new INTO rv_package.
WHEN OTHERS.
ASSERT 0 = 1.
ENDCASE.
TRANSLATE rv_package TO UPPER CASE.
IF zcl_abapgit_factory=>get_sap_package( rv_package )->exists( ) = abap_false AND
iv_create_if_not_exists = abap_true.
zcl_abapgit_factory=>get_sap_package( lv_parent )->create_child( rv_package ).
ENDIF.
lv_parent = rv_package.
ENDWHILE.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
43551,
62,
6404,
291,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
5301,
62,
1462,
62,
6978,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
4852,
220,
220,
220,
220,
220,
220,
220,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
26518,
220,
220,
220,
220,
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,
452,
62,
26495,
220,
220,
220,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
6978,
8,
41876,
4731,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
3108,
62,
1462,
62,
26495,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
4852,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
26518,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
6978,
220,
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,
452,
62,
17953,
62,
361,
62,
1662,
62,
1069,
1023,
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,
81,
85,
62,
26495,
8,
220,
220,
220,
220,
220,
220,
220,
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,
39098,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
39098,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
43551,
62,
6404,
291,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
8000,
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,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
62,
8000,
8,
41876,
1614,
4871,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
7959,
4871,
62,
10951,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1614,
4871,
220,
41876,
1614,
4871,
11,
198,
220,
220,
220,
220,
220,
220,
220,
25745,
41876,
25745,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2560,
565,
220,
41876,
2560,
565,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
7959,
4871,
62,
10951,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
7959,
4871,
62,
10951,
62,
926,
41876,
311,
9863,
1961,
43679,
3963,
1259,
62,
7959,
4871,
62,
10951,
198,
220,
220,
220,
220,
220,
220,
220,
13315,
4725,
33866,
8924,
35374,
1614,
4871,
764,
198,
220,
220,
220,
42865,
45079,
62,
8000,
41876,
1259,
62,
7959,
4871,
62,
10951,
62,
926,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
37,
3535,
14418,
62,
25294,
2149,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
651,
62,
39098,
13,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
686,
62,
39098,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
8000,
13,
198,
220,
220,
220,
42865,
25,
336,
62,
8000,
34178,
48920,
3963,
45079,
62,
8000,
13,
628,
220,
220,
220,
366,
35,
2357,
3810,
16774,
15717,
198,
220,
220,
220,
20832,
43679,
45079,
62,
8000,
39319,
336,
62,
8000,
198,
220,
220,
220,
220,
220,
13315,
43679,
35374,
1614,
4871,
796,
21628,
62,
26495,
13,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
374,
62,
8000,
796,
1976,
565,
62,
397,
499,
18300,
62,
69,
9548,
14804,
1136,
62,
82,
499,
62,
26495,
7,
21628,
62,
26495,
1267,
3784,
961,
62,
8000,
7,
6739,
198,
220,
220,
220,
220,
220,
336,
62,
8000,
12,
7959,
4871,
796,
21628,
62,
26495,
13,
198,
220,
220,
220,
220,
220,
336,
62,
8000,
12,
8000,
565,
796,
374,
62,
8000,
13,
198,
220,
220,
220,
220,
220,
29194,
17395,
336,
62,
8000,
39319,
43679,
45079,
62,
8000,
13,
198,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
374,
62,
8000,
796,
336,
62,
8000,
12,
8000,
565,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
5301,
62,
1462,
62,
6978,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
11925,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
6978,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*&---------------------------------------------------------------------*
*& Include ZABAPGIT_FORMS
*&---------------------------------------------------------------------*
FORM run.
DATA: lx_exception TYPE REF TO zcx_abapgit_exception.
TRY.
zcl_abapgit_migrations=>run( ).
PERFORM open_gui.
CATCH zcx_abapgit_exception INTO lx_exception.
MESSAGE lx_exception TYPE 'E'.
ENDTRY.
ENDFORM. "run
FORM open_gui RAISING zcx_abapgit_exception.
IF sy-batch = abap_true.
zcl_abapgit_background=>run( ).
ELSE.
zcl_abapgit_services_abapgit=>prepare_gui_startup( ).
zcl_abapgit_ui_factory=>get_gui( )->go_home( ).
CALL SELECTION-SCREEN 1001. " trigger screen
ENDIF.
ENDFORM.
FORM branch_popup TABLES tt_fields TYPE zif_abapgit_popups=>ty_sval_tt
USING pv_code TYPE clike
CHANGING cs_error TYPE svale
cv_show_popup TYPE c
RAISING zcx_abapgit_exception ##CALLED ##NEEDED.
* called dynamically from function module POPUP_GET_VALUES_USER_BUTTONS
DATA: lx_error TYPE REF TO zcx_abapgit_exception,
li_popups TYPE REF TO zif_abapgit_popups.
TRY.
li_popups = zcl_abapgit_ui_factory=>get_popups( ).
li_popups->branch_popup_callback(
EXPORTING
iv_code = pv_code
CHANGING
ct_fields = tt_fields[]
cs_error = cs_error
cv_show_popup = cv_show_popup ).
CATCH zcx_abapgit_exception INTO lx_error.
MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'.
ENDTRY.
ENDFORM. "branch_popup
FORM output.
DATA: lx_error TYPE REF TO zcx_abapgit_exception,
lt_ucomm TYPE TABLE OF sy-ucomm.
PERFORM set_pf_status IN PROGRAM rsdbrunt IF FOUND.
APPEND 'CRET' TO lt_ucomm. "Button Execute
APPEND 'SPOS' TO lt_ucomm. "Button Save
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = sy-pfkey
TABLES
p_exclude = lt_ucomm.
TRY.
zcl_abapgit_ui_factory=>get_gui( )->set_focus( ).
CATCH zcx_abapgit_exception INTO lx_error.
MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'.
ENDTRY.
ENDFORM.
FORM exit.
DATA lx_error TYPE REF TO zcx_abapgit_exception.
" The exit logic should only be applied for our 'main' selection screen 1001.
" All other selection-screens are called as popups and shouldn't influence
" the gui navigation as it would lead to inpredictable behaviour like dumps.
IF sy-dynnr <> 1001.
RETURN.
ENDIF.
TRY.
CASE sy-ucomm.
WHEN 'CBAC' OR 'CCAN'. "Back & Escape
IF zcl_abapgit_ui_factory=>get_gui( )->back( ) = abap_true. " end of stack
zcl_abapgit_ui_factory=>get_gui( )->free( ). " Graceful shutdown
ELSE.
LEAVE TO SCREEN 1001.
ENDIF.
ENDCASE.
CATCH zcx_abapgit_exception INTO lx_error.
MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'.
ENDTRY.
ENDFORM.
FORM password_popup
USING
pv_repo_url TYPE string
CHANGING
cv_user TYPE string
cv_pass TYPE string.
lcl_password_dialog=>popup(
EXPORTING
iv_repo_url = pv_repo_url
CHANGING
cv_user = cv_user
cv_pass = cv_pass ).
ENDFORM.
FORM remove_toolbar USING pv_dynnr TYPE sy-dynnr.
DATA: ls_header TYPE rpy_dyhead,
lt_containers TYPE dycatt_tab,
lt_fields_to_containers TYPE dyfatc_tab,
lt_flow_logic TYPE swydyflow.
CALL FUNCTION 'RPY_DYNPRO_READ'
EXPORTING
progname = sy-cprog
dynnr = pv_dynnr
IMPORTING
header = ls_header
TABLES
containers = lt_containers
fields_to_containers = lt_fields_to_containers
flow_logic = lt_flow_logic
EXCEPTIONS
cancelled = 1
not_found = 2
permission_error = 3
OTHERS = 4.
IF sy-subrc IS NOT INITIAL.
RETURN. " Ignore errors, just exit
ENDIF.
IF ls_header-no_toolbar = abap_true.
RETURN. " No change required
ENDIF.
ls_header-no_toolbar = abap_true.
CALL FUNCTION 'RPY_DYNPRO_INSERT'
EXPORTING
header = ls_header
suppress_exist_checks = abap_true
TABLES
containers = lt_containers
fields_to_containers = lt_fields_to_containers
flow_logic = lt_flow_logic
EXCEPTIONS
cancelled = 1
already_exists = 2
program_not_exists = 3
not_executed = 4
missing_required_field = 5
illegal_field_value = 6
field_not_allowed = 7
not_generated = 8
illegal_field_position = 9
OTHERS = 10.
IF sy-subrc <> 2 AND sy-subrc <> 0.
RETURN. " Ignore errors, just exit
ENDIF.
ENDFORM.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
40348,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1168,
6242,
2969,
38,
2043,
62,
13775,
5653,
198,
9,
5,
10097,
30934,
9,
198,
198,
21389,
1057,
13,
628,
220,
42865,
25,
300,
87,
62,
1069,
4516,
41876,
4526,
37,
5390,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
76,
3692,
602,
14804,
5143,
7,
6739,
198,
220,
220,
220,
220,
220,
19878,
21389,
1280,
62,
48317,
13,
198,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
39319,
300,
87,
62,
1069,
4516,
13,
198,
220,
220,
220,
220,
220,
337,
1546,
4090,
8264,
300,
87,
62,
1069,
4516,
41876,
705,
36,
4458,
198,
220,
23578,
40405,
13,
198,
198,
1677,
8068,
1581,
44,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
5143,
198,
198,
21389,
1280,
62,
48317,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
16876,
827,
12,
43501,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
25249,
14804,
5143,
7,
6739,
198,
220,
17852,
5188,
13,
628,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
30416,
62,
397,
499,
18300,
14804,
46012,
533,
62,
48317,
62,
9688,
929,
7,
6739,
198,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
9019,
62,
69,
9548,
14804,
1136,
62,
48317,
7,
1267,
3784,
2188,
62,
11195,
7,
6739,
198,
220,
220,
220,
42815,
33493,
2849,
12,
6173,
2200,
1677,
1802,
16,
13,
366,
7616,
3159,
628,
220,
23578,
5064,
13,
198,
198,
1677,
8068,
1581,
44,
13,
198,
198,
21389,
8478,
62,
12924,
929,
309,
6242,
28378,
220,
220,
256,
83,
62,
25747,
41876,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
14804,
774,
62,
82,
2100,
62,
926,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1294,
2751,
220,
220,
220,
279,
85,
62,
8189,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
50115,
62,
18224,
41876,
38487,
1000,
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,
269,
85,
62,
12860,
62,
12924,
929,
41876,
269,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
22492,
34,
7036,
1961,
22492,
12161,
1961,
1961,
13,
198,
9,
1444,
32366,
422,
2163,
8265,
37586,
8577,
62,
18851,
62,
23428,
35409,
62,
29904,
62,
47526,
11357,
50,
628,
220,
42865,
25,
300,
87,
62,
18224,
220,
41876,
4526,
37,
5390,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
220,
220,
7649,
62,
12924,
4739,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
13,
628,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
7649,
62,
12924,
4739,
796,
1976,
565,
62,
397,
499,
18300,
62,
9019,
62,
69,
9548,
14804,
1136,
62,
12924,
4739,
7,
6739,
198,
220,
220,
220,
220,
220,
7649,
62,
12924,
4739,
3784,
1671,
3702,
62,
12924,
929,
62,
47423,
7,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
8189,
220,
220,
220,
220,
220,
220,
796,
279,
85,
62,
8189,
198,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
83,
62,
25747,
220,
220,
220,
220,
796,
256,
83,
62,
25747,
21737,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
50115,
62,
18224,
220,
220,
220,
220,
220,
796,
50115,
62,
18224,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
85,
62,
12860,
62,
12924,
929,
796,
269,
85,
62,
12860,
62,
12924,
929,
6739,
628,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
39319,
300,
87,
62,
18224,
13,
198,
220,
220,
220,
220,
220,
337,
1546,
4090,
8264,
300,
87,
62,
18224,
41876,
705,
50,
6,
13954,
31519,
34178,
705,
36,
4458,
198,
220,
23578,
40405,
13,
198,
198,
1677,
8068,
1581,
44,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
1671,
3702,
62,
12924,
929,
198,
198,
21389,
5072,
13,
628,
220,
42865,
25,
300,
87,
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,
300,
83,
62,
84,
9503,
41876,
43679,
3963,
827,
12,
84,
9503,
13,
628,
220,
19878,
21389,
900,
62,
79,
69,
62,
13376,
3268,
46805,
374,
21282,
1671,
2797,
16876,
376,
15919,
13,
628,
220,
43504,
10619,
705,
34,
26087,
6,
5390,
300,
83,
62,
84,
9503,
13,
220,
366,
21864,
8393,
1133,
198,
220,
43504,
10619,
705,
4303,
2640,
6,
5390,
300,
83,
62,
84,
9503,
13,
220,
366,
21864,
12793,
628,
220,
42815,
29397,
4177,
2849,
705,
6998,
62,
28480,
62,
50,
3698,
6173,
2200,
1677,
62,
35744,
2937,
6,
198,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
279,
62,
13376,
220,
796,
827,
12,
79,
69,
2539,
198,
220,
220,
220,
309,
6242,
28378,
198,
220,
220,
220,
220,
220,
279,
62,
1069,
9152,
796,
300,
83,
62,
84,
9503,
13,
628,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
9019,
62,
69,
9548,
14804,
1136,
62,
48317,
7,
1267,
3784,
2617,
62,
37635,
7,
6739,
198,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS ltcl_utils_test DEFINITION FINAL
FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
METHODS extract_author_data1 FOR TESTING RAISING cx_static_check.
METHODS extract_author_data2 FOR TESTING RAISING cx_static_check.
METHODS extract_author_data3 FOR TESTING RAISING cx_static_check.
METHODS extract_author_data4 FOR TESTING RAISING cx_static_check.
METHODS extract_author_data5 FOR TESTING RAISING cx_static_check.
METHODS extract_author_data6 FOR TESTING RAISING cx_static_check.
METHODS extract_author_data7 FOR TESTING RAISING cx_static_check.
METHODS extract_author_data8 FOR TESTING RAISING cx_static_check.
METHODS extract_author_data9 FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_utils_test IMPLEMENTATION.
METHOD extract_author_data1.
TRY.
zcl_abapgit_utils=>extract_author_data( 'Volker Jägle äÖüß <[email protected]> 1573216988 +0000' ).
CATCH zcx_abapgit_exception.
cl_abap_unit_assert=>fail( |Language-related special characters in author name are allowed.| ).
ENDTRY.
ENDMETHOD.
METHOD extract_author_data2.
TRY.
zcl_abapgit_utils=>extract_author_data(
'pull[bot&%#$] <39814207+pull[bot]@users.noreply.github.com> 1573216988 +0000' ).
CATCH zcx_abapgit_exception.
cl_abap_unit_assert=>fail( |Special characters in author name are allowed.| ).
ENDTRY.
ENDMETHOD.
METHOD extract_author_data3.
TRY.
zcl_abapgit_utils=>extract_author_data(
'pull[bot] <39814207+pull[bot]@users.noreply.github.com> 1573216988 +00001' ).
cl_abap_unit_assert=>fail( |+00001 shouldn't be valid cause it's too long.| ).
CATCH zcx_abapgit_exception.
ENDTRY.
ENDMETHOD.
METHOD extract_author_data4.
TRY.
zcl_abapgit_utils=>extract_author_data(
'pull[bot] <39814207+pull[bot]@users.noreply.github.com> 15732169881 +0000' ).
cl_abap_unit_assert=>fail( |Value shouldn't be valid cause time is invalid.| ).
CATCH zcx_abapgit_exception.
ENDTRY.
ENDMETHOD.
METHOD extract_author_data5.
TRY.
zcl_abapgit_utils=>extract_author_data(
'<39814207+pull[bot]@users.noreply.github.com> 1573216988 +0000' ).
cl_abap_unit_assert=>fail( |Value shouldn't be valid cause no author name was supplied.| ).
CATCH zcx_abapgit_exception.
ENDTRY.
ENDMETHOD.
METHOD extract_author_data6.
TRY.
zcl_abapgit_utils=>extract_author_data( 'pull[bot] 1573216988 +0000' ).
cl_abap_unit_assert=>fail( |Value shouldn't be valid cause no email was supplied.| ).
CATCH zcx_abapgit_exception.
ENDTRY.
ENDMETHOD.
METHOD extract_author_data7.
TRY.
zcl_abapgit_utils=>extract_author_data( 'pull[bot] <39814207+pull[bot]@users.noreply.github.com> +0000' ).
cl_abap_unit_assert=>fail( |Value shouldn't be valid cause no time was supplied.| ).
CATCH zcx_abapgit_exception.
ENDTRY.
ENDMETHOD.
METHOD extract_author_data8.
TRY.
zcl_abapgit_utils=>extract_author_data(
'pull[bot] <39814207+pull[bot]@users.noreply.github.com> 1573216988' ).
cl_abap_unit_assert=>fail( |Value shouldn't be valid cause +0000 wasn't supplied.| ).
CATCH zcx_abapgit_exception.
ENDTRY.
ENDMETHOD.
METHOD extract_author_data9.
TRY.
zcl_abapgit_utils=>extract_author_data(
'<pull[bot]()> <39814207+pull[bot]@users.noreply.github.com> 1573216988 +0000' ).
CATCH zcx_abapgit_exception.
cl_abap_unit_assert=>fail( |Value should be valid though brackets are in author name.| ).
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
83,
565,
62,
26791,
62,
9288,
5550,
20032,
17941,
25261,
198,
220,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
7925,
62,
9800,
62,
7890,
16,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
7925,
62,
9800,
62,
7890,
17,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
7925,
62,
9800,
62,
7890,
18,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
7925,
62,
9800,
62,
7890,
19,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
7925,
62,
9800,
62,
7890,
20,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
7925,
62,
9800,
62,
7890,
21,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
7925,
62,
9800,
62,
7890,
22,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
7925,
62,
9800,
62,
7890,
23,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
7925,
62,
9800,
62,
7890,
24,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
26791,
62,
9288,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
7925,
62,
9800,
62,
7890,
16,
13,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
26791,
14804,
2302,
974,
62,
9800,
62,
7890,
7,
705,
16598,
6122,
449,
11033,
70,
293,
6184,
97,
127,
244,
9116,
39683,
1279,
12567,
31,
1350,
13057,
13,
3262,
29,
23313,
2624,
22172,
3459,
1343,
2388,
6,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
220,
220,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
930,
32065,
12,
5363,
2041,
3435,
287,
1772,
1438,
389,
3142,
13,
91,
6739,
198,
220,
220,
220,
23578,
40405,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
7925,
62,
9800,
62,
7890,
17,
13,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
26791,
14804,
2302,
974,
62,
9800,
62,
7890,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
31216,
58,
13645,
5,
4,
29953,
60,
1279,
31952,
1415,
22745,
10,
31216,
58,
13645,
60,
31,
18417,
13,
77,
382,
2145,
13,
12567,
13,
785,
29,
23313,
2624,
22172,
3459,
1343,
2388,
6,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
220,
220,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
930,
13409,
3435,
287,
1772,
1438,
389,
3142,
13,
91,
6739,
198,
220,
220,
220,
23578,
40405,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
7925,
62,
9800,
62,
7890,
18,
13,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
26791,
14804,
2302,
974,
62,
9800,
62,
7890,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
31216,
58,
13645,
60,
1279,
31952,
1415,
22745,
10,
31216,
58,
13645,
60,
31,
18417,
13,
77,
382,
2145,
13,
12567,
13,
785,
29,
23313,
2624,
22172,
3459,
1343,
2388,
16,
6,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
930,
10,
2388,
16,
6584,
470,
307,
4938,
2728,
340,
338,
1165,
890,
13,
91,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
220,
220,
220,
23578,
40405,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
7925,
62,
9800,
62,
7890,
19,
13,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
26791,
14804,
2302,
974,
62,
9800,
62,
7890,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
31216,
58,
13645,
60,
1279,
31952,
1415,
22745,
10,
31216,
58,
13645,
60,
31,
18417,
13,
77,
382,
2145,
13,
12567,
13,
785,
29,
23313,
2624,
22172,
3459,
16,
1343,
2388,
6,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
930,
11395,
6584,
470,
307,
4938,
2728,
640,
318,
12515,
13,
91,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
220,
220,
220,
23578,
40405,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
7925,
62,
9800,
62,
7890,
20,
13,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
26791,
14804,
2302,
974,
62,
9800,
62,
7890,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
27,
31952,
1415,
22745,
10,
31216,
58,
13645,
60,
31,
18417,
13,
77,
382,
2145,
13,
12567,
13,
785,
29,
23313,
2624,
22172,
3459,
1343,
2388,
6,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
930,
11395,
6584,
470,
307,
4938,
2728,
645,
1772,
1438,
373,
14275,
13,
91,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
220,
220,
220,
23578,
40405,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
7925,
62,
9800,
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,
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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
] |
CLASS zcl_excel_sheet_setup DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
*"* public components of class ZCL_EXCEL_SHEET_SETUP
*"* do not include other source files here!!!
TYPE-POOLS abap .
DATA black_and_white TYPE flag .
DATA cell_comments TYPE stringval .
DATA copies TYPE int2 .
CONSTANTS c_break_column TYPE zexcel_break VALUE 2. "#EC NOTEXT
CONSTANTS c_break_none TYPE zexcel_break VALUE 0. "#EC NOTEXT
CONSTANTS c_break_row TYPE zexcel_break VALUE 1. "#EC NOTEXT
CONSTANTS c_cc_as_displayed TYPE string VALUE 'asDisplayed'. "#EC NOTEXT
CONSTANTS c_cc_at_end TYPE string VALUE 'atEnd'. "#EC NOTEXT
CONSTANTS c_cc_none TYPE string VALUE 'none'. "#EC NOTEXT
CONSTANTS c_ord_downthenover TYPE string VALUE 'downThenOver'. "#EC NOTEXT
CONSTANTS c_ord_overthendown TYPE string VALUE 'overThenDown'. "#EC NOTEXT
CONSTANTS c_orientation_default TYPE zexcel_sheet_orienatation VALUE 'default'. "#EC NOTEXT
CONSTANTS c_orientation_landscape TYPE zexcel_sheet_orienatation VALUE 'landscape'. "#EC NOTEXT
CONSTANTS c_orientation_portrait TYPE zexcel_sheet_orienatation VALUE 'portrait'. "#EC NOTEXT
CONSTANTS c_papersize_6_3_4_envelope TYPE zexcel_sheet_paper_size VALUE 38. "#EC NOTEXT
CONSTANTS c_papersize_a2_paper TYPE zexcel_sheet_paper_size VALUE 64. "#EC NOTEXT
CONSTANTS c_papersize_a3 TYPE zexcel_sheet_paper_size VALUE 8. "#EC NOTEXT
CONSTANTS c_papersize_a3_extra_paper TYPE zexcel_sheet_paper_size VALUE 61. "#EC NOTEXT
CONSTANTS c_papersize_a3_extra_tv_paper TYPE zexcel_sheet_paper_size VALUE 66. "#EC NOTEXT
CONSTANTS c_papersize_a3_tv_paper TYPE zexcel_sheet_paper_size VALUE 65. "#EC NOTEXT
CONSTANTS c_papersize_a4 TYPE zexcel_sheet_paper_size VALUE 9. "#EC NOTEXT
CONSTANTS c_papersize_a4_extra_paper TYPE zexcel_sheet_paper_size VALUE 51. "#EC NOTEXT
CONSTANTS c_papersize_a4_plus_paper TYPE zexcel_sheet_paper_size VALUE 58. "#EC NOTEXT
CONSTANTS c_papersize_a4_small TYPE zexcel_sheet_paper_size VALUE 10. "#EC NOTEXT
CONSTANTS c_papersize_a4_tv_paper TYPE zexcel_sheet_paper_size VALUE 53. "#EC NOTEXT
CONSTANTS c_papersize_a5 TYPE zexcel_sheet_paper_size VALUE 11. "#EC NOTEXT
CONSTANTS c_papersize_a5_extra_paper TYPE zexcel_sheet_paper_size VALUE 62. "#EC NOTEXT
CONSTANTS c_papersize_a5_tv_paper TYPE zexcel_sheet_paper_size VALUE 59. "#EC NOTEXT
CONSTANTS c_papersize_b4 TYPE zexcel_sheet_paper_size VALUE 12. "#EC NOTEXT
CONSTANTS c_papersize_b4_envelope TYPE zexcel_sheet_paper_size VALUE 33. "#EC NOTEXT
CONSTANTS c_papersize_b5 TYPE zexcel_sheet_paper_size VALUE 13. "#EC NOTEXT
CONSTANTS c_papersize_b5_envelope TYPE zexcel_sheet_paper_size VALUE 34. "#EC NOTEXT
CONSTANTS c_papersize_b6_envelope TYPE zexcel_sheet_paper_size VALUE 35. "#EC NOTEXT
CONSTANTS c_papersize_c TYPE zexcel_sheet_paper_size VALUE 24. "#EC NOTEXT
CONSTANTS c_papersize_c3_envelope TYPE zexcel_sheet_paper_size VALUE 29. "#EC NOTEXT
CONSTANTS c_papersize_c4_envelope TYPE zexcel_sheet_paper_size VALUE 30. "#EC NOTEXT
CONSTANTS c_papersize_c5_envelope TYPE zexcel_sheet_paper_size VALUE 28. "#EC NOTEXT
CONSTANTS c_papersize_c65_envelope TYPE zexcel_sheet_paper_size VALUE 32. "#EC NOTEXT
CONSTANTS c_papersize_c6_envelope TYPE zexcel_sheet_paper_size VALUE 31. "#EC NOTEXT
CONSTANTS c_papersize_d TYPE zexcel_sheet_paper_size VALUE 25. "#EC NOTEXT
CONSTANTS c_papersize_de_leg_fanfold TYPE zexcel_sheet_paper_size VALUE 41. "#EC NOTEXT
CONSTANTS c_papersize_de_std_fanfold TYPE zexcel_sheet_paper_size VALUE 40. "#EC NOTEXT
CONSTANTS c_papersize_dl_envelope TYPE zexcel_sheet_paper_size VALUE 27. "#EC NOTEXT
CONSTANTS c_papersize_e TYPE zexcel_sheet_paper_size VALUE 26. "#EC NOTEXT
CONSTANTS c_papersize_executive TYPE zexcel_sheet_paper_size VALUE 7. "#EC NOTEXT
CONSTANTS c_papersize_folio TYPE zexcel_sheet_paper_size VALUE 14. "#EC NOTEXT
CONSTANTS c_papersize_invite_envelope TYPE zexcel_sheet_paper_size VALUE 47. "#EC NOTEXT
CONSTANTS c_papersize_iso_b4 TYPE zexcel_sheet_paper_size VALUE 42. "#EC NOTEXT
CONSTANTS c_papersize_iso_b5_extra_paper TYPE zexcel_sheet_paper_size VALUE 63. "#EC NOTEXT
CONSTANTS c_papersize_italy_envelope TYPE zexcel_sheet_paper_size VALUE 36. "#EC NOTEXT
CONSTANTS c_papersize_jis_b5_tv_paper TYPE zexcel_sheet_paper_size VALUE 60. "#EC NOTEXT
CONSTANTS c_papersize_jpn_dbl_postcard TYPE zexcel_sheet_paper_size VALUE 43. "#EC NOTEXT
CONSTANTS c_papersize_ledger TYPE zexcel_sheet_paper_size VALUE 4. "#EC NOTEXT
CONSTANTS c_papersize_legal TYPE zexcel_sheet_paper_size VALUE 5. "#EC NOTEXT
CONSTANTS c_papersize_legal_extra_paper TYPE zexcel_sheet_paper_size VALUE 49. "#EC NOTEXT
CONSTANTS c_papersize_letter TYPE zexcel_sheet_paper_size VALUE 1. "#EC NOTEXT
CONSTANTS c_papersize_letter_extra_paper TYPE zexcel_sheet_paper_size VALUE 48. "#EC NOTEXT
CONSTANTS c_papersize_letter_extv_paper TYPE zexcel_sheet_paper_size VALUE 54. "#EC NOTEXT
CONSTANTS c_papersize_letter_plus_paper TYPE zexcel_sheet_paper_size VALUE 57. "#EC NOTEXT
CONSTANTS c_papersize_letter_small TYPE zexcel_sheet_paper_size VALUE 2. "#EC NOTEXT
CONSTANTS c_papersize_letter_tv_paper TYPE zexcel_sheet_paper_size VALUE 52. "#EC NOTEXT
CONSTANTS c_papersize_monarch_envelope TYPE zexcel_sheet_paper_size VALUE 37. "#EC NOTEXT
CONSTANTS c_papersize_no10_envelope TYPE zexcel_sheet_paper_size VALUE 20. "#EC NOTEXT
CONSTANTS c_papersize_no11_envelope TYPE zexcel_sheet_paper_size VALUE 21. "#EC NOTEXT
CONSTANTS c_papersize_no12_envelope TYPE zexcel_sheet_paper_size VALUE 22. "#EC NOTEXT
CONSTANTS c_papersize_no14_envelope TYPE zexcel_sheet_paper_size VALUE 23. "#EC NOTEXT
CONSTANTS c_papersize_no9_envelope TYPE zexcel_sheet_paper_size VALUE 19. "#EC NOTEXT
CONSTANTS c_papersize_note TYPE zexcel_sheet_paper_size VALUE 18. "#EC NOTEXT
CONSTANTS c_papersize_quarto TYPE zexcel_sheet_paper_size VALUE 15. "#EC NOTEXT
CONSTANTS c_papersize_standard_1 TYPE zexcel_sheet_paper_size VALUE 16. "#EC NOTEXT
CONSTANTS c_papersize_standard_2 TYPE zexcel_sheet_paper_size VALUE 17. "#EC NOTEXT
CONSTANTS c_papersize_standard_paper_1 TYPE zexcel_sheet_paper_size VALUE 44. "#EC NOTEXT
CONSTANTS c_papersize_standard_paper_2 TYPE zexcel_sheet_paper_size VALUE 45. "#EC NOTEXT
CONSTANTS c_papersize_standard_paper_3 TYPE zexcel_sheet_paper_size VALUE 46. "#EC NOTEXT
CONSTANTS c_papersize_statement TYPE zexcel_sheet_paper_size VALUE 6. "#EC NOTEXT
CONSTANTS c_papersize_supera_a4_paper TYPE zexcel_sheet_paper_size VALUE 55. "#EC NOTEXT
CONSTANTS c_papersize_superb_a3_paper TYPE zexcel_sheet_paper_size VALUE 56. "#EC NOTEXT
CONSTANTS c_papersize_tabloid TYPE zexcel_sheet_paper_size VALUE 3. "#EC NOTEXT
CONSTANTS c_papersize_tabl_extra_paper TYPE zexcel_sheet_paper_size VALUE 50. "#EC NOTEXT
CONSTANTS c_papersize_us_std_fanfold TYPE zexcel_sheet_paper_size VALUE 39. "#EC NOTEXT
CONSTANTS c_pe_blank TYPE string VALUE 'blank'. "#EC NOTEXT
CONSTANTS c_pe_dash TYPE string VALUE 'dash'. "#EC NOTEXT
CONSTANTS c_pe_displayed TYPE string VALUE 'displayed'. "#EC NOTEXT
CONSTANTS c_pe_na TYPE string VALUE 'NA'. "#EC NOTEXT
DATA diff_oddeven_headerfooter TYPE flag .
DATA draft TYPE flag .
DATA errors TYPE stringval .
DATA even_footer TYPE zexcel_s_worksheet_head_foot .
DATA even_header TYPE zexcel_s_worksheet_head_foot .
DATA first_page_number TYPE int2 .
DATA fit_to_height TYPE int2 .
DATA fit_to_page TYPE flag .
DATA fit_to_width TYPE int2 .
DATA horizontal_centered TYPE flag .
DATA horizontal_dpi TYPE int2 .
DATA margin_bottom TYPE zexcel_dec_8_2 .
DATA margin_footer TYPE zexcel_dec_8_2 .
DATA margin_header TYPE zexcel_dec_8_2 .
DATA margin_left TYPE zexcel_dec_8_2 .
DATA margin_right TYPE zexcel_dec_8_2 .
DATA margin_top TYPE zexcel_dec_8_2 .
DATA odd_footer TYPE zexcel_s_worksheet_head_foot .
DATA odd_header TYPE zexcel_s_worksheet_head_foot .
DATA orientation TYPE zexcel_sheet_orienatation .
DATA page_order TYPE string .
DATA paper_height TYPE string .
DATA paper_size TYPE int2 .
DATA paper_width TYPE string .
DATA scale TYPE int2 .
DATA use_first_page_num TYPE flag .
DATA use_printer_defaults TYPE flag .
DATA vertical_centered TYPE flag .
DATA vertical_dpi TYPE int2 .
METHODS constructor .
METHODS set_page_margins
IMPORTING
!ip_bottom TYPE float OPTIONAL
!ip_footer TYPE float OPTIONAL
!ip_header TYPE float OPTIONAL
!ip_left TYPE float OPTIONAL
!ip_right TYPE float OPTIONAL
!ip_top TYPE float OPTIONAL
!ip_unit TYPE csequence DEFAULT 'in' .
METHODS set_header_footer
IMPORTING
!ip_odd_header TYPE zexcel_s_worksheet_head_foot OPTIONAL
!ip_odd_footer TYPE zexcel_s_worksheet_head_foot OPTIONAL
!ip_even_header TYPE zexcel_s_worksheet_head_foot OPTIONAL
!ip_even_footer TYPE zexcel_s_worksheet_head_foot OPTIONAL .
METHODS get_header_footer_string
EXPORTING
!ep_odd_header TYPE string
!ep_odd_footer TYPE string
!ep_even_header TYPE string
!ep_even_footer TYPE string .
METHODS get_header_footer
EXPORTING
!ep_odd_header TYPE zexcel_s_worksheet_head_foot
!ep_odd_footer TYPE zexcel_s_worksheet_head_foot
!ep_even_header TYPE zexcel_s_worksheet_head_foot
!ep_even_footer TYPE zexcel_s_worksheet_head_foot .
PROTECTED SECTION.
*"* protected components of class ZCL_EXCEL_SHEET_SETUP
*"* do not include other source files here!!!
METHODS process_header_footer
IMPORTING
!ip_header TYPE zexcel_s_worksheet_head_foot
!ip_side TYPE string
RETURNING
VALUE(rv_processed_string) TYPE string .
PRIVATE SECTION.
*"* private components of class ZCL_EXCEL_SHEET_SETUP
*"* do not include other source files here!!!
ENDCLASS.
CLASS zcl_excel_sheet_setup IMPLEMENTATION.
METHOD constructor.
orientation = me->c_orientation_default.
* default margins
margin_bottom = '0.75'.
margin_footer = '0.3'.
margin_header = '0.3'.
margin_left = '0.7'.
margin_right = '0.7'.
margin_top = '0.75'.
* clear page settings
CLEAR: black_and_white,
cell_comments,
copies,
draft,
errors,
first_page_number,
fit_to_page,
fit_to_height,
fit_to_width,
horizontal_dpi,
orientation,
page_order,
paper_height,
paper_size,
paper_width,
scale,
use_first_page_num,
use_printer_defaults,
vertical_dpi.
ENDMETHOD.
METHOD get_header_footer.
* Only Basic font/text formatting possible:
* Bold (yes / no), Font Type, Font Size
*
* usefull placeholders, which can be used in header/footer value strings
* '&P' - page number
* '&N' - total number of pages
* '&D' - Date
* '&T' - Time
* '&F' - File Name
* '&Z' - Path
* '&A' - Sheet name
* new line via class constant CL_ABAP_CHAR_UTILITIES=>newline
*
* Example Value String 'page &P of &N'
*
* DO NOT USE &L , &C or &R which automatically created as position markers
ep_odd_header = me->odd_header.
ep_odd_footer = me->odd_footer.
ep_even_header = me->even_header.
ep_even_footer = me->even_footer.
ENDMETHOD.
METHOD get_header_footer_string.
* ----------------------------------------------------------------------
DATA: lc_marker_left(2) TYPE c VALUE '&L'
, lc_marker_right(2) TYPE c VALUE '&R'
, lc_marker_center(2) TYPE c VALUE '&C'
, lv_value TYPE string
.
* ----------------------------------------------------------------------
IF ep_odd_header IS SUPPLIED.
IF me->odd_header-left_value IS NOT INITIAL.
lv_value = me->process_header_footer( ip_header = me->odd_header ip_side = 'LEFT' ).
CONCATENATE lc_marker_left lv_value INTO ep_odd_header.
ENDIF.
IF me->odd_header-center_value IS NOT INITIAL.
lv_value = me->process_header_footer( ip_header = me->odd_header ip_side = 'CENTER' ).
CONCATENATE ep_odd_header lc_marker_center lv_value INTO ep_odd_header.
ENDIF.
IF me->odd_header-right_value IS NOT INITIAL.
lv_value = me->process_header_footer( ip_header = me->odd_header ip_side = 'RIGHT' ).
CONCATENATE ep_odd_header lc_marker_right lv_value INTO ep_odd_header.
ENDIF.
IF me->odd_header-left_image IS NOT INITIAL.
lv_value = '&G'.
CONCATENATE ep_odd_header lc_marker_left lv_value INTO ep_odd_header.
ENDIF.
IF me->odd_header-center_image IS NOT INITIAL.
lv_value = '&G'.
CONCATENATE ep_odd_header lc_marker_center lv_value INTO ep_odd_header.
ENDIF.
IF me->odd_header-right_image IS NOT INITIAL.
lv_value = '&G'.
CONCATENATE ep_odd_header lc_marker_right lv_value INTO ep_odd_header.
ENDIF.
ENDIF.
* ----------------------------------------------------------------------
IF ep_odd_footer IS SUPPLIED.
IF me->odd_footer-left_value IS NOT INITIAL.
lv_value = me->process_header_footer( ip_header = me->odd_footer ip_side = 'LEFT' ).
CONCATENATE lc_marker_left lv_value INTO ep_odd_footer.
ENDIF.
IF me->odd_footer-center_value IS NOT INITIAL.
lv_value = me->process_header_footer( ip_header = me->odd_footer ip_side = 'CENTER' ).
CONCATENATE ep_odd_footer lc_marker_center lv_value INTO ep_odd_footer.
ENDIF.
IF me->odd_footer-right_value IS NOT INITIAL.
lv_value = me->process_header_footer( ip_header = me->odd_footer ip_side = 'RIGHT' ).
CONCATENATE ep_odd_footer lc_marker_right lv_value INTO ep_odd_footer.
ENDIF.
IF me->odd_footer-left_image IS NOT INITIAL.
lv_value = '&G'.
CONCATENATE ep_odd_header lc_marker_left lv_value INTO ep_odd_footer.
ENDIF.
IF me->odd_footer-center_image IS NOT INITIAL.
lv_value = '&G'.
CONCATENATE ep_odd_header lc_marker_center lv_value INTO ep_odd_footer.
ENDIF.
IF me->odd_footer-right_image IS NOT INITIAL.
lv_value = '&G'.
CONCATENATE ep_odd_header lc_marker_right lv_value INTO ep_odd_footer.
ENDIF.
ENDIF.
* ----------------------------------------------------------------------
IF ep_even_header IS SUPPLIED.
IF me->even_header-left_value IS NOT INITIAL.
lv_value = me->process_header_footer( ip_header = me->even_header ip_side = 'LEFT' ).
CONCATENATE lc_marker_left lv_value INTO ep_even_header.
ENDIF.
IF me->even_header-center_value IS NOT INITIAL.
lv_value = me->process_header_footer( ip_header = me->even_header ip_side = 'CENTER' ).
CONCATENATE ep_even_header lc_marker_center lv_value INTO ep_even_header.
ENDIF.
IF me->even_header-right_value IS NOT INITIAL.
lv_value = me->process_header_footer( ip_header = me->even_header ip_side = 'RIGHT' ).
CONCATENATE ep_even_header lc_marker_right lv_value INTO ep_even_header.
ENDIF.
IF me->even_header-left_image IS NOT INITIAL.
lv_value = '&G'.
CONCATENATE ep_odd_header lc_marker_left lv_value INTO ep_even_header.
ENDIF.
IF me->even_header-center_image IS NOT INITIAL.
lv_value = '&G'.
CONCATENATE ep_odd_header lc_marker_center lv_value INTO ep_even_header.
ENDIF.
IF me->even_header-right_image IS NOT INITIAL.
lv_value = '&G'.
CONCATENATE ep_odd_header lc_marker_right lv_value INTO ep_even_header.
ENDIF.
ENDIF.
* ----------------------------------------------------------------------
IF ep_even_footer IS SUPPLIED.
IF me->even_footer-left_value IS NOT INITIAL.
lv_value = me->process_header_footer( ip_header = me->even_footer ip_side = 'LEFT' ).
CONCATENATE lc_marker_left lv_value INTO ep_even_footer.
ENDIF.
IF me->even_footer-center_value IS NOT INITIAL.
lv_value = me->process_header_footer( ip_header = me->even_footer ip_side = 'CENTER' ).
CONCATENATE ep_even_footer lc_marker_center lv_value INTO ep_even_footer.
ENDIF.
IF me->even_footer-right_value IS NOT INITIAL.
lv_value = me->process_header_footer( ip_header = me->even_footer ip_side = 'RIGHT' ).
CONCATENATE ep_even_footer lc_marker_right lv_value INTO ep_even_footer.
ENDIF.
IF me->even_footer-left_image IS NOT INITIAL.
lv_value = '&G'.
CONCATENATE ep_odd_header lc_marker_left lv_value INTO ep_even_footer.
ENDIF.
IF me->even_footer-center_image IS NOT INITIAL.
lv_value = '&G'.
CONCATENATE ep_odd_header lc_marker_center lv_value INTO ep_even_footer.
ENDIF.
IF me->even_footer-right_image IS NOT INITIAL.
lv_value = '&G'.
CONCATENATE ep_odd_header lc_marker_right lv_value INTO ep_even_footer.
ENDIF.
ENDIF.
* ----------------------------------------------------------------------
ENDMETHOD.
METHOD process_header_footer.
* ----------------------------------------------------------------------
* Only Basic font/text formatting possible:
* Bold (yes / no), Font Type, Font Size
DATA: lv_fname(12) TYPE c
, lv_string TYPE string
.
FIELD-SYMBOLS: <lv_value> TYPE string
, <ls_font> TYPE zexcel_s_style_font
.
* ----------------------------------------------------------------------
CONCATENATE ip_side '_VALUE' INTO lv_fname.
ASSIGN COMPONENT lv_fname OF STRUCTURE ip_header TO <lv_value>.
CONCATENATE ip_side '_FONT' INTO lv_fname.
ASSIGN COMPONENT lv_fname OF STRUCTURE ip_header TO <ls_font>.
IF <ls_font> IS ASSIGNED AND <lv_value> IS ASSIGNED.
IF <lv_value> = '&G'. "image header
rv_processed_string = <lv_value>.
ELSE.
IF <ls_font>-name IS NOT INITIAL.
CONCATENATE '&"' <ls_font>-name ',' INTO rv_processed_string.
ELSE.
rv_processed_string = '&"-,'.
ENDIF.
IF <ls_font>-bold = abap_true.
CONCATENATE rv_processed_string 'Bold"' INTO rv_processed_string.
ELSE.
CONCATENATE rv_processed_string 'Standard"' INTO rv_processed_string.
ENDIF.
IF <ls_font>-size IS NOT INITIAL.
lv_string = <ls_font>-size.
CONCATENATE rv_processed_string '&' lv_string INTO rv_processed_string.
CONDENSE rv_processed_string NO-GAPS.
ENDIF.
CONCATENATE rv_processed_string <lv_value> INTO rv_processed_string.
ENDIF.
ENDIF.
* ----------------------------------------------------------------------
ENDMETHOD.
METHOD set_header_footer.
* Only Basic font/text formatting possible:
* Bold (yes / no), Font Type, Font Size
*
* usefull placeholders, which can be used in header/footer value strings
* '&P' - page number
* '&N' - total number of pages
* '&D' - Date
* '&T' - Time
* '&F' - File Name
* '&Z' - Path
* '&A' - Sheet name
* new line via class constant CL_ABAP_CHAR_UTILITIES=>newline
*
* Example Value String 'page &P of &N'
*
* DO NOT USE &L , &C or &R which automatically created as position markers
me->odd_header = ip_odd_header.
me->odd_footer = ip_odd_footer.
me->even_header = ip_even_header.
me->even_footer = ip_even_footer.
IF me->even_header IS NOT INITIAL OR me->even_footer IS NOT INITIAL.
me->diff_oddeven_headerfooter = abap_true.
ENDIF.
ENDMETHOD.
METHOD set_page_margins.
DATA: lv_coef TYPE f,
lv_unit TYPE string.
lv_unit = ip_unit.
TRANSLATE lv_unit TO UPPER CASE.
CASE lv_unit.
WHEN 'IN'. lv_coef = 1.
WHEN 'CM'. lv_coef = '0.393700787'.
WHEN 'MM'. lv_coef = '0.0393700787'.
ENDCASE.
IF ip_bottom IS SUPPLIED. margin_bottom = lv_coef * ip_bottom. ENDIF.
IF ip_footer IS SUPPLIED. margin_footer = lv_coef * ip_footer. ENDIF.
IF ip_header IS SUPPLIED. margin_header = lv_coef * ip_header. ENDIF.
IF ip_left IS SUPPLIED. margin_left = lv_coef * ip_left. ENDIF.
IF ip_right IS SUPPLIED. margin_right = lv_coef * ip_right. ENDIF.
IF ip_top IS SUPPLIED. margin_top = lv_coef * ip_top. ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
1069,
5276,
62,
21760,
62,
40406,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1168,
5097,
62,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
28480,
8577,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
220,
220,
220,
41876,
12,
16402,
3535,
50,
450,
499,
764,
628,
220,
220,
220,
42865,
2042,
62,
392,
62,
11186,
41876,
6056,
764,
198,
220,
220,
220,
42865,
2685,
62,
15944,
41876,
4731,
2100,
764,
198,
220,
220,
220,
42865,
9088,
41876,
493,
17,
764,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
9032,
62,
28665,
41876,
1976,
1069,
5276,
62,
9032,
26173,
8924,
362,
13,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
9032,
62,
23108,
41876,
1976,
1069,
5276,
62,
9032,
26173,
8924,
657,
13,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
9032,
62,
808,
41876,
1976,
1069,
5276,
62,
9032,
26173,
8924,
352,
13,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
535,
62,
292,
62,
13812,
276,
41876,
4731,
26173,
8924,
705,
292,
7279,
21542,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
535,
62,
265,
62,
437,
41876,
4731,
26173,
8924,
705,
265,
12915,
4458,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
535,
62,
23108,
41876,
4731,
26173,
8924,
705,
23108,
4458,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
585,
62,
67,
6887,
831,
2502,
41876,
4731,
26173,
8924,
705,
2902,
6423,
5886,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
585,
62,
2502,
1169,
358,
593,
41876,
4731,
26173,
8924,
705,
2502,
6423,
8048,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
13989,
341,
62,
12286,
41876,
1976,
1069,
5276,
62,
21760,
62,
273,
2013,
265,
341,
26173,
8924,
705,
12286,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
13989,
341,
62,
1044,
6794,
41876,
1976,
1069,
5276,
62,
21760,
62,
273,
2013,
265,
341,
26173,
8924,
705,
1044,
6794,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
13989,
341,
62,
634,
12907,
41876,
1976,
1069,
5276,
62,
21760,
62,
273,
2013,
265,
341,
26173,
8924,
705,
634,
12907,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
40491,
1096,
62,
21,
62,
18,
62,
19,
62,
268,
1091,
68,
41876,
1976,
1069,
5276,
62,
21760,
62,
20189,
62,
7857,
26173,
8924,
4353,
13,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
40491,
1096,
62,
64,
17,
62,
20189,
41876,
1976,
1069,
5276,
62,
21760,
62,
20189,
62,
7857,
26173,
8924,
5598,
13,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
40491,
1096,
62,
64,
18,
41876,
1976,
1069,
5276,
62,
21760,
62,
20189,
62,
7857,
26173,
8924,
807,
13,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
40491,
1096,
62,
64,
18,
62,
26086,
62,
20189,
41876,
1976,
1069,
5276,
62,
21760,
62,
20189,
62,
7857,
26173,
8924,
8454,
13,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
40491,
1096,
62,
64,
18,
62,
26086,
62,
14981,
62,
20189,
41876,
1976,
1069,
5276,
62,
21760,
62,
20189,
62,
7857,
26173,
8924,
7930,
13,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
40491,
1096,
62,
64,
18,
62,
14981,
62,
20189,
41876,
1976,
1069,
5276,
62,
21760,
62,
20189,
62,
7857,
26173,
8924,
6135,
13,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
40491,
1096,
62,
64,
19,
41876,
1976,
1069,
5276,
62,
21760,
62,
20189,
62,
7857,
26173,
8924,
860,
13,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
40491,
1096,
62,
64,
19,
62,
26086,
62,
20189,
41876,
1976,
1069,
5276,
62,
21760,
62,
20189,
62,
7857,
26173,
8924,
6885,
13,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
40491,
1096,
62,
64,
19,
62,
9541,
62,
20189,
41876,
1976,
1069,
5276,
62,
21760,
62,
20189,
62,
7857,
26173,
8924,
7618,
13,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
40491,
1096,
62,
64,
19,
62,
17470,
41876,
1976,
1069,
5276,
62,
21760,
62,
20189,
62,
7857,
26173,
8924,
838,
13,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
40491,
1096,
62,
64,
19,
62,
14981,
62,
20189,
41876,
1976,
1069,
5276,
62,
21760,
62,
20189,
62,
7857,
26173,
8924,
7192,
13,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
40491,
1096,
62,
64,
20,
41876,
1976,
1069,
5276,
62,
21760,
62,
20189,
62,
7857,
26173,
8924,
1367,
13,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
40491,
1096,
62,
64,
20,
62,
26086,
62,
20189,
41876,
1976,
1069,
5276,
62,
21760,
62,
20189,
62,
7857,
26173,
8924,
8190,
13,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
40491,
1096,
62,
64,
20,
62,
14981,
62,
20189,
41876,
1976,
1069,
5276,
62,
21760,
62,
20189,
62,
7857,
26173,
8924,
7863,
13,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
40491,
1096,
62,
65,
19,
41876,
1976,
1069,
5276,
62,
21760,
62,
20189,
62,
7857,
26173,
8924,
1105,
13,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
40491,
1096,
62,
65,
19
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_mdg_mm_helper_staging DEFINITION
PUBLIC
INHERITING FROM zcl_mdg_mm_helper
FINAL
CREATE PRIVATE .
PUBLIC SECTION.
CLASS-METHODS destruct_instance .
CLASS-METHODS get_instance
RETURNING
VALUE(ro_mm_data) TYPE REF TO zcl_mdg_mm_helper
EXCEPTIONS
instance_creation_failed
entity_data_all_read_error
app_context_get_failed
appcontext_attribute_get_error
unexpected_error
model_get_failed .
PROTECTED SECTION.
PRIVATE SECTION.
* TYPES:
* BEGIN OF gty_s_instance,
* crequest TYPE usmd_crequest,
* material TYPE matnr,
* instance TYPE REF TO zcl_mdg_mm_helper_staging,
* END OF gty_s_instance .
* TYPES:
* gty_t_instance TYPE SORTED TABLE OF gty_s_instance WITH UNIQUE KEY crequest material .
CLASS-DATA go_instance TYPE REF TO zcl_mdg_mm_helper_staging .
DATA gv_crid TYPE usmd_crequest .
DATA gv_wiid TYPE sww_wiid .
CLASS-DATA gv_final_status_set TYPE abap_bool .
METHODS constructor
EXCEPTIONS
entity_data_all_read_error
app_context_get_failed
appcontext_attribute_get_error
model_get_failed
discard_instance
unexpected_error .
METHODS read_entity_data_cr
EXCEPTIONS
model_get_failed
app_context_get_failed
appcontext_attribute_get_error
entity_data_all_read_error
discard_instance
data_not_found
dyn_assignment_failed .
METHODS transfer_txtmi_instantiation .
METHODS read_active_data_of_cr
IMPORTING
!iv_crequest TYPE usmd_crequest
!io_model TYPE REF TO if_usmd_model_ext
EXPORTING
!et_entity_data_act TYPE usmd_ts_data_entity .
METHODS read_matchgmng_data
IMPORTING
!it_materials TYPE table_matnr
!iv_crequest TYPE usmd_crequest OPTIONAL
!it_data_entity TYPE usmd_ts_data_entity OPTIONAL
EXPORTING
!et_matchgmng TYPE usmd_ts_data_entity .
ENDCLASS.
CLASS ZCL_MDG_MM_HELPER_STAGING IMPLEMENTATION.
METHOD constructor.
CALL METHOD super->constructor.
CALL METHOD read_entity_data_cr
EXCEPTIONS
entity_data_all_read_error = 1
app_context_get_failed = 2
appcontext_attribute_get_error = 3
model_get_failed = 4
discard_instance = 5
OTHERS = 6.
IF sy-subrc <> 0 .
CASE sy-subrc.
WHEN 1.
RAISE entity_data_all_read_error.
WHEN 2.
RAISE app_context_get_failed.
WHEN 3.
RAISE appcontext_attribute_get_error.
WHEN 4.
RAISE model_get_failed.
WHEN 5.
RAISE discard_instance.
WHEN OTHERS.
RAISE unexpected_error.
ENDCASE.
ENDIF.
ENDMETHOD.
METHOD destruct_instance.
FREE go_instance.
ENDMETHOD.
METHOD get_instance.
DATA:
lo_app_context TYPE REF TO if_usmd_app_context,
lv_force_reload TYPE abap_bool,
lo_crequest_util TYPE REF TO cl_usmd_crequest_util,
lo_model TYPE REF TO if_usmd_model,
ls_crequest TYPE usmd_s_crequest,
lt_messages TYPE usmd_t_message,
lv_error TYPE abap_bool,
lv_material TYPE matnr.
FIELD-SYMBOLS:
<ls_message> TYPE usmd_s_message.
lv_force_reload = abap_false.
CALL METHOD cl_usmd_app_context=>get_context
RECEIVING
eo_context = lo_app_context.
IF lo_app_context IS BOUND.
IF lo_app_context->mv_crequest_id IS INITIAL.
lv_material = cl_mdg_bs_mat_assist_ui=>gv_current_material.
CALL METHOD zcl_mdg_mm_helper_active=>get_instance
EXPORTING
iv_material = lv_material
RECEIVING
ro_mm_data = ro_mm_data
EXCEPTIONS
instance_creation_failed = 1
entity_data_all_read_error = 2
app_context_get_failed = 3
appcontext_attribute_get_error = 4
unexpected_error = 5
model_get_failed = 6
OTHERS = 7.
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN 1.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_bp TYPE 'X' NUMBER 001 RAISING entity_data_all_read_error ##MG_MISSING.
WHEN 2.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_br_bp TYPE 'X' NUMBER 004 RAISING app_context_get_failed ##MG_MISSING.
WHEN 3.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_br_bp TYPE 'X' NUMBER 004 RAISING app_context_get_failed ##MG_MISSING.
WHEN 4.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 001 RAISING model_get_failed ##MG_MISSING.
WHEN 5.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 001 RAISING instance_creation_failed ##MG_MISSING.
WHEN 6.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 000 RAISING unexpected_error ##MG_MISSING.
WHEN OTHERS.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 000 RAISING unexpected_error ##MG_MISSING.
ENDCASE.
ENDIF.
RETURN.
ELSEIF go_instance IS BOUND.
IF lo_app_context->mv_wi_id <> go_instance->gv_wiid OR go_instance->gv_crid <> lo_app_context->mv_crequest_id.
go_instance->gv_wiid = lo_app_context->mv_wi_id.
go_instance->gv_crid = lo_app_context->mv_crequest_id.
lv_force_reload = abap_true.
ENDIF.
IF gv_final_status_set = abap_false.
CREATE OBJECT lo_crequest_util.
CALL METHOD cl_usmd_model=>get_instance
EXPORTING
i_usmd_model = if_mdg_bs_mat_gen_c=>gc_model_mm
IMPORTING
eo_instance = lo_model
et_message = lt_messages.
LOOP AT lt_messages ASSIGNING <ls_message> WHERE msgty CA 'EAX'.
lv_error = abap_true.
EXIT.
ENDLOOP.
IF lv_error = abap_false.
CALL METHOD lo_crequest_util->get_crequest
EXPORTING
id_crequest = lo_app_context->mv_crequest_id
io_model = lo_model
IMPORTING
es_crequest = ls_crequest.
IF ls_crequest IS NOT INITIAL.
IF ls_crequest-usmd_creq_status = usmd0_cs_crequest_status-finally_approved OR ls_crequest-usmd_creq_status = usmd0_cs_crequest_status-finally_rejected.
gv_final_status_set = abap_true.
lv_force_reload = abap_true.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
ENDIF.
IF go_instance IS INITIAL OR lv_force_reload = abap_true.
CREATE OBJECT go_instance TYPE zcl_mdg_mm_helper_staging
EXCEPTIONS
entity_data_all_read_error = 1
app_context_get_failed = 2
appcontext_attribute_get_error = 3
model_get_failed = 4
discard_instance = 5
unexpected_error = 6
OTHERS = 7.
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN 1.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_bp TYPE 'X' NUMBER 001 RAISING entity_data_all_read_error ##MG_MISSING.
WHEN 2.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_br_bp TYPE 'X' NUMBER 004 RAISING app_context_get_failed.
WHEN 3.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_br_bp TYPE 'X' NUMBER 004 RAISING app_context_get_failed .
WHEN 4.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 001 RAISING model_get_failed.
WHEN 5.
CALL METHOD destruct_instance.
RETURN.
WHEN 6.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 000 RAISING unexpected_error.
WHEN OTHERS.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 000 RAISING unexpected_error.
ENDCASE.
ELSE.
IF go_instance IS BOUND.
go_instance->gv_wiid = lo_app_context->mv_wi_id.
go_instance->gv_crid = lo_app_context->mv_crequest_id.
ENDIF.
ro_mm_data = go_instance.
IF ro_mm_data IS NOT BOUND.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 002 RAISING instance_creation_failed.
ENDIF.
ENDIF.
ELSE.
ro_mm_data = go_instance.
ENDIF.
* "Check if instance exists for CREQUEST (if app_context filled) or iv_matnr
* "Only if iv_force_new_instance is false
* IF iv_force_new_instance EQ abap_false.
* IF iv_matnr IS NOT INITIAL.
* READ TABLE mt_instances INTO ls_instance WITH KEY material = iv_matnr.
* ELSE.
* CALL METHOD cl_usmd_app_context=>get_context
* RECEIVING
* eo_context = lo_context.
*
* IF lo_context IS BOUND.
* CALL METHOD lo_context->get_attributes
* IMPORTING
* ev_crequest_id = lv_crequest.
* ENDIF.
* IF lv_crequest IS NOT INITIAL.
* READ TABLE mt_instances INTO ls_instance WITH KEY crequest = lv_crequest.
* ENDIF.
* ENDIF.
* ENDIF.
*
*
* IF ls_instance-instance IS INITIAL "A new Instance has to be created if no instance exists
* OR iv_force_new_instance EQ abap_true. "a new instance is forced
*
* CREATE OBJECT ro_mm_data_process TYPE zcl_mdg_mm_helper_staging
* EXPORTING
* iv_matnr = iv_matnr
* EXCEPTIONS
* entity_data_all_read_error = 1
* app_context_get_failed = 2
* appcontext_attribute_get_error = 3
* model_get_failed = 4
* discard_instance = 5
* unexpected_error = 6
* OTHERS = 7.
*
* IF sy-subrc <> 0.
* CASE sy-subrc.
* WHEN 1.
* MESSAGE ID ZCL_MDG_general_functions=>gc_msg_class_dm_bp TYPE 'X' NUMBER 001 RAISING entity_data_all_read_error.
* WHEN 2.
* MESSAGE ID ZCL_MDG_general_functions=>gc_msg_class_br_bp TYPE 'X' NUMBER 004 RAISING app_context_get_failed.
* WHEN 3.
* MESSAGE ID ZCL_MDG_general_functions=>gc_msg_class_br_bp TYPE 'X' NUMBER 004 RAISING app_context_get_failed .
* WHEN 4.
* MESSAGE ID ZCL_MDG_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 001 RAISING model_get_failed.
* WHEN 5.
* CALL METHOD destruct_instance
* EXPORTING
* iv_matnr = iv_matnr.
* RETURN.
* WHEN 6.
* MESSAGE ID ZCL_MDG_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 000 RAISING unexpected_error.
* WHEN OTHERS.
* MESSAGE ID ZCL_MDG_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 000 RAISING unexpected_error.
* ENDCASE.
* ENDIF.
*
* IF ro_mm_data_process IS NOT BOUND.
* MESSAGE ID ZCL_MDG_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 002 RAISING instance_creation_failed.
* ENDIF.
*
* "Store instance in Instance table
* ls_instance-crequest = lv_crequest.
* ls_instance-material = iv_matnr.
* ls_instance-instance = ro_mm_data_process.
* INSERT ls_instance INTO TABLE mt_instances.
*
*
* ELSE. "Instance already exists for given key
* ro_mm_data_process = ls_instance-instance.
* ENDIF.
ENDMETHOD.
METHOD read_active_data_of_cr.
DATA:
lt_key_all TYPE usmd_ts_entity_data,
lt_data_entity_temp TYPE usmd_ts_data_entity,
lv_fieldname TYPE usmd_fieldname,
lt_message TYPE usmd_t_message,
lt_materials TYPE table_matnr,
ls_material_selection TYPE usmd_s_sel,
lt_material_selection TYPE usmd_ts_sel,
lt_matchgmng TYPE usmd_ts_data_entity.
FIELD-SYMBOLS:
<lv_material> TYPE matnr,
<ls_key_all> TYPE usmd_sx_entity_data,
<lt_key> TYPE ANY TABLE,
<ls_entity_prop_ext> TYPE usmd_s_entity_prop_ext.
CLEAR et_entity_data_act.
"Get all materials in CR
CALL METHOD io_model->get_cr_objectlist
EXPORTING
i_crequest = iv_crequest
IMPORTING
et_key_all = lt_key_all.
READ TABLE lt_key_all ASSIGNING <ls_key_all> WITH TABLE KEY entity = if_mdg_bs_mat_gen_c=>gc_entity_material.
IF sy-subrc IS INITIAL.
ASSIGN <ls_key_all>-r_data->* TO <lt_key>.
lt_materials = <lt_key>.
ELSE.
RETURN.
ENDIF.
"Build selection tab for all materials in CR
LOOP AT lt_materials ASSIGNING <lv_material>.
ls_material_selection-fieldname = if_mdg_bs_mat_gen_c=>gc_fieldname_material.
ls_material_selection-sign = usmd0_cs_ra-sign_i.
ls_material_selection-option = usmd0_cs_ra-option_eq.
ls_material_selection-low = <lv_material>.
APPEND ls_material_selection TO lt_material_selection. "#EC CI_APPEND_OK
ENDLOOP.
"Read active data
IF lt_material_selection IS NOT INITIAL.
" Look for material entity in active data, if an existent material is changed (business activity = MAT2)
" This call triggers the derivations BAdI and will cause mt_mm_pp_material to be filled afterwards
LOOP AT io_model->if_usmd_model_metadata_ext~dt_entity_prop ASSIGNING <ls_entity_prop_ext> WHERE usage_type = 1. "#EC CI_SORTSEQ - accessing SAP default content in MDG
lv_fieldname = <ls_entity_prop_ext>-usmd_entity.
CALL METHOD go_model->read_entity_data_all
EXPORTING
i_fieldname = lv_fieldname
it_sel = lt_material_selection
if_active = abap_true
IMPORTING
et_message = lt_message
et_data_entity = lt_data_entity_temp.
INSERT LINES OF lt_data_entity_temp INTO TABLE et_entity_data_act.
CLEAR: lv_fieldname.
IF lt_message IS NOT INITIAL.
RETURN.
ENDIF.
ENDLOOP.
" add MATCHGMNG data
CALL METHOD read_matchgmng_data
EXPORTING
it_materials = lt_materials
it_data_entity = et_entity_data_act
IMPORTING
et_matchgmng = lt_matchgmng.
INSERT LINES OF lt_matchgmng INTO TABLE et_entity_data_act.
ENDIF.
ENDMETHOD.
METHOD read_entity_data_cr.
TYPES: BEGIN OF ty_s_usmd1222,
entity_type TYPE usmd_entity,
entity_key TYPE usmd_entity_key_hash,
entity_key_string TYPE usmd_entity_key_string,
END OF ty_s_usmd1222,
ty_t_usmd1222 TYPE SORTED TABLE OF ty_s_usmd1222 WITH UNIQUE KEY entity_type entity_key.
CONSTANTS:
c_prefix TYPE string VALUE 'GT_',
c_suffix_text TYPE string VALUE '_TXT'.
DATA:
lo_context TYPE REF TO if_usmd_app_context,
lo_model TYPE REF TO if_usmd_model_ext,
lt_entity_data TYPE usmd_ts_data_entity,
lt_entity_data_act TYPE usmd_ts_data_entity,
ls_entity_data_act TYPE usmd_sx_data_entity,
lt_message TYPE usmd_t_message,
lv_entity TYPE usmd_entity,
lv_fieldname TYPE usmd_fieldname,
lr_entity_key_struc TYPE REF TO data,
lr_entity_key_struc_1222 TYPE REF TO data,
lo_key_conv TYPE REF TO if_usmd_key_conversion,
lt_usmd1222 TYPE ty_t_usmd1222,
lv_is_parallel TYPE boolean,
lv_found TYPE boolean,
lv_updated TYPE boolean,
lr_entity TYPE REF TO data,
lv_entity_tabname TYPE seocpdname,
lt_data_entity_temp TYPE usmd_ts_data_entity,
ls_entity_data TYPE usmd_sx_data_entity,
lo_conv_api TYPE REF TO if_usmd_conv_som_gov_api,
lt_object_list TYPE usmd_gov_api_t_ent_struc.
FIELD-SYMBOLS:
<ls_usmd1222> TYPE ty_s_usmd1222,
<ls_entity_data> TYPE usmd_sx_data_entity,
<ls_entity_data_act> TYPE usmd_sx_data_entity,
<lt_entity> TYPE ANY TABLE,
<lt_entity_act> TYPE ANY TABLE,
<ls_entity> TYPE any,
<ls_entity_act> TYPE any,
<ls_entity_key_struc> TYPE any,
<ls_entity_key_struc_1222> TYPE any,
<lt_data> TYPE ANY TABLE,
<lt_mt_entity> TYPE SORTED TABLE,
<lt_entity_data> TYPE ANY TABLE,
<ls_entity_prop_ext> TYPE usmd_s_entity_prop_ext.
* Get CR Context
CALL METHOD cl_usmd_app_context=>get_context
RECEIVING
eo_context = lo_context.
IF lo_context IS NOT BOUND.
RAISE app_context_get_failed.
ENDIF.
*Get Model Instance and CR ID from the aplication context
CALL METHOD lo_context->get_attributes
IMPORTING
eo_model = lo_model.
IF lo_model IS NOT BOUND.
RAISE appcontext_attribute_get_error.
ENDIF.
"Set key fields: CR ID, WI ID, Final status
me->gv_crid = lo_context->mv_crequest_id.
me->gv_wiid = lo_context->mv_wi_id.
IF cl_usmd_crequest_util=>is_crequest_closed( i_crequest_status = cl_usmd_crequest_util=>get_cr_status_by_cr( i_crequest = lo_context->mv_crequest_id ) ).
me->gv_final_status_set = abap_true.
ENDIF.
IF me->gv_final_status_set EQ abap_false.
* Read all data from Staging Area
LOOP AT lo_model->if_usmd_model_metadata_ext~dt_entity_prop ASSIGNING <ls_entity_prop_ext> WHERE usage_type = 1. "#EC CI_SORTSEQ - accessing SAP default content in MDG
lv_fieldname = <ls_entity_prop_ext>-usmd_entity.
CALL METHOD go_model->read_entity_data_all
EXPORTING
i_fieldname = lv_fieldname
i_crequest = lo_context->mv_crequest_id
if_active = abap_false
IMPORTING
et_message = lt_message
et_data_entity = lt_data_entity_temp.
INSERT LINES OF lt_data_entity_temp INTO TABLE lt_entity_data.
CLEAR: lv_fieldname.
IF lt_message IS NOT INITIAL.
RETURN.
ENDIF.
ENDLOOP.
* read the active area of the CR
CALL METHOD read_active_data_of_cr
EXPORTING
iv_crequest = lo_context->mv_crequest_id
io_model = lo_model
IMPORTING
et_entity_data_act = lt_entity_data_act.
*get the object list by using conv api
IF cl_usmd_conv_som_gov_api=>check_instance_exists(
iv_model_name = if_mdg_bs_mat_gen_c=>gc_model_mm ) EQ abap_true.
TRY.
lo_conv_api = cl_usmd_conv_som_gov_api=>get_instance(
iv_model_name = if_mdg_bs_mat_gen_c=>gc_model_mm ).
lo_conv_api->set_environment(
EXPORTING
iv_crequest_id = lo_context->mv_crequest_id ).
CHECK lo_context->mv_crequest_id IS NOT INITIAL.
lo_conv_api->get_object_list(
IMPORTING
et_object_list = lt_object_list ).
CATCH cx_usmd_conv_som_gov_api ##NO_HANDLER.
CATCH cx_usmd_app_context_cons_error ##NO_HANDLER.
CATCH cx_usmd_conv_som_gov_api_env ##NO_HANDLER.
CATCH cx_usmd_gov_api_core_error ##NO_HANDLER.
CATCH cx_usmd_gov_api ##NO_HANDLER.
ENDTRY.
ENDIF.
* merge active data into entity data (staging data), in case it is not yet there and in case it is not part of the object list
LOOP AT lt_entity_data_act ASSIGNING <ls_entity_data_act>.
ASSIGN <ls_entity_data_act>-r_t_data->* TO <lt_entity>.
CHECK <lt_entity> IS ASSIGNED.
IF <ls_entity_data_act>-usmd_entity_cont IS INITIAL.
lv_entity = <ls_entity_data_act>-usmd_entity.
ELSE.
lv_entity = <ls_entity_data_act>-usmd_entity_cont.
ENDIF.
READ TABLE lt_object_list WITH KEY entity = lv_entity TRANSPORTING NO FIELDS. "not part of the object list
IF sy-subrc NE 0.
READ TABLE lt_entity_data WITH KEY usmd_entity = lv_entity TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
ls_entity_data-struct = <ls_entity_data_act>-struct.
ls_entity_data-usmd_entity = <ls_entity_data_act>-usmd_entity.
ls_entity_data-usmd_entity_cont = <ls_entity_data_act>-usmd_entity_cont.
CREATE DATA ls_entity_data-r_t_data LIKE <lt_entity>.
ASSIGN ls_entity_data-r_t_data->* TO <lt_entity_data>.
MOVE-CORRESPONDING <lt_entity> TO <lt_entity_data>.
INSERT ls_entity_data INTO TABLE lt_entity_data.
ENDIF.
ENDIF.
CLEAR: lv_entity,ls_entity_data.
UNASSIGN: <lt_entity>.
ENDLOOP.
ELSE.
CALL METHOD read_active_data_of_cr
EXPORTING
iv_crequest = lo_context->mv_crequest_id
io_model = lo_model
IMPORTING
et_entity_data_act = lt_entity_data.
ENDIF.
"If we have a CR type that has parallel processing enabled we have to remove changes from other CRs
CALL METHOD cl_usmd2_cust_access_service=>is_parallel_cr_type
EXPORTING
iv_creq_type = lo_context->mv_crequest_type
RECEIVING
rv_is_parallel = lv_is_parallel.
IF lv_is_parallel EQ abap_true.
SELECT entity_type entity_key entity_key_string FROM usmd1222 "#EC CI_SUBRC
INTO TABLE lt_usmd1222
WHERE crequest_id EQ lo_context->mv_crequest_id.
"Get active data
CALL METHOD read_active_data_of_cr
EXPORTING
iv_crequest = lo_context->mv_crequest_id
io_model = lo_model
IMPORTING
et_entity_data_act = lt_entity_data_act.
CALL METHOD cl_usmd_key_conversion=>get_instance
RECEIVING
ro_key_conversion = lo_key_conv.
LOOP AT lt_usmd1222 ASSIGNING <ls_usmd1222>.
lv_entity = <ls_usmd1222>-entity_type.
lv_fieldname = lv_entity.
CALL METHOD lo_model->create_data_reference
EXPORTING
i_fieldname = lv_fieldname
i_struct = lo_model->gc_struct_key
if_table = abap_false
IMPORTING
er_data = lr_entity_key_struc_1222.
ASSIGN lr_entity_key_struc_1222->* TO <ls_entity_key_struc_1222>.
CALL METHOD lo_model->create_data_reference
EXPORTING
i_fieldname = lv_fieldname
i_struct = lo_model->gc_struct_key
if_table = abap_false
IMPORTING
er_data = lr_entity_key_struc.
ASSIGN lr_entity_key_struc->* TO <ls_entity_key_struc>.
"Get key of change
CALL METHOD lo_key_conv->string_tech_2_entity_key
EXPORTING
iv_key_string = <ls_usmd1222>-entity_key_string
IMPORTING
ev_entity_type = lv_entity
es_entity_key = <ls_entity_key_struc_1222>.
"Get the corresponding inactive data
UNASSIGN <ls_entity_data>.
READ TABLE lt_entity_data ASSIGNING <ls_entity_data>
WITH KEY usmd_entity = if_mdg_bs_mat_gen_c=>gc_entity_material
usmd_entity_cont = lv_entity.
IF sy-subrc IS NOT INITIAL.
READ TABLE lt_entity_data ASSIGNING <ls_entity_data>
WITH KEY usmd_entity = lv_entity
usmd_entity_cont = space.
ENDIF.
IF <ls_entity_data> IS ASSIGNED.
ASSIGN <ls_entity_data>-r_t_data->* TO <lt_entity>.
lv_found = abap_false.
LOOP AT <lt_entity> ASSIGNING <ls_entity>. "#EC CI_NESTED
MOVE-CORRESPONDING <ls_entity> TO <ls_entity_key_struc>.
IF <ls_entity_key_struc> EQ <ls_entity_key_struc_1222>.
lv_found = abap_true.
EXIT.
ENDIF.
ENDLOOP.
"If found replace the act data with inact data
"If NOT found we have a deletion -> remove from active data
IF lv_found EQ abap_true.
"Update or Insert
UNASSIGN <ls_entity_data_act>.
READ TABLE lt_entity_data_act ASSIGNING <ls_entity_data_act>
WITH KEY usmd_entity = if_mdg_bs_mat_gen_c=>gc_entity_material
usmd_entity_cont = lv_entity.
IF sy-subrc IS NOT INITIAL.
READ TABLE lt_entity_data_act ASSIGNING <ls_entity_data_act>
WITH KEY usmd_entity = lv_entity
usmd_entity_cont = space.
ENDIF.
IF <ls_entity_data_act> IS ASSIGNED. "Update
lv_updated = abap_false.
ASSIGN <ls_entity_data_act>-r_t_data->* TO <lt_entity_act>.
LOOP AT <lt_entity_act> ASSIGNING <ls_entity_act>. "#EC CI_NESTED
MOVE-CORRESPONDING <ls_entity_act> TO <ls_entity_key_struc>.
IF <ls_entity_key_struc> EQ <ls_entity_key_struc_1222>.
DELETE TABLE <lt_entity_act> FROM <ls_entity_act>. "#EC CI_ANYSEQ
INSERT <ls_entity> INTO TABLE <lt_entity_act>.
lv_updated = abap_true.
EXIT.
ENDIF.
ENDLOOP.
IF lv_updated EQ abap_false. "Insert new entry
INSERT <ls_entity> INTO TABLE <lt_entity_act>.
ENDIF.
ELSE. "Insert
CLEAR ls_entity_data_act.
ls_entity_data_act-struct = <ls_entity_data>-struct.
ls_entity_data_act-usmd_entity = <ls_entity_data>-usmd_entity.
ls_entity_data_act-usmd_entity_cont = <ls_entity_data>-usmd_entity_cont.
CREATE DATA ls_entity_data_act-r_t_data LIKE <lt_entity>.
ASSIGN ls_entity_data_act-r_t_data->* TO <lt_entity_act>.
INSERT <ls_entity> INTO TABLE <lt_entity_act>.
INSERT ls_entity_data_act INTO TABLE lt_entity_data_act.
ENDIF.
ELSE. "delete
UNASSIGN <ls_entity_data_act>.
READ TABLE lt_entity_data_act ASSIGNING <ls_entity_data_act>
WITH KEY usmd_entity = if_mdg_bs_mat_gen_c=>gc_entity_material
usmd_entity_cont = lv_entity.
IF sy-subrc IS NOT INITIAL.
READ TABLE lt_entity_data_act ASSIGNING <ls_entity_data_act>
WITH KEY usmd_entity = lv_entity
usmd_entity_cont = space.
ENDIF.
IF <ls_entity_data_act> IS ASSIGNED.
ASSIGN <ls_entity_data_act>-r_t_data->* TO <lt_entity_act>.
LOOP AT <lt_entity_act> ASSIGNING <ls_entity_act>. "#EC CI_NESTED
MOVE-CORRESPONDING <ls_entity_act> TO <ls_entity_key_struc>.
IF <ls_entity_key_struc> EQ <ls_entity_key_struc_1222>.
DELETE TABLE <lt_entity_act> FROM <ls_entity_act>. "#EC CI_ANYSEQ
ENDIF.
ENDLOOP.
ENDIF."IF <ls_entity_data_act> IS ASSIGNED.
ENDIF.
ELSE. "Delete
UNASSIGN <ls_entity_data_act>.
READ TABLE lt_entity_data_act ASSIGNING <ls_entity_data_act>
WITH KEY usmd_entity = if_mdg_bs_mat_gen_c=>gc_entity_material
usmd_entity_cont = lv_entity.
IF sy-subrc IS NOT INITIAL.
READ TABLE lt_entity_data_act ASSIGNING <ls_entity_data_act>
WITH KEY usmd_entity = lv_entity
usmd_entity_cont = space.
ENDIF.
IF <ls_entity_data_act> IS ASSIGNED.
ASSIGN <ls_entity_data_act>-r_t_data->* TO <lt_entity_act>.
LOOP AT <lt_entity_act> ASSIGNING <ls_entity_act>. "#EC CI_NESTED
MOVE-CORRESPONDING <ls_entity_act> TO <ls_entity_key_struc>.
IF <ls_entity_key_struc> EQ <ls_entity_key_struc_1222>.
DELETE TABLE <lt_entity_act> FROM <ls_entity_act>. "#EC CI_ANYSEQ
ENDIF.
ENDLOOP.
ENDIF."IF <ls_entity_data_act> IS ASSIGNED.
ENDIF.
ENDLOOP.
lt_entity_data = lt_entity_data_act.
ENDIF. "IF lv_is_parallel EQ abap_true.
"Now we have gathered the correct data
"It has to be stored in the GTs
* Transform untyped to typed data
LOOP AT lt_entity_data ASSIGNING <ls_entity_data>.
CLEAR: lv_entity_tabname, lr_entity.
UNASSIGN: <ls_entity>, <lt_data>, <lt_mt_entity>.
* Construct export table name and assign it to field symbol (it's used to fill the related mt)
CASE <ls_entity_data>-struct.
WHEN if_usmd_model_ext=>gc_struct_key_attr.
IF <ls_entity_data>-usmd_entity_cont IS INITIAL.
CONCATENATE c_prefix <ls_entity_data>-usmd_entity INTO lv_entity_tabname.
ELSE.
CONCATENATE c_prefix <ls_entity_data>-usmd_entity_cont INTO lv_entity_tabname.
ENDIF.
WHEN if_usmd_model_ext=>gc_struct_key_txt_langu.
IF <ls_entity_data>-usmd_entity_cont IS INITIAL.
IF <ls_entity_data>-usmd_entity = if_mdg_bs_mat_gen_c~gc_entity_material.
CONCATENATE c_prefix zcl_mdg_mm_helper=>cs_entities-material_txt INTO lv_entity_tabname.
ELSE.
CONCATENATE c_prefix <ls_entity_data>-usmd_entity c_suffix_text INTO lv_entity_tabname.
ENDIF.
ELSE.
CONCATENATE c_prefix <ls_entity_data>-usmd_entity_cont c_suffix_text INTO lv_entity_tabname.
ENDIF.
ENDCASE.
* write data to gt_* tables
ASSIGN (lv_entity_tabname) TO <lt_mt_entity>. "#EC CI_SUBRC
IF <lt_mt_entity> IS NOT ASSIGNED.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_mm TYPE 'X' NUMBER 002 WITH lv_entity_tabname INTO zcl_mdg_general_functions=>gv_error_message ##MG_MISSING.
RAISE dyn_assignment_failed.
ENDIF.
CREATE DATA lr_entity LIKE LINE OF <lt_mt_entity>.
ASSIGN lr_entity->* TO <ls_entity>.
IF <ls_entity> IS NOT ASSIGNED.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_mm TYPE 'X' NUMBER 002 WITH lv_entity_tabname INTO zcl_mdg_general_functions=>gv_error_message ##MG_MISSING.
RAISE dyn_assignment_failed.
ENDIF.
CLEAR: <ls_entity>, <lt_mt_entity>.
ASSIGN <ls_entity_data>-r_t_data->* TO <lt_data>.
IF sy-subrc <> 0.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_mm TYPE 'X' NUMBER 002 WITH lv_entity_tabname INTO zcl_mdg_general_functions=>gv_error_message ##MG_MISSING.
RAISE dyn_assignment_failed.
ENDIF.
IF <lt_data> IS ASSIGNED.
MOVE-CORRESPONDING <lt_data> TO <lt_mt_entity>.
ENDIF.
ENDLOOP.
CALL METHOD transfer_txtmi_instantiation.
*
* CALL METHOD cl_usmd_app_context=>get_context
* RECEIVING
* eo_context = lo_context.
*
* IF lo_context IS NOT BOUND.
* RAISE app_context_get_failed.
* ENDIF.
*
**Get Model Instance and CR ID from the aplication context
* CALL METHOD lo_context->get_attributes
* IMPORTING
* eo_model = lo_model.
* IF lo_model IS NOT BOUND.
* RAISE appcontext_attribute_get_error.
* ENDIF.
*
* "Set key fields
* "CR ID
* "WI ID
* "Final status
* me->gv_crid = lo_context->mv_crequest_id.
* me->gv_wiid = lo_context->mv_wi_id.
*
* IF cl_usmd_crequest_util=>is_crequest_closed( i_crequest_status = cl_usmd_crequest_util=>get_cr_status_by_cr( i_crequest = lo_context->mv_crequest_id ) ).
* me->gv_final_status_set = abap_true.
* ENDIF.
*
* IF me->gv_final_status_set EQ abap_false.
**read all material entity DATA from staging area
* CALL METHOD lo_model->read_entity_data_all
* EXPORTING
* i_fieldname = if_mdg_bs_mat_gen_c=>gc_fieldname_material
* i_crequest = lo_context->mv_crequest_id
* if_active = abap_false
* IMPORTING
* et_message = lt_message
* et_data_entity = lt_entity_data.
*
**Read all dradbasic(document) entity data from staging area
* CALL METHOD lo_model->read_entity_data_all
* EXPORTING
* i_fieldname = ZCL_MDG_MM_helper=>scs_fields-dradbasic
* i_crequest = lo_context->mv_crequest_id
* if_active = abap_false
* IMPORTING
* et_message = lt_message
* et_data_entity = lt_entity_data_dradbasic.
*
* INSERT LINES OF lt_entity_data_dradbasic INTO TABLE lt_entity_data.
*
* ELSE.
* CALL METHOD read_active_data_of_cr
* EXPORTING
* iv_crequest = lo_context->mv_crequest_id
* io_model = lo_model
* IMPORTING
* et_entity_data_act = lt_entity_data.
* ENDIF.
*
*
* "If we have a CR type that has parallel processing enabled we have to remove changes from other CRs
* CALL METHOD cl_usmd2_cust_access_service=>is_parallel_cr_type
* EXPORTING
* iv_creq_type = lo_context->mv_crequest_type
* RECEIVING
* rv_is_parallel = lv_is_parallel.
*
* IF lv_is_parallel EQ abap_true.
* SELECT entity_type entity_key entity_key_string FROM usmd1222
* INTO TABLE lt_usmd1222
* WHERE crequest_id EQ lo_context->mv_crequest_id.
*
* "Get active data
* CALL METHOD read_active_data_of_cr
* EXPORTING
* iv_crequest = lo_context->mv_crequest_id
* io_model = lo_model
* IMPORTING
* et_entity_data_act = lt_entity_data_act.
*
* CALL METHOD cl_usmd_key_conversion=>get_instance
* RECEIVING
* ro_key_conversion = lo_key_conv.
*
* LOOP AT lt_usmd1222 ASSIGNING <ls_usmd1222>.
* lv_entity = <ls_usmd1222>-entity_type.
* lv_fieldname = lv_entity.
*
* CALL METHOD lo_model->create_data_reference
* EXPORTING
* i_fieldname = lv_fieldname
* i_struct = lo_model->gc_struct_key
* if_table = abap_false
* IMPORTING
* er_data = lr_entity_key_struc_1222.
* ASSIGN lr_entity_key_struc_1222->* TO <ls_entity_key_struc_1222>.
*
* CALL METHOD lo_model->create_data_reference
* EXPORTING
* i_fieldname = lv_fieldname
* i_struct = lo_model->gc_struct_key
* if_table = abap_false
* IMPORTING
* er_data = lr_entity_key_struc.
* ASSIGN lr_entity_key_struc->* TO <ls_entity_key_struc>.
*
* "Get key of change
* CALL METHOD lo_key_conv->string_tech_2_entity_key
* EXPORTING
* iv_key_string = <ls_usmd1222>-entity_key_string
* IMPORTING
* ev_entity_type = lv_entity
* es_entity_key = <ls_entity_key_struc_1222>.
*
* "Get the corresponding inactive data
* UNASSIGN <ls_entity_data>.
* READ TABLE lt_entity_data ASSIGNING <ls_entity_data>
* WITH KEY usmd_entity = if_mdg_bs_mat_gen_c=>gc_entity_material
* usmd_entity_cont = lv_entity.
* IF sy-subrc IS NOT INITIAL.
* READ TABLE lt_entity_data ASSIGNING <ls_entity_data>
* WITH KEY usmd_entity = lv_entity
* usmd_entity_cont = space.
* ENDIF.
*
* IF <ls_entity_data> IS ASSIGNED.
* ASSIGN <ls_entity_data>-r_t_data->* TO <lt_entity>.
* lv_found = abap_false.
* LOOP AT <lt_entity> ASSIGNING <ls_entity>.
* MOVE-CORRESPONDING <ls_entity> TO <ls_entity_key_struc>.
* IF <ls_entity_key_struc> EQ <ls_entity_key_struc_1222>.
* lv_found = abap_true.
* EXIT.
* ENDIF.
* ENDLOOP.
*
* "If found replace the act data with inact data
* "If NOT found we have a deletion -> remove from active data
* IF lv_found EQ abap_true.
* "Update or Insert
* UNASSIGN <ls_entity_data_act>.
* READ TABLE lt_entity_data_act ASSIGNING <ls_entity_data_act>
* WITH KEY usmd_entity = if_mdg_bs_mat_gen_c=>gc_entity_material
* usmd_entity_cont = lv_entity.
* IF sy-subrc IS NOT INITIAL.
* READ TABLE lt_entity_data_act ASSIGNING <ls_entity_data_act>
* WITH KEY usmd_entity = lv_entity
* usmd_entity_cont = space.
* ENDIF.
*
* IF <ls_entity_data_act> IS ASSIGNED. "Update
* lv_updated = abap_false.
* ASSIGN <ls_entity_data_act>-r_t_data->* TO <lt_entity_act>.
* LOOP AT <lt_entity_act> ASSIGNING <ls_entity_act>.
* MOVE-CORRESPONDING <ls_entity_act> TO <ls_entity_key_struc>.
* IF <ls_entity_key_struc> EQ <ls_entity_key_struc_1222>.
* DELETE TABLE <lt_entity_act> FROM <ls_entity_act>.
* INSERT <ls_entity> INTO TABLE <lt_entity_act>.
* lv_updated = abap_true.
* EXIT.
* ENDIF.
* ENDLOOP.
* IF lv_updated EQ abap_false. "Insert new entry
* INSERT <ls_entity> INTO TABLE <lt_entity_act>.
* ENDIF.
* ELSE. "Insert
* CLEAR ls_entity_data_act.
* ls_entity_data_act-struct = <ls_entity_data>-struct.
* ls_entity_data_act-usmd_entity = <ls_entity_data>-usmd_entity.
* ls_entity_data_act-usmd_entity_cont = <ls_entity_data>-usmd_entity_cont.
* CREATE DATA ls_entity_data_act-r_t_data LIKE <lt_entity>.
* ASSIGN ls_entity_data_act-r_t_data->* TO <lt_entity_act>.
* INSERT <ls_entity> INTO TABLE <lt_entity_act>.
* INSERT ls_entity_data_act INTO TABLE lt_entity_data_act.
* ENDIF.
*
*
* ELSE. "delete
* UNASSIGN <ls_entity_data_act>.
* READ TABLE lt_entity_data_act ASSIGNING <ls_entity_data_act>
* WITH KEY usmd_entity = if_mdg_bs_mat_gen_c=>gc_entity_material
* usmd_entity_cont = lv_entity.
* IF sy-subrc IS NOT INITIAL.
* READ TABLE lt_entity_data_act ASSIGNING <ls_entity_data_act>
* WITH KEY usmd_entity = lv_entity
* usmd_entity_cont = space.
* ENDIF.
* IF <ls_entity_data_act> IS ASSIGNED.
* ASSIGN <ls_entity_data_act>-r_t_data->* TO <lt_entity_act>.
* LOOP AT <lt_entity_act> ASSIGNING <ls_entity_act>.
* MOVE-CORRESPONDING <ls_entity_act> TO <ls_entity_key_struc>.
* IF <ls_entity_key_struc> EQ <ls_entity_key_struc_1222>.
* DELETE TABLE <lt_entity_act> FROM <ls_entity_act>.
* ENDIF.
* ENDLOOP.
* ENDIF."IF <ls_entity_data_act> IS ASSIGNED.
* ENDIF.
* ELSE. "Delete
* UNASSIGN <ls_entity_data_act>.
* READ TABLE lt_entity_data_act ASSIGNING <ls_entity_data_act>
* WITH KEY usmd_entity = if_mdg_bs_mat_gen_c=>gc_entity_material
* usmd_entity_cont = lv_entity.
* IF sy-subrc IS NOT INITIAL.
* READ TABLE lt_entity_data_act ASSIGNING <ls_entity_data_act>
* WITH KEY usmd_entity = lv_entity
* usmd_entity_cont = space.
* ENDIF.
* IF <ls_entity_data_act> IS ASSIGNED.
* ASSIGN <ls_entity_data_act>-r_t_data->* TO <lt_entity_act>.
* LOOP AT <lt_entity_act> ASSIGNING <ls_entity_act>.
* MOVE-CORRESPONDING <ls_entity_act> TO <ls_entity_key_struc>.
* IF <ls_entity_key_struc> EQ <ls_entity_key_struc_1222>.
* DELETE TABLE <lt_entity_act> FROM <ls_entity_act>.
* ENDIF.
* ENDLOOP.
* ENDIF."IF <ls_entity_data_act> IS ASSIGNED.
* ENDIF.
* ENDLOOP.
*
* lt_entity_data = lt_entity_data_act.
* ENDIF. "IF lv_is_parallel EQ abap_true.
*
*
*
* "Now we have gathered the correct data
* "It has to be stored in the GTs
** Transform untyped to typed data
* LOOP AT lt_entity_data ASSIGNING <ls_entity_data>.
* CLEAR: lv_entity_tabname, lr_entity.
* UNASSIGN: <ls_entity>, <lt_data>, <lt_mt_entity>.
** Construct export table name and assign it to field symbol (it's used to fill the related mt)
*
* CASE <ls_entity_data>-struct.
* WHEN if_usmd_model_ext=>gc_struct_key_attr.
* IF <ls_entity_data>-usmd_entity_cont IS INITIAL.
* CONCATENATE lc_prefix <ls_entity_data>-usmd_entity INTO lv_entity_tabname.
* ELSE.
* CONCATENATE lc_prefix <ls_entity_data>-usmd_entity_cont INTO lv_entity_tabname.
* ENDIF.
* WHEN if_usmd_model_ext=>gc_struct_key_txt_langu.
* IF <ls_entity_data>-usmd_entity_cont IS INITIAL.
* IF <ls_entity_data>-usmd_entity = if_mdg_bs_mat_gen_c~gc_entity_material.
* CONCATENATE lc_prefix ZCL_MDG_MM_helper=>cs_entities-material_txt INTO lv_entity_tabname.
* ELSE.
* CONCATENATE lc_prefix <ls_entity_data>-usmd_entity lc_suffix_text INTO lv_entity_tabname.
* ENDIF.
* ELSE.
* CONCATENATE lc_prefix <ls_entity_data>-usmd_entity_cont lc_suffix_text INTO lv_entity_tabname.
* ENDIF.
* ENDCASE.
*
** write data to gt_* tables
* ASSIGN (lv_entity_tabname) TO <lt_mt_entity>. "#EC CI_SUBRC
* IF <lt_mt_entity> IS NOT ASSIGNED.
* MESSAGE ID ZCL_MDG_general_functions=>gc_msg_class_dm_mm TYPE 'X' NUMBER 002 WITH lv_entity_tabname INTO ZCL_MDG_general_functions=>gv_error_message.
* RAISE dyn_assignment_failed.
* ENDIF.
*
* CREATE DATA lr_entity LIKE LINE OF <lt_mt_entity>.
* ASSIGN lr_entity->* TO <ls_entity>.
* IF <ls_entity> IS NOT ASSIGNED.
* MESSAGE ID ZCL_MDG_general_functions=>gc_msg_class_dm_mm TYPE 'X' NUMBER 002 WITH lv_entity_tabname INTO ZCL_MDG_general_functions=>gv_error_message.
* RAISE dyn_assignment_failed.
* ENDIF.
*
* CLEAR: <ls_entity>, <lt_mt_entity>.
*
* ASSIGN <ls_entity_data>-r_t_data->* TO <lt_data>.
* IF sy-subrc <> 0.
* MESSAGE ID ZCL_MDG_general_functions=>gc_msg_class_dm_mm TYPE 'X' NUMBER 002 WITH lv_entity_tabname INTO ZCL_MDG_general_functions=>gv_error_message.
* RAISE dyn_assignment_failed.
* ENDIF.
*
* IF <lt_data> IS ASSIGNED.
* MOVE-CORRESPONDING <lt_data> TO <lt_mt_entity>.
* ENDIF.
*
* ENDLOOP.
*
* CALL METHOD transfer_txtmi_instantiation.
ENDMETHOD.
METHOD read_matchgmng_data.
DATA:
lr_data TYPE REF TO data,
ls_matchgmng TYPE /mdgmm/_s_mm_pp_matchgmng,
ls_type1_entity_data TYPE usmd_sx_data_entity,
lt_aeoi_tmp TYPE SORTED TABLE OF aeoi WITH UNIQUE KEY aennr aetyp objkt,
lt_aeoi TYPE TABLE OF aeoi.
FIELD-SYMBOLS:
<lv_material> TYPE matnr,
<ls_data_entity> TYPE usmd_sx_data_entity,
<ls_aeoi> TYPE aeoi,
<lt_data> TYPE zif_mdg_mm_datatypes=>gty_t_matchgmng.
CLEAR: et_matchgmng.
LOOP AT it_materials ASSIGNING <lv_material>.
CLEAR: lt_aeoi_tmp, lt_aeoi.
* material change management data
CALL METHOD go_matchgmng_api->read_chgmng
EXPORTING
iv_matnr = <lv_material>
IMPORTING
et_aeoi = lt_aeoi_tmp.
LOOP AT lt_aeoi_tmp ASSIGNING <ls_aeoi>. "#EC CI_NESTED
INSERT <ls_aeoi> INTO TABLE lt_aeoi.
ENDLOOP.
SORT lt_aeoi DESCENDING BY revlv. "#EC CI_SORTLOOP
IF lt_aeoi IS NOT INITIAL.
" check if an entry for MATCHGMNG already is staging area
READ TABLE it_data_entity WITH KEY usmd_entity = 'MATCHGMNG' ASSIGNING <ls_data_entity>.
IF sy-subrc = 0 AND <ls_data_entity> IS ASSIGNED.
" entry exists -> modify data for this entry
ASSIGN <ls_data_entity>-r_t_data->* TO <lt_data>.
LOOP AT lt_aeoi ASSIGNING <ls_aeoi>. "#EC CI_NESTED
CLEAR ls_matchgmng.
ls_matchgmng-material = <lv_material>.
ls_matchgmng-matchgmng = iv_crequest.
ls_matchgmng-ecochgmng = <ls_aeoi>-aennr.
ls_matchgmng-revchgmng = <ls_aeoi>-revlv.
INSERT ls_matchgmng INTO TABLE <lt_data>.
ENDLOOP.
" no entry exists -> it has to be created from scratch
ELSE.
CLEAR: lr_data.
CALL METHOD go_model->create_data_reference
EXPORTING
i_fieldname = 'MATCHGMNG'
i_struct = if_usmd_model=>gc_struct_key_attr
i_tabtype = if_usmd_model=>gc_tabtype_sorted
IMPORTING
er_data = lr_data.
ASSIGN lr_data->* TO <lt_data>.
LOOP AT lt_aeoi ASSIGNING <ls_aeoi>. "#EC CI_NESTED
CLEAR ls_matchgmng.
ls_matchgmng-material = <lv_material>.
ls_matchgmng-matchgmng = iv_crequest.
ls_matchgmng-ecochgmng = <ls_aeoi>-aennr.
ls_matchgmng-revchgmng = <ls_aeoi>-revlv.
INSERT ls_matchgmng INTO TABLE <lt_data>.
ENDLOOP.
CLEAR: ls_type1_entity_data.
ls_type1_entity_data-usmd_entity = 'MATCHGMNG'.
ls_type1_entity_data-struct = if_usmd_model=>gc_struct_key_attr.
ls_type1_entity_data-r_t_data = lr_data.
INSERT ls_type1_entity_data INTO TABLE et_matchgmng.
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD transfer_txtmi_instantiation.
FIELD-SYMBOLS:
<ls_material> TYPE /mdgmm/_s_mm_pp_material,
<ls_mattxt> TYPE /mdgmm/_st_mm_pp_material.
LOOP AT gt_material ASSIGNING <ls_material>.
IF <ls_material>-txtmi IS INITIAL.
READ TABLE gt_mattxt
ASSIGNING <ls_mattxt>
WITH TABLE KEY material = <ls_material>-material langu = sy-langu.
IF sy-subrc IS INITIAL.
<ls_material>-txtmi = <ls_mattxt>-txtmi.
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
9132,
70,
62,
3020,
62,
2978,
525,
62,
301,
3039,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
9132,
70,
62,
3020,
62,
2978,
525,
198,
220,
25261,
198,
220,
29244,
6158,
4810,
3824,
6158,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
15256,
62,
39098,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
39098,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
3020,
62,
7890,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
9132,
70,
62,
3020,
62,
2978,
525,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
4554,
62,
38793,
62,
47904,
198,
220,
220,
220,
220,
220,
220,
220,
9312,
62,
7890,
62,
439,
62,
961,
62,
18224,
198,
220,
220,
220,
220,
220,
220,
220,
598,
62,
22866,
62,
1136,
62,
47904,
198,
220,
220,
220,
220,
220,
220,
220,
598,
22866,
62,
42348,
62,
1136,
62,
18224,
198,
220,
220,
220,
220,
220,
220,
220,
10059,
62,
18224,
198,
220,
220,
220,
220,
220,
220,
220,
2746,
62,
1136,
62,
47904,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
198,
9,
220,
220,
220,
24412,
47,
1546,
25,
198,
9,
220,
220,
220,
220,
220,
347,
43312,
3963,
308,
774,
62,
82,
62,
39098,
11,
198,
9,
220,
220,
220,
220,
220,
220,
220,
1126,
6138,
41876,
514,
9132,
62,
7513,
6138,
11,
198,
9,
220,
220,
220,
220,
220,
220,
220,
2587,
41876,
2603,
48624,
11,
198,
9,
220,
220,
220,
220,
220,
220,
220,
4554,
41876,
4526,
37,
5390,
1976,
565,
62,
9132,
70,
62,
3020,
62,
2978,
525,
62,
301,
3039,
11,
198,
9,
220,
220,
220,
220,
220,
23578,
3963,
308,
774,
62,
82,
62,
39098,
764,
198,
9,
220,
220,
220,
24412,
47,
1546,
25,
198,
9,
220,
220,
220,
220,
220,
308,
774,
62,
83,
62,
39098,
41876,
311,
9863,
1961,
43679,
3963,
308,
774,
62,
82,
62,
39098,
13315,
4725,
33866,
8924,
35374,
1126,
6138,
2587,
764,
628,
220,
220,
220,
42715,
12,
26947,
467,
62,
39098,
41876,
4526,
37,
5390,
1976,
565,
62,
9132,
70,
62,
3020,
62,
2978,
525,
62,
301,
3039,
764,
198,
220,
220,
220,
42865,
308,
85,
62,
66,
6058,
41876,
514,
9132,
62,
7513,
6138,
764,
198,
220,
220,
220,
42865,
308,
85,
62,
37686,
312,
41876,
264,
1383,
62,
37686,
312,
764,
198,
220,
220,
220,
42715,
12,
26947,
308,
85,
62,
20311,
62,
13376,
62,
2617,
41876,
450,
499,
62,
30388,
764,
628,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
9312,
62,
7890,
62,
439,
62,
961,
62,
18224,
198,
220,
220,
220,
220,
220,
220,
220,
598,
62,
22866,
62,
1136,
62,
47904,
198,
220,
220,
220,
220,
220,
220,
220,
598,
22866,
62,
42348,
62,
1136,
62,
18224,
198,
220,
220,
220,
220,
220,
220,
220,
2746,
62,
1136,
62,
47904,
198,
220,
220,
220,
220,
220,
220,
220,
27537,
62,
39098,
198,
220,
220,
220,
220,
220,
220,
220,
10059,
62,
18224,
764,
198,
220,
220,
220,
337,
36252,
50,
1100,
62,
26858,
62,
7890,
62,
6098,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
2746,
62,
1136,
62,
47904,
198,
220,
220,
220,
220,
220,
220,
220,
598,
62,
22866,
62,
1136,
62,
47904,
198,
220,
220,
220,
220,
220,
220,
220,
598,
22866,
62,
42348,
62,
1136,
62,
18224,
198,
220,
220,
220,
220,
220,
220,
220,
9312,
62,
7890,
62,
439,
62,
961,
62,
18224,
198,
220,
220,
220,
220,
220,
220,
220,
27537,
62,
39098,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
1662,
62,
9275,
198,
220,
220,
220,
220,
220,
220,
220,
37860,
62,
562,
16747,
62,
47904,
764,
198,
220,
220,
220,
337,
36252,
50,
4351,
62,
14116,
11632,
62,
8625,
415,
3920,
764,
198,
220,
220,
220,
337,
36252,
50,
1100,
62,
5275,
62,
7890,
62,
1659,
62,
6098,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
7513,
6138,
220,
220,
220,
220,
220,
220,
220,
41876,
514,
9132,
62,
7513,
6138,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
19849,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
611,
62,
385,
9132,
62,
19849,
62,
2302,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
316,
62,
26858,
62,
7890,
62,
529,
41876,
514,
9132,
62,
912,
62,
7890,
62,
26858,
764,
198,
220,
220,
220,
337,
36252,
50,
1100,
62,
15699,
39870,
782,
62,
7890,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
33665,
82,
220,
220,
41876,
3084,
62,
6759,
48624,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
7513,
6138,
220,
220,
220,
41876,
514,
9132,
62,
7513,
6138,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
7890,
62,
26858,
41876,
514,
9132,
62,
912,
62,
7890,
62,
26858,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
316,
62,
15699,
39870,
782,
220,
220,
41876,
514,
9132,
62,
912,
62,
7890,
62,
26858,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
12740,
38,
62,
12038,
62,
39,
3698,
18973,
62,
2257,
4760,
2751,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
42815,
337,
36252,
2208,
3784,
41571,
273,
13,
628,
220,
220,
220,
42815,
337,
36252,
1100,
62,
26858,
62,
7890,
62,
6098,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
9312,
62,
7890
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_object_fdt0 DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_objects_super
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_object .
PROTECTED SECTION.
PRIVATE SECTION.
METHODS check_is_local
RETURNING
VALUE(rv_is_local) TYPE abap_bool .
METHODS get_application_id
RETURNING
VALUE(rv_application_id) TYPE fdt_admn_0000s-application_id .
METHODS before_xml_deserialize
IMPORTING
!iv_package TYPE devclass
EXPORTING
!ev_create TYPE abap_bool
!ev_is_local TYPE abap_bool
CHANGING
!co_dom_tree TYPE REF TO if_ixml_document
RAISING
zcx_abapgit_exception .
METHODS filter_xml_serialize
CHANGING
!co_ixml_element TYPE REF TO if_ixml_element
RAISING
zcx_abapgit_exception .
METHODS set_field
IMPORTING
!iv_name TYPE string
!iv_value TYPE string DEFAULT ''
CHANGING
!co_ixml_element TYPE REF TO if_ixml_element
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS zcl_abapgit_object_fdt0 IMPLEMENTATION.
METHOD before_xml_deserialize.
DATA lv_application_id TYPE fdt_admn_0000s-application_id.
DATA lv_timestamp TYPE timestamp.
DATA lv_transport TYPE string.
DATA lv_dlvunit TYPE tdevc-dlvunit.
DATA lo_node_local TYPE REF TO if_ixml_element.
DATA lo_node_package TYPE REF TO if_ixml_element.
DATA lo_node_id TYPE REF TO if_ixml_element.
DATA lo_xml_element TYPE REF TO if_ixml_element.
DATA lv_count TYPE i.
lo_node_local = co_dom_tree->find_from_name( name = 'Local'
namespace = 'FDTNS' ).
IF lo_node_local IS BOUND.
ev_is_local = lo_node_local->get_value( ).
ENDIF.
lo_node_package = co_dom_tree->find_from_name(
name = 'DevelopmentPackage'
namespace = 'FDTNS' ).
IF lo_node_package IS BOUND.
lo_node_package->set_value( value = |{ iv_package }| ).
ENDIF.
lo_node_id = co_dom_tree->find_from_name(
name = 'ApplicationId'
namespace = 'FDTNS' ).
IF lo_node_id IS BOUND.
lv_application_id = lo_node_id->get_value( ).
SELECT COUNT( * ) FROM fdt_admn_0000s INTO lv_count
WHERE object_type = 'AP'
AND id = lv_application_id
AND deleted = ''.
ev_create = boolc( lv_count = 0 ).
ENDIF.
" Fill in user/time/system-specific fields
GET TIME STAMP FIELD lv_timestamp.
lv_transport = |${ sy-sysid }0000000000000001|.
lo_xml_element = co_dom_tree->get_root_element( ).
IF ev_create = abap_true.
set_field(
EXPORTING
iv_name = 'CreationUser'
iv_value = |{ sy-uname }|
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'CreationTimestamp'
iv_value = |{ lv_timestamp }|
CHANGING
co_ixml_element = lo_xml_element ).
ENDIF.
set_field(
EXPORTING
iv_name = 'ChangeUser'
iv_value = |{ sy-uname }|
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'ChangeTimestamp'
iv_value = |{ lv_timestamp }|
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'User'
iv_value = |{ sy-uname }|
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'Timestamp'
iv_value = |{ lv_timestamp }|
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'Trrequest'
iv_value = lv_transport
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'Trversion'
iv_value = '000001'
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'Trtimestamp'
iv_value = |{ lv_timestamp }|
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'Trsysid'
iv_value = |{ sy-sysid }|
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'Trclient'
iv_value = |{ sy-mandt }|
CHANGING
co_ixml_element = lo_xml_element ).
set_field(
EXPORTING
iv_name = 'OversId'
iv_value = |{ lv_application_id }|
CHANGING
co_ixml_element = lo_xml_element ).
SELECT SINGLE dlvunit FROM tdevc INTO lv_dlvunit WHERE devclass = iv_package.
IF sy-subrc = 0.
set_field(
EXPORTING
iv_name = 'SoftwareComponent'
iv_value = |{ lv_dlvunit }|
CHANGING
co_ixml_element = lo_xml_element ).
ENDIF.
lo_xml_element->set_attribute(
name = 'Client'
value = |{ sy-mandt }| ).
lo_xml_element->set_attribute(
name = 'Date'
value = |{ sy-datum }| ).
lo_xml_element->set_attribute(
name = 'SAPRelease'
value = |{ sy-saprl }| ).
lo_xml_element->set_attribute(
name = 'Server'
value = |{ sy-host }| ).
lo_xml_element->set_attribute(
name = 'SourceExportReqID'
value = lv_transport ).
lo_xml_element->set_attribute(
name = 'SystemID'
value = |{ sy-sysid }| ).
lo_xml_element->set_attribute(
name = 'Time'
value = |{ sy-uzeit }| ).
lo_xml_element->set_attribute(
name = 'User'
value = |{ sy-uname }| ).
ENDMETHOD.
METHOD check_is_local.
SELECT SINGLE local_object FROM fdt_admn_0000s INTO rv_is_local
WHERE object_type = 'AP'
AND name = ms_item-obj_name.
ENDMETHOD.
METHOD filter_xml_serialize.
DATA lo_components_node TYPE REF TO if_ixml_element.
lo_components_node = co_ixml_element->find_from_name( name = 'ComponentReleases'
namespace = 'FDTNS' ).
IF lo_components_node IS BOUND.
co_ixml_element->remove_child( old_child = lo_components_node ).
ENDIF.
" Clear user/time/system-specific fields
set_field(
EXPORTING
iv_name = 'CreationUser'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'CreationTimestamp'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'ChangeUser'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'ChangeTimestamp'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'User'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'Timestamp'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'Trrequest'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'Trversion'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'Trtimestamp'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'Trsysid'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'Trclient'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'OversId'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'SoftwareComponent'
CHANGING
co_ixml_element = co_ixml_element ).
set_field(
EXPORTING
iv_name = 'DevelopmentPackage'
CHANGING
co_ixml_element = co_ixml_element ).
" Clear attributes of root FDTNS:Fdt node
co_ixml_element->set_attribute(
name = 'Client'
value = '' ).
co_ixml_element->set_attribute(
name = 'Date'
value = '' ).
co_ixml_element->set_attribute(
name = 'SAPRelease'
value = '' ).
co_ixml_element->set_attribute(
name = 'Server'
value = '' ).
co_ixml_element->set_attribute(
name = 'SourceExportReqID'
value = '' ).
co_ixml_element->set_attribute(
name = 'SystemID'
value = '' ).
co_ixml_element->set_attribute(
name = 'Time'
value = '' ).
co_ixml_element->set_attribute(
name = 'User'
value = '' ).
ENDMETHOD.
METHOD get_application_id.
SELECT SINGLE application_id FROM fdt_admn_0000s INTO rv_application_id
WHERE object_type = 'AP'
AND name = ms_item-obj_name.
ENDMETHOD.
METHOD set_field.
DATA:
lo_node_collection TYPE REF TO if_ixml_node_collection,
lo_node TYPE REF TO if_ixml_node,
lv_index TYPE i.
lo_node_collection = co_ixml_element->get_elements_by_tag_name(
namespace = 'FDTNS'
name = iv_name ).
lv_index = 0.
WHILE lv_index < lo_node_collection->get_length( ).
lo_node = lo_node_collection->get_item( lv_index ).
lo_node->set_value( iv_value ).
lv_index = lv_index + 1.
ENDWHILE.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
DATA lv_ch_user TYPE fdt_admn_0000s-ch_user.
SELECT SINGLE ch_user FROM fdt_admn_0000s INTO lv_ch_user
WHERE object_type = 'AP'
AND name = ms_item-obj_name.
rv_user = lv_ch_user.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA lv_is_local TYPE abap_bool.
DATA lt_application_id TYPE TABLE OF fdt_admn_0000s-application_id.
DATA ls_object_category_sel TYPE if_fdt_query=>s_object_category_sel.
DATA lv_failure TYPE abap_bool.
DATA lx_fdt_input TYPE REF TO cx_fdt_input.
lv_is_local = check_is_local( ).
SELECT application_id FROM fdt_admn_0000s INTO TABLE lt_application_id
WHERE object_type = 'AP'
AND name = ms_item-obj_name.
ls_object_category_sel-system_objects = 'X'.
TRY.
IF lv_is_local = abap_true.
cl_fdt_delete_handling=>mark_for_delete_via_job(
EXPORTING
is_object_category_sel = ls_object_category_sel
ita_application_id = lt_application_id
iv_background = abap_true
iv_local_option = '1'
iv_appl_transported_option = '2'
iv_obj_transported_option = '2'
IMPORTING
ev_failure = lv_failure ).
IF lv_failure IS INITIAL.
cl_fdt_delete_handling=>delete_logical_via_job(
EXPORTING
is_object_category_sel = ls_object_category_sel
ita_application_id = lt_application_id
iv_retention_time = 0
iv_background = abap_true
iv_local_option = '1'
iv_appl_transported_option = '2'
iv_obj_transported_option = '2'
IMPORTING
ev_failure = lv_failure ).
IF lv_failure IS INITIAL.
cl_fdt_delete_handling=>delete_physical_via_job(
EXPORTING
is_object_category_sel = ls_object_category_sel
ita_application_id = lt_application_id
iv_retention_time = 0
iv_background = abap_true
iv_local_option = '1'
iv_appl_transported_option = '2'
IMPORTING
ev_failure = lv_failure ).
ENDIF.
ENDIF.
ELSE.
tadir_insert( iv_package ).
corr_insert( iv_package ).
cl_fdt_delete_handling=>mark_for_delete_via_job(
EXPORTING
is_object_category_sel = ls_object_category_sel
ita_application_id = lt_application_id
iv_background = abap_true
iv_local_option = '2'
iv_appl_transported_option = '1'
iv_obj_transported_option = '1'
IMPORTING
ev_failure = lv_failure ).
IF lv_failure IS INITIAL.
cl_fdt_delete_handling=>delete_logical_via_job(
EXPORTING
is_object_category_sel = ls_object_category_sel
ita_application_id = lt_application_id
iv_retention_time = 0
iv_background = abap_true
iv_local_option = '2'
iv_appl_transported_option = '1'
iv_obj_transported_option = '1'
IMPORTING
ev_failure = lv_failure ).
IF lv_failure IS INITIAL.
cl_fdt_delete_handling=>delete_physical_via_job(
EXPORTING
is_object_category_sel = ls_object_category_sel
ita_application_id = lt_application_id
iv_retention_time = 0
iv_background = abap_true
iv_local_option = '2'
iv_appl_transported_option = '1'
IMPORTING
ev_failure = lv_failure ).
ENDIF.
ENDIF.
ENDIF.
IF lv_failure = abap_true.
zcx_abapgit_exception=>raise( |Error deleting { ms_item-obj_type } { ms_item-obj_name }| ).
ENDIF.
CATCH cx_fdt_input INTO lx_fdt_input.
zcx_abapgit_exception=>raise_with_text( lx_fdt_input ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA lo_dexc TYPE REF TO if_fdt_data_exchange.
DATA lx_fdt_input TYPE REF TO cx_fdt_input.
DATA lo_dom_tree TYPE REF TO if_ixml_document.
DATA lv_transportable_package TYPE abap_bool.
DATA lv_is_local TYPE abap_bool.
DATA lt_message TYPE if_fdt_types=>t_message.
DATA lv_create TYPE abap_bool.
FIELD-SYMBOLS <ls_message> TYPE if_fdt_types=>s_message.
lo_dom_tree = io_xml->get_raw( ).
before_xml_deserialize(
EXPORTING
iv_package = iv_package
IMPORTING
ev_create = lv_create
ev_is_local = lv_is_local
CHANGING
co_dom_tree = lo_dom_tree ).
lv_transportable_package = zcl_abapgit_factory=>get_sap_package( iv_package )->are_changes_recorded_in_tr_req( ).
IF lv_transportable_package = abap_true AND lv_is_local = abap_true.
zcx_abapgit_exception=>raise( 'Local applications can only be imported into a local package' ).
ELSEIF lv_transportable_package = abap_false AND lv_is_local = abap_false.
zcx_abapgit_exception=>raise( 'Transportable application can only be imported into transportable package' ).
ENDIF.
lo_dexc = cl_fdt_factory=>if_fdt_factory~get_instance( )->get_data_exchange( ).
TRY.
IF lv_is_local = abap_true. "Local Object
lo_dexc->import_xml(
EXPORTING
io_dom_tree = lo_dom_tree
iv_create = lv_create
iv_activate = abap_true
iv_simulate = abap_false
IMPORTING
et_message = lt_message ).
ELSE. "Transportable Object
tadir_insert( iv_package ).
corr_insert( iv_package ).
lo_dexc->import_xml(
EXPORTING
io_dom_tree = lo_dom_tree
iv_create = lv_create
iv_activate = abap_true
iv_simulate = abap_false
iv_workbench_trrequest = iv_transport
IMPORTING
et_message = lt_message ).
ENDIF.
LOOP AT lt_message ASSIGNING <ls_message>.
ii_log->add(
iv_msg = <ls_message>-text
iv_type = <ls_message>-msgty ).
ENDLOOP.
CATCH cx_fdt_input INTO lx_fdt_input.
zcx_abapgit_exception=>raise_with_text( lx_fdt_input ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA lv_count TYPE i.
SELECT COUNT( * ) FROM fdt_admn_0000s INTO lv_count
WHERE object_type = 'AP'
AND name = ms_item-obj_name
AND deleted = ''.
rv_bool = boolc( lv_count > 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
DATA lo_local_version_output TYPE REF TO zcl_abapgit_xml_output.
DATA lo_local_version_input TYPE REF TO zcl_abapgit_xml_input.
CREATE OBJECT lo_local_version_output.
zif_abapgit_object~serialize( lo_local_version_output ).
CREATE OBJECT lo_local_version_input
EXPORTING
iv_xml = lo_local_version_output->zif_abapgit_xml_output~render( ).
CREATE OBJECT ri_comparator TYPE zcl_abapgit_object_tabl_compar
EXPORTING
ii_local = lo_local_version_input.
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_application_id TYPE fdt_admn_0000s-application_id.
DATA lx_fdt_input TYPE REF TO cx_fdt_input.
DATA lo_instance TYPE REF TO if_fdt_admin_data.
DATA lt_version TYPE if_fdt_admin_data=>ts_version.
DATA lv_index TYPE sy-tabix.
FIELD-SYMBOLS <ls_version> LIKE LINE OF lt_version.
lv_application_id = get_application_id( ).
TRY.
cl_fdt_factory=>get_instance_generic(
EXPORTING
iv_id = lv_application_id
IMPORTING
eo_instance = lo_instance ).
CATCH cx_fdt_input INTO lx_fdt_input.
zcx_abapgit_exception=>raise_with_text( lx_fdt_input ).
ENDTRY.
lo_instance->get_versions( IMPORTING ets_version = lt_version ).
lv_index = lines( lt_version ).
READ TABLE lt_version ASSIGNING <ls_version> INDEX lv_index.
rv_active = boolc( <ls_version>-state = 'A' ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
DATA lv_application_id TYPE string.
lv_application_id = get_application_id( ).
rv_is_locked = exists_a_lock_entry_for(
iv_lock_object = 'FDT_ENQUEUE_ID'
iv_argument = |$ST{ lv_application_id }| ).
ENDMETHOD.
METHOD zif_abapgit_object~jump.
DATA lv_application_id TYPE fdt_admn_0000s-application_id.
DATA lx_root TYPE REF TO cx_root.
DATA lo_fdt_wd TYPE REF TO if_fdt_wd_factory.
lv_application_id = get_application_id( ).
IF lv_application_id IS NOT INITIAL.
TRY.
lo_fdt_wd = cl_fdt_wd_factory=>if_fdt_wd_factory~get_instance( ).
lo_fdt_wd->get_ui_execution( )->execute_workbench( iv_id = lv_application_id ).
CATCH cx_root INTO lx_root.
zcx_abapgit_exception=>raise_with_text( lx_root ).
ENDTRY.
ELSE.
zcx_abapgit_exception=>raise( 'Could not open BRF+ Workbench' ).
ENDIF.
rv_exit = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA lo_dexc TYPE REF TO if_fdt_data_exchange.
DATA lv_application_id TYPE fdt_admn_0000s-application_id.
DATA lx_fdt_input TYPE REF TO cx_fdt_input.
DATA lv_xml_fdt0_application TYPE string.
DATA lo_xml_document TYPE REF TO if_ixml_document.
DATA lo_xml_element TYPE REF TO if_ixml_element.
lv_application_id = get_application_id( ).
lo_dexc = cl_fdt_factory=>if_fdt_factory~get_instance( )->get_data_exchange( ).
TRY.
lo_dexc->export_xml_application(
EXPORTING
iv_application_id = lv_application_id
iv_schema = if_fdt_data_exchange=>gc_xml_schema_type_external
iv_xml_version = if_fdt_data_exchange=>gc_xml_version
IMPORTING
ev_string = lv_xml_fdt0_application ).
lo_xml_document = cl_ixml_80_20=>parse_to_document( stream_string = lv_xml_fdt0_application ).
lo_xml_element = lo_xml_document->get_root_element( ).
filter_xml_serialize( CHANGING co_ixml_element = lo_xml_element ).
io_xml->set_raw( lo_xml_element ).
CATCH cx_fdt_input INTO lx_fdt_input.
zcx_abapgit_exception=>raise_with_text( lx_fdt_input ).
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
16344,
83,
15,
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,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
2198,
62,
271,
62,
12001,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
271,
62,
12001,
8,
41876,
450,
499,
62,
30388,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
31438,
62,
312,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
31438,
62,
312,
8,
41876,
277,
28664,
62,
324,
10295,
62,
2388,
82,
12,
31438,
62,
312,
764,
198,
220,
220,
220,
337,
36252,
50,
878,
62,
19875,
62,
8906,
48499,
1096,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26495,
220,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
1990,
62,
17953,
220,
220,
41876,
450,
499,
62,
30388,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
1990,
62,
271,
62,
12001,
41876,
450,
499,
62,
30388,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
1073,
62,
3438,
62,
21048,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
22897,
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,
8106,
62,
19875,
62,
46911,
1096,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
1073,
62,
844,
4029,
62,
30854,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
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,
3245,
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,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
8367,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
5550,
38865,
10148,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
1073,
62,
844,
4029,
62,
30854,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
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,
16344,
83,
15,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
878,
62,
19875,
62,
8906,
48499,
1096,
13,
628,
220,
220,
220,
42865,
300,
85,
62,
31438,
62,
312,
41876,
277,
28664,
62,
324,
10295,
62,
2388,
82,
12,
31438,
62,
312,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
16514,
27823,
41876,
41033,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
7645,
634,
41876,
4731,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
67,
6780,
20850,
41876,
256,
7959,
66,
12,
67,
6780,
20850,
13,
198,
220,
220,
220,
42865,
2376,
62,
17440,
62,
12001,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
13,
198,
220,
220,
220,
42865,
2376,
62,
17440,
62,
26495,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
13,
198,
220,
220,
220,
42865,
2376,
62,
17440,
62,
312,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
13,
198,
220,
220,
220,
42865,
2376,
62,
19875,
62,
30854,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
9127,
41876,
1312,
13,
628,
220,
220,
220,
2376,
62,
17440,
62,
12001,
796,
763,
62,
3438,
62,
21048,
3784,
19796,
62,
6738,
62,
3672,
7,
1438,
220,
220,
220,
220,
220,
796,
705,
14565,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25745,
796,
705,
37,
24544,
8035,
6,
6739,
628,
220,
220,
220,
16876,
2376,
62,
17440,
62,
12001,
3180,
347,
15919,
13,
198,
220,
220,
220,
220,
220,
819,
62,
271,
62,
12001,
796,
2376,
62,
17440,
62,
12001,
3784,
1136,
62,
8367,
7,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
2376,
62,
17440,
62,
26495,
796,
763,
62,
3438,
62,
21048,
3784,
19796,
62,
6738,
62,
3672,
7,
198,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
796,
705,
41206,
27813,
6,
198,
220,
220,
220,
220,
220,
25745,
796,
705,
37,
24544,
8035,
6,
6739,
198,
220,
220,
220,
16876,
2376,
62,
17440,
62,
26495,
3180,
347,
15919,
13,
198,
220,
220,
220,
220,
220,
2376,
62,
17440,
62,
26495,
3784,
2617,
62,
8367,
7,
1988,
796,
930,
90,
21628,
62,
26495,
1782,
91,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
2376,
62,
17440,
62,
312,
796,
763,
62,
3438,
62,
21048,
3784,
19796,
62,
6738,
62,
3672,
7,
198,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
796,
705,
23416,
7390,
6,
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
] |
CLASS zcl_abapgit_oo_class 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~create_sotr
REDEFINITION .
METHODS zif_abapgit_oo_object_fnc~delete
REDEFINITION .
METHODS zif_abapgit_oo_object_fnc~generate_locals
REDEFINITION .
METHODS zif_abapgit_oo_object_fnc~get_class_properties
REDEFINITION .
METHODS zif_abapgit_oo_object_fnc~get_includes
REDEFINITION .
METHODS zif_abapgit_oo_object_fnc~insert_text_pool
REDEFINITION .
METHODS zif_abapgit_oo_object_fnc~read_sotr
REDEFINITION .
METHODS zif_abapgit_oo_object_fnc~read_text_pool
REDEFINITION .
METHODS zif_abapgit_oo_object_fnc~deserialize_source
REDEFINITION .
PROTECTED SECTION.
PRIVATE SECTION.
CLASS-METHODS update_source_index
IMPORTING
!iv_clsname TYPE csequence
!io_scanner TYPE REF TO cl_oo_source_scanner_class .
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 generate_classpool
IMPORTING
!iv_name TYPE seoclsname
RAISING
zcx_abapgit_exception .
CLASS-METHODS update_meta
IMPORTING
!iv_name TYPE seoclsname
!iv_exposure TYPE seoexpose
!it_source TYPE rswsourcet
RAISING
zcx_abapgit_exception .
CLASS-METHODS determine_method_include
IMPORTING
!iv_name TYPE seoclsname
!iv_method TYPE seocpdname
RETURNING
VALUE(rv_program) TYPE programm
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_class
RAISING
zcx_abapgit_exception .
CLASS-METHODS update_full_class_include
IMPORTING
!iv_classname TYPE seoclsname
!it_source TYPE string_table
!it_methods TYPE cl_oo_source_scanner_class=>type_method_implementations .
CLASS-METHODS create_report
IMPORTING
!iv_program TYPE programm
!it_source TYPE string_table
!iv_extension TYPE sychar02
!iv_program_type TYPE sychar01
!iv_version TYPE r3state .
CLASS-METHODS update_cs_number_of_methods
IMPORTING
!iv_classname TYPE seoclsname
!iv_number_of_impl_methods TYPE i .
ENDCLASS.
CLASS ZCL_ABAPGIT_OO_CLASS IMPLEMENTATION.
METHOD create_report.
INSERT REPORT iv_program FROM it_source EXTENSION TYPE iv_extension STATE iv_version PROGRAM TYPE iv_program_type.
ASSERT sy-subrc = 0.
ENDMETHOD.
METHOD determine_method_include.
DATA: ls_mtdkey TYPE seocpdkey.
ls_mtdkey-clsname = iv_name.
ls_mtdkey-cpdname = iv_method.
cl_oo_classname_service=>get_method_include(
EXPORTING
mtdkey = ls_mtdkey
RECEIVING
result = rv_program
EXCEPTIONS
method_not_existing = 1 ).
IF sy-subrc = 0.
RETURN.
ENDIF.
CALL FUNCTION 'SEO_METHOD_GENERATE_INCLUDE'
EXPORTING
suppress_mtdkey_check = seox_true
mtdkey = ls_mtdkey
EXCEPTIONS
not_existing = 1
model_only = 2
include_existing = 3
method_imp_not_generated = 4
method_imp_not_initialised = 5
_internal_class_not_existing = 6
_internal_method_overflow = 7
cancelled = 8
method_is_abstract_implemented = 9
method_is_final_implemented = 10
internal_error_insert_report = 11
OTHERS = 12.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SEO_METHOD_GENERATE_INCLUDE' ).
ENDIF.
rv_program = cl_oo_classname_service=>get_method_include( ls_mtdkey ).
ENDMETHOD.
METHOD generate_classpool.
DATA: ls_clskey TYPE seoclskey.
ls_clskey-clsname = iv_name.
CALL FUNCTION 'SEO_CLASS_GENERATE_CLASSPOOL'
EXPORTING
clskey = ls_clskey
suppress_corr = seox_true
EXCEPTIONS
not_existing = 1
model_only = 2
class_pool_not_generated = 3
class_stment_not_generated = 4
locals_not_generated = 5
macros_not_generated = 6
public_sec_not_generated = 7
protected_sec_not_generated = 8
private_sec_not_generated = 9
typeref_not_generated = 10
class_pool_not_initialised = 11
class_stment_not_initialised = 12
locals_not_initialised = 13
macros_not_initialised = 14
public_sec_not_initialised = 15
protected_sec_not_initialised = 16
private_sec_not_initialised = 17
typeref_not_initialised = 18
_internal_class_overflow = 19
OTHERS = 20.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SEO_CLASS_GENERATE_CLASSPOOL' ).
ENDIF.
ENDMETHOD.
METHOD init_scanner.
TRY.
ro_scanner = cl_oo_source_scanner_class=>create_class_scanner(
clif_name = iv_name
source = it_source ).
ro_scanner->scan( ).
CATCH cx_clif_scan_error.
zcx_abapgit_exception=>raise( 'error initializing CLAS scanner' ).
ENDTRY.
ENDMETHOD.
METHOD update_cs_number_of_methods.
" Indirect access to keep downward compatibility
DATA lr_cache_entry TYPE REF TO data.
FIELD-SYMBOLS: <lg_cache_entry> TYPE any,
<lg_field> TYPE any.
TRY.
CREATE DATA lr_cache_entry TYPE ('SEO_CS_CACHE').
CATCH cx_sy_create_data_error.
* does not exist in some older systems
RETURN.
ENDTRY.
ASSIGN lr_cache_entry->* TO <lg_cache_entry>.
ASSERT sy-subrc = 0.
ASSIGN COMPONENT 'CLSNAME' OF STRUCTURE <lg_cache_entry>
TO <lg_field>.
ASSERT sy-subrc = 0.
<lg_field> = iv_classname.
ASSIGN COMPONENT 'NO_OF_METHOD_IMPLS' OF STRUCTURE <lg_cache_entry>
TO <lg_field>.
ASSERT sy-subrc = 0.
<lg_field> = iv_number_of_impl_methods.
MODIFY ('SEO_CS_CACHE') FROM <lg_cache_entry>.
ENDMETHOD.
METHOD update_full_class_include.
CONSTANTS: lc_class_source_extension TYPE sychar02 VALUE 'CS',
lc_include_program_type TYPE sychar01 VALUE 'I',
lc_active_version TYPE r3state VALUE 'A'.
create_report( iv_program = cl_oo_classname_service=>get_cs_name( iv_classname )
it_source = it_source
iv_extension = lc_class_source_extension
iv_program_type = lc_include_program_type
iv_version = lc_active_version ).
" Assuming that all methods that were scanned are implemented
update_cs_number_of_methods( iv_classname = iv_classname
iv_number_of_impl_methods = lines( it_methods ) ).
ENDMETHOD.
METHOD update_meta.
DATA: lo_update TYPE REF TO cl_oo_class_section_source,
ls_clskey TYPE seoclskey,
lv_scan_error TYPE seox_boolean.
ls_clskey-clsname = iv_name.
TRY.
CREATE OBJECT lo_update TYPE ('CL_OO_CLASS_SECTION_SOURCE')
EXPORTING
clskey = ls_clskey
exposure = iv_exposure
state = 'A'
source = it_source
suppress_constrctr_generation = seox_true
EXCEPTIONS
class_not_existing = 1
read_source_error = 2
OTHERS = 3.
CATCH cx_sy_dyn_call_param_not_found.
* downport to 702, see https://github.com/larshp/abapGit/issues/933
* this will READ REPORT instead of using it_source, which should be okay
CREATE OBJECT lo_update TYPE cl_oo_class_section_source
EXPORTING
clskey = ls_clskey
exposure = iv_exposure
state = 'A'
EXCEPTIONS
class_not_existing = 1
read_source_error = 2
OTHERS = 3.
ENDTRY.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error instantiating CL_OO_CLASS_SECTION_SOURCE' ).
ENDIF.
lo_update->set_dark_mode( seox_true ).
TRY.
CALL METHOD lo_update->('SET_AMDP_SUPPORT')
EXPORTING
enabled = abap_true.
CATCH cx_sy_dyn_call_illegal_method.
* AMDP not supported in this system, ignore error
ENDTRY.
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( 'CLAS, error while scanning source' ).
ENDIF.
* this will update the SEO* database tables
lo_update->revert_scan_result( ).
IF iv_exposure = seoc_exposure_public.
generate_classpool( iv_name ).
ENDIF.
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 update_source_index.
CONSTANTS:
lc_version_active TYPE r3state VALUE 'A', "#EC NOTEXT
lc_version_inactive TYPE r3state VALUE 'I'. "#EC NOTEXT
" dynamic invocation, IF_OO_SOURCE_POS_INDEX_HELPER doesn't exist in 702.
DATA lo_index_helper TYPE REF TO object.
TRY.
CREATE OBJECT lo_index_helper TYPE ('CL_OO_SOURCE_POS_INDEX_HELPER').
CALL METHOD lo_index_helper->('IF_OO_SOURCE_POS_INDEX_HELPER~CREATE_INDEX_WITH_SCANNER')
EXPORTING
class_name = iv_clsname
version = lc_version_active
scanner = io_scanner.
CALL METHOD lo_index_helper->('IF_OO_SOURCE_POS_INDEX_HELPER~DELETE_INDEX')
EXPORTING
class_name = iv_clsname
version = lc_version_inactive.
CATCH cx_root.
" it's probably okay to no update the index
RETURN.
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~create.
DATA: lt_vseoattrib TYPE seoo_attributes_r.
FIELD-SYMBOLS: <lv_clsname> TYPE seoclsname.
* same as in super class, but with "version = seoc_version_active"
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 ).
CALL FUNCTION 'SEO_CLASS_CREATE_COMPLETE'
EXPORTING
devclass = iv_package
overwrite = iv_overwrite
version = seoc_version_active
CHANGING
class = cg_properties
attributes = lt_vseoattrib
EXCEPTIONS
existing = 1
is_interface = 2
db_error = 3
component_error = 4
no_access = 5
other = 6
OTHERS = 7.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SEO_CLASS_CREATE_COMPLETE' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~create_sotr.
DATA: lt_sotr TYPE zif_abapgit_definitions=>ty_sotr_tt,
lt_objects TYPE sotr_objects,
ls_paket TYPE sotr_pack,
lv_object LIKE LINE OF lt_objects.
FIELD-SYMBOLS: <ls_sotr> LIKE LINE OF lt_sotr.
LOOP AT it_sotr ASSIGNING <ls_sotr>.
CALL FUNCTION 'SOTR_OBJECT_GET_OBJECTS'
EXPORTING
object_vector = <ls_sotr>-header-objid_vec
IMPORTING
objects = lt_objects
EXCEPTIONS
object_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SOTR_OBJECT_GET_OBJECTS' ).
ENDIF.
READ TABLE lt_objects INDEX 1 INTO lv_object.
ASSERT sy-subrc = 0.
ls_paket-paket = iv_package.
CALL FUNCTION 'SOTR_CREATE_CONCEPT'
EXPORTING
paket = ls_paket
crea_lan = <ls_sotr>-header-crea_lan
alias_name = <ls_sotr>-header-alias_name
object = lv_object
entries = <ls_sotr>-entries
concept_default = <ls_sotr>-header-concept
EXCEPTIONS
package_missing = 1
crea_lan_missing = 2
object_missing = 3
paket_does_not_exist = 4
alias_already_exist = 5
object_type_not_found = 6
langu_missing = 7
identical_context_not_allowed = 8
text_too_long = 9
error_in_update = 10
no_master_langu = 11
error_in_concept_id = 12
alias_not_allowed = 13
tadir_entry_creation_failed = 14
internal_error = 15
error_in_correction = 16
user_cancelled = 17
no_entry_found = 18
OTHERS = 19.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SOTR_CREATE_CONCEPT' ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~delete.
CALL FUNCTION 'SEO_CLASS_DELETE_COMPLETE'
EXPORTING
clskey = is_deletion_key
EXCEPTIONS
not_existing = 1
is_interface = 2
db_error = 3
no_access = 4
other = 5
OTHERS = 6.
IF sy-subrc = 1.
* ignore deletion of objects that does not exist
* this can happen when the SXCI object is deleted before the implementing CLAS
RETURN.
ELSEIF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from SEO_CLASS_DELETE_COMPLETE: { sy-subrc }| ).
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_class,
lt_methods TYPE cl_oo_source_scanner_class=>type_method_implementations,
lv_method LIKE LINE OF lt_methods,
lt_source 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 ).
* public
lt_source = lo_scanner->get_public_section_source( ).
IF lt_source IS NOT INITIAL.
lv_program = cl_oo_classname_service=>get_pubsec_name( is_key-clsname ).
lv_updated = update_report( iv_program = lv_program
it_source = lt_source ).
IF lv_updated = abap_true.
update_meta( iv_name = is_key-clsname
iv_exposure = seoc_exposure_public
it_source = lt_source ).
ENDIF.
ENDIF.
* protected
lt_source = lo_scanner->get_protected_section_source( ).
IF lt_source IS NOT INITIAL.
lv_program = cl_oo_classname_service=>get_prosec_name( is_key-clsname ).
lv_updated = update_report( iv_program = lv_program
it_source = lt_source ).
IF lv_updated = abap_true.
update_meta( iv_name = is_key-clsname
iv_exposure = seoc_exposure_protected
it_source = lt_source ).
ENDIF.
ENDIF.
* private
lt_source = lo_scanner->get_private_section_source( ).
IF lt_source IS NOT INITIAL.
lv_program = cl_oo_classname_service=>get_prisec_name( is_key-clsname ).
lv_updated = update_report( iv_program = lv_program
it_source = lt_source ).
IF lv_updated = abap_true.
update_meta( iv_name = is_key-clsname
iv_exposure = seoc_exposure_private
it_source = lt_source ).
ENDIF.
ENDIF.
* methods
lt_methods = lo_scanner->get_method_implementations( ).
LOOP AT lt_methods INTO lv_method.
TRY.
lt_source = lo_scanner->get_method_impl_source( lv_method ).
CATCH cx_oo_clif_component.
zcx_abapgit_exception=>raise( 'error from GET_METHOD_IMPL_SOURCE' ).
ENDTRY.
lv_program = determine_method_include(
iv_name = is_key-clsname
iv_method = lv_method ).
update_report(
iv_program = lv_program
it_source = lt_source ).
ENDLOOP.
* full class include
update_full_class_include( iv_classname = is_key-clsname
it_source = it_source
it_methods = lt_methods ).
update_source_index(
iv_clsname = is_key-clsname
io_scanner = lo_scanner ).
* TODO, perhaps move this call to somewhere else, to be done while cleaning up the CLAS deserialization
zcl_abapgit_objects_activation=>add(
iv_type = 'CLAS'
iv_name = is_key-clsname ).
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~generate_locals.
DATA: lv_program TYPE programm.
IF lines( it_local_definitions ) > 0.
lv_program = cl_oo_classname_service=>get_ccdef_name( is_key-clsname ).
update_report( iv_program = lv_program
it_source = it_local_definitions ).
ENDIF.
IF lines( it_local_implementations ) > 0.
lv_program = cl_oo_classname_service=>get_ccimp_name( is_key-clsname ).
update_report( iv_program = lv_program
it_source = it_local_implementations ).
ENDIF.
IF lines( it_local_macros ) > 0.
lv_program = cl_oo_classname_service=>get_ccmac_name( is_key-clsname ).
update_report( iv_program = lv_program
it_source = it_local_macros ).
ENDIF.
IF lines( it_local_test_classes ) > 0.
lv_program = cl_oo_classname_service=>get_ccau_name( is_key-clsname ).
update_report( iv_program = lv_program
it_source = it_local_test_classes ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~get_class_properties.
CALL FUNCTION 'SEO_CLIF_GET'
EXPORTING
cifkey = is_class_key
version = seoc_version_active
IMPORTING
class = rs_class_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( 'error from seo_clif_get' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~get_includes.
* note: includes returned might not exist
* method cl_oo_classname_service=>GET_ALL_CLASS_INCLUDES does not exist in 702
DATA: lv_class_name TYPE seoclsname,
lt_methods TYPE seop_methods_w_include.
FIELD-SYMBOLS: <ls_method> LIKE LINE OF lt_methods.
lv_class_name = iv_object_name.
APPEND cl_oo_classname_service=>get_ccdef_name( lv_class_name ) TO rt_includes.
APPEND cl_oo_classname_service=>get_ccmac_name( lv_class_name ) TO rt_includes.
APPEND cl_oo_classname_service=>get_ccimp_name( lv_class_name ) TO rt_includes.
APPEND cl_oo_classname_service=>get_cl_name( lv_class_name ) TO rt_includes.
APPEND cl_oo_classname_service=>get_ccau_name( lv_class_name ) TO rt_includes.
APPEND cl_oo_classname_service=>get_pubsec_name( lv_class_name ) TO rt_includes.
APPEND cl_oo_classname_service=>get_prosec_name( lv_class_name ) TO rt_includes.
APPEND cl_oo_classname_service=>get_prisec_name( lv_class_name ) TO rt_includes.
APPEND cl_oo_classname_service=>get_classpool_name( lv_class_name ) TO rt_includes.
APPEND cl_oo_classname_service=>get_ct_name( lv_class_name ) TO rt_includes.
* skip the CS include, as it is sometimes generated on the fly instead of
* when the methods are changed
* APPEND cl_oo_classname_service=>get_cs_name( lv_class_name ) TO rt_includes.
cl_oo_classname_service=>get_all_method_includes(
EXPORTING
clsname = lv_class_name
RECEIVING
result = lt_methods
EXCEPTIONS
class_not_existing = 1 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Class { lv_class_name } not existing| ).
ENDIF.
LOOP AT lt_methods ASSIGNING <ls_method>.
APPEND <ls_method>-incname TO rt_includes.
ENDLOOP.
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~insert_text_pool.
DATA: lv_cp TYPE program.
lv_cp = cl_oo_classname_service=>get_classpool_name( iv_class_name ).
INSERT TEXTPOOL lv_cp
FROM it_text_pool
LANGUAGE iv_language
STATE 'I'.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from INSERT TEXTPOOL' ).
ENDIF.
zcl_abapgit_objects_activation=>add( iv_type = 'REPT'
iv_name = lv_cp ).
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~read_sotr.
DATA: lv_concept TYPE sotr_head-concept,
lt_seocompodf TYPE STANDARD TABLE OF seocompodf WITH DEFAULT KEY,
ls_header TYPE sotr_head,
lt_entries TYPE sotr_text_tt.
FIELD-SYMBOLS: <ls_sotr> LIKE LINE OF rt_sotr,
<ls_seocompodf> LIKE LINE OF lt_seocompodf,
<ls_entry> LIKE LINE OF lt_entries.
SELECT * FROM seocompodf
INTO TABLE lt_seocompodf
WHERE clsname = iv_object_name
AND version = '1'
AND exposure = '2'
AND attdecltyp = '2'
AND type = 'SOTR_CONC'
ORDER BY PRIMARY KEY. "#EC CI_SUBRC
LOOP AT lt_seocompodf ASSIGNING <ls_seocompodf>.
lv_concept = translate( val = <ls_seocompodf>-attvalue from = '''' to = '' ).
CALL FUNCTION 'SOTR_GET_CONCEPT'
EXPORTING
concept = lv_concept
IMPORTING
header = ls_header
TABLES
entries = lt_entries
EXCEPTIONS
no_entry_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
CONTINUE.
ENDIF.
CLEAR: ls_header-paket,
ls_header-crea_name,
ls_header-crea_tstut,
ls_header-chan_name,
ls_header-chan_tstut.
LOOP AT lt_entries ASSIGNING <ls_entry>.
CLEAR: <ls_entry>-version,
<ls_entry>-crea_name,
<ls_entry>-crea_tstut,
<ls_entry>-chan_name,
<ls_entry>-chan_tstut.
ENDLOOP.
APPEND INITIAL LINE TO rt_sotr ASSIGNING <ls_sotr>.
<ls_sotr>-header = ls_header.
<ls_sotr>-entries = lt_entries.
ENDLOOP.
ENDMETHOD.
METHOD zif_abapgit_oo_object_fnc~read_text_pool.
DATA:
lv_cp TYPE program.
lv_cp = cl_oo_classname_service=>get_classpool_name( iv_class_name ).
READ TEXTPOOL lv_cp INTO rt_text_pool LANGUAGE iv_language. "#EC CI_READ_REP
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
2238,
62,
4871,
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,
17953,
62,
82,
313,
81,
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,
8612,
378,
62,
17946,
874,
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,
4871,
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,
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,
28463,
62,
5239,
62,
7742,
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,
961,
62,
82,
313,
81,
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,
961,
62,
5239,
62,
7742,
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,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
4296,
62,
10459,
62,
9630,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
565,
82,
3672,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
35836,
1008,
41876,
4526,
37,
5390,
537,
62,
2238,
62,
10459,
62,
35836,
1008,
62,
4871,
764,
198,
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,
7716,
62,
4871,
7742,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
3672,
41876,
384,
420,
7278,
3672,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
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,
220,
220,
41876,
384,
420,
7278,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
1069,
26205,
41876,
384,
78,
1069,
3455,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
10459,
220,
220,
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,
5004,
62,
24396,
62,
17256,
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,
41876,
384,
420,
7278,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
24396,
220,
220,
220,
220,
220,
220,
220,
41876,
384,
420,
30094,
3672,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
23065,
8,
41876,
1430,
76,
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
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_gui_html_processor DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
CONSTANTS c_css_build_name TYPE string VALUE 'css/bundle.css'.
CONSTANTS c_preprocess_marker TYPE string VALUE `<!-- abapgit HTML preprocessor -->`.
CONSTANTS c_comment_start TYPE string VALUE `<!--`.
CONSTANTS c_comment_end TYPE string VALUE `-->`.
INTERFACES zif_abapgit_gui_html_processor .
METHODS constructor
IMPORTING
ii_asset_man TYPE REF TO zif_abapgit_gui_asset_manager.
METHODS preserve_css
IMPORTING
!iv_css_url TYPE string .
PROTECTED SECTION.
PRIVATE SECTION.
DATA mt_preserve_css TYPE string_table.
DATA mi_asset_man TYPE REF TO zif_abapgit_gui_asset_manager.
METHODS patch_html
IMPORTING
iv_html TYPE string
EXPORTING
ev_html TYPE string
et_css_urls TYPE string_table
RAISING
zcx_abapgit_exception.
METHODS is_preserved
IMPORTING
!iv_css_url TYPE string
RETURNING
VALUE(rv_yes) TYPE abap_bool.
METHODS find_head_offset
IMPORTING
iv_html TYPE string
RETURNING
VALUE(rv_head_end) TYPE i
RAISING
zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_HTML_PROCESSOR IMPLEMENTATION.
METHOD constructor.
mi_asset_man = ii_asset_man.
ENDMETHOD.
METHOD is_preserved.
READ TABLE mt_preserve_css TRANSPORTING NO FIELDS WITH KEY table_line = iv_css_url.
rv_yes = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD patch_html.
CONSTANTS lc_css_re TYPE string VALUE `<link\s+rel="stylesheet"\s+type="text/css"\s+href="(\S+)">`.
DATA lv_head_end TYPE i.
DATA lo_css_re TYPE REF TO cl_abap_regex.
DATA lo_matcher TYPE REF TO cl_abap_matcher.
DATA lv_css_path TYPE string.
DATA lv_marker TYPE string.
DATA lv_off TYPE i.
DATA lv_len TYPE i.
DATA lv_cur TYPE i.
DATA lv_css_build TYPE string VALUE '<link rel="stylesheet" type="text/css" href="$BUILD_NAME">'.
REPLACE FIRST OCCURRENCE OF '$BUILD_NAME' IN lv_css_build WITH c_css_build_name. " Mmmm
CLEAR: ev_html, et_css_urls.
lv_head_end = find_head_offset( iv_html ).
CREATE OBJECT lo_css_re
EXPORTING
ignore_case = abap_true
pattern = lc_css_re.
lo_matcher = lo_css_re->create_matcher( text = substring( val = iv_html len = lv_head_end ) ).
WHILE lo_matcher->find_next( ) = abap_true.
lv_css_path = lo_matcher->get_submatch( 1 ).
IF abap_false = is_preserved( lv_css_path ).
lv_off = lo_matcher->get_offset( ).
lv_len = lo_matcher->get_length( ).
ev_html = ev_html && substring( val = iv_html
off = lv_cur
len = lv_off - lv_cur ).
ev_html = ev_html && c_comment_start && substring( val = iv_html
off = lv_off
len = lv_len ) && c_comment_end.
lv_cur = lv_off + lv_len.
APPEND lv_css_path TO et_css_urls.
ENDIF.
ENDWHILE.
ev_html = ev_html && substring( val = iv_html
off = lv_cur
len = lv_head_end - lv_cur ).
IF lines( et_css_urls ) > 0.
lv_marker = cl_abap_char_utilities=>newline
&& ` ` " Assume 4 space indent, maybe improve and detect ?
&& c_preprocess_marker
&& cl_abap_char_utilities=>newline
&& ` `.
ev_html = ev_html && lv_marker && lv_css_build.
ENDIF.
ev_html = ev_html && substring( val = iv_html
off = lv_head_end ).
ENDMETHOD.
METHOD preserve_css.
APPEND iv_css_url TO mt_preserve_css.
ENDMETHOD.
METHOD zif_abapgit_gui_html_processor~process.
DATA lo_css_processor TYPE REF TO zcl_abapgit_gui_css_processor.
DATA lt_css_urls TYPE string_table.
DATA lv_css_build TYPE string.
FIELD-SYMBOLS <lv_url> LIKE LINE OF lt_css_urls.
patch_html(
EXPORTING
iv_html = iv_html
IMPORTING
ev_html = rv_html
et_css_urls = lt_css_urls ).
IF lines( lt_css_urls ) > 0.
CREATE OBJECT lo_css_processor
EXPORTING
ii_asset_manager = mi_asset_man.
LOOP AT lt_css_urls ASSIGNING <lv_url>.
lo_css_processor->add_file( <lv_url> ).
ENDLOOP.
lv_css_build = lo_css_processor->process( ).
ii_gui_services->cache_asset(
iv_url = |{ c_css_build_name }|
iv_type = 'text'
iv_subtype = 'css'
iv_text = lv_css_build ).
ENDIF.
ENDMETHOD.
METHOD find_head_offset.
rv_head_end = find( val = iv_html
regex = |{ cl_abap_char_utilities=>newline }?\\s*</head>|
case = abap_false ).
IF rv_head_end <= 0.
rv_head_end = find( val = iv_html
regex = |</head>|
case = abap_false ).
IF rv_head_end <= 0.
zcx_abapgit_exception=>raise( 'HTML preprocessor: </head> not found' ).
ENDIF.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
6494,
62,
41341,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
25471,
62,
11249,
62,
3672,
41876,
4731,
26173,
8924,
705,
25471,
14,
65,
31249,
13,
25471,
4458,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
3866,
14681,
62,
4102,
263,
41876,
4731,
26173,
8924,
4600,
27,
28112,
450,
499,
18300,
11532,
662,
41341,
14610,
44646,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
23893,
62,
9688,
41876,
4731,
26173,
8924,
4600,
27,
28112,
44646,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
23893,
62,
437,
41876,
4731,
26173,
8924,
4600,
46904,
44646,
628,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
6494,
62,
41341,
764,
628,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21065,
62,
562,
316,
62,
805,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
562,
316,
62,
37153,
13,
628,
220,
220,
220,
337,
36252,
50,
12201,
62,
25471,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
25471,
62,
6371,
41876,
4731,
764,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
45079,
62,
18302,
3760,
62,
25471,
41876,
4731,
62,
11487,
13,
198,
220,
220,
220,
42865,
21504,
62,
562,
316,
62,
805,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
562,
316,
62,
37153,
13,
628,
220,
220,
220,
337,
36252,
50,
8529,
62,
6494,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
6494,
41876,
4731,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
819,
62,
6494,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
2123,
62,
25471,
62,
6371,
82,
41876,
4731,
62,
11487,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
337,
36252,
50,
318,
62,
18302,
8520,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
25471,
62,
6371,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8505,
8,
41876,
450,
499,
62,
30388,
13,
628,
220,
220,
220,
337,
36252,
50,
1064,
62,
2256,
62,
28968,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
6494,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
2256,
62,
437,
8,
41876,
1312,
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,
40156,
62,
28656,
62,
4805,
4503,
7597,
1581,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
21504,
62,
562,
316,
62,
805,
796,
21065,
62,
562,
316,
62,
805,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
318,
62,
18302,
8520,
13,
198,
220,
220,
220,
20832,
43679,
45079,
62,
18302,
3760,
62,
25471,
48213,
4303,
9863,
2751,
8005,
18930,
3698,
5258,
13315,
35374,
3084,
62,
1370,
796,
21628,
62,
25471,
62,
6371,
13,
198,
220,
220,
220,
374,
85,
62,
8505,
796,
20512,
66,
7,
827,
12,
7266,
6015,
796,
657,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
8529,
62,
6494,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
300,
66,
62,
25471,
62,
260,
41876,
4731,
26173,
8924,
4600,
27,
8726,
59,
82,
10,
2411,
2625,
47720,
25473,
1,
59,
82,
10,
4906,
2625,
5239,
14,
25471,
1,
59,
82,
10,
33257,
2625,
38016,
50,
28988,
5320,
44646,
628,
220,
220,
220,
42865,
300,
85,
62,
2256,
62,
437,
41876,
1312,
13,
198,
220,
220,
220,
42865,
2376,
62,
25471,
62,
260,
220,
220,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
260,
25636,
13,
198,
220,
220,
220,
42865,
2376,
62,
6759,
2044,
220,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
6759,
2044,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
25471,
62,
6978,
41876,
4731,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
4102,
263,
220,
220,
41876,
4731,
13,
628,
220,
220,
220,
42865,
300,
85,
62,
2364,
41876,
1312,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
11925,
41876,
1312,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
22019,
41876,
1312,
13,
628,
220,
220,
220,
42865,
300,
85,
62,
25471,
62,
11249,
41876,
4731,
26173,
8924,
705,
27,
8726,
823,
2625,
47720,
25473,
1,
2099,
2625,
5239,
14,
25471,
1,
13291,
2625,
3,
19499,
26761,
62,
20608,
5320,
4458,
198,
220,
220,
220,
45285,
11598,
31328,
440,
4093,
31302,
18310,
3963,
705,
3,
19499,
26761,
62,
20608,
6,
3268,
300,
85,
62,
25471,
62,
11249,
13315,
269,
62,
25471,
62,
11249,
62,
3672,
13,
366,
337,
27532,
628,
220,
220,
220,
30301,
1503,
25,
819,
62,
6494,
11,
2123,
62,
25471,
62,
6371,
82,
13,
628,
220,
220,
220,
300,
85,
62,
2256,
62,
437,
796,
1064,
62,
2256,
62,
28968,
7,
21628,
62,
6494,
6739,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
2376,
62,
25471,
62,
260,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
8856,
62,
7442,
796,
450,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
1,
1
] |
"! <p class="shorttext synchronized" lang="en">CDS Analysis for ADT</p>
CLASS zcl_sat_adt_res_cds_analysis DEFINITION
PUBLIC
INHERITING FROM cl_adt_rest_resource
ABSTRACT
CREATE PUBLIC .
PUBLIC SECTION.
METHODS get
REDEFINITION.
PROTECTED SECTION.
DATA mv_cds_view TYPE zsat_cds_view_name.
DATA ms_result TYPE zsat_adt_element_info.
"! <p class="shorttext synchronized" lang="en">Retrieve parameters from ADT REST request</p>
METHODS get_parameters
IMPORTING
io_request TYPE REF TO if_adt_rest_request
RAISING
cx_adt_rest.
"! <p class="shorttext synchronized" lang="en">Executes the GET request</p>
METHODS get_internal ABSTRACT
RAISING
cx_adt_rest.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_sat_adt_res_cds_analysis IMPLEMENTATION.
METHOD get.
get_parameters( request ).
get_internal( ).
CHECK ms_result IS NOT INITIAL.
response->set_body_data(
content_handler = zcl_sat_adt_ch_factory=>create_generic_eleminfo_res_ch( )
data = ms_result
).
ENDMETHOD.
METHOD get_parameters.
mv_cds_view = zcl_sat_adt_res_util=>get_request_param_value(
io_request = io_request
iv_param_name = zif_sat_c_adt_utils=>c_cds_analysis_parameter-cds_name
if_mandatory = abap_true
).
ENDMETHOD.
ENDCLASS.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
34,
5258,
14691,
329,
5984,
51,
3556,
79,
29,
198,
31631,
1976,
565,
62,
49720,
62,
324,
83,
62,
411,
62,
66,
9310,
62,
20930,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
537,
62,
324,
83,
62,
2118,
62,
31092,
198,
220,
9564,
18601,
10659,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
42865,
285,
85,
62,
66,
9310,
62,
1177,
41876,
1976,
49720,
62,
66,
9310,
62,
1177,
62,
3672,
13,
198,
220,
220,
220,
42865,
13845,
62,
20274,
41876,
1976,
49720,
62,
324,
83,
62,
30854,
62,
10951,
13,
628,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
9781,
30227,
10007,
422,
5984,
51,
30617,
2581,
3556,
79,
29,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
17143,
7307,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
25927,
41876,
4526,
37,
5390,
611,
62,
324,
83,
62,
2118,
62,
25927,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
324,
83,
62,
2118,
13,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
23002,
1769,
262,
17151,
2581,
3556,
79,
29,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
32538,
9564,
18601,
10659,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
324,
83,
62,
2118,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
198,
198,
31631,
1976,
565,
62,
49720,
62,
324,
83,
62,
411,
62,
66,
9310,
62,
20930,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
651,
13,
198,
220,
220,
220,
651,
62,
17143,
7307,
7,
2581,
6739,
198,
220,
220,
220,
651,
62,
32538,
7,
6739,
628,
220,
220,
220,
5870,
25171,
13845,
62,
20274,
3180,
5626,
3268,
2043,
12576,
13,
628,
220,
220,
220,
2882,
3784,
2617,
62,
2618,
62,
7890,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2695,
62,
30281,
796,
1976,
565,
62,
49720,
62,
324,
83,
62,
354,
62,
69,
9548,
14804,
17953,
62,
41357,
62,
11129,
1084,
6513,
62,
411,
62,
354,
7,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
13845,
62,
20274,
198,
220,
220,
220,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
17143,
7307,
13,
198,
220,
220,
220,
285,
85,
62,
66,
9310,
62,
1177,
796,
1976,
565,
62,
49720,
62,
324,
83,
62,
411,
62,
22602,
14804,
1136,
62,
25927,
62,
17143,
62,
8367,
7,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
25927,
220,
220,
220,
220,
220,
220,
796,
33245,
62,
25927,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
17143,
62,
3672,
220,
220,
220,
796,
1976,
361,
62,
49720,
62,
66,
62,
324,
83,
62,
26791,
14804,
66,
62,
66,
9310,
62,
20930,
62,
17143,
2357,
12,
66,
9310,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
611,
62,
22249,
2870,
220,
220,
220,
220,
796,
450,
499,
62,
7942,
198,
220,
220,
220,
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,
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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
] |
CLASS zcl_wasm_test_data DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
CLASS-METHODS wasm_add_two
RETURNING
VALUE(rv_xstr) TYPE xstring.
CLASS-METHODS wasm_fibonacci
RETURNING
VALUE(rv_xstr) TYPE xstring.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_WASM_TEST_DATA IMPLEMENTATION.
METHOD wasm_add_two.
* (module
* (func $add (param $lhs i32) (param $rhs i32) (result i32)
* get_local $lhs
* get_local $rhs
* i32.add)
* (export "add" (func $add))
* )
rv_xstr =
|0061736D| && " magic
|01000000| && " version
|0107| && |0160027F7F017F| && " types
|0302| && |0100| && " function
|0707| && |01036164640000| && " export
|0A09| && |010700| && |200020016A0B| && " code
|001C| && |046E616D650106010003616464020D01000200036C68730103726873|.
ENDMETHOD.
METHOD wasm_fibonacci.
*(module
* (type $t0 (func (param i32) (result i32)))
* (func $fib (export "fib") (type $t0) (param $n i32) (result i32)
* get_local $n
* i32.const 2
* i32.lt_s
* if $I0
* i32.const 1
* return
* end
* get_local $n
* i32.const 2
* i32.sub
* call $fib
* get_local $n
* i32.const 1
* i32.sub
* call $fib
* i32.add
* return))
rv_xstr =
|0061736D| && " magic
|01000000| && " version
|0106| && |0160017F017F| && " types
|0302| && |0100| && " function
|0707| && |01036669620000| && " export
|0A1F| && |011D00| && " Start code section
|2000| && " get local '00'
|4102| && " const '02'
|48| && " lt_s
|0440| && " IF, blocktype = '40'
|4101| && " const '01'
|0F| && " return
|0B| && " block end
|2000| && " get local '00'
|4102| && " const '02'
|6B| && " subtract
|1000| && " call '00'
|2000| && " get local '00'
|41016B10006A0F0B| &&
|0015| && |046E616D650106010003666962020601000100016E|.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
86,
8597,
62,
9288,
62,
7890,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
373,
76,
62,
2860,
62,
11545,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
87,
2536,
8,
41876,
2124,
8841,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
373,
76,
62,
69,
571,
261,
44456,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
87,
2536,
8,
41876,
2124,
8841,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
54,
1921,
44,
62,
51,
6465,
62,
26947,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
373,
76,
62,
2860,
62,
11545,
13,
198,
198,
9,
357,
21412,
198,
9,
220,
220,
357,
20786,
720,
2860,
357,
17143,
720,
75,
11994,
1312,
2624,
8,
357,
17143,
720,
81,
11994,
1312,
2624,
8,
357,
20274,
1312,
2624,
8,
198,
9,
220,
220,
220,
220,
651,
62,
12001,
720,
75,
11994,
198,
9,
220,
220,
220,
220,
651,
62,
12001,
720,
81,
11994,
198,
9,
220,
220,
220,
220,
1312,
2624,
13,
2860,
8,
198,
9,
220,
220,
357,
39344,
366,
2860,
1,
357,
20786,
720,
2860,
4008,
198,
9,
1267,
628,
220,
220,
220,
374,
85,
62,
87,
2536,
796,
198,
220,
220,
220,
220,
220,
930,
28041,
1558,
2623,
35,
91,
11405,
366,
5536,
198,
220,
220,
220,
220,
220,
930,
486,
10535,
91,
11405,
366,
2196,
198,
220,
220,
220,
220,
220,
930,
486,
2998,
91,
11405,
930,
486,
8054,
1983,
37,
22,
37,
29326,
37,
91,
11405,
366,
3858,
198,
220,
220,
220,
220,
220,
930,
15,
22709,
91,
11405,
930,
39103,
91,
11405,
220,
366,
2163,
198,
220,
220,
220,
220,
220,
930,
15,
24038,
91,
11405,
930,
20943,
2623,
23237,
2414,
2388,
91,
11405,
366,
10784,
198,
220,
220,
220,
220,
220,
930,
15,
32,
2931,
91,
11405,
930,
486,
2998,
405,
91,
11405,
930,
11024,
2167,
1433,
32,
15,
33,
91,
11405,
366,
2438,
198,
220,
220,
220,
220,
220,
930,
8298,
34,
91,
11405,
930,
45438,
36,
44214,
35,
2996,
486,
3312,
486,
830,
2623,
1433,
3510,
1821,
1238,
35,
486,
830,
11024,
2623,
34,
3104,
4790,
20943,
2718,
25022,
4790,
91,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
373,
76,
62,
69,
571,
261,
44456,
13,
198,
198,
9,
7,
21412,
198,
9,
220,
357,
4906,
720,
83,
15,
357,
20786,
357,
17143,
1312,
2624,
8,
357,
20274,
1312,
2624,
22305,
198,
9,
220,
357,
20786,
720,
69,
571,
357,
39344,
366,
69,
571,
4943,
357,
4906,
720,
83,
15,
8,
357,
17143,
720,
77,
1312,
2624,
8,
357,
20274,
1312,
2624,
8,
198,
9,
220,
220,
220,
651,
62,
12001,
720,
77,
198,
9,
220,
220,
220,
1312,
2624,
13,
9979,
362,
198,
9,
220,
220,
220,
1312,
2624,
13,
2528,
62,
82,
198,
9,
220,
220,
220,
611,
720,
40,
15,
198,
9,
220,
220,
220,
220,
220,
1312,
2624,
13,
9979,
352,
198,
9,
220,
220,
220,
220,
220,
1441,
198,
9,
220,
220,
220,
886,
198,
9,
220,
220,
220,
651,
62,
12001,
720,
77,
198,
9,
220,
220,
220,
1312,
2624,
13,
9979,
362,
198,
9,
220,
220,
220,
1312,
2624,
13,
7266,
198,
9,
220,
220,
220,
869,
720,
69,
571,
198,
9,
220,
220,
220,
651,
62,
12001,
720,
77,
198,
9,
220,
220,
220,
1312,
2624,
13,
9979,
352,
198,
9,
220,
220,
220,
1312,
2624,
13,
7266,
198,
9,
220,
220,
220,
869,
720,
69,
571,
198,
9,
220,
220,
220,
1312,
2624,
13,
2860,
198,
9,
220,
220,
220,
1441,
4008,
628,
220,
220,
220,
374,
85,
62,
87,
2536,
796,
198,
220,
220,
220,
220,
220,
930,
28041,
1558,
2623,
35,
91,
11405,
366,
5536,
198,
220,
220,
220,
220,
220,
930,
486,
10535,
91,
11405,
366,
2196,
198,
220,
220,
220,
220,
220,
930,
486,
3312,
91,
11405,
930,
486,
8054,
1558,
37,
29326,
37,
91,
11405,
366,
3858,
198,
220,
220,
220,
220,
220,
930,
15,
22709,
91,
11405,
930,
39103,
91,
11405,
366,
2163,
198,
220,
220,
220,
220,
220,
930,
15,
24038,
91,
11405,
930,
20943,
2623,
2791,
4846,
2167,
405,
91,
11405,
366,
10784,
198,
220,
220,
220,
220,
220,
930,
15,
32,
16,
37,
91,
11405,
930,
28555,
35,
405,
91,
11405,
366,
7253,
2438,
2665,
198,
220,
220,
220,
220,
220,
220,
220,
930,
11024,
91,
11405,
366,
651,
1957,
705,
405,
6,
198,
220,
220,
220,
220,
220,
220,
220,
930,
19,
15377,
91,
11405,
366,
1500,
705,
2999,
6,
198,
220,
220,
220,
220,
220,
220,
220,
930,
2780,
91,
11405,
220,
220,
366,
300,
83,
62,
82,
198,
220,
220,
220,
220,
220,
220,
220,
930,
3023,
1821,
91,
11405,
366,
16876,
11,
2512,
4906,
796,
705,
1821,
6,
198,
220,
220,
220,
220,
220,
220,
220,
930,
3901,
486,
91,
11405,
366,
1500,
705,
486,
6,
198,
220,
220,
220,
220,
220,
220,
220,
930,
15,
37,
91,
11405,
220,
220,
366,
1441,
198,
220,
220,
220,
220,
220,
220,
220,
930,
15,
33,
91,
11405,
220,
220,
366,
2512,
886,
198,
220,
220,
220,
220,
220,
220,
220,
930,
11024,
91,
11405,
366,
651,
1957,
705,
405,
6,
198,
220,
220,
220,
220,
220,
220,
220,
930,
19,
15377,
91,
11405,
366,
1500,
705,
2999,
6,
198,
220,
220,
220,
220,
220,
220,
220,
930,
21,
33,
91,
11405,
220,
220,
366,
34128,
198,
220,
220,
220,
220,
220,
220,
220,
930,
12825,
91,
11405,
366,
869,
705,
405,
6,
198,
220,
220,
220,
220,
220,
220,
220,
930,
11024,
91,
11405,
366,
651,
1957,
705,
405,
6,
198,
220,
220,
220,
220,
220,
220,
220,
930,
3901,
27037,
33,
12825,
21,
32,
15,
37,
15,
33,
91,
11405,
198,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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
] |
CLASS zcl_adv_hex_check DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES: zif_adv_check.
ALIASES: is_valid FOR zif_adv_check~is_valid.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_ADV_HEX_CHECK IMPLEMENTATION.
METHOD zif_adv_check~is_valid.
DATA: xstring_hex TYPE xstring.
DATA(string_hex) = CONV string( data ).
IF string_hex IS INITIAL.
RETURN.
ENDIF.
xstring_hex = string_hex.
IF CONV string( xstring_hex ) <> string_hex.
RETURN.
ENDIF.
valid = abap_true.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
32225,
62,
33095,
62,
9122,
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,
1976,
361,
62,
32225,
62,
9122,
13,
198,
220,
220,
220,
8355,
43429,
1546,
25,
318,
62,
12102,
7473,
1976,
361,
62,
32225,
62,
9122,
93,
271,
62,
12102,
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,
2885,
53,
62,
39,
6369,
62,
50084,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
32225,
62,
9122,
93,
271,
62,
12102,
13,
628,
220,
220,
220,
42865,
25,
2124,
8841,
62,
33095,
41876,
2124,
8841,
13,
628,
220,
220,
220,
42865,
7,
8841,
62,
33095,
8,
796,
7102,
53,
4731,
7,
1366,
6739,
628,
220,
220,
220,
16876,
4731,
62,
33095,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
2124,
8841,
62,
33095,
796,
4731,
62,
33095,
13,
628,
220,
220,
220,
16876,
7102,
53,
4731,
7,
2124,
8841,
62,
33095,
1267,
1279,
29,
4731,
62,
33095,
13,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
4938,
796,
450,
499,
62,
7942,
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
] |
INTERFACE zif_dbbr_user_settings_ids
PUBLIC .
"! Type ABAP_BOOL
CONSTANTS c_auto_hide_empty_cols TYPE string VALUE 'P_AUTHEC' ##NO_TEXT.
"! Type ABAP_BOOL
CONSTANTS c_advanced_mode TYPE string VALUE 'P_ADVM' ##NO_TEXT.
"! Type ABAP_BOOL
CONSTANTS c_auto_layout_transfer TYPE string VALUE 'P_AUTOL' ##NO_TEXT.
"! Type ABAP_BOOL
CONSTANTS c_color_add_text_fields TYPE string VALUE 'P_COLAT' ##NO_TEXT.
"! Type ABAP_BOOL
CONSTANTS c_color_formula_fields TYPE string VALUE 'P_COLFF' ##NO_TEXT.
"! Type ABAP_BOOL
CONSTANTS c_color_sorted_columns TYPE string VALUE 'P_COLSO' ##NO_TEXT.
"! Type ZDBBR_FAV_USER_MODE
CONSTANTS c_favorite_mode_entry TYPE string VALUE 'P_FAVMO' ##NO_TEXT.
"! Type SY-TABIX
CONSTANTS c_number_fav_most_used TYPE string VALUE 'P_FLUSED' ##NO_TEXT.
"! Type ABAP_BOOL
CONSTANTS c_object_navigator_at_start TYPE string VALUE 'P_ONAST' ##NO_TEXT.
"! Type zdbbr_obj_navigator_Mode
CONSTANTS c_initial_obj_nav_mode TYPE string VALUE 'P_IOBJM' ##no_text.
"! Type ZSAT_OBJ_BROWSER_MODE
CONSTANTS c_initial_obj_browser_mode TYPE string VALUE 'P_IOBBRM' ##no_text.
"! Type ABAP_BOOL
CONSTANTS c_no_fixed_key_cols TYPE string VALUE 'P_KCOLNF' ##NO_TEXT.
"! Type SY-TABIX
CONSTANTS c_max_result_lines TYPE string VALUE 'P_MAXL' ##NO_TEXT.
"! Type sy-tabix
CONSTANTS c_disable_date_to_timest_conv TYPE string VALUE 'P_XDD2TC' ##no_text.
"! Type ABAP_BOOL
CONSTANTS c_no_conv_exit TYPE string VALUE 'P_NOCVEX' ##NO_TEXT.
"! Type ABAP_BOOL
CONSTANTS c_no_merging_of_srt_cols TYPE string VALUE 'P_NOSRTM' ##NO_TEXT.
"! Type ABAP_BOOL
CONSTANTS c_no_trailing_sign TYPE string VALUE 'P_NOTRSG' ##NO_TEXT.
"! Type ABAP_BOOL
CONSTANTS c_use_reduced_memory TYPE string VALUE 'P_REDMEM' ##NO_TEXT.
"! Type ABAP_BOOL
CONSTANTS c_technical_fields_first TYPE string VALUE 'P_TFIRST' ##NO_TEXT.
"! Type ABAP_BOOL
CONSTANTS c_technical_names TYPE string VALUE 'P_TNAMES' ##NO_TEXT.
"! Type ABAP_BOOL
CONSTANTS c_technical_view TYPE string VALUE 'P_TVIEW' ##NO_TEXT.
"! Type ABAP_BOOL
CONSTANTS c_zeros_as_blanks TYPE string VALUE 'P_ZERASB' ##NO_TEXT.
"! Type ZDBBR_EXPERIMENTAL_MODE
CONSTANTS c_experimental_mode TYPE string VALUE 'P_EXPM' ##NO_TEXT.
"! Type ZDBBR_READ_DB_LENGTH
CONSTANTS c_read_db_table_length TYPE string VALUE 'P_RDDBSZ' ##NO_TEXT.
"! Type ZDBBR_enable_alv_default_var
CONSTANTS c_enable_alv_default_var TYPE string VALUE 'P_DEFALV' ##NO_TEXT.
"! Type ZDBBR_MAINT_DB_SETTING - abap_bool
CONSTANTS c_activate_maintain_entries TYPE string VALUE 'P_XDBEDT' ##NO_TEXT.
"! Type ZDBBR_LANGUAGE
CONSTANTS c_description_language TYPE string VALUE 'P_DLANG' ##NO_TEXT.
"! Type ABAP_BOOL
CONSTANTS c_override_sy_langu TYPE string VALUE 'P_OVRSYL' ##NO_TEXT.
"! Type abap_bool
CONSTANTS c_activate_alv_live_filter TYPE string VALUE 'P_XFLLIV' ##no_text.
"! Type abap_bool
CONSTANTS c_use_ddl_view_for_select TYPE string VALUE 'P_XDDLFS' ##no_text.
"! Type abap_bool
CONSTANTS c_deactvt_highltng_in_cqe TYPE string VALUE 'P_XDHLQE' ##no_text.
"! type zuitb_code_viewer_theme
CONSTANTS c_code_viewer_theme TYPE string VALUE 'P_CVTHME' ##no_text.
"!Type SAP_BOOL
CONSTANTS c_search_ignore_case TYPE string VALUE 'P_XIGNCS' ##NO_TEXT.
CONSTANTS c_assocation_sel_mode TYPE string VALUE 'P_ASNVMO' ##NO_TEXT.
CONSTANTS c_show_assoc_sel_at_start TYPE string VALUE 'P_ASSLST' ##NO_TEXT.
"! Type - SAP_BOOL
CONSTANTS c_auto_select_criteria_saving TYPE string VALUE 'P_XATSCR' ##NO_TEXT.
"! Type - SAP_BOOL
CONSTANTS c_always_load_def_var_first TYPE string VALUE 'P_XLDVAS' ##NO_TEXT.
"! Type - SAP_BOOL
CONSTANTS c_dock_obj_nav_on_right TYPE string VALUE 'P_XDONOR' ##NO_TEXT.
"! Type - SAP_BOOL
CONSTANTS c_selscr_compact_col_widths TYPE string VALUE 'P_XSCCCW' ##NO_TEXT.
CONSTANTS c_r_user_settings_controller TYPE string VALUE 'GR_USER_SETTINGS_CONTROLLER' ##NO_TEXT.
"! Type - SAP_BOOL
CONSTANTS c_calculate_virtual_elements TYPE string VALUE 'P_CALCVE' ##NO_TEXT.
"! Type - SAP_BOOL
CONSTANTS c_ignore_error_virt_elem_calc TYPE string VALUE 'P_IGEVEC' ##NO_TEXT.
"! Type - SAP_BOOL
CONSTANTS c_color_cds_calculated_fields TYPE string VALUE 'P_COLCF' ##NO_TEXT.
"! Type - SAP_BOOL
CONSTANTS c_async_max_rows_determination TYPE string VALUE 'P_XAMRDE' ##NO_TEXT.
"! Type - SAP_BOOL
CONSTANTS c_disable_auto_max_rows_det TYPE string VALUE 'P_XDAMRD' ##NO_TEXT.
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
9945,
1671,
62,
7220,
62,
33692,
62,
2340,
198,
220,
44731,
764,
628,
220,
366,
0,
5994,
9564,
2969,
62,
8202,
3535,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
23736,
62,
24717,
62,
28920,
62,
4033,
82,
41876,
4731,
26173,
8924,
705,
47,
62,
32,
24318,
2943,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
9564,
2969,
62,
8202,
3535,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
32225,
2903,
62,
14171,
41876,
4731,
26173,
8924,
705,
47,
62,
2885,
15996,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
9564,
2969,
62,
8202,
3535,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
23736,
62,
39786,
62,
39437,
41876,
4731,
26173,
8924,
705,
47,
62,
39371,
3535,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
9564,
2969,
62,
8202,
3535,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
8043,
62,
2860,
62,
5239,
62,
25747,
41876,
4731,
26173,
8924,
705,
47,
62,
25154,
1404,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
9564,
2969,
62,
8202,
3535,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
8043,
62,
687,
4712,
62,
25747,
41876,
4731,
26173,
8924,
705,
47,
62,
25154,
5777,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
9564,
2969,
62,
8202,
3535,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
8043,
62,
82,
9741,
62,
28665,
82,
41876,
4731,
26173,
8924,
705,
47,
62,
25154,
15821,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
1168,
11012,
11473,
62,
7708,
53,
62,
29904,
62,
49058,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
35200,
62,
14171,
62,
13000,
41876,
4731,
26173,
8924,
705,
47,
62,
7708,
53,
11770,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
19704,
12,
5603,
3483,
55,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
17618,
62,
69,
615,
62,
1712,
62,
1484,
41876,
4731,
26173,
8924,
705,
47,
62,
3697,
2937,
1961,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
9564,
2969,
62,
8202,
3535,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
15252,
62,
28341,
23823,
62,
265,
62,
9688,
41876,
4731,
26173,
8924,
705,
47,
62,
1340,
11262,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
1976,
9945,
1671,
62,
26801,
62,
28341,
23823,
62,
19076,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
36733,
62,
26801,
62,
28341,
62,
14171,
41876,
4731,
26173,
8924,
705,
47,
62,
9399,
33,
50229,
6,
22492,
3919,
62,
5239,
13,
198,
220,
366,
0,
5994,
1168,
50,
1404,
62,
9864,
41,
62,
11473,
22845,
1137,
62,
49058,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
36733,
62,
26801,
62,
40259,
62,
14171,
41876,
4731,
26173,
8924,
705,
47,
62,
9399,
33,
11473,
44,
6,
22492,
3919,
62,
5239,
13,
198,
220,
366,
0,
5994,
9564,
2969,
62,
8202,
3535,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
3919,
62,
34021,
62,
2539,
62,
4033,
82,
41876,
4731,
26173,
8924,
705,
47,
62,
42,
25154,
21870,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
19704,
12,
5603,
3483,
55,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
9806,
62,
20274,
62,
6615,
41876,
4731,
26173,
8924,
705,
47,
62,
22921,
43,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
827,
12,
8658,
844,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
40223,
62,
4475,
62,
1462,
62,
16514,
395,
62,
42946,
41876,
4731,
26173,
8924,
705,
47,
62,
55,
16458,
17,
4825,
6,
22492,
3919,
62,
5239,
13,
198,
220,
366,
0,
5994,
9564,
2969,
62,
8202,
3535,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
3919,
62,
42946,
62,
37023,
41876,
4731,
26173,
8924,
705,
47,
62,
45,
4503,
6089,
55,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
9564,
2969,
62,
8202,
3535,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
3919,
62,
647,
2667,
62,
1659,
62,
82,
17034,
62,
4033,
82,
41876,
4731,
26173,
8924,
705,
47,
62,
45,
2640,
14181,
44,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
9564,
2969,
62,
8202,
3535,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
3919,
62,
9535,
4386,
62,
12683,
41876,
4731,
26173,
8924,
705,
47,
62,
11929,
6998,
38,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
9564,
2969,
62,
8202,
3535,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
1904,
62,
445,
19513,
62,
31673,
41876,
4731,
26173,
8924,
705,
47,
62,
22083,
44,
3620,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
9564,
2969,
62,
8202,
3535,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
47944,
62,
25747,
62,
11085,
41876,
4731,
26173,
8924,
705,
47,
62,
10234,
4663,
2257,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
9564,
2969,
62,
8202,
3535,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
47944,
62,
14933,
41876,
4731,
26173,
8924,
705,
47,
62,
46559,
29559,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
9564,
2969,
62,
8202,
3535,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
47944,
62,
1177,
41876,
4731,
26173,
8924,
705,
47,
62,
6849,
40,
6217,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
9564,
2969,
62,
8202,
3535,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
9107,
418,
62,
292,
62,
2436,
2283,
41876,
4731,
26173,
8924,
705,
47,
62,
57,
1137,
1921,
33,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
1168,
11012,
11473,
62,
6369,
18973,
3955,
3525,
1847,
62,
49058,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
23100,
9134,
62,
14171,
41876,
4731,
26173,
8924,
705,
47,
62,
6369,
5868,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
1168,
11012,
11473,
62,
15675,
62,
11012,
62,
43,
49494,
198,
220,
7102,
2257,
1565,
4694,
269,
62,
961,
62,
9945,
62,
11487,
62,
13664,
41876,
4731,
26173,
8924,
705,
47,
62,
49,
16458,
4462,
57,
6,
22492,
15285,
62,
32541,
13,
198,
220,
366,
0,
5994,
1168,
11012,
11473,
62,
21633,
62,
282,
85,
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,
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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
] |
CLASS zcl_abapgit_popups DEFINITION
PUBLIC
FINAL
CREATE PRIVATE
GLOBAL FRIENDS zcl_abapgit_ui_factory .
PUBLIC SECTION.
INTERFACES zif_abapgit_popups .
ALIASES branch_list_popup
FOR zif_abapgit_popups~branch_list_popup .
ALIASES branch_popup_callback
FOR zif_abapgit_popups~branch_popup_callback .
ALIASES create_branch_popup
FOR zif_abapgit_popups~create_branch_popup .
ALIASES package_popup_callback
FOR zif_abapgit_popups~package_popup_callback .
ALIASES popup_folder_logic
FOR zif_abapgit_popups~popup_folder_logic .
ALIASES popup_object
FOR zif_abapgit_popups~popup_object .
ALIASES popup_package_export
FOR zif_abapgit_popups~popup_package_export .
ALIASES popup_proxy_bypass
FOR zif_abapgit_popups~popup_proxy_bypass .
ALIASES popup_to_confirm
FOR zif_abapgit_popups~popup_to_confirm .
ALIASES popup_to_create_package
FOR zif_abapgit_popups~popup_to_create_package .
ALIASES popup_to_create_transp_branch
FOR zif_abapgit_popups~popup_to_create_transp_branch .
ALIASES popup_to_inform
FOR zif_abapgit_popups~popup_to_inform .
ALIASES popup_to_select_from_list
FOR zif_abapgit_popups~popup_to_select_from_list .
ALIASES popup_to_select_transports
FOR zif_abapgit_popups~popup_to_select_transports .
ALIASES popup_transport_request
FOR zif_abapgit_popups~popup_transport_request .
ALIASES repo_popup
FOR zif_abapgit_popups~repo_popup .
CONSTANTS c_default_column TYPE lvc_fname VALUE `DEFAULT_COLUMN` ##NO_TEXT.
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 c LENGTH 1 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 VALUE abap_false.
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 on_double_click
FOR EVENT double_click OF cl_salv_events_table
IMPORTING
!row
!column .
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
ev_folder_logic TYPE string
ev_ign_subpkg TYPE abap_bool
ev_master_lang_only TYPE abap_bool.
TYPES:
ty_lt_fields TYPE STANDARD TABLE OF sval WITH DEFAULT KEY.
METHODS _popup_3_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
ev_value_3 TYPE spo_value
CHANGING ct_fields TYPE ty_lt_fields
RAISING zcx_abapgit_exception.
METHODS popup_get_from_free_selections
IMPORTING
iv_title TYPE zcl_abapgit_free_sel_dialog=>ty_syst_title OPTIONAL
iv_frame_text TYPE zcl_abapgit_free_sel_dialog=>ty_syst_title OPTIONAL
CHANGING
ct_fields TYPE zcl_abapgit_free_sel_dialog=>ty_free_sel_field_tab
RAISING
zcx_abapgit_cancel
zcx_abapgit_exception.
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_data_descr TYPE REF TO cl_abap_datadescr,
lo_elem_descr TYPE REF TO cl_abap_elemdescr,
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,
<lg_value> TYPE any.
mo_table_descr ?= cl_abap_tabledescr=>describe_by_data( it_list ).
lo_data_descr = mo_table_descr->get_table_line_type( ).
CASE lo_data_descr->kind.
WHEN cl_abap_elemdescr=>kind_elem.
lo_elem_descr ?= mo_table_descr->get_table_line_type( ).
INSERT INITIAL LINE INTO lt_components ASSIGNING <ls_component> INDEX 1.
<ls_component>-name = c_default_column.
<ls_component>-type = lo_elem_descr.
WHEN cl_abap_elemdescr=>kind_struct.
lo_struct_descr ?= mo_table_descr->get_table_line_type( ).
lt_components = lo_struct_descr->get_components( ).
ENDCASE.
IF lt_components IS INITIAL.
RETURN.
ENDIF.
INSERT INITIAL LINE INTO lt_components ASSIGNING <ls_component> INDEX 1.
<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>.
CASE lo_data_descr->kind.
WHEN cl_abap_elemdescr=>kind_elem.
ASSIGN COMPONENT c_default_column OF STRUCTURE <lg_data> TO <lg_value>.
ASSERT <lg_value> IS ASSIGNED.
<lg_line> = <lg_value>.
WHEN OTHERS.
MOVE-CORRESPONDING <lg_data> TO <lg_line>.
ENDCASE.
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,
ev_folder_logic,
ev_ign_subpkg.
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.
READ TABLE it_fields INDEX 5 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_folder_logic = <ls_field>-value.
TRANSLATE ev_folder_logic TO UPPER CASE.
READ TABLE it_fields INDEX 6 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_ign_subpkg = <ls_field>-value.
TRANSLATE ev_ign_subpkg TO UPPER CASE.
READ TABLE it_fields INDEX 7 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_master_lang_only = <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,
<lg_value> TYPE any,
<lv_selected> TYPE abap_bool,
<lv_selected_row> TYPE LINE OF salv_t_row.
DATA: lo_data_descr TYPE REF TO cl_abap_datadescr,
lo_selections TYPE REF TO cl_salv_selections,
lt_selected_rows TYPE salv_t_row.
ASSIGN mr_table->* TO <lt_table>.
ASSERT sy-subrc = 0.
lo_selections = mo_select_list_popup->get_selections( ).
IF lo_selections->get_selection_mode( ) = if_salv_c_selection_mode=>single.
lt_selected_rows = lo_selections->get_selected_rows( ).
LOOP AT lt_selected_rows ASSIGNING <lv_selected_row>.
READ TABLE <lt_table>
ASSIGNING <lg_line>
INDEX <lv_selected_row>.
CHECK <lg_line> IS ASSIGNED.
ASSIGN COMPONENT c_fieldname_selected
OF STRUCTURE <lg_line>
TO <lv_selected>.
CHECK <lv_selected> IS ASSIGNED.
<lv_selected> = abap_true.
ENDLOOP.
ENDIF.
lv_condition = |{ c_fieldname_selected } = ABAP_TRUE|.
CREATE DATA lr_exporting LIKE LINE OF et_list.
ASSIGN lr_exporting->* TO <lg_exporting>.
mo_table_descr ?= cl_abap_tabledescr=>describe_by_data( et_list ).
lo_data_descr = mo_table_descr->get_table_line_type( ).
LOOP AT <lt_table> ASSIGNING <lg_line> WHERE (lv_condition).
CLEAR <lg_exporting>.
CASE lo_data_descr->kind.
WHEN cl_abap_elemdescr=>kind_elem.
ASSIGN COMPONENT c_default_column OF STRUCTURE <lg_line> TO <lg_value>.
ASSERT <lg_value> IS ASSIGNED.
<lg_exporting> = <lg_value>.
WHEN OTHERS.
MOVE-CORRESPONDING <lg_line> TO <lg_exporting>.
ENDCASE.
APPEND <lg_exporting> TO et_list.
ENDLOOP.
ENDMETHOD.
METHOD on_double_click.
DATA: lo_selections TYPE REF TO cl_salv_selections.
lo_selections = mo_select_list_popup->get_selections( ).
IF lo_selections->get_selection_mode( ) = if_salv_c_selection_mode=>single.
mo_select_list_popup->close_screen( ).
ENDIF.
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.
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.
READ TABLE <lt_table> ASSIGNING <lg_line> INDEX row.
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 popup_get_from_free_selections.
DATA: lo_free_sel_dialog TYPE REF TO zcl_abapgit_free_sel_dialog.
CREATE OBJECT lo_free_sel_dialog
EXPORTING
iv_title = iv_title
iv_frame_text = iv_frame_text.
lo_free_sel_dialog->set_fields( CHANGING ct_fields = ct_fields ).
lo_free_sel_dialog->show( ).
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,
lv_text 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.
IF iv_hide_head IS NOT INITIAL.
lv_text = 'master'.
ENDIF.
IF iv_hide_branch IS NOT INITIAL AND iv_hide_branch <> zif_abapgit_definitions=>c_git_branch-master.
IF lv_text IS INITIAL.
lv_text = iv_hide_branch && ' is'.
ELSE.
CONCATENATE lv_text 'and' iv_hide_branch 'are' INTO lv_text SEPARATED BY space.
ENDIF.
ELSE.
lv_text = lv_text && ' is'.
ENDIF.
IF lv_text IS NOT INITIAL.
zcx_abapgit_exception=>raise( 'No branches available to select (' && lv_text && ' hidden)' ).
ELSE.
zcx_abapgit_exception=>raise( 'No branches are available to select' ).
ENDIF.
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.
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 ).
lv_text = |Branch switched from { zcl_abapgit_git_branch_list=>get_display_name( iv_default_branch ) } to {
zcl_abapgit_git_branch_list=>get_display_name( rs_branch-name ) } |.
MESSAGE lv_text TYPE 'S'.
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'.
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~choose_pr_popup.
DATA lv_answer TYPE c LENGTH 1.
DATA lt_selection TYPE TABLE OF spopli.
FIELD-SYMBOLS <ls_sel> LIKE LINE OF lt_selection.
FIELD-SYMBOLS <ls_pull> LIKE LINE OF it_pulls.
IF lines( it_pulls ) = 0.
zcx_abapgit_exception=>raise( 'No pull requests to select from' ).
ENDIF.
LOOP AT it_pulls ASSIGNING <ls_pull>.
APPEND INITIAL LINE TO lt_selection ASSIGNING <ls_sel>.
<ls_sel>-varoption = |{ <ls_pull>-number } - { <ls_pull>-title } @{ <ls_pull>-user }|.
ENDLOOP.
CALL FUNCTION 'POPUP_TO_DECIDE_LIST'
EXPORTING
textline1 = 'Select pull request'
titel = 'Select pull request'
start_col = 30
start_row = 5
IMPORTING
answer = lv_answer
TABLES
t_spopli = lt_selection
EXCEPTIONS
OTHERS = 1.
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.
READ TABLE it_pulls INTO rs_pull INDEX sy-tabix.
ASSERT sy-subrc = 0.
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_3_get_values(
EXPORTING iv_popup_title = |Create branch from {
zcl_abapgit_git_branch_list=>get_display_name( iv_source_branch_name ) }|
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_3_get_values( EXPORTING iv_popup_title = 'Export package'
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 ).
_popup_3_get_values( EXPORTING iv_popup_title = 'Object'
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 ) ).
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.
DATA: lv_serialize_master_lang_only 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 ).
add_field( EXPORTING iv_tabname = 'TVDIR'
iv_fieldname = 'FLAG'
iv_fieldtext = 'Master lang only'
CHANGING ct_fields = lt_fields ).
TRY.
_popup_3_get_values( EXPORTING iv_popup_title = 'Export package'
iv_no_value_check = abap_true
IMPORTING ev_value_1 = lv_package
ev_value_2 = lv_folder_logic
ev_value_3 = lv_serialize_master_lang_only
CHANGING ct_fields = lt_fields ).
ev_package = to_upper( lv_package ).
ev_folder_logic = to_upper( lv_folder_logic ).
ev_serialize_master_lang_only = boolc( lv_serialize_master_lang_only IS NOT INITIAL ).
CATCH zcx_abapgit_cancel.
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_perf_test_parameters.
DATA: lt_fields TYPE zcl_abapgit_free_sel_dialog=>ty_free_sel_field_tab.
FIELD-SYMBOLS: <ls_field> TYPE zcl_abapgit_free_sel_dialog=>ty_free_sel_field.
APPEND INITIAL LINE TO lt_fields ASSIGNING <ls_field>.
<ls_field>-name = 'PACKAGE'.
<ls_field>-only_parameter = abap_true.
<ls_field>-ddic_tabname = 'TADIR'.
<ls_field>-ddic_fieldname = 'DEVCLASS'.
<ls_field>-param_obligatory = abap_true.
<ls_field>-value = cv_package.
APPEND INITIAL LINE TO lt_fields ASSIGNING <ls_field>.
<ls_field>-name = 'PGMID'.
<ls_field>-only_parameter = abap_true.
<ls_field>-ddic_tabname = 'TADIR'.
<ls_field>-ddic_fieldname = 'PGMID'.
<ls_field>-value = 'R3TR'.
APPEND INITIAL LINE TO lt_fields ASSIGNING <ls_field>.
<ls_field>-name = 'OBJECT'.
<ls_field>-ddic_tabname = 'TADIR'.
<ls_field>-ddic_fieldname = 'OBJECT'.
APPEND INITIAL LINE TO lt_fields ASSIGNING <ls_field>.
<ls_field>-name = 'OBJ_NAME'.
<ls_field>-ddic_tabname = 'TADIR'.
<ls_field>-ddic_fieldname = 'OBJ_NAME'.
APPEND INITIAL LINE TO lt_fields ASSIGNING <ls_field>.
<ls_field>-name = 'INCLUDE_SUB_PACKAGES'.
<ls_field>-only_parameter = abap_true.
<ls_field>-ddic_tabname = 'TDEVC'.
<ls_field>-ddic_fieldname = 'IS_ENHANCEABLE'.
<ls_field>-text = 'Include subpackages'.
<ls_field>-value = cv_include_sub_packages.
APPEND INITIAL LINE TO lt_fields ASSIGNING <ls_field>.
<ls_field>-name = 'MASTER_LANG_ONLY'.
<ls_field>-only_parameter = abap_true.
<ls_field>-ddic_tabname = 'TVDIR'.
<ls_field>-ddic_fieldname = 'FLAG'.
<ls_field>-text = 'Master lang only'.
<ls_field>-value = cv_serialize_master_lang_only.
popup_get_from_free_selections(
EXPORTING
iv_title = 'Serialization Performance Test Parameters'
iv_frame_text = 'Parameters'
CHANGING
ct_fields = lt_fields ).
LOOP AT lt_fields ASSIGNING <ls_field>.
CASE <ls_field>-name.
WHEN 'PACKAGE'.
cv_package = <ls_field>-value.
WHEN 'OBJECT'.
et_object_type_filter = <ls_field>-value_range.
WHEN 'OBJ_NAME'.
et_object_name_filter = <ls_field>-value_range.
WHEN 'INCLUDE_SUB_PACKAGES'.
cv_include_sub_packages = boolc( <ls_field>-value IS NOT INITIAL ).
WHEN 'MASTER_LANG_ONLY'.
cv_serialize_master_lang_only = boolc( <ls_field>-value IS NOT INITIAL ).
ENDCASE.
ENDLOOP.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_proxy_bypass.
rt_proxy_bypass = it_proxy_bypass.
CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
EXPORTING
title = 'Bypass proxy settings for these Hosts & Domains'
signed = abap_false
lower_case = abap_true
no_interval_check = abap_true
TABLES
range = rt_proxy_bypass
EXCEPTIONS
no_range_tab = 1
cancelled = 2
internal_error = 3
invalid_fieldname = 4
OTHERS = 5.
CASE sy-subrc.
WHEN 0.
WHEN 2.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
WHEN OTHERS.
zcx_abapgit_exception=>raise( 'Error from COMPLEX_SELECTIONS_DIALOG' ).
ENDCASE.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_search_help.
DATA lt_ret TYPE TABLE OF ddshretval.
DATA ls_ret LIKE LINE OF lt_ret.
DATA lv_tabname TYPE dfies-tabname.
DATA lv_fieldname TYPE dfies-fieldname.
SPLIT iv_tab_field AT '-' INTO lv_tabname lv_fieldname.
lv_tabname = to_upper( lv_tabname ).
lv_fieldname = to_upper( lv_fieldname ).
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = lv_tabname
fieldname = lv_fieldname
TABLES
return_tab = lt_ret
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |F4IF_FIELD_VALUE_REQUEST error [{ iv_tab_field }]| ).
ENDIF.
IF lines( lt_ret ) > 0.
READ TABLE lt_ret INDEX 1 INTO ls_ret.
ASSERT sy-subrc = 0.
rv_value = ls_ret-fieldval.
ENDIF.
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.
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.
ev_create = boolc( sy-subrc = 0 ).
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_3_get_values( EXPORTING iv_popup_title = 'Transport to new Branch'
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 c LENGTH 70,
lv_line2 TYPE c LENGTH 70.
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: lv_pfstatus TYPE sypfkey,
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,
<ls_column_to_display> TYPE zif_abapgit_definitions=>ty_alv_column.
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> ).
CASE iv_selection_mode.
WHEN if_salv_c_selection_mode=>single.
lv_pfstatus = '110'.
WHEN OTHERS.
lv_pfstatus = '102'.
ENDCASE.
mo_select_list_popup->set_screen_status( pfstatus = lv_pfstatus
report = 'SAPMSVIM' ).
mo_select_list_popup->set_screen_popup( start_column = iv_start_column
end_column = iv_end_column
start_line = iv_start_line
end_line = iv_end_line ).
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.
SET HANDLER on_double_click FOR lo_events.
IF iv_title CN ' _0'.
mo_select_list_popup->get_display_settings( )->set_list_header( iv_title ).
ENDIF.
IF iv_header_text CN ' _0'.
CREATE OBJECT lo_table_header
EXPORTING
text = iv_header_text.
mo_select_list_popup->set_top_of_list( lo_table_header ).
ENDIF.
mo_select_list_popup->get_display_settings( )->set_striped_pattern( iv_striped_pattern ).
mo_select_list_popup->get_selections( )->set_selection_mode( iv_selection_mode ).
lo_columns = mo_select_list_popup->get_columns( ).
lt_columns = lo_columns->get( ).
lo_columns->set_optimize( iv_optimize_col_width ).
LOOP AT lt_columns INTO ls_column.
lo_column ?= ls_column-r_column.
IF iv_selection_mode = if_salv_c_selection_mode=>multiple
AND ls_column-columnname = c_fieldname_selected.
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
ASSIGNING <ls_column_to_display>
WITH KEY name = ls_column-columnname.
CASE sy-subrc.
WHEN 0.
IF <ls_column_to_display>-text CN ' _0'.
lo_column->set_short_text( |{ <ls_column_to_display>-text }| ).
lo_column->set_medium_text( |{ <ls_column_to_display>-text }| ).
lo_column->set_long_text( |{ <ls_column_to_display>-text }| ).
ENDIF.
IF <ls_column_to_display>-length > 0.
lo_column->set_output_length( <ls_column_to_display>-length ).
ENDIF.
WHEN OTHERS.
" Hide column
lo_column->set_technical( abap_true ).
ENDCASE.
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.
mv_cancel = abap_false.
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_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_folder_logic TYPE string,
lv_ign_subpkg TYPE abap_bool,
lv_finished TYPE abap_bool,
lv_master_lang_only 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'.
lv_icon2 = icon_folder.
ENDIF.
lv_display_name = iv_display_name.
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 ).
add_field( EXPORTING iv_tabname = 'TADIR'
iv_fieldname = 'AUTHOR'
iv_fieldtext = 'Folder logic'
iv_obligatory = abap_true
iv_value = zif_abapgit_dot_abapgit=>c_folder_logic-prefix
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'TDEVC'
iv_fieldname = 'IS_ENHANCEABLE'
iv_fieldtext = 'Ignore subpackages'
iv_value = abap_false
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'DOKIL'
iv_fieldname = 'MASTERLANG'
iv_fieldtext = 'Master language only'
iv_value = abap_true
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.
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
ev_folder_logic = lv_folder_logic
ev_ign_subpkg = lv_ign_subpkg
ev_master_lang_only = lv_master_lang_only ).
lv_finished = abap_true.
TRY.
IF iv_freeze_url = abap_false.
zcl_abapgit_url=>validate( |{ lv_url }| ).
ENDIF.
IF iv_freeze_package = abap_false.
zcl_abapgit_repo_srv=>get_instance( )->validate_package( iv_package = lv_package
iv_ign_subpkg = lv_ign_subpkg
iv_chk_exists = abap_false ).
ENDIF.
validate_folder_logic( lv_folder_logic ).
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.
rs_popup-folder_logic = lv_folder_logic.
rs_popup-ign_subpkg = lv_ign_subpkg.
rs_popup-master_lang_only = lv_master_lang_only.
ENDMETHOD.
METHOD _popup_3_get_values.
DATA lv_answer TYPE c LENGTH 1.
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.
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.
IF ev_value_3 IS SUPPLIED.
READ TABLE ct_fields INDEX 3 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_value_3 = <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,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
764,
628,
220,
220,
220,
8355,
43429,
1546,
8478,
62,
4868,
62,
12924,
929,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
1671,
3702,
62,
4868,
62,
12924,
929,
764,
198,
220,
220,
220,
8355,
43429,
1546,
8478,
62,
12924,
929,
62,
47423,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
1671,
3702,
62,
12924,
929,
62,
47423,
764,
198,
220,
220,
220,
8355,
43429,
1546,
2251,
62,
1671,
3702,
62,
12924,
929,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
17953,
62,
1671,
3702,
62,
12924,
929,
764,
198,
220,
220,
220,
8355,
43429,
1546,
5301,
62,
12924,
929,
62,
47423,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
26495,
62,
12924,
929,
62,
47423,
764,
198,
220,
220,
220,
8355,
43429,
1546,
46207,
62,
43551,
62,
6404,
291,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
43551,
62,
6404,
291,
764,
198,
220,
220,
220,
8355,
43429,
1546,
46207,
62,
15252,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
15252,
764,
198,
220,
220,
220,
8355,
43429,
1546,
46207,
62,
26495,
62,
39344,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
26495,
62,
39344,
764,
198,
220,
220,
220,
8355,
43429,
1546,
46207,
62,
36436,
62,
1525,
6603,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
36436,
62,
1525,
6603,
764,
198,
220,
220,
220,
8355,
43429,
1546,
46207,
62,
1462,
62,
10414,
2533,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
1462,
62,
10414,
2533,
764,
198,
220,
220,
220,
8355,
43429,
1546,
46207,
62,
1462,
62,
17953,
62,
26495,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
1462,
62,
17953,
62,
26495,
764,
198,
220,
220,
220,
8355,
43429,
1546,
46207,
62,
1462,
62,
17953,
62,
7645,
79,
62,
1671,
3702,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
1462,
62,
17953,
62,
7645,
79,
62,
1671,
3702,
764,
198,
220,
220,
220,
8355,
43429,
1546,
46207,
62,
1462,
62,
259,
687,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
1462,
62,
259,
687,
764,
198,
220,
220,
220,
8355,
43429,
1546,
46207,
62,
1462,
62,
19738,
62,
6738,
62,
4868,
198,
220,
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,
764,
198,
220,
220,
220,
8355,
43429,
1546,
46207,
62,
1462,
62,
19738,
62,
7645,
3742,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
1462,
62,
19738,
62,
7645,
3742,
764,
198,
220,
220,
220,
8355,
43429,
1546,
46207,
62,
7645,
634,
62,
25927,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
12924,
929,
62,
7645,
634,
62,
25927,
764,
198,
220,
220,
220,
8355,
43429,
1546,
29924,
62,
12924,
929,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
12924,
4739,
93,
260,
7501,
62,
12924,
929,
764,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
12286,
62,
28665,
41876,
300,
28435,
62,
69,
3672,
26173,
8924,
4600,
7206,
38865,
62,
25154,
5883,
45,
63,
22492,
15285,
62,
32541,
13,
198,
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,
269,
406,
49494,
352,
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,
26173,
8924,
450,
499,
62,
9562,
13,
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,
264,
2100,
12,
3245,
3672,
198,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
INTERFACE z_aff_example_intf PUBLIC.
TYPES ty_example_type TYPE string.
CONSTANTS co_example_constant TYPE ty_example_type VALUE `ABC123` ##NO_TEXT.
EVENTS example_event.
"! Method description, lorem ipsum
METHODS example_method
IMPORTING
!i_param TYPE ty_example_type.
ENDINTERFACE.
| [
41358,
49836,
1976,
62,
2001,
62,
20688,
62,
600,
69,
44731,
13,
628,
220,
24412,
47,
1546,
1259,
62,
20688,
62,
4906,
41876,
4731,
13,
628,
220,
7102,
2257,
1565,
4694,
763,
62,
20688,
62,
9979,
415,
41876,
1259,
62,
20688,
62,
4906,
26173,
8924,
4600,
24694,
10163,
63,
22492,
15285,
62,
32541,
13,
628,
220,
22399,
1672,
62,
15596,
13,
628,
220,
366,
0,
11789,
6764,
11,
24044,
76,
220,
2419,
388,
198,
220,
337,
36252,
50,
1672,
62,
24396,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
17143,
41876,
1259,
62,
20688,
62,
4906,
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
] |
CLASS y_check_max_nesting_depth DEFINITION
PUBLIC
INHERITING FROM y_check_base
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor .
PROTECTED SECTION.
METHODS inspect_tokens
REDEFINITION .
PRIVATE SECTION.
DATA statement_for_message TYPE sstmnt.
DATA curr_nesting TYPE i .
DATA max_nesting TYPE i .
METHODS compute_nesting_level
IMPORTING
!token_str TYPE string .
METHODS determine_position
IMPORTING
!type TYPE flag
!index TYPE i
RETURNING
VALUE(result) TYPE int4 .
ENDCLASS.
CLASS Y_CHECK_MAX_NESTING_DEPTH IMPLEMENTATION.
METHOD compute_nesting_level.
CASE token_str.
WHEN 'IF' OR 'WHILE' OR 'LOOP' OR
'DO' OR 'PROVIDE' OR 'TRY' OR 'CASE'.
ADD 1 TO curr_nesting.
WHEN 'ENDIF' OR 'ENDWHILE' OR 'ENDLOOP' OR
'ENDDO' OR 'ENDPROVIDE' OR 'ENDTRY' OR 'ENDCASE'.
max_nesting = nmax( val1 = max_nesting val2 = curr_nesting ).
SUBTRACT 1 FROM curr_nesting.
WHEN 'ENDAT' OR 'ENDSELECT'.
IF curr_nesting >= max_nesting.
max_nesting = curr_nesting + 1.
ENDIF.
ENDCASE.
ENDMETHOD.
METHOD constructor.
super->constructor( ).
description = 'Nesting Depth'(001).
category = 'Y_CHECK_CATEGORY'.
position = '450'.
version = '0000'.
has_documentation = abap_true.
settings-pseudo_comment = '"#EC CI_NESTING' ##NO_TEXT.
settings-documentation = |{ c_docs_path-checks }maximum-nesting-depth.md|.
y_message_registration=>add_message(
EXPORTING
check_name = me->myname
text = '[Clean Code]: Maximal nesting depth is &1, exceeding threshold of &2'(102)
pseudo_comment = settings-pseudo_comment
CHANGING
messages = me->scimessages ).
ENDMETHOD.
METHOD determine_position.
result = index.
IF type = scan_struc_type-event.
result = result - 1.
ENDIF.
ENDMETHOD.
METHOD inspect_tokens.
IF index = structure-stmnt_from.
statement_for_message = statement.
curr_nesting = 0.
max_nesting = 0.
ENDIF.
LOOP AT ref_scan_manager->get_tokens( ) ASSIGNING FIELD-SYMBOL(<token>)
FROM statement-from TO statement-to.
compute_nesting_level( <token>-str ).
IF index = structure-stmnt_to.
DATA(check_configuration) = detect_check_configuration( error_count = max_nesting
statement = statement_for_message ).
IF check_configuration IS INITIAL.
CONTINUE.
ENDIF.
raise_error( statement_level = statement_for_message-level
statement_index = determine_position( type = structure-type index = index )
statement_from = statement_for_message-from
error_priority = check_configuration-prio
parameter_01 = |{ max_nesting }|
parameter_02 = |{ check_configuration-threshold }| ).
ENDIF.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
62,
9122,
62,
9806,
62,
77,
37761,
62,
18053,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
331,
62,
9122,
62,
8692,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
23772,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
10104,
62,
83,
482,
641,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
2643,
62,
1640,
62,
20500,
41876,
264,
301,
76,
429,
13,
198,
220,
220,
220,
42865,
1090,
81,
62,
77,
37761,
41876,
1312,
764,
198,
220,
220,
220,
42865,
3509,
62,
77,
37761,
41876,
1312,
764,
628,
220,
220,
220,
337,
36252,
50,
24061,
62,
77,
37761,
62,
5715,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
30001,
62,
2536,
41876,
4731,
764,
198,
220,
220,
220,
337,
36252,
50,
5004,
62,
9150,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4906,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
6056,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
9630,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
493,
19,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
575,
62,
50084,
62,
22921,
62,
45,
6465,
2751,
62,
46162,
4221,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
24061,
62,
77,
37761,
62,
5715,
13,
198,
220,
220,
220,
42001,
11241,
62,
2536,
13,
198,
220,
220,
220,
220,
220,
42099,
705,
5064,
6,
6375,
705,
12418,
41119,
6,
220,
220,
6375,
705,
21982,
3185,
6,
6375,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
18227,
6,
6375,
705,
41283,
14114,
6,
6375,
705,
40405,
6,
220,
6375,
705,
34,
11159,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
27841,
352,
5390,
1090,
81,
62,
77,
37761,
13,
198,
220,
220,
220,
220,
220,
42099,
705,
10619,
5064,
6,
6375,
705,
10619,
12418,
41119,
6,
220,
220,
6375,
705,
10619,
21982,
3185,
6,
6375,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
10619,
18227,
6,
6375,
705,
10619,
41283,
14114,
6,
6375,
705,
10619,
40405,
6,
220,
6375,
705,
1677,
9697,
11159,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
3509,
62,
77,
37761,
796,
299,
9806,
7,
1188,
16,
796,
3509,
62,
77,
37761,
1188,
17,
796,
1090,
81,
62,
77,
37761,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
28932,
5446,
10659,
352,
16034,
1090,
81,
62,
77,
37761,
13,
198,
220,
220,
220,
220,
220,
42099,
705,
10619,
1404,
6,
6375,
705,
10619,
46506,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
16876,
1090,
81,
62,
77,
37761,
18189,
3509,
62,
77,
37761,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3509,
62,
77,
37761,
796,
1090,
81,
62,
77,
37761,
1343,
352,
13,
198,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
34,
11159,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
6739,
628,
220,
220,
220,
6764,
796,
705,
45,
37761,
36350,
6,
7,
8298,
737,
198,
220,
220,
220,
6536,
220,
220,
220,
796,
705,
56,
62,
50084,
62,
34,
6158,
38,
15513,
4458,
198,
220,
220,
220,
2292,
220,
220,
220,
796,
705,
17885,
4458,
198,
220,
220,
220,
2196,
220,
220,
220,
220,
796,
705,
2388,
4458,
198,
220,
220,
220,
468,
62,
22897,
341,
796,
450,
499,
62,
7942,
13,
628,
220,
220,
220,
6460,
12,
7752,
12003,
62,
23893,
796,
705,
1,
2,
2943,
14514,
62,
45,
6465,
2751,
6,
22492,
15285,
62,
32541,
13,
198,
220,
220,
220,
6460,
12,
22897,
341,
796,
930,
90,
269,
62,
31628,
62,
6978,
12,
42116,
1782,
47033,
12,
77,
37761,
12,
18053,
13,
9132,
91,
13,
628,
220,
220,
220,
331,
62,
20500,
62,
2301,
33397,
14804,
2860,
62,
20500,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
2198,
62,
3672,
220,
220,
220,
220,
796,
502,
3784,
1820,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
2420,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
44438,
32657,
6127,
5974,
5436,
4402,
46282,
6795,
318,
1222,
16,
11,
23353,
11387,
286,
1222,
17,
6,
7,
15377,
8,
198,
220,
220,
220,
220,
220,
220,
220,
24543,
62,
23893,
796,
6460,
12,
7752,
12003,
62,
23893,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
6218,
220,
220,
220,
220,
220,
220,
796,
502,
3784,
1416,
320,
408,
1095,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
5004,
62,
9150,
13,
198,
220,
220,
220,
1255,
796,
6376,
13,
198,
220,
220,
220,
16876,
2099,
796,
9367,
62,
19554,
66,
62,
4906,
12,
15596,
13,
198,
220,
220,
220,
220,
220,
1255,
796,
1255,
532,
352,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
10104,
62,
83,
482,
641,
13,
198,
220,
220,
220,
16876,
6376,
796,
4645,
12,
301,
76,
429,
62,
6738,
13,
198,
220,
220,
220,
220,
220,
2643,
62,
1640,
62,
20500,
796,
2643,
13,
198,
220,
220,
220,
220,
220,
1090,
81,
62,
77,
37761,
796,
657,
13,
198,
220,
220,
220,
220,
220,
3509,
62,
77,
37761,
796,
657,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
17579,
3185,
5161,
1006,
62,
35836,
62,
37153,
3784,
1136,
62,
83,
482,
641,
7,
1267,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
30001,
43734,
198,
220,
220,
220,
220,
220,
16034,
2643,
12,
6738,
5390,
2643,
12,
1462,
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,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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
] |
*******************************************************************
* System-defined Include-files. *
*******************************************************************
INCLUDE LZMONSTER_UNIT_TESTINGTOP. " Global Data
INCLUDE LZMONSTER_UNIT_TESTINGUXX. " Function Modules
*******************************************************************
* User-defined Include-files (if necessary). *
*******************************************************************
* INCLUDE LZMONSTER_UNIT_TESTINGF... " Subroutines
* INCLUDE LZMONSTER_UNIT_TESTINGO... " PBO-Modules
* INCLUDE LZMONSTER_UNIT_TESTINGI... " PAI-Modules
* INCLUDE LZMONSTER_UNIT_TESTINGE... " Events
* INCLUDE LZMONSTER_UNIT_TESTINGP... " Local class implement.
| [
17174,
17174,
8162,
198,
9,
220,
220,
4482,
12,
23211,
40348,
12,
16624,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
17174,
17174,
8162,
198,
220,
3268,
5097,
52,
7206,
406,
57,
27857,
41809,
62,
4944,
2043,
62,
51,
6465,
2751,
35222,
13,
220,
220,
220,
220,
220,
220,
220,
220,
366,
8060,
6060,
198,
220,
3268,
5097,
52,
7206,
406,
57,
27857,
41809,
62,
4944,
2043,
62,
51,
6465,
2751,
52,
8051,
13,
220,
220,
220,
220,
220,
220,
220,
220,
366,
15553,
3401,
5028,
198,
198,
17174,
17174,
8162,
198,
9,
220,
220,
11787,
12,
23211,
40348,
12,
16624,
357,
361,
3306,
737,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
17174,
17174,
8162,
198,
9,
3268,
5097,
52,
7206,
406,
57,
27857,
41809,
62,
4944,
2043,
62,
51,
6465,
2751,
37,
986,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3834,
81,
448,
1127,
198,
9,
3268,
5097,
52,
7206,
406,
57,
27857,
41809,
62,
4944,
2043,
62,
51,
6465,
2751,
46,
986,
220,
220,
220,
220,
220,
220,
220,
220,
366,
350,
8202,
12,
5841,
5028,
198,
9,
3268,
5097,
52,
7206,
406,
57,
27857,
41809,
62,
4944,
2043,
62,
51,
6465,
2751,
40,
986,
220,
220,
220,
220,
220,
220,
220,
220,
366,
8147,
40,
12,
5841,
5028,
198,
9,
3268,
5097,
52,
7206,
406,
57,
27857,
41809,
62,
4944,
2043,
62,
51,
6465,
2751,
36,
986,
220,
220,
220,
220,
220,
220,
220,
220,
366,
18715,
198,
9,
3268,
5097,
52,
7206,
406,
57,
27857,
41809,
62,
4944,
2043,
62,
51,
6465,
2751,
47,
986,
220,
220,
220,
220,
220,
220,
220,
220,
366,
10714,
1398,
3494,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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gp_packet~get_name .
ALIASES get_tag
FOR zif_abappgp_packet~get_tag .
ALIASES to_stream
FOR zif_abappgp_packet~to_stream .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_ABAPPGP_PACKET_17 IMPLEMENTATION.
METHOD zif_abappgp_packet~dump.
rv_dump = |{ get_name( ) }(tag { get_tag( ) })({ to_stream( )->get_length( ) } bytes)\n\ttodo\n|.
ENDMETHOD.
METHOD zif_abappgp_packet~from_stream.
* todo
CREATE OBJECT ri_packet
TYPE zcl_abappgp_packet_17.
ENDMETHOD.
METHOD zif_abappgp_packet~get_name.
rv_name = 'User Attribute Packet'(001).
ENDMETHOD.
METHOD zif_abappgp_packet~get_tag.
rv_tag = zif_abappgp_constants=>c_tag-user_attribute.
ENDMETHOD.
METHOD zif_abappgp_packet~to_stream.
* todo
CREATE OBJECT ro_stream.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
1324,
31197,
62,
8002,
316,
62,
1558,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
764,
628,
220,
220,
220,
8355,
43429,
1546,
422,
62,
5532,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
93,
6738,
62,
5532,
764,
198,
220,
220,
220,
8355,
43429,
1546,
651,
62,
3672,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
93,
1136,
62,
3672,
764,
198,
220,
220,
220,
8355,
43429,
1546,
651,
62,
12985,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
93,
1136,
62,
12985,
764,
198,
220,
220,
220,
8355,
43429,
1546,
284,
62,
5532,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
93,
1462,
62,
5532,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
6968,
47,
62,
47,
8120,
2767,
62,
1558,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
93,
39455,
13,
628,
220,
220,
220,
374,
85,
62,
39455,
796,
930,
90,
651,
62,
3672,
7,
1267,
1782,
7,
12985,
1391,
651,
62,
12985,
7,
1267,
1782,
5769,
90,
284,
62,
5532,
7,
1267,
3784,
1136,
62,
13664,
7,
1267,
1782,
9881,
19415,
77,
59,
926,
24313,
59,
77,
91,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
93,
6738,
62,
5532,
13,
198,
198,
9,
284,
4598,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
374,
72,
62,
8002,
316,
198,
220,
220,
220,
220,
220,
41876,
1976,
565,
62,
397,
1324,
31197,
62,
8002,
316,
62,
1558,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
93,
1136,
62,
3672,
13,
628,
220,
220,
220,
374,
85,
62,
3672,
796,
705,
12982,
3460,
4163,
6400,
316,
6,
7,
8298,
737,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
93,
1136,
62,
12985,
13,
628,
220,
220,
220,
374,
85,
62,
12985,
796,
1976,
361,
62,
397,
1324,
31197,
62,
9979,
1187,
14804,
66,
62,
12985,
12,
7220,
62,
42348,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
1324,
31197,
62,
8002,
316,
93,
1462,
62,
5532,
13,
198,
198,
9,
284,
4598,
628,
220,
220,
220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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_scp1 DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_objects_super
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_object .
PROTECTED SECTION.
TYPES:
BEGIN OF ty_scp1,
scprattr TYPE scprattr,
scprtext TYPE STANDARD TABLE OF scprtext WITH DEFAULT KEY,
scprvals TYPE STANDARD TABLE OF scprvals WITH DEFAULT KEY,
scprvall TYPE STANDARD TABLE OF scprvall WITH DEFAULT KEY,
scprreca TYPE STANDARD TABLE OF scprreca WITH DEFAULT KEY,
scprfldv TYPE STANDARD TABLE OF scprfldv WITH DEFAULT KEY,
subprofs TYPE STANDARD TABLE OF scprpprl WITH DEFAULT KEY,
END OF ty_scp1 .
METHODS dequeue .
METHODS enqueue
RAISING
zcx_abapgit_exception .
METHODS save
IMPORTING
!is_scp1 TYPE ty_scp1
RAISING
zcx_abapgit_exception .
METHODS save_hier
IMPORTING
!is_scp1 TYPE ty_scp1
RAISING
zcx_abapgit_exception .
METHODS adjust_inbound
CHANGING
!cs_scp1 TYPE ty_scp1 .
METHODS adjust_outbound
CHANGING
!cs_scp1 TYPE ty_scp1 .
METHODS load
CHANGING
!cs_scp1 TYPE ty_scp1 .
METHODS load_hier
CHANGING
!cs_scp1 TYPE ty_scp1 .
METHODS call_delete_fms
IMPORTING
!iv_profile_id TYPE scpr_id
RAISING
zcx_abapgit_exception .
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_SCP1 IMPLEMENTATION.
METHOD adjust_inbound.
FIELD-SYMBOLS: <ls_scprvals> TYPE scprvals,
<ls_scprreca> TYPE scprreca,
<ls_scprvall> TYPE scprvall.
* back to internal format
LOOP AT cs_scp1-scprvals ASSIGNING <ls_scprvals>.
SHIFT <ls_scprvals>-recnumber RIGHT DELETING TRAILING space.
ENDLOOP.
LOOP AT cs_scp1-scprreca ASSIGNING <ls_scprreca>.
SHIFT <ls_scprreca>-recnumber RIGHT DELETING TRAILING space.
ENDLOOP.
LOOP AT cs_scp1-scprvall ASSIGNING <ls_scprvall>.
SHIFT <ls_scprvall>-recnumber RIGHT DELETING TRAILING space.
ENDLOOP.
ENDMETHOD.
METHOD adjust_outbound.
FIELD-SYMBOLS: <ls_scprvals> TYPE scprvals,
<ls_scprreca> TYPE scprreca,
<ls_scprvall> TYPE scprvall.
* normalize the XML
LOOP AT cs_scp1-scprvals ASSIGNING <ls_scprvals>.
CONDENSE <ls_scprvals>-recnumber.
ENDLOOP.
LOOP AT cs_scp1-scprreca ASSIGNING <ls_scprreca>.
CONDENSE <ls_scprreca>-recnumber.
ENDLOOP.
LOOP AT cs_scp1-scprvall ASSIGNING <ls_scprvall>.
CONDENSE <ls_scprvall>-recnumber.
ENDLOOP.
ENDMETHOD.
METHOD call_delete_fms.
CONSTANTS:
lc_version_new TYPE c VALUE 'N' ##NO_TEXT, "Include SCPRINTCONST version_new
lc_operation_delete TYPE c VALUE 'D' ##NO_TEXT.
DATA:
lv_profile_type TYPE scprattr-type,
lt_fatherprofiles TYPE STANDARD TABLE OF scproprof WITH DEFAULT KEY,
ls_fatherprofile TYPE scproprof.
CALL FUNCTION 'SCPR_DB_ATTR_GET_DETAIL'
EXPORTING
profid = iv_profile_id
version = lc_version_new
IMPORTING
proftype = lv_profile_type
EXCEPTIONS
OTHERS = 0.
CALL FUNCTION 'SCPR_PRSET_DB_USED_IN'
EXPORTING
profid = iv_profile_id
version = lc_version_new
TABLES
profiles = lt_fatherprofiles.
ls_fatherprofile-id = iv_profile_id.
APPEND ls_fatherprofile TO lt_fatherprofiles.
CALL FUNCTION 'SCPR_CT_TRANSPORT_ENTRIES'
TABLES
profids = lt_fatherprofiles
EXCEPTIONS
error_in_transport_layer = 1
user_abort = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |error while deleting SCP1 - TRANSPORT, { sy-subrc }| ).
ENDIF.
CALL FUNCTION 'SCPR_PRSET_DB_DELETE_ALL'
EXPORTING
profid = iv_profile_id
proftype = lv_profile_type
TABLES
fatherprofs = lt_fatherprofiles
EXCEPTIONS
user_abort = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |error while deleting SCP1 - DB_DELETE, { sy-subrc }| ).
ENDIF.
CALL FUNCTION 'SCPR_MEM_SCPR_ACTIONS_ADD'
EXPORTING
bcset_id = iv_profile_id
operation = lc_operation_delete.
ENDMETHOD.
METHOD dequeue.
DATA: lv_id TYPE scpr_id.
lv_id = ms_item-obj_name.
CALL FUNCTION 'SCPR_SV_DEQUEUE_BCSET'
EXPORTING
bcset_id = lv_id.
ENDMETHOD.
METHOD enqueue.
DATA: lv_id TYPE scpr_id.
lv_id = ms_item-obj_name.
CALL FUNCTION 'SCPR_SV_ENQUEUE_BCSET'
EXPORTING
bcset_id = lv_id
EXCEPTIONS
is_already_locked = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |SCP1 locking error| ).
ENDIF.
ENDMETHOD.
METHOD load.
CALL FUNCTION 'SCPR_TEMPL_DB_VALS_GET_DETAIL'
EXPORTING
profid = cs_scp1-scprattr-id
category = cs_scp1-scprattr-category
TABLES
values = cs_scp1-scprvals
valuesl = cs_scp1-scprvall
recattr = cs_scp1-scprreca.
CALL FUNCTION 'SCPR_TEMPL_DB_FLDTXTVAR_GET'
EXPORTING
bcset_id = cs_scp1-scprattr-id
category = cs_scp1-scprattr-category
TABLES
it_fldv = cs_scp1-scprfldv.
ENDMETHOD.
METHOD load_hier.
CALL FUNCTION 'SCPR_PRSET_DB_SUBP_GET_DETAIL'
EXPORTING
profid = cs_scp1-scprattr-id
category = cs_scp1-scprattr-category
TABLES
subprofs = cs_scp1-subprofs.
ENDMETHOD.
METHOD save.
DATA: ls_scp1 TYPE ty_scp1,
ls_text TYPE scprtext.
* copy everything to local, the function module changes the values
ls_scp1 = is_scp1.
READ TABLE ls_scp1-scprtext INTO ls_text WITH KEY langu = sy-langu. "#EC CI_SUBRC
CALL FUNCTION 'SCPR_TEMPL_MN_TEMPLATE_SAVE'
EXPORTING
profid = ls_scp1-scprattr-id
proftext = ls_text-text
category = ls_scp1-scprattr-category
cli_dep = ls_scp1-scprattr-cli_dep
cli_cas = ls_scp1-scprattr-cli_cas
reftype = ls_scp1-scprattr-reftype
refname = ls_scp1-scprattr-refname
orgid = ls_scp1-scprattr-orgid
component = ls_scp1-scprattr-component
minrelease = ls_scp1-scprattr-minrelease
maxrelease = ls_scp1-scprattr-maxrelease
act_info = ls_scp1-scprattr-act_info
bcset_type = ls_scp1-scprattr-type
fldtxtvar_supplied = 'YES'
with_transp_insert = abap_false
with_progress_indicator = abap_false
remove_denied_data = abap_true
ask_for_cont_after_remove = abap_true
TABLES
values = ls_scp1-scprvals
valuesl = ls_scp1-scprvall
recattr = ls_scp1-scprreca
it_fldv = ls_scp1-scprfldv
texts = ls_scp1-scprtext
EXCEPTIONS
user_abort = 1
error_in_transport_layer = 2
inconsistent_data = 3
database_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error saving SCP1, { sy-subrc }| ).
ENDIF.
ENDMETHOD.
METHOD save_hier.
DATA: ls_scp1 TYPE ty_scp1,
ls_profs LIKE LINE OF ls_scp1-subprofs,
lt_sub TYPE STANDARD TABLE OF scproprof WITH DEFAULT KEY,
ls_sub LIKE LINE OF lt_sub,
ls_text TYPE scprtext.
* copy everything to local, the function module changes the values
ls_scp1 = is_scp1.
READ TABLE ls_scp1-scprtext INTO ls_text WITH KEY langu = sy-langu. "#EC CI_SUBRC
* see fm SCPR_PRSET_DB_STORE, only this field and sequence is used
LOOP AT ls_scp1-subprofs INTO ls_profs.
ls_sub-id = ls_profs-subprofile.
APPEND ls_sub TO lt_sub.
ENDLOOP.
CALL FUNCTION 'SCPR_PRSET_MN_BCSET_SAVE'
EXPORTING
profid = ls_scp1-scprattr-id
proftext = ls_text-text
category = ls_scp1-scprattr-category
cli_dep = ls_scp1-scprattr-cli_dep
cli_cas = ls_scp1-scprattr-cli_cas
reftype = ls_scp1-scprattr-reftype
refname = ls_scp1-scprattr-refname
orgid = ls_scp1-scprattr-orgid
component = ls_scp1-scprattr-component
minrelease = ls_scp1-scprattr-minrelease
maxrelease = ls_scp1-scprattr-maxrelease
act_info = ls_scp1-scprattr-act_info
with_transp_insert = abap_false
with_progress_indicator = abap_false
TABLES
subprofs = lt_sub
texts = ls_scp1-scprtext
EXCEPTIONS
user_abort = 1
error_in_transport_layer = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error saving SCP1, { sy-subrc }| ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
SELECT SINGLE modifier INTO rv_user FROM scprattr
WHERE id = ms_item-obj_name
AND version = 'N'.
IF sy-subrc <> 0 OR rv_user IS INITIAL.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_profile_id TYPE scpr_id.
lv_profile_id = ms_item-obj_name.
enqueue( ).
call_delete_fms( lv_profile_id ).
dequeue( ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_scp1 TYPE ty_scp1.
io_xml->read(
EXPORTING iv_name = 'SCP1'
CHANGING cg_data = ls_scp1 ).
adjust_inbound( CHANGING cs_scp1 = ls_scp1 ).
IF ls_scp1-scprattr-type = 'TMP'.
save_hier( ls_scp1 ).
ELSE.
save( ls_scp1 ).
ENDIF.
dequeue( ).
tadir_insert( iv_package ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_rc TYPE sy-subrc,
lv_profid TYPE scprattr-id.
lv_profid = ms_item-obj_name.
CALL FUNCTION 'SCPR_BCSET_EXISTS'
EXPORTING
profid = lv_profid
IMPORTING
rc = lv_rc.
rv_bool = boolc( lv_rc = 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.
DATA: lv_display_only TYPE scpr_txt20,
lv_bcset_id TYPE scpr_id.
lv_display_only = abap_false.
lv_bcset_id = ms_item-obj_name.
EXPORT scpr3_display_only = lv_display_only
scpr3_bcset_id = lv_bcset_id
TO MEMORY ID 'SCPR3_PARAMETER'.
SUBMIT scpr3 AND RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: ls_scp1 TYPE ty_scp1.
ls_scp1-scprattr-id = ms_item-obj_name.
CALL FUNCTION 'SCPR_DB_ATTR_GET_DETAIL'
EXPORTING
profid = ls_scp1-scprattr-id
IMPORTING
proftype = ls_scp1-scprattr-type
cli_dep = ls_scp1-scprattr-cli_dep
cli_cas = ls_scp1-scprattr-cli_cas
reftype = ls_scp1-scprattr-reftype
refname = ls_scp1-scprattr-refname
component = ls_scp1-scprattr-component
minrelease = ls_scp1-scprattr-minrelease
maxrelease = ls_scp1-scprattr-maxrelease
orgid = ls_scp1-scprattr-orgid
act_info = ls_scp1-scprattr-act_info.
CALL FUNCTION 'SCPR_TEXT_GET'
EXPORTING
profid = ls_scp1-scprattr-id
category = ls_scp1-scprattr-category
TABLES
texts = ls_scp1-scprtext
EXCEPTIONS
no_text_found = 1.
IF ls_scp1-scprattr-type = 'TMP'.
load_hier( CHANGING cs_scp1 = ls_scp1 ).
ELSE.
load( CHANGING cs_scp1 = ls_scp1 ).
ENDIF.
adjust_outbound( CHANGING cs_scp1 = ls_scp1 ).
io_xml->add(
iv_name = 'SCP1'
ig_data = ls_scp1 ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
1416,
79,
16,
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,
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,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
1416,
79,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
629,
1050,
35226,
41876,
629,
1050,
35226,
11,
198,
220,
220,
220,
220,
220,
220,
220,
629,
1050,
5239,
41876,
49053,
9795,
43679,
3963,
629,
1050,
5239,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
629,
1050,
12786,
41876,
49053,
9795,
43679,
3963,
629,
1050,
12786,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
629,
1050,
85,
439,
41876,
49053,
9795,
43679,
3963,
629,
1050,
85,
439,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
629,
1050,
260,
6888,
41876,
49053,
9795,
43679,
3963,
629,
1050,
260,
6888,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
629,
1050,
69,
335,
85,
41876,
49053,
9795,
43679,
3963,
629,
1050,
69,
335,
85,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
850,
5577,
82,
41876,
49053,
9795,
43679,
3963,
629,
1050,
381,
45895,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
1416,
79,
16,
764,
628,
220,
220,
220,
337,
36252,
50,
390,
36560,
764,
198,
220,
220,
220,
337,
36252,
50,
551,
36560,
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,
3613,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
1416,
79,
16,
41876,
1259,
62,
1416,
79,
16,
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,
3613,
62,
71,
959,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
1416,
79,
16,
41876,
1259,
62,
1416,
79,
16,
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,
4532,
62,
259,
7784,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
6359,
62,
1416,
79,
16,
41876,
1259,
62,
1416,
79,
16,
764,
198,
220,
220,
220,
337,
36252,
50,
4532,
62,
448,
7784,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
6359,
62,
1416,
79,
16,
41876,
1259,
62,
1416,
79,
16,
764,
198,
220,
220,
220,
337,
36252,
50,
3440,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
6359,
62,
1416,
79,
16,
41876,
1259,
62,
1416,
79,
16,
764,
198,
220,
220,
220,
337,
36252,
50,
3440,
62,
71,
959,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
6359,
62,
1416,
79,
16,
41876,
1259,
62,
1416,
79,
16,
764,
198,
220,
220,
220,
337,
36252,
50,
869,
62,
33678,
62,
69,
907,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
13317,
62,
312,
41876,
629,
1050,
62,
312,
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,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
48956,
16,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
4532,
62,
259,
7784,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
1416,
1050,
12786,
29,
41876,
629,
1050,
12786,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7278,
62,
1416,
1050,
260,
6888,
29,
41876,
629,
1050,
260,
6888,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7278,
62,
1416,
1050,
85,
439,
29,
41876,
629,
1050,
85,
439,
13,
198,
198,
9,
736,
284,
5387,
5794,
198,
220,
220,
220,
17579,
3185,
5161,
50115,
62,
1416,
79,
16,
12,
1416,
1050,
12786,
24994,
3528,
15871,
1279,
7278,
62,
1416,
1050,
12786,
28401,
198,
220,
220,
220,
220,
220,
6006,
32297,
1279,
7278,
62,
1416,
1050,
12786,
29,
12,
8344,
17618,
33621,
5550,
28882,
2751,
29125,
4146,
2751,
2272,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
198,
220,
220,
220,
17579,
3185,
5161,
50115,
62,
1416,
79,
16,
12,
1416,
1050,
260,
6888,
24994,
3528,
15871,
1279,
7278,
62,
1416,
1050,
260,
6888,
28401,
198,
220,
220,
220,
220,
220,
6006,
32297,
1279,
7278,
62,
1416,
1050,
260,
6888,
29,
12,
8344,
17618,
33621,
5550,
28882,
2751,
29125,
4146,
2751,
2272,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
198,
220,
220,
220,
17579,
3185,
5161,
50115,
62,
1416,
79,
16,
12,
1416,
1050,
85,
439,
24994,
3528,
15871,
1279,
7278,
62,
1416,
1050,
85,
439,
28401,
198,
220,
220,
220,
220,
220,
6006,
32297,
1279,
7278,
62,
1416,
1050,
85,
439,
29,
12,
8344,
17618,
33621,
5550,
28882,
2751,
29125,
4146,
2751,
2272,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
23578,
49273,
13,
628,
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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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
] |
CLASS zcl_app_rule_amdp_sel_ups_ins DEFINITION
PUBLIC
INHERITING FROM zcl_app_rule_amdp_default_no_c
CREATE PUBLIC .
PUBLIC SECTION.
METHODS zif_app_rule~finalize_init REDEFINITION.
METHODS zif_app_rule~get_new_line_indent REDEFINITION.
METHODS zif_app_rule~get_cur_offset_start REDEFINITION.
METHODS zif_app_rule~refresh_buffer REDEFINITION.
PROTECTED SECTION.
PRIVATE SECTION.
METHODS set_additional_indent
RAISING
zcx_app_exception.
METHODS get_join_rule
IMPORTING iv_token TYPE zapp_d_token
RETURNING VALUE(rr_result) TYPE REF TO zif_app_rule
RAISING zcx_app_exception .
METHODS get_order_rule
RETURNING VALUE(rr_result) TYPE REF TO zif_app_rule
RAISING zcx_app_exception .
METHODS get_default_rule
RETURNING VALUE(rr_result) TYPE REF TO zif_app_rule
RAISING zcx_app_exception .
METHODS get_group_rule
RETURNING VALUE(rr_result) TYPE REF TO zif_app_rule
RAISING zcx_app_exception .
METHODS get_prev_select_rule
RETURNING VALUE(rr_result) TYPE REF TO zif_app_rule
RAISING zcx_app_exception .
METHODS get_prev_ups_ins_rule
RETURNING VALUE(rr_result) TYPE REF TO zif_app_rule
RAISING zcx_app_exception .
METHODS get_distinct_rule
RETURNING VALUE(rr_result) TYPE REF TO zif_app_rule
RAISING zcx_app_exception .
METHODS get_longest_join_rule
RETURNING VALUE(rr_result) TYPE REF TO zif_app_rule
RAISING zcx_app_exception.
METHODS get_union_all_rule
RETURNING VALUE(rr_result) TYPE REF TO zif_app_rule
RAISING zcx_app_exception .
DATA mv_add_indent_set TYPE abap_bool.
ENDCLASS.
CLASS zcl_app_rule_amdp_sel_ups_ins IMPLEMENTATION.
METHOD zif_app_rule~get_new_line_indent.
IF is_logic_active( ) = abap_false.
rv_result = super->zif_app_rule~get_new_line_indent( ).
RETURN.
ENDIF.
rv_result = zif_app_rule~get_cur_offset_end( ).
ENDMETHOD.
METHOD zif_app_rule~get_cur_offset_start.
IF is_logic_active( ) = abap_true.
set_additional_indent( ).
ENDIF.
rv_result = super->zif_app_rule~get_cur_offset_start( ).
ENDMETHOD.
METHOD set_additional_indent.
DATA lr_prev_select_rule TYPE REF TO zif_app_rule.
DATA lr_prev_insert_rule TYPE REF TO zif_app_rule.
DATA lr_join_rule TYPE REF TO zif_app_rule.
DATA lr_order_rule TYPE REF TO zif_app_rule.
DATA lr_group_rule TYPE REF TO zif_app_rule.
DATA lr_distinct_rule TYPE REF TO zif_app_rule.
DATA lr_union_all_rule TYPE REF TO zif_app_rule.
DATA lr_default_rule TYPE REF TO zif_app_rule.
IF mv_add_indent_set = abap_true.
RETURN.
ENDIF.
lr_prev_insert_rule = get_prev_ups_ins_rule( ).
IF lr_prev_insert_rule IS NOT INITIAL.
mv_add_indent = -7.
mv_add_indent_set = abap_true.
RETURN.
ENDIF.
lr_prev_select_rule = get_prev_select_rule( ).
IF lr_prev_select_rule IS NOT INITIAL.
mv_add_indent = lr_prev_select_rule->get_additional_indent( ).
mv_add_indent_set = abap_true.
RETURN.
ENDIF.
lr_join_rule = get_longest_join_rule( ).
IF lr_join_rule IS NOT INITIAL.
CASE lr_join_rule->get_token_up( ).
WHEN 'LEFT'.
mv_add_indent = 9.
WHEN 'RIGHT'.
mv_add_indent = 10.
WHEN 'CROSS' OR 'INNER'.
mv_add_indent = 4.
ENDCASE.
mv_add_indent_set = abap_true.
RETURN.
ENDIF.
lr_union_all_rule = get_union_all_rule( ).
IF NOT lr_union_all_rule IS INITIAL.
mv_add_indent = 3.
mv_add_indent_set = abap_true.
RETURN.
ENDIF.
lr_distinct_rule = get_distinct_rule( ).
IF NOT lr_distinct_rule IS INITIAL.
mv_add_indent = 2.
mv_add_indent_set = abap_true.
RETURN.
ENDIF.
lr_order_rule = get_order_rule( ).
IF NOT lr_order_rule IS INITIAL.
mv_add_indent = 2.
mv_add_indent_set = abap_true.
RETURN.
ENDIF.
lr_group_rule = get_group_rule( ).
IF NOT lr_group_rule IS INITIAL.
mv_add_indent = 2.
mv_add_indent_set = abap_true.
RETURN.
ENDIF.
lr_default_rule = get_default_rule( ).
IF NOT lr_default_rule IS INITIAL.
mv_add_indent = 1.
mv_add_indent_set = abap_true.
RETURN.
ENDIF.
mv_add_indent_set = abap_true.
ENDMETHOD.
METHOD get_join_rule.
DATA lt_token TYPE zapp_t_token.
DATA lt_stop_token TYPE zapp_t_token.
DATA lr_next_rule TYPE REF TO zif_app_rule.
DATA lv_token TYPE zapp_d_token.
DATA lr_start_rule TYPE REF TO zif_app_rule.
INSERT iv_token INTO TABLE lt_token.
lr_start_rule = me.
DO.
rr_result = zcl_app_amdp_rule_utilities=>get_rule_in_stm_on_same_level(
EXPORTING
ir_start_rule = lr_start_rule
it_token = lt_token
it_stop_token = lt_stop_token
).
IF rr_result IS INITIAL.
RETURN.
ENDIF.
CASE rr_result->get_token_up( ).
WHEN 'LEFT' OR 'RIGHT'.
lr_next_rule = rr_result->get_next_rule( ).
IF lr_next_rule IS NOT INITIAL.
IF lr_next_rule->get_token_up( ) = '('.
"the rule doesn't belong to the join condition, it is the function
lr_start_rule = lr_next_rule.
CONTINUE.
ENDIF.
ENDIF.
ENDCASE.
RETURN.
ENDDO.
ENDMETHOD.
METHOD get_order_rule.
DATA lt_token TYPE zapp_t_token.
DATA lt_stop_token TYPE zapp_t_token.
DATA lv_token TYPE zapp_d_token.
lv_token = 'ORDER'.
INSERT lv_token INTO TABLE lt_token.
rr_result = zcl_app_amdp_rule_utilities=>get_rule_in_stm_on_same_level(
EXPORTING
ir_start_rule = me
it_token = lt_token
it_stop_token = lt_stop_token
).
ENDMETHOD.
METHOD get_default_rule.
DATA lt_token TYPE zapp_t_token.
DATA lt_stop_token TYPE zapp_t_token.
DATA lv_token TYPE zapp_d_token.
lv_token = 'DEFAULT'.
INSERT lv_token INTO TABLE lt_token.
rr_result = zcl_app_amdp_rule_utilities=>get_rule_in_stm_on_same_level(
EXPORTING
ir_start_rule = me
it_token = lt_token
it_stop_token = lt_stop_token
).
ENDMETHOD.
METHOD get_union_all_rule.
DATA lt_token TYPE zapp_t_token.
DATA lt_stop_token TYPE zapp_t_token.
DATA lv_token TYPE zapp_d_token.
DATA lr_rule TYPE REF TO zif_app_rule.
DATA lr_next_rule TYPE REF TO zif_app_rule.
lv_token = 'UNION'.
INSERT lv_token INTO TABLE lt_token.
rr_result = zcl_app_amdp_rule_utilities=>get_rule_in_stm_on_same_level(
EXPORTING
ir_start_rule = me
it_token = lt_token
it_stop_token = lt_stop_token
).
IF lr_rule IS NOT INITIAL.
lr_next_rule = lr_rule->get_next_rule( ).
IF lr_next_rule IS NOT INITIAL.
IF lr_next_rule->get_token_up( ) = 'ALL'.
rr_result = lr_rule.
ENDIF.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD get_longest_join_rule.
DATA lv_token TYPE zapp_d_token.
lv_token = 'RIGHT'.
rr_result = get_join_rule( lv_token ).
IF NOT rr_result IS INITIAL.
RETURN.
ENDIF.
lv_token = 'LEFT'.
rr_result = get_join_rule( lv_token ).
IF NOT rr_result IS INITIAL.
RETURN.
ENDIF.
lv_token = 'INNER'.
rr_result = get_join_rule( lv_token ).
IF NOT rr_result IS INITIAL.
RETURN.
ENDIF.
lv_token = 'CROSS'.
rr_result = get_join_rule( lv_token ).
ENDMETHOD.
METHOD zif_app_rule~refresh_buffer.
super->zif_app_rule~refresh_buffer( ).
CLEAR mv_add_indent_set.
ENDMETHOD.
METHOD zif_app_rule~finalize_init.
super->zif_app_rule~finalize_init( ).
IF is_logic_active( ) = abap_true.
mr_token_ext->delimiter = zcl_app_utilities=>get_space_as_delimiter( ).
ENDIF.
ENDMETHOD.
METHOD get_group_rule.
DATA lt_token TYPE zapp_t_token.
DATA lt_stop_token TYPE zapp_t_token.
DATA lv_token TYPE zapp_d_token.
lv_token = 'GROUP'.
INSERT lv_token INTO TABLE lt_token.
rr_result = zcl_app_amdp_rule_utilities=>get_rule_in_stm_on_same_level(
EXPORTING
ir_start_rule = me
it_token = lt_token
it_stop_token = lt_stop_token
).
ENDMETHOD.
METHOD get_distinct_rule.
DATA lt_token TYPE zapp_t_token.
DATA lt_stop_token TYPE zapp_t_token.
DATA lv_token TYPE zapp_d_token.
lv_token = 'DISTINCT'.
INSERT lv_token INTO TABLE lt_token.
rr_result = zcl_app_amdp_rule_utilities=>get_rule_in_stm_on_same_level(
EXPORTING
ir_start_rule = me
it_token = lt_token
it_stop_token = lt_stop_token
).
ENDMETHOD.
METHOD get_prev_select_rule.
DATA lt_token TYPE zapp_t_token.
DATA lt_stop_token TYPE zapp_t_token.
DATA lv_token TYPE zapp_d_token.
lv_token = 'SELECT'.
INSERT lv_token INTO TABLE lt_token.
rr_result = zcl_app_amdp_rule_utilities=>get_rule_in_stm_on_same_lvl_rw(
EXPORTING
ir_start_rule = me
it_token = lt_token
it_stop_token = lt_stop_token
).
ENDMETHOD.
METHOD get_prev_ups_ins_rule.
DATA lt_token TYPE zapp_t_token.
DATA lt_stop_token TYPE zapp_t_token.
DATA lv_token TYPE zapp_d_token.
lv_token = 'INSERT'.
INSERT lv_token INTO TABLE lt_token.
lv_token = 'UPSERT'.
INSERT lv_token INTO TABLE lt_token.
rr_result = zcl_app_amdp_rule_utilities=>get_rule_in_stm_on_same_lvl_rw(
EXPORTING
ir_start_rule = me
it_token = lt_token
it_stop_token = lt_stop_token
).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
1324,
62,
25135,
62,
321,
26059,
62,
741,
62,
4739,
62,
1040,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
1324,
62,
25135,
62,
321,
26059,
62,
12286,
62,
3919,
62,
66,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
1976,
361,
62,
1324,
62,
25135,
93,
20311,
1096,
62,
15003,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
1976,
361,
62,
1324,
62,
25135,
93,
1136,
62,
3605,
62,
1370,
62,
521,
298,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
1976,
361,
62,
1324,
62,
25135,
93,
1136,
62,
22019,
62,
28968,
62,
9688,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
1976,
361,
62,
1324,
62,
25135,
93,
5420,
3447,
62,
22252,
23848,
36,
20032,
17941,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
900,
62,
2860,
1859,
62,
521,
298,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
13,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
22179,
62,
25135,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
30001,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
1324,
62,
67,
62,
30001,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
21062,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
2875,
62,
25135,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
21062,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
12286,
62,
25135,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
21062,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
8094,
62,
25135,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
21062,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
47050,
62,
19738,
62,
25135,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
21062,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
47050,
62,
4739,
62,
1040,
62,
25135,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
21062,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
17080,
4612,
62,
25135,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
21062,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
6511,
395,
62,
22179,
62,
25135,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
21062,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
13,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
24592,
62,
439,
62,
25135,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
21062,
62,
20274,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
1324,
62,
25135,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
1324,
62,
1069,
4516,
764,
628,
220,
220,
220,
42865,
285,
85,
62,
2860,
62,
521,
298,
62,
2617,
41876,
450,
499,
62,
30388,
13,
628,
198,
10619,
31631,
13,
198,
198,
31631,
1976,
565,
62,
1324,
62,
25135,
62,
321,
26059,
62,
741,
62,
4739,
62,
1040,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
1976,
361,
62,
1324,
62,
25135,
93,
1136,
62,
3605,
62,
1370,
62,
521,
298,
13,
198,
220,
220,
220,
16876,
318,
62,
6404,
291,
62,
5275,
7,
220,
1267,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
20274,
796,
2208,
3784,
89,
361,
62,
1324,
62,
25135,
93,
1136,
62,
3605,
62,
1370,
62,
521,
298,
7,
6739,
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,
1976,
361,
62,
1324,
62,
25135,
93,
1136,
62,
22019,
62,
28968,
62,
437,
7,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1976,
361,
62,
1324,
62,
25135,
93,
1136,
62,
22019,
62,
28968,
62,
9688,
13,
628,
220,
220,
220,
16876,
318,
62,
6404,
291,
62,
5275,
7,
220,
1267,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
900,
62,
2860,
1859,
62,
521,
298,
7,
6739,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
374,
85,
62,
20274,
796,
2208,
3784,
89,
361,
62,
1324,
62,
25135,
93,
1136,
62,
22019,
62,
28968,
62,
9688,
7,
6739,
628,
220,
23578
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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no_more_act TYPE i VALUE 4,
new_page_w_bookmark TYPE i VALUE 5,
go_back_to_bookmark TYPE i VALUE 6,
new_page_replacing TYPE i VALUE 7,
END OF c_event_state .
CONSTANTS:
BEGIN OF c_action,
go_home TYPE string VALUE 'go_home',
go_db TYPE string VALUE 'go_db',
END OF c_action .
METHODS go_home
RAISING
zcx_abapgit_exception .
METHODS go_page
IMPORTING
!ii_page TYPE REF TO zif_abapgit_gui_renderable
!iv_clear_stack TYPE abap_bool DEFAULT abap_true
RAISING
zcx_abapgit_exception .
METHODS back
IMPORTING
!iv_to_bookmark TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(rv_exit) TYPE abap_bool
RAISING
zcx_abapgit_exception .
METHODS on_event
FOR EVENT sapevent OF zif_abapgit_html_viewer
IMPORTING
!action
!frame
!getdata
!postdata
!query_table .
METHODS constructor
IMPORTING
!io_component TYPE REF TO object OPTIONAL
!ii_asset_man TYPE REF TO zif_abapgit_gui_asset_manager OPTIONAL
!ii_hotkey_ctl TYPE REF TO zif_abapgit_gui_hotkey_ctl OPTIONAL
!ii_html_processor TYPE REF TO zif_abapgit_gui_html_processor OPTIONAL
!iv_rollback_on_error TYPE abap_bool DEFAULT abap_true
RAISING
zcx_abapgit_exception .
METHODS free .
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_page_stack,
page TYPE REF TO zif_abapgit_gui_renderable,
bookmark TYPE abap_bool,
END OF ty_page_stack .
DATA mv_rollback_on_error TYPE abap_bool .
DATA mi_cur_page TYPE REF TO zif_abapgit_gui_renderable .
DATA:
mt_stack TYPE STANDARD TABLE OF ty_page_stack .
DATA:
mt_event_handlers TYPE STANDARD TABLE OF REF TO zif_abapgit_gui_event_handler .
DATA mi_router TYPE REF TO zif_abapgit_gui_event_handler .
DATA mi_asset_man TYPE REF TO zif_abapgit_gui_asset_manager .
DATA mi_hotkey_ctl TYPE REF TO zif_abapgit_gui_hotkey_ctl .
DATA mi_html_processor TYPE REF TO zif_abapgit_gui_html_processor .
DATA mi_html_viewer TYPE REF TO zif_abapgit_html_viewer .
DATA mo_html_parts TYPE REF TO zcl_abapgit_html_parts .
METHODS cache_html
IMPORTING
!iv_text TYPE string
RETURNING
VALUE(rv_url) TYPE w3url
RAISING
zcx_abapgit_exception .
METHODS startup
RAISING
zcx_abapgit_exception .
METHODS render
RAISING
zcx_abapgit_exception .
METHODS call_page
IMPORTING
!ii_page TYPE REF TO zif_abapgit_gui_renderable
!iv_with_bookmark TYPE abap_bool DEFAULT abap_false
!iv_replacing TYPE abap_bool DEFAULT abap_false
RAISING
zcx_abapgit_exception .
METHODS handle_action
IMPORTING
!iv_action TYPE c
!iv_getdata TYPE c OPTIONAL
!it_postdata TYPE zif_abapgit_html_viewer=>ty_post_data OPTIONAL .
METHODS handle_error
IMPORTING
!ix_exception TYPE REF TO zcx_abapgit_exception .
ENDCLASS.
CLASS zcl_abapgit_gui IMPLEMENTATION.
METHOD back.
DATA: lv_index TYPE i,
ls_stack LIKE LINE OF mt_stack.
" If viewer is showing Internet page, then use browser navigation
IF mi_html_viewer->get_url( ) CP 'http*'.
mi_html_viewer->back( ).
RETURN.
ENDIF.
lv_index = lines( mt_stack ).
IF lv_index = 0.
rv_exit = abap_true.
RETURN.
ENDIF.
DO lv_index TIMES.
READ TABLE mt_stack INDEX lv_index INTO ls_stack.
ASSERT sy-subrc = 0.
DELETE mt_stack INDEX lv_index.
ASSERT sy-subrc = 0.
lv_index = lv_index - 1.
IF iv_to_bookmark = abap_false OR ls_stack-bookmark = abap_true.
EXIT.
ENDIF.
ENDDO.
mi_cur_page = ls_stack-page. " last page always stays
render( ).
ENDMETHOD.
METHOD cache_html.
rv_url = zif_abapgit_gui_services~cache_asset(
iv_text = iv_text
iv_type = 'text'
iv_subtype = 'html' ).
ENDMETHOD.
METHOD call_page.
DATA: ls_stack TYPE ty_page_stack.
IF iv_replacing = abap_false AND NOT mi_cur_page IS INITIAL.
ls_stack-page = mi_cur_page.
ls_stack-bookmark = iv_with_bookmark.
APPEND ls_stack TO mt_stack.
ENDIF.
mi_cur_page = ii_page.
render( ).
ENDMETHOD.
METHOD constructor.
IF io_component IS BOUND.
IF zcl_abapgit_gui_utils=>is_renderable( io_component ) = abap_true.
mi_cur_page ?= io_component. " direct page
ELSE.
IF zcl_abapgit_gui_utils=>is_event_handler( io_component ) = abap_false.
zcx_abapgit_exception=>raise( 'Component must be renderable or be an event handler' ).
ENDIF.
mi_router ?= io_component.
ENDIF.
ENDIF.
CREATE OBJECT mo_html_parts.
mv_rollback_on_error = iv_rollback_on_error.
mi_asset_man = ii_asset_man.
mi_hotkey_ctl = ii_hotkey_ctl.
mi_html_processor = ii_html_processor. " Maybe improve to middlewares stack ??
startup( ).
ENDMETHOD.
METHOD free.
SET HANDLER on_event FOR mi_html_viewer ACTIVATION space.
mi_html_viewer->close_document( ).
mi_html_viewer->free( ).
FREE mi_html_viewer.
ENDMETHOD.
METHOD go_home.
DATA: ls_stack LIKE LINE OF mt_stack,
lv_mode TYPE tabname.
IF mi_router IS BOUND.
CLEAR: mt_stack, mt_event_handlers.
APPEND mi_router TO mt_event_handlers.
" on_event doesn't accept strings directly
GET PARAMETER ID 'DBT' FIELD lv_mode.
CASE lv_mode.
WHEN 'ZABAPGIT'.
on_event( action = |{ c_action-go_db }| ).
WHEN OTHERS.
on_event( action = |{ c_action-go_home }| ).
ENDCASE.
ELSE.
IF lines( mt_stack ) > 0.
READ TABLE mt_stack INTO ls_stack INDEX 1.
mi_cur_page = ls_stack-page.
ENDIF.
render( ).
ENDIF.
ENDMETHOD.
METHOD go_page.
IF iv_clear_stack = abap_true.
CLEAR mt_stack.
ENDIF.
mi_cur_page = ii_page.
render( ).
ENDMETHOD.
METHOD handle_action.
DATA:
lx_exception TYPE REF TO zcx_abapgit_exception,
li_handler TYPE REF TO zif_abapgit_gui_event_handler,
li_event TYPE REF TO zif_abapgit_gui_event,
ls_handled TYPE zif_abapgit_gui_event_handler=>ty_handling_result.
CREATE OBJECT li_event TYPE zcl_abapgit_gui_event
EXPORTING
ii_gui_services = me
iv_action = iv_action
iv_getdata = iv_getdata
it_postdata = it_postdata.
TRY.
LOOP AT mt_event_handlers INTO li_handler.
ls_handled = li_handler->on_event( li_event ).
IF ls_handled-state IS NOT INITIAL AND ls_handled-state <> c_event_state-not_handled. " is handled
EXIT.
ENDIF.
ENDLOOP.
CASE ls_handled-state.
WHEN c_event_state-re_render.
render( ).
WHEN c_event_state-new_page.
call_page( ls_handled-page ).
WHEN c_event_state-new_page_w_bookmark.
call_page(
ii_page = ls_handled-page
iv_with_bookmark = abap_true ).
WHEN c_event_state-new_page_replacing.
call_page(
ii_page = ls_handled-page
iv_replacing = abap_true ).
WHEN c_event_state-go_back.
back( ).
WHEN c_event_state-go_back_to_bookmark.
back( abap_true ).
WHEN c_event_state-no_more_act.
" Do nothing, handling completed
WHEN OTHERS.
zcx_abapgit_exception=>raise( |Unknown action: { iv_action }| ).
ENDCASE.
CATCH zcx_abapgit_cancel ##NO_HANDLER.
" Do nothing = gc_event_state-no_more_act
CATCH zcx_abapgit_exception INTO lx_exception.
handle_error( lx_exception ).
ENDTRY.
ENDMETHOD.
METHOD handle_error.
DATA: li_gui_error_handler TYPE REF TO zif_abapgit_gui_error_handler,
lx_exception TYPE REF TO cx_root.
IF mv_rollback_on_error = abap_true.
ROLLBACK WORK.
ENDIF.
TRY.
li_gui_error_handler ?= mi_cur_page.
IF li_gui_error_handler IS BOUND AND li_gui_error_handler->handle_error( ix_exception ) = abap_true.
" We rerender the current page to display the error box
render( ).
ELSE.
MESSAGE ix_exception TYPE 'S' DISPLAY LIKE 'E'.
ENDIF.
CATCH zcx_abapgit_exception cx_sy_move_cast_error INTO lx_exception.
" In case of fire we just fallback to plain old message
MESSAGE lx_exception TYPE 'S' DISPLAY LIKE 'E'.
ENDTRY.
ENDMETHOD.
METHOD on_event.
handle_action(
iv_action = action
iv_getdata = getdata
it_postdata = postdata ).
ENDMETHOD.
METHOD render.
DATA: lv_url TYPE w3url,
lv_html TYPE string,
li_html TYPE REF TO zif_abapgit_html.
IF mi_cur_page IS NOT BOUND.
zcx_abapgit_exception=>raise( 'GUI error: no current page' ).
ENDIF.
CLEAR mt_event_handlers.
mo_html_parts->clear( ).
IF mi_router IS BOUND.
APPEND mi_router TO mt_event_handlers.
ENDIF.
IF mi_hotkey_ctl IS BOUND.
mi_hotkey_ctl->reset( ).
ENDIF.
li_html = mi_cur_page->render( ).
lv_html = li_html->render( iv_no_indent_jscss = abap_true ).
IF mi_html_processor IS BOUND.
lv_html = mi_html_processor->process(
iv_html = lv_html
ii_gui_services = me ).
ENDIF.
lv_url = cache_html( lv_html ).
mi_html_viewer->show_url( lv_url ).
ENDMETHOD.
METHOD startup.
DATA: lt_events TYPE cntl_simple_events,
ls_event LIKE LINE OF lt_events,
lt_assets TYPE zif_abapgit_gui_asset_manager=>ty_web_assets.
FIELD-SYMBOLS <ls_asset> LIKE LINE OF lt_assets.
mi_html_viewer = zcl_abapgit_ui_factory=>get_html_viewer( ).
IF mi_asset_man IS BOUND.
lt_assets = mi_asset_man->get_all_assets( ).
LOOP AT lt_assets ASSIGNING <ls_asset> WHERE is_cacheable = abap_true.
zif_abapgit_gui_services~cache_asset(
iv_xdata = <ls_asset>-content
iv_url = <ls_asset>-url
iv_type = <ls_asset>-type
iv_subtype = <ls_asset>-subtype ).
ENDLOOP.
ENDIF.
ls_event-eventid = mi_html_viewer->m_id_sapevent.
ls_event-appl_event = abap_true.
APPEND ls_event TO lt_events.
mi_html_viewer->set_registered_events( lt_events ).
SET HANDLER on_event FOR mi_html_viewer.
ENDMETHOD.
METHOD zif_abapgit_gui_services~cache_asset.
TYPES: ty_hex TYPE x LENGTH 200.
DATA: lt_xdata TYPE STANDARD TABLE OF ty_hex WITH DEFAULT KEY,
lv_size TYPE i,
lt_html TYPE w3htmltab.
ASSERT iv_text IS SUPPLIED OR iv_xdata IS SUPPLIED.
IF iv_text IS SUPPLIED. " String input
zcl_abapgit_convert=>string_to_tab(
EXPORTING
iv_str = iv_text
IMPORTING
ev_size = lv_size
et_tab = lt_html ).
mi_html_viewer->load_data(
EXPORTING
iv_type = iv_type
iv_subtype = iv_subtype
iv_size = lv_size
iv_url = iv_url
IMPORTING
ev_assigned_url = rv_url
CHANGING
ct_data_table = lt_html ).
ELSE. " Raw input
zcl_abapgit_convert=>xstring_to_bintab(
EXPORTING
iv_xstr = iv_xdata
IMPORTING
ev_size = lv_size
et_bintab = lt_xdata ).
mi_html_viewer->load_data(
EXPORTING
iv_type = iv_type
iv_subtype = iv_subtype
iv_size = lv_size
iv_url = iv_url
IMPORTING
ev_assigned_url = rv_url
CHANGING
ct_data_table = lt_xdata ).
ENDIF.
ASSERT sy-subrc = 0. " Image data error
ENDMETHOD.
METHOD zif_abapgit_gui_services~get_current_page_name.
DATA li_page_hoc TYPE REF TO zcl_abapgit_gui_page_hoc.
IF mi_cur_page IS BOUND.
rv_page_name = cl_abap_classdescr=>describe_by_object_ref( mi_cur_page )->get_relative_name( ).
" For HOC components return name of child component instead
IF rv_page_name = 'ZCL_ABAPGIT_GUI_PAGE_HOC'.
li_page_hoc ?= mi_cur_page.
IF li_page_hoc->get_child( ) IS BOUND.
rv_page_name = cl_abap_classdescr=>describe_by_object_ref(
li_page_hoc->get_child( ) )->get_relative_name( ).
ENDIF.
ENDIF.
ENDIF." ELSE - return is empty => initial page
ENDMETHOD.
METHOD zif_abapgit_gui_services~get_hotkeys_ctl.
ri_hotkey_ctl = mi_hotkey_ctl.
ENDMETHOD.
METHOD zif_abapgit_gui_services~get_html_parts.
ro_parts = mo_html_parts.
ENDMETHOD.
METHOD zif_abapgit_gui_services~register_event_handler.
ASSERT ii_event_handler IS BOUND.
INSERT ii_event_handler INTO mt_event_handlers INDEX 1.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
30416,
764,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
15596,
62,
5219,
11,
198,
220,
220,
220,
220,
220,
220,
220,
407,
62,
38788,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
26173,
8924,
657,
11,
198,
220,
220,
220,
220,
220,
220,
220,
302,
62,
13287,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
26173,
8924,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
7700,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
26173,
8924,
362,
11,
198,
220,
220,
220,
220,
220,
220,
220,
467,
62,
1891,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
26173,
8924,
513,
11,
198,
220,
220,
220,
220,
220,
220,
220,
645,
62,
3549,
62,
529,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
26173,
8924,
604,
11,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
7700,
62,
86,
62,
2070,
4102,
41876,
1312,
26173,
8924,
642,
11,
198,
220,
220,
220,
220,
220,
220,
220,
467,
62,
1891,
62,
1462,
62,
2070,
4102,
41876,
1312,
26173,
8924,
718,
11,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
7700,
62,
35666,
4092,
220,
41876,
1312,
26173,
8924,
767,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
15596,
62,
5219,
764,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
2673,
11,
198,
220,
220,
220,
220,
220,
220,
220,
467,
62,
11195,
41876,
4731,
26173,
8924,
705,
2188,
62,
11195,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
467,
62,
9945,
220,
220,
41876,
4731,
26173,
8924,
705,
2188,
62,
9945,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
2673,
764,
628,
220,
220,
220,
337,
36252,
50,
467,
62,
11195,
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,
467,
62,
7700,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
7700,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
13287,
540,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
20063,
62,
25558,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
7942,
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,
736,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
1462,
62,
2070,
4102,
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,
81,
85,
62,
37023,
8,
220,
41876,
450,
499,
62,
30388,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
319,
62,
15596,
198,
220,
220,
220,
220,
220,
220,
220,
7473,
49261,
473,
431,
1151,
3963,
1976,
361,
62,
397,
499,
18300,
62,
6494,
62,
1177,
263,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
2673,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
14535,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
1136,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
7353,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
22766,
62,
11487,
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,
952,
62,
42895,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
2134,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
562,
316,
62,
805,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
562,
316,
62,
37153,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
8940,
2539,
62,
34168,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
8940,
2539,
62,
34168,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
6494,
62,
41341,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
6494,
62,
41341,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
2487,
1891,
62,
261,
62,
18224,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
7942,
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,
1479,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
7700,
62,
25558,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2443,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
13287,
540,
11,
198,
220,
220,
220,
220,
220,
220,
220,
44007,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
23578
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
class /OOP/CX_RUNTIMEEXCEPTION definition
public
inheriting from CX_NO_CHECK
create public .
public section.
*"* public components of class /OOP/CX_RUNTIMEEXCEPTION
*"* do not include other source files here!!!
constants /OOP/CX_RUNTIMEEXCEPTION type SOTR_CONC value '001560AB31521EE1B6FDF852B7FA5160'. "#EC NOTEXT
data MESSAGE type STRING .
methods CONSTRUCTOR
importing
!TEXTID like TEXTID optional
!PREVIOUS like PREVIOUS optional
!MESSAGE type STRING optional .
protected section.
*"* protected components of class /OOP/CX_RUNTIMEEXCEPTION
*"* do not include other source files here!!!
private section.
*"* private components of class /OOP/CX_RUNTIMEEXCEPTION
*"* do not include other source files here!!!
ENDCLASS.
CLASS /OOP/CX_RUNTIMEEXCEPTION IMPLEMENTATION.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method /OOP/CX_RUNTIMEEXCEPTION->CONSTRUCTOR
* +-------------------------------------------------------------------------------------------------+
* | [--->] TEXTID LIKE TEXTID(optional)
* | [--->] PREVIOUS LIKE PREVIOUS(optional)
* | [--->] MESSAGE TYPE STRING(optional)
* +--------------------------------------------------------------------------------------</SIGNATURE>
method CONSTRUCTOR.
CALL METHOD SUPER->CONSTRUCTOR
EXPORTING
TEXTID = TEXTID
PREVIOUS = PREVIOUS
.
IF textid IS INITIAL.
me->textid = /OOP/CX_RUNTIMEEXCEPTION .
ENDIF.
me->MESSAGE = MESSAGE .
endmethod.
ENDCLASS.
| [
4871,
1220,
46,
3185,
14,
34,
55,
62,
49,
4944,
34694,
6369,
42006,
2849,
6770,
201,
198,
220,
1171,
201,
198,
220,
10639,
1780,
422,
327,
55,
62,
15285,
62,
50084,
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,
34,
55,
62,
49,
4944,
34694,
6369,
42006,
2849,
201,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
201,
198,
201,
198,
220,
38491,
1220,
46,
3185,
14,
34,
55,
62,
49,
4944,
34694,
6369,
42006,
2849,
2099,
311,
2394,
49,
62,
10943,
34,
1988,
705,
405,
1314,
1899,
6242,
27936,
2481,
6500,
16,
33,
21,
37,
8068,
23,
4309,
33,
22,
7708,
20,
14198,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
1366,
337,
1546,
4090,
8264,
2099,
19269,
2751,
764,
201,
198,
201,
198,
220,
5050,
7102,
46126,
1581,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
32541,
2389,
588,
40383,
2389,
11902,
201,
198,
220,
220,
220,
220,
220,
5145,
46437,
12861,
20958,
588,
22814,
12861,
20958,
11902,
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,
1220,
46,
3185,
14,
34,
55,
62,
49,
4944,
34694,
6369,
42006,
2849,
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,
34,
55,
62,
49,
4944,
34694,
6369,
42006,
2849,
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,
34,
55,
62,
49,
4944,
34694,
6369,
42006,
2849,
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,
1220,
46,
3185,
14,
34,
55,
62,
49,
4944,
34694,
6369,
42006,
2849,
3784,
10943,
46126,
1581,
201,
198,
9,
1343,
10097,
3880,
19529,
201,
198,
9,
930,
685,
438,
3784,
60,
40383,
2389,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34178,
220,
220,
220,
220,
220,
220,
220,
40383,
2389,
7,
25968,
8,
201,
198,
9,
930,
685,
438,
3784,
60,
22814,
12861,
20958,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34178,
220,
220,
220,
220,
220,
220,
220,
22814,
12861,
20958,
7,
25968,
8,
201,
198,
9,
930,
685,
438,
3784,
60,
337,
1546,
4090,
8264,
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,
7,
25968,
8,
201,
198,
9,
1343,
10097,
19351,
438,
3556,
46224,
40086,
29,
201,
198,
24396,
7102,
46126,
1581,
13,
201,
198,
34,
7036,
337,
36252,
33088,
3784,
10943,
46126,
1581,
201,
198,
6369,
15490,
2751,
201,
198,
32541,
2389,
796,
40383,
2389,
201,
198,
46437,
12861,
20958,
796,
22814,
12861,
20958,
201,
198,
13,
201,
198,
16876,
2420,
312,
3180,
3268,
2043,
12576,
13,
201,
198,
220,
220,
502,
3784,
5239,
312,
796,
1220,
46,
3185,
14,
34,
55,
62,
49,
4944,
34694,
6369,
42006,
2849,
764,
201,
198,
23578,
5064,
13,
201,
198,
1326,
3784,
44,
1546,
4090,
8264,
796,
337,
1546,
4090,
8264,
764,
201,
198,
437,
24396,
13,
201,
198,
10619,
31631,
13,
201,
198
] | [
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
] |
CLASS zcl_abapgit_object_devc DEFINITION PUBLIC
INHERITING FROM zcl_abapgit_objects_super
FINAL.
PUBLIC SECTION.
INTERFACES:
zif_abapgit_object.
ALIASES:
mo_files FOR zif_abapgit_object~mo_files.
METHODS:
constructor IMPORTING is_item TYPE zif_abapgit_definitions=>ty_item
iv_language TYPE spras.
PROTECTED SECTION.
PRIVATE SECTION.
METHODS:
get_package RETURNING VALUE(ri_package) TYPE REF TO if_package
RAISING zcx_abapgit_exception,
update_pinf_usages IMPORTING ii_package TYPE REF TO if_package
it_usage_data TYPE scomppdata
RAISING zcx_abapgit_exception,
set_lock IMPORTING ii_package TYPE REF TO if_package
iv_lock TYPE abap_bool
RAISING zcx_abapgit_exception.
DATA:
mv_local_devclass TYPE devclass.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_DEVC IMPLEMENTATION.
METHOD constructor.
super->constructor( is_item = is_item
iv_language = iv_language ).
mv_local_devclass = is_item-devclass.
ENDMETHOD.
METHOD get_package.
IF me->zif_abapgit_object~exists( ) = abap_true.
cl_package_factory=>load_package(
EXPORTING
i_package_name = mv_local_devclass
i_force_reload = abap_true
IMPORTING
e_package = ri_package
EXCEPTIONS
object_not_existing = 1
unexpected_error = 2
intern_err = 3
no_access = 4
object_locked_and_modified = 5
OTHERS = 6 ).
IF sy-subrc = 1.
RETURN.
ELSEIF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDIF.
ENDMETHOD.
METHOD set_lock.
DATA: lv_changeable TYPE abap_bool.
ii_package->get_changeable( IMPORTING e_changeable = lv_changeable ).
IF lv_changeable <> iv_lock.
ii_package->set_changeable(
EXPORTING
i_changeable = iv_lock
EXCEPTIONS
object_locked_by_other_user = 1
permission_failure = 2
object_already_changeable = 3
object_already_unlocked = 4
object_just_created = 5
object_deleted = 6
object_modified = 7
object_not_existing = 8
object_invalid = 9
unexpected_error = 10
OTHERS = 11 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDIF.
ii_package->set_permissions_changeable(
EXPORTING
i_changeable = iv_lock
i_suppress_dialog = abap_true
EXCEPTIONS
object_already_changeable = 1
object_already_unlocked = 2
object_locked_by_other_user = 3
object_modified = 4
object_just_created = 5
object_deleted = 6
permission_failure = 7
object_invalid = 8
unexpected_error = 9
OTHERS = 10 ).
IF ( sy-subrc = 1 AND iv_lock = abap_true ) OR ( sy-subrc = 2 AND iv_lock = abap_false ).
" There's no getter to find out beforehand...
ELSEIF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD update_pinf_usages.
DATA: lt_current_permissions TYPE tpak_permission_to_use_list,
li_usage TYPE REF TO if_package_permission_to_use,
ls_data_sign TYPE scomppsign,
ls_add_permission_data TYPE pkgpermdat,
lt_handled TYPE SORTED TABLE OF i WITH UNIQUE KEY table_line.
FIELD-SYMBOLS: <ls_usage_data> LIKE LINE OF it_usage_data.
" Get the current permissions
ii_package->get_permissions_to_use(
IMPORTING
e_permissions = lt_current_permissions
EXCEPTIONS
object_invalid = 1
unexpected_error = 2
OTHERS = 3 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ls_data_sign-err_sever = abap_true.
" New permissions
LOOP AT it_usage_data ASSIGNING <ls_usage_data>.
READ TABLE lt_current_permissions
WITH KEY table_line->package_interface_name = <ls_usage_data>-intf_name
INTO li_usage.
IF sy-subrc = 0 AND li_usage IS BOUND.
INSERT sy-tabix INTO TABLE lt_handled.
" Permission already exists, update attributes
li_usage->set_all_attributes(
EXPORTING
i_permission_data = <ls_usage_data>
i_data_sign = ls_data_sign
EXCEPTIONS
object_not_changeable = 1
object_invalid = 2
intern_err = 3
OTHERS = 4 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ELSE.
" Permission does not exist yet, add it
MOVE-CORRESPONDING <ls_usage_data> TO ls_add_permission_data.
ii_package->add_permission_to_use(
EXPORTING
i_pkg_permission_data = ls_add_permission_data
EXCEPTIONS
object_not_changeable = 1
object_access_error = 2
object_already_existing = 3
object_invalid = 4
unexpected_error = 5
OTHERS = 6 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDIF.
FREE li_usage.
ENDLOOP.
" Delete missing usages
LOOP AT lt_current_permissions INTO li_usage.
READ TABLE lt_handled WITH TABLE KEY table_line = sy-tabix TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
CONTINUE.
ENDIF.
li_usage->delete(
EXCEPTIONS
object_not_changeable = 1
object_invalid = 2
deletion_not_allowed = 3
intern_err = 4
OTHERS = 5 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
rv_user = get_package( )->changed_by.
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.
" Package deletion is a bit tricky. A package can only be deleted if there are no objects
" contained in it. This includes subpackages, so first the leaf packages need to be deleted.
" Unfortunately deleted objects that are still contained in an unreleased transport request
" also count towards the contained objects counter.
" -> Package deletion is currently not supported by abapGit
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: li_package TYPE REF TO if_package,
ls_package_data TYPE scompkdtln,
ls_data_sign TYPE scompksign,
lt_usage_data TYPE scomppdata,
ls_save_sign TYPE paksavsign.
FIELD-SYMBOLS: <ls_usage_data> TYPE scomppdtln.
mv_local_devclass = iv_package.
io_xml->read(
EXPORTING
iv_name = 'DEVC'
CHANGING
cg_data = ls_package_data ).
li_package = get_package( ).
" Swap out repository package name with the local installation package name
ls_package_data-devclass = mv_local_devclass.
ls_package_data-pdevclass = li_package->transport_layer.
" Parent package is not changed. Assume the folder logic already created the package and set
" the hierarchy before.
CLEAR ls_package_data-parentcl.
ls_data_sign-ctext = abap_true.
* ls_data_sign-korrflag = abap_true.
ls_data_sign-as4user = abap_true.
ls_data_sign-pdevclass = abap_true.
* ls_data_sign-dlvunit = abap_true.
ls_data_sign-comp_posid = abap_true.
ls_data_sign-component = abap_true.
* ls_data_sign-parentcl = abap_true. " No parent package change here
ls_data_sign-perminher = abap_true.
ls_data_sign-intfprefx = abap_true.
ls_data_sign-packtype = abap_true.
ls_data_sign-restricted = abap_true.
ls_data_sign-mainpack = abap_true.
ls_data_sign-srv_check = abap_true.
ls_data_sign-cli_check = abap_true.
ls_data_sign-ext_alias = abap_true.
ls_data_sign-project_guid = abap_true.
ls_data_sign-project_id = abap_true.
ls_data_sign-project_passdown = abap_true.
IF ls_package_data-ctext IS INITIAL.
ls_package_data-ctext = mv_local_devclass.
ENDIF.
IF ls_package_data-dlvunit IS INITIAL.
ls_package_data-dlvunit = 'HOME'.
ENDIF.
ls_package_data-as4user = cl_abap_syst=>get_user_name( ).
IF li_package IS BOUND.
" Package already exists, change it
set_lock( ii_package = li_package iv_lock = abap_true ).
li_package->set_all_attributes(
EXPORTING
i_package_data = ls_package_data
i_data_sign = ls_data_sign
EXCEPTIONS
object_not_changeable = 1
object_deleted = 2
object_invalid = 3
short_text_missing = 4
author_not_existing = 5
local_package = 6
software_component_invalid = 7
layer_invalid = 8
korrflag_invalid = 9
component_not_existing = 10
component_missing = 11
authorize_failure = 12
prefix_in_use = 13
unexpected_error = 14
intern_err = 15
wrong_mainpack_value = 16
superpackage_invalid = 17
OTHERS = 18 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
* " If the application component was cleared SET_ALL_ATTRIBUTES doesn't change it
* IF ls_package_data-component IS INITIAL AND li_package->application_component IS NOT INITIAL.
*
* ENDIF.
ELSE.
" Package does not exist yet, create it
" This shouldn't really happen, because the folder logic initially creates the packages.
cl_package_factory=>create_new_package(
IMPORTING
e_package = li_package
CHANGING
c_package_data = ls_package_data
EXCEPTIONS
object_already_existing = 1
object_just_created = 2
not_authorized = 3
wrong_name_prefix = 4
undefined_name = 5
reserved_local_name = 6
invalid_package_name = 7
short_text_missing = 8
software_component_invalid = 9
layer_invalid = 10
author_not_existing = 11
component_not_existing = 12
component_missing = 13
prefix_in_use = 14
unexpected_error = 15
intern_err = 16
no_access = 17
invalid_translation_depth = 18
wrong_mainpack_value = 19
superpackage_invalid = 20
* error_in_cts_checks = 21 downport, does not exist in 7.31
OTHERS = 22 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDIF.
" Load package interface usages
TRY.
io_xml->read(
EXPORTING
iv_name = 'PERMISSION'
CHANGING
cg_data = lt_usage_data ).
CATCH zcx_abapgit_exception ##NO_HANDLER.
" No permissions saved
ENDTRY.
LOOP AT lt_usage_data ASSIGNING <ls_usage_data>.
<ls_usage_data>-client_pak = mv_local_devclass.
ENDLOOP.
update_pinf_usages( ii_package = li_package
it_usage_data = lt_usage_data ).
ls_save_sign-pack = ls_save_sign-permis = ls_save_sign-elems = ls_save_sign-interf = abap_true.
li_package->save_generic(
EXPORTING
i_save_sign = ls_save_sign
EXCEPTIONS
cancelled_in_corr = 1
permission_failure = 2
object_not_changeable = 3
object_invalid = 4
OTHERS = 5 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
set_lock( ii_package = li_package iv_lock = abap_false ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
" Check remote package if deserialize has not been called before this
IF mv_local_devclass IS INITIAL.
rv_bool = abap_false.
ELSE.
cl_package_helper=>check_package_existence(
EXPORTING
i_package_name = mv_local_devclass
IMPORTING
e_package_exists = rv_bool
EXCEPTIONS
intern_err = 1
OTHERS = 2 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDIF.
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~jump.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = ms_item-obj_name
object_type = 'DEVC'
in_new_window = abap_true
EXCEPTIONS
not_executed = 1
invalid_object_type = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: ls_package_data TYPE scompkdtln,
li_package TYPE REF TO if_package,
lt_intf_usages TYPE tpak_permission_to_use_list,
lt_usage_data TYPE scomppdata,
ls_usage_data TYPE scomppdtln,
li_usage TYPE REF TO if_package_permission_to_use.
FIELD-SYMBOLS: <lg_field> TYPE any.
li_package = get_package( ).
IF li_package IS NOT BOUND.
zcx_abapgit_exception=>raise( |Could not find package to serialize.| ).
ENDIF.
li_package->get_all_attributes(
IMPORTING
e_package_data = ls_package_data
EXCEPTIONS
object_invalid = 1
package_deleted = 2
intern_err = 3
OTHERS = 4 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
CLEAR: ls_package_data-devclass,
ls_package_data-parentcl.
" Clear administrative data to prevent diffs
CLEAR: ls_package_data-created_by,
ls_package_data-created_on,
ls_package_data-changed_by,
ls_package_data-changed_on,
ls_package_data-as4user.
" Clear text descriptions that might be localized
CLEAR: ls_package_data-comp_text,
ls_package_data-dlvu_text,
ls_package_data-translation_depth_text,
ls_package_data-layer_text.
ASSIGN COMPONENT 'TRANSLATION_GRAPH_DEPTH_TEXT'
OF STRUCTURE ls_package_data
TO <lg_field>.
IF sy-subrc = 0.
CLEAR: <lg_field>.
ENDIF.
" Clear things related to local installation package
CLEAR: ls_package_data-namespace,
ls_package_data-dlvunit,
ls_package_data-pdevclass.
" Not usable on customer systems
CLEAR: ls_package_data-translation_depth.
ASSIGN COMPONENT 'TRANSLATION_GRAPH_DEPTH'
OF STRUCTURE ls_package_data
TO <lg_field>.
IF sy-subrc = 0.
CLEAR: <lg_field>.
ENDIF.
CLEAR: ls_package_data-korrflag.
io_xml->add( iv_name = 'DEVC' ig_data = ls_package_data ).
" Save package interface usages
li_package->get_permissions_to_use(
IMPORTING
e_permissions = lt_intf_usages
EXCEPTIONS
object_invalid = 1
unexpected_error = 2
OTHERS = 3 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
LOOP AT lt_intf_usages INTO li_usage.
li_usage->get_all_attributes(
IMPORTING
e_permission_data = ls_usage_data
EXCEPTIONS
object_invalid = 1
intern_err = 2
OTHERS = 3 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
CLEAR: ls_usage_data-pack_name, ls_usage_data-client_pak.
APPEND ls_usage_data TO lt_usage_data.
ENDLOOP.
IF lt_usage_data IS NOT INITIAL.
io_xml->add( iv_name = 'PERMISSION' ig_data = lt_usage_data ).
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
7959,
66,
5550,
20032,
17941,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
198,
220,
25261,
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,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
25,
198,
220,
220,
220,
220,
220,
6941,
62,
16624,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
30023,
9863,
2751,
318,
62,
9186,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16129,
41876,
7500,
292,
13,
198,
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,
62,
26495,
30826,
4261,
15871,
26173,
8924,
7,
380,
62,
26495,
8,
41876,
4526,
37,
5390,
611,
62,
26495,
198,
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,
11,
198,
220,
220,
220,
220,
220,
4296,
62,
79,
10745,
62,
385,
1095,
30023,
9863,
2751,
21065,
62,
26495,
220,
220,
220,
41876,
4526,
37,
5390,
611,
62,
26495,
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,
340,
62,
26060,
62,
7890,
41876,
629,
296,
381,
7890,
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,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
900,
62,
5354,
30023,
9863,
2751,
21065,
62,
26495,
41876,
4526,
37,
5390,
611,
62,
26495,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
5354,
220,
220,
220,
41876,
450,
499,
62,
30388,
198,
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,
198,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
285,
85,
62,
12001,
62,
7959,
4871,
41876,
1614,
4871,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
7206,
15922,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
318,
62,
9186,
220,
220,
220,
220,
796,
318,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16129,
796,
21628,
62,
16129,
6739,
198,
220,
220,
220,
285,
85,
62,
12001,
62,
7959,
4871,
796,
318,
62,
9186,
12,
7959,
4871,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
26495,
13,
198,
220,
220,
220,
16876,
502,
3784,
89,
361,
62,
397,
499,
18300,
62,
15252,
93,
1069,
1023,
7,
1267,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
537,
62,
26495,
62,
69,
9548,
14804,
2220,
62,
26495,
7,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
26495,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
285,
85,
62,
12001,
62,
7959,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
3174,
62,
260,
2220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
304,
62,
26495,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
374,
72,
62,
26495,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
1662,
62,
25687,
220,
220,
220,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10059,
62,
18224,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1788,
62,
8056,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
645,
62,
15526,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
604,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
24162,
62,
392,
62,
41771,
796,
642,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
718,
6739,
198,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
796,
352,
13,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
220,
220,
17852,
5188,
5064,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
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,
220,
220,
23578,
5064,
13,
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,
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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
] |
INTERFACE y_code_pal_version PUBLIC. "#EC CONS_INTF
CONSTANTS abap TYPE string VALUE '1.16.3' ##NO_TEXT.
ENDINTERFACE.
| [
41358,
49836,
331,
62,
8189,
62,
18596,
62,
9641,
44731,
13,
25113,
2943,
39537,
62,
1268,
10234,
198,
220,
7102,
2257,
1565,
4694,
450,
499,
41876,
4731,
26173,
8924,
705,
16,
13,
1433,
13,
18,
6,
22492,
15285,
62,
32541,
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
] |
CLASS zcl_abapgit_object_odso 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.
METHODS:
clear_field
IMPORTING
iv_fieldname TYPE string
CHANGING
cg_metadata TYPE any.
ENDCLASS.
CLASS zcl_abapgit_object_odso IMPLEMENTATION.
METHOD zif_abapgit_object~changed_by.
DATA: lv_dsonam TYPE c LENGTH 30,
ls_return TYPE bapiret2,
lr_details TYPE REF TO data.
FIELD-SYMBOLS: <lg_details> TYPE any,
<lg_tstpnm> TYPE any.
TRY.
CREATE DATA lr_details TYPE ('BAPI6116').
CATCH cx_sy_create_data_error.
zcx_abapgit_exception=>raise( |ODSO is not supported on this system| ).
ENDTRY.
ASSIGN lr_details->* TO <lg_details>.
lv_dsonam = ms_item-obj_name.
CALL FUNCTION 'BAPI_ODSO_GETDETAIL'
EXPORTING
odsobject = lv_dsonam
IMPORTING
details = <lg_details>
return = ls_return.
IF ls_return-type = 'E'.
zcx_abapgit_exception=>raise( |Error when geting changed by of ODSO: { ls_return-message }| ).
ENDIF.
ASSIGN COMPONENT 'TSTPNM' OF STRUCTURE <lg_details> TO <lg_tstpnm>.
rv_user = <lg_tstpnm>.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_odsonam TYPE c LENGTH 30,
lv_objname TYPE sobj_name,
lo_collection TYPE REF TO object,
lt_msg TYPE STANDARD TABLE OF bal_s_msg,
ls_msg TYPE bal_s_msg.
TRY.
CREATE OBJECT lo_collection TYPE ('CL_RSD_ODSO_COLLECTION').
CATCH cx_sy_create_data_error.
zcx_abapgit_exception=>raise( |ODSO is not supported on this system| ).
ENDTRY.
lv_odsonam = ms_item-obj_name.
lv_objname = ms_item-obj_name.
TRY.
CALL METHOD lo_collection->('ADD_TLOGO')
EXPORTING
i_objnm = lv_objname
i_modify = abap_true
i_delete = abap_true.
CALL METHOD lo_collection->('DELETE').
CALL METHOD ('CL_RSO_APPLICATION_LOG')=>('APPL_LOG_MSG_READ')
IMPORTING
e_t_msg = lt_msg.
READ TABLE lt_msg WITH KEY msgty = 'E' INTO ls_msg.
IF sy-subrc = 0.
zcx_abapgit_exception=>raise(
|Error when deleting ODSO: { ms_item-obj_name } { ls_msg-msgv1 } { ls_msg-msgv2 }| ).
ENDIF.
CATCH cx_rs_cancelled.
zcx_abapgit_exception=>raise( |Canceled deletion of ODSO: { ms_item-obj_name }| ).
CATCH cx_rs_existing.
zcx_abapgit_exception=>raise( |ODSO not exist: { ms_item-obj_name }| ).
CATCH cx_rs_not_found.
zcx_abapgit_exception=>raise( |ODSO not found: { ms_item-obj_name }| ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lv_dsonam TYPE c LENGTH 30,
lr_details TYPE REF TO data,
lr_infoobjects TYPE REF TO data,
lr_navigation TYPE REF TO data,
lr_indexes TYPE REF TO data,
lr_index_iobj TYPE REF TO data,
lt_return TYPE STANDARD TABLE OF bapiret2,
ls_return TYPE bapiret2.
FIELD-SYMBOLS:
<lg_details> TYPE any,
<lt_infoobjects> TYPE STANDARD TABLE,
<lt_navigation> TYPE STANDARD TABLE,
<lt_indexes> TYPE STANDARD TABLE,
<lt_index_iobj> TYPE STANDARD TABLE.
TRY.
CREATE DATA lr_details TYPE ('BAPI6116').
CREATE DATA lr_infoobjects TYPE STANDARD TABLE OF ('BAPI6116IO').
CREATE DATA lr_navigation TYPE STANDARD TABLE OF ('BAPI6116NA').
CREATE DATA lr_indexes TYPE STANDARD TABLE OF ('BAPI6116IN').
CREATE DATA lr_index_iobj TYPE STANDARD TABLE OF ('BAPI6116II').
CATCH cx_sy_create_data_error.
zcx_abapgit_exception=>raise( |ODSO is not supported on this system| ).
ENDTRY.
ASSIGN lr_details->* TO <lg_details>.
ASSIGN lr_infoobjects->* TO <lt_infoobjects>.
ASSIGN lr_navigation->* TO <lt_navigation>.
ASSIGN lr_indexes->* TO <lt_indexes>.
ASSIGN lr_index_iobj->* TO <lt_index_iobj>.
io_xml->read( EXPORTING iv_name = 'ODSO'
CHANGING cg_data = <lg_details> ).
io_xml->read( EXPORTING iv_name = 'INFOOBJECTS'
CHANGING cg_data = <lt_infoobjects> ).
io_xml->read( EXPORTING iv_name = 'NAVIGATION'
CHANGING cg_data = <lt_navigation> ).
io_xml->read( EXPORTING iv_name = 'INDEXES'
CHANGING cg_data = <lt_indexes> ).
io_xml->read( EXPORTING iv_name = 'INDEX_IOBJ'
CHANGING cg_data = <lt_index_iobj> ).
TRY.
CALL FUNCTION 'BAPI_ODSO_CREATE'
EXPORTING
details = <lg_details>
IMPORTING
odsobject = lv_dsonam
TABLES
infoobjects = <lt_infoobjects>
navigationattributes = <lt_navigation>
indexes = <lt_indexes>
indexesinfoobjects = <lt_index_iobj>
return = lt_return.
CATCH cx_sy_dyn_call_illegal_func.
zcx_abapgit_exception=>raise( |Necessary BW function modules not found or object not supported| ).
ENDTRY.
READ TABLE lt_return WITH KEY type = 'E' INTO ls_return.
IF sy-subrc = 0.
zcx_abapgit_exception=>raise( |Error when creating ODSO: { ls_return-message }| ).
ENDIF.
CALL FUNCTION 'BAPI_ODSO_ACTIVATE'
EXPORTING
odsobject = lv_dsonam
TABLES
return = lt_return.
READ TABLE lt_return WITH KEY type = 'E' INTO ls_return.
IF sy-subrc = 0.
zcx_abapgit_exception=>raise( |Error when activating ODSO: { ls_return-message }| ).
ENDIF.
tadir_insert( iv_package ).
corr_insert( iv_package ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_iobjnm TYPE c LENGTH 30.
SELECT SINGLE odsobject
FROM ('RSDODSO')
INTO lv_iobjnm
WHERE odsobject = 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.
DATA: lv_dsona TYPE c LENGTH 30,
lo_odso TYPE REF TO object,
lv_isact TYPE abap_bool.
lv_dsona = ms_item-obj_name.
CALL METHOD ('CL_RSD_ODSO')=>('FACTORY')
EXPORTING
i_odsobject = lv_dsona
RECEIVING
r_r_odso = lo_odso.
CALL METHOD lo_odso->('IS_ACTIVE')
RECEIVING
r_is_active = lv_isact.
rv_active = lv_isact.
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
DATA: lv_object TYPE eqegraarg.
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 = 'RSD_S_PROV'
iv_argument = lv_object ).
ENDMETHOD.
METHOD zif_abapgit_object~jump.
zcx_abapgit_exception=>raise( |Jump to ODSO is not yet supported| ).
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lv_dsonam TYPE c LENGTH 30,
lr_details TYPE REF TO data,
lr_infoobjects TYPE REF TO data,
lr_navigation TYPE REF TO data,
lr_indexes TYPE REF TO data,
lr_index_iobj TYPE REF TO data,
ls_return TYPE bapiret2.
FIELD-SYMBOLS:
<lg_details> TYPE any,
<lt_infoobjects> TYPE STANDARD TABLE,
<lt_navigation> TYPE STANDARD TABLE,
<lt_indexes> TYPE STANDARD TABLE,
<lt_index_iobj> TYPE STANDARD TABLE.
TRY.
CREATE DATA lr_details TYPE ('BAPI6116').
CREATE DATA lr_infoobjects TYPE STANDARD TABLE OF ('BAPI6116IO').
CREATE DATA lr_navigation TYPE STANDARD TABLE OF ('BAPI6116NA').
CREATE DATA lr_indexes TYPE STANDARD TABLE OF ('BAPI6116IN').
CREATE DATA lr_index_iobj TYPE STANDARD TABLE OF ('BAPI6116II').
CATCH cx_sy_create_data_error.
zcx_abapgit_exception=>raise( |ODSO is not supported on this system| ).
ENDTRY.
ASSIGN lr_details->* TO <lg_details>.
ASSIGN lr_infoobjects->* TO <lt_infoobjects>.
ASSIGN lr_navigation->* TO <lt_navigation>.
ASSIGN lr_indexes->* TO <lt_indexes>.
ASSIGN lr_index_iobj->* TO <lt_index_iobj>.
lv_dsonam = ms_item-obj_name.
CALL FUNCTION 'BAPI_ODSO_GETDETAIL'
EXPORTING
odsobject = lv_dsonam
IMPORTING
details = <lg_details>
return = ls_return
TABLES
infoobjects = <lt_infoobjects>
navigationattributes = <lt_navigation>
indexes = <lt_indexes>
indexesinfoobjects = <lt_index_iobj>.
IF ls_return-type = 'E'.
zcx_abapgit_exception=>raise( |Error when geting details of ODSO: { ls_return-message }| ).
ENDIF.
clear_field( EXPORTING iv_fieldname = 'TSTPNM'
CHANGING cg_metadata = <lg_details> ).
clear_field( EXPORTING iv_fieldname = 'TIMESTMP'
CHANGING cg_metadata = <lg_details> ).
clear_field( EXPORTING iv_fieldname = 'CONTTIMESTMP'
CHANGING cg_metadata = <lg_details> ).
clear_field( EXPORTING iv_fieldname = 'OWNER'
CHANGING cg_metadata = <lg_details> ).
io_xml->add( iv_name = 'ODSO'
ig_data = <lg_details> ).
io_xml->add( iv_name = 'INFOOBJECTS'
ig_data = <lt_infoobjects> ).
io_xml->add( iv_name = 'NAVIGATION'
ig_data = <lt_navigation> ).
io_xml->add( iv_name = 'INDEXES'
ig_data = <lt_indexes> ).
io_xml->add( iv_name = 'INDEX_IOBJ'
ig_data = <lt_index_iobj> ).
ENDMETHOD.
METHOD clear_field.
FIELD-SYMBOLS: <lg_field> TYPE data.
ASSIGN COMPONENT iv_fieldname
OF STRUCTURE cg_metadata
TO <lg_field>.
ASSERT sy-subrc = 0.
CLEAR: <lg_field>.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
375,
568,
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,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
1598,
62,
3245,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3245,
3672,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
70,
62,
38993,
220,
41876,
597,
13,
198,
10619,
31631,
13,
628,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
375,
568,
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,
300,
85,
62,
67,
1559,
321,
220,
41876,
269,
406,
49494,
1542,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
7783,
220,
41876,
275,
499,
557,
83,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
81,
62,
36604,
41876,
4526,
37,
5390,
1366,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
75,
70,
62,
36604,
29,
41876,
597,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
75,
70,
62,
83,
301,
79,
21533,
29,
220,
41876,
597,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
42865,
300,
81,
62,
36604,
41876,
19203,
33,
17614,
21,
18298,
27691,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
1837,
62,
17953,
62,
7890,
62,
18224,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
930,
3727,
15821,
318,
407,
4855,
319,
428,
1080,
91,
6739,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
220,
220,
24994,
16284,
300,
81,
62,
36604,
3784,
9,
5390,
1279,
75,
70,
62,
36604,
28401,
628,
220,
220,
220,
300,
85,
62,
67,
1559,
321,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
33,
17614,
62,
3727,
15821,
62,
18851,
35,
20892,
4146,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
16298,
568,
65,
752,
796,
300,
85,
62,
67,
1559,
321,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
3307,
220,
220,
796,
1279,
75,
70,
62,
36604,
29,
198,
220,
220,
220,
220,
220,
220,
220,
1441,
220,
220,
220,
796,
43979,
62,
7783,
13,
628,
220,
220,
220,
16876,
43979,
62,
7783,
12,
4906,
796,
705,
36,
4458,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
930,
12331,
618,
651,
278,
3421,
416,
286,
440,
5258,
46,
25,
1391,
43979,
62,
7783,
12,
20500,
1782,
91,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
24994,
16284,
24301,
1340,
3525,
705,
51,
2257,
13137,
44,
6,
3963,
19269,
18415,
11335,
1279,
75,
70,
62,
36604,
29,
5390,
1279,
75,
70,
62,
83,
301,
79,
21533,
28401,
628,
220,
220,
220,
374,
85,
62,
7220,
796,
1279,
75,
70,
62,
83,
301,
79,
21533,
28401,
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,
375,
1559,
321,
220,
220,
220,
41876,
269,
406,
49494,
1542,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
26801,
3672,
220,
220,
220,
41876,
27355,
73,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
43681,
41876,
4526,
37,
5390,
2134,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
19662,
220,
220,
220,
220,
220,
220,
220,
41876,
49053,
9795,
43679,
3963,
3652,
62,
82,
62,
19662,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
19662,
220,
220,
220,
220,
220,
220,
220,
41876,
3652,
62,
82,
62,
19662,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
2376,
62,
43681,
41876,
19203,
5097,
62,
6998,
35,
62,
3727,
15821,
62,
25154,
16779,
2849,
27691,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
1837,
62,
17953,
62,
7890,
62,
18224,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
930,
3727,
15821,
318,
407,
4855,
319,
428,
1080,
91,
6739,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
220,
220,
300,
85,
62,
375,
1559,
321,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
198,
220,
220,
220,
300,
85,
62,
26801,
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,
42815,
337,
36252,
2376,
62,
43681,
3784,
10786,
29266,
62,
14990,
7730,
46,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
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,
1,
1,
1,
1,
1
] |
*&---------------------------------------------------------------------*
*& Report zdemo_ain_cl14
*&---------------------------------------------------------------------*
*& This is the demo program written for book:
*& ALV grid in nutshell by Łukasz Pęgiel
*&---------------------------------------------------------------------*
report zdemo_ain_cl14.
include zdemo_ain_include_screen.
start-of-selection.
types: begin of t_data,
carrid type spfli-carrid,
connid type spfli-connid,
distance type spfli-distance,
distid type spfli-distid,
style type lvc_t_styl,
end of t_data.
data flights type standard table of t_data.
select * up to 50 rows from spfli into corresponding fields of table flights.
data(grid) = new cl_gui_alv_grid(
i_parent = new cl_gui_custom_container( container_name = 'CC' )
).
data(fcat) = value lvc_t_fcat(
( fieldname = 'CARRID' key = abap_true )
( fieldname = 'CONNID' )
( fieldname = 'DISTANCE' qfieldname = 'DISTID' )
( fieldname = 'DISTID' )
).
grid->set_table_for_first_display(
changing
it_fieldcatalog = fcat
it_outtab = flights
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4
).
if sy-subrc eq 0.
call screen 0100.
endif.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
1976,
9536,
78,
62,
391,
62,
565,
1415,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
770,
318,
262,
13605,
1430,
3194,
329,
1492,
25,
198,
9,
5,
8355,
53,
10706,
287,
43875,
416,
25370,
223,
2724,
292,
89,
350,
128,
247,
70,
8207,
198,
9,
5,
10097,
30934,
9,
198,
13116,
1976,
9536,
78,
62,
391,
62,
565,
1415,
13,
198,
198,
17256,
1976,
9536,
78,
62,
391,
62,
17256,
62,
9612,
13,
198,
198,
9688,
12,
1659,
12,
49283,
13,
628,
220,
3858,
25,
2221,
286,
256,
62,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1097,
6058,
220,
220,
2099,
599,
2704,
72,
12,
66,
3258,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
48260,
312,
220,
220,
2099,
599,
2704,
72,
12,
37043,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5253,
2099,
599,
2704,
72,
12,
30246,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1233,
312,
220,
220,
2099,
599,
2704,
72,
12,
17080,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3918,
220,
220,
220,
2099,
300,
28435,
62,
83,
62,
301,
2645,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
886,
286,
256,
62,
7890,
13,
198,
220,
1366,
13956,
2099,
3210,
3084,
286,
256,
62,
7890,
13,
628,
220,
2922,
1635,
510,
284,
2026,
15274,
422,
599,
2704,
72,
656,
11188,
7032,
286,
3084,
13956,
13,
628,
628,
220,
1366,
7,
25928,
8,
796,
649,
537,
62,
48317,
62,
282,
85,
62,
25928,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
8000,
796,
649,
537,
62,
48317,
62,
23144,
62,
34924,
7,
9290,
62,
3672,
796,
705,
4093,
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,
220,
220,
220,
6739,
198,
220,
1366,
7,
69,
9246,
8,
796,
1988,
300,
28435,
62,
83,
62,
69,
9246,
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,
220,
220,
220,
357,
2214,
3672,
796,
705,
20034,
49,
2389,
6,
220,
1994,
796,
450,
499,
62,
7942,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
2214,
3672,
796,
705,
10943,
45,
2389,
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,
220,
357,
2214,
3672,
796,
705,
35,
8808,
19240,
6,
10662,
3245,
3672,
796,
705,
35,
8808,
2389,
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,
220,
357,
2214,
3672,
796,
705,
35,
8808,
2389,
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,
6739,
628,
220,
10706,
3784,
2617,
62,
11487,
62,
1640,
62,
11085,
62,
13812,
7,
198,
220,
220,
220,
5609,
198,
220,
220,
220,
220,
220,
340,
62,
3245,
9246,
11794,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
277,
9246,
198,
220,
220,
220,
220,
220,
340,
62,
448,
8658,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
13956,
198,
220,
220,
220,
13269,
198,
220,
220,
220,
220,
220,
12515,
62,
17143,
2357,
62,
24011,
1883,
796,
352,
198,
220,
220,
220,
220,
220,
1430,
62,
18224,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
1165,
62,
21834,
62,
6615,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
513,
198,
220,
220,
220,
220,
220,
1854,
220,
220,
220,
220,
220,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_legacy03 DEFINITION
PUBLIC
FINAL
CREATE PRIVATE
GLOBAL FRIENDS /dmo/cl_flight_data_generat_03.
PUBLIC SECTION.
INTERFACES /dmo/if_flight_legacy03.
TYPES: BEGIN OF ENUM ty_change_mode STRUCTURE change_mode," Key checks are done separately
create,
update," Only fields that have been changed need to be checked
END OF ENUM ty_change_mode STRUCTURE change_mode.
CLASS-METHODS: get_instance RETURNING VALUE(ro_instance) TYPE REF TO /dmo/cl_flight_legacy03.
" With respect to the same method call of create/update/delete_travel() we have All or Nothing.
" I.e. when one of the levels contains an error, the complete call is refused.
" However, the buffer is not cleared in case of an error.
" I.e. when the caller wants to start over, he needs to call Initialize() explicitly.
METHODS set_status_to_booked IMPORTING iv_travel_id TYPE /dmo/travel_id03
EXPORTING et_messages TYPE /dmo/if_flight_legacy03=>tt_if_t100_message.
METHODS create_travel IMPORTING is_travel TYPE /dmo/if_flight_legacy03=>ts_travel_in
it_booking TYPE /dmo/if_flight_legacy03=>tt_booking_in OPTIONAL
it_booking_supplement TYPE /dmo/if_flight_legacy03=>tt_booking_supplement_in OPTIONAL
EXPORTING es_travel TYPE /dmo/travel03
et_booking TYPE /dmo/if_flight_legacy03=>tt_booking
et_booking_supplement TYPE /dmo/if_flight_legacy03=>tt_booking_supplement
et_messages TYPE /dmo/if_flight_legacy03=>tt_if_t100_message.
METHODS update_travel IMPORTING is_travel TYPE /dmo/if_flight_legacy03=>ts_travel_in
is_travelx TYPE /dmo/if_flight_legacy03=>ts_travel_inx
it_booking TYPE /dmo/if_flight_legacy03=>tt_booking_in OPTIONAL
it_bookingx TYPE /dmo/if_flight_legacy03=>tt_booking_inx OPTIONAL
it_booking_supplement TYPE /dmo/if_flight_legacy03=>tt_booking_supplement_in OPTIONAL
it_booking_supplementx TYPE /dmo/if_flight_legacy03=>tt_booking_supplement_inx OPTIONAL
EXPORTING es_travel TYPE /dmo/travel03
et_booking TYPE /dmo/if_flight_legacy03=>tt_booking
et_booking_supplement TYPE /dmo/if_flight_legacy03=>tt_booking_supplement
et_messages TYPE /dmo/if_flight_legacy03=>tt_if_t100_message.
METHODS delete_travel IMPORTING iv_travel_id TYPE /dmo/travel_id03
EXPORTING et_messages TYPE /dmo/if_flight_legacy03=>tt_if_t100_message.
METHODS get_travel IMPORTING iv_travel_id TYPE /dmo/travel_id03
iv_include_buffer TYPE abap_boolean
iv_include_temp_buffer TYPE abap_boolean OPTIONAL
EXPORTING es_travel TYPE /dmo/travel03
et_booking TYPE /dmo/if_flight_legacy03=>tt_booking
et_booking_supplement TYPE /dmo/if_flight_legacy03=>tt_booking_supplement
et_messages TYPE /dmo/if_flight_legacy03=>tt_if_t100_message.
METHODS save.
METHODS initialize.
METHODS convert_messages IMPORTING it_messages TYPE /dmo/if_flight_legacy03=>tt_if_t100_message
EXPORTING et_messages TYPE /dmo/if_flight_legacy03=>tt_message.
PROTECTED SECTION.
PRIVATE SECTION.
CLASS-DATA go_instance TYPE REF TO /dmo/cl_flight_legacy03.
CLASS-METHODS:
"! Calculation of Price <br/>
"! <br/>
"! Price will be calculated using distance multiplied and occupied seats.<br/>
"! Depending on how many seats in percentage are occupied the formula <br/>
"! 3/400·x² + 25<br/>
"! will be applied.<br/>
"! 0% seats occupied leads to 25% of distance as price.<br/>
"! 75% seats occupied leads to 50% of distance as price.<br/>
"! 100% seats occupied leads to 100% of distance as price.<br/>
"! @parameter iv_seats_occupied_percent | occupied seats
"! @parameter iv_flight_distance | flight distance in kilometer
"! @parameter rv_price | calculated flight price
calculate_flight_price
IMPORTING
iv_seats_occupied_percent TYPE /dmo/plane_seats_occupied03
iv_flight_distance TYPE i
RETURNING
VALUE(rv_price) TYPE /dmo/flight_price03 ##RELAX.
METHODS lock_travel IMPORTING iv_lock TYPE abap_bool
RAISING /dmo/cx_flight_legacy03 ##RELAX ##NEEDED.
METHODS _resolve_attribute IMPORTING iv_attrname TYPE scx_attrname
ix TYPE REF TO /dmo/cx_flight_legacy03
RETURNING VALUE(rv_symsgv) TYPE symsgv.
"! Final determinations / derivations after all levels have been prepared, e.g. bottom-up derivations
METHODS _determine EXPORTING et_messages TYPE /dmo/if_flight_legacy03=>tt_if_t100_message
CHANGING cs_travel TYPE /dmo/travel03
ct_booking TYPE /dmo/if_flight_legacy03=>tt_booking
ct_booking_supplement TYPE /dmo/if_flight_legacy03=>tt_booking_supplement.
METHODS _determine_travel_total_price CHANGING cs_travel TYPE /dmo/travel03
ct_booking TYPE /dmo/if_flight_legacy03=>tt_booking
ct_booking_supplement TYPE /dmo/if_flight_legacy03=>tt_booking_supplement
ct_messages TYPE /dmo/if_flight_legacy03=>tt_if_t100_message ##NEEDED.
METHODS _convert_currency IMPORTING iv_currency_code_source TYPE /dmo/currency_code03
iv_currency_code_target TYPE /dmo/currency_code03
iv_amount TYPE /dmo/total_price03
RETURNING VALUE(rv_amount) TYPE /dmo/total_price03.
ENDCLASS.
CLASS /dmo/cl_flight_legacy03 IMPLEMENTATION.
METHOD calculate_flight_price.
DATA: lv_percentage_of_max_price TYPE i.
lv_percentage_of_max_price = ( 3 * iv_seats_occupied_percent ** 2 DIV 400 ) + 25 ##OPERATOR[**].
rv_price = lv_percentage_of_max_price * iv_flight_distance DIV 100.
ENDMETHOD.
METHOD convert_messages.
CLEAR et_messages.
DATA ls_message TYPE symsg.
LOOP AT it_messages INTO DATA(lr_error) ##INTO_OK.
ls_message-msgty = 'E'.
ls_message-msgid = lr_error->t100key-msgid.
ls_message-msgno = lr_error->t100key-msgno.
IF lr_error IS INSTANCE OF /dmo/cx_flight_legacy03.
DATA(lx) = CAST /dmo/cx_flight_legacy03( lr_error ).
ls_message-msgv1 = _resolve_attribute( iv_attrname = lr_error->t100key-attr1 ix = lx ).
ls_message-msgv2 = _resolve_attribute( iv_attrname = lr_error->t100key-attr2 ix = lx ).
ls_message-msgv3 = _resolve_attribute( iv_attrname = lr_error->t100key-attr3 ix = lx ).
ls_message-msgv4 = _resolve_attribute( iv_attrname = lr_error->t100key-attr4 ix = lx ).
ENDIF.
APPEND ls_message TO et_messages.
ENDLOOP.
ENDMETHOD.
METHOD create_travel.
CLEAR: es_travel, et_booking, et_booking_supplement, et_messages.
" Travel
lcl_travel_buffer=>get_instance( )->cud_prep( EXPORTING it_travel = VALUE #( ( CORRESPONDING #( is_travel ) ) )
it_travelx = VALUE #( ( travel_id = is_travel-travel_id action_code = /dmo/if_flight_legacy03=>action_code-create ) )
IMPORTING et_travel = DATA(lt_travel)
et_messages = et_messages ).
IF et_messages IS INITIAL.
ASSERT lines( lt_travel ) = 1.
es_travel = lt_travel[ 1 ].
ENDIF.
" Bookings
IF et_messages IS INITIAL.
DATA lt_booking TYPE /dmo/if_flight_legacy03=>tt_booking.
DATA lt_bookingx TYPE /dmo/if_flight_legacy03=>tt_bookingx.
LOOP AT it_booking INTO DATA(ls_booking_in).
DATA ls_booking TYPE /dmo/booking03.
ls_booking = CORRESPONDING #( ls_booking_in ).
ls_booking-travel_id = es_travel-travel_id.
INSERT ls_booking INTO TABLE lt_booking.
INSERT VALUE #( travel_id = ls_booking-travel_id booking_id = ls_booking-booking_id action_code = /dmo/if_flight_legacy03=>action_code-create ) INTO TABLE lt_bookingx.
ENDLOOP.
lcl_booking_buffer=>get_instance( )->cud_prep( EXPORTING it_booking = lt_booking
it_bookingx = lt_bookingx
IMPORTING et_booking = et_booking
et_messages = DATA(lt_messages) ).
APPEND LINES OF lt_messages TO et_messages.
ENDIF.
" Booking Supplements
IF et_messages IS INITIAL.
DATA lt_booking_supplement TYPE /dmo/if_flight_legacy03=>tt_booking_supplement.
DATA lt_booking_supplementx TYPE /dmo/if_flight_legacy03=>tt_booking_supplementx.
LOOP AT it_booking_supplement INTO DATA(ls_booking_supplement_in).
DATA ls_booking_supplement TYPE /dmo/book_sup_03.
ls_booking_supplement = CORRESPONDING #( ls_booking_supplement_in ).
ls_booking_supplement-travel_id = es_travel-travel_id.
IF lcl_booking_buffer=>get_instance( )->check_booking_id( EXPORTING iv_travel_id = ls_booking_supplement-travel_id iv_booking_id = ls_booking_supplement-booking_id CHANGING ct_messages = et_messages ) = abap_false.
EXIT.
ENDIF.
INSERT ls_booking_supplement INTO TABLE lt_booking_supplement.
INSERT VALUE #( travel_id = ls_booking_supplement-travel_id
booking_id = ls_booking_supplement-booking_id
booking_supplement_id = ls_booking_supplement-booking_supplement_id
action_code = /dmo/if_flight_legacy03=>action_code-create ) INTO TABLE lt_booking_supplementx.
ENDLOOP.
IF et_messages IS INITIAL.
lcl_booking_supplement_buffer=>get_instance( )->cud_prep( EXPORTING it_booking_supplement = lt_booking_supplement
it_booking_supplementx = lt_booking_supplementx
IMPORTING et_booking_supplement = et_booking_supplement
et_messages = lt_messages ).
APPEND LINES OF lt_messages TO et_messages.
ENDIF.
ENDIF.
" Now do any derivations that require the whole business object (not only a single node), but which may in principle result in an error
IF et_messages IS INITIAL.
_determine( IMPORTING et_messages = et_messages
CHANGING cs_travel = es_travel
ct_booking = et_booking
ct_booking_supplement = et_booking_supplement ).
ENDIF.
IF et_messages IS INITIAL.
lcl_travel_buffer=>get_instance( )->cud_copy( ).
lcl_booking_buffer=>get_instance( )->cud_copy( ).
lcl_booking_supplement_buffer=>get_instance( )->cud_copy( ).
ELSE.
CLEAR: es_travel, et_booking, et_booking_supplement.
lcl_travel_buffer=>get_instance( )->cud_disc( ).
lcl_booking_buffer=>get_instance( )->cud_disc( ).
lcl_booking_supplement_buffer=>get_instance( )->cud_disc( ).
ENDIF.
ENDMETHOD.
METHOD delete_travel.
CLEAR et_messages.
get_travel( EXPORTING iv_travel_id = iv_travel_id
iv_include_buffer = abap_true
iv_include_temp_buffer = abap_true
IMPORTING et_booking = DATA(lt_booking)
et_booking_supplement = DATA(lt_booking_supplement)
et_messages = et_messages ).
IF et_messages IS INITIAL.
lcl_booking_supplement_buffer=>get_instance( )->cud_prep( EXPORTING it_booking_supplement = CORRESPONDING #( lt_booking_supplement MAPPING travel_id = travel_id
booking_id = booking_id
booking_supplement_id = booking_supplement_id EXCEPT * )
it_booking_supplementx = VALUE #( FOR ls_bs IN lt_booking_supplement ( action_code = /dmo/if_flight_legacy03=>action_code-delete
travel_id = ls_bs-travel_id
booking_id = ls_bs-booking_id
booking_supplement_id = ls_bs-booking_supplement_id ) )
iv_no_delete_check = abap_true " No existence check required
IMPORTING et_messages = DATA(lt_messages) ).
APPEND LINES OF lt_messages TO et_messages.
ENDIF.
IF et_messages IS INITIAL.
lcl_booking_buffer=>get_instance( )->cud_prep( EXPORTING it_booking = CORRESPONDING #( lt_booking MAPPING travel_id = travel_id booking_id = booking_id EXCEPT * )
it_bookingx = VALUE #( FOR ls_b IN lt_booking ( action_code = /dmo/if_flight_legacy03=>action_code-delete travel_id = ls_b-travel_id booking_id = ls_b-booking_id ) )
iv_no_delete_check = abap_true " No existence check required
IMPORTING et_messages = lt_messages ).
APPEND LINES OF lt_messages TO et_messages.
ENDIF.
IF et_messages IS INITIAL.
lcl_travel_buffer=>get_instance( )->cud_prep( EXPORTING it_travel = VALUE #( ( travel_id = iv_travel_id ) )
it_travelx = VALUE #( ( travel_id = iv_travel_id action_code = /dmo/if_flight_legacy03=>action_code-delete ) )
iv_no_delete_check = abap_true " No existence check required
IMPORTING et_messages = lt_messages ).
APPEND LINES OF lt_messages TO et_messages.
ENDIF.
IF et_messages IS INITIAL.
lcl_travel_buffer=>get_instance( )->cud_copy( ).
lcl_booking_buffer=>get_instance( )->cud_copy( ).
lcl_booking_supplement_buffer=>get_instance( )->cud_copy( ).
ELSE.
lcl_travel_buffer=>get_instance( )->cud_disc( ).
lcl_booking_buffer=>get_instance( )->cud_disc( ).
lcl_booking_supplement_buffer=>get_instance( )->cud_disc( ).
ENDIF.
ENDMETHOD.
METHOD get_instance.
go_instance = COND #( WHEN go_instance IS BOUND THEN go_instance ELSE NEW #( ) ).
ro_instance = go_instance.
ENDMETHOD.
METHOD get_travel.
CLEAR: es_travel, et_booking, et_booking_supplement, et_messages.
IF iv_travel_id IS INITIAL.
APPEND NEW /dmo/cx_flight_legacy03( textid = /dmo/cx_flight_legacy03=>travel_no_key ) TO et_messages.
RETURN.
ENDIF.
lcl_travel_buffer=>get_instance( )->get( EXPORTING it_travel = VALUE #( ( travel_id = iv_travel_id ) )
iv_include_buffer = iv_include_buffer
iv_include_temp_buffer = iv_include_temp_buffer
IMPORTING et_travel = DATA(lt_travel) ).
IF lt_travel IS INITIAL.
APPEND NEW /dmo/cx_flight_legacy03( textid = /dmo/cx_flight_legacy03=>travel_unknown travel_id = iv_travel_id ) TO et_messages.
RETURN.
ENDIF.
ASSERT lines( lt_travel ) = 1.
es_travel = lt_travel[ 1 ].
lcl_booking_buffer=>get_instance( )->get( EXPORTING it_booking = VALUE #( ( travel_id = iv_travel_id ) )
iv_include_buffer = iv_include_buffer
iv_include_temp_buffer = iv_include_temp_buffer
IMPORTING et_booking = et_booking ).
lcl_booking_supplement_buffer=>get_instance( )->get( EXPORTING it_booking_supplement = CORRESPONDING #( et_booking MAPPING travel_id = travel_id booking_id = booking_id EXCEPT * )
iv_include_buffer = iv_include_buffer
iv_include_temp_buffer = iv_include_temp_buffer
IMPORTING et_booking_supplement = et_booking_supplement ).
ENDMETHOD.
METHOD initialize.
lcl_travel_buffer=>get_instance( )->initialize( ).
lcl_booking_buffer=>get_instance( )->initialize( ).
lcl_booking_supplement_buffer=>get_instance( )->initialize( ).
ENDMETHOD.
METHOD lock_travel ##NEEDED.
* IF iv_lock = abap_true.
* CALL FUNCTION 'ENQUEUE_/DMO/ETRAVEL03'
* EXCEPTIONS
* foreign_lock = 1
* system_failure = 2
* OTHERS = 3.
* IF sy-subrc <> 0.
* RAISE EXCEPTION TYPE /dmo/cx_flight_legacy03
* EXPORTING
* textid = /dmo/cx_flight_legacy03=>travel_lock.
* ENDIF.
* ELSE.
* CALL FUNCTION 'DEQUEUE_/DMO/ETRAVEL03'.
* ENDIF.
ENDMETHOD.
METHOD save.
lcl_travel_buffer=>get_instance( )->save( ).
lcl_booking_buffer=>get_instance( )->save( ).
lcl_booking_supplement_buffer=>get_instance( )->save( ).
initialize( ).
ENDMETHOD.
METHOD set_status_to_booked.
lcl_travel_buffer=>get_instance( )->set_status_to_booked( EXPORTING iv_travel_id = iv_travel_id
IMPORTING et_messages = et_messages ).
ENDMETHOD.
METHOD update_travel.
CLEAR es_travel.
CLEAR et_booking.
CLEAR et_booking_supplement.
CLEAR et_messages.
" Travel
IF is_travel-travel_id IS INITIAL.
APPEND NEW /dmo/cx_flight_legacy03( textid = /dmo/cx_flight_legacy03=>travel_no_key ) TO et_messages.
RETURN.
ENDIF.
DATA ls_travelx TYPE /dmo/if_flight_legacy03=>ts_travelx.
ls_travelx = CORRESPONDING #( is_travelx ).
ls_travelx-action_code = /dmo/if_flight_legacy03=>action_code-update.
lcl_travel_buffer=>get_instance( )->cud_prep( EXPORTING it_travel = VALUE #( ( CORRESPONDING #( is_travel ) ) )
it_travelx = VALUE #( ( ls_travelx ) )
IMPORTING et_travel = DATA(lt_travel)
et_messages = et_messages ).
" We may need to delete Booking Supplements of deleted Bookings
" Read all Booking Supplements before any Bookings are deleted
get_travel( EXPORTING iv_travel_id = is_travel-travel_id
iv_include_buffer = abap_true
iv_include_temp_buffer = abap_true
IMPORTING et_booking_supplement = DATA(lt_booking_supplement_del) ).
" Bookings
IF et_messages IS INITIAL.
" Ignore provided Travel ID of subnode tables
DATA lt_booking TYPE /dmo/if_flight_legacy03=>tt_booking.
DATA lt_bookingx TYPE /dmo/if_flight_legacy03=>tt_bookingx.
LOOP AT it_booking INTO DATA(ls_booking_in).
DATA ls_booking TYPE /dmo/booking03.
ls_booking = CORRESPONDING #( ls_booking_in ).
ls_booking-travel_id = is_travel-travel_id.
INSERT ls_booking INTO TABLE lt_booking.
ENDLOOP.
LOOP AT it_bookingx INTO DATA(ls_booking_inx).
DATA ls_bookingx TYPE /dmo/if_flight_legacy03=>ts_bookingx.
ls_bookingx = CORRESPONDING #( ls_booking_inx ).
ls_bookingx-travel_id = is_travel-travel_id.
INSERT ls_bookingx INTO TABLE lt_bookingx.
ENDLOOP.
lcl_booking_buffer=>get_instance( )->cud_prep( EXPORTING it_booking = lt_booking
it_bookingx = lt_bookingx
IMPORTING et_booking = et_booking
et_messages = DATA(lt_messages) ).
APPEND LINES OF lt_messages TO et_messages.
ENDIF.
" Booking Supplements
IF et_messages IS INITIAL.
" Ignore provided Travel ID of subnode tables
DATA lt_booking_supplement TYPE /dmo/if_flight_legacy03=>tt_booking_supplement.
DATA lt_booking_supplementx TYPE /dmo/if_flight_legacy03=>tt_booking_supplementx.
LOOP AT it_booking_supplement INTO DATA(ls_booking_supplement_in).
DATA ls_booking_supplement TYPE /dmo/book_sup_03.
ls_booking_supplement = CORRESPONDING #( ls_booking_supplement_in ).
ls_booking_supplement-travel_id = is_travel-travel_id.
IF lcl_booking_buffer=>get_instance( )->check_booking_id( EXPORTING iv_travel_id = ls_booking_supplement-travel_id
iv_booking_id = ls_booking_supplement-booking_id
CHANGING ct_messages = et_messages ) = abap_false.
EXIT.
ENDIF.
INSERT ls_booking_supplement INTO TABLE lt_booking_supplement.
ENDLOOP.
IF et_messages IS INITIAL.
LOOP AT it_booking_supplementx INTO DATA(ls_booking_supplement_inx).
DATA ls_booking_supplementx TYPE /dmo/if_flight_legacy03=>ts_booking_supplementx.
ls_booking_supplementx = CORRESPONDING #( ls_booking_supplement_inx ).
ls_booking_supplementx-travel_id = is_travel-travel_id.
INSERT ls_booking_supplementx INTO TABLE lt_booking_supplementx.
ENDLOOP.
lcl_booking_supplement_buffer=>get_instance( )->cud_prep( EXPORTING it_booking_supplement = lt_booking_supplement
it_booking_supplementx = lt_booking_supplementx
IMPORTING et_booking_supplement = et_booking_supplement
et_messages = lt_messages ).
APPEND LINES OF lt_messages TO et_messages.
ENDIF.
ENDIF.
" For Bookings to be deleted we also need to delete the Booking Supplements
IF et_messages IS INITIAL
AND lt_booking_supplement_del IS NOT INITIAL
AND line_exists( lt_bookingx[ action_code = CONV /dmo/action_code03( /dmo/if_flight_legacy03=>action_code-delete ) ] ).
" Remove any Bookings from internal table that must not be deleted
LOOP AT lt_booking_supplement_del ASSIGNING FIELD-SYMBOL(<s_booking_supplement_del>).
READ TABLE lt_bookingx TRANSPORTING NO FIELDS WITH KEY action_code = CONV /dmo/action_code03( /dmo/if_flight_legacy03=>action_code-delete )
travel_id = <s_booking_supplement_del>-travel_id
booking_id = <s_booking_supplement_del>-booking_id.
IF sy-subrc <> 0.
DELETE lt_booking_supplement_del.
ENDIF.
ENDLOOP.
lcl_booking_supplement_buffer=>get_instance( )->cud_prep( EXPORTING it_booking_supplement = CORRESPONDING #( lt_booking_supplement_del MAPPING travel_id = travel_id
booking_id = booking_id
booking_supplement_id = booking_supplement_id EXCEPT * )
it_booking_supplementx = VALUE #( FOR ls_bs IN lt_booking_supplement_del ( action_code = /dmo/if_flight_legacy03=>action_code-delete
travel_id = ls_bs-travel_id
booking_id = ls_bs-booking_id
booking_supplement_id = ls_bs-booking_supplement_id ) )
iv_no_delete_check = abap_true " No existence check required
IMPORTING et_messages = et_messages ).
ENDIF.
IF et_messages IS INITIAL.
ASSERT lines( lt_travel ) = 1.
" Now do any derivations that require the whole business object (not only a single node), but which may in principle result in an error
" The derivation may need the complete Business Object, i.e. including unchanged subnodes
get_travel( EXPORTING iv_travel_id = lt_travel[ 1 ]-travel_id
iv_include_buffer = abap_true
iv_include_temp_buffer = abap_true
IMPORTING es_travel = es_travel
et_booking = et_booking
et_booking_supplement = et_booking_supplement
et_messages = et_messages ).
ASSERT et_messages IS INITIAL.
_determine( IMPORTING et_messages = et_messages
CHANGING cs_travel = es_travel
ct_booking = et_booking
ct_booking_supplement = et_booking_supplement ).
IF et_messages IS INITIAL.
" We do not want to return all subnodes, but only those that have been created or changed.
" So currently it is not implemented that a determination of a booking changes another booking as the other booking cannot be properly returned.
LOOP AT et_booking ASSIGNING FIELD-SYMBOL(<s_booking>).
LOOP AT it_bookingx TRANSPORTING NO FIELDS WHERE booking_id = <s_booking>-booking_id
AND ( action_code = CONV /dmo/action_code03( /dmo/if_flight_legacy03=>action_code-create ) OR action_code = CONV /dmo/action_code03( /dmo/if_flight_legacy03=>action_code-update ) ).
EXIT.
ENDLOOP.
IF sy-subrc <> 0.
DELETE et_booking.
ENDIF.
ENDLOOP.
LOOP AT et_booking_supplement ASSIGNING FIELD-SYMBOL(<s_booking_supplement>).
LOOP AT it_booking_supplementx TRANSPORTING NO FIELDS WHERE booking_id = <s_booking_supplement>-booking_id AND booking_supplement_id = <s_booking_supplement>-booking_supplement_id
AND ( action_code = CONV /dmo/action_code03( /dmo/if_flight_legacy03=>action_code-create ) OR action_code = CONV /dmo/action_code03( /dmo/if_flight_legacy03=>action_code-update ) ).
EXIT.
ENDLOOP.
IF sy-subrc <> 0.
DELETE et_booking_supplement.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
IF et_messages IS INITIAL.
lcl_travel_buffer=>get_instance( )->cud_copy( ).
lcl_booking_buffer=>get_instance( )->cud_copy( ).
lcl_booking_supplement_buffer=>get_instance( )->cud_copy( ).
ELSE.
CLEAR: es_travel, et_booking, et_booking_supplement.
lcl_travel_buffer=>get_instance( )->cud_disc( ).
lcl_booking_buffer=>get_instance( )->cud_disc( ).
lcl_booking_supplement_buffer=>get_instance( )->cud_disc( ).
ENDIF.
ENDMETHOD.
METHOD _convert_currency.
DATA(lv_exchange_rate_date) = cl_abap_context_info=>get_system_date( )." Do not buffer: Current date may change during lifetime of session
/dmo/cl_flight_amdp03=>convert_currency(
EXPORTING
iv_amount = iv_amount
iv_currency_code_source = iv_currency_code_source
iv_currency_code_target = iv_currency_code_target
iv_exchange_rate_date = lv_exchange_rate_date
IMPORTING
ev_amount = rv_amount
).
ENDMETHOD.
METHOD _determine.
ASSERT cs_travel-travel_id IS NOT INITIAL.
LOOP AT ct_booking TRANSPORTING NO FIELDS WHERE travel_id <> cs_travel-travel_id.
EXIT.
ENDLOOP.
ASSERT sy-subrc = 4.
LOOP AT ct_booking_supplement TRANSPORTING NO FIELDS WHERE travel_id <> cs_travel-travel_id.
EXIT.
ENDLOOP.
ASSERT sy-subrc = 4.
CLEAR et_messages.
_determine_travel_total_price( CHANGING cs_travel = cs_travel
ct_booking = ct_booking
ct_booking_supplement = ct_booking_supplement
ct_messages = et_messages ).
ENDMETHOD.
METHOD _determine_travel_total_price.
DATA lv_add TYPE /dmo/total_price03.
DATA(lv_currency_code_target) = cs_travel-currency_code.
" If we do not have a Travel Currency Code yet,
" we may derive it when all the subnodes have the same non-initial Currency Code
IF lv_currency_code_target IS INITIAL.
DATA lv_ok TYPE abap_bool.
lv_ok = abap_true.
LOOP AT ct_booking ASSIGNING FIELD-SYMBOL(<s_booking>).
IF sy-tabix = 1.
lv_currency_code_target = <s_booking>-currency_code.
ENDIF.
IF <s_booking>-currency_code IS INITIAL.
lv_ok = abap_false.
EXIT.
ENDIF.
IF lv_currency_code_target <> <s_booking>-currency_code.
lv_ok = abap_false.
EXIT.
ENDIF.
ENDLOOP.
IF lv_ok = abap_true.
LOOP AT ct_booking_supplement ASSIGNING FIELD-SYMBOL(<s_booking_supplement>).
IF <s_booking_supplement>-currency_code IS INITIAL.
lv_ok = abap_false.
EXIT.
ENDIF.
IF lv_currency_code_target <> <s_booking_supplement>-currency_code.
lv_ok = abap_false.
EXIT.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
IF lv_currency_code_target IS NOT INITIAL.
" Total Price = Booking Fee + Booking Flight Prices + Booking Supplement Prices
cs_travel-total_price = cs_travel-booking_fee.
cs_travel-currency_code = lv_currency_code_target.
LOOP AT ct_booking ASSIGNING <s_booking>
GROUP BY <s_booking>-currency_code INTO DATA(booking_currency_code).
lv_add = REDUCE #( INIT sum = 0
FOR b IN GROUP booking_currency_code
NEXT sum = sum + b-flight_price ).
IF booking_currency_code <> lv_currency_code_target.
lv_add = _convert_currency( iv_currency_code_source = booking_currency_code
iv_currency_code_target = lv_currency_code_target
iv_amount = lv_add ).
ENDIF.
cs_travel-total_price = cs_travel-total_price + lv_add.
ENDLOOP.
LOOP AT ct_booking_supplement ASSIGNING <s_booking_supplement>
GROUP BY <s_booking_supplement>-currency_code INTO DATA(supplement_currency_code).
lv_add = REDUCE #( INIT sum = 0
FOR s IN GROUP supplement_currency_code
NEXT sum = sum + s-price ).
IF supplement_currency_code <> lv_currency_code_target.
lv_add = _convert_currency( iv_currency_code_source = supplement_currency_code
iv_currency_code_target = lv_currency_code_target
iv_amount = lv_add ).
ENDIF.
cs_travel-total_price = cs_travel-total_price + lv_add.
ENDLOOP.
lcl_travel_buffer=>get_instance( )->cud_prep( EXPORTING it_travel = VALUE #( ( travel_id = cs_travel-travel_id total_price = cs_travel-total_price currency_code = cs_travel-currency_code ) )
it_travelx = VALUE #( ( action_code = /dmo/if_flight_legacy03=>action_code-update travel_id = cs_travel-travel_id total_price = abap_true currency_code = abap_true ) )
IMPORTING et_messages = DATA(lt_messages) ).
ASSERT lt_messages IS INITIAL.
ENDIF.
ENDMETHOD.
METHOD _resolve_attribute.
CLEAR rv_symsgv.
CASE iv_attrname.
WHEN ''.
rv_symsgv = ''.
WHEN 'MV_TRAVEL_ID'.
rv_symsgv = |{ ix->mv_travel_id ALPHA = OUT }|.
WHEN 'MV_BOOKING_ID'.
rv_symsgv = |{ ix->mv_booking_id ALPHA = OUT }|.
WHEN 'MV_BOOKING_SUPPLEMENT_ID'.
rv_symsgv = |{ ix->mv_booking_supplement_id ALPHA = OUT }|.
WHEN 'MV_AGENCY_ID'.
rv_symsgv = |{ ix->mv_agency_id ALPHA = OUT }|.
WHEN 'MV_CUSTOMER_ID'.
rv_symsgv = |{ ix->mv_customer_id ALPHA = OUT }|.
WHEN 'MV_CARRIER_ID'.
rv_symsgv = |{ ix->mv_carrier_id ALPHA = OUT }|.
WHEN 'MV_CONNECTION_ID'.
rv_symsgv = |{ ix->mv_connection_id ALPHA = OUT }|.
WHEN 'MV_SUPPLEMENT_ID'.
rv_symsgv = ix->mv_supplement_id.
WHEN 'MV_BEGIN_DATE'.
rv_symsgv = |{ ix->mv_begin_date DATE = USER }|.
WHEN 'MV_END_DATE'.
rv_symsgv = |{ ix->mv_end_date DATE = USER }|.
WHEN 'MV_BOOKING_DATE'.
rv_symsgv = |{ ix->mv_booking_date DATE = USER }|.
WHEN 'MV_FLIGHT_DATE'.
rv_symsgv = |{ ix->mv_flight_date DATE = USER }|.
WHEN 'MV_STATUS'.
rv_symsgv = ix->mv_status.
WHEN 'MV_CURRENCY_CODE'.
rv_symsgv = ix->mv_currency_code.
WHEN 'MV_UNAME'.
rv_symsgv = ix->mv_uname.
WHEN OTHERS.
ASSERT 1 = 2.
ENDCASE.
ENDMETHOD.
ENDCLASS.
| [
31631,
1220,
67,
5908,
14,
565,
62,
22560,
62,
1455,
1590,
3070,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
4810,
3824,
6158,
198,
220,
10188,
9864,
1847,
48167,
1677,
5258,
1220,
67,
5908,
14,
565,
62,
22560,
62,
7890,
62,
8612,
265,
62,
3070,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1220,
67,
5908,
14,
361,
62,
22560,
62,
1455,
1590,
3070,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
12964,
5883,
1259,
62,
3803,
62,
14171,
19269,
18415,
11335,
1487,
62,
14171,
553,
7383,
8794,
389,
1760,
13869,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2251,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4296,
553,
5514,
7032,
326,
423,
587,
3421,
761,
284,
307,
10667,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
12964,
5883,
1259,
62,
3803,
62,
14171,
19269,
18415,
11335,
1487,
62,
14171,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
25,
651,
62,
39098,
30826,
4261,
15871,
26173,
8924,
7,
305,
62,
39098,
8,
41876,
4526,
37,
5390,
1220,
67,
5908,
14,
565,
62,
22560,
62,
1455,
1590,
3070,
13,
628,
220,
220,
220,
366,
220,
220,
2080,
2461,
284,
262,
976,
2446,
869,
286,
2251,
14,
19119,
14,
33678,
62,
35927,
3419,
356,
423,
1439,
393,
10528,
13,
198,
220,
220,
220,
366,
220,
220,
314,
13,
68,
13,
618,
530,
286,
262,
2974,
4909,
281,
4049,
11,
262,
1844,
869,
318,
6520,
13,
198,
220,
220,
220,
366,
220,
220,
2102,
11,
262,
11876,
318,
407,
12539,
287,
1339,
286,
281,
4049,
13,
198,
220,
220,
220,
366,
220,
220,
314,
13,
68,
13,
618,
262,
24955,
3382,
284,
923,
625,
11,
339,
2476,
284,
869,
20768,
1096,
3419,
11777,
13,
628,
220,
220,
220,
337,
36252,
50,
900,
62,
13376,
62,
1462,
62,
2070,
276,
30023,
9863,
2751,
21628,
62,
35927,
62,
312,
41876,
1220,
67,
5908,
14,
35927,
62,
312,
3070,
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,
7788,
15490,
2751,
2123,
62,
37348,
1095,
220,
41876,
1220,
67,
5908,
14,
361,
62,
22560,
62,
1455,
1590,
3070,
14804,
926,
62,
361,
62,
83,
3064,
62,
20500,
13,
628,
220,
220,
220,
337,
36252,
50,
2251,
62,
35927,
30023,
9863,
2751,
318,
62,
35927,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
361,
62,
22560,
62,
1455,
1590,
3070,
14804,
912,
62,
35927,
62,
259,
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,
2070,
278,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
361,
62,
22560,
62,
1455,
1590,
3070,
14804,
926,
62,
2070,
278,
62,
259,
39852,
2849,
1847,
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,
2070,
278,
62,
18608,
1732,
41876,
1220,
67,
5908,
14,
361,
62,
22560,
62,
1455,
1590,
3070,
14804,
926,
62,
2070,
278,
62,
18608,
1732,
62,
259,
39852,
2849,
1847,
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,
7788,
15490,
2751,
1658,
62,
35927,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
35927,
3070,
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,
2123,
62,
2070,
278,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
361,
62,
22560,
62,
1455,
1590,
3070,
14804,
926,
62,
2070,
278,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2123,
62,
2070,
278,
62,
18608,
1732,
41876,
1220,
67,
5908,
14,
361,
62,
22560,
62,
1455,
1590,
3070,
14804,
926,
62,
2070,
278,
62,
18608,
1732,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2123,
62,
37348,
1095,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
361,
62,
22560,
62,
1455,
1590,
3070,
14804,
926,
62,
361,
62,
83,
3064,
62,
20500,
13,
198,
220,
220,
220,
337,
36252,
50,
4296,
62,
35927,
30023,
9863,
2751,
318,
62,
35927,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
361,
62,
22560,
62,
1455,
1590,
3070,
14804,
912,
62,
35927,
62,
259,
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,
35927,
87,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
361,
62,
22560,
62,
1455,
1590,
3070,
14804,
912,
62,
35927,
62,
28413,
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,
2070,
278,
220,
220,
220,
220,
220,
220,
220,
220,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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class ZCL_RETURN_TEST definition
public
create public .
public section.
types:
ty_table_type TYPE STANDARD TABLE OF usr02 WITH DEFAULT KEY .
methods CONSTRUCTOR
importing
!IV_ROWS type I .
methods EXPORTING
exporting
!ET_VALUES type TY_TABLE_TYPE .
methods RETURN_BY_VALUE
returning
value(RT_VALUES) type TY_TABLE_TYPE .
protected section.
private section.
data MV_ROWS type I .
ENDCLASS.
CLASS ZCL_RETURN_TEST IMPLEMENTATION.
METHOD constructor.
mv_rows = iv_rows.
ENDMETHOD.
METHOD exporting.
FIELD-SYMBOLS: <ls_value> LIKE LINE OF et_values.
DO mv_rows TIMES.
APPEND INITIAL LINE TO et_values ASSIGNING <ls_value>.
<ls_value>-bname = sy-index.
ENDDO.
ENDMETHOD.
METHOD return_by_value.
FIELD-SYMBOLS: <ls_value> LIKE LINE OF rt_values.
DO mv_rows TIMES.
APPEND INITIAL LINE TO rt_values ASSIGNING <ls_value>.
<ls_value>-bname = sy-index.
ENDDO.
* DATA: lt_values LIKE rt_values.
* DO 100000 TIMES.
* APPEND INITIAL LINE TO lt_values ASSIGNING <ls_value>.
* <ls_value>-bname = sy-index.
* ENDDO.
*
*break-point.
ENDMETHOD.
ENDCLASS.
| [
4871,
1168,
5097,
62,
26087,
27064,
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,
1259,
62,
11487,
62,
4906,
41876,
49053,
9795,
43679,
3963,
514,
81,
2999,
13315,
5550,
38865,
35374,
764,
628,
220,
5050,
7102,
46126,
1581,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
49,
22845,
2099,
314,
764,
198,
220,
5050,
7788,
15490,
2751,
198,
220,
220,
220,
39133,
198,
220,
220,
220,
220,
220,
5145,
2767,
62,
23428,
35409,
2099,
24412,
62,
38148,
62,
25216,
764,
198,
220,
5050,
30826,
27064,
62,
17513,
62,
39488,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
14181,
62,
23428,
35409,
8,
2099,
24412,
62,
38148,
62,
25216,
764,
198,
24326,
2665,
13,
198,
19734,
2665,
13,
628,
220,
1366,
32947,
62,
49,
22845,
2099,
314,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
26087,
27064,
62,
51,
6465,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
285,
85,
62,
8516,
796,
21628,
62,
8516,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
39133,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
8367,
29,
34178,
48920,
3963,
2123,
62,
27160,
13,
628,
220,
220,
220,
8410,
285,
85,
62,
8516,
31742,
1546,
13,
198,
220,
220,
220,
220,
220,
43504,
10619,
3268,
2043,
12576,
48920,
5390,
2123,
62,
27160,
24994,
3528,
15871,
1279,
7278,
62,
8367,
28401,
198,
220,
220,
220,
220,
220,
1279,
7278,
62,
8367,
29,
12,
65,
3672,
796,
827,
12,
9630,
13,
198,
220,
220,
220,
23578,
18227,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1441,
62,
1525,
62,
8367,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
8367,
29,
34178,
48920,
3963,
374,
83,
62,
27160,
13,
628,
220,
220,
220,
8410,
285,
85,
62,
8516,
31742,
1546,
13,
198,
220,
220,
220,
220,
220,
43504,
10619,
3268,
2043,
12576,
48920,
5390,
374,
83,
62,
27160,
24994,
3528,
15871,
1279,
7278,
62,
8367,
28401,
198,
220,
220,
220,
220,
220,
1279,
7278,
62,
8367,
29,
12,
65,
3672,
796,
827,
12,
9630,
13,
198,
220,
220,
220,
23578,
18227,
13,
198,
198,
9,
220,
220,
220,
42865,
25,
300,
83,
62,
27160,
34178,
374,
83,
62,
27160,
13,
198,
9,
220,
220,
220,
8410,
1802,
830,
31742,
1546,
13,
198,
9,
220,
220,
220,
220,
220,
43504,
10619,
3268,
2043,
12576,
48920,
5390,
300,
83,
62,
27160,
24994,
3528,
15871,
1279,
7278,
62,
8367,
28401,
198,
9,
220,
220,
220,
220,
220,
1279,
7278,
62,
8367,
29,
12,
65,
3672,
796,
827,
12,
9630,
13,
198,
9,
220,
220,
220,
23578,
18227,
13,
198,
9,
198,
9,
9032,
12,
4122,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_14 DEFINITION
PUBLIC
INHERITING FROM zcl_aoc_super
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor .
METHODS check
REDEFINITION .
METHODS get_attributes
REDEFINITION .
METHODS get_message_text
REDEFINITION .
METHODS put_attributes
REDEFINITION .
METHODS if_ci_test~query_attributes
REDEFINITION .
PROTECTED SECTION.
DATA mv_one_per_include TYPE sap_bool .
PRIVATE SECTION.
METHODS parse
IMPORTING
!it_commented TYPE string_table
!is_level TYPE slevel
!iv_line TYPE token_row
RETURNING
VALUE(rv_informed) TYPE abap_bool .
ENDCLASS.
CLASS ZCL_AOC_CHECK_14 IMPLEMENTATION.
METHOD check.
* abapOpenChecks
* https://github.com/larshp/abapOpenChecks
* MIT License
DATA: lt_code TYPE string_table,
lt_commented TYPE string_table,
lv_informed TYPE abap_bool,
lv_line TYPE token_row.
FIELD-SYMBOLS: <ls_level> LIKE LINE OF io_scan->levels,
<lv_code> LIKE LINE OF lt_code.
LOOP AT io_scan->levels ASSIGNING <ls_level> WHERE type = io_scan->gc_level-program.
lt_code = get_source( <ls_level> ).
LOOP AT lt_code ASSIGNING <lv_code>.
IF strlen( <lv_code> ) > 1 AND <lv_code>(1) = '*'.
IF lines( lt_commented ) = 0.
lv_line = sy-tabix.
ENDIF.
APPEND <lv_code>+1 TO lt_commented.
ELSE.
lv_informed = parse( it_commented = lt_commented
is_level = <ls_level>
iv_line = lv_line ).
CLEAR lt_commented.
IF lv_informed = abap_true AND mv_one_per_include = abap_true.
EXIT. " current loop
ENDIF.
ENDIF.
ENDLOOP.
IF lv_informed = abap_true AND mv_one_per_include = abap_true.
CONTINUE.
ENDIF.
parse( it_commented = lt_commented
is_level = <ls_level>
iv_line = lv_line ).
CLEAR lt_commented.
ENDLOOP.
ENDMETHOD.
METHOD constructor.
super->constructor( ).
version = '001'.
position = '014'.
has_attributes = abap_true.
attributes_ok = abap_true.
mv_one_per_include = abap_false.
enable_rfc( ).
ENDMETHOD.
METHOD get_attributes.
EXPORT
mv_errty = mv_errty
mv_one_per_include = mv_one_per_include
TO DATA BUFFER p_attributes.
ENDMETHOD.
METHOD get_message_text.
CLEAR p_text.
CASE p_code.
WHEN '001'.
p_text = 'Commented code'. "#EC NOTEXT
WHEN OTHERS.
super->get_message_text( EXPORTING p_test = p_test
p_code = p_code
IMPORTING p_text = p_text ).
ENDCASE.
ENDMETHOD. "GET_MESSAGE_TEXT
METHOD if_ci_test~query_attributes.
zzaoc_top.
zzaoc_fill_att mv_errty 'Error Type' ''. "#EC NOTEXT
zzaoc_fill_att mv_one_per_include 'One finding per include' 'C'. "#EC NOTEXT
zzaoc_popup.
ENDMETHOD.
METHOD parse.
DATA: lv_code LIKE LINE OF it_commented.
FIELD-SYMBOLS: <lv_commented> LIKE LINE OF it_commented.
IF lines( it_commented ) = 0.
RETURN.
ENDIF.
* skip auto generated INCLUDEs in function group top include
IF ( is_level-name CP 'LY*TOP' OR is_level-name CP 'LZ*TOP' )
AND lines( it_commented ) = 1.
READ TABLE it_commented INDEX 1 INTO lv_code.
ASSERT sy-subrc = 0.
IF lv_code CS 'INCLUDE L'.
RETURN.
ENDIF.
ENDIF.
LOOP AT it_commented ASSIGNING <lv_commented>.
IF strlen( <lv_commented> ) > 1 AND <lv_commented>(2) = '"*'.
RETURN.
ENDIF.
IF strlen( <lv_commented> ) > 0 AND <lv_commented>(1) = '*'.
RETURN.
ENDIF.
IF strlen( <lv_commented> ) > 4 AND <lv_commented>(5) = '-----'.
RETURN.
ENDIF.
IF strlen( <lv_commented> ) > 4 AND <lv_commented>(5) = ' ===='.
RETURN.
ENDIF.
IF strlen( <lv_commented> ) > 4 AND <lv_commented>(5) = '*****'.
RETURN.
ENDIF.
IF lines( it_commented ) = 1 AND <lv_commented> CO '. '.
RETURN.
ENDIF.
ENDLOOP.
IF zcl_aoc_parser=>run( it_commented )-match = abap_true.
inform( p_sub_obj_name = is_level-name
p_line = iv_line
p_kind = mv_errty
p_test = myname
p_code = '001' ).
rv_informed = abap_true.
ENDIF.
ENDMETHOD.
METHOD put_attributes.
IMPORT
mv_errty = mv_errty
mv_one_per_include = mv_one_per_include
FROM DATA BUFFER p_attributes. "#EC CI_USE_WANTED
ASSERT sy-subrc = 0.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
64,
420,
62,
9122,
62,
1415,
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,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
23772,
764,
628,
220,
220,
220,
337,
36252,
50,
2198,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
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,
651,
62,
20500,
62,
5239,
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,
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,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
42865,
285,
85,
62,
505,
62,
525,
62,
17256,
41876,
31841,
62,
30388,
764,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
21136,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
785,
12061,
220,
220,
220,
220,
220,
41876,
4731,
62,
11487,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
5715,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
3133,
626,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
1370,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
11241,
62,
808,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
35698,
8,
41876,
450,
499,
62,
30388,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
32,
4503,
62,
50084,
62,
1415,
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,
8189,
220,
220,
220,
220,
220,
41876,
4731,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
785,
12061,
41876,
4731,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
35698,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
1370,
220,
220,
220,
220,
220,
41876,
11241,
62,
808,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
5715,
29,
34178,
48920,
3963,
33245,
62,
35836,
3784,
46170,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
6780,
62,
8189,
29,
220,
34178,
48920,
3963,
300,
83,
62,
8189,
13,
628,
198,
220,
220,
220,
17579,
3185,
5161,
33245,
62,
35836,
3784,
46170,
24994,
3528,
15871,
1279,
7278,
62,
5715,
29,
33411,
2099,
796,
33245,
62,
35836,
3784,
36484,
62,
5715,
12,
23065,
13,
198,
220,
220,
220,
220,
220,
300,
83,
62,
8189,
796,
651,
62,
10459,
7,
1279,
7278,
62,
5715,
29,
6739,
628,
220,
220,
220,
220,
220,
17579,
3185,
5161,
300,
83,
62,
8189,
24994,
3528,
15871,
1279,
6780,
62,
8189,
28401,
628,
220,
220,
220,
220,
220,
220,
220,
16876,
965,
11925,
7,
1279,
6780,
62,
8189,
29,
1267,
1875,
352,
5357,
1279,
6780,
62,
8189,
33994,
16,
8,
796,
705,
9,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16876,
3951,
7,
300,
83,
62,
785,
12061,
1267,
796,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
1370,
796,
827,
12,
8658,
844,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43504,
10619,
1279,
6780,
62,
8189,
29,
10,
16,
5390,
300,
83,
62,
785,
12061,
13,
198,
220,
220,
220,
220,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
35698,
796,
21136,
7,
340,
62,
785,
12061,
796,
300,
83,
62,
785,
12061,
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,
318,
62,
5715,
220,
220,
220,
220,
796,
1279,
7278,
62,
5715,
29,
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,
21628,
62,
1370,
220,
220,
220,
220,
220,
796,
300,
85,
62,
1370,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30301,
1503,
300,
83,
62,
785,
12061,
13,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16876,
300,
85,
62,
35698,
796,
450,
499,
62,
7942,
5357,
285,
85,
62,
505,
62,
525,
62,
17256,
796,
450,
499,
62,
7942,
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,
23578,
5064,
13,
628,
220,
220,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
220,
220,
16876,
300,
85,
62,
35698,
796,
450,
499,
62,
7942,
5357,
285,
85,
62,
505,
62,
525,
62,
17256,
796,
450,
499,
62,
7942,
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,
21136,
7,
340,
62,
785,
12061,
796,
300,
83,
62,
785,
12061,
198,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
FUNCTION Z_IDOC_INPUT_FW.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(INPUT_METHOD) TYPE BDWFAP_PAR-INPUTMETHD
*" REFERENCE(MASS_PROCESSING) TYPE BDWFAP_PAR-MASS_PROC
*" EXPORTING
*" REFERENCE(WORKFLOW_RESULT) TYPE BDWFAP_PAR-RESULT
*" REFERENCE(APPLICATION_VARIABLE) TYPE BDWFAP_PAR-APPL_VAR
*" REFERENCE(IN_UPDATE_TASK) TYPE BDWFAP_PAR-UPDATETASK
*" REFERENCE(CALL_TRANSACTION_DONE) TYPE BDWFAP_PAR-CALLTRANS
*" TABLES
*" IDOC_CONTRL STRUCTURE EDIDC
*" IDOC_DATA STRUCTURE EDIDD
*" IDOC_STATUS STRUCTURE BDIDOCSTAT
*" RETURN_VARIABLES STRUCTURE BDWFRETVAR
*" SERIALIZATION_INFO STRUCTURE BDI_SER
*" EXCEPTIONS
*" WRONG_FUNCTION_CALLED
*"----------------------------------------------------------------------
************************************************************************
DATA:
lo_interface TYPE REF TO zcl_idoc_input,
ls_edidc LIKE LINE OF idoc_contrl,
ls_edids LIKE LINE OF idoc_status,
ls_ret_var LIKE LINE OF return_variables.
READ TABLE idoc_contrl INTO ls_edidc INDEX 1.
TRY.
lo_interface ?= zcl_idoc_input=>get_instance( iv_direction = ls_edidc-direct
iv_parnum = ls_edidc-sndprn
iv_partyp = ls_edidc-sndprt
iv_parfct = ls_edidc-sndpfc
iv_mestyp = ls_edidc-mestyp
iv_mescod = ls_edidc-mescod
iv_mesfct = ls_edidc-mesfct ).
lo_interface->execute_inbound(
EXPORTING
iv_input_method = input_method
iv_mass_processing = mass_processing
IMPORTING
ev_workflow_result = workflow_result
ev_application_variable = application_variable
ev_in_update_task = in_update_task
ev_call_transaction_done = call_transaction_done
CHANGING
ct_idoc_contrl = idoc_contrl[]
ct_idoc_data = idoc_data[]
ct_idoc_status = idoc_status[]
ct_return_variables = return_variables[]
ct_serialization_info = serialization_info[] ).
CATCH cx_sy_create_object_error.
* Issue error message
* 010(AD) - Error creating IDoc framework object for & &
ls_edids-docnum = ls_edidc-docnum.
ls_edids-status = zcl_idoc_base=>c_status_in_err.
ls_edids-msgty = zcl_idoc_base=>c_msg_type_error.
ls_edids-msgid = 'AD'.
ls_edids-msgno = '010'.
ls_edids-msgv1 = 'Error creating IDoc framework object for'.
ls_edids-msgv2 = ls_edidc-mestyp.
ls_edids-msgv3 = ls_edidc-mescod.
ls_edids-msgv4 = ls_edidc-mesfct.
APPEND ls_edids TO idoc_status.
* Set output values
workflow_result = zcl_idoc_base=>c_wf_result_err.
ls_ret_var-wf_param = zcl_idoc_base=>c_wf_param_err.
ls_ret_var-doc_number = ls_edidc-docnum.
APPEND ls_ret_var TO return_variables.
CATCH zcx_wrong_function_called .
RAISE wrong_function_called.
ENDTRY.
* Clear the static reference in base class
zcl_idoc_input=>free_instance( ).
ENDFUNCTION.
| [
42296,
4177,
2849,
1168,
62,
2389,
4503,
62,
1268,
30076,
62,
24160,
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,
1268,
30076,
62,
49273,
8,
41876,
220,
28023,
48397,
2969,
62,
27082,
12,
1268,
30076,
47123,
10227,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
44,
10705,
62,
4805,
4503,
7597,
2751,
8,
41876,
220,
28023,
48397,
2969,
62,
27082,
12,
44,
10705,
62,
4805,
4503,
198,
9,
1,
220,
7788,
15490,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
33249,
3697,
3913,
62,
19535,
16724,
8,
41876,
220,
28023,
48397,
2969,
62,
27082,
12,
19535,
16724,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
2969,
31484,
6234,
62,
53,
1503,
3539,
19146,
8,
41876,
220,
28023,
48397,
2969,
62,
27082,
12,
2969,
6489,
62,
53,
1503,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
1268,
62,
16977,
62,
51,
1921,
42,
8,
41876,
220,
28023,
48397,
2969,
62,
27082,
12,
52,
5760,
1404,
2767,
1921,
42,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
34,
7036,
62,
5446,
15037,
44710,
62,
35,
11651,
8,
41876,
220,
28023,
48397,
2969,
62,
27082,
12,
34,
7036,
5446,
15037,
198,
9,
1,
220,
309,
6242,
28378,
198,
9,
1,
220,
220,
220,
220,
220,
4522,
4503,
62,
10943,
5446,
43,
19269,
18415,
11335,
220,
8392,
2389,
34,
198,
9,
1,
220,
220,
220,
220,
220,
4522,
4503,
62,
26947,
19269,
18415,
11335,
220,
8392,
2389,
35,
198,
9,
1,
220,
220,
220,
220,
220,
4522,
4503,
62,
35744,
2937,
19269,
18415,
11335,
220,
28023,
2389,
4503,
35744,
198,
9,
1,
220,
220,
220,
220,
220,
30826,
27064,
62,
53,
1503,
3539,
9148,
1546,
19269,
18415,
11335,
220,
28023,
48397,
2200,
6849,
1503,
198,
9,
1,
220,
220,
220,
220,
220,
18871,
12576,
14887,
6234,
62,
10778,
19269,
18415,
11335,
220,
347,
17931,
62,
35009,
198,
9,
1,
220,
7788,
42006,
11053,
198,
9,
1,
220,
220,
220,
220,
220,
11342,
18494,
62,
42296,
4177,
2849,
62,
34,
7036,
1961,
198,
9,
1,
10097,
23031,
198,
17174,
17174,
4557,
198,
220,
42865,
25,
198,
220,
220,
220,
2376,
62,
39994,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
312,
420,
62,
15414,
11,
198,
220,
220,
220,
43979,
62,
276,
312,
66,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34178,
48920,
3963,
4686,
420,
62,
3642,
45895,
11,
198,
220,
220,
220,
43979,
62,
276,
2340,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34178,
48920,
3963,
4686,
420,
62,
13376,
11,
198,
220,
220,
220,
43979,
62,
1186,
62,
7785,
220,
220,
220,
220,
220,
220,
220,
34178,
48920,
3963,
1441,
62,
25641,
2977,
13,
628,
220,
20832,
43679,
4686,
420,
62,
3642,
45895,
39319,
43979,
62,
276,
312,
66,
24413,
6369,
352,
13,
198,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
2376,
62,
39994,
5633,
28,
1976,
565,
62,
312,
420,
62,
15414,
14804,
1136,
62,
39098,
7,
21628,
62,
37295,
220,
796,
43979,
62,
276,
312,
66,
12,
12942,
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,
21628,
62,
79,
1501,
388,
220,
220,
220,
220,
796,
43979,
62,
276,
312,
66,
12,
82,
358,
1050,
77,
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,
21628,
62,
3911,
4464,
220,
220,
220,
220,
796,
43979,
62,
276,
312,
66,
12,
82,
358,
1050,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
1845,
69,
310,
220,
220,
220,
220,
796,
43979,
62,
276,
312,
66,
12,
82,
358,
79,
16072,
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,
21628,
62,
76,
395,
4464,
220,
220,
220,
220,
796,
43979,
62,
276,
312,
66,
12,
76,
395,
4464,
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,
21628,
62,
76,
3798,
375,
220,
220,
220,
220,
796,
43979,
62,
276,
312,
66,
12,
76,
3798,
375,
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,
21628,
62,
6880,
69,
310,
220,
220,
220,
220,
796,
43979,
62,
276,
312,
66,
12,
6880,
69,
310,
6739,
628,
220,
220,
220,
220,
220,
2376,
62,
39994,
3784,
41049,
62,
259,
7784,
7,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
15414,
62,
24396,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
5128,
62,
24396,
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,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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,
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_view IMPLEMENTATION.
METHOD constructor.
CONSTANTS lc_width TYPE lvc_outlen VALUE 11.
CREATE DATA mr_table LIKE it_table.
map_status_to_icon( it_table = it_table
ir_table = mr_table ).
config_column( iv_column = 'NAME'
iv_width = 20 ).
config_column( iv_column = 'CLONE_URL'
iv_width = 60 ).
config_column( iv_column = 'PACKAGE'
iv_width = 25 ).
config_column( iv_column = 'LAYER'
iv_width = 5 ).
config_column( iv_column = 'CREATE_PACKAGE'
iv_width = 12 ).
config_column( iv_column = 'SKIP'
iv_width = lc_width ).
config_column( iv_column = 'DO_NOT_PURGE'
iv_width = lc_width ).
config_column( iv_column = 'CLONE'
iv_width = lc_width ).
config_column( iv_column = 'PULL'
iv_width = lc_width ).
config_column( iv_column = 'SYNTAX_CHECK'
iv_width = lc_width ).
config_column( iv_column = 'OBJECT_CHECK'
iv_width = lc_width ).
config_column( iv_column = 'CHECK_CREATE_TRANSPORT'
iv_width = lc_width ).
config_column( iv_column = 'PURGE'
iv_width = lc_width ).
config_column( iv_column = 'CHECK_DELETE_TRANSPORT'
iv_width = lc_width ).
config_column( iv_column = 'CHECK_LEFTOVERS'
iv_width = lc_width ).
config_column( iv_column = 'STATUS'
iv_width = lc_width ).
config_column( iv_column = 'DURATION'
iv_width = 10 ).
config_column( iv_column = 'MESSAGE'
iv_width = 80 ).
config_column( iv_column = 'DESCRIPTION'
iv_width = 60 ).
config_column( iv_column = 'TITLE'
iv_width = 120 ).
ENDMETHOD.
METHOD map_status_to_icon.
DATA: lr_line TYPE REF TO data.
FIELD-SYMBOLS:
<lt_table> TYPE table,
<lv_right> TYPE data,
<lv_left> TYPE data,
<lv_line> TYPE data.
ASSIGN ir_table->* TO <lt_table>.
ASSERT sy-subrc = 0.
DATA(components) = CAST cl_abap_structdescr(
CAST cl_abap_tabledescr(
cl_abap_tabledescr=>describe_by_data( it_table )
)->get_table_line_type( )
)->get_components( ).
LOOP AT it_table ASSIGNING FIELD-SYMBOL(<ls_line>).
CREATE DATA lr_line LIKE LINE OF <lt_table>.
ASSIGN lr_line->* TO <lv_line>.
LOOP AT components ASSIGNING FIELD-SYMBOL(<component>).
ASSIGN COMPONENT <component>-name
OF STRUCTURE <ls_line>
TO <lv_right>.
ASSERT sy-subrc = 0.
ASSIGN COMPONENT <component>-name
OF STRUCTURE <lv_line>
TO <lv_left>.
ASSERT sy-subrc = 0.
IF <component>-type->get_ddic_header( )-refname CS |STATUS|.
<lv_left> = SWITCH icon_d(
<lv_right>
WHEN zif_abapgit_ci_definitions=>co_status-ok THEN icon_checked
WHEN zif_abapgit_ci_definitions=>co_status-not_ok THEN icon_incomplete
WHEN zif_abapgit_ci_definitions=>co_status-undefined THEN icon_led_inactive
WHEN zif_abapgit_ci_definitions=>co_status-skipped THEN icon_total_right
ELSE icon_space ).
ELSE.
<lv_left> = <lv_right>.
ENDIF.
ENDLOOP.
INSERT <lv_line> INTO TABLE <lt_table>.
ENDLOOP.
ENDMETHOD.
METHOD config_column.
INSERT VALUE #( column = iv_column
width = iv_width )
INTO TABLE mt_column_width.
ENDMETHOD.
ENDCLASS.
CLASS lcl_alv IMPLEMENTATION.
METHOD constructor.
super->constructor( it_table = it_table ).
mo_container = io_container.
ENDMETHOD.
METHOD display.
DATA: ls_color TYPE lvc_s_colo.
FIELD-SYMBOLS: <lt_table> TYPE INDEX TABLE.
ASSIGN mr_table->* TO <lt_table>.
ASSERT sy-subrc = 0.
TRY.
cl_salv_table=>factory(
EXPORTING
r_container = mo_container
IMPORTING
r_salv_table = mo_alv
CHANGING
t_table = <lt_table> ).
mo_alv->get_selections( )->set_selection_mode( if_salv_c_selection_mode=>row_column ).
mo_alv->get_functions( )->set_all( ).
LOOP AT mt_column_width ASSIGNING FIELD-SYMBOL(<ls_column_width>).
TRY.
DATA(lo_column) = CAST cl_salv_column_table(
mo_alv->get_columns( )->get_column( <ls_column_width>-column ) ).
lo_column->set_output_length( <ls_column_width>-width ).
IF <ls_column_width>-column = |NAME| OR
<ls_column_width>-column = |PACKAGE| OR
<ls_column_width>-column = |DESCRIPTION|.
lo_column->set_key( ).
lo_column->set_optimized( ).
ENDIF.
IF <ls_column_width>-column = |SKIP| OR
<ls_column_width>-column = |CATEGORY|.
lo_column->set_technical( ).
lo_column->set_optimized( ).
ENDIF.
IF <ls_column_width>-column = |STATUS|.
ls_color-col = col_total.
lo_column->set_color( ls_color ).
ENDIF.
CATCH cx_salv_error.
CONTINUE.
ENDTRY.
ENDLOOP.
mo_alv->display( ).
CATCH cx_salv_error INTO DATA(lx_error).
zcx_abapgit_exception=>raise( iv_text = lx_error->get_text( )
ix_previous = lx_error ).
ENDTRY.
ENDMETHOD.
ENDCLASS.
CLASS lcl_list IMPLEMENTATION.
METHOD constructor.
super->constructor( it_table = it_table ).
mv_tabname = iv_tabname.
ENDMETHOD.
METHOD display.
DATA:
lt_fieldcat TYPE slis_t_fieldcat_alv,
ls_layout TYPE slis_layout_alv,
lt_events TYPE slis_t_event.
FIELD-SYMBOLS: <lt_table> TYPE STANDARD TABLE.
ASSIGN mr_table->* TO <lt_table>.
ASSERT sy-subrc = 0.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_structure_name = mv_tabname
CHANGING
ct_fieldcat = lt_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
LOOP AT lt_fieldcat ASSIGNING FIELD-SYMBOL(<ls_fieldcat>).
ASSIGN mt_column_width[ column = <ls_fieldcat>-fieldname ] TO FIELD-SYMBOL(<ls_column_width>).
IF sy-subrc = 0.
<ls_fieldcat>-outputlen = <ls_column_width>-width.
IF <ls_fieldcat>-fieldname = |NAME| OR
<ls_fieldcat>-fieldname = |PACKAGE| OR
<ls_fieldcat>-fieldname = |DESCRIPTION| OR
<ls_fieldcat>-fieldname = |TITLE|.
<ls_fieldcat>-key = abap_true.
ENDIF.
IF <ls_fieldcat>-fieldname = |SKIP| OR
<ls_fieldcat>-fieldname = |CATEGORY|.
<ls_fieldcat>-no_out = abap_true.
ENDIF.
ENDIF.
ENDLOOP.
ls_layout-box_tabname = 'ZABAPGIT_CI_RESULT'.
ls_layout-no_colhead = xsdbool( mv_tabname CS 'HEADER' ).
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = ls_layout
it_fieldcat = lt_fieldcat
i_tabname = mv_tabname
it_events = lt_events
TABLES
t_outtab = <lt_table>
EXCEPTIONS
program_error = 1
maximum_of_appends_reached = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
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,
198,
31631,
300,
565,
62,
1177,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
300,
66,
62,
10394,
41876,
300,
28435,
62,
448,
11925,
26173,
8924,
1367,
13,
628,
220,
220,
220,
29244,
6158,
42865,
285,
81,
62,
11487,
34178,
340,
62,
11487,
13,
628,
220,
220,
220,
3975,
62,
13376,
62,
1462,
62,
4749,
7,
340,
62,
11487,
796,
340,
62,
11487,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4173,
62,
11487,
796,
285,
81,
62,
11487,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
20608,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
1160,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
5097,
11651,
62,
21886,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
3126,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
47,
8120,
11879,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
1679,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
43,
4792,
1137,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
642,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
43387,
6158,
62,
47,
8120,
11879,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
1105,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
18831,
4061,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
300,
66,
62,
10394,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
18227,
62,
11929,
62,
47,
4261,
8264,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
300,
66,
62,
10394,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
5097,
11651,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
300,
66,
62,
10394,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
5105,
3069,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
300,
66,
62,
10394,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
23060,
45,
5603,
55,
62,
50084,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
300,
66,
62,
10394,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
9864,
23680,
62,
50084,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
300,
66,
62,
10394,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
50084,
62,
43387,
6158,
62,
5446,
1565,
4303,
9863,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
300,
66,
62,
10394,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
47,
4261,
8264,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
300,
66,
62,
10394,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
50084,
62,
7206,
2538,
9328,
62,
5446,
1565,
4303,
9863,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
300,
66,
62,
10394,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
50084,
62,
2538,
9792,
8874,
4877,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
300,
66,
62,
10394,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
35744,
2937,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
300,
66,
62,
10394,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
35,
4261,
6234,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
838,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
44,
1546,
4090,
8264,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
4019,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
30910,
40165,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
10394,
220,
796,
3126,
6739,
628,
220,
220,
220,
4566,
62,
28665,
7,
21628,
62,
28665,
796,
705,
49560
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
******************************************************************************
* Report : ZMSA_R_CHAPTER4_4
* Author : Pawel Grzeskowiak
* Email : [email protected]
* WWW : http://sapported.com
*----------------------------------------------------------------------------*
* Reading file from application server
******************************************************************************
* CHANGE HISTORY : (Latest change first, descending order) *
*----------------------------------------------------------------------------*
* AUTHOR | YYYYMMDD | Description *
*----------------------------------------------------------------------------*
* PawelGrzeskowiak | 20180720 | Initial Version
*----------------------------------------------------------------------------
REPORT zmsa_r_chapter4_4.
CLASS lcl_demo DEFINITION.
PUBLIC SECTION.
CLASS-METHODS main.
ENDCLASS.
CLASS lcl_demo IMPLEMENTATION.
METHOD main.
DATA: lv_file TYPE string VALUE 'testfile4_3.txt'.
DATA: lv_line TYPE string.
DATA: lt_data TYPE TABLE OF string.
OPEN DATASET lv_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
DO.
READ DATASET lv_file INTO lv_line.
IF sy-subrc = 0.
APPEND lv_line TO lt_data.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET lv_file.
cl_demo_output=>display_data( lt_data ).
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
lcl_demo=>main( ). | [
17174,
17174,
46068,
1174,
198,
9,
6358,
220,
1058,
1168,
44,
4090,
62,
49,
62,
41481,
19,
62,
19,
198,
9,
6434,
220,
1058,
35553,
417,
1902,
12271,
74,
322,
32994,
198,
9,
9570,
220,
220,
1058,
41827,
417,
13,
2164,
12271,
74,
322,
32994,
31,
14816,
13,
785,
198,
9,
13505,
54,
220,
220,
220,
220,
1058,
2638,
1378,
82,
1324,
9741,
13,
785,
198,
9,
10097,
10541,
9,
198,
9,
11725,
2393,
422,
3586,
4382,
198,
17174,
17174,
46068,
1174,
198,
9,
5870,
27746,
367,
42480,
1058,
357,
39478,
1487,
717,
11,
31491,
1502,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
10097,
10541,
9,
198,
9,
44746,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
575,
26314,
56,
12038,
16458,
930,
12489,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
10097,
10541,
9,
198,
9,
35553,
417,
8642,
12271,
74,
322,
32994,
930,
580,
1795,
23906,
930,
20768,
10628,
198,
9,
10097,
10541,
198,
2200,
15490,
1976,
907,
64,
62,
81,
62,
43582,
19,
62,
19,
13,
198,
198,
31631,
300,
565,
62,
9536,
78,
5550,
20032,
17941,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
1388,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
565,
62,
9536,
78,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
1388,
13,
198,
220,
220,
220,
42865,
25,
300,
85,
62,
7753,
41876,
4731,
26173,
8924,
705,
9288,
7753,
19,
62,
18,
13,
14116,
4458,
198,
220,
220,
220,
42865,
25,
300,
85,
62,
1370,
41876,
4731,
13,
198,
220,
220,
220,
42865,
25,
300,
83,
62,
7890,
41876,
43679,
3963,
4731,
13,
628,
220,
220,
220,
38303,
360,
1404,
1921,
2767,
300,
85,
62,
7753,
7473,
3268,
30076,
3268,
40383,
337,
16820,
412,
7792,
3727,
2751,
5550,
38865,
13,
628,
220,
220,
220,
8410,
13,
198,
220,
220,
220,
220,
220,
20832,
360,
1404,
1921,
2767,
300,
85,
62,
7753,
39319,
300,
85,
62,
1370,
13,
198,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
43504,
10619,
300,
85,
62,
1370,
5390,
300,
83,
62,
7890,
13,
198,
220,
220,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
2043,
13,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
18227,
13,
628,
220,
220,
220,
7852,
14058,
360,
1404,
1921,
2767,
300,
85,
62,
7753,
13,
628,
220,
220,
220,
537,
62,
9536,
78,
62,
22915,
14804,
13812,
62,
7890,
7,
300,
83,
62,
7890,
6739,
628,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198,
198,
2257,
7227,
12,
19238,
12,
46506,
2849,
13,
198,
220,
300,
565,
62,
9536,
78,
14804,
12417,
7,
6739
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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
] |
"! <p class="shorttext synchronized" lang="en">Value Help for CDS View fields</p>
CLASS zcl_dbbr_cds_field_value_help DEFINITION
PUBLIC
INHERITING FROM zcl_uitb_gui_modal_dialog
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS zif_uitb_gui_command_handler~execute_command
REDEFINITION.
"! <p class="shorttext synchronized" lang="en">CONSTRUCTOR</p>
METHODS constructor
IMPORTING
iv_entity TYPE ZSAT_CDS_VIEW_NAME
iv_field TYPE fieldname.
PROTECTED SECTION.
METHODS create_content
REDEFINITION.
PRIVATE SECTION.
DATA mo_main_splitter TYPE REF TO zcl_uitb_gui_splitter_cont.
DATA mv_cds_view TYPE ZSAT_CDS_VIEW_NAME.
DATA mo_filter_alv TYPE REF TO zcl_dbbr_f4_alv_filter.
DATA mv_fieldname TYPE fieldname.
ENDCLASS.
CLASS zcl_dbbr_cds_field_value_help IMPLEMENTATION.
METHOD constructor.
super->constructor( iv_title = |{ 'Value Help for ' }{ iv_entity }-{ iv_field }| ).
mv_cds_view = iv_entity.
mv_fieldname = iv_field.
ENDMETHOD.
METHOD create_content.
create_control_toolbar(
EXPORTING
io_parent = io_container
it_button = VALUE #(
( function = 'TAKE'
icon = icon_okay
quickinfo = |{ 'Transfer values' }| )
)
IMPORTING
eo_toolbar = DATA(mo_toolbar)
eo_client = DATA(lo_container)
).
mo_main_splitter = NEW zcl_uitb_gui_splitter_cont(
iv_elements = 2
iv_size = '30:70'
io_parent = lo_container
).
DATA(lo_filter_container) = mo_main_splitter->get_container( 1 ).
mo_filter_alv = NEW zcl_dbbr_f4_alv_filter(
io_parent = lo_filter_container
it_selfield = VALUE #( )
).
DATA(lo_alv_container) = mo_main_splitter->get_container( 2 ).
ENDMETHOD.
METHOD zif_uitb_gui_command_handler~execute_command.
ENDMETHOD.
ENDCLASS.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
11395,
10478,
329,
327,
5258,
3582,
7032,
3556,
79,
29,
198,
31631,
1976,
565,
62,
9945,
1671,
62,
66,
9310,
62,
3245,
62,
8367,
62,
16794,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
5013,
65,
62,
48317,
62,
4666,
282,
62,
38969,
519,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
1976,
361,
62,
5013,
65,
62,
48317,
62,
21812,
62,
30281,
93,
41049,
62,
21812,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
10943,
46126,
1581,
3556,
79,
29,
198,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
26858,
41876,
1168,
50,
1404,
62,
34,
5258,
62,
28206,
62,
20608,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3245,
220,
41876,
2214,
3672,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
2251,
62,
11299,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
6941,
62,
12417,
62,
22018,
1967,
41876,
4526,
37,
5390,
1976,
565,
62,
5013,
65,
62,
48317,
62,
22018,
1967,
62,
3642,
13,
198,
220,
220,
220,
42865,
285,
85,
62,
66,
9310,
62,
1177,
41876,
1168,
50,
1404,
62,
34,
5258,
62,
28206,
62,
20608,
13,
198,
220,
220,
220,
42865,
6941,
62,
24455,
62,
282,
85,
41876,
4526,
37,
5390,
1976,
565,
62,
9945,
1671,
62,
69,
19,
62,
282,
85,
62,
24455,
13,
198,
220,
220,
220,
42865,
285,
85,
62,
3245,
3672,
41876,
2214,
3672,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
9945,
1671,
62,
66,
9310,
62,
3245,
62,
8367,
62,
16794,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
2208,
3784,
41571,
273,
7,
21628,
62,
7839,
796,
930,
90,
705,
11395,
10478,
329,
705,
1782,
90,
21628,
62,
26858,
1782,
12,
90,
21628,
62,
3245,
1782,
91,
6739,
198,
220,
220,
220,
285,
85,
62,
66,
9310,
62,
1177,
796,
21628,
62,
26858,
13,
198,
220,
220,
220,
285,
85,
62,
3245,
3672,
796,
21628,
62,
3245,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
2251,
62,
11299,
13,
198,
220,
220,
220,
2251,
62,
13716,
62,
25981,
5657,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
8000,
220,
220,
220,
796,
33245,
62,
34924,
198,
220,
220,
220,
220,
220,
220,
220,
340,
62,
16539,
220,
220,
220,
796,
26173,
8924,
1303,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
2163,
220,
796,
705,
5603,
7336,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7196,
220,
220,
220,
220,
220,
796,
7196,
62,
482,
323,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2068,
10951,
796,
930,
90,
705,
43260,
3815,
6,
1782,
91,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
304,
78,
62,
25981,
5657,
220,
220,
796,
42865,
7,
5908,
62,
25981,
5657,
8,
198,
220,
220,
220,
220,
220,
220,
220,
304,
78,
62,
16366,
220,
220,
220,
796,
42865,
7,
5439,
62,
34924,
8,
198,
220,
220,
220,
6739,
628,
220,
220,
220,
6941,
62,
12417,
62,
22018,
1967,
796,
12682,
1976,
565,
62,
5013,
65,
62,
48317,
62,
22018,
1967,
62,
3642,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
68,
3639,
796,
362,
198,
220,
220,
220,
220,
220,
21628,
62,
7857,
220,
220,
220,
220,
796,
705,
1270,
25,
2154,
6,
198,
220,
220,
220,
220,
220,
33245,
62,
8000,
220,
220,
796,
2376,
62,
34924,
198,
220,
220,
220,
6739,
628,
220,
220,
220,
42865,
7,
5439,
62,
24455,
62,
34924,
8,
796,
6941,
62,
12417,
62,
22018,
1967,
3784,
1136,
62,
34924,
7,
352,
6739,
198,
220,
220,
220,
6941,
62,
24455,
62,
282,
85,
796,
12682,
1976,
565,
62,
9945,
1671,
62,
69,
19,
62,
282,
85,
62,
24455,
7,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
8000,
220,
220,
796,
2376,
62,
24455,
62,
34924,
198,
220,
220,
220,
220,
220,
220,
220,
340,
62,
944,
1164,
796,
26173,
8924,
1303,
7,
1267,
198,
220,
220,
220,
6739,
198,
220,
220,
220,
42865,
7,
5439,
62,
282,
85,
62,
34924,
8,
796,
6941,
62,
12417,
62,
22018,
1967,
3784,
1136,
62,
34924,
7,
362,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1976,
361,
62,
5013,
65,
62,
48317,
62,
21812,
62,
30281,
93,
41049,
62,
21812,
13,
628,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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
] |
CLASS zcl_aoc_check_86 DEFINITION
PUBLIC
INHERITING FROM zcl_aoc_super_root
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor .
METHODS get_message_text
REDEFINITION .
METHODS run
REDEFINITION .
METHODS consolidate_for_display
REDEFINITION .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_AOC_CHECK_86 IMPLEMENTATION.
METHOD consolidate_for_display.
DATA: ls_result LIKE LINE OF p_results,
lv_index TYPE i.
super->consolidate_for_display(
EXPORTING
p_sort_by_user = p_sort_by_user
p_sort_by_package = p_sort_by_package
p_sort_by_object = p_sort_by_object
CHANGING
p_results = p_results
p_results_hd = p_results_hd ).
READ TABLE p_results INTO ls_result WITH KEY test = myname.
IF sy-subrc = 0 AND ls_result-code = '002'.
* only keep one result if the database is not uploaded
lv_index = sy-tabix + 1.
DELETE p_results FROM lv_index WHERE test = myname.
ENDIF.
ENDMETHOD.
METHOD constructor.
super->constructor( ).
version = '001'.
position = '086'.
has_documentation = abap_true.
has_attributes = abap_true.
attributes_ok = abap_true.
has_display_consolidation = abap_true.
add_obj_type( c_type_program ).
add_obj_type( 'DOMA' ).
add_obj_type( 'DTEL' ).
add_obj_type( 'TABL' ).
add_obj_type( 'VIEW' ).
add_obj_type( 'TTYP' ).
add_obj_type( 'SHLP' ).
add_obj_type( 'WAPA' ).
ENDMETHOD.
METHOD get_message_text.
CLEAR p_text.
CASE p_code.
WHEN '001'.
p_text = 'Uses &1 &2, see note &3'. "#EC NOTEXT
WHEN '002'.
p_text = 'Load database via report ZAOC_UPLOAD_SIDB'. "#EC NOTEXT
WHEN OTHERS.
super->get_message_text( EXPORTING p_test = p_test
p_code = p_code
IMPORTING p_text = p_text ).
ENDCASE.
ENDMETHOD.
METHOD run.
* abapOpenChecks
* https://github.com/larshp/abapOpenChecks
* MIT License
DATA: lv_obj_type TYPE euobj-id,
lt_result TYPE STANDARD TABLE OF zaoc_sidb,
ls_result LIKE LINE OF lt_result,
lv_note TYPE string,
ls_sidb TYPE zaoc_sidb,
lt_environment TYPE senvi_tab.
* check zip is loaded
SELECT SINGLE * FROM zaoc_sidb INTO ls_sidb.
IF sy-subrc <> 0.
inform( p_test = myname
p_kind = c_note
p_code = '002' ).
RETURN.
ENDIF.
lv_obj_type = object_type.
CALL FUNCTION 'REPOSITORY_ENVIRONMENT_SET'
EXPORTING
obj_type = lv_obj_type
object_name = object_name
TABLES
environment = lt_environment
EXCEPTIONS
batch = 1
batchjob_error = 2
not_executed = 3
OTHERS = 4.
IF sy-subrc <> 0 OR lines( lt_environment ) = 0.
RETURN.
ENDIF.
SELECT * FROM zaoc_sidb
INTO TABLE lt_result
FOR ALL ENTRIES IN lt_environment
WHERE object_type = lt_environment-type(4)
AND object_name = lt_environment-object(40). "#EC CI_SUBRC
LOOP AT lt_result INTO ls_result.
lv_note = ls_result-note.
inform( p_test = myname
p_kind = mv_errty
p_code = '001'
p_param_1 = ls_result-object_type
p_param_2 = ls_result-object_name
p_param_3 = lv_note ).
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
64,
420,
62,
9122,
62,
4521,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
64,
420,
62,
16668,
62,
15763,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
23772,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
20500,
62,
5239,
198,
220,
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,
220,
23848,
36,
20032,
17941,
764,
198,
220,
220,
220,
337,
36252,
50,
38562,
62,
1640,
62,
13812,
198,
220,
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,
1168,
5097,
62,
32,
4503,
62,
50084,
62,
4521,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
38562,
62,
1640,
62,
13812,
13,
628,
220,
220,
220,
42865,
25,
43979,
62,
20274,
34178,
48920,
3963,
279,
62,
43420,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
9630,
220,
41876,
1312,
13,
628,
220,
220,
220,
2208,
3784,
5936,
10180,
378,
62,
1640,
62,
13812,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
30619,
62,
1525,
62,
7220,
220,
220,
220,
796,
279,
62,
30619,
62,
1525,
62,
7220,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
30619,
62,
1525,
62,
26495,
796,
279,
62,
30619,
62,
1525,
62,
26495,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
30619,
62,
1525,
62,
15252,
220,
796,
279,
62,
30619,
62,
1525,
62,
15252,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
43420,
220,
220,
220,
220,
220,
220,
220,
220,
796,
279,
62,
43420,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
43420,
62,
31298,
220,
220,
220,
220,
220,
796,
279,
62,
43420,
62,
31298,
6739,
628,
220,
220,
220,
20832,
43679,
279,
62,
43420,
39319,
43979,
62,
20274,
13315,
35374,
1332,
796,
616,
3672,
13,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
796,
657,
5357,
43979,
62,
20274,
12,
8189,
796,
705,
21601,
4458,
198,
9,
691,
1394,
530,
1255,
611,
262,
6831,
318,
407,
19144,
198,
220,
220,
220,
220,
220,
300,
85,
62,
9630,
796,
827,
12,
8658,
844,
1343,
352,
13,
198,
220,
220,
220,
220,
220,
5550,
2538,
9328,
279,
62,
43420,
16034,
300,
85,
62,
9630,
33411,
1332,
796,
616,
3672,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
2208,
3784,
41571,
273,
7,
6739,
628,
220,
220,
220,
2196,
220,
796,
705,
8298,
4458,
198,
220,
220,
220,
2292,
796,
705,
2919,
21,
4458,
628,
220,
220,
220,
468,
62,
22897,
341,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
468,
62,
1078,
7657,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
12608,
62,
482,
220,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
468,
62,
13812,
62,
5936,
10180,
341,
796,
450,
499,
62,
7942,
13,
628,
220,
220,
220,
751,
62,
26801,
62,
4906,
7,
269,
62,
4906,
62,
23065,
6739,
198,
220,
220,
220,
751,
62,
26801,
62,
4906,
7,
705,
39170,
32,
6,
6739,
198,
220,
220,
220,
751,
62,
26801,
62,
4906,
7,
705,
24544,
3698,
6,
6739,
198,
220,
220,
220,
751,
62,
26801,
62,
4906,
7,
705,
5603,
9148,
6,
6739,
198,
220,
220,
220,
751,
62,
26801,
62,
4906,
7,
705,
28206,
6,
6739,
198,
220,
220,
220,
751,
62,
26801,
62,
4906,
7,
705,
51,
9936,
47,
6,
6739,
198,
220,
220,
220,
751,
62,
26801,
62,
4906,
7,
705,
50,
6581,
47,
6,
6739,
198,
220,
220,
220,
751,
62,
26801,
62,
4906,
7,
705,
54,
2969,
32,
6,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
20500,
62,
5239,
13,
628,
220,
220,
220,
30301,
1503,
279,
62,
5239,
13,
628,
220,
220,
220,
42001,
279,
62,
8189,
13,
198,
220,
220,
220,
220,
220,
42099,
705,
8298,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
5239,
796,
705,
5842,
274,
1222,
16,
1222,
17,
11,
766,
3465,
1222,
18,
4458,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
42099,
705,
21601,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
5239,
796,
705,
8912,
6831,
2884,
989,
1168,
32,
4503,
62,
52,
6489,
41048,
62,
50,
2389,
33,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
42099,
440,
4221,
4877,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2208,
3784,
1136,
62,
20500,
62,
5239,
7,
7788,
15490,
2751,
279,
62,
9288,
796,
279,
62,
9288,
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,
279,
62,
8189,
796,
279,
62,
8189,
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,
30023,
9863,
2751,
279,
62,
5239,
796,
279,
62,
5239,
6739,
198,
220,
220,
220,
23578,
34,
11159,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1057,
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,
85,
62,
26801,
62,
4906,
220,
220,
220,
41876,
304,
84,
26801,
12,
312,
11,
198,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_more DEFINITION PUBLIC.
PUBLIC SECTION.
METHODS foobar RETURNING VALUE(moo) TYPE string.
ENDCLASS.
CLASS zcl_more IMPLEMENTATION.
METHOD foobar.
moo = 'moo'.
ENDMETHOD.
ENDCLASS. | [
31631,
1976,
565,
62,
3549,
5550,
20032,
17941,
44731,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
11511,
30973,
30826,
4261,
15871,
26173,
8924,
7,
76,
2238,
8,
41876,
4731,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
1976,
565,
62,
3549,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
11511,
30973,
13,
198,
220,
220,
220,
285,
2238,
796,
705,
76,
2238,
4458,
198,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*"* use this source file for the definition and implementation of
*"* local helper classes, interface definitions and type
*"* declarations
**********************************************************************
**********************************************************************
CLASS lcl_json_util IMPLEMENTATION.
METHOD class_constructor.
FIELD-SYMBOLS <lv_type> LIKE LINE OF mt_xsdboolean.
" Get all boolean types
SELECT rollname INTO TABLE mt_xsdboolean
FROM dd04l
WHERE ( domname = 'XSDBOOLEAN' OR domname = 'OS_BOOLEAN' ) AND as4local = 'A'.
" Add text for speed
LOOP AT mt_xsdboolean ASSIGNING <lv_type>.
CONCATENATE '\TYPE=' <lv_type> INTO <lv_type>.
ENDLOOP.
" Is standard table
SORT mt_xsdboolean BY table_line.
ENDMETHOD.
ENDCLASS.
**********************************************************************
**********************************************************************
CLASS lcl_salv_util IMPLEMENTATION.
METHOD _get_grid_from_salv.
DATA:
lo_grid_adapter TYPE REF TO cl_salv_grid_adapter,
lo_fs_adapter TYPE REF TO cl_salv_fullscreen_adapter,
lo_root TYPE REF TO cx_root.
IF io_salv->model <> if_salv_c_model=>table.
RAISE EXCEPTION TYPE cx_salv_msg
EXPORTING
msgid = '00'
msgno = '001'
msgty = 'E'
msgv1 = 'Incorrect SALV Type'.
ENDIF.
TRY.
lo_grid_adapter ?= io_salv->r_controller->r_adapter.
CATCH cx_root INTO lo_root.
"could be fullscreen adaptper
TRY .
lo_fs_adapter ?= io_salv->r_controller->r_adapter.
CATCH cx_root INTO lo_root.
RAISE EXCEPTION TYPE cx_salv_msg
EXPORTING
previous = lo_root
msgid = '00'
msgno = '001'
msgty = 'E'
msgv1 = 'Check PREVIOUS exception'.
ENDTRY.
ENDTRY.
IF lo_grid_adapter IS NOT INITIAL.
ro_gui_alv = lo_grid_adapter->get_grid( ).
ELSEIF lo_fs_adapter IS NOT INITIAL.
ro_gui_alv = lo_fs_adapter->get_grid( ).
ELSE.
RAISE EXCEPTION TYPE cx_salv_msg
EXPORTING
msgid = '00'
msgno = '001'
msgty = 'W'
msgv1 = 'Adapter is not bound yet'.
ENDIF.
ENDMETHOD.
ENDCLASS.
**********************************************************************
**********************************************************************
CLASS lcl_grid_util IMPLEMENTATION.
METHOD _get_grid_table.
rr_table = io_alv->mt_outtab.
ENDMETHOD.
ENDCLASS.
**********************************************************************
**********************************************************************
CLASS lcl_assert_util IMPLEMENTATION.
METHOD get_class_name.
" Let see >=7.02
SELECT SINGLE clsname INTO rv_class_name
FROM seoclass
WHERE clsname = 'CL_ABAP_UNIT_ASSERT'.
" Let see >=7.00 or even lower
IF rv_class_name IS INITIAL.
SELECT SINGLE clsname INTO rv_class_name
FROM seoclass
WHERE clsname = 'CL_AUNIT_ASSERT'.
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,
198,
17174,
17174,
2466,
1174,
198,
17174,
17174,
2466,
1174,
198,
198,
31631,
300,
565,
62,
17752,
62,
22602,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
1398,
62,
41571,
273,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
1279,
6780,
62,
4906,
29,
34178,
48920,
3963,
45079,
62,
87,
21282,
2127,
21052,
13,
628,
220,
220,
220,
366,
3497,
477,
25131,
3858,
198,
220,
220,
220,
33493,
4836,
3672,
39319,
43679,
45079,
62,
87,
21282,
2127,
21052,
198,
220,
220,
220,
16034,
49427,
3023,
75,
198,
220,
220,
220,
33411,
357,
2401,
3672,
796,
705,
55,
10305,
33,
6684,
2538,
1565,
6,
6375,
2401,
3672,
796,
705,
2640,
62,
33,
6684,
2538,
1565,
6,
1267,
5357,
355,
19,
12001,
796,
705,
32,
4458,
628,
220,
220,
220,
366,
3060,
2420,
329,
2866,
198,
220,
220,
220,
17579,
3185,
5161,
45079,
62,
87,
21282,
2127,
21052,
24994,
3528,
15871,
1279,
6780,
62,
4906,
28401,
198,
220,
220,
220,
220,
220,
39962,
1404,
1677,
6158,
705,
59,
25216,
11639,
1279,
6780,
62,
4906,
29,
39319,
1279,
6780,
62,
4906,
28401,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
366,
1148,
3210,
3084,
198,
220,
220,
220,
311,
9863,
45079,
62,
87,
21282,
2127,
21052,
11050,
3084,
62,
1370,
13,
198,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198,
198,
17174,
17174,
2466,
1174,
198,
17174,
17174,
2466,
1174,
198,
198,
31631,
300,
565,
62,
21680,
85,
62,
22602,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
4808,
1136,
62,
25928,
62,
6738,
62,
21680,
85,
13,
198,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
2376,
62,
25928,
62,
324,
3429,
41876,
4526,
37,
5390,
537,
62,
21680,
85,
62,
25928,
62,
324,
3429,
11,
198,
220,
220,
220,
220,
220,
2376,
62,
9501,
62,
324,
3429,
220,
220,
41876,
4526,
37,
5390,
537,
62,
21680,
85,
62,
12853,
9612,
62,
324,
3429,
11,
198,
220,
220,
220,
220,
220,
2376,
62,
15763,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
43213,
62,
15763,
13,
628,
220,
220,
220,
16876,
33245,
62,
21680,
85,
3784,
19849,
1279,
29,
611,
62,
21680,
85,
62,
66,
62,
19849,
14804,
11487,
13,
198,
220,
220,
220,
220,
220,
17926,
24352,
7788,
42006,
2849,
41876,
43213,
62,
21680,
85,
62,
19662,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
312,
796,
705,
405,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
3919,
796,
705,
8298,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
774,
796,
705,
36,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
85,
16,
796,
705,
818,
30283,
42475,
53,
5994,
4458,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
25928,
62,
324,
3429,
5633,
28,
33245,
62,
21680,
85,
3784,
81,
62,
36500,
3784,
81,
62,
324,
3429,
13,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
15763,
39319,
2376,
62,
15763,
13,
198,
220,
220,
220,
220,
220,
220,
220,
366,
24089,
307,
1336,
9612,
6068,
525,
198,
220,
220,
220,
220,
220,
220,
220,
7579,
56,
764,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
9501,
62,
324,
3429,
5633,
28,
33245,
62,
21680,
85,
3784,
81,
62,
36500,
3784,
81,
62,
324,
3429,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
15763,
39319,
2376,
62,
15763,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17926,
24352,
7788,
42006,
2849,
41876,
43213,
62,
21680,
85,
62,
19662,
198,
220,
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,
2180,
796,
2376,
62,
15763,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
312,
220,
220,
220,
796,
705,
405,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
3919,
220,
220,
220,
796,
705,
8298,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
774,
220,
220,
220,
796,
705,
36,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
85,
16,
220,
220,
220,
796,
705,
9787,
22814,
12861,
20958,
6631,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
23578,
40405,
13,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
220,
220,
16876,
2376,
62,
25928,
62,
324,
3429,
3180,
5626,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
686,
62,
48317,
62,
282,
85,
796,
2376,
62,
25928,
62,
324,
3429,
3784,
1136,
62,
25928,
7,
6739,
198,
220,
220,
220,
17852,
5188,
5064,
2376,
62,
9501,
62,
324,
3429,
3180,
5626,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
686,
62,
48317,
62,
282,
85,
796,
2376,
62,
9501,
62,
324,
3429,
3784,
1136,
62,
25928,
7,
6739,
198,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
17926,
24352,
7788,
42006,
2849,
41876,
43213,
62,
21680,
85,
62,
19662,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
312,
796,
705,
405,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
3919,
796,
705,
8298,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
774,
796,
705,
54,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
85,
16,
796,
705,
47307,
318,
407,
5421,
1865,
4458,
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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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 lcl_Test DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS ltcl_test DEFINITION FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS
FINAL.
PRIVATE SECTION.
* ================
DATA: mt_code TYPE string_table,
ms_result TYPE scirest_ad,
mo_check TYPE REF TO zcl_aoc_check_101.
METHODS:
setup,
export_import FOR TESTING,
test001_01 FOR TESTING,
test001_02 FOR TESTING,
test001_03 FOR TESTING RAISING cx_static_check,
test001_04 FOR TESTING RAISING cx_static_check,
test001_05 FOR TESTING RAISING cx_static_check,
test001_06 FOR TESTING RAISING cx_static_check,
test002_01 FOR TESTING RAISING cx_static_check,
test002_02 FOR TESTING RAISING cx_static_check,
test002_03 FOR TESTING RAISING cx_static_check,
test002_04 FOR TESTING RAISING cx_static_check,
test002_05 FOR TESTING RAISING cx_static_check.
ENDCLASS. "lcl_Test
*----------------------------------------------------------------------*
* CLASS lcl_Test IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS ltcl_test IMPLEMENTATION.
* ==============================
DEFINE _code.
APPEND &1 TO mt_code.
END-OF-DEFINITION.
METHOD setup.
CREATE OBJECT mo_check.
zcl_aoc_unit_test=>set_check( mo_check ).
ENDMETHOD. "setup
METHOD export_import.
zcl_aoc_unit_test=>export_import( mo_check ).
ENDMETHOD.
METHOD test001_01.
* ===========
_code 'IF foo IS NOT INITIAL.'.
_code ' foo = foo + 1.'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD. "test1
METHOD test001_02.
* ===========
cl_abap_unit_assert=>assert_initial( ms_result ).
_code 'IF NOT foo IS INITIAL.'.
_code ' foo = foo + 1.'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD. "test2
METHOD test001_03.
* ===========
cl_abap_unit_assert=>assert_initial( ms_result ).
_code 'IF foo IS NOT INITIAL AND NOT bar IS INITIAL.'.
_code ' foo = foo + 1.'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD. "test2
METHOD test001_04.
* ===========
_code 'IF NOT ( foo IS INITIAL ).'. "Not handled by check
_code ' foo = foo + 1.'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
METHOD test001_05.
* ===========
_code 'IF ( NOT foo IS INITIAL ).'.
_code ' foo = foo + 1.'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD.
METHOD test001_06.
* ===========
_code 'IF lines( foo ) > 1.'. "Not handled by check
_code ' bar = bar + 1.'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
METHOD test002_01.
* ===========
_code 'IF NOT line_exists( foo[ 1 ] ).'.
_code ' WRITE 1.'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
METHOD test002_02.
* ===========
_code 'IF NOT line_exists( foo[ bar = 1 ] ).'.
_code ' WRITE 1.'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
METHOD test002_03.
* ===========
_code 'IF NOT foo[ bar = 1 ]-var = 1.'.
_code ' WRITE 1.'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD.
METHOD test002_04.
* ===========
_code 'IF matches( val = <ls_token>-str regex = `^\w*\[$` ).'.
_code ' WRITE 1.'.
_code 'ENDIF.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
METHOD test002_05.
* ===========
_code 'if not line_exists( foo['.
_code ' var1 = 1'.
_code ' var2 = 2 ] ).'.
_code ' select * from mara into table lt_mara'.
_code ' where matnr = ls_matnr.'.
_code ' endif.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
ENDCLASS. "lcl_Test
| [
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
565,
62,
14402,
5550,
20032,
17941,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
31631,
300,
83,
565,
62,
9288,
5550,
20032,
17941,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
198,
220,
25261,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
9,
796,
25609,
18604,
628,
220,
220,
220,
42865,
25,
45079,
62,
8189,
220,
220,
41876,
4731,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13845,
62,
20274,
41876,
629,
557,
301,
62,
324,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6941,
62,
9122,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
9122,
62,
8784,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
220,
220,
10784,
62,
11748,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
486,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
2999,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
3070,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
3023,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
2713,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
3312,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
1332,
21601,
62,
486,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
1332,
21601,
62,
2999,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
1332,
21601,
62,
3070,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
1332,
21601,
62,
3023,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
1332,
21601,
62,
2713,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
198,
10619,
31631,
13,
220,
220,
220,
220,
220,
220,
366,
75,
565,
62,
14402,
198,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
565,
62,
14402,
30023,
2538,
10979,
6234,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
31631,
300,
83,
565,
62,
9288,
30023,
2538,
10979,
6234,
13,
198,
9,
36658,
25609,
28,
628,
220,
23449,
8881,
4808,
8189,
13,
198,
220,
220,
220,
43504,
10619,
1222,
16,
5390,
45079,
62,
8189,
13,
198,
220,
23578,
12,
19238,
12,
7206,
20032,
17941,
13,
628,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
6941,
62,
9122,
13,
198,
220,
220,
220,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
2617,
62,
9122,
7,
6941,
62,
9122,
6739,
198,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
40406,
628,
220,
337,
36252,
10784,
62,
11748,
13,
198,
220,
220,
220,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
39344,
62,
11748,
7,
6941,
62,
9122,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
8298,
62,
486,
13,
198,
9,
796,
2559,
855,
628,
220,
220,
220,
4808,
8189,
705,
5064,
22944,
3180,
5626,
3268,
2043,
12576,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
220,
22944,
796,
22944,
1343,
352,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
10619,
5064,
2637,
13,
628,
220,
220,
220,
13845,
62,
20274,
796,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
9122,
7,
45079,
62,
8189,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
36733,
7,
13845,
62,
20274,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9288,
16,
628,
220,
337,
36252,
1332,
8298,
62,
2999,
13,
198,
9,
796,
2559,
855,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
36733,
7,
13845,
62,
20274,
6739,
198,
220,
220,
220,
4808,
8189,
705,
5064,
5626,
22944,
3180,
3268,
2043,
12576,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
220,
22944,
796,
22944,
1343,
352,
2637,
13,
198,
220,
220,
220,
4808,
8189,
705,
10619,
5064,
2637,
13,
628,
220,
220,
220,
13845,
62,
20274,
796,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
9122,
7,
45079,
62,
8189,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
1033,
796,
705,
8298,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
719,
796,
13845,
62,
20274,
12,
8189,
6739,
628,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9288,
17,
628,
220,
337,
36252,
1332,
8298,
62,
3070,
13,
198,
9,
796,
2559,
855,
628,
220,
220,
220,
537,
62,
397,
499
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS ZCL_DBBR_addtext_importer DEFINITION
PUBLIC
INHERITING FROM ZCL_uitb_generic_importer
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor.
PROTECTED SECTION.
METHODS: create_internal_table_ref REDEFINITION,
write_no_data_found_message REDEFINITION,
process_import_data REDEFINITION,
persist_import_data REDEFINITION,
write_start_message REDEFINITION.
PRIVATE SECTION.
data mr_addtext_f type ref to ZCL_DBBR_addtext_factory.
ENDCLASS.
CLASS ZCL_DBBR_addtext_importer IMPLEMENTATION.
METHOD constructor.
super->constructor( 'SE16N-Advanced-AdditionalTexts' ).
mr_addtext_f = NEW ZCL_DBBR_addtext_factory( ).
ENDMETHOD.
METHOD create_internal_table_ref.
rr_table_ref = NEW ZDBBR_addtext_itab( ).
ENDMETHOD.
METHOD write_no_data_found_message.
MESSAGE w020(ZDBBR_exception) INTO DATA(lv_dummy).
mr_log->add_from_sy(
if_newobj = abap_false
iv_level = zif_uitb_c_protocol_level=>warning
).
ENDMETHOD.
METHOD process_import_data.
ASSIGN CAST ZDBBR_addtext_itab( mr_import_data )->* TO FIELD-SYMBOL(<lt_addtexts>).
LOOP AT <lt_addtexts> ASSIGNING FIELD-SYMBOL(<ls_addtext>).
IF mr_addtext_f->exists_for_bus_key(
iv_id_table = <ls_addtext>-id_table
iv_id_field1 = <ls_addtext>-id_field
iv_id_field2 = <ls_addtext>-id_field2
iv_cond_field = <ls_addtext>-condition_field
iv_cond_value = <ls_addtext>-condition_value
iv_cond_operation = <ls_addtext>-condition_op ).
DATA(lv_bus_key) = <ls_addtext>-id_table && ',' &&
<ls_addtext>-id_field && ',' &&
<ls_addtext>-id_field2 && ',' &&
<ls_addtext>-condition_field && ',' &&
<ls_addtext>-condition_value && ',' &&
<ls_addtext>-condition_op.
ZCL_SAT_MESSAGE_HELPER=>split_string_for_message(
EXPORTING
iv_string = lv_bus_key
IMPORTING
ev_msgv1 = DATA(lv_msgv1)
ev_msgv2 = DATA(lv_msgv2)
ev_msgv3 = DATA(lv_msgv3)
ev_msgv4 = DATA(lv_msgv4)
).
MESSAGE w040(ZDBBR_exception) WITH lv_msgv1 lv_msgv2 lv_msgv3 lv_msgv4 INTO DATA(lv_exists_msg).
mr_log->add_from_sy( if_newobj = abap_false
iv_level = zif_uitb_c_protocol_level=>warning ).
DELETE <lt_addtexts>.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD persist_import_data.
LOOP AT CAST ZDBBR_addtext_itab( mr_import_data )->* ASSIGNING FIELD-SYMBOL(<ls_addtext>).
mr_addtext_f->save_add_text(
CHANGING cs_addtext_data = <ls_addtext>
).
ENDLOOP.
ENDMETHOD.
METHOD write_start_message.
MESSAGE i050(ZDBBR_info) WITH 'Zusatztexten' INTO DATA(lv_dummy).
mr_log->add_from_sy( if_newobj = abap_false
iv_level = zif_uitb_c_protocol_level=>success ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1168,
5097,
62,
11012,
11473,
62,
2860,
5239,
62,
320,
26634,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1168,
5097,
62,
5013,
65,
62,
41357,
62,
320,
26634,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
23772,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
2251,
62,
32538,
62,
11487,
62,
5420,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
3551,
62,
3919,
62,
7890,
62,
9275,
62,
20500,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
1429,
62,
11748,
62,
7890,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
21160,
62,
11748,
62,
7890,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
3551,
62,
9688,
62,
20500,
23848,
36,
20032,
17941,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
1366,
285,
81,
62,
2860,
5239,
62,
69,
2099,
1006,
284,
1168,
5097,
62,
11012,
11473,
62,
2860,
5239,
62,
69,
9548,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
11012,
11473,
62,
2860,
5239,
62,
320,
26634,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
705,
5188,
1433,
45,
12,
28809,
12,
17699,
8206,
82,
6,
6739,
628,
220,
220,
220,
285,
81,
62,
2860,
5239,
62,
69,
796,
12682,
1168,
5097,
62,
11012,
11473,
62,
2860,
5239,
62,
69,
9548,
7,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
2251,
62,
32538,
62,
11487,
62,
5420,
13,
198,
220,
220,
220,
374,
81,
62,
11487,
62,
5420,
796,
12682,
1168,
11012,
11473,
62,
2860,
5239,
62,
270,
397,
7,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
3551,
62,
3919,
62,
7890,
62,
9275,
62,
20500,
13,
198,
220,
220,
220,
337,
1546,
4090,
8264,
266,
33618,
7,
57,
11012,
11473,
62,
1069,
4516,
8,
39319,
42865,
7,
6780,
62,
67,
13513,
737,
198,
220,
220,
220,
285,
81,
62,
6404,
3784,
2860,
62,
6738,
62,
1837,
7,
198,
220,
220,
220,
220,
220,
220,
220,
611,
62,
3605,
26801,
796,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
5715,
220,
796,
1976,
361,
62,
5013,
65,
62,
66,
62,
11235,
4668,
62,
5715,
14804,
43917,
198,
220,
220,
220,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1429,
62,
11748,
62,
7890,
13,
198,
220,
220,
220,
24994,
16284,
327,
11262,
1168,
11012,
11473,
62,
2860,
5239,
62,
270,
397,
7,
285,
81,
62,
11748,
62,
7890,
1267,
3784,
9,
5390,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
2528,
62,
2860,
5239,
82,
29,
737,
628,
220,
220,
220,
17579,
3185,
5161,
1279,
2528,
62,
2860,
5239,
82,
29,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
7278,
62,
2860,
5239,
29,
737,
198,
220,
220,
220,
220,
220,
16876,
285,
81,
62,
2860,
5239,
62,
69,
3784,
1069,
1023,
62,
1640,
62,
10885,
62,
2539,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
312,
62,
11487,
220,
220,
220,
220,
220,
220,
796,
1279,
7278,
62,
2860,
5239,
29,
12,
312,
62,
11487,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
312,
62,
3245,
16,
220,
220,
220,
220,
220,
796,
1279,
7278,
62,
2860,
5239,
29,
12,
312,
62,
3245,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
312,
62,
3245,
17,
220,
220,
220,
220,
220,
796,
1279,
7278,
62,
2860,
5239,
29,
12,
312,
62,
3245,
17,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
17561,
62,
3245,
220,
220,
220,
220,
796,
1279,
7278,
62,
2860,
5239,
29,
12,
31448,
62,
3245,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
17561,
62,
8367,
220,
220,
220,
220,
796,
1279,
7278,
62,
2860,
5239,
29,
12,
31448,
62,
8367,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
17561,
62,
27184,
796,
1279,
7278,
62,
2860,
5239,
29,
12,
31448,
62,
404,
6739,
628,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
6780,
62,
10885,
62,
2539,
8,
796,
1279,
7278,
62,
2860,
5239,
29,
12,
312,
62,
11487,
11405,
705,
4032,
11405,
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,
1279,
7278,
62,
2860,
5239,
29,
12,
312,
62,
3245,
11405,
705,
4032,
11405,
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,
1279,
7278,
62,
2860,
5239,
29,
12,
312,
62,
3245,
17,
11405,
705,
4032,
11405,
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,
1279,
7278,
62,
2860,
5239,
29,
12,
31448,
62,
3245,
11405,
705,
4032,
11405,
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,
1279,
7278,
62,
2860,
5239,
29,
12,
31448,
62,
8367,
11405,
705,
4032,
11405,
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,
1279,
7278,
62,
2860,
5239,
29,
12,
31448,
62,
404,
13,
628,
220,
220,
220,
220,
220,
220,
220,
1168,
5097,
62,
50,
1404,
62,
44,
1546,
4090,
8264,
62,
39,
3698,
18973,
14804,
35312,
62,
8841,
62,
1640,
62,
20500,
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,
21628,
62,
8841,
796,
300,
85,
62,
10885
] | [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] |
"! <p class="shorttext synchronized" lang="en">AoC Day 3</p>
CLASS zpanel DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
TYPES: BEGIN OF point_type,
x TYPE i,
y TYPE i,
END OF point_type,
BEGIN OF crossing_type,
x TYPE i,
y TYPE i,
distance TYPE i,
delay TYPE i,
END OF crossing_type,
BEGIN OF grid_line,
x TYPE i,
y TYPE i,
z TYPE char1,
delay TYPE i,
END OF grid_line,
grid_type TYPE HASHED TABLE OF grid_line WITH UNIQUE KEY x y.
METHODS load
IMPORTING
VALUE(color) TYPE char1
wire TYPE string.
METHODS calc_manhatten_distance
IMPORTING VALUE(central_port) TYPE point_type
VALUE(crossing) TYPE point_type
RETURNING VALUE(distance) TYPE i.
METHODS: get_grid RETURNING VALUE(r_result) TYPE grid_type,
get_point
IMPORTING
VALUE(x) TYPE i
VALUE(y) TYPE i
RETURNING
VALUE(z) TYPE char1,
constructor,
find_closest_crossing
RETURNING
VALUE(manhatten_distance) TYPE i,
get_delay
IMPORTING
VALUE(x) TYPE i
VALUE(y) TYPE i
RETURNING
VALUE(delay) TYPE i,
find_min_delay_x
RETURNING
VALUE(min_delay) TYPE i.
DATA crossings TYPE STANDARD TABLE OF crossing_type WITH DEFAULT KEY READ-ONLY.
PROTECTED SECTION.
PRIVATE SECTION.
DATA grid TYPE grid_type.
DATA pointer TYPE point_type.
ENDCLASS.
CLASS zpanel IMPLEMENTATION.
METHOD calc_manhatten_distance.
distance = abs( central_port-x - crossing-x ) + abs( central_port-y - crossing-y ).
ENDMETHOD.
METHOD get_grid.
r_result = me->grid.
ENDMETHOD.
METHOD get_point.
z = VALUE #( grid[ x = x y = y ]-z DEFAULT '.' ).
ENDMETHOD.
METHOD constructor.
grid = VALUE #( ( x = 0 y = 0 z = 'o' delay = 0 ) ).
ENDMETHOD.
METHOD load.
SPLIT wire AT ',' INTO TABLE DATA(wire_table).
pointer = VALUE #( x = 0 y = 0 ).
DATA(delay) = 0.
LOOP AT wire_table INTO DATA(path).
DATA(direction) = path(1).
DATA(steps) = CONV i( shift_left( val = path places = 1 ) ).
DATA: new TYPE i, crossing_delay TYPE i.
CASE direction.
WHEN 'R'.
DO steps TIMES.
delay = delay + 1.
new = pointer-x + sy-index.
IF line_exists( grid[ x = new y = pointer-y ] ).
IF grid[ x = new y = pointer-y ]-z <> color.
crossing_delay = grid[ x = new y = pointer-y ]-delay + delay.
INSERT VALUE #( x = new y = pointer-y delay = crossing_delay ) INTO TABLE crossings.
grid[ x = new y = pointer-y ]-z = 'X'.
grid[ x = new y = pointer-y ]-delay = crossing_delay.
ENDIF.
ELSE.
INSERT VALUE #( x = new y = pointer-y z = color delay = delay ) INTO TABLE grid.
ENDIF.
ENDDO.
pointer-x = pointer-x + steps.
WHEN 'L'.
DO steps TIMES.
delay = delay + 1.
new = pointer-x - sy-index.
IF line_exists( grid[ x = new y = pointer-y ] ).
IF grid[ x = new y = pointer-y ]-z <> color.
crossing_delay = grid[ x = new y = pointer-y ]-delay + delay.
INSERT VALUE #( x = new y = pointer-y delay = crossing_delay ) INTO TABLE crossings.
grid[ x = new y = pointer-y ]-z = 'X'.
grid[ x = new y = pointer-y ]-delay = crossing_delay.
ENDIF.
ELSE.
INSERT VALUE #( x = new y = pointer-y z = color delay = delay ) INTO TABLE grid.
ENDIF.
ENDDO.
pointer-x = pointer-x - steps.
WHEN 'U'.
DO steps TIMES.
delay = delay + 1.
new = pointer-y + sy-index.
IF line_exists( grid[ x = pointer-x y = new ] ).
IF grid[ x = pointer-x y = new ]-z <> color.
crossing_delay = grid[ x = pointer-x y = new ]-delay + delay.
INSERT VALUE #( x = pointer-x y = new delay = crossing_delay ) INTO TABLE crossings.
grid[ x = pointer-x y = new ]-z = 'X'.
grid[ x = pointer-x y = new ]-delay = crossing_delay.
ENDIF.
grid[ x = pointer-x y = new ]-z = color.
grid[ x = pointer-x y = new ]-delay = COND #( WHEN grid[ x = pointer-x y = new ]-delay > delay THEN delay
ELSE grid[ x = pointer-x y = new ]-delay ).
ELSE.
INSERT VALUE #( x = pointer-x y = new z = color delay = delay ) INTO TABLE grid.
ENDIF.
ENDDO.
pointer-y = pointer-y + steps.
WHEN 'D'.
DO steps TIMES.
delay = delay + 1.
new = pointer-y - sy-index.
IF line_exists( grid[ x = pointer-x y = new ] ).
IF grid[ x = pointer-x y = new ]-z <> color.
crossing_delay = grid[ x = pointer-x y = new ]-delay + delay.
INSERT VALUE #( x = pointer-x y = new delay = crossing_delay ) INTO TABLE crossings.
grid[ x = pointer-x y = new ]-z = 'X'.
grid[ x = pointer-x y = new ]-delay = crossing_delay.
ENDIF.
ELSE.
INSERT VALUE #( x = pointer-x y = new z = color delay = delay ) INTO TABLE grid.
ENDIF.
ENDDO.
pointer-y = pointer-y - steps.
ENDCASE.
ENDLOOP.
ENDMETHOD.
METHOD find_closest_crossing.
LOOP AT crossings ASSIGNING FIELD-SYMBOL(<crossing>).
<crossing>-distance = calc_manhatten_distance( central_port = VALUE #( x = 0 y = 0 )
crossing = VALUE #( x = <crossing>-x
y = <crossing>-y ) ).
ENDLOOP.
SORT crossings BY distance ASCENDING.
manhatten_distance = crossings[ 1 ]-distance.
ENDMETHOD.
METHOD get_delay.
delay = grid[ x = x y = y ]-delay.
ENDMETHOD.
METHOD find_min_delay_x.
SORT crossings BY delay ASCENDING.
min_delay = crossings[ 1 ]-delay.
ENDMETHOD.
ENDCLASS.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
32,
78,
34,
3596,
513,
3556,
79,
29,
198,
31631,
1976,
35330,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
966,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
966,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
43312,
3963,
12538,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5253,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5711,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
12538,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
43312,
3963,
10706,
62,
1370,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
331,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
220,
220,
220,
220,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5711,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
10706,
62,
1370,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10706,
62,
4906,
41876,
367,
11211,
1961,
43679,
3963,
10706,
62,
1370,
13315,
4725,
33866,
8924,
35374,
2124,
331,
13,
198,
220,
220,
220,
337,
36252,
50,
3440,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
8043,
8,
41876,
1149,
16,
198,
220,
220,
220,
220,
220,
220,
220,
6503,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
13,
198,
220,
220,
220,
337,
36252,
50,
42302,
62,
805,
11653,
268,
62,
30246,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
26173,
8924,
7,
31463,
62,
634,
8,
41876,
966,
62,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
19692,
278,
8,
220,
220,
220,
220,
41876,
966,
62,
4906,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
30246,
8,
220,
220,
220,
220,
41876,
1312,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
651,
62,
25928,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
10706,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
651,
62,
4122,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
87,
8,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
88,
8,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
89,
8,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
23772,
11,
198,
220,
220,
220,
220,
220,
1064,
62,
565,
418,
395,
62,
19692,
278,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
805,
11653,
268,
62,
30246,
8,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
651,
62,
40850,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
87,
8,
220,
220,
220,
220,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
88,
8,
220,
220,
220,
220,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
40850,
8,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
1064,
62,
1084,
62,
40850,
62,
87,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
1084,
62,
40850,
8,
41876,
1312,
13,
198,
220,
220,
220,
42865,
41930,
41876,
49053,
9795,
43679,
3963,
12538,
62,
4906,
13315,
5550,
38865,
35374,
20832,
12,
1340,
11319,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
10706,
41876,
10706,
62,
4906,
13,
198,
220,
220,
220,
42865,
17562,
41876,
966,
62,
4906,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
35330,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
42302,
62,
805,
11653,
268,
62,
30246,
13,
198,
220,
220,
220,
5253,
796,
2352,
7,
4318,
62,
634,
12,
87,
532,
12538,
12,
87,
1267,
1343,
2352,
7,
4318,
62,
634,
12,
88,
532,
12538,
12,
88,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
25928,
13,
198,
220,
220,
220,
374,
62,
20274,
796,
502,
3784,
25928,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
4122,
13,
198,
220,
220,
220,
1976,
796,
26173,
8924,
1303,
7,
10706,
58,
2124,
796,
2124,
331,
796,
331,
2361,
12,
89,
5550,
38865,
705,
2637,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
10706,
796,
26173,
8924,
1303,
7,
357,
220,
2124,
796
] | [
1,
1,
1,
1,
1,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------*
* CLASS lcl_Test DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS ltcl_test DEFINITION FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS
FINAL.
PRIVATE SECTION.
* ================
DATA: mt_code TYPE string_table,
ms_result TYPE scirest_ad,
mo_check TYPE REF TO zcl_aoc_check_15.
METHODS:
setup,
export_import FOR TESTING,
test001_01 FOR TESTING,
test001_02 FOR TESTING,
test001_03 FOR TESTING,
test001_04 FOR TESTING,
is_amdp_call_ignored FOR TESTING.
ENDCLASS. "lcl_Test
*----------------------------------------------------------------------*
* CLASS lcl_Test IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS ltcl_test IMPLEMENTATION.
* ==============================
DEFINE _code.
APPEND &1 TO mt_code.
END-OF-DEFINITION.
METHOD setup.
CREATE OBJECT mo_check.
zcl_aoc_unit_test=>set_check( mo_check ).
ENDMETHOD. "setup
METHOD export_import.
zcl_aoc_unit_test=>export_import( mo_check ).
ENDMETHOD.
METHOD test001_01.
* ===========
_code 'CALL ''C_DIR_READ_FINISH'''.
_code 'ID ''ERRNO'' FIELD file-errno'.
_code 'ID ''ERRMSG'' FIELD file-errmsg.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD. "test1
METHOD test001_02.
* ===========
_code 'CALL FUNCTION ''FOOBAR''.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD. "test2
METHOD test001_03.
* ===========
_code 'CALL CUSTOMER-FUNCTION ''001''.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
METHOD test001_04.
* ===========
_code 'SYSTEM-CALL OBJMGR CLONE lo_foo TO lo_bar.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD.
METHOD is_amdp_call_ignored.
_code 'CALL "ZCL_MY_AMDP_CLASS=>ANOTHER_AMDP_METHOD"( iv_input => :iv_input );'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result ).
ENDMETHOD.
ENDCLASS. "lcl_Test
| [
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
565,
62,
14402,
5550,
20032,
17941,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
31631,
300,
83,
565,
62,
9288,
5550,
20032,
17941,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
198,
220,
25261,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
9,
796,
25609,
18604,
628,
220,
220,
220,
42865,
25,
45079,
62,
8189,
220,
220,
41876,
4731,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13845,
62,
20274,
41876,
629,
557,
301,
62,
324,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6941,
62,
9122,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
9122,
62,
1314,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
220,
220,
10784,
62,
11748,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
486,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
2999,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
3070,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
3023,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
318,
62,
321,
26059,
62,
13345,
62,
570,
1850,
7473,
43001,
2751,
13,
198,
198,
10619,
31631,
13,
220,
220,
220,
220,
220,
220,
366,
75,
565,
62,
14402,
198,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
565,
62,
14402,
30023,
2538,
10979,
6234,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
31631,
300,
83,
565,
62,
9288,
30023,
2538,
10979,
6234,
13,
198,
9,
36658,
25609,
28,
628,
220,
23449,
8881,
4808,
8189,
13,
198,
220,
220,
220,
43504,
10619,
1222,
16,
5390,
45079,
62,
8189,
13,
198,
220,
23578,
12,
19238,
12,
7206,
20032,
17941,
13,
628,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
6941,
62,
9122,
13,
198,
220,
220,
220,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
2617,
62,
9122,
7,
6941,
62,
9122,
6739,
198,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
40406,
628,
220,
337,
36252,
10784,
62,
11748,
13,
198,
220,
220,
220,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
39344,
62,
11748,
7,
6941,
62,
9122,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
8298,
62,
486,
13,
198,
9,
796,
2559,
855,
628,
220,
220,
220,
4808,
8189,
705,
34,
7036,
10148,
34,
62,
34720,
62,
15675,
62,
20032,
18422,
7061,
4458,
198,
220,
220,
220,
4808,
8189,
705,
2389,
10148,
1137,
49,
15285,
7061,
220,
18930,
24639,
2393,
12,
8056,
3919,
4458,
198,
220,
220,
220,
4808,
8189,
705,
2389,
10148,
1137,
49,
5653,
38,
7061,
18930,
24639,
2393,
12,
8056,
19662,
2637,
13,
628,
220,
220,
220,
13845,
62,
20274,
796,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
9122,
7,
45079,
62,
8189,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
1033,
796,
705,
8298,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
719,
796,
13845,
62,
20274,
12,
8189,
6739,
628,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9288,
16,
628,
220,
337,
36252,
1332,
8298,
62,
2999,
13,
198,
9,
796,
2559,
855,
628,
220,
220,
220,
4808,
8189,
705,
34,
7036,
29397,
4177,
2849,
10148,
6080,
9864,
1503,
7061,
2637,
13,
628,
220,
220,
220,
13845,
62,
20274,
796,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
9122,
7,
45079,
62,
8189,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
36733,
7,
13845,
62,
20274,
6739,
628,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9288,
17,
628,
220,
337,
36252,
1332,
8298,
62,
3070,
13,
198,
9,
796,
2559,
855,
628,
220,
220,
220,
4808,
8189,
705,
34,
7036,
327,
7759,
2662,
1137,
12,
42296,
4177,
2849,
10148,
8298,
7061,
2637,
13,
628,
220,
220,
220,
13845,
62,
20274,
796,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
9122,
7,
45079,
62,
8189,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
36733,
7,
13845,
62,
20274,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
8298,
62,
3023,
13,
198,
9,
796,
2559,
855,
628,
220,
220,
220,
4808,
8189,
705,
23060,
25361,
12,
34,
7036,
25334,
50229,
10761,
7852,
11651,
2376,
62,
21943,
5390,
2376,
62,
5657,
2637,
13,
628,
220,
220,
220,
13845,
62,
20274,
796,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
9122,
7,
45079,
62,
8189,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
1033,
796,
705,
8298,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
719,
796,
13845,
62,
20274,
12,
8189,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
318,
62,
321,
26059,
62,
13345,
62,
570,
1850,
13,
628,
220,
220,
220,
4808,
8189,
705,
34,
7036,
366,
57,
5097,
62,
26708,
62,
2390,
6322,
62,
31631,
14804,
1565,
31858,
62,
2390,
6322,
62,
49273,
18109,
21628,
62,
15414,
5218,
1058,
452,
62,
15414,
5619
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
REPORT zaoc_count_classes_with_tests.
TABLES: tadir.
SELECT-OPTIONS: s_objn FOR tadir-obj_name,
s_devc FOR tadir-devclass.
START-OF-SELECTION.
PERFORM run.
FORM run RAISING cx_salv_msg.
TYPES: BEGIN OF ty_alv,
obj_name TYPE tadir-obj_name,
with TYPE i,
without TYPE i,
END OF ty_alv.
TYPES: BEGIN OF ty_tadir,
object TYPE tadir-object,
obj_name TYPE tadir-obj_name,
END OF ty_tadir.
DATA: lt_tadir TYPE STANDARD TABLE OF ty_tadir WITH DEFAULT KEY,
ls_tadir LIKE LINE OF lt_tadir,
lo_alv TYPE REF TO cl_salv_table,
lt_alv TYPE STANDARD TABLE OF ty_alv WITH DEFAULT KEY,
ls_alv LIKE LINE OF lt_alv,
ls_aunit_info TYPE if_aunit_prog_info_types=>ty_s_program.
SELECT object obj_name FROM tadir INTO TABLE lt_tadir
WHERE pgmid = 'R3TR'
AND object = 'CLAS'
AND obj_name IN s_objn
AND devclass IN s_devc
AND delflag = abap_false. "#EC CI_GENBUFF "#EC CI_SUBRC
LOOP AT lt_tadir INTO ls_tadir.
CLEAR ls_alv.
ls_aunit_info = cl_aunit_prog_info=>get_program_info(
allow_commit = abap_true
obj_type = ls_tadir-object
obj_name = ls_tadir-obj_name ).
ls_alv-obj_name = ls_tadir-obj_name.
IF ls_aunit_info-has_tests = abap_true.
ls_alv-with = 1.
ELSE.
ls_alv-without = 1.
ENDIF.
APPEND ls_alv TO lt_alv.
ENDLOOP.
cl_salv_table=>factory(
IMPORTING
r_salv_table = lo_alv
CHANGING
t_table = lt_alv ).
lo_alv->get_functions( )->set_all( ).
lo_alv->get_columns( )->set_optimize( ).
lo_alv->display( ).
ENDFORM.
| [
2200,
15490,
1976,
64,
420,
62,
9127,
62,
37724,
62,
4480,
62,
41989,
13,
198,
198,
5603,
9148,
1546,
25,
36264,
343,
13,
198,
198,
46506,
12,
3185,
51,
11053,
25,
264,
62,
26801,
77,
7473,
36264,
343,
12,
26801,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
62,
7959,
66,
7473,
36264,
343,
12,
7959,
4871,
13,
198,
198,
2257,
7227,
12,
19238,
12,
46506,
2849,
13,
198,
220,
19878,
21389,
1057,
13,
198,
198,
21389,
1057,
17926,
1797,
2751,
43213,
62,
21680,
85,
62,
19662,
13,
628,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
282,
85,
11,
198,
220,
220,
220,
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,
220,
220,
220,
351,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1231,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
282,
85,
13,
628,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
83,
324,
343,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2134,
220,
220,
41876,
36264,
343,
12,
15252,
11,
198,
220,
220,
220,
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,
220,
23578,
3963,
1259,
62,
83,
324,
343,
13,
628,
220,
42865,
25,
300,
83,
62,
83,
324,
343,
220,
220,
220,
220,
220,
41876,
49053,
9795,
43679,
3963,
1259,
62,
83,
324,
343,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
83,
324,
343,
220,
220,
220,
220,
220,
34178,
48920,
3963,
300,
83,
62,
83,
324,
343,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
282,
85,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
537,
62,
21680,
85,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
282,
85,
220,
220,
220,
220,
220,
220,
220,
41876,
49053,
9795,
43679,
3963,
1259,
62,
282,
85,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
282,
85,
220,
220,
220,
220,
220,
220,
220,
34178,
48920,
3963,
300,
83,
62,
282,
85,
11,
198,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
1942,
270,
62,
10951,
41876,
611,
62,
1942,
270,
62,
1676,
70,
62,
10951,
62,
19199,
14804,
774,
62,
82,
62,
23065,
13,
628,
220,
33493,
2134,
26181,
62,
3672,
16034,
36264,
343,
39319,
43679,
300,
83,
62,
83,
324,
343,
198,
220,
220,
220,
33411,
23241,
13602,
796,
705,
49,
18,
5446,
6,
198,
220,
220,
220,
5357,
2134,
796,
705,
5097,
1921,
6,
198,
220,
220,
220,
5357,
26181,
62,
3672,
3268,
264,
62,
26801,
77,
198,
220,
220,
220,
5357,
1614,
4871,
3268,
264,
62,
7959,
66,
198,
220,
220,
220,
5357,
1619,
32109,
796,
450,
499,
62,
9562,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
14514,
62,
35353,
19499,
5777,
25113,
2943,
14514,
62,
50,
10526,
7397,
628,
220,
17579,
3185,
5161,
300,
83,
62,
83,
324,
343,
39319,
43979,
62,
83,
324,
343,
13,
198,
220,
220,
220,
30301,
1503,
43979,
62,
282,
85,
13,
198,
220,
220,
220,
43979,
62,
1942,
270,
62,
10951,
796,
537,
62,
1942,
270,
62,
1676,
70,
62,
10951,
14804,
1136,
62,
23065,
62,
10951,
7,
198,
220,
220,
220,
220,
220,
1249,
62,
41509,
796,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
26181,
62,
4906,
220,
220,
220,
220,
796,
43979,
62,
83,
324,
343,
12,
15252,
198,
220,
220,
220,
220,
220,
26181,
62,
3672,
220,
220,
220,
220,
796,
43979,
62,
83,
324,
343,
12,
26801,
62,
3672,
6739,
198,
220,
220,
220,
43979,
62,
282,
85,
12,
26801,
62,
3672,
796,
43979,
62,
83,
324,
343,
12,
26801,
62,
3672,
13,
198,
220,
220,
220,
16876,
43979,
62,
1942,
270,
62,
10951,
12,
10134,
62,
41989,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
43979,
62,
282,
85,
12,
4480,
796,
352,
13,
198,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
43979,
62,
282,
85,
12,
19419,
796,
352,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
43504,
10619,
43979,
62,
282,
85,
5390,
300,
83,
62,
282,
85,
13,
198,
220,
23578,
21982,
3185,
13,
628,
220,
537,
62,
21680,
85,
62,
11487,
14804,
69,
9548,
7,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
374,
62,
21680,
85,
62,
11487,
796,
2376,
62,
282,
85,
198,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
256,
62,
11487,
220,
220,
220,
220,
220,
796,
300,
83,
62,
282,
85,
6739,
628,
220,
2376,
62,
282,
85,
3784,
1136,
62,
12543,
2733,
7,
1267,
3784,
2617,
62,
439,
7,
6739,
198,
220,
2376,
62,
282,
85,
3784,
1136,
62,
28665,
82,
7,
1267,
3784,
2617,
62,
40085,
1096,
7,
6739,
198,
220,
2376,
62,
282,
85,
3784,
13812,
7,
6739,
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,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40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
10080,
3582,
3556,
79,
29,
198,
40484,
2940,
263,
7071,
329,
257,
12454,
3582,
198,
41358,
49836,
1976,
361,
62,
5013,
65,
62,
48317,
62,
1177,
198,
220,
44731,
764,
198,
198,
10619,
41358,
49836,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
INTERFACE y_code_pal_version PUBLIC.
CONSTANTS abap TYPE string VALUE '1.13.0' ##NO_TEXT.
ENDINTERFACE.
| [
41358,
49836,
331,
62,
8189,
62,
18596,
62,
9641,
44731,
13,
198,
220,
7102,
2257,
1565,
4694,
450,
499,
41876,
4731,
26173,
8924,
705,
16,
13,
1485,
13,
15,
6,
22492,
15285,
62,
32541,
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
] |
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.
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_exception
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 zif_abapgit_object~has_changed_since.
rv_changed = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
rv_user = c_user_unknown. " todo
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
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 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.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_abapgit_not_found.
ENDIF.
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.
zcx_abapgit_exception=>raise( 'error from TYPD_GET_OBJECT' ).
ENDIF.
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.
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 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~delete.
DATA: lv_objname TYPE rsedd0-ddobjname.
lv_objname = ms_item-obj_name.
CALL FUNCTION 'RS_DD_DELETE_OBJ'
EXPORTING
no_ask = abap_true
objname = lv_objname
objtype = 'G'
EXCEPTIONS
not_executed = 1
object_not_found = 2
object_not_specified = 3
permission_failure = 4
dialog_needed = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error deleting TYPE' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
jump_se11( iv_radio = 'RSRD1-TYMA'
iv_field = 'RSRD1-TYMA_VAL' ).
ENDMETHOD.
METHOD zif_abapgit_object~compare_to_remote_version.
CREATE OBJECT ro_comparison_result TYPE zcl_abapgit_comparison_null.
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
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,
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,
1069,
4516,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
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,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
4906,
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,
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,
628,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
1069,
1023,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1100,
7,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
374,
85,
62,
30388,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
397,
499,
18300,
62,
1662,
62,
9275,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
220,
220,
220,
220,
220,
220,
220,
374,
85,
62,
30388,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
23578,
49273,
13,
628,
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,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
5357,
49427,
16129,
796,
285,
85,
62,
16129,
13,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
17926,
24352,
7788,
42006,
2849,
41876,
1976,
66,
87,
62,
397,
499,
18300,
62,
1662,
62,
9275,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
300,
85,
62,
28004,
67,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
198,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
9936,
5760,
62,
18851,
62,
9864,
23680,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
2170,
67,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
28004,
67,
3672,
198,
220,
220,
220,
220,
220,
309,
6242,
28378,
198,
220,
220,
220,
220,
220,
220,
220,
26692,
4666,
271,
6015,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
83,
62,
862,
4666,
271,
6015,
198,
220,
220,
220,
220,
220,
220,
220,
26692,
4666,
346,
519,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
83,
62,
862,
4666,
346,
519,
198,
220,
220,
220,
220,
220,
220,
220,
279,
10459,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
2123,
62,
10459,
198,
220,
220,
220,
220,
220,
220,
220,
50116,
15908,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
83,
62,
457,
4372,
343,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
2196,
62,
1662,
62,
9275,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
20982,
62,
1662,
62,
38476,
220,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
513,
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,
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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
] |
CLASS zbp_cct_i_county_m DEFINITION PUBLIC ABSTRACT FINAL FOR BEHAVIOR OF zcct_i_county_m.
ENDCLASS.
CLASS zbp_cct_i_county_m IMPLEMENTATION.
ENDCLASS.
| [
31631,
1976,
46583,
62,
66,
310,
62,
72,
62,
9127,
88,
62,
76,
5550,
20032,
17941,
44731,
9564,
18601,
10659,
25261,
7473,
9348,
7801,
12861,
1581,
3963,
1976,
66,
310,
62,
72,
62,
9127,
88,
62,
76,
13,
198,
10619,
31631,
13,
198,
198,
31631,
1976,
46583,
62,
66,
310,
62,
72,
62,
9127,
88,
62,
76,
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
] |
CLASS zcl_wtc_roman_converter DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS to_arabic
IMPORTING
i_roman_numberal TYPE string
RETURNING
VALUE(r_arabic) TYPE i.
CONSTANTS error_value TYPE i VALUE -1.
PROTECTED SECTION.
PRIVATE SECTION.
METHODS value_of_roman_digit
IMPORTING
i_roman_numberal_digit TYPE char1
RETURNING
VALUE(r_arabic) TYPE i.
ENDCLASS.
CLASS zcl_wtc_roman_converter IMPLEMENTATION.
METHOD to_arabic.
DATA:
offset TYPE i,
current_digit TYPE char1,
previous_digit TYPE char1,
roman TYPE string,
value_of_prev_digit TYPE i,
value_of_cur_digit TYPE i.
offset = 0.
value_of_prev_digit = 0.
roman = i_roman_numberal.
TRANSLATE roman TO UPPER CASE.
DO strlen( roman ) TIMES.
offset = sy-index - 1.
previous_digit = current_digit.
value_of_prev_digit = value_of_cur_digit.
current_digit = roman+offset(1).
value_of_cur_digit = value_of_roman_digit( current_digit ).
IF value_of_cur_digit = error_value.
r_arabic = error_value.
ENDIF.
r_arabic = r_arabic + value_of_cur_digit.
IF value_of_prev_digit > 0 AND value_of_prev_digit < value_of_cur_digit.
r_arabic = r_arabic - 2 * value_of_prev_digit.
CASE current_digit.
WHEN 'X' OR 'V'. IF previous_digit NE 'I'. r_arabic = error_value. EXIT. ENDIF.
WHEN 'L' OR 'C'. IF previous_digit NE 'X'. r_arabic = error_value. EXIT. ENDIF.
WHEN 'D' OR 'M'. IF previous_digit NE 'C'. r_arabic = error_value. EXIT. ENDIF.
ENDCASE.
ELSE.
DATA lv_check_offset TYPE i.
lv_check_offset = offset - 3.
IF lv_check_offset >= 0 AND current_digit = roman+lv_check_offset(1).
r_arabic = error_value.
EXIT.
ENDIF.
ENDIF.
ENDDO.
ENDMETHOD.
METHOD value_of_roman_digit.
CASE i_roman_numberal_digit.
WHEN 'I'. r_arabic = 1.
WHEN 'V'. r_arabic = 5.
WHEN 'X'. r_arabic = 10.
WHEN 'L'. r_arabic = 50.
WHEN 'C'. r_arabic = 100.
WHEN 'M'. r_arabic = 1000.
WHEN OTHERS. r_arabic = error_value.
ENDCASE.
ENDMETHOD.
ENDCLASS. | [
31631,
1976,
565,
62,
86,
23047,
62,
47119,
62,
1102,
332,
353,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
284,
62,
283,
397,
291,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
47119,
62,
17618,
282,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
62,
283,
397,
291,
8,
220,
41876,
1312,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
4049,
62,
8367,
41876,
1312,
26173,
8924,
532,
16,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
1988,
62,
1659,
62,
47119,
62,
27003,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
47119,
62,
17618,
282,
62,
27003,
41876,
1149,
16,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
62,
283,
397,
291,
8,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
86,
23047,
62,
47119,
62,
1102,
332,
353,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
284,
62,
283,
397,
291,
13,
198,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
11677,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
1459,
62,
27003,
220,
220,
220,
220,
220,
220,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
2180,
62,
27003,
220,
220,
220,
220,
220,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
374,
5185,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
1988,
62,
1659,
62,
47050,
62,
27003,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
1988,
62,
1659,
62,
22019,
62,
27003,
220,
41876,
1312,
13,
628,
220,
220,
220,
11677,
796,
657,
13,
198,
220,
220,
220,
1988,
62,
1659,
62,
47050,
62,
27003,
796,
657,
13,
198,
220,
220,
220,
374,
5185,
796,
1312,
62,
47119,
62,
17618,
282,
13,
198,
220,
220,
220,
48213,
8634,
6158,
374,
5185,
5390,
471,
10246,
1137,
42001,
13,
628,
220,
220,
220,
8410,
965,
11925,
7,
374,
5185,
1267,
31742,
1546,
13,
198,
220,
220,
220,
220,
220,
11677,
796,
827,
12,
9630,
532,
352,
13,
198,
220,
220,
220,
220,
220,
2180,
62,
27003,
796,
1459,
62,
27003,
13,
198,
220,
220,
220,
220,
220,
1988,
62,
1659,
62,
47050,
62,
27003,
796,
1988,
62,
1659,
62,
22019,
62,
27003,
13,
198,
220,
220,
220,
220,
220,
1459,
62,
27003,
796,
374,
5185,
10,
28968,
7,
16,
737,
198,
220,
220,
220,
220,
220,
1988,
62,
1659,
62,
22019,
62,
27003,
796,
1988,
62,
1659,
62,
47119,
62,
27003,
7,
1459,
62,
27003,
6739,
198,
220,
220,
220,
220,
220,
16876,
1988,
62,
1659,
62,
22019,
62,
27003,
796,
4049,
62,
8367,
13,
198,
220,
220,
220,
220,
220,
220,
220,
374,
62,
283,
397,
291,
796,
4049,
62,
8367,
13,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
220,
220,
374,
62,
283,
397,
291,
796,
374,
62,
283,
397,
291,
1343,
1988,
62,
1659,
62,
22019,
62,
27003,
13,
198,
220,
220,
220,
220,
220,
16876,
1988,
62,
1659,
62,
47050,
62,
27003,
1875,
657,
5357,
1988,
62,
1659,
62,
47050,
62,
27003,
1279,
1988,
62,
1659,
62,
22019,
62,
27003,
13,
198,
220,
220,
220,
220,
220,
220,
220,
374,
62,
283,
397,
291,
796,
374,
62,
283,
397,
291,
532,
362,
1635,
1988,
62,
1659,
62,
47050,
62,
27003,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42001,
1459,
62,
27003,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42099,
705,
55,
6,
6375,
705,
53,
4458,
16876,
2180,
62,
27003,
10635,
705,
40,
4458,
374,
62,
283,
397,
291,
796,
4049,
62,
8367,
13,
7788,
2043,
13,
23578,
5064,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42099,
705,
43,
6,
6375,
705,
34,
4458,
16876,
2180,
62,
27003,
10635,
705,
55,
4458,
374,
62,
283,
397,
291,
796,
4049,
62,
8367,
13,
7788,
2043,
13,
23578,
5064,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42099,
705,
35,
6,
6375,
705,
44,
4458,
16876,
2180,
62,
27003,
10635,
705,
34,
4458,
374,
62,
283,
397,
291,
796,
4049,
62,
8367,
13,
7788,
2043,
13,
23578,
5064,
13,
198,
220,
220,
220,
220,
220,
220,
220,
23578,
34,
11159,
13,
198,
220,
220,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
300,
85,
62,
9122,
62,
28968,
220,
41876,
1312,
13,
198,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
9122,
62,
28968,
796,
11677,
532,
513,
13,
198,
220,
220,
220,
220,
220,
220,
220,
16876,
300,
85,
62,
9122,
62,
28968,
18189,
657,
5357,
1459,
62,
27003,
796,
374,
5185,
10,
6780,
62,
9122,
62,
28968,
7,
16,
737,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
62,
283,
397,
291,
796,
4049,
62,
8367,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
2043,
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,
18227,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1988,
62,
1659,
62,
47119,
62,
27003,
13,
198,
220,
220,
220,
42001,
1312,
62,
47119,
62,
17618,
282,
62,
27003,
13,
198,
220,
220,
220,
220,
220,
42099,
705,
40,
4458,
374,
62,
283,
397,
291,
796,
352,
13,
198,
220,
220,
220,
220,
220,
42099,
705,
53,
4458,
374,
62,
283,
397,
291,
796,
642,
13,
198,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
interface zif_mockup_loader_stub_dummy
public .
types:
begin of ty_params,
param1 type string,
connid type s_conn_id,
end of ty_params.
types:
begin of ty_sflight_extract,
connid type sflight-connid,
fldate type sflight-fldate,
price type sflight-price,
end of ty_sflight_extract,
tt_sflight_extract type standard table of ty_sflight_extract with default key.
types:
begin of ty_deep,
carrid type sflight-carrid,
connid type sflight-connid,
prices type tt_sflight_extract,
end of ty_deep,
tt_deep type standard table of ty_deep with key carrid connid.
types:
ty_connid_range type range of sflight-connid.
methods tab_return
importing
!i_connid type s_conn_id
returning
value(r_tab) type flighttab .
methods tab_return_w_date
importing
!i_connid type s_conn_id
!i_fldate type sflight-fldate
returning
value(r_tab) type flighttab .
methods tab_return_by_range
importing
!ir_connid type ty_connid_range
returning
value(r_tab) type flighttab .
methods tab_return_w_struc_param
importing
!i_params type ty_params
returning
value(r_tab) type flighttab .
methods tab_return_extract_by_date
importing
!i_fldate type sflight-fldate
returning
value(r_tab) type tt_sflight_extract .
methods tab_export
importing
!i_connid type s_conn_id
exporting
!e_tab type flighttab .
methods tab_change
importing
!i_connid type s_conn_id
changing
!c_tab type flighttab .
methods wrong_return
importing
!i_connid type s_conn_id
returning
value(r_tab) type sflight-carrid .
methods wrong_sift
importing
!i_connid type sflight
returning
value(r_tab) type flighttab .
methods gen_param_target
importing
!i_p1 type i
!i_p2 type clike
!i_p3 type data
!i_p4 type data optional
changing
c_tab type flighttab.
methods proxy_test
importing
!i_p1 type string
!i_p2 type i optional
returning value(r_val) type string .
methods return_value
importing
!i_connid type s_conn_id
returning
value(r_val) type sflight-price .
methods return_value_w_date
importing
!i_connid type s_conn_id
!i_fldate type sflight-fldate
returning
value(r_val) type sflight-price .
methods return_deep
importing
!i_connid type s_conn_id
returning
value(r_deep) type tt_deep .
endinterface.
| [
39994,
1976,
361,
62,
76,
735,
929,
62,
29356,
62,
301,
549,
62,
67,
13513,
198,
220,
1171,
764,
628,
220,
3858,
25,
198,
220,
220,
220,
2221,
286,
1259,
62,
37266,
11,
198,
220,
220,
220,
220,
220,
5772,
16,
2099,
4731,
11,
198,
220,
220,
220,
220,
220,
48260,
312,
2099,
264,
62,
37043,
62,
312,
11,
198,
220,
220,
220,
886,
286,
1259,
62,
37266,
13,
628,
220,
3858,
25,
198,
220,
220,
220,
2221,
286,
1259,
62,
82,
22560,
62,
2302,
974,
11,
198,
220,
220,
220,
220,
220,
48260,
312,
2099,
264,
22560,
12,
37043,
312,
11,
198,
220,
220,
220,
220,
220,
277,
335,
378,
2099,
264,
22560,
12,
69,
335,
378,
11,
198,
220,
220,
220,
220,
220,
2756,
2099,
264,
22560,
12,
20888,
11,
198,
220,
220,
220,
886,
286,
1259,
62,
82,
22560,
62,
2302,
974,
11,
198,
220,
220,
220,
256,
83,
62,
82,
22560,
62,
2302,
974,
2099,
3210,
3084,
286,
1259,
62,
82,
22560,
62,
2302,
974,
351,
4277,
1994,
13,
628,
220,
3858,
25,
198,
220,
220,
220,
2221,
286,
1259,
62,
22089,
11,
198,
220,
220,
220,
220,
220,
1097,
6058,
2099,
264,
22560,
12,
66,
3258,
312,
11,
198,
220,
220,
220,
220,
220,
48260,
312,
2099,
264,
22560,
12,
37043,
312,
11,
198,
220,
220,
220,
220,
220,
4536,
2099,
256,
83,
62,
82,
22560,
62,
2302,
974,
11,
198,
220,
220,
220,
886,
286,
1259,
62,
22089,
11,
198,
220,
220,
220,
256,
83,
62,
22089,
2099,
3210,
3084,
286,
1259,
62,
22089,
351,
1994,
1097,
6058,
48260,
312,
13,
628,
220,
3858,
25,
198,
220,
220,
220,
1259,
62,
37043,
312,
62,
9521,
2099,
2837,
286,
264,
22560,
12,
37043,
312,
13,
628,
220,
5050,
7400,
62,
7783,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
37043,
312,
2099,
264,
62,
37043,
62,
312,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
81,
62,
8658,
8,
2099,
5474,
8658,
764,
628,
220,
5050,
7400,
62,
7783,
62,
86,
62,
4475,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
37043,
312,
2099,
264,
62,
37043,
62,
312,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
69,
335,
378,
2099,
264,
22560,
12,
69,
335,
378,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
81,
62,
8658,
8,
2099,
5474,
8658,
764,
628,
220,
5050,
7400,
62,
7783,
62,
1525,
62,
9521,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
343,
62,
37043,
312,
2099,
1259,
62,
37043,
312,
62,
9521,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
81,
62,
8658,
8,
2099,
5474,
8658,
764,
628,
220,
5050,
7400,
62,
7783,
62,
86,
62,
19554,
66,
62,
17143,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
37266,
2099,
1259,
62,
37266,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
81,
62,
8658,
8,
2099,
5474,
8658,
764,
628,
220,
5050,
7400,
62,
7783,
62,
2302,
974,
62,
1525,
62,
4475,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
69,
335,
378,
2099,
264,
22560,
12,
69,
335,
378,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
81,
62,
8658,
8,
2099,
256,
83,
62,
82,
22560,
62,
2302,
974,
764,
628,
220,
5050,
7400,
62,
39344,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
37043,
312,
2099,
264,
62,
37043,
62,
312,
198,
220,
220,
220,
39133,
198,
220,
220,
220,
220,
220,
5145,
68,
62,
8658,
2099,
5474,
8658,
764,
198,
220,
5050,
7400,
62,
3803,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
37043,
312,
2099,
264,
62,
37043,
62,
312,
198,
220,
220,
220,
5609,
198,
220,
220,
220,
220,
220,
5145,
66,
62,
8658,
2099,
5474,
8658,
764,
628,
220,
5050,
2642,
62,
7783,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
37043,
312,
2099,
264,
62,
37043,
62,
312,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
81,
62,
8658,
8,
2099,
264,
22560,
12,
66,
3258,
312,
764,
628,
220,
5050,
2642,
62,
82,
2135,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
37043,
312,
2099,
264,
22560,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
81,
62,
8658,
8,
2099,
5474,
8658,
764,
628,
220,
5050,
2429,
62,
17143,
62,
16793,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
79,
16,
2099,
1312,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
79,
17,
2099,
537,
522,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
79,
18,
2099,
1366,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
79,
19,
2099,
1366,
11902,
198,
220,
220,
220,
5609,
198,
220,
220,
220,
220,
220,
269,
62,
8658,
2099,
5474,
8658,
13,
628,
220,
5050,
15741,
62,
9288,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
79,
16,
2099,
4731,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
79,
17,
2099,
1312,
11902,
198,
220,
220,
220,
8024,
1988,
7,
81,
62,
2100,
8,
2099,
4731,
764,
628,
220,
5050,
1441,
62,
8367,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
37043,
312,
2099,
264,
62,
37043,
62,
312,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
81,
62,
2100,
8,
2099,
264,
22560,
12,
20888,
764,
628,
220,
5050,
1441,
62,
8367,
62,
86,
62,
4475,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
37043,
312,
2099,
264,
62,
37043,
62,
312,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
69,
335,
378,
2099,
264,
22560,
12,
69,
335,
378,
198,
220,
220,
220,
8024,
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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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
] |
*&---------------------------------------------------------------------*
*& Report ZTMP_SAO_OMVC
*&
*&---------------------------------------------------------------------*
report ztmp_sao_omvc no standard page heading.
*&---------------------------------------------------------------------*
*& Data types and interface
*&---------------------------------------------------------------------*
type-pools icon.
types t_index type sy-index.
types: begin of ts_data,
key type t_index,
text type text20,
end of ts_data.
types tt_data type standard table of ts_data with default key.
*&=====================================================================*
*& Class Model
*&---------------------------------------------------------------------*
class cl_model definition final.
public section.
events data_changed.
methods modified
importing
is_data type ts_data
raising
cx_sy_duplicate_key.
methods remove
raising
cx_sy_duplicate_key.
methods get_all
returning
value(rt_data) type tt_data.
methods get_index
returning
value(r_index) type index.
methods set_index
importing
i_index type t_index
raising
cx_sy_duplicate_key.
private section.
data mt_data type tt_data.
data m_index type t_index.
endclass. "c2 DEFINITION
*&---------------------------------------------------------------------*
* CLASS cl_model IMPLEMENTATION
*----------------------------------------------------------------------*
class cl_model implementation.
method modified.
field-symbols <ls_data> like line of mt_data.
read table mt_data assigning <ls_data> index m_index.
if sy-subrc = 0.
<ls_data>-text = is_data-text.
else.
data l_key type ts_data-key.
data lt_data like mt_data.
lt_data = mt_data.
sort lt_data by key descending.
data ls_data like line of lt_data.
read table lt_data into ls_data index 1.
if sy-subrc = 0.
l_key = ls_data-key + 1.
else.
l_key = 1.
endif.
append initial line to mt_data assigning <ls_data>.
<ls_data>-key = l_key.
<ls_data>-text = is_data-text.
endif.
raise event data_changed.
endmethod. "cl_observer
method remove.
read table mt_data transporting no fields index m_index.
if sy-subrc = 0.
delete mt_data index m_index.
clear m_index.
raise event data_changed.
else.
raise exception type cx_sy_duplicate_key.
endif.
endmethod. "cl_observer
method set_index.
data l_length type i.
l_length = lines( mt_data ).
if i_index >= 0 and i_index <= l_length.
m_index = i_index.
raise event data_changed.
else.
raise exception type cx_sy_duplicate_key.
endif.
endmethod. "cl_observer
method get_all.
rt_data = mt_data.
endmethod. "cl_observer
method get_index.
r_index = m_index.
endmethod. "cl_observer
endclass. "c2 IMPLEMENTATION
*&=====================================================================*
* CLASS cl_frame
*----------------------------------------------------------------------*
class cl_frame_stat definition final.
public section.
class-methods start
importing
i_beg_col type i default 1
i_beg_row type i optional
i_width type i.
class-methods middle.
class-methods line.
class-methods end.
private section.
class-data m_beg_row type i.
class-data m_beg_col type i.
class-data m_end_col type i.
class-data m_length type i.
endclass. "cl_frame
*----------------------------------------------------------------------*
* CLASS cl_frame IMPLEMENTATION
*----------------------------------------------------------------------*
class cl_frame_stat implementation.
method start.
m_beg_col = i_beg_col.
m_beg_row = i_beg_row.
m_end_col = i_beg_col + i_width.
m_length = m_end_col - m_beg_col + 1.
*Позиционируем и выводим текст + боковые границы
data y type i.
y = m_beg_row + 1.
skip to line y.
position m_beg_col.
write '|'.
endmethod. "start
method middle.
write at m_end_col '|'.
data l_hight type i.
l_hight = m_beg_col - m_end_col.
skip to line l_hight.
write at m_beg_col '|'.
endmethod. "middle
method line.
write at m_end_col '|'.
data l_hight type i.
l_hight = m_beg_col - m_end_col.
skip to line l_hight.
*Рисуем промежуточную границу
data y type i.
uline at m_beg_col(m_length).
y = sy-linno + 1.
skip to line y.
write at m_beg_col '|'.
endmethod. "middle
method end.
data l_lin_end type i.
l_lin_end = sy-linno - m_beg_row + 1.
write at m_end_col '|'.
*Рисуем верхнюю границу
skip to line m_beg_row.
uline at m_beg_col(m_length).
*Рисуем нижнюю границу
data y type i.
y = m_beg_row + l_lin_end.
skip to line y.
uline at m_beg_col(m_length).
*Переводим каретку к новой строке
skip to line y.
endmethod. "end
endclass. "cl_frame IMPLEMENTATION
*&=====================================================================*
*& Class View
*&---------------------------------------------------------------------*
class cl_view_form definition final.
public section.
events clear_form.
events save_item
exporting
value(is_data) type ts_data.
events remove_item.
methods constructor
importing
ir_model type ref to cl_model
i_beg_row type i default 1
i_beg_col type i default 1.
methods draw for event data_changed of cl_model.
methods line_sel_event
importing
value(i_row) type t_index
value(i_col) type t_index.
private section.
methods read_data
returning
value(rs_data) type ts_data.
data m_beg_row type i. "Относительная начальная строка контрола
data m_beg_col type i. "Начальный столбец контрола
data m_root_row type i. "Абсолютная начальная строка контрола
data mr_model type ref to cl_model.
endclass. "c2 DEFINITION
*----------------------------------------------------------------------*
* CLASS cl_view IMPLEMENTATION
*----------------------------------------------------------------------*
class cl_view_form implementation.
method constructor.
mr_model = ir_model.
m_beg_col = i_beg_col.
m_beg_row = i_beg_row.
draw( ).
set handler draw for ir_model.
endmethod. "cl_view
method draw.
m_root_row = sy-linno + m_beg_row. "Отступ от верхнего элемента
data l_index type t_index.
l_index = mr_model->get_index( ).
data lt_data type tt_data.
lt_data = mr_model->get_all( ).
data ls_data like line of lt_data.
if l_index is not initial.
read table lt_data into ls_data index l_index.
endif.
*Рисуем форму
set blank lines on.
cl_frame_stat=>start(
i_beg_col = m_beg_col
i_beg_row = m_root_row
i_width = 35 ).
write: (10) 'Key',
(20) ls_data-key color col_heading.
cl_frame_stat=>middle( ).
write: (10) 'Text',
(20) ls_data-text input.
data l_shift type i.
l_shift = m_beg_col + 29.
*Рисуем кнопки
cl_frame_stat=>middle( ).
cl_frame_stat=>middle( ).
format hotspot on.
write: icon_create as icon,
at l_shift icon_delete as icon,
icon_system_save as icon.
format hotspot off.
cl_frame_stat=>end( ).
set blank lines off.
endmethod. "if_observer_item~execute
method line_sel_event.
sy-lsind = 0.
data l_ind type t_index.
l_ind = m_root_row + 4.
data l_col type i.
l_col = i_col - m_beg_col + 1.
if i_row = l_ind.
case l_col.
when 4.
raise event clear_form.
when 31.
raise event remove_item.
when 34.
data ls_data type ts_data.
ls_data = read_data( ).
if ls_data is not initial.
raise event save_item exporting is_data = ls_data.
endif.
endcase.
endif.
endmethod. "line_selection_event
method read_data.
data l_line type string.
data l_val type string.
data l_index type t_index.
l_index = m_root_row + 2.
data l_shift type i.
l_shift = m_beg_col + 12.
read line l_index line value into l_line.
if sy-subrc = 0
and l_line is not initial.
l_val = l_line+l_shift(20).
condense l_val.
rs_data-text = l_val.
endif.
endmethod. "read_data
endclass. "c2 IMPLEMENTATION
*&=====================================================================*
*& Class View
*&---------------------------------------------------------------------*
class cl_view_table definition final.
public section.
events line_selection
exporting
value(i_index) type t_index.
methods constructor
importing
ir_model type ref to cl_model
i_beg_row type i default 1 "Если не заполнено с текущей строки
i_beg_col type i default 1.
methods draw for event data_changed of cl_model.
methods line_sel_event
importing
value(i_row) type t_index.
data m_beg_row type i. "Относительная начальная строка контрола
data m_beg_col type i. "Начальный столбец контрола
data m_root_row type i. "Абсолютная начальная строка контрола
data mr_model type ref to cl_model.
endclass. "c2 DEFINITION
*----------------------------------------------------------------------*
* CLASS cl_view IMPLEMENTATION
*----------------------------------------------------------------------*
class cl_view_table implementation.
method constructor.
mr_model = ir_model.
m_beg_col = i_beg_col.
m_beg_row = i_beg_row.
draw( ).
set handler draw for ir_model.
endmethod. "cl_view
method draw.
m_root_row = sy-linno + m_beg_row. "Отступ от верхнего элемента
data l_index type t_index.
l_index = mr_model->get_index( ).
data lt_data type tt_data.
lt_data = mr_model->get_all( ).
cl_frame_stat=>start(
i_beg_col = m_beg_col
i_beg_row = m_root_row
i_width = 30 ).
format color col_heading.
write: (5) 'Key' centered,
'|', (20) 'Text' centered.
format color off.
cl_frame_stat=>line( ).
if lt_data is not initial.
data ls_data like line of lt_data.
loop at lt_data into ls_data.
if sy-tabix > 1.
cl_frame_stat=>middle( ).
endif.
if sy-tabix = l_index.
format color col_total.
endif.
format hotspot on.
write: (5) ls_data-key, '|', (20) ls_data-text.
format hotspot off.
if sy-tabix = l_index.
format color off.
endif.
endloop.
else.
data l_shift type i.
l_shift = m_beg_col + 8.
write at l_shift '|'.
endif.
cl_frame_stat=>end( ).
endmethod. "if_observer_item~execute
method line_sel_event.
sy-lsind = 0.
data lt_data type tt_data.
lt_data = mr_model->get_all( ).
data l_min type t_index.
l_min = m_root_row + 2.
data l_max type i.
l_max = lines( lt_data ) + l_min + 1.
data l_index type t_index.
if i_row > l_min
and i_row <= l_max.
l_index = i_row - l_min.
raise event line_selection exporting i_index = l_index.
endif.
endmethod. "line_selection_event
endclass. "c2 IMPLEMENTATION
*&=====================================================================*
*& Class Controller
*&---------------------------------------------------------------------*
class cl_contr definition final.
public section.
methods constructor
importing
ir_model type ref to cl_model
ir_view_form type ref to cl_view_form
ir_view_table type ref to cl_view_table.
methods clear_form
for event clear_form of cl_view_form.
methods save_item
for event save_item of cl_view_form
importing is_data.
methods remove_item
for event remove_item of cl_view_form.
methods line_sel
for event line_selection of cl_view_table
importing i_index.
private section.
data mr_model type ref to cl_model.
constants mc_err_mess type sy-msgv1 value 'No line selected'.
endclass. "c2 DEFINITION
*----------------------------------------------------------------------*
* CLASS cl_view IMPLEMENTATION
*----------------------------------------------------------------------*
class cl_contr implementation.
method constructor.
set handler clear_form for ir_view_form.
set handler save_item for ir_view_form.
set handler remove_item for ir_view_form.
set handler line_sel for ir_view_table.
mr_model = ir_model.
endmethod. "cl_view
method line_sel.
try.
mr_model->set_index( i_index ).
catch cx_sy_duplicate_key.
message e001(00) with mc_err_mess.
endtry.
endmethod. "line_selection
method clear_form.
mr_model->set_index( 0 ).
endmethod. "add_item
method save_item.
mr_model->modified( is_data ).
endmethod. "add_item
method remove_item.
try.
mr_model->remove( ).
catch cx_sy_duplicate_key.
message e001(00) with mc_err_mess.
endtry.
endmethod. "remove_item
endclass. "c2 IMPLEMENTATION
*&=====================================================================*
start-of-selection.
data gr_model type ref to cl_model.
create object gr_model.
data gr_view_form type ref to cl_view_form.
create object gr_view_form
exporting
ir_model = gr_model
i_beg_row = 5
i_beg_col = 10.
data gr_view_table type ref to cl_view_table.
create object gr_view_table
exporting
ir_model = gr_model
i_beg_row = 1
i_beg_col = 20.
data gr_contr type ref to cl_contr.
create object gr_contr
exporting
ir_model = gr_model
ir_view_form = gr_view_form
ir_view_table = gr_view_table.
at line-selection.
gr_view_form->line_sel_event( i_row = sy-lilli i_col = sy-cucol ).
gr_view_table->line_sel_event( sy-lilli ).
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
220,
1168,
51,
7378,
62,
4090,
46,
62,
2662,
15922,
198,
9,
5,
198,
9,
5,
10097,
30934,
9,
198,
13116,
220,
1976,
22065,
62,
82,
5488,
62,
296,
28435,
645,
3210,
2443,
9087,
13,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
6060,
3858,
290,
7071,
198,
9,
5,
10097,
30934,
9,
198,
4906,
12,
7742,
82,
7196,
13,
198,
198,
19199,
256,
62,
9630,
2099,
827,
12,
9630,
13,
198,
198,
19199,
25,
2221,
286,
40379,
62,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
1994,
2099,
256,
62,
9630,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
2420,
2099,
2420,
1238,
11,
198,
220,
220,
220,
220,
220,
220,
886,
286,
40379,
62,
7890,
13,
198,
198,
19199,
256,
83,
62,
7890,
2099,
3210,
3084,
286,
40379,
62,
7890,
351,
4277,
1994,
13,
198,
9,
5,
23926,
1421,
28,
9,
198,
9,
5,
5016,
9104,
198,
9,
5,
10097,
30934,
9,
198,
4871,
537,
62,
19849,
6770,
2457,
13,
198,
220,
1171,
2665,
13,
198,
220,
220,
220,
2995,
1366,
62,
40985,
13,
628,
220,
220,
220,
5050,
9518,
198,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
318,
62,
7890,
2099,
40379,
62,
7890,
198,
220,
220,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
1837,
62,
646,
489,
5344,
62,
2539,
13,
628,
220,
220,
220,
5050,
4781,
198,
220,
220,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
1837,
62,
646,
489,
5344,
62,
2539,
13,
628,
220,
220,
220,
5050,
651,
62,
439,
198,
220,
220,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
7,
17034,
62,
7890,
8,
2099,
256,
83,
62,
7890,
13,
628,
220,
220,
220,
5050,
651,
62,
9630,
198,
220,
220,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
7,
81,
62,
9630,
8,
2099,
6376,
13,
628,
220,
220,
220,
5050,
900,
62,
9630,
198,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
9630,
2099,
256,
62,
9630,
198,
220,
220,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
1837,
62,
646,
489,
5344,
62,
2539,
13,
628,
220,
2839,
2665,
13,
198,
220,
220,
220,
1366,
45079,
62,
7890,
2099,
256,
83,
62,
7890,
13,
198,
220,
220,
220,
1366,
285,
62,
9630,
2099,
256,
62,
9630,
13,
198,
437,
4871,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
66,
17,
5550,
20032,
17941,
198,
9,
5,
10097,
30934,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
537,
62,
19849,
30023,
2538,
10979,
6234,
198,
9,
10097,
23031,
9,
198,
4871,
537,
62,
19849,
7822,
13,
628,
220,
2446,
9518,
13,
198,
220,
220,
220,
2214,
12,
1837,
2022,
10220,
1279,
7278,
62,
7890,
29,
588,
1627,
286,
45079,
62,
7890,
13,
628,
220,
220,
220,
1100,
3084,
45079,
62,
7890,
38875,
1279,
7278,
62,
7890,
29,
6376,
285,
62,
9630,
13,
198,
220,
220,
220,
611,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
1279,
7278,
62,
7890,
29,
12,
5239,
796,
318,
62,
7890,
12,
5239,
13,
198,
220,
220,
220,
2073,
13,
198,
220,
220,
220,
220,
220,
1366,
300,
62,
2539,
2099,
40379,
62,
7890,
12,
2539,
13,
628,
220,
220,
220,
220,
220,
1366,
300,
83,
62,
7890,
588,
45079,
62,
7890,
13,
198,
220,
220,
220,
220,
220,
300,
83,
62,
7890,
796,
45079,
62,
7890,
13,
198,
220,
220,
220,
220,
220,
3297,
300,
83,
62,
7890,
416,
1994,
31491,
13,
628,
220,
220,
220,
220,
220,
1366,
43979,
62,
7890,
588,
1627,
286,
300,
83,
62,
7890,
13,
198,
220,
220,
220,
220,
220,
1100,
3084,
300,
83,
62,
7890,
656,
43979,
62,
7890,
6376,
352,
13,
198,
220,
220,
220,
220,
220,
611,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
300,
62,
2539,
796,
43979,
62,
7890,
12,
2539,
1343,
352,
13,
198,
220,
220,
220,
220,
220,
2073,
13,
198,
220,
220,
220,
220,
220,
220,
220,
300,
62,
2539,
796,
352,
13,
198,
220,
220,
220,
220,
220,
45762,
13,
628,
220,
220,
220,
220,
220,
24443,
4238,
1627,
284,
45079,
62,
7890,
38875,
1279,
7278,
62,
7890,
28401,
198,
220,
220,
220,
220,
220,
1279,
7278,
62,
7890,
29,
12,
2539,
796,
300,
62,
2539,
13,
198,
220,
220,
220,
220,
220,
1279,
7278,
62,
7890,
29,
12,
5239,
796,
318,
62,
7890,
12,
5239,
13,
198,
220,
220,
220,
45762,
13,
628,
220,
220,
220,
5298,
1785,
1366,
62,
40985,
13,
198,
220,
886,
24396,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
565,
62,
672,
15388,
628,
220,
2446,
4781,
13,
198,
220,
220,
220,
1100,
3084,
45079,
62,
7890,
32331,
645,
7032,
6376,
285,
62,
9630,
13,
198,
220,
220,
220,
611,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
12233,
45079,
62,
7890,
6376,
285,
62,
9630,
13,
198,
220,
220,
220,
220,
220,
1598,
285,
62,
9630,
13,
198,
220,
220,
220,
220,
220,
5298,
1785,
1366,
62,
40985,
13,
198,
220,
220,
220,
2073,
13,
198,
220,
220,
220,
220,
220,
5298,
6631,
2099,
43213,
62,
1837,
62,
646,
489,
5344,
62,
2539,
13,
198,
220,
220,
220,
45762,
13,
198,
220,
886,
24396,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
565,
62,
672,
15388,
628,
220,
2446,
900,
62,
9630,
13,
198,
220,
220,
220,
1366,
300,
62,
13664,
2099,
1312,
13,
198,
220,
220,
220,
300,
62,
13664,
796,
3951,
7,
45079,
62,
7890,
6739,
628,
220,
220,
220,
611,
1312,
62,
9630,
18189,
657,
290,
1312,
62,
9630,
19841,
300,
62,
13664
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_gui_page_sett_info DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_gui_component
FINAL
CREATE PRIVATE .
PUBLIC SECTION.
INTERFACES zif_abapgit_gui_event_handler .
INTERFACES zif_abapgit_gui_renderable .
CLASS-METHODS create
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo
RETURNING
VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable
RAISING
zcx_abapgit_exception .
METHODS constructor
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo
RAISING
zcx_abapgit_exception .
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_stats,
measure TYPE string,
local TYPE i,
remote TYPE i,
END OF ty_stats .
TYPES:
BEGIN OF ty_infos,
size TYPE p LENGTH 16 DECIMALS 0,
line TYPE p LENGTH 16 DECIMALS 0,
sloc TYPE p LENGTH 16 DECIMALS 0,
END OF ty_infos .
CONSTANTS:
BEGIN OF c_id,
info TYPE string VALUE 'info',
created_by TYPE string VALUE 'created_by',
created_at TYPE string VALUE 'created_at',
deserialized_by TYPE string VALUE 'deserialized_by',
deserialized_at TYPE string VALUE 'deserialized_at',
stats TYPE string VALUE 'stats',
stats_table TYPE string VALUE 'stats_table',
END OF c_id .
CONSTANTS:
BEGIN OF c_event,
go_back TYPE string VALUE 'go-back',
save TYPE string VALUE 'save',
END OF c_event .
DATA mo_form TYPE REF TO zcl_abapgit_html_form .
DATA mo_form_data TYPE REF TO zcl_abapgit_string_map .
DATA mo_repo TYPE REF TO zcl_abapgit_repo .
DATA:
mt_stats TYPE STANDARD TABLE OF ty_stats WITH KEY measure .
METHODS get_form_schema
RETURNING
VALUE(ro_form) TYPE REF TO zcl_abapgit_html_form
RAISING
zcx_abapgit_exception .
METHODS read_settings
RAISING
zcx_abapgit_exception .
METHODS read_stats
RAISING
zcx_abapgit_exception .
METHODS read_stats_files
EXPORTING
!et_local TYPE zif_abapgit_definitions=>ty_files_item_tt
!et_remote TYPE zif_abapgit_definitions=>ty_files_tt
RAISING
zcx_abapgit_exception .
METHODS read_stats_state
RAISING
zcx_abapgit_exception .
METHODS read_stats_size_lines_sloc
IMPORTING
!it_local TYPE zif_abapgit_definitions=>ty_files_item_tt
!it_remote TYPE zif_abapgit_definitions=>ty_files_tt
EXPORTING
!et_local_items TYPE zif_abapgit_definitions=>ty_items_tt
!et_remote_items TYPE zif_abapgit_definitions=>ty_items_tt
RAISING
zcx_abapgit_exception .
METHODS read_stats_file
IMPORTING
!is_file TYPE zif_abapgit_definitions=>ty_file
RETURNING
VALUE(rs_info) TYPE ty_infos .
METHODS read_stats_objects
CHANGING
!ct_local_items TYPE zif_abapgit_definitions=>ty_items_tt
!ct_remote_items TYPE zif_abapgit_definitions=>ty_items_tt
RAISING
zcx_abapgit_exception .
METHODS format_user
IMPORTING
!iv_username TYPE xubname
RETURNING
VALUE(rv_user) TYPE string .
METHODS format_timestamp
IMPORTING
!iv_timestamp TYPE timestampl
RETURNING
VALUE(rv_timestamp) TYPE string .
METHODS format_size
IMPORTING
!iv_size TYPE i
RETURNING
VALUE(rv_size) TYPE string .
ENDCLASS.
CLASS zcl_abapgit_gui_page_sett_info IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
CREATE OBJECT mo_form_data.
mo_repo = io_repo.
mo_form = get_form_schema( ).
ENDMETHOD.
METHOD create.
DATA lo_component TYPE REF TO zcl_abapgit_gui_page_sett_info.
CREATE OBJECT lo_component
EXPORTING
io_repo = io_repo.
ri_page = zcl_abapgit_gui_page_hoc=>create(
iv_page_title = 'Repository Stats'
io_page_menu = zcl_abapgit_gui_chunk_lib=>settings_repo_toolbar(
iv_key = io_repo->get_key( )
iv_act = zif_abapgit_definitions=>c_action-repo_infos )
ii_child_component = lo_component ).
ENDMETHOD.
METHOD format_size.
DATA:
lv_size TYPE p LENGTH 16 DECIMALS 2.
IF iv_size > 1024 * 1024 * 1024.
lv_size = iv_size / 1024 / 1024 / 1024.
rv_size = |{ lv_size } GB|.
ELSEIF iv_size > 1024 * 1024.
lv_size = iv_size / 1024 / 1024.
rv_size = |{ lv_size } MB|.
ELSEIF iv_size > 1024.
lv_size = iv_size / 1024.
rv_size = |{ lv_size } KB|.
ELSE.
rv_size = |{ iv_size } Bytes|.
ENDIF.
ENDMETHOD.
METHOD format_timestamp.
IF iv_timestamp IS INITIAL.
rv_timestamp = 'n/a'.
RETURN.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_TIMES_OUTPUT'
EXPORTING
input = iv_timestamp
IMPORTING
output = rv_timestamp.
ENDMETHOD.
METHOD format_user.
DATA:
ls_user_address TYPE addr3_val,
lv_title TYPE string.
IF iv_username IS INITIAL.
rv_user = 'n/a'.
RETURN.
ENDIF.
IF iv_username <> zcl_abapgit_objects_super=>c_user_unknown.
CALL FUNCTION 'SUSR_USER_ADDRESS_READ'
EXPORTING
user_name = iv_username
IMPORTING
user_address = ls_user_address
EXCEPTIONS
user_address_not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
lv_title = ls_user_address-name_text.
ENDIF.
ENDIF.
rv_user = iv_username.
IF lv_title IS NOT INITIAL.
rv_user = |{ rv_user } ({ lv_title })|.
ENDIF.
ENDMETHOD.
METHOD get_form_schema.
DATA lv_label TYPE string.
ro_form = zcl_abapgit_html_form=>create(
iv_form_id = 'repo-infos-form'
iv_help_page = 'https://docs.abapgit.org/guide-repo-infos.html' ).
IF mo_repo->is_offline( ) = abap_true.
lv_label = 'ZIP File'.
ELSE.
lv_label = 'Remote'.
ENDIF.
ro_form->start_group(
iv_name = c_id-info
iv_label = 'Stats'
)->text(
iv_name = c_id-created_by
iv_label = 'Created By'
iv_readonly = abap_true
)->text(
iv_name = c_id-created_at
iv_label = 'Created At'
iv_readonly = abap_true
)->text(
iv_name = c_id-deserialized_by
iv_label = 'Last Deserialized By'
iv_readonly = abap_true
)->text(
iv_name = c_id-deserialized_at
iv_label = 'Last Deserialized At'
iv_readonly = abap_true
)->table(
iv_name = c_id-stats_table
iv_label = 'Statistics'
)->column(
iv_label = 'Measure'
iv_width = '50%'
iv_readonly = abap_true
)->column(
iv_label = 'Local'
iv_width = '25%'
iv_readonly = abap_true
)->column(
iv_label = lv_label
iv_width = '25%'
iv_readonly = abap_true
)->command(
iv_label = 'Back'
iv_action = c_event-go_back ).
ENDMETHOD.
METHOD read_settings.
DATA:
ls_repo TYPE zif_abapgit_persistence=>ty_repo,
ls_stats TYPE ty_stats,
lv_row TYPE i,
lv_int TYPE i,
lv_val TYPE string.
" Get infos from DB
TRY.
ls_repo = zcl_abapgit_persist_factory=>get_repo( )->read( mo_repo->get_key( ) ).
CATCH zcx_abapgit_not_found.
zcx_abapgit_exception=>raise( |Repo not found, key { mo_repo->get_key( ) }| ).
ENDTRY.
read_stats( ).
" Infos
mo_form_data->set(
iv_key = c_id-created_by
iv_val = format_user( ls_repo-created_by ) ).
mo_form_data->set(
iv_key = c_id-created_at
iv_val = format_timestamp( ls_repo-created_at ) ).
mo_form_data->set(
iv_key = c_id-deserialized_by
iv_val = format_user( ls_repo-deserialized_by ) ).
mo_form_data->set(
iv_key = c_id-deserialized_at
iv_val = format_timestamp( ls_repo-deserialized_at ) ).
LOOP AT mt_stats INTO ls_stats.
lv_row = sy-tabix.
DO 3 TIMES.
CASE sy-index.
WHEN 1.
lv_val = ls_stats-measure.
WHEN 2.
lv_val = ls_stats-local.
WHEN 3.
lv_val = ls_stats-remote.
ENDCASE.
IF ls_stats-measure CS 'Size' AND sy-index BETWEEN 2 AND 3.
lv_int = lv_val.
lv_val = format_size( lv_int ).
ENDIF.
mo_form_data->set(
iv_key = |{ c_id-stats_table }-{ lv_row }-{ sy-index }|
iv_val = lv_val ).
ENDDO.
ENDLOOP.
mo_form_data->set(
iv_key = |{ c_id-stats_table }-{ zif_abapgit_html_form=>c_rows }|
iv_val = |{ lv_row }| ).
ENDMETHOD.
METHOD read_stats.
DATA:
lt_local TYPE zif_abapgit_definitions=>ty_files_item_tt,
lt_remote TYPE zif_abapgit_definitions=>ty_files_tt,
lt_local_items TYPE zif_abapgit_definitions=>ty_items_tt,
lt_remote_items TYPE zif_abapgit_definitions=>ty_items_tt.
CLEAR mt_stats.
read_stats_files(
IMPORTING
et_local = lt_local
et_remote = lt_remote ).
read_stats_state( ).
read_stats_size_lines_sloc(
EXPORTING
it_local = lt_local
it_remote = lt_remote
IMPORTING
et_local_items = lt_local_items
et_remote_items = lt_remote_items ).
read_stats_objects(
CHANGING
ct_local_items = lt_local_items
ct_remote_items = lt_remote_items ).
ENDMETHOD.
METHOD read_stats_file.
DATA:
lv_code TYPE string,
lt_code TYPE abaptxt255_tab.
FIELD-SYMBOLS:
<ls_code> LIKE LINE OF lt_code.
rs_info-size = xstrlen( is_file-data ).
IF is_file-filename CP '*.abap'.
lv_code = zcl_abapgit_convert=>xstring_to_string_utf8( is_file-data ).
SPLIT lv_code AT zif_abapgit_definitions=>c_newline INTO TABLE lt_code.
rs_info-line = lines( lt_code ).
LOOP AT lt_code ASSIGNING <ls_code> WHERE table_line IS NOT INITIAL AND table_line(1) <> '*'.
SHIFT <ls_code>-line LEFT DELETING LEADING space.
IF <ls_code>-line(1) <> '"'.
rs_info-sloc = rs_info-sloc + 1.
ENDIF.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD read_stats_files.
DATA ls_stats TYPE ty_stats.
et_local = mo_repo->get_files_local( ).
ls_stats-measure = 'Number of Files'.
ls_stats-local = lines( et_local ).
IF mo_repo->has_remote_source( ) = abap_true.
et_remote = mo_repo->get_files_remote( ).
ls_stats-remote = lines( et_remote ).
ENDIF.
APPEND ls_stats TO mt_stats.
IF et_remote IS NOT INITIAL.
ls_stats-measure = 'Number of Ignored Files'.
ls_stats-local = ls_stats-remote - ls_stats-local.
IF ls_stats-local < 0.
ls_stats-local = 0.
ENDIF.
ls_stats-remote = 0.
APPEND ls_stats TO mt_stats.
ENDIF.
ENDMETHOD.
METHOD read_stats_objects.
DATA:
ls_stats TYPE ty_stats,
ls_item TYPE zif_abapgit_definitions=>ty_item,
lt_supported_types TYPE zcl_abapgit_objects=>ty_types_tt.
ls_stats-measure = 'Number of Objects'.
DELETE ct_local_items WHERE obj_type IS INITIAL OR obj_name IS INITIAL.
ls_stats-local = lines( ct_local_items ).
DELETE ct_remote_items WHERE obj_type IS INITIAL OR obj_name IS INITIAL.
ls_stats-remote = lines( ct_remote_items ).
APPEND ls_stats TO mt_stats.
CLEAR ls_stats.
ls_stats-measure = 'Number of Unsupported Objects'.
ls_stats-local = lines( mo_repo->get_unsupported_objects_local( ) ).
lt_supported_types = zcl_abapgit_objects=>supported_list( ).
LOOP AT ct_remote_items INTO ls_item.
READ TABLE lt_supported_types WITH KEY table_line = ls_item-obj_type TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
ls_stats-remote = ls_stats-remote + 1.
ENDIF.
ENDLOOP.
APPEND ls_stats TO mt_stats.
ENDMETHOD.
METHOD read_stats_size_lines_sloc.
DATA:
ls_stats TYPE ty_stats,
lv_ignored TYPE abap_bool,
ls_info_file TYPE ty_infos,
ls_info_local TYPE ty_infos,
ls_info_remote TYPE ty_infos,
ls_item TYPE zif_abapgit_definitions=>ty_item.
FIELD-SYMBOLS:
<ls_local> LIKE LINE OF it_local,
<ls_remote> LIKE LINE OF it_remote.
LOOP AT it_local ASSIGNING <ls_local>.
ls_info_file = read_stats_file( <ls_local>-file ).
ls_info_local-size = ls_info_local-size + ls_info_file-size.
ls_info_local-line = ls_info_local-line + ls_info_file-line.
ls_info_local-sloc = ls_info_local-sloc + ls_info_file-sloc.
COLLECT <ls_local>-item INTO et_local_items.
ENDLOOP.
IF mo_repo->has_remote_source( ) = abap_true.
LOOP AT it_remote ASSIGNING <ls_remote>.
ls_info_file = read_stats_file( <ls_remote> ).
ls_info_remote-size = ls_info_remote-size + ls_info_file-size.
ls_info_remote-line = ls_info_remote-line + ls_info_file-line.
ls_info_remote-sloc = ls_info_remote-sloc + ls_info_file-sloc.
lv_ignored = mo_repo->get_dot_abapgit( )->is_ignored(
iv_filename = <ls_remote>-filename
iv_path = <ls_remote>-path ).
IF <ls_remote>-filename IS NOT INITIAL AND lv_ignored = abap_false.
TRY.
zcl_abapgit_file_status=>identify_object(
EXPORTING
iv_filename = <ls_remote>-filename
iv_path = <ls_remote>-path
iv_devclass = mo_repo->get_package( )
io_dot = mo_repo->get_dot_abapgit( )
IMPORTING
es_item = ls_item ).
COLLECT ls_item INTO et_remote_items.
CATCH zcx_abapgit_exception ##NO_HANDLER.
ENDTRY.
ENDIF.
ENDLOOP.
ENDIF.
ls_stats-measure = 'Size of Files'.
ls_stats-local = ls_info_local-size.
ls_stats-remote = ls_info_remote-size.
APPEND ls_stats TO mt_stats.
ls_stats-measure = 'Lines in ABAP Files'.
ls_stats-local = ls_info_local-line.
ls_stats-remote = ls_info_remote-line.
APPEND ls_stats TO mt_stats.
ls_stats-measure = 'Lines of Code in ABAP Files'.
ls_stats-local = ls_info_local-sloc.
ls_stats-remote = ls_info_remote-sloc.
APPEND ls_stats TO mt_stats.
ENDMETHOD.
METHOD read_stats_state.
DATA:
lt_results TYPE zif_abapgit_definitions=>ty_results_tt,
lv_state TYPE c LENGTH 1,
ls_stats TYPE ty_stats.
FIELD-SYMBOLS:
<ls_result> LIKE LINE OF lt_results.
lt_results = zcl_abapgit_file_status=>status( mo_repo ).
DO 3 TIMES.
CLEAR ls_stats.
CASE sy-index.
WHEN 1.
ls_stats-measure = 'Number of Modified Files'.
lv_state = zif_abapgit_definitions=>c_state-modified.
WHEN 2.
ls_stats-measure = 'Number of Added Files'.
lv_state = zif_abapgit_definitions=>c_state-added.
WHEN 3.
ls_stats-measure = 'Number of Deleted Files'.
lv_state = zif_abapgit_definitions=>c_state-deleted.
ENDCASE.
LOOP AT lt_results ASSIGNING <ls_result>.
IF <ls_result>-lstate = lv_state.
ls_stats-local = ls_stats-local + 1.
ENDIF.
IF <ls_result>-rstate = lv_state AND mo_repo->has_remote_source( ) = abap_true.
ls_stats-remote = ls_stats-remote + 1.
ENDIF.
ENDLOOP.
APPEND ls_stats TO mt_stats.
ENDDO.
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
IF ii_event->mv_action = c_event-go_back.
rs_handled-state = zcl_abapgit_gui=>c_event_state-go_back_to_bookmark.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_gui_renderable~render.
gui_services( )->register_event_handler( me ).
read_settings( ).
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->add( `<div class="repo">` ).
ri_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top(
io_repo = mo_repo
iv_show_commit = abap_false
iv_interactive_branch = abap_true ) ).
ri_html->add( `</div>` ).
ri_html->add( mo_form->render( mo_form_data ) ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
17744,
62,
10951,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
42895,
198,
220,
25261,
198,
220,
29244,
6158,
4810,
3824,
6158,
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,
764,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
13287,
540,
764,
628,
220,
220,
220,
42715,
12,
49273,
50,
2251,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
260,
7501,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
7700,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
13287,
540,
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,
952,
62,
260,
7501,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
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,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
34242,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3953,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1957,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
6569,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
34242,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
10745,
418,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2546,
41876,
279,
406,
49494,
1467,
27196,
3955,
23333,
657,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1627,
41876,
279,
406,
49494,
1467,
27196,
3955,
23333,
657,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1017,
420,
41876,
279,
406,
49494,
1467,
27196,
3955,
23333,
657,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
10745,
418,
764,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
7508,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
10951,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
2727,
62,
1525,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
25598,
62,
1525,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
2727,
62,
265,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
25598,
62,
265,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
748,
48499,
1143,
62,
1525,
41876,
4731,
26173,
8924,
705,
8906,
48499,
1143,
62,
1525,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
748,
48499,
1143,
62,
265,
41876,
4731,
26173,
8924,
705,
8906,
48499,
1143,
62,
265,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
9756,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
34242,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
9756,
62,
11487,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
34242,
62,
11487,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
312,
764,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
15596,
11,
198,
220,
220,
220,
220,
220,
220,
220,
467,
62,
1891,
41876,
4731,
26173,
8924,
705,
2188,
12,
1891,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
3613,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
21928,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
15596,
764,
198,
220,
220,
220,
42865,
6941,
62,
687,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
687,
764,
198,
220,
220,
220,
42865,
6941,
62,
687,
62,
7890,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
8841,
62,
8899,
764,
198,
220,
220,
220,
42865,
6941,
62,
260,
7501,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
764,
198,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
45079,
62,
34242,
41876,
49053,
9795,
43679,
3963,
1259,
62,
34242,
13315,
35374,
3953,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
687,
62,
15952,
2611,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
687,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
687,
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,
1100,
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,
1100,
62,
34242,
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,
1100,
62,
34242,
62,
16624,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_object_scp1 DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_objects_super
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_object .
PROTECTED SECTION.
TYPES:
BEGIN OF ty_scp1,
scprattr TYPE scprattr,
scprtext TYPE STANDARD TABLE OF scprtext WITH DEFAULT KEY,
scprvals TYPE STANDARD TABLE OF scprvals WITH DEFAULT KEY,
scprvall TYPE STANDARD TABLE OF scprvall WITH DEFAULT KEY,
scprreca TYPE STANDARD TABLE OF scprreca WITH DEFAULT KEY,
scprfldv TYPE STANDARD TABLE OF scprfldv WITH DEFAULT KEY,
END OF ty_scp1 .
METHODS dequeue .
METHODS enqueue
RAISING
zcx_abapgit_exception .
METHODS save
IMPORTING
!is_scp1 TYPE ty_scp1
RAISING
zcx_abapgit_exception .
METHODS adjust_inbound
CHANGING
!cs_scp1 TYPE ty_scp1 .
METHODS adjust_outbound
CHANGING
!cs_scp1 TYPE ty_scp1 .
METHODS load
CHANGING
!cs_scp1 TYPE ty_scp1 .
METHODS call_delete_fms
IMPORTING iv_profile_id TYPE scpr_id
RAISING zcx_abapgit_exception.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_SCP1 IMPLEMENTATION.
METHOD adjust_inbound.
FIELD-SYMBOLS: <ls_scprvals> TYPE scprvals,
<ls_scprreca> TYPE scprreca,
<ls_scprvall> TYPE scprvall.
* back to internal format
LOOP AT cs_scp1-scprvals ASSIGNING <ls_scprvals>.
SHIFT <ls_scprvals>-recnumber RIGHT DELETING TRAILING space.
ENDLOOP.
LOOP AT cs_scp1-scprreca ASSIGNING <ls_scprreca>.
SHIFT <ls_scprreca>-recnumber RIGHT DELETING TRAILING space.
ENDLOOP.
LOOP AT cs_scp1-scprvall ASSIGNING <ls_scprvall>.
SHIFT <ls_scprvall>-recnumber RIGHT DELETING TRAILING space.
ENDLOOP.
ENDMETHOD.
METHOD adjust_outbound.
FIELD-SYMBOLS: <ls_scprvals> TYPE scprvals,
<ls_scprreca> TYPE scprreca,
<ls_scprvall> TYPE scprvall.
* normalize the XML
LOOP AT cs_scp1-scprvals ASSIGNING <ls_scprvals>.
CONDENSE <ls_scprvals>-recnumber.
ENDLOOP.
LOOP AT cs_scp1-scprreca ASSIGNING <ls_scprreca>.
CONDENSE <ls_scprreca>-recnumber.
ENDLOOP.
LOOP AT cs_scp1-scprvall ASSIGNING <ls_scprvall>.
CONDENSE <ls_scprvall>-recnumber.
ENDLOOP.
ENDMETHOD.
METHOD call_delete_fms.
CONSTANTS lc_version_new TYPE c VALUE 'N' ##NO_TEXT. "Include SCPRINTCONST version_new
CONSTANTS lc_operation_delete TYPE c VALUE 'D' ##NO_TEXT.
DATA lv_profile_type TYPE scprattr-type.
DATA lt_fatherprofiles TYPE STANDARD TABLE OF scproprof WITH DEFAULT KEY.
DATA ls_fatherprofile TYPE scproprof.
CALL FUNCTION 'SCPR_DB_ATTR_GET_DETAIL'
EXPORTING
profid = iv_profile_id
version = lc_version_new
IMPORTING
proftype = lv_profile_type
EXCEPTIONS
OTHERS = 0.
CALL FUNCTION 'SCPR_PRSET_DB_USED_IN'
EXPORTING
profid = iv_profile_id
version = lc_version_new
TABLES
profiles = lt_fatherprofiles.
ls_fatherprofile-id = iv_profile_id.
APPEND ls_fatherprofile TO lt_fatherprofiles.
CALL FUNCTION 'SCPR_CT_TRANSPORT_ENTRIES'
TABLES
profids = lt_fatherprofiles
EXCEPTIONS
error_in_transport_layer = 1
user_abort = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |error while deleting SCP1 - TRANSPORT, { sy-subrc }| ).
ENDIF.
CALL FUNCTION 'SCPR_PRSET_DB_DELETE_ALL'
EXPORTING
profid = iv_profile_id
proftype = lv_profile_type
TABLES
fatherprofs = lt_fatherprofiles
EXCEPTIONS
user_abort = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |error while deleting SCP1 - DB_DELETE, { sy-subrc }| ).
ENDIF.
CALL FUNCTION 'SCPR_MEM_SCPR_ACTIONS_ADD'
EXPORTING
bcset_id = iv_profile_id
operation = lc_operation_delete.
ENDMETHOD.
METHOD dequeue.
DATA: lv_id TYPE scpr_id.
lv_id = ms_item-obj_name.
CALL FUNCTION 'SCPR_SV_DEQUEUE_BCSET'
EXPORTING
bcset_id = lv_id.
ENDMETHOD.
METHOD enqueue.
DATA: lv_id TYPE scpr_id.
lv_id = ms_item-obj_name.
CALL FUNCTION 'SCPR_SV_ENQUEUE_BCSET'
EXPORTING
bcset_id = lv_id
EXCEPTIONS
is_already_locked = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |SCP1 locking error| ).
ENDIF.
ENDMETHOD.
METHOD load.
CALL FUNCTION 'SCPR_TEXT_GET'
EXPORTING
profid = cs_scp1-scprattr-id
category = cs_scp1-scprattr-category
TABLES
texts = cs_scp1-scprtext
EXCEPTIONS
no_text_found = 1.
CALL FUNCTION 'SCPR_TEMPL_DB_VALS_GET_DETAIL'
EXPORTING
profid = cs_scp1-scprattr-id
category = cs_scp1-scprattr-category
TABLES
values = cs_scp1-scprvals
valuesl = cs_scp1-scprvall
recattr = cs_scp1-scprreca.
CALL FUNCTION 'SCPR_TEMPL_DB_FLDTXTVAR_GET'
EXPORTING
bcset_id = cs_scp1-scprattr-id
category = cs_scp1-scprattr-category
TABLES
it_fldv = cs_scp1-scprfldv.
ENDMETHOD.
METHOD save.
DATA: ls_scp1 TYPE ty_scp1,
ls_text TYPE scprtext.
* copy everything to local, the function module changes the values
ls_scp1 = is_scp1.
READ TABLE ls_scp1-scprtext INTO ls_text WITH KEY langu = sy-langu.
CALL FUNCTION 'SCPR_TEMPL_MN_TEMPLATE_SAVE'
EXPORTING
profid = ls_scp1-scprattr-id
proftext = ls_text-text
category = ls_scp1-scprattr-category
cli_dep = ls_scp1-scprattr-cli_dep
cli_cas = ls_scp1-scprattr-cli_cas
reftype = ls_scp1-scprattr-reftype
refname = ls_scp1-scprattr-refname
orgid = ls_scp1-scprattr-orgid
component = ls_scp1-scprattr-component
minrelease = ls_scp1-scprattr-minrelease
maxrelease = ls_scp1-scprattr-maxrelease
act_info = ls_scp1-scprattr-act_info
bcset_type = ls_scp1-scprattr-type
fldtxtvar_supplied = 'YES'
with_transp_insert = abap_false
with_progress_indicator = abap_true
remove_denied_data = abap_true
ask_for_cont_after_remove = abap_true
TABLES
values = ls_scp1-scprvals
valuesl = ls_scp1-scprvall
recattr = ls_scp1-scprreca
it_fldv = ls_scp1-scprfldv
texts = ls_scp1-scprtext
EXCEPTIONS
user_abort = 1
error_in_transport_layer = 2
inconsistent_data = 3
database_error = 4
OTHERS = 5.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error saving SCP1, { sy-tabix }| ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
SELECT SINGLE modifier INTO rv_user FROM scprattr
WHERE id = ms_item-obj_name
AND version = 'N'.
IF sy-subrc <> 0 OR rv_user IS INITIAL.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_profile_id TYPE scpr_id.
lv_profile_id = ms_item-obj_name.
enqueue( ).
call_delete_fms( lv_profile_id ).
dequeue( ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_scp1 TYPE ty_scp1.
io_xml->read(
EXPORTING iv_name = 'SCP1'
CHANGING cg_data = ls_scp1 ).
adjust_inbound( CHANGING cs_scp1 = ls_scp1 ).
IF ls_scp1-scprattr-type = 'TMP'.
* todo, function module SCPR_PRSET_MN_BCSET_SAVE
zcx_abapgit_exception=>raise( |todo, SCP1| ).
ELSE.
save( ls_scp1 ).
ENDIF.
dequeue( ).
tadir_insert( iv_package ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_rc TYPE sy-subrc,
lv_profid TYPE scprattr-id.
lv_profid = ms_item-obj_name.
CALL FUNCTION 'SCPR_BCSET_EXISTS'
EXPORTING
profid = lv_profid
IMPORTING
rc = lv_rc.
rv_bool = boolc( lv_rc = 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.
DATA: lv_display_only TYPE scpr_txt20,
lv_bcset_id TYPE scpr_id.
lv_display_only = abap_false.
lv_bcset_id = ms_item-obj_name.
EXPORT scpr3_display_only = lv_display_only
scpr3_bcset_id = lv_bcset_id
TO MEMORY ID 'SCPR3_PARAMETER'.
SUBMIT scpr3 AND RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: ls_scp1 TYPE ty_scp1.
ls_scp1-scprattr-id = ms_item-obj_name.
CALL FUNCTION 'SCPR_DB_ATTR_GET_DETAIL'
EXPORTING
profid = ls_scp1-scprattr-id
IMPORTING
proftype = ls_scp1-scprattr-type
cli_dep = ls_scp1-scprattr-cli_dep
cli_cas = ls_scp1-scprattr-cli_cas
reftype = ls_scp1-scprattr-reftype
refname = ls_scp1-scprattr-refname
component = ls_scp1-scprattr-component
minrelease = ls_scp1-scprattr-minrelease
maxrelease = ls_scp1-scprattr-maxrelease
orgid = ls_scp1-scprattr-orgid
act_info = ls_scp1-scprattr-act_info.
IF ls_scp1-scprattr-type = 'TMP'.
* todo, Hierarchical, fm SCPR_PRSET_DB_SUBP_GET_DETAIL, recursive?
zcx_abapgit_exception=>raise( |todo, SCP1| ).
ELSE.
load( CHANGING cs_scp1 = ls_scp1 ).
ENDIF.
adjust_outbound( CHANGING cs_scp1 = ls_scp1 ).
io_xml->add(
iv_name = 'SCP1'
ig_data = ls_scp1 ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
1416,
79,
16,
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,
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,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
1416,
79,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
629,
1050,
35226,
41876,
629,
1050,
35226,
11,
198,
220,
220,
220,
220,
220,
220,
220,
629,
1050,
5239,
41876,
49053,
9795,
43679,
3963,
629,
1050,
5239,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
629,
1050,
12786,
41876,
49053,
9795,
43679,
3963,
629,
1050,
12786,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
629,
1050,
85,
439,
41876,
49053,
9795,
43679,
3963,
629,
1050,
85,
439,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
629,
1050,
260,
6888,
41876,
49053,
9795,
43679,
3963,
629,
1050,
260,
6888,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
629,
1050,
69,
335,
85,
41876,
49053,
9795,
43679,
3963,
629,
1050,
69,
335,
85,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
1416,
79,
16,
764,
628,
220,
220,
220,
337,
36252,
50,
390,
36560,
764,
198,
220,
220,
220,
337,
36252,
50,
551,
36560,
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,
3613,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
1416,
79,
16,
41876,
1259,
62,
1416,
79,
16,
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,
4532,
62,
259,
7784,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
6359,
62,
1416,
79,
16,
41876,
1259,
62,
1416,
79,
16,
764,
198,
220,
220,
220,
337,
36252,
50,
4532,
62,
448,
7784,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
6359,
62,
1416,
79,
16,
41876,
1259,
62,
1416,
79,
16,
764,
198,
220,
220,
220,
337,
36252,
50,
3440,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
6359,
62,
1416,
79,
16,
41876,
1259,
62,
1416,
79,
16,
764,
198,
220,
220,
220,
337,
36252,
50,
869,
62,
33678,
62,
69,
907,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
13317,
62,
312,
41876,
629,
1050,
62,
312,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
48956,
16,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
4532,
62,
259,
7784,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
1416,
1050,
12786,
29,
41876,
629,
1050,
12786,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7278,
62,
1416,
1050,
260,
6888,
29,
41876,
629,
1050,
260,
6888,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7278,
62,
1416,
1050,
85,
439,
29,
41876,
629,
1050,
85,
439,
13,
198,
198,
9,
736,
284,
5387,
5794,
198,
220,
220,
220,
17579,
3185,
5161,
50115,
62,
1416,
79,
16,
12,
1416,
1050,
12786,
24994,
3528,
15871,
1279,
7278,
62,
1416,
1050,
12786,
28401,
198,
220,
220,
220,
220,
220,
6006,
32297,
1279,
7278,
62,
1416,
1050,
12786,
29,
12,
8344,
17618,
33621,
5550,
28882,
2751,
29125,
4146,
2751,
2272,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
198,
220,
220,
220,
17579,
3185,
5161,
50115,
62,
1416,
79,
16,
12,
1416,
1050,
260,
6888,
24994,
3528,
15871,
1279,
7278,
62,
1416,
1050,
260,
6888,
28401,
198,
220,
220,
220,
220,
220,
6006,
32297,
1279,
7278,
62,
1416,
1050,
260,
6888,
29,
12,
8344,
17618,
33621,
5550,
28882,
2751,
29125,
4146,
2751,
2272,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
198,
220,
220,
220,
17579,
3185,
5161,
50115,
62,
1416,
79,
16,
12,
1416,
1050,
85,
439,
24994,
3528,
15871,
1279,
7278,
62,
1416,
1050,
85,
439,
28401,
198,
220,
220,
220,
220,
220,
6006,
32297,
1279,
7278,
62,
1416,
1050,
85,
439,
29,
12,
8344,
17618,
33621,
5550,
28882,
2751,
29125,
4146,
2751,
2272,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
4532,
62,
448,
7784,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
1416,
1050,
12786,
29,
41876,
629,
1050,
12786,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7278,
62,
1416,
1050,
260,
6888,
29,
41876,
629,
1050,
260,
6888,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7278,
62,
1416,
1050,
85,
439,
29,
41876,
629,
1050,
85,
439,
13,
198,
198,
9,
3487,
1096,
262,
23735,
198,
220,
220,
220,
17579,
3185,
5161,
50115,
62,
1416,
79,
16,
12,
1416,
1050,
12786,
24994,
3528,
15871,
1279,
7278,
62,
1416,
1050,
12786,
28401,
198,
220,
220,
220,
220,
220,
7102,
35,
24290,
1279,
7278,
62,
1416,
1050,
12786,
29,
12,
8344,
17618
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_EXCEL_STYLE_FONT definition
public
final
create public .
public section.
*"* public components of class ZCL_EXCEL_STYLE_FONT
*"* do not include other source files here!!!
type-pools ABAP .
data BOLD type FLAG .
data COLOR type ZEXCEL_S_STYLE_COLOR .
constants C_FAMILY_DECORATIVE type ZEXCEL_STYLE_FONT_FAMILY value 5. "#EC NOTEXT
constants C_FAMILY_MODERN type ZEXCEL_STYLE_FONT_FAMILY value 3. "#EC NOTEXT
constants C_FAMILY_NONE type ZEXCEL_STYLE_FONT_FAMILY value 0. "#EC NOTEXT
constants C_FAMILY_ROMAN type ZEXCEL_STYLE_FONT_FAMILY value 1. "#EC NOTEXT
constants C_FAMILY_SCRIPT type ZEXCEL_STYLE_FONT_FAMILY value 4. "#EC NOTEXT
constants C_FAMILY_SWISS type ZEXCEL_STYLE_FONT_FAMILY value 2. "#EC NOTEXT
constants C_NAME_ARIAL type ZEXCEL_STYLE_FONT_NAME value 'Arial'. "#EC NOTEXT
constants C_NAME_CALIBRI type ZEXCEL_STYLE_FONT_NAME value 'Calibri'. "#EC NOTEXT
constants C_NAME_CAMBRIA type ZEXCEL_STYLE_FONT_NAME value 'Cambria'. "#EC NOTEXT
constants C_NAME_ROMAN type ZEXCEL_STYLE_FONT_NAME value 'Times New Roman'. "#EC NOTEXT
constants C_SCHEME_MAJOR type ZEXCEL_STYLE_FONT_SCHEME value 'major'. "#EC NOTEXT
constants C_SCHEME_NONE type ZEXCEL_STYLE_FONT_SCHEME value ''. "#EC NOTEXT
constants C_SCHEME_MINOR type ZEXCEL_STYLE_FONT_SCHEME value 'minor'. "#EC NOTEXT
constants C_UNDERLINE_DOUBLE type ZEXCEL_STYLE_FONT_UNDERLINE value 'double'. "#EC NOTEXT
constants C_UNDERLINE_DOUBLEACCOUNTING type ZEXCEL_STYLE_FONT_UNDERLINE value 'doubleAccounting'. "#EC NOTEXT
constants C_UNDERLINE_NONE type ZEXCEL_STYLE_FONT_UNDERLINE value 'none'. "#EC NOTEXT
constants C_UNDERLINE_SINGLE type ZEXCEL_STYLE_FONT_UNDERLINE value 'single'. "#EC NOTEXT
constants C_UNDERLINE_SINGLEACCOUNTING type ZEXCEL_STYLE_FONT_UNDERLINE value 'singleAccounting'. "#EC NOTEXT
data FAMILY type ZEXCEL_STYLE_FONT_FAMILY value 2. "#EC NOTEXT . . . . . . . . . . . . " .
data ITALIC type FLAG .
data NAME type ZEXCEL_STYLE_FONT_NAME value 'Calibri'. "#EC NOTEXT . . . . . . . . . . . . " .
data SCHEME type ZEXCEL_STYLE_FONT_SCHEME value 'minor'. "#EC NOTEXT . . . . . . . . . . . . " .
data SIZE type ZEXCEL_STYLE_FONT_SIZE value 11. "#EC NOTEXT . . . . . . . . . . . . " .
data STRIKETHROUGH type FLAG .
data UNDERLINE type FLAG .
data UNDERLINE_MODE type ZEXCEL_STYLE_FONT_UNDERLINE .
methods CONSTRUCTOR .
methods GET_STRUCTURE
returning
value(ES_FONT) type ZEXCEL_S_STYLE_FONT .
methods CALCULATE_TEXT_WIDTH
importing
!I_TEXT type ZEXCEL_CELL_VALUE
returning
value(R_WIDTH) type I .
*"* protected components of class ZCL_EXCEL_STYLE_FONT
*"* do not include other source files here!!!
protected section.
private section.
*"* private components of class ZCL_EXCEL_STYLE_FONT
*"* do not include other source files here!!!
ENDCLASS.
CLASS ZCL_EXCEL_STYLE_FONT IMPLEMENTATION.
method CALCULATE_TEXT_WIDTH.
" Addition to solve issue #120, contribution by Stefan Schmoecker
r_width = strlen( i_text ).
" use scale factor based on default 11
" ( don't know where defaultsetting is stored currently )
r_width = r_width * me->size / 11.
endmethod.
method CONSTRUCTOR.
me->color-rgb = zcl_excel_style_color=>c_black.
me->color-theme = zcl_excel_style_color=>c_theme_not_set.
me->color-indexed = zcl_excel_style_color=>c_indexed_not_set.
me->scheme = zcl_excel_style_font=>c_scheme_minor.
me->underline_mode = zcl_excel_style_font=>c_underline_single.
endmethod.
method GET_STRUCTURE.
es_font-bold = me->bold.
es_font-italic = me->italic.
es_font-underline = me->underline.
es_font-underline_mode = me->underline_mode.
es_font-strikethrough = me->strikethrough.
es_font-size = me->size.
es_font-color = me->color.
es_font-name = me->name.
es_font-family = me->family.
es_font-scheme = me->scheme.
endmethod.
ENDCLASS.
| [
4871,
1168,
5097,
62,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
6770,
198,
220,
1171,
198,
220,
2457,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1168,
5097,
62,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
220,
2099,
12,
7742,
82,
9564,
2969,
764,
628,
220,
1366,
347,
15173,
2099,
9977,
4760,
764,
198,
220,
1366,
20444,
1581,
2099,
1168,
6369,
34,
3698,
62,
50,
62,
2257,
56,
2538,
62,
46786,
764,
198,
220,
38491,
327,
62,
37,
2390,
33340,
62,
41374,
1581,
37045,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
37,
2390,
33340,
1988,
642,
13,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
37,
2390,
33340,
62,
33365,
28778,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
37,
2390,
33340,
1988,
513,
13,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
37,
2390,
33340,
62,
45,
11651,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
37,
2390,
33340,
1988,
657,
13,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
37,
2390,
33340,
62,
33676,
1565,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
37,
2390,
33340,
1988,
352,
13,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
37,
2390,
33340,
62,
6173,
46023,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
37,
2390,
33340,
1988,
604,
13,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
37,
2390,
33340,
62,
17887,
16744,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
37,
2390,
33340,
1988,
362,
13,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
20608,
62,
1503,
12576,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
20608,
1988,
705,
32,
4454,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
20608,
62,
34,
1847,
9865,
7112,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
20608,
1988,
705,
9771,
571,
380,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
20608,
62,
34,
2390,
11473,
3539,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
20608,
1988,
705,
34,
4131,
7496,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
20608,
62,
33676,
1565,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
20608,
1988,
705,
28595,
968,
7993,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
50,
3398,
3620,
36,
62,
5673,
41,
1581,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
50,
3398,
3620,
36,
1988,
705,
22478,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
50,
3398,
3620,
36,
62,
45,
11651,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
50,
3398,
3620,
36,
1988,
705,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
50,
3398,
3620,
36,
62,
23678,
1581,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
50,
3398,
3620,
36,
1988,
705,
1084,
273,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
4944,
14418,
24027,
62,
35,
2606,
19146,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
4944,
14418,
24027,
1988,
705,
23352,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
4944,
14418,
24027,
62,
35,
2606,
19146,
26861,
28270,
2751,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
4944,
14418,
24027,
1988,
705,
23352,
30116,
278,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
4944,
14418,
24027,
62,
45,
11651,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
4944,
14418,
24027,
1988,
705,
23108,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
4944,
14418,
24027,
62,
50,
2751,
2538,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
4944,
14418,
24027,
1988,
705,
29762,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
4944,
14418,
24027,
62,
50,
2751,
2538,
26861,
28270,
2751,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
4944,
14418,
24027,
1988,
705,
29762,
30116,
278,
4458,
25113,
2943,
5626,
13918,
198,
220,
1366,
42129,
33340,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
37,
2390,
33340,
1988,
362,
13,
25113,
2943,
5626,
13918,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
366,
764,
198,
220,
1366,
7283,
1847,
2149,
2099,
9977,
4760,
764,
198,
220,
1366,
36751,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
20608,
1988,
705,
9771,
571,
380,
4458,
25113,
2943,
5626,
13918,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
366,
764,
198,
220,
1366,
22374,
3620,
36,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
50,
3398,
3620,
36,
1988,
705,
1084,
273,
4458,
25113,
2943,
5626,
13918,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
366,
764,
198,
220,
1366,
311,
35400,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
33489,
1988,
1367,
13,
25113,
2943,
5626,
13918,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
366,
764,
198,
220,
1366,
3563,
7112,
42,
2767,
17184,
32632,
2099,
9977,
4760,
764,
198,
220,
1366,
35219,
24027,
2099,
9977,
4760,
764,
198,
220,
1366,
35219,
24027,
62,
49058,
2099,
1168,
6369,
34,
3698,
62,
2257,
56,
2538,
62,
37,
35830,
62,
4944,
14418,
24027,
764,
628,
220,
5050,
7102,
46126,
1581,
764,
198,
220,
5050,
17151,
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,
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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
] |
INTERFACE zif_abapgit_version
PUBLIC .
CONSTANTS gc_xml_version TYPE string VALUE 'v1.0.0' ##NO_TEXT.
CONSTANTS gc_abap_version TYPE string VALUE '1.80.0' ##NO_TEXT.
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
397,
499,
18300,
62,
9641,
198,
220,
44731,
764,
628,
220,
7102,
2257,
1565,
4694,
308,
66,
62,
19875,
62,
9641,
41876,
4731,
26173,
8924,
705,
85,
16,
13,
15,
13,
15,
6,
22492,
15285,
62,
32541,
13,
198,
220,
7102,
2257,
1565,
4694,
308,
66,
62,
397,
499,
62,
9641,
41876,
4731,
26173,
8924,
705,
16,
13,
1795,
13,
15,
6,
22492,
15285,
62,
32541,
13,
198,
198,
10619,
41358,
49836,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_xml DEFINITION DEFERRED.
CLASS ltcl_xml_concrete DEFINITION FOR 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.
mo_xml = NEW #( ).
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,
6941,
62,
19875,
796,
12682,
1303,
7,
6739,
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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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
] |
CLASS zcl_advent2020_day20_gw DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_advent2020_gw .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_advent2020_day20_gw IMPLEMENTATION.
METHOD zif_advent2020_gw~solve.
output = 'todo'.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
324,
1151,
42334,
62,
820,
1238,
62,
70,
86,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
324,
1151,
42334,
62,
70,
86,
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,
324,
1151,
42334,
62,
820,
1238,
62,
70,
86,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
324,
1151,
42334,
62,
70,
86,
93,
82,
6442,
13,
628,
220,
220,
220,
5072,
796,
705,
83,
24313,
4458,
628,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS ltcl_list_commits DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL.
PRIVATE SECTION.
DATA: mo_branch TYPE REF TO zcl_ags_branch.
METHODS:
setup RAISING zcx_ags_error,
test01 FOR TESTING RAISING zcx_ags_error,
test02 FOR TESTING RAISING zcx_ags_error.
ENDCLASS.
CLASS ltcl_list_commits IMPLEMENTATION.
METHOD setup.
zcl_ags_db=>set_fake( ).
mo_branch = zcl_ags_repo=>create(
iv_name = 'UNITTEST'
iv_description = 'FOOBAR' )->get_default_branch( ).
ENDMETHOD.
METHOD test01.
DATA: lt_commits TYPE zcl_ags_obj_commit=>ty_pretty_tt.
lt_commits = mo_branch->get_cache( )->list_commits( ).
cl_abap_unit_assert=>assert_equals(
act = lines( lt_commits )
exp = 1 ).
mo_branch->get_files( )->add(
iv_filename = 'BLAH.TXT'
iv_path = '/'
iv_file_contents = 'WELLO'
iv_commit_message = 'BLAH' ).
lt_commits = mo_branch->get_cache( )->list_commits( ).
cl_abap_unit_assert=>assert_equals(
act = lines( lt_commits )
exp = 2 ).
ENDMETHOD.
METHOD test02.
CONSTANTS: lc_count TYPE i VALUE 900.
DATA: lt_commits TYPE zcl_ags_obj_commit=>ty_pretty_tt,
lv_index TYPE i.
FIELD-SYMBOLS: <ls_commit> LIKE LINE OF lt_commits.
DO lc_count TIMES.
lv_index = sy-index.
mo_branch->get_files( )->modify(
iv_filename = 'README.md'
iv_path = '/'
iv_file_contents = |COMMIT{ lv_index }|
iv_commit_message = |COMMIT{ lv_index }| ).
ENDDO.
lt_commits = mo_branch->get_cache( )->list_commits( ).
cl_abap_unit_assert=>assert_equals(
act = lines( lt_commits )
exp = lc_count + 1 ).
* make sure the order is correct
lv_index = lc_count.
LOOP AT lt_commits ASSIGNING <ls_commit>.
IF sy-tabix = lc_count + 1.
CONTINUE.
ENDIF.
cl_abap_unit_assert=>assert_equals(
act = <ls_commit>-text
exp = |COMMIT{ lv_index }| ).
lv_index = lv_index - 1.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
CLASS ltcl_list_files_by_path DEFINITION
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL.
PRIVATE SECTION.
CONSTANTS: c_root TYPE string VALUE '/'.
DATA: mo_branch TYPE REF TO zcl_ags_branch.
METHODS:
setup RAISING zcx_ags_error,
check
IMPORTING iv_lines TYPE i
RETURNING VALUE(rt_files) TYPE zcl_ags_cache=>ty_files_tt
RAISING zcx_ags_error,
check_filled IMPORTING it_files TYPE zcl_ags_cache=>ty_files_tt,
test01 FOR TESTING RAISING zcx_ags_error,
test02 FOR TESTING RAISING zcx_ags_error,
test03 FOR TESTING RAISING zcx_ags_error,
test04 FOR TESTING RAISING zcx_ags_error.
ENDCLASS. "ltcl_List_Files_By_Path
CLASS ltcl_list_files_by_path IMPLEMENTATION.
METHOD setup.
zcl_ags_db=>set_fake( ).
mo_branch = zcl_ags_repo=>create(
iv_name = 'UNITTEST'
iv_description = 'FOOBAR' )->get_default_branch( ).
ENDMETHOD.
METHOD check.
DATA: lt_files1 TYPE zcl_ags_cache=>ty_files_tt,
lt_files2 TYPE zcl_ags_cache=>ty_files_tt.
* call method 2 times, first to save to cache, 2nd time to read from cache
lt_files1 = mo_branch->get_cache( )->list_files_by_path( c_root ).
cl_abap_unit_assert=>assert_equals(
act = lines( lt_files1 )
exp = iv_lines ).
check_filled( lt_files1 ).
lt_files2 = mo_branch->get_cache( )->list_files_by_path( c_root ).
cl_abap_unit_assert=>assert_equals(
act = lines( lt_files2 )
exp = iv_lines ).
check_filled( lt_files2 ).
cl_abap_unit_assert=>assert_equals(
act = lt_files1
exp = lt_files2 ).
rt_files = lt_files1.
ENDMETHOD.
METHOD check_filled.
FIELD-SYMBOLS: <ls_file> LIKE LINE OF it_files.
LOOP AT it_files ASSIGNING <ls_file>.
cl_abap_unit_assert=>assert_not_initial( <ls_file>-filename ).
cl_abap_unit_assert=>assert_not_initial( <ls_file>-path ).
cl_abap_unit_assert=>assert_not_initial( <ls_file>-blob_sha1 ).
cl_abap_unit_assert=>assert_not_initial( <ls_file>-last_commit_sha1 ).
cl_abap_unit_assert=>assert_not_initial( <ls_file>-time ).
cl_abap_unit_assert=>assert_not_initial( <ls_file>-comment ).
ENDLOOP.
ENDMETHOD.
METHOD test01.
check( 1 ).
mo_branch->get_files( )->add(
iv_filename = 'NEW.TXT'
iv_path = c_root
iv_file_contents = 'WELLO'
iv_commit_message = 'BLAH' ).
check( 2 ).
ENDMETHOD.
METHOD test02.
* test folder last commit
CONSTANTS: lc_path TYPE string VALUE '/FOO/',
lc_first TYPE string VALUE 'FIRST',
lc_second TYPE string VALUE 'SECOND'.
DATA: lt_files TYPE zcl_ags_cache=>ty_files_tt.
FIELD-SYMBOLS: <ls_file> LIKE LINE OF lt_files.
* trigger build of initial cache
mo_branch->get_cache( )->list_files_by_path( c_root ).
mo_branch->get_files( )->add(
iv_filename = 'ASDF.TXT'
iv_path = '/BAR/'
iv_file_contents = 'WELLO'
iv_commit_message = lc_first ).
mo_branch->get_files( )->add(
iv_filename = 'NEW.TXT'
iv_path = lc_path
iv_file_contents = 'WELLO'
iv_commit_message = lc_first ).
lt_files = mo_branch->get_cache( )->list_files_by_path( c_root ).
* README.md and folder FOO + BAR at root
cl_abap_unit_assert=>assert_equals(
act = lines( lt_files )
exp = 3 ).
READ TABLE lt_files WITH KEY filename = 'FOO' ASSIGNING <ls_file>.
cl_abap_unit_assert=>assert_subrc( ).
cl_abap_unit_assert=>assert_equals(
act = <ls_file>-chmod
exp = zcl_ags_obj_tree=>c_chmod-dir ).
cl_abap_unit_assert=>assert_equals(
act = <ls_file>-comment
exp = lc_first ).
mo_branch->get_files( )->add(
iv_filename = 'NEW2.TXT'
iv_path = lc_path
iv_file_contents = 'HELLO'
iv_commit_message = lc_second ).
lt_files = mo_branch->get_cache( )->list_files_by_path( c_root ).
cl_abap_unit_assert=>assert_equals(
act = lines( lt_files )
exp = 3 ).
READ TABLE lt_files WITH KEY filename = 'BAR' ASSIGNING <ls_file>.
cl_abap_unit_assert=>assert_subrc( ).
cl_abap_unit_assert=>assert_equals(
act = <ls_file>-chmod
exp = zcl_ags_obj_tree=>c_chmod-dir ).
cl_abap_unit_assert=>assert_equals(
act = <ls_file>-comment
exp = lc_first ).
READ TABLE lt_files WITH KEY filename = 'FOO' ASSIGNING <ls_file>.
cl_abap_unit_assert=>assert_subrc( ).
cl_abap_unit_assert=>assert_equals(
act = <ls_file>-chmod
exp = zcl_ags_obj_tree=>c_chmod-dir ).
cl_abap_unit_assert=>assert_equals(
act = <ls_file>-comment
exp = lc_second ).
ENDMETHOD.
METHOD test03.
CONSTANTS: lc_latest TYPE string VALUE 'LATEST'.
DATA: lt_files TYPE zcl_ags_cache=>ty_files_tt.
mo_branch->get_files( )->add(
iv_filename = 'NEW.TXT'
iv_path = c_root
iv_file_contents = 'WELLO'
iv_commit_message = 'BLAH' ).
mo_branch->get_files( )->modify(
iv_filename = 'NEW.TXT'
iv_path = c_root
iv_file_contents = '234'
iv_commit_message = lc_latest ).
lt_files = check( 2 ).
READ TABLE lt_files WITH KEY comment = lc_latest TRANSPORTING NO FIELDS.
cl_abap_unit_assert=>assert_subrc( ).
ENDMETHOD.
METHOD test04.
mo_branch->get_files( )->add(
iv_filename = 'NEW.TXT'
iv_path = c_root
iv_file_contents = 'WELLO'
iv_commit_message = 'BLAH' ).
check( 2 ).
mo_branch->get_files( )->delete(
iv_filename = 'NEW.TXT'
iv_path = c_root
iv_commit_message = 'MOO' ).
check( 1 ).
ENDMETHOD.
ENDCLASS.
CLASS ltcl_list_files_simple DEFINITION
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL.
PRIVATE SECTION.
DATA: mo_branch TYPE REF TO zcl_ags_branch.
METHODS:
setup RAISING zcx_ags_error,
test01 FOR TESTING RAISING zcx_ags_error.
ENDCLASS. "ltcl_List_Files_Simple
CLASS ltcl_list_files_simple IMPLEMENTATION.
METHOD setup.
zcl_ags_db=>set_fake( ).
mo_branch = zcl_ags_repo=>create(
iv_name = 'UNITTEST'
iv_description = 'FOOBAR' )->get_default_branch( ).
ENDMETHOD.
METHOD test01.
CONSTANTS: lc_path TYPE string VALUE '/foo/bar/'.
DATA: lt_files TYPE zcl_ags_cache=>ty_files_simple_tt.
mo_branch->get_files( )->add(
iv_filename = 'NEW.TXT'
iv_path = lc_path
iv_file_contents = 'WELLO'
iv_commit_message = 'BLAH' ).
lt_files = mo_branch->get_cache( )->list_files_simple( ).
READ TABLE lt_files WITH KEY
filename = 'NEW.TXT'
path = lc_path
chmod = zcl_ags_obj_tree=>c_chmod-file
TRANSPORTING NO FIELDS.
cl_abap_unit_assert=>assert_subrc( ).
READ TABLE lt_files WITH KEY
filename = 'foo'
path = '/'
chmod = zcl_ags_obj_tree=>c_chmod-dir
TRANSPORTING NO FIELDS.
cl_abap_unit_assert=>assert_subrc( ).
ENDMETHOD.
ENDCLASS.
CLASS ltcl_bubble_dir DEFINITION DEFERRED.
CLASS zcl_ags_cache DEFINITION LOCAL FRIENDS ltcl_bubble_dir.
CLASS ltcl_bubble_dir DEFINITION
FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL.
PRIVATE SECTION.
METHODS:
single_step FOR TESTING,
multi FOR TESTING.
ENDCLASS. "ltcl_Bubble_Dir
CLASS ltcl_bubble_dir IMPLEMENTATION.
METHOD single_step.
CONSTANTS: lc_last TYPE zags_sha1 VALUE 'LAST'.
DATA: lo_cache TYPE REF TO zcl_ags_cache,
ls_file TYPE zags_tree_cache_data,
lt_files TYPE zags_tree_cache_data_tt.
FIELD-SYMBOLS: <ls_file> LIKE LINE OF lt_files.
ls_file-filename = 'FOO'.
ls_file-path = '/'.
ls_file-chmod = zcl_ags_obj_tree=>c_chmod-dir.
INSERT ls_file INTO TABLE lt_files.
CLEAR ls_file.
ls_file-filename = 'BAR'.
ls_file-path = '/'.
ls_file-chmod = zcl_ags_obj_tree=>c_chmod-dir.
INSERT ls_file INTO TABLE lt_files.
CLEAR ls_file.
CREATE OBJECT lo_cache
EXPORTING
iv_repo = ''
iv_commit = ''.
ls_file-path = '/FOO/'.
lo_cache->bubble_dir(
EXPORTING iv_commit = lc_last
is_file = ls_file
CHANGING ct_files = lt_files ).
READ TABLE lt_files WITH KEY filename = 'FOO' ASSIGNING <ls_file>.
cl_abap_unit_assert=>assert_subrc( ).
cl_abap_unit_assert=>assert_equals(
act = <ls_file>-last_commit_sha1
exp = lc_last ).
READ TABLE lt_files WITH KEY filename = 'BAR' ASSIGNING <ls_file>.
cl_abap_unit_assert=>assert_subrc( ).
cl_abap_unit_assert=>assert_equals(
act = <ls_file>-last_commit_sha1
exp = '' ).
ENDMETHOD.
METHOD multi.
CONSTANTS: lc_last TYPE zags_sha1 VALUE 'MULTI'.
DATA: lo_cache TYPE REF TO zcl_ags_cache,
ls_file TYPE zags_tree_cache_data,
lt_files TYPE zags_tree_cache_data_tt.
FIELD-SYMBOLS: <ls_file> LIKE LINE OF lt_files.
ls_file-filename = 'FOO'.
ls_file-path = '/'.
ls_file-chmod = zcl_ags_obj_tree=>c_chmod-dir.
INSERT ls_file INTO TABLE lt_files.
CLEAR ls_file.
ls_file-filename = 'BAR'.
ls_file-path = '/FOO/'.
ls_file-chmod = zcl_ags_obj_tree=>c_chmod-dir.
INSERT ls_file INTO TABLE lt_files.
CLEAR ls_file.
CREATE OBJECT lo_cache
EXPORTING
iv_repo = ''
iv_commit = ''.
ls_file-path = '/FOO/BAR/'.
lo_cache->bubble_dir(
EXPORTING iv_commit = lc_last
is_file = ls_file
CHANGING ct_files = lt_files ).
cl_abap_unit_assert=>assert_equals(
act = lines( lt_files )
exp = 2 ).
LOOP AT lt_files ASSIGNING <ls_file>.
cl_abap_unit_assert=>assert_equals(
act = <ls_file>-last_commit_sha1
exp = lc_last ).
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
198,
31631,
300,
83,
565,
62,
4868,
62,
9503,
896,
5550,
20032,
17941,
7473,
43001,
2751,
360,
4261,
6234,
6006,
9863,
45698,
42,
49277,
43638,
5805,
7597,
25261,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
6941,
62,
1671,
3702,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
3775,
62,
1671,
3702,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9058,
17926,
1797,
2751,
1976,
66,
87,
62,
3775,
62,
18224,
11,
198,
220,
220,
220,
220,
220,
1332,
486,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
3775,
62,
18224,
11,
198,
220,
220,
220,
220,
220,
1332,
2999,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
3775,
62,
18224,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
4868,
62,
9503,
896,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
1976,
565,
62,
3775,
62,
9945,
14804,
2617,
62,
30706,
7,
6739,
628,
220,
220,
220,
6941,
62,
1671,
3702,
796,
1976,
565,
62,
3775,
62,
260,
7501,
14804,
17953,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
796,
705,
4944,
22470,
6465,
6,
198,
220,
220,
220,
220,
220,
21628,
62,
11213,
796,
705,
6080,
9864,
1503,
6,
1267,
3784,
1136,
62,
12286,
62,
1671,
3702,
7,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
486,
13,
628,
220,
220,
220,
42865,
25,
300,
83,
62,
9503,
896,
41876,
1976,
565,
62,
3775,
62,
26801,
62,
41509,
14804,
774,
62,
37784,
62,
926,
13,
628,
198,
220,
220,
220,
300,
83,
62,
9503,
896,
796,
6941,
62,
1671,
3702,
3784,
1136,
62,
23870,
7,
1267,
3784,
4868,
62,
9503,
896,
7,
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,
3951,
7,
300,
83,
62,
9503,
896,
1267,
198,
220,
220,
220,
220,
220,
1033,
796,
352,
6739,
628,
220,
220,
220,
6941,
62,
1671,
3702,
3784,
1136,
62,
16624,
7,
1267,
3784,
2860,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
34345,
220,
220,
220,
220,
220,
220,
796,
705,
9148,
18429,
13,
51,
25010,
6,
198,
220,
220,
220,
220,
220,
21628,
62,
6978,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
31051,
6,
198,
220,
220,
220,
220,
220,
21628,
62,
7753,
62,
3642,
658,
220,
796,
705,
8845,
3069,
46,
6,
198,
220,
220,
220,
220,
220,
21628,
62,
41509,
62,
20500,
796,
705,
9148,
18429,
6,
6739,
628,
220,
220,
220,
300,
83,
62,
9503,
896,
796,
6941,
62,
1671,
3702,
3784,
1136,
62,
23870,
7,
1267,
3784,
4868,
62,
9503,
896,
7,
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,
3951,
7,
300,
83,
62,
9503,
896,
1267,
198,
220,
220,
220,
220,
220,
1033,
796,
362,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
2999,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
300,
66,
62,
9127,
41876,
1312,
26173,
8924,
15897,
13,
628,
220,
220,
220,
42865,
25,
300,
83,
62,
9503,
896,
41876,
1976,
565,
62,
3775,
62,
26801,
62,
41509,
14804,
774,
62,
37784,
62,
926,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
9630,
220,
220,
41876,
1312,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
41509,
29,
34178,
48920,
3963,
300,
83,
62,
9503,
896,
13,
628,
198,
220,
220,
220,
8410,
300,
66,
62,
9127,
31742,
1546,
13,
198,
220,
220,
220,
220,
220,
300,
85,
62,
9630,
796,
827,
12,
9630,
13,
198,
220,
220,
220,
220,
220,
6941,
62,
1671,
3702,
3784,
1136,
62,
16624,
7,
1267,
3784,
4666,
1958,
7,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
34345,
220,
220,
220,
220,
220,
220,
796,
705,
15675,
11682,
13,
9132,
6,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
6978,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
31051,
6,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
7753,
62,
3642,
658,
220,
796,
930,
9858,
36393,
90,
300,
85,
62,
9630,
1782,
91,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
41509,
62,
20500,
796,
930,
9858,
36393,
90,
300,
85,
62,
9630,
1782,
91,
6739,
198,
220,
220,
220,
23578,
18227,
13,
628,
220,
220,
220,
300,
83,
62,
9503,
896,
796,
6941,
62,
1671,
3702,
3784,
1136,
62,
23870,
7,
1267,
3784,
4868,
62,
9503,
896,
7,
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,
3951,
7,
300,
83,
62,
9503,
896,
1267,
198,
220,
220,
220,
220,
220,
1033,
796,
300,
66,
62,
9127,
1343,
352,
6739,
198,
198,
9,
787,
1654,
262,
1502,
318,
3376,
198,
220,
220,
220,
300,
85,
62,
9630,
796,
300,
66,
62,
9127,
13,
198,
220,
220,
220,
17579,
3185,
5161,
300,
83,
62,
9503,
896,
24994,
3528,
15871,
1279,
7278,
62,
41509,
28401,
198,
220,
220,
220,
220,
220,
16876,
827,
12,
8658,
844,
796,
300,
66,
62,
9127,
1343,
352,
13,
198,
220,
220,
220,
220,
220,
220,
220,
43659,
8924,
13,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
719,
796,
1279,
7278,
62,
41509,
29,
12,
5239,
198,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
930,
9858,
36393,
90,
300,
85,
62,
9630,
1782,
91,
6739,
198,
220,
220,
220,
220,
220,
300,
85,
62,
9630,
796,
300,
85,
62,
9630,
532,
352,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
23578,
49273,
13,
198,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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definition
public
inheriting from /IWBEP/CL_MGW_PUSH_ABS_MODEL
create public .
public section.
interfaces IF_SADL_GW_MODEL_EXPOSURE_DATA .
types:
TS_I_DRAFTADMINISTRATIVEDATATY type SDRAFT_ADMIN_CDS .
types:
TT_I_DRAFTADMINISTRATIVEDATATY type standard table of TS_I_DRAFTADMINISTRATIVEDATATY .
types:
begin of TS_Z4CDS_MONSTER_DELIVERIESTYP.
include type Z4V_MONS_DELS.
types:
ACTIVEUUID type Z4T_DRAFT_DELS-ACTIVEUUID,
DRAFTENTITYCREATIONDATETIME type Z4T_DRAFT_DELS-DRAFTENTITYCREATIONDATETIME,
DRAFTENTITYLASTCHANGEDATETIME type Z4T_DRAFT_DELS-DRAFTENTITYLASTCHANGEDATETIME,
HASACTIVEENTITY type SDRAFT_HAS_ACTIVE,
HASDRAFTENTITY type SDRAFT_HAS_DRAFT,
ISACTIVEENTITY type SDRAFT_IS_ACTIVE,
A_ACTIVATION type SADL_GW_DYNAMIC_ACTN_PROPERTY,
A_EDIT type SADL_GW_DYNAMIC_ACTN_PROPERTY,
A_PREPARATION type SADL_GW_DYNAMIC_ACTN_PROPERTY,
A_VALIDATION type SADL_GW_DYNAMIC_ACTN_PROPERTY,
end of TS_Z4CDS_MONSTER_DELIVERIESTYP .
types:
TT_Z4CDS_MONSTER_DELIVERIESTYP type standard table of TS_Z4CDS_MONSTER_DELIVERIESTYP .
constants GC_I_DRAFTADMINISTRATIVEDATATY type /IWBEP/IF_MGW_MED_ODATA_TYPES=>TY_E_MED_ENTITY_NAME value 'I_DraftAdministrativeDataType' ##NO_TEXT.
constants GC_Z4CDS_MONSTER_DELIVERIESTYP type /IWBEP/IF_MGW_MED_ODATA_TYPES=>TY_E_MED_ENTITY_NAME value 'Z4CDS_MONSTER_DELIVERIESType' ##NO_TEXT.
methods DEFINE
redefinition .
methods GET_LAST_MODIFIED
redefinition .
protected section.
private section.
methods DEFINE_RDS_4
raising
/IWBEP/CX_MGW_MED_EXCEPTION .
methods GET_LAST_MODIFIED_RDS_4
returning
value(RV_LAST_MODIFIED_RDS) type TIMESTAMP .
ENDCLASS.
CLASS ZCL_Z_4_MONSTER_DELIVE_MPC IMPLEMENTATION.
method DEFINE.
*&---------------------------------------------------------------------*
*& Generated code for the MODEL PROVIDER BASE CLASS &*
*& &*
*& !!!NEVER MODIFY THIS CLASS. IN CASE YOU WANT TO CHANGE THE MODEL &*
*& DO THIS IN THE MODEL PROVIDER SUBCLASS!!! &*
*& &*
*&---------------------------------------------------------------------*
model->set_schema_namespace( 'Z_4_MONSTER_DELIVERY_CDS_PULL_SRV' ).
define_rds_4( ).
get_last_modified_rds_4( ).
endmethod.
method DEFINE_RDS_4.
*&---------------------------------------------------------------------*
*& Generated code for the MODEL PROVIDER BASE CLASS &*
*& &*
*& !!!NEVER MODIFY THIS CLASS. IN CASE YOU WANT TO CHANGE THE MODEL &*
*& DO THIS IN THE MODEL PROVIDER SUBCLASS!!! &*
*& &*
*&---------------------------------------------------------------------*
* This code is generated for Reference Data Source
* 4
*&---------------------------------------------------------------------*
TRY.
if_sadl_gw_model_exposure_data~get_model_exposure( )->expose( model )->expose_vocabulary( vocab_anno_model ).
CATCH cx_sadl_exposure_error INTO DATA(lx_sadl_exposure_error).
RAISE EXCEPTION TYPE /iwbep/cx_mgw_med_exception
EXPORTING
previous = lx_sadl_exposure_error.
ENDTRY.
endmethod.
method GET_LAST_MODIFIED.
*&---------------------------------------------------------------------*
*& Generated code for the MODEL PROVIDER BASE CLASS &*
*& &*
*& !!!NEVER MODIFY THIS CLASS. IN CASE YOU WANT TO CHANGE THE MODEL &*
*& DO THIS IN THE MODEL PROVIDER SUBCLASS!!! &*
*& &*
*&---------------------------------------------------------------------*
CONSTANTS: lc_gen_date_time TYPE timestamp VALUE '20210630082719'. "#EC NOTEXT
DATA: lv_rds_last_modified TYPE timestamp .
rv_last_modified = super->get_last_modified( ).
IF rv_last_modified LT lc_gen_date_time.
rv_last_modified = lc_gen_date_time.
ENDIF.
lv_rds_last_modified = GET_LAST_MODIFIED_RDS_4( ).
IF rv_last_modified LT lv_rds_last_modified.
rv_last_modified = lv_rds_last_modified .
ENDIF .
endmethod.
method GET_LAST_MODIFIED_RDS_4.
*&---------------------------------------------------------------------*
*& Generated code for the MODEL PROVIDER BASE CLASS &*
*& &*
*& !!!NEVER MODIFY THIS CLASS. IN CASE YOU WANT TO CHANGE THE MODEL &*
*& DO THIS IN THE MODEL PROVIDER SUBCLASS!!! &*
*& &*
*&---------------------------------------------------------------------*
* This code is generated for Reference Data Source
* 4
*&---------------------------------------------------------------------*
CONSTANTS: co_gen_date_time TYPE timestamp VALUE '20210630082720'.
TRY.
rv_last_modified_rds = CAST cl_sadl_gw_model_exposure( if_sadl_gw_model_exposure_data~get_model_exposure( ) )->get_last_modified( ).
CATCH cx_root.
rv_last_modified_rds = co_gen_date_time.
ENDTRY.
IF rv_last_modified_rds < co_gen_date_time.
rv_last_modified_rds = co_gen_date_time.
ENDIF.
endmethod.
method IF_SADL_GW_MODEL_EXPOSURE_DATA~GET_MODEL_EXPOSURE.
CONSTANTS: co_gen_timestamp TYPE timestamp VALUE '20210630082720'.
DATA(lv_sadl_xml) =
|<?xml version="1.0" encoding="utf-16"?>| &
|<sadl:definition xmlns:sadl="http://sap.com/sap.nw.f.sadl" syntaxVersion="" >| &
| <sadl:dataSource type="CDS" name="Z4CDS_MONSTER_DELIVERIES" binding="Z4CDS_MONSTER_DELIVERIES" />| &
|<sadl:resultSet>| &
|<sadl:structure name="Z4CDS_MONSTER_DELIVERIES" dataSource="Z4CDS_MONSTER_DELIVERIES" maxEditMode="RO" exposure="TRUE" >| &
| <sadl:query name="SADL_QUERY">| &
| </sadl:query>| &
|</sadl:structure>| &
|</sadl:resultSet>| &
|</sadl:definition>| .
ro_model_exposure = cl_sadl_gw_model_exposure=>get_exposure_xml( iv_uuid = CONV #( 'Z_4_MONSTER_DELIVERY_CDS_PULL' )
iv_timestamp = co_gen_timestamp
iv_sadl_xml = lv_sadl_xml ).
endmethod.
ENDCLASS.
| [
4871,
1168,
5097,
62,
57,
62,
19,
62,
27857,
41809,
62,
35,
3698,
9306,
62,
44,
5662,
6770,
198,
220,
1171,
198,
220,
10639,
1780,
422,
1220,
40,
45607,
8905,
14,
5097,
62,
20474,
54,
62,
47,
27143,
62,
32,
4462,
62,
33365,
3698,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
20314,
16876,
62,
50,
2885,
43,
62,
33191,
62,
33365,
3698,
62,
6369,
37997,
11335,
62,
26947,
764,
628,
220,
3858,
25,
198,
220,
220,
26136,
62,
40,
62,
35,
44700,
2885,
23678,
1797,
5446,
1404,
3824,
1961,
1404,
1404,
56,
2099,
9834,
44700,
62,
2885,
23678,
62,
34,
5258,
764,
198,
220,
3858,
25,
198,
220,
220,
26653,
62,
40,
62,
35,
44700,
2885,
23678,
1797,
5446,
1404,
3824,
1961,
1404,
1404,
56,
2099,
3210,
3084,
286,
26136,
62,
40,
62,
35,
44700,
2885,
23678,
1797,
5446,
1404,
3824,
1961,
1404,
1404,
56,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
2221,
286,
26136,
62,
57,
19,
34,
5258,
62,
27857,
41809,
62,
35,
3698,
38757,
40,
6465,
48232,
13,
198,
220,
220,
220,
220,
220,
2291,
2099,
1168,
19,
53,
62,
44,
19213,
62,
35,
37142,
13,
198,
220,
3858,
25,
198,
220,
220,
220,
220,
220,
11741,
9306,
52,
27586,
2099,
1168,
19,
51,
62,
35,
44700,
62,
35,
37142,
12,
10659,
9306,
52,
27586,
11,
198,
220,
220,
220,
220,
220,
360,
44700,
3525,
9050,
43387,
6234,
35,
1404,
2767,
12789,
2099,
1168,
19,
51,
62,
35,
44700,
62,
35,
37142,
12,
35,
44700,
3525,
9050,
43387,
6234,
35,
1404,
2767,
12789,
11,
198,
220,
220,
220,
220,
220,
360,
44700,
3525,
9050,
43,
11262,
3398,
15567,
1961,
1404,
2767,
12789,
2099,
1168,
19,
51,
62,
35,
44700,
62,
35,
37142,
12,
35,
44700,
3525,
9050,
43,
11262,
3398,
15567,
1961,
1404,
2767,
12789,
11,
198,
220,
220,
220,
220,
220,
33930,
10659,
9306,
3525,
9050,
2099,
9834,
44700,
62,
39,
1921,
62,
10659,
9306,
11,
198,
220,
220,
220,
220,
220,
33930,
35,
44700,
3525,
9050,
2099,
9834,
44700,
62,
39,
1921,
62,
35,
44700,
11,
198,
220,
220,
220,
220,
220,
3180,
10659,
9306,
3525,
9050,
2099,
9834,
44700,
62,
1797,
62,
10659,
9306,
11,
198,
220,
220,
220,
220,
220,
317,
62,
10659,
3824,
6234,
2099,
311,
2885,
43,
62,
33191,
62,
35,
40760,
2390,
2149,
62,
10659,
45,
62,
4805,
31054,
9936,
11,
198,
220,
220,
220,
220,
220,
317,
62,
24706,
2099,
311,
2885,
43,
62,
33191,
62,
35,
40760,
2390,
2149,
62,
10659,
45,
62,
4805,
31054,
9936,
11,
198,
220,
220,
220,
220,
220,
317,
62,
46437,
27082,
6234,
2099,
311,
2885,
43,
62,
33191,
62,
35,
40760,
2390,
2149,
62,
10659,
45,
62,
4805,
31054,
9936,
11,
198,
220,
220,
220,
220,
220,
317,
62,
23428,
2389,
6234,
2099,
311,
2885,
43,
62,
33191,
62,
35,
40760,
2390,
2149,
62,
10659,
45,
62,
4805,
31054,
9936,
11,
198,
220,
220,
220,
886,
286,
26136,
62,
57,
19,
34,
5258,
62,
27857,
41809,
62,
35,
3698,
38757,
40,
6465,
48232,
764,
198,
220,
3858,
25,
198,
220,
220,
26653,
62,
57,
19,
34,
5258,
62,
27857,
41809,
62,
35,
3698,
38757,
40,
6465,
48232,
2099,
3210,
3084,
286,
26136,
62,
57,
19,
34,
5258,
62,
27857,
41809,
62,
35,
3698,
38757,
40,
6465,
48232,
764,
628,
220,
38491,
20145,
62,
40,
62,
35,
44700,
2885,
23678,
1797,
5446,
1404,
3824,
1961,
1404,
1404,
56,
2099,
1220,
40,
45607,
8905,
14,
5064,
62,
20474,
54,
62,
30733,
62,
3727,
13563,
62,
9936,
47,
1546,
14804,
9936,
62,
36,
62,
30733,
62,
3525,
9050,
62,
20608,
1988,
705,
40,
62,
37741,
41862,
13260,
6601,
6030,
6,
22492,
15285,
62,
32541,
13,
198,
220,
38491,
20145,
62,
57,
19,
34,
5258,
62,
27857,
41809,
62,
35,
3698,
38757,
40,
6465,
48232,
2099,
1220,
40,
45607,
8905,
14,
5064,
62,
20474,
54,
62,
30733,
62,
3727,
13563,
62,
9936,
47,
1546,
14804,
9936,
62,
36,
62,
30733,
62,
3525,
9050,
62,
20608,
1988,
705,
57,
19,
34,
5258,
62,
27857,
41809,
62,
35,
3698,
38757,
11015,
6030,
6,
22492,
15285,
62,
32541,
13,
628,
220,
5050,
23449,
8881,
198,
220,
220,
220,
34087,
17750,
764,
198,
220,
5050,
17151,
62,
43,
11262,
62,
33365,
28343,
198,
220,
220,
220,
34087,
17750,
764,
198,
24326,
2665,
13,
198,
19734,
2665,
13,
628,
220,
5050,
23449,
8881,
62,
49,
5258,
62,
19,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
1220,
40,
45607,
8905,
14,
34,
55,
62,
20474,
54,
62,
30733,
62,
6369,
42006,
2849,
764,
198,
220,
5050,
17151,
62,
43,
11262,
62,
33365,
28343,
62,
49,
5258,
62,
19,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
43,
11262,
62,
33365,
28343,
62,
49,
5258,
8,
2099,
31742,
6465,
23518,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
57,
62,
19,
62,
27857,
41809,
62,
35,
3698,
9306,
62,
44,
5662,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
2446,
23449,
8881,
13,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2980,
515,
2438,
329,
262,
19164,
3698,
36592,
41237,
49688,
42715,
220,
220,
220,
220,
220,
220,
220,
220,
1222,
9,
198,
9,
5,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1222,
9,
198,
9,
5,
220,
220,
10185,
12161,
5959,
19164,
5064,
56,
12680,
42715,
13,
3268,
42001,
7013,
41300,
5390,
5870,
27746,
3336,
19164,
3698,
220,
1222,
9,
198,
9,
5,
220,
220,
220,
220,
220,
220,
220,
8410,
12680,
3268,
3336,
19164,
3698,
36592,
41237,
13558,
2749,
43,
10705,
10185,
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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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
] |
CLASS zcl_abapgit_branch_overview DEFINITION PUBLIC FINAL CREATE PRIVATE.
PUBLIC SECTION.
CLASS-METHODS: run
IMPORTING io_repo TYPE REF TO zcl_abapgit_repo_online
RETURNING VALUE(ro_branch_overview) TYPE REF TO zcl_abapgit_branch_overview
RAISING zcx_abapgit_exception.
METHODS:
constructor
IMPORTING io_repo TYPE REF TO zcl_abapgit_repo_online
RAISING zcx_abapgit_exception,
get_branches
RETURNING VALUE(rt_branches) TYPE zif_abapgit_definitions=>ty_git_branch_list_tt,
get_tags
RETURNING VALUE(rt_tags) TYPE zif_abapgit_definitions=>ty_git_tag_list_tt,
get_commits
RETURNING
VALUE(rt_commits) TYPE zif_abapgit_definitions=>ty_commit_tt,
compress
IMPORTING it_commits TYPE zif_abapgit_definitions=>ty_commit_tt
RETURNING VALUE(rt_commits) TYPE zif_abapgit_definitions=>ty_commit_tt
RAISING zcx_abapgit_exception.
PRIVATE SECTION.
METHODS:
parse_commits
IMPORTING it_objects TYPE zif_abapgit_definitions=>ty_objects_tt
RAISING zcx_abapgit_exception,
parse_annotated_tags
IMPORTING it_objects TYPE zif_abapgit_definitions=>ty_objects_tt
RAISING zcx_abapgit_exception,
determine_branch
RAISING zcx_abapgit_exception,
determine_merges
RAISING zcx_abapgit_exception,
fixes
RAISING zcx_abapgit_exception,
get_git_objects
IMPORTING io_repo TYPE REF TO zcl_abapgit_repo_online
RETURNING VALUE(rt_objects) TYPE zif_abapgit_definitions=>ty_objects_tt
RAISING zcx_abapgit_exception,
determine_tags
RAISING zcx_abapgit_exception.
DATA:
mo_repo TYPE REF TO zcl_abapgit_repo_online,
mt_branches TYPE zif_abapgit_definitions=>ty_git_branch_list_tt,
mt_commits TYPE TABLE OF zif_abapgit_definitions=>ty_commit,
mt_tags TYPE zif_abapgit_definitions=>ty_git_tag_list_tt.
ENDCLASS.
CLASS zcl_abapgit_branch_overview IMPLEMENTATION.
METHOD compress.
DEFINE _compress.
IF lines( lt_temp ) >= 10.
READ TABLE lt_temp ASSIGNING <ls_temp> INDEX 1.
ASSERT sy-subrc = 0.
APPEND INITIAL LINE TO rt_commits ASSIGNING <ls_new>.
<ls_new>-time = <ls_temp>-time.
<ls_new>-message = |Compressed, { lines( lt_temp ) } commits|.
<ls_new>-branch = lv_name.
<ls_new>-compressed = abap_true.
ELSE.
APPEND LINES OF lt_temp TO rt_commits.
ENDIF.
END-OF-DEFINITION.
DATA: lv_previous TYPE i,
lv_index TYPE i,
lv_name TYPE string,
lt_temp LIKE it_commits.
FIELD-SYMBOLS: <ls_branch> LIKE LINE OF mt_branches,
<ls_new> LIKE LINE OF rt_commits,
<ls_temp> LIKE LINE OF lt_temp,
<ls_commit> LIKE LINE OF it_commits.
LOOP AT mt_branches ASSIGNING <ls_branch>.
CLEAR lt_temp.
lv_name = <ls_branch>-name+11.
LOOP AT it_commits ASSIGNING <ls_commit>
WHERE branch = lv_name.
lv_index = sy-tabix.
IF NOT <ls_commit>-merge IS INITIAL
OR NOT <ls_commit>-create IS INITIAL.
* always show these vertices
lv_previous = -1.
ENDIF.
IF lv_previous + 1 <> sy-tabix.
_compress.
CLEAR lt_temp.
ENDIF.
lv_previous = lv_index.
APPEND <ls_commit> TO lt_temp.
ENDLOOP.
_compress.
ENDLOOP.
SORT rt_commits BY time ASCENDING.
ENDMETHOD.
METHOD constructor.
DATA: lt_objects TYPE zif_abapgit_definitions=>ty_objects_tt.
mo_repo = io_repo.
CLEAR mt_branches.
CLEAR mt_commits.
lt_objects = get_git_objects( io_repo ).
parse_commits( lt_objects ).
parse_annotated_tags( lt_objects ).
CLEAR lt_objects.
determine_branch( ).
determine_merges( ).
determine_tags( ).
fixes( ).
SORT mt_commits BY time ASCENDING.
ENDMETHOD.
METHOD determine_branch.
CONSTANTS: lc_head TYPE string VALUE 'HEAD'.
DATA: lv_name TYPE string.
FIELD-SYMBOLS: <ls_branch> LIKE LINE OF mt_branches,
<ls_head> LIKE LINE OF mt_branches,
<ls_commit> LIKE LINE OF mt_commits,
<ls_create> LIKE LINE OF <ls_commit>-create.
* exchange HEAD, and make sure the branch determination starts with the HEAD branch
READ TABLE mt_branches ASSIGNING <ls_head> WITH KEY name = lc_head.
ASSERT sy-subrc = 0.
LOOP AT mt_branches ASSIGNING <ls_branch>
WHERE sha1 = <ls_head>-sha1 AND name <> lc_head.
<ls_head>-name = <ls_branch>-name.
DELETE mt_branches INDEX sy-tabix.
EXIT.
ENDLOOP.
LOOP AT mt_branches ASSIGNING <ls_branch>.
lv_name = <ls_branch>-name+11.
READ TABLE mt_commits ASSIGNING <ls_commit> WITH KEY sha1 = <ls_branch>-sha1.
ASSERT sy-subrc = 0.
DO.
IF <ls_commit>-branch IS INITIAL.
<ls_commit>-branch = lv_name.
ELSE.
APPEND INITIAL LINE TO <ls_commit>-create ASSIGNING <ls_create>.
<ls_create>-name = lv_name.
<ls_create>-parent = <ls_commit>-branch.
EXIT.
ENDIF.
IF <ls_commit>-parent1 IS INITIAL.
EXIT.
ELSE.
READ TABLE mt_commits ASSIGNING <ls_commit>
WITH KEY sha1 = <ls_commit>-parent1.
ASSERT sy-subrc = 0.
ENDIF.
ENDDO.
ENDLOOP.
ENDMETHOD.
METHOD determine_merges.
FIELD-SYMBOLS: <ls_merged> LIKE LINE OF mt_commits,
<ls_commit> LIKE LINE OF mt_commits.
* important: start with the newest first and propagate branches
SORT mt_commits BY time DESCENDING.
LOOP AT mt_commits ASSIGNING <ls_commit> WHERE NOT parent2 IS INITIAL.
ASSERT NOT <ls_commit>-branch IS INITIAL.
READ TABLE mt_commits ASSIGNING <ls_merged> WITH KEY sha1 = <ls_commit>-parent2.
IF sy-subrc = 0.
<ls_commit>-merge = <ls_merged>-branch.
* orphaned, branch has been deleted after merge
WHILE <ls_merged>-branch IS INITIAL.
<ls_merged>-branch = <ls_commit>-branch.
READ TABLE mt_commits ASSIGNING <ls_merged> WITH KEY sha1 = <ls_merged>-parent1.
IF sy-subrc <> 0.
EXIT.
ENDIF.
ENDWHILE.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD determine_tags.
DATA: lv_tag TYPE LINE OF zif_abapgit_definitions=>ty_commit-tags.
FIELD-SYMBOLS: <ls_tag> LIKE LINE OF mt_tags,
<ls_commit> LIKE LINE OF mt_commits.
LOOP AT mt_tags ASSIGNING <ls_tag>.
IF <ls_tag>-type = zif_abapgit_definitions=>c_git_branch_type-lightweight_tag.
READ TABLE mt_commits WITH KEY sha1 = <ls_tag>-sha1
ASSIGNING <ls_commit>.
ELSEIF <ls_tag>-type = zif_abapgit_definitions=>c_git_branch_type-annotated_tag.
READ TABLE mt_commits WITH KEY sha1 = <ls_tag>-object
ASSIGNING <ls_commit>.
ENDIF.
CHECK sy-subrc = 0.
lv_tag = zcl_abapgit_tag=>remove_tag_prefix( <ls_tag>-name ).
INSERT lv_tag INTO TABLE <ls_commit>-tags.
ENDLOOP.
ENDMETHOD.
METHOD fixes.
FIELD-SYMBOLS: <ls_commit> LIKE LINE OF mt_commits.
LOOP AT mt_commits ASSIGNING <ls_commit> WHERE NOT merge IS INITIAL.
* commits from old branches
IF <ls_commit>-branch = <ls_commit>-merge.
CLEAR <ls_commit>-merge.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD get_branches.
rt_branches = mt_branches.
ENDMETHOD.
METHOD get_commits.
rt_commits = mt_commits.
ENDMETHOD.
METHOD get_git_objects.
DATA: lo_branch_list TYPE REF TO zcl_abapgit_git_branch_list,
lo_progress TYPE REF TO zcl_abapgit_progress,
lt_branches_and_tags TYPE zif_abapgit_definitions=>ty_git_branch_list_tt,
lt_tags TYPE zif_abapgit_definitions=>ty_git_branch_list_tt,
ls_tag LIKE LINE OF mt_tags.
FIELD-SYMBOLS: <ls_branch> TYPE zif_abapgit_definitions=>ty_git_branch.
CREATE OBJECT lo_progress
EXPORTING
iv_total = 1.
lo_progress->show(
iv_current = 1
iv_text = |Get git objects { io_repo->get_name( ) }| ) ##NO_TEXT.
* get objects directly from git, mo_repo only contains a shallow clone of only
* the selected branch
"TODO refactor
lo_branch_list = zcl_abapgit_git_transport=>branches( io_repo->get_url( ) ).
mt_branches = lo_branch_list->get_branches_only( ).
INSERT LINES OF mt_branches INTO TABLE lt_branches_and_tags.
lt_tags = lo_branch_list->get_tags_only( ).
INSERT LINES OF lt_tags INTO TABLE lt_branches_and_tags.
LOOP AT lt_tags ASSIGNING <ls_branch>.
IF <ls_branch>-name CP '*^{}'.
CONTINUE.
ENDIF.
MOVE-CORRESPONDING <ls_branch> TO ls_tag.
INSERT ls_tag INTO TABLE mt_tags.
ENDLOOP.
zcl_abapgit_git_transport=>upload_pack(
EXPORTING
iv_url = io_repo->get_url( )
iv_branch_name = io_repo->get_branch_name( )
iv_deepen = abap_false
it_branches = lt_branches_and_tags
IMPORTING
et_objects = rt_objects ).
DELETE rt_objects WHERE type = zif_abapgit_definitions=>gc_type-blob.
ENDMETHOD.
METHOD get_tags.
rt_tags = mt_tags.
ENDMETHOD.
METHOD parse_annotated_tags.
DATA: ls_raw TYPE zcl_abapgit_git_pack=>ty_tag,
ls_tag LIKE LINE OF mt_tags.
FIELD-SYMBOLS: <ls_object> LIKE LINE OF it_objects,
<ls_tag> LIKE LINE OF mt_tags.
LOOP AT it_objects ASSIGNING <ls_object> WHERE type = zif_abapgit_definitions=>gc_type-tag.
ls_raw = zcl_abapgit_git_pack=>decode_tag( <ls_object>-data ).
CLEAR ls_tag.
ls_tag-sha1 = <ls_object>-sha1.
READ TABLE mt_tags ASSIGNING <ls_tag>
WITH KEY sha1 = <ls_object>-sha1.
ASSERT sy-subrc = 0.
<ls_tag>-name = |refs/tags/{ ls_raw-tag }|.
<ls_tag>-sha1 = <ls_object>-sha1.
<ls_tag>-object = ls_raw-object.
<ls_tag>-type = zif_abapgit_definitions=>c_git_branch_type-annotated_tag.
<ls_tag>-display_name = ls_raw-tag.
<ls_tag>-tagger_name = ls_raw-tagger_name.
<ls_tag>-tagger_email = ls_raw-tagger_email.
<ls_tag>-message = ls_raw-message.
<ls_tag>-body = ls_raw-body.
ENDLOOP.
ENDMETHOD.
METHOD parse_commits.
DATA: ls_commit LIKE LINE OF mt_commits,
lv_trash TYPE string ##NEEDED,
ls_raw TYPE zcl_abapgit_git_pack=>ty_commit.
FIELD-SYMBOLS: <ls_object> LIKE LINE OF it_objects.
LOOP AT it_objects ASSIGNING <ls_object> WHERE type = zif_abapgit_definitions=>gc_type-commit.
ls_raw = zcl_abapgit_git_pack=>decode_commit( <ls_object>-data ).
CLEAR ls_commit.
ls_commit-sha1 = <ls_object>-sha1.
ls_commit-parent1 = ls_raw-parent.
ls_commit-parent2 = ls_raw-parent2.
SPLIT ls_raw-body AT zif_abapgit_definitions=>gc_newline INTO ls_commit-message lv_trash.
* unix time stamps are in same time zone, so ignore the zone,
FIND REGEX zif_abapgit_definitions=>gc_author_regex IN ls_raw-author
SUBMATCHES
ls_commit-author
ls_commit-email
ls_commit-time ##NO_TEXT.
ASSERT sy-subrc = 0.
APPEND ls_commit TO mt_commits.
ENDLOOP.
ENDMETHOD.
METHOD run.
CREATE OBJECT ro_branch_overview
EXPORTING
io_repo = io_repo.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
1671,
3702,
62,
2502,
1177,
5550,
20032,
17941,
44731,
25261,
29244,
6158,
4810,
3824,
6158,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
25,
1057,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
33245,
62,
260,
7501,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
305,
62,
1671,
3702,
62,
2502,
1177,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
1671,
3702,
62,
2502,
1177,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
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,
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,
628,
220,
220,
220,
220,
220,
651,
62,
1671,
12140,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
1671,
12140,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
18300,
62,
1671,
3702,
62,
4868,
62,
926,
11,
628,
220,
220,
220,
220,
220,
651,
62,
31499,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
31499,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
18300,
62,
12985,
62,
4868,
62,
926,
11,
628,
220,
220,
220,
220,
220,
651,
62,
9503,
896,
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,
9503,
896,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
41509,
62,
926,
11,
628,
220,
220,
220,
220,
220,
27413,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
340,
62,
9503,
896,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
41509,
62,
926,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
9503,
896,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
41509,
62,
926,
198,
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,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
21136,
62,
9503,
896,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
340,
62,
48205,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
48205,
62,
926,
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,
21136,
62,
34574,
515,
62,
31499,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
340,
62,
48205,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
48205,
62,
926,
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,
5004,
62,
1671,
3702,
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,
5004,
62,
647,
3212,
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,
13040,
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,
651,
62,
18300,
62,
48205,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
33245,
62,
260,
7501,
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,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
48205,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
48205,
62,
926,
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,
5004,
62,
31499,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
6941,
62,
260,
7501,
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,
45079,
62,
1671,
12140,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
18300,
62,
1671,
3702,
62,
4868,
62,
926,
11,
198,
220,
220,
220,
220,
220,
45079,
62,
9503,
896,
220,
41876,
43679,
3963,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
41509,
11,
198,
220,
220,
220,
220,
220,
45079,
62,
31499,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
18300,
62,
12985,
62,
4868,
62,
926,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
1671,
3702,
62,
2502,
1177,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
27413,
13,
628,
220,
220,
220,
23449,
8881,
4808,
5589,
601,
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,
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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
] |
CLASS zcl_aff_log DEFINITION
PUBLIC
FINAL
CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES zif_aff_log.
CLASS-METHODS:
"! Writes the actual system message fields into the returned structure
"!
"! @parameter result | The actual system message
get_sy_message
RETURNING VALUE(result) TYPE symsg.
PROTECTED SECTION.
PRIVATE SECTION.
DATA:
messages TYPE zif_aff_log=>tt_log_out,
max_severity TYPE symsgty.
METHODS:
add_message
IMPORTING
type TYPE symsgty
message TYPE symsg
component_name TYPE string,
set_max_severity
IMPORTING
type TYPE symsgty.
ENDCLASS.
CLASS zcl_aff_log IMPLEMENTATION.
METHOD zif_aff_log~get_messages.
messages = me->messages.
ENDMETHOD.
METHOD zif_aff_log~add_info.
set_max_severity( zif_aff_log=>c_message_type-info ).
add_message( type = zif_aff_log=>c_message_type-info message = message component_name = component_name ).
ENDMETHOD.
METHOD zif_aff_log~add_warning.
set_max_severity( zif_aff_log=>c_message_type-warning ).
add_message( type = zif_aff_log=>c_message_type-warning message = message component_name = component_name ).
ENDMETHOD.
METHOD zif_aff_log~add_error.
set_max_severity( zif_aff_log=>c_message_type-error ).
add_message( type = zif_aff_log=>c_message_type-error message = message component_name = component_name ).
ENDMETHOD.
METHOD zif_aff_log~add_exception.
set_max_severity( message_type ).
IF exception->get_text( ) IS NOT INITIAL.
cl_message_helper=>set_msg_vars_for_if_msg( exception ).
add_message( type = message_type message = get_sy_message( ) component_name = component_name ).
ENDIF.
IF exception->previous IS BOUND.
zif_aff_log~add_exception( exception = exception->previous message_type = message_type component_name = component_name ).
ENDIF.
ENDMETHOD.
METHOD add_message.
MESSAGE
ID message-msgid
TYPE type
NUMBER message-msgno
WITH message-msgv1 message-msgv2 message-msgv3 message-msgv4
INTO DATA(text).
APPEND VALUE #( component_name = component_name
type = type
text = text
message = get_sy_message( ) ) TO me->messages.
ENDMETHOD.
METHOD zif_aff_log~join.
APPEND LINES OF log_to_join->get_messages( ) TO me->messages.
set_max_severity( log_to_join->get_max_severity( ) ).
ENDMETHOD.
METHOD zif_aff_log~clear.
CLEAR me->messages.
ENDMETHOD.
METHOD zif_aff_log~get_max_severity.
max_severity = me->max_severity.
ENDMETHOD.
METHOD zif_aff_log~has_messages.
has_messages = xsdbool( me->messages IS NOT INITIAL ).
ENDMETHOD.
METHOD get_sy_message.
result = VALUE #(
msgid = sy-msgid
msgno = sy-msgno
msgty = sy-msgty
msgv1 = sy-msgv1
msgv2 = sy-msgv2
msgv3 = sy-msgv3
msgv4 = sy-msgv4 ).
ENDMETHOD.
METHOD set_max_severity.
IF type = zif_aff_log=>c_message_type-error.
max_severity = zif_aff_log=>c_message_type-error.
ELSEIF type = zif_aff_log=>c_message_type-warning.
IF max_severity <> zif_aff_log=>c_message_type-error.
max_severity = zif_aff_log=>c_message_type-warning.
ENDIF.
ELSEIF type = zif_aff_log=>c_message_type-info.
IF max_severity IS INITIAL.
max_severity = zif_aff_log=>c_message_type-info.
ENDIF.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
2001,
62,
6404,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
2001,
62,
6404,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
25,
198,
220,
220,
220,
220,
220,
366,
0,
12257,
274,
262,
4036,
1080,
3275,
7032,
656,
262,
4504,
4645,
198,
220,
220,
220,
220,
220,
366,
0,
198,
220,
220,
220,
220,
220,
366,
0,
2488,
17143,
2357,
1255,
930,
383,
4036,
1080,
3275,
198,
220,
220,
220,
220,
220,
651,
62,
1837,
62,
20500,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
827,
19662,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
6218,
220,
220,
220,
220,
41876,
1976,
361,
62,
2001,
62,
6404,
14804,
926,
62,
6404,
62,
448,
11,
198,
220,
220,
220,
220,
220,
3509,
62,
28116,
414,
41876,
827,
19662,
774,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
751,
62,
20500,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
827,
19662,
774,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3275,
220,
220,
220,
220,
220,
220,
220,
41876,
827,
19662,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7515,
62,
3672,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
900,
62,
9806,
62,
28116,
414,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
41876,
827,
19662,
774,
13,
198,
10619,
31631,
13,
628,
198,
31631,
1976,
565,
62,
2001,
62,
6404,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
2001,
62,
6404,
93,
1136,
62,
37348,
1095,
13,
198,
220,
220,
220,
6218,
796,
502,
3784,
37348,
1095,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
2001,
62,
6404,
93,
2860,
62,
10951,
13,
198,
220,
220,
220,
900,
62,
9806,
62,
28116,
414,
7,
1976,
361,
62,
2001,
62,
6404,
14804,
66,
62,
20500,
62,
4906,
12,
10951,
6739,
198,
220,
220,
220,
751,
62,
20500,
7,
2099,
796,
1976,
361,
62,
2001,
62,
6404,
14804,
66,
62,
20500,
62,
4906,
12,
10951,
3275,
796,
3275,
7515,
62,
3672,
796,
7515,
62,
3672,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
2001,
62,
6404,
93,
2860,
62,
43917,
13,
198,
220,
220,
220,
900,
62,
9806,
62,
28116,
414,
7,
1976,
361,
62,
2001,
62,
6404,
14804,
66,
62,
20500,
62,
4906,
12,
43917,
6739,
198,
220,
220,
220,
751,
62,
20500,
7,
2099,
796,
1976,
361,
62,
2001,
62,
6404,
14804,
66,
62,
20500,
62,
4906,
12,
43917,
3275,
796,
3275,
7515,
62,
3672,
796,
7515,
62,
3672,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
2001,
62,
6404,
93,
2860,
62,
18224,
13,
198,
220,
220,
220,
900,
62,
9806,
62,
28116,
414,
7,
1976,
361,
62,
2001,
62,
6404,
14804,
66,
62,
20500,
62,
4906,
12,
18224,
6739,
198,
220,
220,
220,
751,
62,
20500,
7,
2099,
796,
1976,
361,
62,
2001,
62,
6404,
14804,
66,
62,
20500,
62,
4906,
12,
18224,
3275,
796,
3275,
7515,
62,
3672,
796,
7515,
62,
3672,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
2001,
62,
6404,
93,
2860,
62,
1069,
4516,
13,
198,
220,
220,
220,
900,
62,
9806,
62,
28116,
414,
7,
3275,
62,
4906,
6739,
628,
220,
220,
220,
16876,
6631,
3784,
1136,
62,
5239,
7,
1267,
3180,
5626,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
537,
62,
20500,
62,
2978,
525,
14804,
2617,
62,
19662,
62,
85,
945,
62,
1640,
62,
361,
62,
19662,
7,
6631,
6739,
198,
220,
220,
220,
220,
220,
751,
62,
20500,
7,
2099,
796,
3275,
62,
4906,
3275,
796,
651,
62,
1837,
62,
20500,
7,
1267,
7515,
62,
3672,
796,
7515,
62,
3672,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
16876,
6631,
3784,
3866,
1442,
3180,
347,
15919,
13,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
2001,
62,
6404,
93,
2860,
62,
1069,
4516,
7,
6631,
796,
6631,
3784,
3866,
1442,
3275,
62,
4906,
796,
3275,
62,
4906,
7515,
62,
3672,
796,
7515,
62,
3672,
6739,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
751,
62,
20500,
13,
628,
220,
220,
220,
337,
1546,
4090,
8264,
198,
220,
220,
220,
220,
220,
4522,
3275,
12,
19662,
312,
198,
220,
220,
220,
220,
220,
41876,
2099,
198,
220,
220,
220,
220,
220,
36871,
13246,
3275,
12,
19662,
3919,
198,
220,
220,
220,
220,
220,
13315,
3275,
12,
19662,
85,
16,
3275,
12,
19662,
85,
17,
3275,
12,
19662,
85,
18,
3275,
12,
19662,
85,
19,
198,
220,
220,
220,
220,
220,
39319,
42865,
7,
5239,
737,
628,
220,
220,
220,
43504,
10619,
26173,
8924,
1303,
7,
7515,
62,
3672,
796,
7515,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
220,
220,
220,
796,
2099,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2420,
220,
220,
220,
220,
220,
220,
220,
220,
796,
2420,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3275,
220,
220,
220,
220,
220,
796,
651,
62,
1837,
62,
20500,
7,
1267,
1267,
5390,
502,
3784,
37348,
1095,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
2001,
62,
6404,
93,
22179,
13,
198,
220,
220,
220,
43504,
10619
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
METHOD requestset_update_entity.
DATA: ls_request_input_data TYPE zcl_zabap_active_recor_mpc=>ts_request.
io_data_provider->read_entry_data( IMPORTING es_data = ls_request_input_data ).
er_entity = ls_request_input_data.
DATA lv_parameter TYPE string.
lv_parameter = ls_request_input_data-parameter.
" add field or parameter in to internal table to use in Open SQL operation.
FIELD-SYMBOLS: <fs_parameters> LIKE LINE OF me->parameters.
APPEND INITIAL LINE TO me->parameters ASSIGNING <fs_parameters>.
<fs_parameters>-parameter_type = lv_parameter(1).
SHIFT lv_parameter LEFT BY 1 PLACES.
<fs_parameters>-parameter_line = lv_parameter.
ENDMETHOD. | [
220,
337,
36252,
2581,
2617,
62,
19119,
62,
26858,
13,
198,
220,
220,
220,
42865,
25,
43979,
62,
25927,
62,
15414,
62,
7890,
220,
41876,
1976,
565,
62,
89,
397,
499,
62,
5275,
62,
8344,
273,
62,
3149,
66,
14804,
912,
62,
25927,
13,
628,
220,
220,
220,
33245,
62,
7890,
62,
15234,
1304,
3784,
961,
62,
13000,
62,
7890,
7,
30023,
9863,
2751,
1658,
62,
7890,
796,
43979,
62,
25927,
62,
15414,
62,
7890,
6739,
198,
220,
220,
220,
1931,
62,
26858,
796,
43979,
62,
25927,
62,
15414,
62,
7890,
13,
628,
220,
220,
220,
42865,
300,
85,
62,
17143,
2357,
41876,
4731,
13,
198,
220,
220,
220,
300,
85,
62,
17143,
2357,
796,
43979,
62,
25927,
62,
15414,
62,
7890,
12,
17143,
2357,
13,
628,
220,
220,
220,
366,
751,
2214,
393,
11507,
287,
284,
5387,
3084,
284,
779,
287,
4946,
16363,
4905,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
9501,
62,
17143,
7307,
29,
34178,
48920,
3963,
502,
3784,
17143,
7307,
13,
198,
220,
220,
220,
43504,
10619,
3268,
2043,
12576,
48920,
5390,
502,
3784,
17143,
7307,
24994,
3528,
15871,
1279,
9501,
62,
17143,
7307,
28401,
198,
220,
220,
220,
1279,
9501,
62,
17143,
7307,
29,
12,
17143,
2357,
62,
4906,
796,
300,
85,
62,
17143,
2357,
7,
16,
737,
198,
220,
220,
220,
6006,
32297,
300,
85,
62,
17143,
2357,
12509,
9792,
11050,
352,
9297,
2246,
1546,
13,
198,
220,
220,
220,
1279,
9501,
62,
17143,
7307,
29,
12,
17143,
2357,
62,
1370,
796,
300,
85,
62,
17143,
2357,
13,
628,
220,
23578,
49273,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class ZBIL_BRF_GROUPING_RULES definition
public
final
create public .
public section.
class-methods GET_ALLOWED_FOR_PRODUCT
importing
!PRODUCT type CHAR40
returning
value(RETURN) TYPE ZBIL_BRF_GROUPING_CONFIG_T .
class-methods GET_KEYFIELDS_FOR_PRODUCT
importing
!PRODUCT type CHAR40
returning
value(RETURN) TYPE TCHAR255 .
protected section.
private section.
ENDCLASS.
CLASS ZBIL_BRF_GROUPING_RULES IMPLEMENTATION.
METHOD GET_ALLOWED_FOR_PRODUCT.
CONSTANTS:lv_function_id TYPE if_fdt_types=>id VALUE '0242AC1100021EE8A1BD90FCA835CAA2'.
types: begin of ty_input,
product_code type char255,
end of ty_input.
DATA:lv_timestamp TYPE timestamp,
lt_name_value TYPE abap_parmbind_tab,
ls_name_value TYPE abap_parmbind,
lr_data TYPE REF TO data,
lx_fdt TYPE REF TO cx_fdt,
lr_input TYPE REF TO data,
ls_input type ty_input,
ls_output type line of ZBIL_BRF_GROUPING_CONFIG_T.
FIELD-SYMBOLS: <la_any> TYPE table,
<lr_input> TYPE any,
<fs_field> type any,
<fs_result> type any.
GET TIME STAMP FIELD lv_timestamp.
ls_name_value-name = 'INPUT'.
CREATE DATA lr_input TYPE ty_input.
ASSIGN lr_input->* TO <lr_input>.
ls_input-product_code = product.
<lr_input> = ls_input.
lr_data = lr_input.
cl_fdt_function_process=>move_data_to_data_object( EXPORTING ir_data = lr_data
iv_function_id = lv_function_id
iv_data_object = '0242AC1100021EE8A1BD4CC5978FCA75' "INPUT
iv_timestamp = lv_timestamp
iv_trace_generation = abap_false
iv_has_ddic_binding = abap_false
IMPORTING er_data = ls_name_value-value ).
INSERT ls_name_value INTO TABLE lt_name_value.
cl_fdt_function_process=>get_data_object_reference( EXPORTING iv_function_id = lv_function_id
iv_data_object = '_V_RESULT'
iv_timestamp = lv_timestamp
iv_trace_generation = abap_false
IMPORTING er_data = lr_data ).
ASSIGN lr_data->* TO <la_any>.
TRY.
cl_fdt_function_process=>process( EXPORTING iv_function_id = lv_function_id
iv_timestamp = lv_timestamp
IMPORTING ea_result = <la_any>
CHANGING ct_name_value = lt_name_value ).
loop at <la_any> assigning <fs_result>.
ASSIGN COMPONENT 'ADDITIONAL_CODE' OF STRUCTURE <fs_result> TO <fs_field>.
ls_output-additional_service = <fs_field>.
ASSIGN COMPONENT 'ALLOWED' OF STRUCTURE <fs_result> TO <fs_field>.
ls_output-allowed = <fs_field>.
append ls_output to return.
endloop.
CATCH cx_fdt into lx_fdt.
****************************************************************************************************
* You can check CX_FDT->MT_MESSAGE for error handling.
****************************************************************************************************
ENDTRY.
ENDMETHOD.
METHOD GET_KEYFIELDS_FOR_PRODUCT.
CONSTANTS:lv_function_id TYPE if_fdt_types=>id VALUE '0242AC1100021EE8A1BC78E0CF130A01'.
types: begin of ty_input,
product_code type char255,
end of ty_input.
DATA:lv_timestamp TYPE timestamp,
lt_name_value TYPE abap_parmbind_tab,
ls_name_value TYPE abap_parmbind,
lr_data TYPE REF TO data,
lx_fdt TYPE REF TO cx_fdt,
lr_input TYPE REF TO data,
ls_input type ty_input,
lv_output type char255.
FIELD-SYMBOLS: <la_any> TYPE table,
<lr_input> TYPE any,
<fs_output> type any,
<fs_field> type any.
GET TIME STAMP FIELD lv_timestamp.
ls_name_value-name = 'INPUT'.
CREATE DATA lr_input TYPE ty_input .
ASSIGN lr_input->* TO <lr_input>.
ls_input-product_code = product.
<lr_input> = ls_input.
lr_data = lr_input.
cl_fdt_function_process=>move_data_to_data_object( EXPORTING ir_data = lr_data
iv_function_id = lv_function_id
iv_data_object = '0242AC1100021EE8A1BC12C4574CA9C3' "INPUT
iv_timestamp = lv_timestamp
iv_trace_generation = abap_false
iv_has_ddic_binding = abap_false
IMPORTING er_data = ls_name_value-value ).
INSERT ls_name_value INTO TABLE lt_name_value.
cl_fdt_function_process=>get_data_object_reference( EXPORTING iv_function_id = lv_function_id
iv_data_object = '_V_RESULT'
iv_timestamp = lv_timestamp
iv_trace_generation = abap_false
IMPORTING er_data = lr_data ).
ASSIGN lr_data->* TO <la_any>.
TRY.
cl_fdt_function_process=>process( EXPORTING iv_function_id = lv_function_id
iv_timestamp = lv_timestamp
IMPORTING ea_result = <la_any>
CHANGING ct_name_value = lt_name_value ).
loop at <la_any> assigning <fs_output>.
ASSIGN COMPONENT 'FIELD' OF STRUCTURE <fs_output> TO <fs_field>.
lv_output = <fs_field>.
append lv_output to return.
endloop.
CATCH cx_fdt into lx_fdt.
****************************************************************************************************
* You can check CX_FDT->MT_MESSAGE for error handling.
****************************************************************************************************
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
4871,
1168,
19676,
62,
11473,
37,
62,
46846,
2751,
62,
49,
6239,
1546,
6770,
198,
220,
1171,
198,
220,
2457,
198,
220,
2251,
1171,
764,
628,
220,
1171,
2665,
13,
198,
220,
220,
220,
1398,
12,
24396,
82,
17151,
62,
7036,
3913,
1961,
62,
13775,
62,
4805,
28644,
198,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4805,
28644,
220,
220,
220,
220,
220,
2099,
28521,
1821,
198,
220,
220,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
7,
26087,
27064,
8,
41876,
1168,
19676,
62,
11473,
37,
62,
46846,
2751,
62,
10943,
16254,
62,
51,
764,
198,
220,
220,
220,
1398,
12,
24396,
82,
17151,
62,
20373,
11674,
3698,
5258,
62,
13775,
62,
4805,
28644,
198,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4805,
28644,
220,
220,
220,
220,
220,
2099,
28521,
1821,
198,
220,
220,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
7,
26087,
27064,
8,
41876,
309,
38019,
13381,
764,
198,
220,
6861,
2665,
13,
198,
220,
2839,
2665,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
19676,
62,
11473,
37,
62,
46846,
2751,
62,
49,
6239,
1546,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
17151,
62,
7036,
3913,
1961,
62,
13775,
62,
4805,
28644,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
6780,
62,
8818,
62,
312,
41876,
611,
62,
16344,
83,
62,
19199,
14804,
312,
26173,
8924,
705,
15,
27877,
2246,
1157,
830,
2481,
6500,
23,
32,
16,
14529,
3829,
4851,
32,
23,
2327,
34,
3838,
17,
4458,
198,
220,
220,
220,
3858,
25,
2221,
286,
1259,
62,
15414,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1720,
62,
8189,
2099,
1149,
13381,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
286,
1259,
62,
15414,
13,
198,
220,
220,
220,
42865,
25,
6780,
62,
16514,
27823,
220,
41876,
41033,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
3672,
62,
8367,
41876,
450,
499,
62,
79,
1670,
21653,
62,
8658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
3672,
62,
8367,
41876,
450,
499,
62,
79,
1670,
21653,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
300,
81,
62,
7890,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1366,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
300,
87,
62,
16344,
83,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
43213,
62,
16344,
83,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
300,
81,
62,
15414,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1366,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
15414,
220,
220,
220,
220,
220,
2099,
1259,
62,
15414,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
22915,
220,
220,
220,
220,
2099,
1627,
286,
220,
1168,
19676,
62,
11473,
37,
62,
46846,
2751,
62,
10943,
16254,
62,
51,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
5031,
62,
1092,
29,
220,
220,
220,
41876,
3084,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
14050,
62,
15414,
29,
220,
41876,
597,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
9501,
62,
3245,
29,
220,
2099,
597,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
9501,
62,
20274,
29,
2099,
597,
13,
198,
220,
220,
220,
17151,
20460,
3563,
23518,
18930,
24639,
300,
85,
62,
16514,
27823,
13,
628,
220,
220,
220,
43979,
62,
3672,
62,
8367,
12,
3672,
796,
705,
1268,
30076,
4458,
198,
220,
220,
220,
29244,
6158,
42865,
300,
81,
62,
15414,
41876,
1259,
62,
15414,
13,
198,
220,
220,
220,
24994,
16284,
300,
81,
62,
15414,
3784,
9,
5390,
1279,
14050,
62,
15414,
28401,
198,
220,
220,
220,
43979,
62,
15414,
12,
11167,
62,
8189,
796,
1720,
13,
198,
220,
220,
220,
1279,
14050,
62,
15414,
29,
796,
43979,
62,
15414,
13,
198,
220,
220,
220,
300,
81,
62,
7890,
796,
300,
81,
62,
15414,
13,
198,
220,
220,
220,
537,
62,
16344,
83,
62,
8818,
62,
14681,
14804,
21084,
62,
7890,
62,
1462,
62,
7890,
62,
15252,
7,
7788,
15490,
2751,
4173,
62,
7890,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
81,
62,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
8818,
62,
312,
220,
220,
220,
220,
220,
796,
300,
85,
62,
8818,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
7890,
62,
15252,
220,
220,
220,
220,
220,
796,
705,
15,
27877,
2246,
1157,
830,
2481,
6500,
23,
32,
16,
14529,
19,
4093,
3270,
3695,
4851,
32,
2425,
6,
366,
1268,
30076,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_object_tabl 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.
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.
"! 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 zcl_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 zcl_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 .
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' ##NO_TEXT,
END OF c_s_dataname .
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 .
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_TABL IMPLEMENTATION.
METHOD clear_dd03p_fields.
CONSTANTS lc_comptype_dataelement TYPE comptype VALUE 'E' ##NO_TEXT.
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.
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_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( 'error from TR_TADIR_INTERFACE' ).
ENDIF.
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 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 zif_abapgit_object~changed_by.
TYPES: BEGIN OF ty_data,
as4user TYPE as4user,
as4date TYPE as4date,
as4time TYPE 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_tabclass TYPE dd02l-tabclass,
lv_no_ask TYPE abap_bool,
lv_subrc TYPE sy-subrc,
lr_data TYPE REF TO data.
FIELD-SYMBOLS: <lg_data> TYPE any.
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 tabclass FROM dd02l INTO lv_tabclass
WHERE tabname = ms_item-obj_name
AND as4local = 'A'
AND as4vers = '0000'.
IF sy-subrc = 0 AND lv_tabclass = 'TRANSP'.
* Avoid dump in dynamic SELECT in case the table does not exist on database
CALL FUNCTION 'DB_EXISTS_TABLE'
EXPORTING
tabname = lv_objname
IMPORTING
subrc = lv_subrc.
IF lv_subrc = 0.
* it cannot delete table with table without asking
CREATE DATA lr_data TYPE (lv_objname).
ASSIGN lr_data->* TO <lg_data>.
SELECT SINGLE * FROM (lv_objname) INTO <lg_data>.
IF sy-subrc = 0.
lv_no_ask = abap_false.
ENDIF.
ENDIF.
ENDIF.
CALL FUNCTION 'RS_DD_DELETE_OBJ'
EXPORTING
no_ask = lv_no_ask
objname = lv_objname
objtype = 'T'
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, TABL,' && sy-subrc ).
ENDIF.
delete_longtexts( c_longtext_id_tabl ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lv_name TYPE ddobjname,
lv_tname TYPE trobj_name,
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_dd12v TYPE dd12vtab,
lt_dd17v TYPE dd17vtab,
ls_dd17v LIKE LINE OF lt_dd17v,
lt_secondary LIKE lt_dd17v,
lt_dd35v TYPE TABLE OF dd35v,
lt_dd36m TYPE dd36mttyp,
ls_dd12v LIKE LINE OF lt_dd12v.
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 ).
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 = 'DD12V'
CHANGING cg_data = lt_dd12v ).
io_xml->read( EXPORTING iv_name = 'DD17V'
CHANGING cg_data = lt_dd17v ).
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 ).
corr_insert( iv_package = iv_package ig_object_class = 'DICT' ).
lv_name = ms_item-obj_name. " type conversion
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( 'error from DDIF_TABL_PUT' ).
ENDIF.
zcl_abapgit_objects_activation=>add_item( ms_item ).
* handle indexes
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( 'error from DDIF_INDX_PUT' ).
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.
deserialize_longtexts( io_xml ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_tabname TYPE dd02l-tabname.
SELECT SINGLE tabname FROM dd02l INTO lv_tabname
WHERE tabname = ms_item-obj_name
AND as4local = 'A'
AND as4vers = '0000'.
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
DATA: lo_local_version_output TYPE REF TO zcl_abapgit_xml_output,
lo_local_version_input TYPE REF TO zcl_abapgit_xml_input.
CREATE OBJECT lo_local_version_output.
me->zif_abapgit_object~serialize( lo_local_version_output ).
CREATE OBJECT lo_local_version_input
EXPORTING
iv_xml = lo_local_version_output->render( ).
CREATE OBJECT ri_comparator TYPE zcl_abapgit_object_tabl_compar
EXPORTING
io_local = lo_local_version_input.
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-DDTYPE'
iv_field = 'RSRD1-DDTYPE_VAL' ).
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.
FIELD-SYMBOLS: <ls_dd12v> LIKE LINE OF lt_dd12v,
<ls_dd05m> LIKE LINE OF lt_dd05m,
<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.
RETURN. " object does not exits
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>.
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.
* remove inherited search helps
DELETE lt_dd35v WHERE shlpinher = abap_true.
LOOP AT lt_dd36m ASSIGNING <ls_dd36m>.
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( ig_data = lt_dd03p
iv_name = 'DD03P_TABLE' ).
io_xml->add( ig_data = lt_dd05m
iv_name = 'DD05M_TABLE' ).
io_xml->add( ig_data = lt_dd08v
iv_name = 'DD08V_TABLE' ).
io_xml->add( iv_name = 'DD12V'
ig_data = lt_dd12v ).
io_xml->add( iv_name = 'DD17V'
ig_data = lt_dd17v ).
io_xml->add( ig_data = lt_dd35v
iv_name = 'DD35V_TALE' ).
io_xml->add( iv_name = 'DD36M'
ig_data = lt_dd36m ).
serialize_longtexts( io_xml = io_xml
iv_longtext_id = c_longtext_id_tabl ).
serialize_idoc_segment( io_xml ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
8658,
75,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
13,
198,
220,
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,
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,
565,
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,
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,
220,
220,
220,
220,
220,
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,
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,
198,
220,
220,
220,
366,
0,
23520,
262,
4522,
420,
1001,
5154,
2099,
611,
7160,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
374,
85,
62,
2934,
33342,
930,
632,
338,
257,
10618,
290,
373,
13140,
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,
12233,
62,
312,
420,
62,
325,
5154,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
2934,
33342,
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,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
1860,
3070,
79,
62,
926,
41876,
49053,
9795,
43679,
3963,
49427,
3070,
79,
764,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
6511,
5239,
62,
312,
62,
8658,
75,
41876,
466,
34553,
12,
312,
26173,
8924,
705,
22737,
6,
22492,
15285,
62,
32541,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
82,
62,
19608,
272,
480,
11,
198,
220,
220,
220,
220,
220,
220,
220,
10618,
62,
46758,
41876,
4731,
26173,
8924,
705,
5188,
38,
10979,
62,
7206,
20032,
17941,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
82,
62,
19608,
272,
480,
764,
628,
220,
220,
220,
337,
36252,
50,
1598,
62,
1860,
3070,
79,
62,
25747,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
310,
62,
1860,
3070,
79,
41876,
1259,
62,
1860,
3070,
79,
62,
926,
764,
198,
220,
220,
220,
366,
0,
6822,
611,
4645,
318,
281
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
class ZSAPLINK_NUGGET definition
public
final
create public .
public section.
methods ADDOBJECTTONUGGET
importing
!OBJNAME type STRING optional
!OBJTYPE type STRING optional
!XMLDOCUMENT type ref to IF_IXML_DOCUMENT optional
raising
ZCX_SAPLINK .
methods CREATEIXMLDOCFROMNUGGET
returning
value(IXMLDOCUMENT) type ref to IF_IXML_DOCUMENT .
methods GETNEXTOBJECT
returning
value(IXMLDOCUMENT) type ref to IF_IXML_DOCUMENT .
methods RESET .
class-methods CREATEEMPTYXML
importing
!NUGGETNAME type STRING
returning
value(IXMLDOCUMENT) type ref to IF_IXML_DOCUMENT .
class-methods GETNUGGETINFO
importing
!IXMLDOCUMENT type ref to IF_IXML_DOCUMENT
returning
value(NAME) type STRING .
methods CONSTRUCTOR
importing
!NAME type STRING optional
!IXMLDOCUMENT type ref to IF_IXML_DOCUMENT optional .
methods CHECKOBJECTEXISTS
importing
!OBJNAME type STRING
!OBJTYPE type STRING
returning
value(RETVAL) type SY-SUBRC .
methods DELETEOBJECTFROMNUGGET
importing
!OBJNAME type STRING
!OBJTYPE type STRING
returning
value(RETVAL) type SY-SUBRC .
protected section.
data IXML type ref to IF_IXML .
data XMLDOC type ref to IF_IXML_DOCUMENT .
private section.
data ITERATOR type ref to IF_IXML_NODE_ITERATOR .
data NUGGNAME type STRING .
data STREAMFACTORY type ref to IF_IXML_STREAM_FACTORY .
data XMLDATA type STRING .
data WT_OBJECTS type TT_OBJECTS .
data W_INDEX type SY-TABIX .
endclass. "ZSAPLINK_NUGGET definition
*----------------------------------------------------------------------*
* class ZSAPLINK_NUGGET implementation.
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class ZSAPLINK_NUGGET implementation.
method ADDOBJECTTONUGGET.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| The code of this project is provided to you under the current |
*| version of the SAP Code Exchange Terms of Use. You can find the |
*| text on the SAP Code Exchange webpage at http://www.sdn.sap.com |
*| |
*| SAPlink is provided to you AS IS with no guarantee, warranty or |
*| support. |
*\---------------------------------------------------------------------/
types: begin of t_objectTable,
classname type string,
object type ko100-object,
text type ko100-text,
end of t_objectTable.
data rootNode type ref to if_ixml_element.
data saplink type ref to zsaplink.
data objectTable type table of t_objectTable.
data objectLine type t_objectTable.
data ixmlDocument type ref to if_ixml_document.
data rval type i.
data objElement type ref to if_ixml_element.
rootNode = xmlDoc->GET_ROOT_ELEMENT( ).
if xmlDocument is initial.
call method zsaplink=>getplugins( changing objectTable = objectTable ).
read table objectTable into objectLine with key object = ObjType.
if sy-subrc <> 0.
raise exception type zcx_saplink
exporting textid = zcx_saplink=>no_plugin.
endif.
create object saplink type (objectLine-classname) exporting name =
objName.
ixmlDocument = saplink->CREATEIXMLDOCFROMOBJECT( ).
else.
ixmlDocument = xmlDocument.
endif.
objElement = ixmlDocument->get_root_element( ).
rval = rootNode->append_Child( objElement ).
endmethod.
method CHECKOBJECTEXISTS.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| The code of this project is provided to you under the current |
*| version of the SAP Code Exchange Terms of Use. You can find the |
*| text on the SAP Code Exchange webpage at http://www.sdn.sap.com |
*| |
*| SAPlink is provided to you AS IS with no guarantee, warranty or |
*| support. |
*\---------------------------------------------------------------------/
data: docFilter type ref to if_ixml_node_filter,
docIterator type ref to if_ixml_node_iterator,
currentNode type ref to if_ixml_node,
rootAttr type ref to IF_IXML_NAMED_NODE_MAP,
AttrNode type ref to IF_IXML_NODE,
nodeName type string,
existsFlag type flag.
* create a filter to traverse the nugget by object type like CLAS or PROG
docFilter = xmlDoc->create_filter_name_ns( objType ).
* apply the filter to the iterator
docIterator = xmlDoc->create_iterator_filtered( docFilter ).
* get the first object of that type in the nugget
currentNode = docIterator->get_next( ).
* if this node is not blank proceed to check the attributes
while currentNode is not initial.
* get object name
rootAttr = currentNode->GET_ATTRIBUTES( ).
AttrNode = rootAttr->GET_ITEM( 0 ).
nodeName = AttrNode->GET_VALUE( ).
* if the name of the node is the same as the passed parameter, set the flag
if nodeName = objname.
existsFlag = 'X'.
endif.
currentNode = docIterator->get_next( ).
endwhile.
if existsFlag = 'X'.
retval = 0.
else.
retval = 4.
endif.
endmethod.
method CONSTRUCTOR.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| The code of this project is provided to you under the current |
*| version of the SAP Code Exchange Terms of Use. You can find the |
*| text on the SAP Code Exchange webpage at http://www.sdn.sap.com |
*| |
*| SAPlink is provided to you AS IS with no guarantee, warranty or |
*| support. |
*\---------------------------------------------------------------------/
data rootNode type ref to if_ixml_element.
data rval type i.
*data xmlDoc type ref to if_ixml_document.
if name is not initial.
NuggName = name.
ixml = cl_ixml=>create( ).
xmlDoc = ixml->create_document( ).
* may need this from create empty nugget
*dan this was commented out, any ideas why?? Uncommented for Zake.
rootNode = xmlDoc->create_element( 'nugget' ).
rval = rootNode->SET_ATTRIBUTE( name = 'name' value = nuggName ).
rval = xmlDoc->append_child( rootNode ).
streamFactory = ixml->CREATE_STREAM_FACTORY( ).
elseif ixmlDocument is not initial.
ixml = cl_ixml=>create( ).
xmlDoc = ixmlDocument.
rootNode = xmlDoc->get_root_element( ).
nuggName = rootNode->get_attribute( 'name' ).
streamFactory = ixml->CREATE_STREAM_FACTORY( ).
else.
raise exception type zcx_saplink
exporting textid = zcx_saplink=>system_error.
endif.
endmethod.
method CREATEEMPTYXML.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| The code of this project is provided to you under the current |
*| version of the SAP Code Exchange Terms of Use. You can find the |
*| text on the SAP Code Exchange webpage at http://www.sdn.sap.com |
*| |
*| SAPlink is provided to you AS IS with no guarantee, warranty or |
*| support. |
*\---------------------------------------------------------------------/
data ixml type ref to if_IXML.
data rootNode type ref to if_ixml_element.
data rval type i.
data xmlDoc type ref to if_ixml_document.
ixml = cl_ixml=>create( ).
xmlDoc = ixml->create_document( ).
rootNode = xmlDoc->create_element( 'nugget' ).
rval = rootNode->SET_ATTRIBUTE( name = 'name' value = nuggetName ).
rval = xmlDoc->append_child( rootNode ).
ixmlDocument = xmlDoc.
endmethod.
method CREATEIXMLDOCFROMNUGGET.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| The code of this project is provided to you under the current |
*| version of the SAP Code Exchange Terms of Use. You can find the |
*| text on the SAP Code Exchange webpage at http://www.sdn.sap.com |
*| |
*| SAPlink is provided to you AS IS with no guarantee, warranty or |
*| support. |
*\---------------------------------------------------------------------/
ixmlDocument = xmlDoc.
endmethod.
method DELETEOBJECTFROMNUGGET.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| The code of this project is provided to you under the current |
*| version of the SAP Code Exchange Terms of Use. You can find the |
*| text on the SAP Code Exchange webpage at http://www.sdn.sap.com |
*| |
*| SAPlink is provided to you AS IS with no guarantee, warranty or |
*| support. |
*\---------------------------------------------------------------------/
data: docFilter type ref to if_ixml_node_filter,
docIterator type ref to if_ixml_node_iterator,
currentNode type ref to if_ixml_node,
rootAttr type ref to IF_IXML_NAMED_NODE_MAP,
AttrNode type ref to IF_IXML_NODE,
nodeName type string.
* create a filter to traverse the nugget by object type like CLAS or PROG
docFilter = xmlDoc->create_filter_name_ns( objType ).
* apply the filter to the iterator
docIterator = xmlDoc->create_iterator_filtered( docFilter ).
* get the first object of that type in the nugget
currentNode = docIterator->get_next( ).
* if this node is not blank proceed to check the attributes
while currentNode is not initial.
* get object name
rootAttr = currentNode->GET_ATTRIBUTES( ).
AttrNode = rootAttr->GET_ITEM( 0 ).
nodeName = AttrNode->GET_VALUE( ).
* if the name of the node is the same as the passed parameter, delete the node
if nodeName = objname.
currentNode->remove_node( ).
retVal = sy-subrc.
return.
endif.
currentNode = docIterator->get_next( ).
endwhile.
endmethod.
method GETNEXTOBJECT.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| The code of this project is provided to you under the current |
*| version of the SAP Code Exchange Terms of Use. You can find the |
*| text on the SAP Code Exchange webpage at http://www.sdn.sap.com |
*| |
*| SAPlink is provided to you AS IS with no guarantee, warranty or |
*| support. |
*\---------------------------------------------------------------------/
DATA anode TYPE REF TO if_ixml_node.
DATA stemp TYPE string.
DATA rootnode TYPE REF TO if_ixml_node.
DATA namefilter TYPE REF TO if_ixml_node_filter.
DATA parentfilter TYPE REF TO if_ixml_node_filter.
DATA currentnode TYPE REF TO if_ixml_node.
DATA newnode TYPE REF TO if_ixml_node.
DATA: rval TYPE i,
lo_object TYPE REF TO zsaplink,
l_tabix TYPE i,
ls_objects TYPE ts_objects.
IF wt_objects IS INITIAL.
IF iterator IS INITIAL.
namefilter = xmldoc->create_filter_name_ns( name = 'nugget' ).
parentfilter = xmldoc->create_filter_parent( namefilter ).
iterator = xmldoc->create_iterator_filtered( parentfilter ).
ENDIF.
currentnode ?= iterator->get_next( ).
WHILE currentnode IS NOT INITIAL.
add 1 to l_tabix.
ixmldocument = ixml->create_document( ).
newnode = currentnode->clone( ).
rval = ixmldocument->append_child( newnode ).
CLEAR ls_objects.
zsaplink=>checkobject(
EXPORTING
i_ixmldocument = ixmldocument
IMPORTING
* e_objtype =
* e_objname =
* e_pluginexists =
* e_objectexists =
e_targetobject = lo_object
).
IF lo_object IS BOUND.
ls_objects-nugget_level = lo_object->nugget_level.
ELSE.
* We will not handle this here
ls_objects-nugget_level = 0.
ENDIF.
ls_objects-sort = l_tabix.
ls_objects-xmldocument = ixmldocument.
INSERT ls_objects INTO TABLE wt_objects.
currentnode ?= iterator->get_next( ).
ENDWHILE.
ENDIF.
ADD 1 TO w_index.
READ TABLE wt_objects INTO ls_objects INDEX w_index.
IF sy-subrc = 0.
ixmldocument = ls_objects-xmldocument.
ELSE.
CLEAR ixmldocument.
ENDIF.
endmethod.
method GETNUGGETINFO.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| The code of this project is provided to you under the current |
*| version of the SAP Code Exchange Terms of Use. You can find the |
*| text on the SAP Code Exchange webpage at http://www.sdn.sap.com |
*| |
*| SAPlink is provided to you AS IS with no guarantee, warranty or |
*| support. |
*\---------------------------------------------------------------------/
data rootNode type ref to if_ixml_element.
rootNode = ixmlDocument->get_root_element( ).
name = rootNode->get_attribute( 'name' ).
endmethod.
method RESET.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| The code of this project is provided to you under the current |
*| version of the SAP Code Exchange Terms of Use. You can find the |
*| text on the SAP Code Exchange webpage at http://www.sdn.sap.com |
*| |
*| SAPlink is provided to you AS IS with no guarantee, warranty or |
*| support. |
*\---------------------------------------------------------------------/
if iterator is not initial.
refresh: wt_objects.
clear w_index.
iterator->reset( ).
endif.
endmethod.
endclass. "ZSAPLINK_NUGGET implementation | [
4871,
1168,
50,
2969,
43,
17248,
62,
45,
7340,
18851,
6770,
201,
198,
220,
1171,
201,
198,
220,
2457,
201,
198,
220,
2251,
1171,
764,
201,
198,
201,
198,
11377,
2665,
13,
201,
198,
201,
198,
220,
5050,
27841,
9864,
23680,
11357,
7340,
18851,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
9864,
41,
20608,
2099,
19269,
2751,
11902,
201,
198,
220,
220,
220,
220,
220,
5145,
9864,
41,
25216,
2099,
19269,
2751,
11902,
201,
198,
220,
220,
220,
220,
220,
5145,
55,
5805,
38715,
5883,
3525,
2099,
1006,
284,
16876,
62,
10426,
5805,
62,
38715,
5883,
3525,
11902,
201,
198,
220,
220,
220,
8620,
201,
198,
220,
220,
220,
220,
220,
1168,
34,
55,
62,
50,
2969,
43,
17248,
764,
201,
198,
220,
5050,
29244,
6158,
10426,
5805,
38715,
10913,
2662,
45,
7340,
18851,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
10426,
5805,
38715,
5883,
3525,
8,
2099,
1006,
284,
16876,
62,
10426,
5805,
62,
38715,
5883,
3525,
764,
201,
198,
220,
5050,
17151,
45,
13918,
9864,
23680,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
10426,
5805,
38715,
5883,
3525,
8,
2099,
1006,
284,
16876,
62,
10426,
5805,
62,
38715,
5883,
3525,
764,
201,
198,
220,
5050,
15731,
2767,
764,
201,
198,
220,
1398,
12,
24396,
82,
29244,
6158,
39494,
9936,
55,
5805,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
45,
7340,
18851,
20608,
2099,
19269,
2751,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
10426,
5805,
38715,
5883,
3525,
8,
2099,
1006,
284,
16876,
62,
10426,
5805,
62,
38715,
5883,
3525,
764,
201,
198,
220,
1398,
12,
24396,
82,
17151,
45,
7340,
18851,
10778,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
10426,
5805,
38715,
5883,
3525,
2099,
1006,
284,
16876,
62,
10426,
5805,
62,
38715,
5883,
3525,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
20608,
8,
2099,
19269,
2751,
764,
201,
198,
220,
5050,
7102,
46126,
1581,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
20608,
2099,
19269,
2751,
11902,
201,
198,
220,
220,
220,
220,
220,
5145,
10426,
5805,
38715,
5883,
3525,
2099,
1006,
284,
16876,
62,
10426,
5805,
62,
38715,
5883,
3525,
11902,
764,
201,
198,
220,
5050,
5870,
25171,
9864,
23680,
6369,
1797,
4694,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
9864,
41,
20608,
2099,
19269,
2751,
201,
198,
220,
220,
220,
220,
220,
5145,
9864,
41,
25216,
2099,
19269,
2751,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
2200,
6849,
1847,
8,
2099,
19704,
12,
50,
10526,
7397,
764,
201,
198,
220,
5050,
5550,
28882,
4720,
33,
23680,
10913,
2662,
45,
7340,
18851,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
9864,
41,
20608,
2099,
19269,
2751,
201,
198,
220,
220,
220,
220,
220,
5145,
9864,
41,
25216,
2099,
19269,
2751,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
2200,
6849,
1847,
8,
2099,
19704,
12,
50,
10526,
7397,
764,
201,
198,
24326,
2665,
13,
201,
198,
201,
198,
220,
1366,
22631,
5805,
2099,
1006,
284,
16876,
62,
10426,
5805,
764,
201,
198,
220,
1366,
23735,
38715,
2099,
1006,
284,
16876,
62,
10426,
5805,
62,
38715,
5883,
3525,
764,
201,
198,
19734,
2665,
13,
201,
198,
201,
198,
220,
1366,
314,
5781,
25633,
2099,
1006,
284,
16876,
62,
10426,
5805,
62,
45,
16820,
62,
2043,
1137,
25633,
764,
201,
198,
220,
1366,
399,
7340,
16630,
10067,
2099,
19269,
2751,
764,
201,
198,
220,
1366,
3563,
32235,
37,
10659,
15513,
2099,
1006,
284,
16876,
62,
10426,
5805,
62,
2257,
32235,
62,
37,
10659,
15513,
764,
201,
198,
220,
1366,
23735,
26947,
2099,
19269,
2751,
764,
201,
198,
220,
1366,
41281,
62,
9864,
41,
2943,
4694,
2099,
26653,
62,
9864,
41,
2943,
4694,
764,
201,
198,
220,
1366,
370,
62,
12115,
6369,
2099,
19704,
12,
5603,
3483,
55,
764,
201,
198,
437,
4871,
13,
366,
57,
50,
2969,
43,
17248,
62,
45,
7340,
18851,
6770,
201,
198,
201,
198,
201,
198,
201,
198,
9,
10097,
23031,
9,
201,
198,
9,
220,
220,
220,
220,
220,
220,
1398,
1168,
50,
2969,
43,
17248,
62,
45,
7340,
18851,
7822,
13,
201,
198,
9,
10097,
23031,
9,
201,
198,
9,
201,
198,
9,
10097,
23031,
9,
201,
198,
4871,
1168,
50,
2969,
43,
17248,
62,
45,
7340,
18851,
7822,
13,
201,
198,
201,
198,
201,
198,
24396,
27841,
9864,
23680,
11357,
7340,
18851,
13,
201,
198,
16208,
10097,
30934,
59,
201,
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,
201,
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,
201,
198,
9,
91,
220,
220,
383,
2438,
286,
428,
1628,
318,
2810,
284,
345,
739,
262,
1459,
220,
220,
220,
220,
930,
201,
198,
9,
91,
220,
220,
2196,
286,
262,
48323,
6127,
12516,
17637,
286,
5765,
13,
921,
460,
1064,
262,
220,
220,
930,
201,
198,
9,
91,
220,
220,
2420,
319,
262,
48323,
6127,
12516,
35699,
379,
2638,
1378,
2503,
13,
21282,
77,
13,
82,
499,
13,
785,
220,
220,
930,
201,
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
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS ycl_a2g_json_candlestickserie 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_candlestickserie,
data TYPE ycl_a2g_json_chartdata=>ty_s_json_chartdata,
END OF ty_s_json_candlestickserie.
TYPES ty_t_json_candlestickserie TYPE STANDARD TABLE OF ty_s_json_candlestickserie WITH NON-UNIQUE DEFAULT KEY.
PROTECTED SECTION.
METHODS generate_rules REDEFINITION.
METHODS rebuild_data REDEFINITION.
METHODS push_data REDEFINITION.
DATA: gs_candlestickserie TYPE ty_s_json_candlestickserie.
PRIVATE SECTION.
ENDCLASS.
CLASS ycl_a2g_json_candlestickserie IMPLEMENTATION.
METHOD push_data.
ENDMETHOD.
METHOD rebuild_data.
ENDMETHOD.
METHOD constructor.
super->constructor( if_msg_manager ).
me->gv_data = REF #( me->gs_candlestickserie ).
ENDMETHOD.
METHOD generate_rules.
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
46188,
32712,
3378,
18287,
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,
46188,
32712,
3378,
18287,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
41876,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
40926,
7890,
14804,
774,
62,
82,
62,
17752,
62,
40926,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
82,
62,
17752,
62,
46188,
32712,
3378,
18287,
13,
198,
220,
220,
220,
24412,
47,
1546,
1259,
62,
83,
62,
17752,
62,
46188,
32712,
3378,
18287,
41876,
49053,
9795,
43679,
3963,
1259,
62,
82,
62,
17752,
62,
46188,
32712,
3378,
18287,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
7716,
62,
38785,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
17884,
62,
7890,
220,
220,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
4574,
62,
7890,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
13,
628,
220,
220,
220,
42865,
25,
308,
82,
62,
46188,
32712,
3378,
18287,
220,
41876,
1259,
62,
82,
62,
17752,
62,
46188,
32712,
3378,
18287,
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,
46188,
32712,
3378,
18287,
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,
46188,
32712,
3378,
18287,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_bubblechart 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_bubblechart,
legendposition TYPE string,
bubblelabels TYPE ycl_a2g_json_chartdata=>ty_s_json_chartdata,
domain TYPE ycl_a2g_json_chartdata=>ty_s_json_chartdata,
series TYPE ycl_a2g_json_chartdata=>ty_s_json_chartdata,
groupids TYPE ycl_a2g_json_chartdata=>ty_s_json_chartdata,
bubbleopacity TYPE i,
bubblebordercolor TYPE ycl_a2g_json_color=>ty_s_json_color,
bubblemaxradiussize TYPE i,
bubbleminradiussize TYPE i,
bubbletextstyle TYPE ycl_a2g_json_textformat=>ty_s_json_textformat,
END OF ty_s_json_bubblechart.
TYPES ty_t_json_bubblechart TYPE STANDARD TABLE OF ty_s_json_bubblechart WITH NON-UNIQUE DEFAULT KEY.
PROTECTED SECTION.
METHODS generate_rules REDEFINITION.
METHODS rebuild_data REDEFINITION.
METHODS push_data REDEFINITION.
DATA: gs_bubblechart TYPE ty_s_json_bubblechart.
PRIVATE SECTION.
ENDCLASS.
CLASS ycl_a2g_json_bubblechart IMPLEMENTATION.
METHOD push_data.
ENDMETHOD.
METHOD rebuild_data.
ENDMETHOD.
METHOD constructor.
super->constructor( if_msg_manager ).
me->gv_data = REF #( me->gs_bubblechart ).
ENDMETHOD.
METHOD generate_rules.
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
46176,
903,
40926,
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,
46176,
903,
40926,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8177,
9150,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14310,
23912,
1424,
220,
220,
220,
220,
220,
220,
220,
41876,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
40926,
7890,
14804,
774,
62,
82,
62,
17752,
62,
40926,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7386,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
40926,
7890,
14804,
774,
62,
82,
62,
17752,
62,
40926,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2168,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
40926,
7890,
14804,
774,
62,
82,
62,
17752,
62,
40926,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1448,
2340,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
40926,
7890,
14804,
774,
62,
82,
62,
17752,
62,
40926,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14310,
404,
4355,
220,
220,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14310,
65,
585,
2798,
45621,
220,
220,
41876,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
8043,
14804,
774,
62,
82,
62,
17752,
62,
8043,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14310,
9806,
6335,
72,
1046,
1096,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14310,
1084,
6335,
72,
1046,
1096,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
14310,
5239,
7635,
220,
220,
220,
220,
41876,
331,
565,
62,
64,
17,
70,
62,
17752,
62,
5239,
18982,
14804,
774,
62,
82,
62,
17752,
62,
5239,
18982,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
82,
62,
17752,
62,
46176,
903,
40926,
13,
198,
220,
220,
220,
24412,
47,
1546,
1259,
62,
83,
62,
17752,
62,
46176,
903,
40926,
41876,
49053,
9795,
43679,
3963,
1259,
62,
82,
62,
17752,
62,
46176,
903,
40926,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
7716,
62,
38785,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
17884,
62,
7890,
220,
220,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
4574,
62,
7890,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
13,
628,
220,
220,
220,
42865,
25,
308,
82,
62,
46176,
903,
40926,
220,
41876,
1259,
62,
82,
62,
17752,
62,
46176,
903,
40926,
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,
46176,
903,
40926,
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,
46176,
903,
40926,
220,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
7716,
62,
38785,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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
] |
CLASS ycl_advent2020_day01 DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS solve_part_one
IMPORTING
input TYPE string_table
RETURNING
VALUE(result) TYPE i.
METHODS solve_part_two
IMPORTING
input TYPE string_table
RETURNING
VALUE(result) TYPE i.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS YCL_ADVENT2020_DAY01 IMPLEMENTATION.
METHOD solve_part_one.
LOOP AT input ASSIGNING FIELD-SYMBOL(<i>).
DATA(diff) = 2020 - <i>.
DATA(found) = VALUE i( input[ table_line = |{ diff }| ] OPTIONAL ).
IF found IS NOT INITIAL.
result = diff * <i>.
RETURN.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD solve_part_two.
LOOP AT input ASSIGNING FIELD-SYMBOL(<i>).
LOOP AT input ASSIGNING FIELD-SYMBOL(<j>).
DATA(diff) = 2020 - ( <i> + <j> ) .
DATA(found) = VALUE i( input[ table_line = |{ diff }| ] OPTIONAL ).
IF found IS NOT INITIAL.
result = diff * <i> * <j>.
RETURN.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
565,
62,
324,
1151,
42334,
62,
820,
486,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
8494,
62,
3911,
62,
505,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
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,
1312,
13,
628,
220,
220,
220,
337,
36252,
50,
8494,
62,
3911,
62,
11545,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5128,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
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,
1312,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
575,
5097,
62,
2885,
53,
3525,
42334,
62,
26442,
486,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
8494,
62,
3911,
62,
505,
13,
628,
220,
220,
220,
17579,
3185,
5161,
5128,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
72,
29,
737,
198,
220,
220,
220,
220,
220,
42865,
7,
26069,
8,
796,
12131,
532,
1279,
72,
28401,
198,
220,
220,
220,
220,
220,
42865,
7,
9275,
8,
796,
26173,
8924,
1312,
7,
5128,
58,
3084,
62,
1370,
796,
220,
930,
90,
814,
1782,
91,
2361,
39852,
2849,
1847,
6739,
198,
220,
220,
220,
220,
220,
16876,
1043,
3180,
5626,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
814,
1635,
1279,
72,
28401,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
8494,
62,
3911,
62,
11545,
13,
198,
220,
220,
220,
17579,
3185,
5161,
5128,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
72,
29,
737,
198,
220,
220,
220,
220,
220,
17579,
3185,
5161,
5128,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
73,
29,
737,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
26069,
8,
796,
12131,
532,
357,
1279,
72,
29,
1343,
1279,
73,
29,
1267,
764,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
9275,
8,
796,
26173,
8924,
1312,
7,
5128,
58,
3084,
62,
1370,
796,
220,
930,
90,
814,
1782,
91,
2361,
39852,
2849,
1847,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
16876,
1043,
3180,
5626,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
814,
1635,
1279,
72,
29,
1635,
1279,
73,
28401,
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,
21982,
3185,
13,
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,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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
] |
CLASS zcl_abapgit_gui_page_commit DEFINITION PUBLIC FINAL
CREATE PUBLIC INHERITING FROM zcl_abapgit_gui_page.
PUBLIC SECTION.
CONSTANTS: BEGIN OF c_action,
commit_post TYPE string VALUE 'commit_post',
commit_cancel TYPE string VALUE 'commit_cancel',
END OF c_action.
METHODS:
constructor
IMPORTING io_repo TYPE REF TO zcl_abapgit_repo_online
io_stage TYPE REF TO zcl_abapgit_stage
RAISING zcx_abapgit_exception,
zif_abapgit_gui_page~on_event REDEFINITION.
PROTECTED SECTION.
METHODS:
render_content REDEFINITION,
scripts REDEFINITION.
PRIVATE SECTION.
DATA: mo_repo TYPE REF TO zcl_abapgit_repo_online,
mo_stage TYPE REF TO zcl_abapgit_stage.
METHODS:
render_menu
RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html,
render_stage
RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html
RAISING zcx_abapgit_exception,
render_form
RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html
RAISING zcx_abapgit_exception,
render_text_input
IMPORTING iv_name TYPE string
iv_label TYPE string
iv_value TYPE string OPTIONAL
iv_max_length TYPE string OPTIONAL
RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html.
ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_PAGE_COMMIT IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
mo_repo = io_repo.
mo_stage = io_stage.
ms_control-page_title = 'COMMIT'.
ENDMETHOD.
METHOD render_content.
CREATE OBJECT ro_html.
ro_html->add( '<div class="repo">' ).
ro_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top(
io_repo = mo_repo
iv_show_package = abap_false
iv_branch = mo_stage->get_branch_name( ) ) ).
ro_html->add( render_menu( ) ).
ro_html->add( render_form( ) ).
ro_html->add( render_stage( ) ).
ro_html->add( '</div>' ).
ENDMETHOD. "render_content
METHOD render_form.
CONSTANTS: lc_body_col_max TYPE i VALUE 150.
DATA: lo_user TYPE REF TO zcl_abapgit_persistence_user.
DATA: lv_user TYPE string.
DATA: lv_email TYPE string.
DATA: lv_s_param TYPE string.
DATA: lo_settings TYPE REF TO zcl_abapgit_settings.
DATA: lv_body_size TYPE i.
* see https://git-scm.com/book/ch5-2.html
* commit messages should be max 50 characters
* body should wrap at 72 characters
lo_user = zcl_abapgit_persistence_user=>get_instance( ).
lv_user = lo_user->get_repo_git_user_name( mo_repo->get_url( ) ).
IF lv_user IS INITIAL.
lv_user = lo_user->get_default_git_user_name( ).
ENDIF.
lv_email = lo_user->get_repo_git_user_email( mo_repo->get_url( ) ).
IF lv_email IS INITIAL.
lv_email = lo_user->get_default_git_user_email( ).
ENDIF.
CREATE OBJECT ro_html.
ro_html->add( '<div class="form-container">' ).
ro_html->add( '<form id="commit_form" class="aligned-form"'
&& ' method="post" action="sapevent:commit_post">' ).
ro_html->add( render_text_input( iv_name = 'committer_name'
iv_label = 'committer name'
iv_value = lv_user ) ).
ro_html->add( render_text_input( iv_name = 'committer_email'
iv_label = 'committer e-mail'
iv_value = lv_email ) ).
lo_settings = zcl_abapgit_persist_settings=>get_instance( )->read( ).
lv_s_param = lo_settings->get_commitmsg_comment_length( ).
ro_html->add( render_text_input( iv_name = 'comment'
iv_label = 'comment'
iv_max_length = lv_s_param ) ).
ro_html->add( '<div class="row">' ).
ro_html->add( '<label for="c-body">body</label>' ).
lv_body_size = lo_settings->get_commitmsg_body_size( ).
IF lv_body_size > lc_body_col_max.
lv_body_size = lc_body_col_max.
ENDIF.
ro_html->add( |<textarea id="c-body" name="body" rows="10" cols="| &&
|{ lv_body_size }"></textarea>| ).
ro_html->add( '<input type="submit" class="hidden-submit">' ).
ro_html->add( '</div>' ).
ro_html->add( '<div class="row">' ).
ro_html->add( '<span class="cell"></span>' ).
ro_html->add( '<span class="cell sub-title">Optionally,'
&& ' specify author (same as committer by default)</span>' ).
ro_html->add( '</div>' ).
ro_html->add( render_text_input( iv_name = 'author_name'
iv_label = 'author name' ) ).
ro_html->add( render_text_input( iv_name = 'author_email'
iv_label = 'author e-mail' ) ).
ro_html->add( '</form>' ).
ro_html->add( '</div>' ).
ENDMETHOD. "render_form
METHOD render_menu.
DATA lo_toolbar TYPE REF TO zcl_abapgit_html_toolbar.
CREATE OBJECT ro_html.
CREATE OBJECT lo_toolbar.
lo_toolbar->add( iv_act = 'submitFormById(''commit_form'');'
iv_txt = 'Commit'
iv_typ = zif_abapgit_definitions=>gc_action_type-onclick
iv_opt = zif_abapgit_definitions=>gc_html_opt-strong ) ##NO_TEXT.
lo_toolbar->add( iv_act = c_action-commit_cancel
iv_txt = 'Cancel'
iv_opt = zif_abapgit_definitions=>gc_html_opt-cancel ) ##NO_TEXT.
ro_html->add( '<div class="paddings">' ).
ro_html->add( lo_toolbar->render( ) ).
ro_html->add( '</div>' ).
ENDMETHOD. "render_menu
METHOD render_stage.
DATA: lt_stage TYPE zcl_abapgit_stage=>ty_stage_tt.
FIELD-SYMBOLS: <ls_stage> LIKE LINE OF lt_stage.
CREATE OBJECT ro_html.
lt_stage = mo_stage->get_all( ).
ro_html->add( '<table class="stage_tab">' ).
ro_html->add( '<thead>' ).
ro_html->add( '<tr>').
ro_html->add( '<th colspan="2">Staged files</th>').
ro_html->add( '</tr>' ).
ro_html->add( '</thead>' ).
ro_html->add( '<tbody>' ).
LOOP AT lt_stage ASSIGNING <ls_stage>.
ro_html->add( '<tr>' ).
ro_html->add( '<td class="method">' ).
ro_html->add( zcl_abapgit_stage=>method_description( <ls_stage>-method ) ).
ro_html->add( '</td>' ).
ro_html->add( '<td>' ).
ro_html->add( <ls_stage>-file-path && <ls_stage>-file-filename ).
ro_html->add( '</td>' ).
ro_html->add( '</tr>' ).
ENDLOOP.
ro_html->add( '</tbody>' ).
ro_html->add( '</table>' ).
ENDMETHOD. "render_stage
METHOD render_text_input.
DATA lv_attrs TYPE string.
CREATE OBJECT ro_html.
IF iv_value IS NOT INITIAL.
lv_attrs = | value="{ iv_value }"|.
ENDIF.
IF iv_max_length IS NOT INITIAL.
lv_attrs = | maxlength="{ iv_max_length }"|.
ENDIF.
ro_html->add( '<div class="row">' ).
ro_html->add( |<label for="{ iv_name }">{ iv_label }</label>| ).
ro_html->add( |<input id="{ iv_name }" name="{ iv_name }" type="text"{ lv_attrs }>| ).
ro_html->add( '</div>' ).
ENDMETHOD. " render_text_input
METHOD scripts.
CREATE OBJECT ro_html.
ro_html->add( 'setInitialFocus("comment");' ).
ENDMETHOD. "scripts
METHOD zif_abapgit_gui_page~on_event.
DATA: ls_commit TYPE zcl_abapgit_services_git=>ty_commit_fields.
CASE iv_action.
WHEN c_action-commit_post.
zcl_abapgit_html_action_utils=>parse_commit_request(
EXPORTING it_postdata = it_postdata
IMPORTING es_fields = ls_commit ).
ls_commit-repo_key = mo_repo->get_key( ).
zcl_abapgit_services_git=>commit( is_commit = ls_commit
io_repo = mo_repo
io_stage = mo_stage ).
ev_state = zif_abapgit_definitions=>gc_event_state-go_back_to_bookmark.
WHEN c_action-commit_cancel.
ev_state = zif_abapgit_definitions=>gc_event_state-go_back.
ENDCASE.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
41509,
5550,
20032,
17941,
44731,
25261,
198,
220,
220,
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,
7102,
2257,
1565,
4694,
25,
347,
43312,
3963,
269,
62,
2673,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4589,
62,
7353,
220,
220,
41876,
4731,
26173,
8924,
705,
41509,
62,
7353,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4589,
62,
66,
21130,
41876,
4731,
26173,
8924,
705,
41509,
62,
66,
21130,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
2673,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
33245,
62,
260,
7501,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
14247,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
14247,
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,
7700,
93,
261,
62,
15596,
23848,
36,
20032,
17941,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
8543,
62,
11299,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
14750,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
6941,
62,
260,
7501,
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,
6941,
62,
14247,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
14247,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
8543,
62,
26272,
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,
14247,
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,
8543,
62,
687,
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,
8543,
62,
5239,
62,
15414,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
18242,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
8367,
220,
220,
220,
220,
220,
220,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
9806,
62,
13664,
220,
41876,
4731,
39852,
2849,
1847,
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,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
40156,
62,
4537,
8264,
62,
9858,
36393,
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,
6941,
62,
260,
7501,
220,
220,
796,
33245,
62,
260,
7501,
13,
198,
220,
220,
220,
6941,
62,
14247,
220,
796,
33245,
62,
14247,
13,
628,
220,
220,
220,
13845,
62,
13716,
12,
7700,
62,
7839,
796,
705,
9858,
36393,
4458,
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,
628,
220,
220,
220,
686,
62,
6494,
3784,
2860,
7,
705,
27,
7146,
1398,
2625,
260,
7501,
5320,
6,
6739,
198,
220,
220,
220,
686,
62,
6494,
3784,
2860,
7,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
354,
2954,
62,
8019,
14804,
13287,
62,
260,
7501,
62,
4852,
7,
198,
220,
220,
220,
220,
220,
33245,
62,
260,
7501,
220,
220,
220,
220,
220,
220,
220,
220,
796,
6941,
62,
260,
7501,
198,
220,
220,
220,
220,
220,
21628,
62,
12860,
62,
26495,
796,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
21628,
62,
1671,
3702,
220,
220,
220,
220,
220,
220,
796,
6941,
62,
14247,
3784,
1136,
62,
1671,
3702,
62,
3672,
7,
1267,
1267,
6739,
628,
220,
220,
220,
686,
62,
6494,
3784,
2860,
7,
8543,
62,
26272,
7,
1267,
6739,
198,
220,
220,
220,
686,
62,
6494,
3784,
2860,
7,
8543,
62,
687,
7,
1267,
6739,
198,
220,
220,
220,
686,
62,
6494,
3784,
2860,
7,
8543,
62,
14247,
7,
1267,
6739,
198,
220,
220,
220,
686,
62,
6494,
3784,
2860,
7,
705,
3556,
7146,
29,
6,
6739,
628,
220,
23578,
49273,
13,
220,
366,
13287,
62,
11299,
628,
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,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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
] |
CLASS zcl_faker_provider_address DEFINITION
PUBLIC
INHERITING FROM zcl_faker_provider
ABSTRACT .
PUBLIC SECTION.
METHODS street_name
RETURNING VALUE(r_result) TYPE string.
METHODS street_suffix_long
RETURNING VALUE(r_result) TYPE string.
METHODS street_suffix_short
RETURNING VALUE(r_result) TYPE string.
METHODS post_code
RETURNING VALUE(r_result) TYPE string.
METHODS building_number
RETURNING VALUE(r_result) TYPE string.
METHODS city_prefix
RETURNING VALUE(r_result) TYPE string.
METHODS city_suffix
RETURNING VALUE(r_result) TYPE string.
METHODS city_name
RETURNING VALUE(r_result) TYPE string.
METHODS city
RETURNING VALUE(r_result) TYPE string.
PROTECTED SECTION.
DATA _street_formats TYPE string_table.
DATA _street_suffixes_long TYPE string_table.
DATA _street_suffixes_short TYPE string_table.
DATA _building_number_formats TYPE string_table.
DATA _postcode_formats TYPE string_table.
DATA _city_prefixes TYPE string_table.
DATA _city_suffixes TYPE string_table.
DATA _city_names TYPE string_table.
DATA _city_formats TYPE string_table.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_faker_provider_address IMPLEMENTATION.
METHOD street_name.
r_result = formatter( _street_formats[ random( lines( _street_formats ) ) ] ).
ENDMETHOD.
METHOD street_suffix_long.
r_result = _street_suffixes_long[ random( lines( _street_suffixes_long ) ) ].
ENDMETHOD.
METHOD street_suffix_short.
r_result = _street_suffixes_short[ random( lines( _street_suffixes_short ) ) ].
ENDMETHOD.
METHOD post_code.
r_result = numerify( _postcode_formats[ random( lines( _postcode_formats ) ) ] ).
ENDMETHOD.
METHOD building_number.
r_result = numerify( _building_number_formats[ random( lines( _building_number_formats ) ) ] ).
ENDMETHOD.
METHOD city_prefix.
r_result = _city_prefixes[ random( lines( _city_prefixes ) ) ].
ENDMETHOD.
METHOD city_suffix.
r_result = _city_suffixes[ random( lines( _city_suffixes ) ) ].
ENDMETHOD.
METHOD city_name.
r_result = _city_names[ random( lines( _city_names ) ) ].
ENDMETHOD.
METHOD city.
r_result = formatter( _city_formats[ random( lines( _city_formats ) ) ] ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
69,
3110,
62,
15234,
1304,
62,
21975,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
69,
3110,
62,
15234,
1304,
198,
220,
9564,
18601,
10659,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
4675,
62,
3672,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4731,
13,
198,
220,
220,
220,
337,
36252,
50,
4675,
62,
37333,
844,
62,
6511,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4731,
13,
198,
220,
220,
220,
337,
36252,
50,
4675,
62,
37333,
844,
62,
19509,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4731,
13,
198,
220,
220,
220,
337,
36252,
50,
1281,
62,
8189,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4731,
13,
198,
220,
220,
220,
337,
36252,
50,
2615,
62,
17618,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4731,
13,
198,
220,
220,
220,
337,
36252,
50,
1748,
62,
40290,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4731,
13,
198,
220,
220,
220,
337,
36252,
50,
1748,
62,
37333,
844,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4731,
13,
198,
220,
220,
220,
337,
36252,
50,
1748,
62,
3672,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4731,
13,
198,
220,
220,
220,
337,
36252,
50,
1748,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
4731,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
42865,
4808,
25662,
62,
687,
1381,
41876,
4731,
62,
11487,
13,
198,
220,
220,
220,
42865,
4808,
25662,
62,
37333,
844,
274,
62,
6511,
41876,
4731,
62,
11487,
13,
198,
220,
220,
220,
42865,
4808,
25662,
62,
37333,
844,
274,
62,
19509,
41876,
4731,
62,
11487,
13,
198,
220,
220,
220,
42865,
4808,
16894,
62,
17618,
62,
687,
1381,
41876,
4731,
62,
11487,
13,
198,
220,
220,
220,
42865,
4808,
7353,
8189,
62,
687,
1381,
41876,
4731,
62,
11487,
13,
198,
220,
220,
220,
42865,
4808,
19205,
62,
40290,
274,
41876,
4731,
62,
11487,
13,
198,
220,
220,
220,
42865,
4808,
19205,
62,
37333,
844,
274,
41876,
4731,
62,
11487,
13,
198,
220,
220,
220,
42865,
4808,
19205,
62,
14933,
41876,
4731,
62,
11487,
13,
198,
220,
220,
220,
42865,
4808,
19205,
62,
687,
1381,
41876,
4731,
62,
11487,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
69,
3110,
62,
15234,
1304,
62,
21975,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
4675,
62,
3672,
13,
198,
220,
220,
220,
374,
62,
20274,
796,
1296,
1436,
7,
4808,
25662,
62,
687,
1381,
58,
4738,
7,
3951,
7,
4808,
25662,
62,
687,
1381,
1267,
1267,
2361,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
4675,
62,
37333,
844,
62,
6511,
13,
198,
220,
220,
220,
374,
62,
20274,
796,
4808,
25662,
62,
37333,
844,
274,
62,
6511,
58,
4738,
7,
3951,
7,
4808,
25662,
62,
37333,
844,
274,
62,
6511,
1267,
1267,
20740,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
4675,
62,
37333,
844,
62,
19509,
13,
198,
220,
220,
220,
374,
62,
20274,
796,
4808,
25662,
62,
37333,
844,
274,
62,
19509,
58,
4738,
7,
3951,
7,
4808,
25662,
62,
37333,
844,
274,
62,
19509,
1267,
1267,
20740,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1281,
62,
8189,
13,
198,
220,
220,
220,
374,
62,
20274,
796,
5470,
1958,
7,
4808,
7353,
8189,
62,
687,
1381,
58,
4738,
7,
3951,
7,
4808,
7353,
8189,
62,
687,
1381,
1267,
1267,
2361,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
2615,
62,
17618,
13,
198,
220,
220,
220,
374,
62,
20274,
796,
5470,
1958,
7,
4808,
16894,
62,
17618,
62,
687,
1381,
58,
4738,
7,
3951,
7,
4808,
16894,
62,
17618,
62,
687,
1381,
1267,
1267,
2361,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1748,
62,
40290,
13,
198,
220,
220,
220,
374,
62,
20274,
796,
4808,
19205,
62,
40290,
274,
58,
4738,
7,
3951,
7,
4808,
19205,
62,
40290,
274,
1267,
1267,
20740,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1748,
62,
37333,
844,
13,
198,
220,
220,
220,
374,
62,
20274,
796,
4808,
19205,
62,
37333,
844,
274,
58,
4738,
7,
3951,
7,
4808,
19205,
62,
37333,
844,
274,
1267,
1267,
20740,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1748,
62,
3672,
13,
198,
220,
220,
220,
374,
62,
20274,
796,
4808,
19205,
62,
14933,
58,
4738,
7,
3951,
7,
4808,
19205,
62,
14933,
1267,
1267,
20740,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1748,
13,
198,
220,
220,
220,
374,
62,
20274,
796,
1296,
1436,
7,
4808,
19205,
62,
687,
1381,
58,
4738,
7,
3951,
7,
4808,
19205,
62,
687,
1381,
1267,
1267,
2361,
6739,
198,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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