content
stringlengths 4
1.04M
| input_ids
sequencelengths 2
1.02k
| attention_mask
sequencelengths 2
1.02k
|
---|---|---|
CLASS ltcl_error DEFINITION
FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT
FINAL.
PRIVATE SECTION.
METHODS raise FOR TESTING.
ENDCLASS.
CLASS ltcl_error IMPLEMENTATION.
METHOD raise.
DATA lx_error TYPE REF TO zcx_abaplint_error.
DATA lv_msg TYPE string.
lv_msg = repeat( val = 'a' occ = 50 ) && repeat( val = 'b' occ = 50 ) && '123'.
TRY.
zcx_abaplint_error=>raise( lv_msg ).
cl_abap_unit_assert=>fail( ).
CATCH zcx_abaplint_error INTO lx_error.
cl_abap_unit_assert=>assert_equals(
exp = lv_msg
act = lx_error->get_text( ) ).
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
83,
565,
62,
18224,
5550,
20032,
17941,
198,
220,
7473,
43001,
2751,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
25261,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
5298,
7473,
43001,
2751,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
18224,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
5298,
13,
628,
220,
220,
220,
42865,
300,
87,
62,
18224,
41876,
4526,
37,
5390,
1976,
66,
87,
62,
15498,
489,
600,
62,
18224,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
19662,
41876,
4731,
13,
628,
220,
220,
220,
300,
85,
62,
19662,
796,
9585,
7,
1188,
796,
705,
64,
6,
1609,
796,
2026,
1267,
11405,
9585,
7,
1188,
796,
705,
65,
6,
1609,
796,
2026,
1267,
11405,
705,
10163,
4458,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
15498,
489,
600,
62,
18224,
14804,
40225,
7,
300,
85,
62,
19662,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
15498,
489,
600,
62,
18224,
39319,
300,
87,
62,
18224,
13,
198,
220,
220,
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,
220,
220,
1033,
796,
300,
85,
62,
19662,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
719,
796,
300,
87,
62,
18224,
3784,
1136,
62,
5239,
7,
1267,
6739,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abappgp_subpacket_07 DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abappgp_subpacket .
ALIASES from_stream
FOR zif_abappgp_subpacket~from_stream .
ALIASES get_name
FOR zif_abappgp_subpacket~get_name .
ALIASES get_type
FOR zif_abappgp_subpacket~get_type .
ALIASES to_stream
FOR zif_abappgp_subpacket~to_stream .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_ABAPPGP_SUBPACKET_07 IMPLEMENTATION.
METHOD zif_abappgp_subpacket~dump.
rv_dump = |\tSub - { get_name( ) }(sub { get_type( ) })({ to_stream( )->get_length( ) } bytes)\n\t\ttodo\n|.
ENDMETHOD.
METHOD zif_abappgp_subpacket~from_stream.
* todo
CREATE OBJECT ri_packet
TYPE zcl_abappgp_subpacket_07.
ENDMETHOD.
METHOD zif_abappgp_subpacket~get_name.
rv_name = 'Revocable'.
ENDMETHOD.
METHOD zif_abappgp_subpacket~get_type.
rv_type = zif_abappgp_constants=>c_sub_type-revocable.
ENDMETHOD.
METHOD zif_abappgp_subpacket~to_stream.
CREATE OBJECT ro_stream.
* todo
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
1324,
31197,
62,
7266,
8002,
316,
62,
2998,
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,
7266,
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,
7266,
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,
7266,
8002,
316,
93,
1136,
62,
3672,
764,
198,
220,
220,
220,
8355,
43429,
1546,
651,
62,
4906,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
1324,
31197,
62,
7266,
8002,
316,
93,
1136,
62,
4906,
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,
7266,
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,
50,
10526,
47,
8120,
2767,
62,
2998,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
1324,
31197,
62,
7266,
8002,
316,
93,
39455,
13,
628,
220,
220,
220,
374,
85,
62,
39455,
796,
930,
59,
83,
7004,
532,
1391,
651,
62,
3672,
7,
1267,
1782,
7,
7266,
1391,
651,
62,
4906,
7,
1267,
1782,
5769,
90,
284,
62,
5532,
7,
1267,
3784,
1136,
62,
13664,
7,
1267,
1782,
9881,
19415,
77,
59,
83,
59,
926,
24313,
59,
77,
91,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
1324,
31197,
62,
7266,
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,
7266,
8002,
316,
62,
2998,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
1324,
31197,
62,
7266,
8002,
316,
93,
1136,
62,
3672,
13,
628,
220,
220,
220,
374,
85,
62,
3672,
796,
705,
18009,
420,
540,
4458,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
1324,
31197,
62,
7266,
8002,
316,
93,
1136,
62,
4906,
13,
628,
220,
220,
220,
374,
85,
62,
4906,
796,
1976,
361,
62,
397,
1324,
31197,
62,
9979,
1187,
14804,
66,
62,
7266,
62,
4906,
12,
18218,
420,
540,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
1324,
31197,
62,
7266,
8002,
316,
93,
1462,
62,
5532,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
686,
62,
5532,
13,
198,
9,
284,
4598,
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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
1,
1,
1
] |
*&---------------------------------------------------------------------*
*& Report zbc100_01_selscreen
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zbc100_01_selscreen.
* Utilizing a simple selection screen
* input fields for user name and age
PARAMETERS: p_name TYPE string,
p_age TYPE i.
* say hello to the user
WRITE: TEXT-hel, p_name. " using a text symbol in text elements
NEW-LINE.
WRITE: 'Congratulations on reaching the age of', p_age, '!'.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
1976,
15630,
3064,
62,
486,
62,
741,
9612,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
198,
9,
5,
10097,
30934,
9,
198,
2200,
15490,
1976,
15630,
3064,
62,
486,
62,
741,
9612,
13,
198,
9,
7273,
346,
2890,
257,
2829,
6356,
3159,
198,
198,
9,
5128,
7032,
329,
2836,
1438,
290,
2479,
198,
27082,
2390,
2767,
4877,
25,
279,
62,
3672,
41876,
4731,
11,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
62,
496,
220,
41876,
1312,
13,
198,
198,
9,
910,
23748,
284,
262,
2836,
198,
18564,
12709,
25,
40383,
12,
2978,
11,
279,
62,
3672,
13,
366,
1262,
257,
2420,
6194,
287,
2420,
4847,
198,
198,
13965,
12,
24027,
13,
198,
198,
18564,
12709,
25,
705,
45048,
319,
8978,
262,
2479,
286,
3256,
279,
62,
496,
11,
705,
0,
4458,
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
] |
REPORT ztransport.
PARAMETERS: p_sys TYPE tmssysnam MATCHCODE OBJECT s_realsys OBLIGATORY.
START-OF-SELECTION.
PERFORM run.
FORM run.
DATA: lt_log TYPE tmstpalogs,
lv_domain TYPE tmsmconf-domnam,
lv_start_date TYPE dats,
lv_start_time TYPE tims,
lv_end_date TYPE dats,
lv_end_time TYPE tims.
lv_start_date = sy-datum - 100.
lv_start_time = sy-uzeit.
lv_end_date = sy-datum.
lv_end_time = sy-uzeit.
CALL FUNCTION 'TMS_CFG_GET_LOCAL_DOMAIN_NAME'
IMPORTING
ev_domain_name = lv_domain
EXCEPTIONS
tms_is_not_configured = 1
OTHERS = 2.
IF sy-subrc <> 0.
BREAK-POINT.
ENDIF.
CALL FUNCTION 'TMS_TM_GET_HISTORY'
EXPORTING
iv_system = p_sys
iv_domain = lv_domain
IMPORTING
et_tmstpalog = lt_log
CHANGING
cv_start_date = lv_start_date
cv_start_time = lv_start_time
cv_end_date = lv_end_date
cv_end_time = lv_end_time
EXCEPTIONS
alert = 1
OTHERS = 2.
IF sy-subrc <> 0.
BREAK-POINT.
ENDIF.
SORT lt_log BY trtime ASCENDING.
LOOP AT lt_log ASSIGNING FIELD-SYMBOL(<ls_log>) WHERE retcode = '0008'.
cl_progress_indicator=>progress_indicate(
i_text = <ls_log>-trkorr
i_processed = sy-tabix
i_total = lines( lt_log )
i_output_immediately = abap_true ).
WRITE: / <ls_log>-trtime, <ls_log>-trkorr.
PERFORM read_log USING <ls_log>-trkorr.
ENDLOOP.
ENDFORM.
FORM read_log USING pv_trkorr TYPE trkorr.
DATA: lt_log TYPE trlogs.
CALL FUNCTION 'TMS_WBO_READ_LOG'
EXPORTING
iv_sysname = p_sys
iv_acttype = 'G'
iv_trkorr = pv_trkorr
IMPORTING
et_logtab = lt_log
EXCEPTIONS
invalid_input = 1
file_access_error = 2
db_access_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
WRITE: / space, space, 'Error'.
RETURN.
ENDIF.
DELETE lt_log WHERE severity <> 'E'.
LOOP AT lt_log ASSIGNING FIELD-SYMBOL(<ls_log>).
WRITE: / space, space, <ls_log>-line.
ENDLOOP.
ENDFORM.
| [
2200,
15490,
1976,
7645,
634,
13,
198,
198,
27082,
2390,
2767,
4877,
25,
279,
62,
17597,
41876,
256,
76,
824,
893,
7402,
337,
11417,
34,
16820,
25334,
23680,
264,
62,
260,
874,
893,
440,
9148,
3528,
1404,
15513,
13,
198,
198,
2257,
7227,
12,
19238,
12,
46506,
2849,
13,
198,
220,
19878,
21389,
1057,
13,
198,
198,
21389,
1057,
13,
628,
220,
42865,
25,
300,
83,
62,
6404,
220,
220,
220,
220,
220,
220,
220,
41876,
256,
76,
301,
79,
11794,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
27830,
220,
220,
220,
220,
41876,
256,
907,
76,
10414,
12,
3438,
7402,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
9688,
62,
4475,
41876,
288,
1381,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
9688,
62,
2435,
41876,
4628,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
437,
62,
4475,
220,
220,
41876,
288,
1381,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
437,
62,
2435,
220,
220,
41876,
4628,
82,
13,
628,
198,
220,
300,
85,
62,
9688,
62,
4475,
796,
827,
12,
19608,
388,
532,
1802,
13,
198,
220,
300,
85,
62,
9688,
62,
2435,
796,
827,
12,
84,
2736,
270,
13,
198,
220,
300,
85,
62,
437,
62,
4475,
796,
827,
12,
19608,
388,
13,
198,
220,
300,
85,
62,
437,
62,
2435,
796,
827,
12,
84,
2736,
270,
13,
628,
220,
42815,
29397,
4177,
2849,
705,
51,
5653,
62,
22495,
38,
62,
18851,
62,
29701,
1847,
62,
39170,
29833,
62,
20608,
6,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
819,
62,
27830,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
27830,
198,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
256,
907,
62,
271,
62,
1662,
62,
11250,
1522,
796,
352,
198,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
362,
13,
198,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
29377,
10206,
12,
16402,
12394,
13,
198,
220,
23578,
5064,
13,
628,
220,
42815,
29397,
4177,
2849,
705,
51,
5653,
62,
15972,
62,
18851,
62,
39,
42480,
6,
198,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
21628,
62,
10057,
220,
220,
220,
220,
796,
279,
62,
17597,
198,
220,
220,
220,
220,
220,
21628,
62,
27830,
220,
220,
220,
220,
796,
300,
85,
62,
27830,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
2123,
62,
17209,
301,
79,
11794,
220,
796,
300,
83,
62,
6404,
198,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
269,
85,
62,
9688,
62,
4475,
796,
300,
85,
62,
9688,
62,
4475,
198,
220,
220,
220,
220,
220,
269,
85,
62,
9688,
62,
2435,
796,
300,
85,
62,
9688,
62,
2435,
198,
220,
220,
220,
220,
220,
269,
85,
62,
437,
62,
4475,
220,
220,
796,
300,
85,
62,
437,
62,
4475,
198,
220,
220,
220,
220,
220,
269,
85,
62,
437,
62,
2435,
220,
220,
796,
300,
85,
62,
437,
62,
2435,
198,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
7995,
220,
220,
220,
220,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
796,
362,
13,
198,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
29377,
10206,
12,
16402,
12394,
13,
198,
220,
23578,
5064,
13,
628,
220,
311,
9863,
300,
83,
62,
6404,
11050,
491,
2435,
25400,
10619,
2751,
13,
198,
220,
17579,
3185,
5161,
300,
83,
62,
6404,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
7278,
62,
6404,
43734,
33411,
1005,
8189,
796,
705,
830,
23,
4458,
198,
220,
220,
220,
537,
62,
33723,
62,
521,
26407,
14804,
33723,
62,
521,
5344,
7,
198,
220,
220,
220,
220,
220,
1312,
62,
5239,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
1279,
7278,
62,
6404,
29,
12,
2213,
74,
38890,
198,
220,
220,
220,
220,
220,
1312,
62,
14681,
276,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
827,
12,
8658,
844,
198,
220,
220,
220,
220,
220,
1312,
62,
23350,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
3951,
7,
300,
83,
62,
6404,
1267,
198,
220,
220,
220,
220,
220,
1312,
62,
22915,
62,
320,
23802,
796,
450,
499,
62,
7942,
6739,
628,
220,
220,
220,
44423,
25,
1220,
1279,
7278,
62,
6404,
29,
12,
2213,
2435,
11,
1279,
7278,
62,
6404,
29,
12,
2213,
74,
38890,
13,
198,
220,
220,
220,
19878,
21389,
1100,
62,
6404,
1294,
2751,
1279,
7278,
62,
6404,
29,
12,
2213,
74,
38890,
13,
198,
220,
23578,
21982,
3185,
13,
198,
198,
1677,
8068,
1581,
44,
13,
198,
198,
21389,
1100,
62,
6404,
1294,
2751,
279,
85,
62,
2213,
74,
38890,
41876,
491,
74,
38890,
13,
628,
220,
42865,
25,
300,
83,
62,
6404,
41876,
491,
6404,
82,
13,
628,
220,
42815,
29397,
4177,
2849,
705,
51,
5653,
62,
54,
8202,
62,
15675,
62,
25294,
6,
198,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
21628,
62,
17597,
3672,
220,
220,
220,
220,
220,
220,
220,
796,
279,
62,
17597,
198,
220,
220,
220,
220,
220,
21628,
62,
529,
4906,
220,
220,
220,
220,
220,
220,
220,
796,
705,
38,
6,
198,
220,
220,
220,
220,
220,
21628,
62,
2213,
74,
38890,
220,
220,
220,
220,
220,
220,
220,
220,
796,
279,
85,
62,
2213,
74,
38890,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
2123,
62,
6404,
8658,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
83,
62,
6404,
198,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
12515,
62,
15414,
220,
220,
220,
220,
796,
352,
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,
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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
] |
CLASS cl_apl_ecatt_script_download DEFINITION PUBLIC INHERITING FROM cl_apl_ecatt_download CREATE PUBLIC ABSTRACT.
PUBLIC SECTION.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS cl_apl_ecatt_script_download IMPLEMENTATION.
ENDCLASS.
| [
31631,
537,
62,
64,
489,
62,
721,
1078,
62,
12048,
62,
15002,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
537,
62,
64,
489,
62,
721,
1078,
62,
15002,
29244,
6158,
44731,
9564,
18601,
10659,
13,
628,
220,
44731,
44513,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
537,
62,
64,
489,
62,
721,
1078,
62,
12048,
62,
15002,
30023,
2538,
10979,
6234,
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
] |
CLASS y_exemption_of_class DEFINITION PUBLIC CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES y_if_exemption_of_object.
ALIASES is_exempted FOR y_if_exemption_of_object~is_exempted.
PRIVATE SECTION.
CLASS-DATA class_header_data TYPE seoclassdf.
CLASS-METHODS is_srv_maint_ui_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_odata_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_ecatt_odata_test_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_fin_infotype_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_amdp_class RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_extensibility_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_shma_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_proxy_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_sadl_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_exit_class RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_exception_class RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_xlca_generate RETURNING VALUE(result) TYPE abap_bool.
CLASS-METHODS is_bcp_application RETURNING VALUE(result) TYPE abap_bool.
ENDCLASS.
CLASS y_exemption_of_class IMPLEMENTATION.
METHOD y_if_exemption_of_object~is_exempted.
result = abap_true.
SELECT SINGLE *
FROM seoclassdf
INTO @class_header_data
WHERE clsname = @object_name
AND version = 1.
IF sy-subrc = 0.
result = xsdbool( is_srv_maint_ui_generate( ) = abap_true OR
is_odata_generate( ) = abap_true OR
is_ecatt_odata_test_generate( ) = abap_true OR
is_fin_infotype_generate( ) = abap_true OR
is_extensibility_generate( ) = abap_true OR
is_shma_generate( ) = abap_true OR
is_proxy_generate( ) = abap_true OR
is_sadl_generate( ) = abap_true OR
is_exit_class( ) = abap_true OR
is_exception_class( ) = abap_true OR
is_bcp_application( ) = abap_true ).
ENDIF.
ENDMETHOD.
METHOD is_amdp_class.
DATA: lt_interfaces TYPE seor_implementing_keys.
DATA: lv_seoclskey TYPE seoclskey.
lv_seoclskey = class_header_data-clsname.
CALL FUNCTION 'SEO_CLASS_ALL_IMPLEMENTG_GET'
EXPORTING
clskey = lv_seoclskey
IMPORTING
set = lt_interfaces
EXCEPTIONS
not_existing = 1
is_interface = 2
model_only = 3
OTHERS = 4.
IF sy-subrc <> 0.
RETURN.
ENDIF.
LOOP AT lt_interfaces TRANSPORTING NO FIELDS
WHERE refclsname = 'IF_AMDP_MARKER_HDB'.
result = abap_true.
RETURN.
ENDLOOP.
ENDMETHOD.
METHOD is_bcp_application.
DATA it_bsp_classes TYPE STANDARD TABLE OF seoclsname.
it_bsp_classes = VALUE #( ( 'CL_BSP_WD_COMPONENT_CONTROLLER' )
( 'CL_BSP_WD_CONTEXT' )
( 'CL_BSP_WD_CONTEXT_NODE' )
( 'CL_BSP_WD_WINDOW' )
( 'CL_BSP_WD_CUSTOM_CONTROLLER' )
( 'CL_BSP_WD_VIEW_CONTROLLER' )
( 'CL_BSP_WD_ADVSEARCH_CONTROLLER' )
( 'CL_BSP_WD_CONTEXT_NODE_ASP' ) ).
SELECT SINGLE refclsname FROM seometarel
WHERE clsname = @class_header_data-clsname AND refclsname IS NOT NULL
INTO @DATA(inherited_by).
IF sy-subrc NE 0.
RETURN.
ENDIF.
"Multi Inheritance
DO.
LOOP AT it_bsp_classes TRANSPORTING NO FIELDS WHERE table_line = inherited_by.
result = abap_true.
RETURN.
ENDLOOP.
SELECT SINGLE refclsname FROM seometarel
WHERE clsname = @inherited_by AND refclsname IS NOT NULL
INTO @inherited_by.
IF sy-subrc = 4.
RETURN.
ENDIF.
ENDDO.
ENDMETHOD.
METHOD is_ecatt_odata_test_generate.
SELECT SINGLE s~clsname FROM seoclassdf AS s INTO @DATA(lv_odata_class)
WHERE clsname = @class_header_data-clsname AND s~author = 'eCATTClassGe'.
IF sy-subrc = 0.
result = abap_true.
ENDIF.
ENDMETHOD.
METHOD is_exception_class.
CONSTANTS exception_clase_type LIKE class_header_data-category VALUE '40'.
IF class_header_data-category = exception_clase_type.
result = abap_true.
ENDIF.
ENDMETHOD.
METHOD is_exit_class.
CONSTANTS exit_class_type LIKE class_header_data-category VALUE '01'.
IF class_header_data-category = exit_class_type.
result = abap_true.
ENDIF.
ENDMETHOD.
METHOD is_extensibility_generate.
DATA: lt_interfaces TYPE seor_implementing_keys.
DATA: lv_seoclskey TYPE seoclskey.
lv_seoclskey = class_header_data-clsname.
CALL FUNCTION 'SEO_CLASS_ALL_IMPLEMENTG_GET'
EXPORTING
clskey = lv_seoclskey
IMPORTING
set = lt_interfaces
EXCEPTIONS
not_existing = 1
is_interface = 2
model_only = 3
OTHERS = 4.
IF sy-subrc <> 0.
RETURN.
ENDIF.
LOOP AT lt_interfaces TRANSPORTING NO FIELDS
WHERE refclsname = 'IF_CFD_ODATA_MPC_FLX' OR refclsname = 'IF_CFD_ODATA_DPC_FLX'.
result = abap_true.
RETURN.
ENDLOOP.
ENDMETHOD.
METHOD is_fin_infotype_generate.
SELECT SINGLE idclass FROM t777ditclass INTO @DATA(lv_inftype_cl) WHERE idclass = @class_header_data-clsname.
IF sy-subrc = 0.
result = abap_true.
RETURN.
ENDIF.
SELECT SINGLE cont_db FROM t777ditclass INTO @DATA(lv_inftype1_cl) WHERE cont_db = @class_header_data-clsname.
IF sy-subrc = 0.
result = abap_true.
RETURN.
ENDIF.
SELECT SINGLE bl_class FROM t777ditclass INTO @DATA(lv_inftype2_cl) WHERE bl_class = @class_header_data-clsname.
IF sy-subrc = 0.
result = abap_true.
RETURN.
ENDIF.
ENDMETHOD.
METHOD is_odata_generate.
SELECT SINGLE trobj_name FROM /iwbep/i_sbd_ga INTO @DATA(l_name)
WHERE ( gen_art_type = 'DPCB' OR gen_art_type = 'MPCB' ) AND trobj_type = 'CLAS' AND trobj_name = @class_header_data-clsname. "#EC CI_NOFIELD
IF sy-subrc = 0.
result = abap_true.
ENDIF.
ENDMETHOD.
METHOD is_proxy_generate.
result = xsdbool( class_header_data-clsproxy = abap_true ).
ENDMETHOD.
METHOD is_sadl_generate.
SELECT SINGLE langu FROM seoclasstx INTO @DATA(l_category)
WHERE clsname = @class_header_data-clsname AND descript = 'Generated by SADL Generation Toolkit' ##NO_TEXT.
IF sy-subrc = 0.
result = abap_true.
ENDIF.
ENDMETHOD.
METHOD is_shma_generate.
SELECT SINGLE obj_name FROM tadir INTO @DATA(shma_clas)
WHERE pgmid = 'R3TR' AND object = 'SHMA' AND obj_name = @class_header_data-clsname.
IF sy-subrc = 0.
result = abap_true.
ENDIF.
ENDMETHOD.
METHOD is_srv_maint_ui_generate.
DATA: lt_interfaces TYPE seor_implementing_keys.
DATA: lv_seoclskey TYPE seoclskey.
lv_seoclskey = class_header_data-clsname.
CALL FUNCTION 'SEO_CLASS_ALL_IMPLEMENTG_GET'
EXPORTING
clskey = lv_seoclskey
IMPORTING
set = lt_interfaces
EXCEPTIONS
not_existing = 1
is_interface = 2
model_only = 3
OTHERS = 4.
IF sy-subrc <> 0.
RETURN.
ENDIF.
LOOP AT lt_interfaces TRANSPORTING NO FIELDS
WHERE refclsname = '/FTI/IF_FTI_MODEL' OR refclsname = '/FTI/IF_NATIVE_SQL_GENERATOR'.
result = abap_true.
RETURN.
ENDLOOP.
ENDMETHOD.
METHOD is_xlca_generate.
DATA: lt_interfaces TYPE seor_implementing_keys.
DATA: lv_seoclskey TYPE seoclskey.
lv_seoclskey = class_header_data-clsname.
CALL FUNCTION 'SEO_CLASS_ALL_IMPLEMENTG_GET'
EXPORTING
clskey = lv_seoclskey
IMPORTING
set = lt_interfaces
EXCEPTIONS
not_existing = 1
is_interface = 2
model_only = 3
OTHERS = 4.
IF sy-subrc <> 0.
RETURN.
ENDIF.
LOOP AT lt_interfaces TRANSPORTING NO FIELDS
WHERE refclsname = 'IF_CTS_TABLE_CONVERSION'.
result = abap_true.
RETURN.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
62,
1069,
11221,
62,
1659,
62,
4871,
5550,
20032,
17941,
44731,
29244,
6158,
44731,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
331,
62,
361,
62,
1069,
11221,
62,
1659,
62,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
318,
62,
42679,
276,
7473,
331,
62,
361,
62,
1069,
11221,
62,
1659,
62,
15252,
93,
271,
62,
42679,
276,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42715,
12,
26947,
1398,
62,
25677,
62,
7890,
41876,
384,
420,
31172,
7568,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
318,
62,
27891,
85,
62,
76,
2913,
62,
9019,
62,
8612,
378,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
318,
62,
375,
1045,
62,
8612,
378,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
318,
62,
721,
1078,
62,
375,
1045,
62,
9288,
62,
8612,
378,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
318,
62,
15643,
62,
10745,
8690,
62,
8612,
378,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
318,
62,
321,
26059,
62,
4871,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
318,
62,
2302,
641,
2247,
62,
8612,
378,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
318,
62,
1477,
2611,
62,
8612,
378,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
318,
62,
36436,
62,
8612,
378,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
318,
62,
82,
324,
75,
62,
8612,
378,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
318,
62,
37023,
62,
4871,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
318,
62,
1069,
4516,
62,
4871,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
318,
62,
87,
75,
6888,
62,
8612,
378,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
318,
62,
65,
13155,
62,
31438,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
331,
62,
1069,
11221,
62,
1659,
62,
4871,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
331,
62,
361,
62,
1069,
11221,
62,
1659,
62,
15252,
93,
271,
62,
42679,
276,
13,
198,
220,
220,
220,
1255,
796,
450,
499,
62,
7942,
13,
628,
220,
220,
220,
33493,
311,
2751,
2538,
1635,
198,
220,
220,
220,
16034,
384,
420,
31172,
7568,
198,
220,
220,
220,
39319,
2488,
4871,
62,
25677,
62,
7890,
198,
220,
220,
220,
33411,
537,
82,
3672,
796,
2488,
15252,
62,
3672,
198,
220,
220,
220,
5357,
2196,
796,
352,
13,
628,
220,
220,
220,
16876,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
1255,
796,
2124,
82,
9945,
970,
7,
318,
62,
27891,
85,
62,
76,
2913,
62,
9019,
62,
8612,
378,
7,
1267,
796,
450,
499,
62,
7942,
6375,
198,
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,
375,
1045,
62,
8612,
378,
7,
1267,
796,
450,
499,
62,
7942,
6375,
198,
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,
721,
1078,
62,
375,
1045,
62,
9288,
62,
8612,
378,
7,
1267,
796,
450,
499,
62,
7942,
6375,
198,
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,
15643,
62,
10745,
8690,
62,
8612,
378,
7,
220,
1267,
796,
450,
499,
62,
7942,
6375,
198,
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,
2302,
641,
2247,
62,
8612,
378,
7,
220,
1267,
796,
450,
499,
62,
7942,
6375,
198,
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,
1477,
2611,
62,
8612,
378,
7,
220,
1267,
796,
450,
499,
62,
7942,
6375,
198,
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,
36436,
62,
8612,
378,
7,
220,
1267,
796,
450,
499,
62,
7942,
6375,
198,
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,
82,
324,
75,
62,
8612,
378,
7,
220,
1267,
796,
450,
499,
62,
7942,
6375,
198,
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,
37023,
62,
4871,
7,
220,
1267,
796,
450,
499,
62,
7942,
6375,
198,
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,
1069,
4516,
62,
4871,
7,
220,
1267,
796,
450,
499,
62,
7942,
6375,
198,
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,
65,
13155,
62,
31438,
7,
1267
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 zcl_abapgit_repo_content_list DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor
IMPORTING io_repo TYPE REF TO zcl_abapgit_repo.
METHODS list
IMPORTING iv_path TYPE string
iv_by_folders TYPE abap_bool
iv_changes_only TYPE abap_bool
RETURNING VALUE(rt_repo_items) TYPE zif_abapgit_definitions=>tt_repo_items
RAISING zcx_abapgit_exception.
METHODS get_log
RETURNING VALUE(ri_log) TYPE REF TO zif_abapgit_log.
PROTECTED SECTION.
PRIVATE SECTION.
CONSTANTS: BEGIN OF c_sortkey,
default TYPE i VALUE 9999,
parent_dir TYPE i VALUE 0,
dir TYPE i VALUE 1,
orphan TYPE i VALUE 2,
changed TYPE i VALUE 3,
inactive TYPE i VALUE 4,
END OF c_sortkey.
DATA: mo_repo TYPE REF TO zcl_abapgit_repo,
mi_log TYPE REF TO zif_abapgit_log.
METHODS build_repo_items_local_only
RETURNING VALUE(rt_repo_items) TYPE zif_abapgit_definitions=>tt_repo_items
RAISING zcx_abapgit_exception.
METHODS build_repo_items_with_remote
RETURNING VALUE(rt_repo_items) TYPE zif_abapgit_definitions=>tt_repo_items
RAISING zcx_abapgit_exception.
METHODS build_folders
IMPORTING iv_cur_dir TYPE string
CHANGING ct_repo_items TYPE zif_abapgit_definitions=>tt_repo_items
RAISING zcx_abapgit_exception.
METHODS filter_changes
CHANGING ct_repo_items TYPE zif_abapgit_definitions=>tt_repo_items.
ENDCLASS.
CLASS ZCL_ABAPGIT_REPO_CONTENT_LIST IMPLEMENTATION.
METHOD build_folders.
DATA: lv_index TYPE i,
lt_subitems LIKE ct_repo_items,
ls_subitem LIKE LINE OF ct_repo_items,
ls_folder LIKE LINE OF ct_repo_items.
FIELD-SYMBOLS <ls_item> LIKE LINE OF ct_repo_items.
LOOP AT ct_repo_items ASSIGNING <ls_item>.
lv_index = sy-tabix.
CHECK <ls_item>-path <> iv_cur_dir. " files in target dir - just leave them be
IF zcl_abapgit_path=>is_subdir( iv_path = <ls_item>-path iv_parent = iv_cur_dir ) = abap_true.
ls_subitem-changes = <ls_item>-changes.
ls_subitem-path = <ls_item>-path.
ls_subitem-lstate = <ls_item>-lstate.
ls_subitem-rstate = <ls_item>-rstate.
APPEND ls_subitem TO lt_subitems.
ENDIF.
DELETE ct_repo_items INDEX lv_index.
ENDLOOP.
SORT lt_subitems BY path ASCENDING.
LOOP AT lt_subitems ASSIGNING <ls_item>.
AT NEW path.
CLEAR ls_folder.
ls_folder-path = <ls_item>-path.
ls_folder-sortkey = c_sortkey-dir. " Directory
ls_folder-is_dir = abap_true.
ENDAT.
ls_folder-changes = ls_folder-changes + <ls_item>-changes.
zcl_abapgit_state=>reduce( EXPORTING iv_cur = <ls_item>-lstate
CHANGING cv_prev = ls_folder-lstate ).
zcl_abapgit_state=>reduce( EXPORTING iv_cur = <ls_item>-rstate
CHANGING cv_prev = ls_folder-rstate ).
AT END OF path.
APPEND ls_folder TO ct_repo_items.
ENDAT.
ENDLOOP.
ENDMETHOD.
METHOD build_repo_items_local_only.
DATA: lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt,
ls_item TYPE zif_abapgit_definitions=>ty_item.
FIELD-SYMBOLS: <ls_repo_item> LIKE LINE OF rt_repo_items,
<ls_tadir> LIKE LINE OF lt_tadir.
lt_tadir = zcl_abapgit_factory=>get_tadir( )->read(
iv_package = mo_repo->get_package( )
io_dot = mo_repo->get_dot_abapgit( ) ).
LOOP AT lt_tadir ASSIGNING <ls_tadir>.
APPEND INITIAL LINE TO rt_repo_items ASSIGNING <ls_repo_item>.
<ls_repo_item>-obj_type = <ls_tadir>-object.
<ls_repo_item>-obj_name = <ls_tadir>-obj_name.
<ls_repo_item>-path = <ls_tadir>-path.
MOVE-CORRESPONDING <ls_repo_item> TO ls_item.
<ls_repo_item>-inactive = boolc( zcl_abapgit_objects=>is_active( ls_item ) = abap_false ).
IF <ls_repo_item>-inactive = abap_true.
<ls_repo_item>-sortkey = c_sortkey-inactive.
ELSE.
<ls_repo_item>-sortkey = c_sortkey-default. " Default sort key
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD build_repo_items_with_remote.
DATA:
ls_file TYPE zif_abapgit_definitions=>ty_repo_file,
lt_status TYPE zif_abapgit_definitions=>ty_results_tt.
FIELD-SYMBOLS: <ls_status> LIKE LINE OF lt_status,
<ls_repo_item> LIKE LINE OF rt_repo_items.
lt_status = mo_repo->status( mi_log ).
LOOP AT lt_status ASSIGNING <ls_status>.
AT NEW obj_name. "obj_type + obj_name
APPEND INITIAL LINE TO rt_repo_items ASSIGNING <ls_repo_item>.
<ls_repo_item>-obj_type = <ls_status>-obj_type.
<ls_repo_item>-obj_name = <ls_status>-obj_name.
<ls_repo_item>-inactive = <ls_status>-inactive.
<ls_repo_item>-sortkey = c_sortkey-default. " Default sort key
<ls_repo_item>-changes = 0.
<ls_repo_item>-path = <ls_status>-path.
ENDAT.
IF <ls_status>-filename IS NOT INITIAL.
ls_file-path = <ls_status>-path.
ls_file-filename = <ls_status>-filename.
ls_file-is_changed = boolc( <ls_status>-match = abap_false ). " TODO refactor
ls_file-rstate = <ls_status>-rstate.
ls_file-lstate = <ls_status>-lstate.
APPEND ls_file TO <ls_repo_item>-files.
IF <ls_status>-inactive = abap_true
AND <ls_repo_item>-sortkey > c_sortkey-changed.
<ls_repo_item>-sortkey = c_sortkey-inactive.
ENDIF.
IF ls_file-is_changed = abap_true.
<ls_repo_item>-sortkey = c_sortkey-changed. " Changed files
<ls_repo_item>-changes = <ls_repo_item>-changes + 1.
zcl_abapgit_state=>reduce( EXPORTING iv_cur = ls_file-lstate
CHANGING cv_prev = <ls_repo_item>-lstate ).
zcl_abapgit_state=>reduce( EXPORTING iv_cur = ls_file-rstate
CHANGING cv_prev = <ls_repo_item>-rstate ).
ENDIF.
ENDIF.
AT END OF obj_name. "obj_type + obj_name
IF <ls_repo_item>-obj_type IS INITIAL.
<ls_repo_item>-sortkey = c_sortkey-orphan. "Virtual objects
ENDIF.
ENDAT.
ENDLOOP.
ENDMETHOD.
METHOD constructor.
mo_repo = io_repo.
CREATE OBJECT mi_log TYPE zcl_abapgit_log.
ENDMETHOD.
METHOD filter_changes.
FIELD-SYMBOLS: <ls_item> TYPE zif_abapgit_definitions=>ty_repo_item.
DELETE ct_repo_items WHERE changes = 0.
LOOP AT ct_repo_items ASSIGNING <ls_item>.
DELETE <ls_item>-files WHERE is_changed = abap_false.
ENDLOOP.
ENDMETHOD.
METHOD get_log.
DATA li_repo_log TYPE REF TO zif_abapgit_log.
DATA lt_repo_msg TYPE zif_abapgit_log=>tty_log_out.
DATA lr_repo_msg TYPE REF TO zif_abapgit_log=>ty_log_out.
ri_log = mi_log.
"add warning and error messages from repo log
li_repo_log = mo_repo->get_log( ).
IF li_repo_log IS BOUND.
lt_repo_msg = li_repo_log->get_messages( ).
LOOP AT lt_repo_msg REFERENCE INTO lr_repo_msg WHERE type CA 'EW'.
CASE lr_repo_msg->type.
WHEN 'E'.
ri_log->add_error( iv_msg = lr_repo_msg->text ).
WHEN 'W'.
ri_log->add_warning( iv_msg = lr_repo_msg->text ).
WHEN OTHERS.
CONTINUE.
ENDCASE.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD list.
mi_log->clear( ).
IF mo_repo->has_remote_source( ) = abap_true.
rt_repo_items = build_repo_items_with_remote( ).
ELSE.
rt_repo_items = build_repo_items_local_only( ).
ENDIF.
IF iv_by_folders = abap_true.
build_folders(
EXPORTING iv_cur_dir = iv_path
CHANGING ct_repo_items = rt_repo_items ).
ENDIF.
IF iv_changes_only = abap_true.
" There are never changes for offline repositories
filter_changes( CHANGING ct_repo_items = rt_repo_items ).
ENDIF.
SORT rt_repo_items BY
sortkey ASCENDING
path ASCENDING
obj_name ASCENDING.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
11299,
62,
4868,
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,
33245,
62,
260,
7501,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
13,
628,
220,
220,
220,
337,
36252,
50,
1351,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
6978,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
1525,
62,
11379,
364,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
36653,
62,
8807,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
260,
7501,
62,
23814,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
926,
62,
260,
7501,
62,
23814,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
6404,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
380,
62,
6404,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
347,
43312,
3963,
269,
62,
30619,
2539,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4277,
220,
220,
220,
41876,
1312,
26173,
8924,
860,
17032,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2560,
62,
15908,
41876,
1312,
26173,
8924,
657,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26672,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
26173,
8924,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26051,
220,
220,
220,
220,
41876,
1312,
26173,
8924,
362,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3421,
220,
220,
220,
41876,
1312,
26173,
8924,
513,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28621,
220,
220,
41876,
1312,
26173,
8924,
604,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
30619,
2539,
13,
628,
220,
220,
220,
42865,
25,
6941,
62,
260,
7501,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21504,
62,
6404,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
13,
628,
220,
220,
220,
337,
36252,
50,
1382,
62,
260,
7501,
62,
23814,
62,
12001,
62,
8807,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
260,
7501,
62,
23814,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
926,
62,
260,
7501,
62,
23814,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
337,
36252,
50,
1382,
62,
260,
7501,
62,
23814,
62,
4480,
62,
47960,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
260,
7501,
62,
23814,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
926,
62,
260,
7501,
62,
23814,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
337,
36252,
50,
1382,
62,
11379,
364,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
22019,
62,
15908,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
220,
269,
83,
62,
260,
7501,
62,
23814,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
926,
62,
260,
7501,
62,
23814,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
337,
36252,
50,
8106,
62,
36653,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
269,
83,
62,
260,
7501,
62,
23814,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
926,
62,
260,
7501,
62,
23814,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
2200,
16402,
62,
37815,
3525,
62,
45849,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1382,
62,
11379,
364,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
9630,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
7266,
23814,
34178,
269,
83,
62,
260,
7501,
62,
23814,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
7266,
9186,
220,
34178,
48920,
3963,
269,
83,
62,
260,
7501,
62,
23814,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
43551,
220,
220,
34178,
48920,
3963,
269,
83,
62,
260,
7501,
62,
23814,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
1279,
7278,
62,
9186,
29,
34178,
48920,
3963,
269,
83,
62,
260,
7501,
62,
23814,
13,
628,
198,
220,
220,
220,
17579,
3185,
5161,
269,
83,
62,
260,
7501,
62,
23814,
24994,
3528,
15871,
1279,
7278,
62,
9186,
28401,
198,
220,
220,
220,
220,
220,
300,
85,
62,
9630,
796,
827,
12,
8658,
844,
13,
198,
220,
220,
220,
220,
220,
5870,
25171,
1279,
7278,
62,
9186
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_object_auth DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
METHODS constructor
IMPORTING
is_item TYPE zif_abapgit_definitions=>ty_item
iv_language TYPE spras.
PRIVATE SECTION.
DATA: mv_fieldname TYPE authx-fieldname.
ENDCLASS.
CLASS zcl_abapgit_object_auth IMPLEMENTATION.
METHOD constructor.
super->constructor( is_item = is_item
iv_language = iv_language ).
mv_fieldname = ms_item-obj_name.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
* looks like "changed by user" is not stored in the database
rv_user = c_user_unknown.
ENDMETHOD.
METHOD zif_abapgit_object~compare_to_remote_version.
CREATE OBJECT ro_comparison_result TYPE zcl_abapgit_comparison_null.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
" there is a bug in SAP standard, the TADIR entries are not deleted
" when the AUTH object is deleted in transaction SU20
" FM SUSR_AUTF_DELETE_FIELD calls the UI, therefore we reimplement its logic
DATA:
lt_objlst TYPE susr_t_xuobject,
lo_auth TYPE REF TO cl_auth_tools,
lv_dummy TYPE string.
" authority check
CREATE OBJECT lo_auth.
IF lo_auth->authority_check_suso( actvt = '06'
fieldname = mv_fieldname ) <> 0.
MESSAGE e463(01) WITH mv_fieldname INTO lv_dummy.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
" if field is used check
lt_objlst = lo_auth->suso_where_used_afield( mv_fieldname ).
IF lt_objlst IS NOT INITIAL.
MESSAGE i453(01) WITH mv_fieldname INTO lv_dummy.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
" collect fieldname into a transport task
IF lo_auth->add_afield_to_trkorr( mv_fieldname ) <> 0.
"no transport -> no deletion
MESSAGE e507(0m) INTO lv_dummy.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
DELETE FROM authx WHERE fieldname = mv_fieldname.
IF sy-subrc <> 0.
MESSAGE e507(0m) INTO lv_dummy.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
* see include LSAUT_FIELDF02
DATA: ls_authx TYPE authx,
lo_auth TYPE REF TO cl_auth_tools.
io_xml->read( EXPORTING iv_name = 'AUTHX'
CHANGING cg_data = ls_authx ).
tadir_insert( iv_package ).
CREATE OBJECT lo_auth.
IF lo_auth->add_afield_to_trkorr( ls_authx-fieldname ) <> 0.
zcx_abapgit_exception=>raise( 'Error deserializing AUTH' ).
ENDIF.
MODIFY authx FROM ls_authx.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error deserializing AUTH' ).
ENDIF.
CALL FUNCTION 'DB_COMMIT'.
lo_auth->set_authfld_info_from_db( ls_authx-fieldname ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
SELECT SINGLE fieldname FROM authx
INTO mv_fieldname
WHERE fieldname = ms_item-obj_name. "#EC CI_GENBUFF
rv_bool = boolc( sy-subrc = 0 ).
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.
* TODO, this function module does not exist in 702
CALL FUNCTION 'SU20_MAINTAIN_SNGL'
EXPORTING
id_field = mv_fieldname
id_wbo_mode = abap_false.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: ls_authx TYPE authx.
SELECT SINGLE * FROM authx INTO ls_authx
WHERE fieldname = ms_item-obj_name. "#EC CI_GENBUFF
IF sy-subrc <> 0.
RETURN.
ENDIF.
io_xml->add( iv_name = 'AUTHX'
ig_data = ls_authx ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
18439,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
13,
198,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
318,
62,
9186,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16129,
41876,
7500,
292,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
285,
85,
62,
3245,
3672,
41876,
6284,
87,
12,
3245,
3672,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
18439,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
2208,
3784,
41571,
273,
7,
318,
62,
9186,
220,
220,
220,
220,
796,
318,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16129,
796,
21628,
62,
16129,
6739,
628,
220,
220,
220,
285,
85,
62,
3245,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
40985,
62,
1525,
13,
198,
9,
3073,
588,
366,
40985,
416,
2836,
1,
318,
407,
8574,
287,
262,
6831,
198,
220,
220,
220,
374,
85,
62,
7220,
796,
269,
62,
7220,
62,
34680,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5589,
533,
62,
1462,
62,
47960,
62,
9641,
13,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
686,
62,
785,
1845,
1653,
62,
20274,
41876,
1976,
565,
62,
397,
499,
18300,
62,
785,
1845,
1653,
62,
8423,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
33678,
13,
628,
220,
220,
220,
366,
612,
318,
257,
5434,
287,
48323,
3210,
11,
262,
309,
2885,
4663,
12784,
389,
407,
13140,
198,
220,
220,
220,
366,
618,
262,
37195,
2134,
318,
13140,
287,
8611,
13558,
1238,
628,
220,
220,
220,
366,
18695,
311,
2937,
49,
62,
39371,
37,
62,
7206,
2538,
9328,
62,
44603,
3848,
262,
12454,
11,
4361,
356,
21123,
26908,
663,
9156,
628,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
300,
83,
62,
672,
20362,
301,
41876,
2341,
81,
62,
83,
62,
87,
84,
15252,
11,
198,
220,
220,
220,
220,
220,
2376,
62,
18439,
220,
220,
41876,
4526,
37,
5390,
537,
62,
18439,
62,
31391,
11,
198,
220,
220,
220,
220,
220,
300,
85,
62,
67,
13513,
220,
41876,
4731,
13,
628,
220,
220,
220,
366,
4934,
2198,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
2376,
62,
18439,
13,
198,
220,
220,
220,
16876,
2376,
62,
18439,
3784,
9800,
414,
62,
9122,
62,
82,
385,
78,
7,
719,
36540,
220,
220,
220,
220,
796,
705,
3312,
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,
2214,
3672,
796,
285,
85,
62,
3245,
3672,
1267,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
337,
1546,
4090,
8264,
304,
38380,
7,
486,
8,
13315,
285,
85,
62,
3245,
3672,
39319,
300,
85,
62,
67,
13513,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
62,
83,
3064,
7,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
366,
611,
2214,
318,
973,
2198,
198,
220,
220,
220,
300,
83,
62,
672,
20362,
301,
796,
2376,
62,
18439,
3784,
82,
385,
78,
62,
3003,
62,
1484,
62,
1878,
1164,
7,
285,
85,
62,
3245,
3672,
6739,
198,
220,
220,
220,
16876,
300,
83,
62,
672,
20362,
301,
3180,
5626,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
337,
1546,
4090,
8264,
1312,
36625,
7,
486,
8,
13315,
285,
85,
62,
3245,
3672,
39319,
300,
85,
62,
67,
13513,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
62,
83,
3064,
7,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
366,
2824,
2214,
3672,
656,
257,
4839,
4876,
198,
220,
220,
220,
16876,
2376,
62,
18439,
3784,
2860,
62,
1878,
1164,
62,
1462,
62,
2213,
74,
38890,
7,
285,
85,
62,
3245,
3672,
1267,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
366,
3919,
4839,
4613,
645,
39948,
198,
220,
220,
220,
220,
220,
337,
1546,
4090,
8264,
304,
35378,
7,
15,
76,
8,
39319,
300,
85,
62,
67,
13513,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
62,
83,
3064,
7,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
5550,
2538,
9328,
16034,
6284,
87,
33411,
2214,
3672,
796,
285,
85,
62,
3245,
3672,
13,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
337,
1546,
4090,
8264,
304,
35378,
7,
15,
76,
8,
39319,
300,
85,
62,
67,
13513,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
62,
83,
3064,
7,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,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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_W3MIME_POLLER definition
public
final
create public .
public section.
types:
begin of ty_target,
directory type string,
filter type string,
end of ty_target .
types:
tt_target type standard table of ty_target with default key .
types:
begin of ty_file_state,
path type string,
isdir type abap_bool, " for future use
timestamp type char14,
end of ty_file_state .
types:
tt_file_state type standard table of ty_file_state with key path .
events CHANGED
exporting
value(CHANGED_LIST) type TT_FILE_STATE .
events ERROR
exporting
value(ERROR_TEXT) type STRING .
methods CONSTRUCTOR
importing
!IT_TARGETS type TT_TARGET
!IV_INTERVAL type I default 1 " 1 second
raising
ZCX_W3MIME_ERROR .
methods START
raising
ZCX_W3MIME_ERROR .
methods HANDLE_TIMER
for event FINISHED of CL_GUI_TIMER .
methods READ_CURRENT_STATE
returning
value(RT_STATE) type TT_FILE_STATE
raising
ZCX_W3MIME_ERROR .
methods UPDATE_STATE
returning
value(RT_CHANGES) type TT_FILE_STATE
raising
ZCX_W3MIME_ERROR .
class-methods DETECT_CHANGES
importing
!IT_PREV type TT_FILE_STATE
!IT_CUR type TT_FILE_STATE
returning
value(RT_CHANGES) type TT_FILE_STATE .
class-methods MERGE_CHANGES
importing
!IT_CHANGES type TT_FILE_STATE
changing
!CT_STATE type TT_FILE_STATE .
protected section.
private section.
data mt_targets type tt_target.
data mt_file_state type tt_file_state.
data mo_timer type ref to cl_gui_timer.
ENDCLASS.
CLASS ZCL_W3MIME_POLLER IMPLEMENTATION.
method constructor.
if lines( it_targets ) = 0.
zcx_w3mime_error=>raise( 'Specify poll targets' ). "#EC NOTEXT
endif.
data lv_sep type c.
cl_gui_frontend_services=>get_file_separator( changing file_separator = lv_sep ).
mt_targets = it_targets.
field-symbols: <t> like line of mt_targets.
loop at mt_targets assigning <t>.
if <t>-directory is initial.
zcx_w3mime_error=>raise( 'Target directory cannot be empty' ). "#EC NOTEXT
endif.
if substring( val = <t>-directory off = strlen( <t>-directory ) - 1 len = 1 ) <> lv_sep.
<t>-directory = <t>-directory && lv_sep.
endif.
if <t>-filter is initial.
<t>-filter = '*.*'.
endif.
endloop.
create object mo_timer.
set handler me->handle_timer for mo_timer.
mo_timer->interval = iv_interval.
endmethod. " constructor.
method detect_changes.
" TODO detect deletions ! file in prev but not in cur
field-symbols <c> like line of it_cur.
field-symbols <p> like line of it_cur.
" assuming both inputs are sorted
loop at it_cur assigning <c>.
read table it_prev assigning <p> with key path = <c>-path binary search.
if sy-subrc is not initial or <c>-timestamp <> <p>-timestamp.
append <c> to rt_changes.
endif.
endloop.
endmethod. " detect_changes.
method handle_timer.
data:
lx type ref to zcx_w3mime_error,
lv_text type string,
lt_changes like mt_file_state.
try.
lt_changes = update_state( ).
catch zcx_w3mime_error into lx.
lv_text = lx->get_text( ).
raise event error exporting error_text = lv_text.
endtry.
if lines( lt_changes ) > 0.
raise event changed exporting changed_list = lt_changes.
endif.
mo_timer->run( ).
endmethod. "handle_timer
method merge_changes.
if lines( it_changes ) = 0.
return.
endif.
append lines of it_changes to ct_state.
sort ct_state by path ascending timestamp descending.
delete adjacent duplicates from ct_state comparing path.
endmethod. " merge_changes.
method read_current_state.
data lt_files type standard table of file_info.
field-symbols:
<state> like line of rt_state,
<t> like line of mt_targets.
loop at mt_targets assigning <t>.
lt_files = zcl_w3mime_fs=>read_dir(
iv_dir = <t>-directory
iv_filter = <t>-filter ).
field-symbols <file> like line of lt_files.
loop at lt_files assigning <file> where isdir is initial.
append initial line to rt_state assigning <state>.
<state>-path = <t>-directory && <file>-filename.
concatenate <file>-writedate <file>-writetime into <state>-timestamp. " Hmmm
* cl_abap_tstmp=>systemtstmp_syst2utc(
* exporting
* syst_date = <file>-writedate
* syst_time = <file>-writetime
* importing
* utc_tstmp = <state>-timestamp ).
endloop.
endloop.
sort rt_state by path.
endmethod. " read_current_state.
method start.
mt_file_state = read_current_state( ). " Sorted
mo_timer->run( ).
endmethod. "start.
method update_state.
data: lt_state like mt_file_state.
lt_state = read_current_state( ). " Sorted
rt_changes = detect_changes(
it_prev = mt_file_state
it_cur = lt_state ).
merge_changes(
exporting
it_changes = rt_changes
changing
ct_state = mt_file_state ).
endmethod. " update_state.
ENDCLASS.
| [
4871,
1168,
5097,
62,
54,
18,
44,
12789,
62,
16402,
3069,
1137,
6770,
198,
220,
1171,
198,
220,
2457,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
3858,
25,
198,
220,
220,
220,
2221,
286,
1259,
62,
16793,
11,
198,
220,
220,
220,
220,
220,
8619,
2099,
4731,
11,
198,
220,
220,
220,
220,
220,
8106,
220,
220,
220,
2099,
4731,
11,
198,
220,
220,
220,
886,
286,
1259,
62,
16793,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
256,
83,
62,
16793,
2099,
3210,
3084,
286,
1259,
62,
16793,
351,
4277,
1994,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
2221,
286,
1259,
62,
7753,
62,
5219,
11,
198,
220,
220,
220,
220,
220,
3108,
220,
220,
220,
220,
220,
2099,
4731,
11,
198,
220,
220,
220,
220,
220,
318,
15908,
220,
220,
220,
220,
2099,
450,
499,
62,
30388,
11,
366,
329,
2003,
779,
198,
220,
220,
220,
220,
220,
41033,
2099,
1149,
1415,
11,
198,
220,
220,
220,
886,
286,
1259,
62,
7753,
62,
5219,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
256,
83,
62,
7753,
62,
5219,
2099,
3210,
3084,
286,
1259,
62,
7753,
62,
5219,
351,
1994,
3108,
764,
628,
220,
2995,
5870,
15567,
1961,
198,
220,
220,
220,
39133,
198,
220,
220,
220,
220,
220,
1988,
7,
3398,
15567,
1961,
62,
45849,
8,
2099,
26653,
62,
25664,
62,
44724,
764,
198,
220,
2995,
33854,
198,
220,
220,
220,
39133,
198,
220,
220,
220,
220,
220,
1988,
7,
24908,
62,
32541,
8,
2099,
19269,
2751,
764,
628,
220,
5050,
7102,
46126,
1581,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
2043,
62,
51,
46095,
50,
2099,
26653,
62,
51,
46095,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
41358,
23428,
2099,
314,
4277,
352,
366,
352,
1218,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
1168,
34,
55,
62,
54,
18,
44,
12789,
62,
24908,
764,
198,
220,
5050,
33303,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
1168,
34,
55,
62,
54,
18,
44,
12789,
62,
24908,
764,
198,
220,
5050,
367,
6981,
2538,
62,
51,
3955,
1137,
198,
220,
220,
220,
329,
1785,
33642,
18422,
1961,
286,
7852,
62,
40156,
62,
51,
3955,
1137,
764,
198,
220,
5050,
20832,
62,
34,
39237,
62,
44724,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
14181,
62,
44724,
8,
2099,
26653,
62,
25664,
62,
44724,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
1168,
34,
55,
62,
54,
18,
44,
12789,
62,
24908,
764,
198,
220,
5050,
35717,
62,
44724,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
14181,
62,
3398,
15567,
1546,
8,
2099,
26653,
62,
25664,
62,
44724,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
1168,
34,
55,
62,
54,
18,
44,
12789,
62,
24908,
764,
198,
220,
1398,
12,
24396,
82,
38267,
9782,
62,
3398,
15567,
1546,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
2043,
62,
46437,
53,
2099,
26653,
62,
25664,
62,
44724,
198,
220,
220,
220,
220,
220,
5145,
2043,
62,
34,
4261,
2099,
26653,
62,
25664,
62,
44724,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
14181,
62,
3398,
15567,
1546,
8,
2099,
26653,
62,
25664,
62,
44724,
764,
198,
220,
1398,
12,
24396,
82,
34482,
8264,
62,
3398,
15567,
1546,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
2043,
62,
3398,
15567,
1546,
2099,
26653,
62,
25664,
62,
44724,
198,
220,
220,
220,
5609,
198,
220,
220,
220,
220,
220,
5145,
4177,
62,
44724,
2099,
26653,
62,
25664,
62,
44724,
764,
198,
24326,
2665,
13,
198,
19734,
2665,
13,
198,
220,
1366,
45079,
62,
83,
853,
1039,
220,
220,
220,
2099,
256,
83,
62,
16793,
13,
198,
220,
1366,
45079,
62,
7753,
62,
5219,
2099,
256,
83,
62,
7753,
62,
5219,
13,
198,
220,
1366,
6941,
62,
45016,
220,
220,
220,
220,
220,
2099,
1006,
284,
537,
62,
48317,
62,
45016,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
54,
18,
44,
12789,
62,
16402,
3069,
1137,
30023,
2538,
10979,
6234,
13,
628,
198,
24396,
23772,
13,
198,
220,
611,
3951,
7,
340,
62,
83,
853,
1039,
1267,
796,
657,
13,
198,
220,
220,
220,
1976,
66,
87,
62,
86,
18,
76,
524,
62,
18224,
14804,
40225,
7,
705,
22882,
1958,
3278,
6670,
6,
6739,
25113,
2943,
5626,
13918,
198,
220,
45762,
13,
628,
220,
1366,
300,
85,
62,
325,
79,
2099,
269,
13,
198,
220,
537,
62,
48317,
62,
8534,
437,
62,
30416,
14804,
1136,
62,
7753,
62,
25512,
1352,
7,
5609,
2393,
62,
25512,
1352,
796,
300,
85,
62,
325,
79,
6739,
198,
220,
45079,
62,
83,
853,
1039,
796,
340,
62,
83,
853,
1039,
13,
628,
220,
2214,
12,
1837,
2022,
10220,
25,
1279,
83,
29,
588,
1627,
286,
45079,
62,
83,
853,
1039,
13,
198,
220,
9052,
379,
45079,
62,
83,
853,
1039,
38875,
1279,
83,
28401,
198,
220,
220,
220,
611,
1279,
83,
29,
12,
34945,
318,
4238,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
86,
18,
76,
524,
62,
18224,
14804,
40225,
7,
705,
21745,
8619,
2314,
307,
6565,
6,
6739,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
45762,
13,
198,
220,
220,
220,
611,
3293,
1806,
7,
1188,
796,
1279,
83,
29,
12,
34945,
572,
796,
965,
11925,
7,
1279,
83,
29,
12,
34945,
1267,
532,
352,
18896,
796,
352,
1267,
1279,
29,
300,
85,
62,
325,
79,
13,
198,
220,
220,
220,
220,
220,
1279,
83,
29,
12,
34945,
796,
1279,
83,
29,
12,
34945,
11405,
300,
85,
62,
325,
79,
13,
198,
220,
220,
220,
45762,
13,
198,
220,
220,
220,
611,
1279,
83,
29,
12,
24455,
318,
4238,
13,
198,
220,
220,
220,
220,
220,
1279,
83,
29,
12,
24455,
796,
705,
9,
15885,
4458,
198,
220,
220,
220,
45762,
13,
198,
220,
886,
26268,
13,
628,
220,
2251,
2134,
6941,
62,
45016,
13,
198,
220,
900,
21360,
502,
3784,
28144,
62,
45016,
329
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class ZCL_XTT_COND definition
public
final
create public .
public section.
*"* public components of class ZCL_XTT_COND
*"* do not include other source files here!!!
types:
BEGIN OF ts_match,
cid TYPE string,
cond TYPE string,
caller TYPE REF TO object,
type TYPE string,
form TYPE string,
END OF ts_match .
types:
tt_match TYPE SORTED TABLE OF ts_match WITH UNIQUE KEY cid .
data MV_ROOT_TYPE type STRING .
methods CONSTRUCTOR
importing
!IO_XTT type ref to ZCL_XTT .
class-methods UNESCAPE
importing
!IV_TEXT type STRING
returning
value(RV_TEXT) type STRING .
methods CALC_MATCHES
importing
!IO_XTT type ref to ZCL_XTT
!IV_TABIX type SYTABIX
!IO_BLOCK type ref to ZCL_XTT_REPLACE_BLOCK
!IT_SCOPE type ZCL_XTT_SCOPE=>TT_SCOPE optional .
methods GET_TYPE
importing
!IS_DATA type ANY
!IV_SUFFIX type CSEQUENCE default 'ROW'
!IV_IS_TOP type ABAP_BOOL default ABAP_TRUE
exporting
!EV_TYPE type CSEQUENCE .
methods MAKE_TREE_FORMS
exporting
!EV_PROG type PROGRAMM
changing
!CT_ROW_OFFSET type ZCL_XTT_TREE_FUNCTION=>TT_ROW_OFFSET .
protected section.
private section.
*"* private components of class ZCL_XTT_COND
*"* do not include other source files here!!!
data MO_XTT type ref to ZCL_XTT .
data MT_ABAP_CODE type STRINGTAB .
data MT_MATCH type TT_MATCH .
data MV_PROG type PROGRAMM .
data MV_TOP_IS_DDIC_TYPE type ABAP_BOOL .
methods _MAKE_COND_FORMS .
methods _READ_SCOPES
importing
!IT_SCOPE type ZCL_XTT_SCOPE=>TT_SCOPE .
methods _GENERATE .
methods _702_COND
importing
!IV_VALUE type STRING
returning
value(RT_CODE) type STRINGTAB .
methods _702_BLOCK
importing
!IV_VALUE type STRING
returning
value(RT_CODE) type STRINGTAB .
methods _702_AS_IS
importing
!IV_VALUE type STRING
!IV_PREFIX type CSEQUENCE
returning
value(RT_CODE) type STRINGTAB .
methods _GET_TEXT_TYPE
importing
!IO_TYPE type ref to CL_ABAP_TYPEDESCR
returning
value(RV_TYPE) type STRING .
ENDCLASS.
CLASS ZCL_XTT_COND IMPLEMENTATION.
METHOD calc_matches.
IF it_scope IS NOT INITIAL.
_read_scopes( it_scope ).
get_type( EXPORTING is_data = io_block->ms_ext-dref
IMPORTING ev_type = mv_root_type ).
_make_cond_forms( ).
ENDIF.
" No dynamic fields
CHECK mt_match[] IS NOT INITIAL.
" CREATE DATA types
TYPES integer TYPE int4.
TYPES double TYPE p LENGTH 16 DECIMALS 5.
TYPES date TYPE d.
TYPES time TYPE t.
TYPES boolean TYPE abap_bool.
TYPES datetime TYPE c LENGTH 14.
* TYPES string TYPE string.
TYPES: BEGIN OF ts_block,
ok TYPE i,
END OF ts_block.
TYPES block TYPE STANDARD TABLE OF ts_block WITH DEFAULT KEY. " just any table
FIELD-SYMBOLS <ls_root> TYPE any.
FIELD-SYMBOLS <lv_result> TYPE any.
ASSIGN io_block->ms_ext-dref->* TO <ls_root>.
FIELD-SYMBOLS <ls_match> LIKE LINE OF mt_match.
LOOP AT mt_match ASSIGNING <ls_match>.
DATA ls_field LIKE LINE OF io_block->mt_fields.
ls_field-name = <ls_match>-cid.
ls_field-typ = <ls_match>-type.
" Just make it table
IF ls_field-typ = zcl_xtt_replace_block=>mc_type-block.
ls_field-typ = zcl_xtt_replace_block=>mc_type-table.
ENDIF.
" Use pseudo types
CREATE DATA ls_field-dref TYPE (<ls_match>-type).
ASSIGN ls_field-dref->* TO <lv_result>.
DATA lo_error TYPE REF TO zcx_eui_no_check.
TRY.
sy-tabix = iv_tabix.
PERFORM (<ls_match>-form) IN PROGRAM (mv_prog) IF FOUND
USING
<ls_root>
<ls_match>-caller
CHANGING
<lv_result>.
CATCH zcx_eui_no_check INTO lo_error.
MESSAGE w025(zsy_xtt) WITH <ls_match>-cond INTO sy-msgli.
io_xtt->add_log_message( iv_syst = abap_true ).
" tech info
io_xtt->add_log_message( io_exception = lo_error
iv_msgty = 'W' ).
ENDTRY.
INSERT ls_field INTO TABLE io_block->mt_fields.
IF sy-subrc <> 0.
MESSAGE e021(zsy_xtt) WITH ls_field-name INTO sy-msgli.
zcx_eui_no_check=>raise_sys_error( ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD constructor.
mo_xtt = io_xtt.
ENDMETHOD.
METHOD get_type.
DATA ls_field_ext TYPE zcl_xtt_replace_block=>ts_field_ext.
ls_field_ext = zcl_xtt_replace_block=>get_field_ext( io_xtt = mo_xtt
is_block = is_data
iv_block_name = iv_suffix ).
DATA lo_type LIKE ls_field_ext-desc.
lo_type = ls_field_ext-desc.
ev_type = _get_text_type( lo_type ).
IF iv_is_top = abap_true AND ev_type IS NOT INITIAL.
mv_top_is_ddic_type = abap_true.
ENDIF.
IF ev_type IS INITIAL.
DATA lv_len TYPE string.
DATA lv_dec TYPE string.
lv_len = lo_type->length.
lv_dec = lo_type->decimals.
CASE lo_type->type_kind.
WHEN cl_abap_typedescr=>typekind_int OR cl_abap_typedescr=>typekind_int1 OR cl_abap_typedescr=>typekind_int2.
ev_type = 'INT4'.
WHEN cl_abap_typedescr=>typekind_num OR cl_abap_typedescr=>typekind_numeric.
lv_len = lv_len / 2.
CONCATENATE `n LENGTH ` lv_len INTO ev_type.
WHEN cl_abap_typedescr=>typekind_char OR cl_abap_typedescr=>typekind_clike.
CONCATENATE `c LENGTH ` lv_len INTO ev_type.
WHEN cl_abap_typedescr=>typekind_packed OR cl_abap_typedescr=>typekind_float OR
'/' OR 'a' OR 'e'. " typekind_decfloat OR typekind_decfloat16 OR typekind_decfloat34.
ev_type = `p LENGTH 16 DECIMALS 5`.
WHEN cl_abap_typedescr=>typekind_date.
ev_type = 'd'.
WHEN cl_abap_typedescr=>typekind_time.
ev_type = 't'.
" No trunsformation for STRING
WHEN cl_abap_typedescr=>typekind_csequence OR cl_abap_typedescr=>typekind_string OR
cl_abap_typedescr=>typekind_w OR
" Binary data in template? Dump ?
cl_abap_typedescr=>typekind_hex OR cl_abap_typedescr=>typekind_xsequence OR cl_abap_typedescr=>typekind_xstring.
ev_type = 'STRING'.
" Special case for objects
WHEN cl_abap_typedescr=>typekind_intf OR cl_abap_typedescr=>typekind_class OR cl_abap_typedescr=>typekind_oref.
" Local classes ?
RETURN.
" Structures
WHEN cl_abap_typedescr=>typekind_struct1 OR cl_abap_typedescr=>typekind_struct2.
" Declare in code
DATA lt_code LIKE mt_abap_code.
CONCATENATE `TS_` iv_suffix INTO ev_type.
" Line by line
DATA lv_line TYPE string.
CONCATENATE `TYPES: BEGIN OF TS_` iv_suffix `,` INTO lv_line.
APPEND lv_line TO lt_code.
DATA lo_sdesc TYPE REF TO cl_abap_structdescr.
lo_sdesc ?= lo_type.
" Get structure data
FIELD-SYMBOLS <ls_struc> TYPE any.
ASSIGN ls_field_ext-dref->* TO <ls_struc>.
" Add every field
FIELD-SYMBOLS <ls_comp> TYPE abap_compdescr.
" TODO ref ???
LOOP AT lo_sdesc->components ASSIGNING <ls_comp> WHERE type_kind <> cl_abap_typedescr=>typekind_dref.
" data
FIELD-SYMBOLS <ls_sub_fld> TYPE any.
ASSIGN COMPONENT sy-tabix OF STRUCTURE <ls_struc> TO <ls_sub_fld>.
DATA lv_suffix TYPE string.
CONCATENATE iv_suffix `_` <ls_comp>-name INTO lv_suffix.
" Add sub field
DATA lv_sub_type TYPE string.
get_type( EXPORTING is_data = <ls_sub_fld>
iv_suffix = lv_suffix
iv_is_top = abap_false
IMPORTING ev_type = lv_sub_type ).
CONCATENATE <ls_comp>-name ` TYPE ` lv_sub_type `,` INTO lv_line. "#EC NOTEXT
APPEND lv_line TO lt_code.
ENDLOOP.
CONCATENATE `END OF TS_` iv_suffix `.` INTO lv_line. " #EC NOTEXT
APPEND lv_line TO lt_code.
APPEND '' TO lt_code.
" Tables
WHEN cl_abap_typedescr=>typekind_table.
DATA lo_tdesc TYPE REF TO cl_abap_tabledescr.
lo_tdesc ?= lo_type.
" Only stuctures ?
DATA lo_line TYPE REF TO cl_abap_datadescr.
lo_line = lo_tdesc->get_table_line_type( ).
" Create empy line
DATA lr_line TYPE REF TO data.
CREATE DATA lr_line TYPE HANDLE lo_line.
CONCATENATE iv_suffix `_LINE` INTO lv_suffix.
get_type( EXPORTING is_data = lr_line
iv_suffix = lv_suffix
iv_is_top = abap_false
IMPORTING ev_type = lv_sub_type ).
CASE lo_tdesc->table_kind.
WHEN lo_tdesc->tablekind_std.
ev_type = 'STANDARD'.
WHEN lo_tdesc->tablekind_hashed.
ev_type = 'HASHED'.
WHEN lo_tdesc->tablekind_sorted.
ev_type = 'SORTED'.
WHEN OTHERS.
ENDCASE.
DATA lv_kind TYPE string.
CASE lo_tdesc->key_defkind.
WHEN lo_tdesc->keydefkind_default.
lv_kind = `DEFAULT`.
WHEN 'E'. " lo_tdesc->keydefkind_empty. " only with kernel >= 7.40
lv_kind = `EMPTY`.
WHEN lo_tdesc->keydefkind_user OR lo_tdesc->keydefkind_tableline.
IF lo_tdesc->has_unique_key = abap_true.
lv_kind = `UNIQUE`.
ELSE.
lv_kind = `NON-UNIQUE`.
ENDIF.
DATA lv_key TYPE string.
CONCATENATE LINES OF lo_tdesc->key INTO lv_key SEPARATED BY space.
WHEN OTHERS.
ENDCASE.
CONCATENATE ev_type ` TABLE OF ` lv_sub_type ` WITH ` lv_kind ` KEY ` lv_key INTO ev_type.
*TYPEKIND_IREF, TYPEKIND_BREF TYPEKIND_DATA, TYPEKIND_SIMPLE, TYPEKIND_ANY
WHEN OTHERS.
MESSAGE e002(zsy_xtt) WITH lo_type->type_kind INTO sy-msgli.
zcx_eui_no_check=>raise_sys_error( ).
ENDCASE.
ENDIF.
" And add all
CHECK lt_code IS NOT INITIAL.
APPEND LINES OF lt_code TO mt_abap_code.
ENDMETHOD.
METHOD make_tree_forms.
" Global structure
DATA lv_line TYPE string.
CONCATENATE `DATA: ROW TYPE ` mv_root_type `.` INTO lv_line.
APPEND lv_line TO mt_abap_code. "#EC NOTEXT
APPEND '' TO mt_abap_code.
" Generate FORMs
FIELD-SYMBOLS <ls_row_off> LIKE LINE OF ct_row_offset.
LOOP AT ct_row_offset ASSIGNING <ls_row_off> WHERE if_where IS NOT INITIAL. "#EC CI_SORTSEQ
" Name of FORM
<ls_row_off>-if_form = sy-tabix.
CONDENSE <ls_row_off>-if_form.
CONCATENATE `F_` <ls_row_off>-if_form INTO <ls_row_off>-if_form.
" FORM declaration
CONCATENATE `FORM ` <ls_row_off>-if_form ` USING is_row TYPE ANY CHANGING cv_ok TYPE abap_bool.` INTO lv_line. "#EC NOTEXT
APPEND lv_line TO mt_abap_code.
APPEND 'MOVE-CORRESPONDING is_row TO row.' TO mt_abap_code. "#EC NOTEXT
CONCATENATE `IF ` <ls_row_off>-if_where `. cv_ok = 'X'. ENDIF.` INTO lv_line. "#EC NOTEXT
APPEND lv_line TO mt_abap_code.
APPEND 'ENDFORM.' TO mt_abap_code. "#EC NOTEXT
APPEND '' TO mt_abap_code.
ENDLOOP.
_generate( ).
ev_prog = mv_prog.
ENDMETHOD.
METHOD unescape.
rv_text = iv_text.
" TODO unescape all? Only for <>
REPLACE ALL OCCURRENCES OF:
'<' IN rv_text WITH '<',
'>' IN rv_text WITH '>',
'&' IN rv_text WITH '&',
'"' IN rv_text WITH '"',
''' IN rv_text WITH `'`.
ENDMETHOD.
METHOD _702_as_is.
DATA lv_code LIKE LINE OF rt_code.
CONCATENATE iv_prefix iv_value `.` INTO lv_code. "#EC NOTEXT
APPEND lv_code TO rt_code.
ENDMETHOD.
METHOD _702_block.
DATA lv_code LIKE LINE OF rt_code.
CONCATENATE `IF ` iv_value `.` INTO lv_code.
APPEND lv_code TO rt_code.
APPEND `APPEND INITIAL LINE TO result.` TO rt_code.
APPEND `ENDIF.` TO rt_code.
ENDMETHOD.
METHOD _702_cond.
DATA lv_code LIKE LINE OF rt_code.
* CONCATENATE `result = COND STRING( ` iv_value ` ).` INTO lv_code. "#EC NOTEXT
* RETURN.
" COND -> IF .. ELSEIF
CONCATENATE iv_value `.ENDIF.` INTO lv_code.
REPLACE ALL OCCURRENCES OF `THEN` IN lv_code WITH `. result = `.
REPLACE FIRST OCCURRENCE OF `ELSE` IN lv_code WITH `. ELSE. result = `.
REPLACE FIRST OCCURRENCE OF `WHEN` IN lv_code WITH `IF`.
REPLACE ALL OCCURRENCES OF `WHEN` IN lv_code WITH `.ELSEIF`.
APPEND lv_code TO rt_code.
ENDMETHOD.
METHOD _generate.
" Basic header of app
INSERT `REPORT DYNAMIC_IF.` INTO mt_abap_code INDEX 1.
INSERT `TYPE-POOLS ABAP.` INTO mt_abap_code INDEX 2. " Required for ABAP 7.01
INSERT `` INTO mt_abap_code INDEX 3.
DATA lo_prog TYPE REF TO zcl_eui_prog.
CREATE OBJECT lo_prog.
mv_prog = lo_prog->generate( it_code = mt_abap_code
iv_cprog = `` ).
ENDMETHOD.
METHOD _get_text_type.
" Simple case declared in SE11
IF io_type->is_ddic_type( ) = abap_true.
rv_type = io_type->get_relative_name( ).
RETURN.
ENDIF.
IF io_type->absolute_name CP '\CLASS=*'.
DATA lv_type TYPE string.
lv_type = io_type->absolute_name+7.
REPLACE FIRST OCCURRENCE OF '\TYPE=' IN lv_type WITH '=>'.
CHECK sy-subrc = 0.
" Private type ?
TRY.
DATA lr_type TYPE REF TO data.
CREATE DATA lr_type TYPE (lv_type).
rv_type = lv_type.
CATCH cx_sy_create_error.
CLEAR rv_type.
ENDTRY.
ENDIF.
ENDMETHOD.
METHOD _make_cond_forms.
" No dynamic fields
CHECK mt_match[] IS NOT INITIAL.
" Global structure For move-corresponding
DATA lv_line TYPE string.
DATA lv_form_decl TYPE string.
IF mv_top_is_ddic_type = abap_true.
CONCATENATE `value TYPE ` mv_root_type INTO lv_form_decl.
ELSE.
lv_form_decl = `root TYPE ANY`.
CONCATENATE `DATA: VALUE TYPE ` mv_root_type `.` INTO lv_line.
APPEND lv_line TO mt_abap_code. "#EC NOTEXT
ENDIF.
APPEND '' TO mt_abap_code.
FIELD-SYMBOLS <ls_match> LIKE LINE OF mt_match.
LOOP AT mt_match ASSIGNING <ls_match>.
" Name of FORM
<ls_match>-form = sy-tabix.
CONDENSE <ls_match>-form.
CONCATENATE `F_` <ls_match>-form INTO <ls_match>-form.
" FORM declaration
IF <ls_match>-type = zcl_xtt_replace_block=>mc_type-block.
lv_line = `STANDARD TABLE`.
ELSE.
lv_line = `ANY`.
ENDIF.
CONCATENATE `FORM ` <ls_match>-form ` USING ` lv_form_decl ` _caller TYPE REF TO OBJECT CHANGING result TYPE ` lv_line `.` INTO lv_line. "#EC NOTEXT
APPEND lv_line TO mt_abap_code.
" Use slow MOVE-CORRESPONDING
IF mv_top_is_ddic_type <> abap_true.
IF sy-saprl >= '740'.
APPEND 'value = CORRESPONDING #( DEEP root ).' TO mt_abap_code. "#EC NOTEXT
ELSE.
APPEND 'MOVE-CORRESPONDING root TO value.' TO mt_abap_code. "#EC NOTEXT
ENDIF.
ENDIF.
DATA lt_line LIKE mt_abap_code.
IF <ls_match>-type = zcl_xtt_replace_block=>mc_type-block.
lt_line = _702_block( <ls_match>-cond ).
ELSEIF <ls_match>-caller IS NOT INITIAL.
lt_line = _702_as_is( iv_value = <ls_match>-cond
iv_prefix = `` ).
ELSEIF <ls_match>-cond CP 'when*'.
lt_line = _702_cond( <ls_match>-cond ).
ELSE.
lt_line = _702_as_is( iv_value = <ls_match>-cond
iv_prefix = `result = ` ).
ENDIF.
APPEND `DATA lo_error TYPE REF TO cx_root.` TO mt_abap_code.
APPEND `TRY.` TO mt_abap_code.
LOOP AT lt_line INTO lv_line.
APPEND lv_line TO mt_abap_code.
ENDLOOP.
APPEND `CATCH cx_root INTO lo_error.` TO mt_abap_code.
APPEND ` zcx_eui_no_check=>raise_sys_error( io_error = lo_error ).` TO mt_abap_code.
APPEND `ENDTRY.` TO mt_abap_code.
APPEND 'ENDFORM.' TO mt_abap_code. "#EC NOTEXT
APPEND '' TO mt_abap_code.
ENDLOOP.
_generate( ).
ENDMETHOD.
METHOD _read_scopes.
FIELD-SYMBOLS <ls_scope> LIKE LINE OF it_scope.
LOOP AT it_scope ASSIGNING <ls_scope>.
DATA ls_match LIKE LINE OF mt_match.
CLEAR ls_match.
" Defaults
ls_match-type = zcl_xtt_replace_block=>mc_type-string.
ls_match-cid = <ls_scope>-field.
" Get params
FIELD-SYMBOLS <ls_pair> LIKE LINE OF <ls_scope>-t_pair.
LOOP AT <ls_scope>-t_pair ASSIGNING <ls_pair>.
CASE <ls_pair>-key.
WHEN 'cond'.
ls_match-cond = <ls_pair>-val.
WHEN 'type'.
ls_match-type = <ls_pair>-val.
WHEN 'call'.
ls_match-cond = <ls_pair>-val.
mo_xtt->get_caller_info( CHANGING cs_match = ls_match ).
WHEN OTHERS.
MESSAGE e017(zsy_xtt) WITH <ls_pair>-key INTO sy-msgli.
zcx_eui_no_check=>raise_sys_error( ).
ENDCASE.
ENDLOOP.
INSERT ls_match INTO TABLE mt_match.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
4871,
1168,
5097,
62,
55,
15751,
62,
10943,
35,
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,
55,
15751,
62,
10943,
35,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
628,
220,
3858,
25,
198,
220,
220,
220,
347,
43312,
3963,
40379,
62,
15699,
11,
198,
220,
220,
220,
220,
220,
269,
312,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
1779,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
24955,
41876,
4526,
37,
5390,
2134,
11,
198,
220,
220,
220,
220,
220,
2099,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
1296,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
23578,
3963,
40379,
62,
15699,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
256,
83,
62,
15699,
41876,
311,
9863,
1961,
43679,
3963,
40379,
62,
15699,
13315,
4725,
33866,
8924,
35374,
269,
312,
764,
628,
220,
1366,
32947,
62,
13252,
2394,
62,
25216,
2099,
19269,
2751,
764,
628,
220,
5050,
7102,
46126,
1581,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
9399,
62,
55,
15751,
2099,
1006,
284,
1168,
5097,
62,
55,
15751,
764,
198,
220,
1398,
12,
24396,
82,
4725,
1546,
33177,
36,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
32541,
2099,
19269,
2751,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
32541,
8,
2099,
19269,
2751,
764,
198,
220,
5050,
33290,
34,
62,
44,
11417,
1546,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
9399,
62,
55,
15751,
2099,
1006,
284,
1168,
5097,
62,
55,
15751,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
5603,
3483,
55,
2099,
19704,
5603,
3483,
55,
198,
220,
220,
220,
220,
220,
5145,
9399,
62,
9148,
11290,
2099,
1006,
284,
1168,
5097,
62,
55,
15751,
62,
2200,
6489,
11598,
62,
9148,
11290,
198,
220,
220,
220,
220,
220,
5145,
2043,
62,
6173,
32135,
2099,
1168,
5097,
62,
55,
15751,
62,
6173,
32135,
14804,
15751,
62,
6173,
32135,
11902,
764,
198,
220,
5050,
17151,
62,
25216,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
1797,
62,
26947,
2099,
15529,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
12564,
5777,
10426,
2099,
327,
5188,
10917,
18310,
4277,
705,
49,
3913,
6,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
1797,
62,
35222,
2099,
9564,
2969,
62,
8202,
3535,
4277,
9564,
2969,
62,
5446,
8924,
198,
220,
220,
220,
39133,
198,
220,
220,
220,
220,
220,
5145,
20114,
62,
25216,
2099,
327,
5188,
10917,
18310,
764,
198,
220,
5050,
39134,
62,
51,
11587,
62,
13775,
5653,
198,
220,
220,
220,
39133,
198,
220,
220,
220,
220,
220,
5145,
20114,
62,
4805,
7730,
2099,
46805,
44,
198,
220,
220,
220,
5609,
198,
220,
220,
220,
220,
220,
5145,
4177,
62,
49,
3913,
62,
27977,
28480,
2099,
1168,
5097,
62,
55,
15751,
62,
51,
11587,
62,
42296,
4177,
2849,
14804,
15751,
62,
49,
3913,
62,
27977,
28480,
764,
198,
24326,
2665,
13,
198,
19734,
2665,
13,
198,
198,
9,
1,
9,
2839,
6805,
286,
1398,
1168,
5097,
62,
55,
15751,
62,
10943,
35,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
220,
1366,
13070,
62,
55,
15751,
2099,
1006,
284,
1168,
5097,
62,
55,
15751,
764,
198,
220,
1366,
19308,
62,
6242,
2969,
62,
34,
16820,
2099,
19269,
2751,
5603,
33,
764,
198,
220,
1366,
19308,
62,
44,
11417,
2099,
26653,
62,
44,
11417,
764,
198,
220,
1366,
32947,
62,
4805,
7730,
2099,
46805,
44,
764,
198,
220,
1366,
32947,
62,
35222,
62,
1797,
62,
16458,
2149,
62,
25216,
2099,
9564,
2969,
62,
8202,
3535,
764,
628,
220,
5050,
4808,
5673,
7336,
62,
10943,
35,
62,
13775,
5653,
764,
198,
220,
5050,
4808,
15675,
62,
6173,
3185,
1546,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
2043,
62,
6173,
32135,
2099,
1168,
5097,
62,
55,
15751,
62,
6173,
32135,
14804,
15751,
62,
6173,
32135,
764,
198,
220,
5050,
4808,
35353,
1137,
6158,
764,
198,
220,
5050,
4808,
36680,
62,
10943,
35,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
39488,
2099,
19269,
2751,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
14181,
62,
34,
16820,
8,
2099,
19269,
2751,
5603,
33,
764,
198,
220,
5050,
4808,
36680,
62,
9148,
11290,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
39488,
2099,
19269,
2751,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
14181,
62,
34,
16820,
8,
2099,
19269,
2751,
5603,
33,
764,
198,
220,
5050,
4808,
36680,
62,
1921,
62,
1797,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
39488,
2099,
19269,
2751,
198,
220,
220,
220,
220,
220,
5145,
3824,
62,
47,
31688,
10426,
2099,
327,
5188,
10917,
18310,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
14181,
62,
34,
16820,
8,
2099,
19269,
2751,
5603,
33,
764,
198,
220,
5050,
4808,
18851,
62,
32541,
62,
25216,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
9399,
62,
25216,
2099,
1006,
284,
7852,
62,
6242,
2969,
62,
9936,
47,
1961,
1546,
9419,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
25216,
8,
2099,
19269,
2751,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
55,
15751,
62,
10943,
35,
30023,
2538,
10979,
6234,
13,
628,
198,
49273,
42302,
62,
6759,
2052,
13,
198,
220,
16876,
340,
62,
29982,
3180,
5626,
3268,
2043,
12576,
13,
198,
220,
220,
220,
4808,
961,
62,
1416,
13920,
7,
340,
62,
29982,
6739,
198,
220,
220,
220,
651,
62,
4906,
7,
7788,
15490,
2751,
318,
62,
7890,
796,
33245,
62,
9967,
3784,
907,
62,
2302,
12,
67,
5420,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30023
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS /dmo/cl_flight_amdp17 DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_amdp_marker_hdb.
CLASS-METHODS convert_currency IMPORTING VALUE(iv_amount) TYPE /dmo/total_price17
VALUE(iv_currency_code_source) TYPE /dmo/currency_code17
VALUE(iv_currency_code_target) TYPE /dmo/currency_code17
VALUE(iv_exchange_rate_date) TYPE d
EXPORTING VALUE(ev_amount) TYPE /dmo/total_price17.
ENDCLASS.
CLASS /dmo/cl_flight_amdp17 IMPLEMENTATION.
METHOD convert_currency BY DATABASE PROCEDURE FOR HDB LANGUAGE SQLSCRIPT OPTIONS READ-ONLY .
tab = SELECT CONVERT_CURRENCY( amount => :iv_amount,
source_unit => :iv_currency_code_source,
target_unit => :iv_currency_code_target,
reference_date => :iv_exchange_rate_date,
schema => CURRENT_SCHEMA,
error_handling => 'set to null',
steps => 'shift,convert,shift_back',
client => SESSION_CONTEXT( 'CLIENT' )
) AS target_value
FROM dummy ;
ev_amount = :tab.target_value[1];
ENDMETHOD.
ENDCLASS.
| [
31631,
1220,
67,
5908,
14,
565,
62,
22560,
62,
321,
26059,
1558,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
611,
62,
321,
26059,
62,
4102,
263,
62,
71,
9945,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
10385,
62,
34415,
30023,
9863,
2751,
26173,
8924,
7,
452,
62,
17287,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
23350,
62,
20888,
1558,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
452,
62,
34415,
62,
8189,
62,
10459,
8,
41876,
1220,
67,
5908,
14,
34415,
62,
8189,
1558,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
452,
62,
34415,
62,
8189,
62,
16793,
8,
41876,
1220,
67,
5908,
14,
34415,
62,
8189,
1558,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
452,
62,
1069,
3803,
62,
4873,
62,
4475,
8,
220,
220,
41876,
288,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
26173,
8924,
7,
1990,
62,
17287,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
23350,
62,
20888,
1558,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1220,
67,
5908,
14,
565,
62,
22560,
62,
321,
26059,
1558,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
10385,
62,
34415,
11050,
360,
1404,
6242,
11159,
41755,
1961,
11335,
7473,
5572,
33,
406,
15567,
52,
11879,
16363,
6173,
46023,
39852,
11053,
20832,
12,
1340,
11319,
764,
198,
220,
220,
220,
7400,
796,
33493,
7102,
15858,
62,
34,
31302,
45155,
7,
2033,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
1058,
452,
62,
17287,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2723,
62,
20850,
220,
220,
220,
5218,
1058,
452,
62,
34415,
62,
8189,
62,
10459,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2496,
62,
20850,
220,
220,
220,
5218,
1058,
452,
62,
34415,
62,
8189,
62,
16793,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4941,
62,
4475,
5218,
1058,
452,
62,
1069,
3803,
62,
4873,
62,
4475,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32815,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
327,
39237,
62,
50,
3398,
27630,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4049,
62,
4993,
1359,
5218,
705,
2617,
284,
9242,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4831,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
705,
30846,
11,
1102,
1851,
11,
30846,
62,
1891,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5456,
220,
220,
220,
220,
220,
220,
220,
220,
5218,
311,
47621,
62,
10943,
32541,
7,
705,
5097,
28495,
6,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
7054,
2496,
62,
8367,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16034,
31548,
2162,
198,
220,
220,
220,
819,
62,
17287,
796,
1058,
8658,
13,
16793,
62,
8367,
58,
16,
11208,
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,
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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
] |
class ZCL_WDA_MONSTER_TEST_CLASS definition
public
create private
for testing
duration short
risk level harmless .
public section.
PROTECTED SECTION.
PRIVATE SECTION.
DATA mo_tester TYPE REF TO cl_wd_web_dynpro_tester .
METHODS: setup,
allow_box_to_be_checked FOR TESTING,
given_user_ticks_box,
when_round_trip_occurs,
then_box_is_ticked.
ENDCLASS.
CLASS ZCL_WDA_MONSTER_TEST_CLASS IMPLEMENTATION.
METHOD allow_box_to_be_checked."for TESTING
*--------------------------------------------------------------------*
* Listing 11.09 : Setting Up WDA Unit Test
*--------------------------------------------------------------------*
given_user_ticks_box( ).
when_round_trip_occurs( ).
then_box_is_ticked( ).
ENDMETHOD.
METHOD given_user_ticks_box.
*--------------------------------------------------------------------*
* Listing 11.10 : Executing WDA Unit Test (1/3)
*--------------------------------------------------------------------*
DATA: checkbox TYPE REF TO if_wdt_checkbox.
checkbox ?= mo_tester->get_ui_element_tester( EXPORTING view_id = 'V_SELECT_OPTIONS'
uielement_id = 'CBOX_BED_HIDER' ).
checkbox->raise_change( EXPORTING checked = abap_true ).
ENDMETHOD.
METHOD setup.
*--------------------------------------------------------------------*
* Listing 11.09 : Setting Up WDA Unit Test
*--------------------------------------------------------------------*
mo_tester = cl_wd_web_dynpro_tester=>create(
application = 'ZWDA_MONSTER_MONITOR' ).
ENDMETHOD.
METHOD then_box_is_ticked.
*--------------------------------------------------------------------*
* Listing 11.10 : Executing WDA Unit Test (3/3)
*--------------------------------------------------------------------*
DATA: checked TYPE abap_bool.
DATA(root_node) = mo_tester->get_context_root_node( controller_id = 'V_SELECT_OPTIONS' ).
DATA(node) = root_node->get_child_node( 'BED_HIDER_FLAG' ).
node->get_attribute( EXPORTING name = 'BED_HIDER_FLAG'
IMPORTING value = checked ).
cl_abap_unit_assert=>assert_equals(
exp = abap_true
act = checked ).
ENDMETHOD.
METHOD when_round_trip_occurs.
*--------------------------------------------------------------------*
* Listing 11.10 : Executing WDA Unit Test (2/3)
*--------------------------------------------------------------------*
mo_tester->execute_request( ).
ENDMETHOD.
ENDCLASS.
| [
4871,
1168,
5097,
62,
54,
5631,
62,
27857,
41809,
62,
51,
6465,
62,
31631,
6770,
198,
220,
1171,
198,
220,
2251,
2839,
198,
220,
329,
4856,
198,
220,
9478,
1790,
198,
220,
2526,
1241,
23585,
764,
198,
198,
11377,
2665,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
42865,
6941,
62,
4879,
353,
41876,
4526,
37,
5390,
537,
62,
16993,
62,
12384,
62,
67,
2047,
1676,
62,
4879,
353,
764,
628,
220,
220,
220,
337,
36252,
50,
25,
9058,
11,
198,
220,
220,
220,
220,
220,
1249,
62,
3524,
62,
1462,
62,
1350,
62,
26752,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1813,
62,
7220,
62,
83,
3378,
62,
3524,
11,
198,
220,
220,
220,
220,
220,
618,
62,
744,
62,
39813,
62,
13966,
1834,
11,
198,
220,
220,
220,
220,
220,
788,
62,
3524,
62,
271,
62,
83,
9484,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
54,
5631,
62,
27857,
41809,
62,
51,
6465,
62,
31631,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1249,
62,
3524,
62,
1462,
62,
1350,
62,
26752,
526,
1640,
43001,
2751,
198,
9,
10097,
650,
9,
198,
9,
7343,
278,
1367,
13,
2931,
1058,
220,
25700,
3205,
370,
5631,
11801,
6208,
198,
9,
10097,
650,
9,
198,
220,
220,
220,
1813,
62,
7220,
62,
83,
3378,
62,
3524,
7,
6739,
628,
220,
220,
220,
618,
62,
744,
62,
39813,
62,
13966,
1834,
7,
6739,
628,
220,
220,
220,
788,
62,
3524,
62,
271,
62,
83,
9484,
7,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1813,
62,
7220,
62,
83,
3378,
62,
3524,
13,
198,
9,
10097,
650,
9,
198,
9,
7343,
278,
1367,
13,
940,
1058,
8393,
15129,
370,
5631,
11801,
6208,
357,
16,
14,
18,
8,
198,
9,
10097,
650,
9,
198,
220,
220,
220,
42865,
25,
2198,
3524,
41876,
4526,
37,
5390,
611,
62,
16993,
83,
62,
9122,
3524,
13,
628,
220,
220,
220,
2198,
3524,
5633,
28,
6941,
62,
4879,
353,
3784,
1136,
62,
9019,
62,
30854,
62,
4879,
353,
7,
7788,
15490,
2751,
1570,
62,
312,
220,
220,
220,
220,
220,
220,
220,
796,
705,
53,
62,
46506,
62,
3185,
51,
11053,
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,
220,
334,
494,
1732,
62,
312,
220,
220,
796,
705,
34,
39758,
62,
33,
1961,
62,
39,
41237,
6,
6739,
628,
220,
220,
220,
2198,
3524,
3784,
40225,
62,
3803,
7,
7788,
15490,
2751,
10667,
796,
450,
499,
62,
7942,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
9058,
13,
198,
9,
10097,
650,
9,
198,
9,
7343,
278,
1367,
13,
2931,
1058,
220,
25700,
3205,
370,
5631,
11801,
6208,
198,
9,
10097,
650,
9,
198,
220,
220,
220,
6941,
62,
4879,
353,
220,
220,
796,
537,
62,
16993,
62,
12384,
62,
67,
2047,
1676,
62,
4879,
353,
14804,
17953,
7,
198,
220,
220,
220,
3586,
796,
705,
57,
54,
5631,
62,
27857,
41809,
62,
27857,
2043,
1581,
6,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
788,
62,
3524,
62,
271,
62,
83,
9484,
13,
198,
9,
10097,
650,
9,
198,
9,
7343,
278,
1367,
13,
940,
1058,
8393,
15129,
370,
5631,
11801,
6208,
357,
18,
14,
18,
8,
198,
9,
10097,
650,
9,
198,
220,
220,
220,
42865,
25,
10667,
41876,
450,
499,
62,
30388,
13,
628,
220,
220,
220,
42865,
7,
15763,
62,
17440,
8,
796,
6941,
62,
4879,
353,
3784,
1136,
62,
22866,
62,
15763,
62,
17440,
7,
10444,
62,
312,
796,
705,
53,
62,
46506,
62,
3185,
51,
11053,
6,
6739,
628,
220,
220,
220,
42865,
7,
17440,
8,
796,
6808,
62,
17440,
3784,
1136,
62,
9410,
62,
17440,
7,
705,
33,
1961,
62,
39,
41237,
62,
38948,
6,
6739,
628,
220,
220,
220,
10139,
3784,
1136,
62,
42348,
7,
7788,
15490,
2751,
1438,
220,
796,
705,
33,
1961,
62,
39,
41237,
62,
38948,
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,
30023,
9863,
2751,
1988,
796,
10667,
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,
220,
220,
1033,
220,
220,
220,
220,
220,
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,
719,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
10667,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
618,
62,
744,
62,
39813,
62,
13966,
1834,
13,
198,
9,
10097,
650,
9,
198,
9,
7343,
278,
1367,
13,
940,
1058,
8393,
15129,
370,
5631,
11801,
6208,
357,
17,
14,
18,
8,
198,
9,
10097,
650,
9,
198,
220,
220,
220,
6941,
62,
4879,
353,
3784,
41049,
62,
25927,
7,
6739,
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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E SECTION.
ENDCLASS.
CLASS zcl_monster IMPLEMENTATION.
ENDCLASS.
| [
31631,
1976,
565,
62,
39050,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
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,
39050,
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
] |
"! @testing /DMO/CL_I_TRAVEL_TUM
"! @testing /DMO/CL_C_TRAVEL_TUM
"! @testing /DMO/CL_FLIGHT_LEGACY13
"! @testing FUGR:/DMO/FLIGHT_TRAVEL_API13
CLASS ltc DEFINITION FINAL INHERITING FROM /dmo/tc_flight_travel_api13 FOR TESTING RISK LEVEL HARMLESS DURATION MEDIUM.
ENDCLASS.
| [
40484,
2488,
33407,
1220,
35,
11770,
14,
5097,
62,
40,
62,
51,
3861,
18697,
62,
51,
5883,
198,
40484,
2488,
33407,
1220,
35,
11770,
14,
5097,
62,
34,
62,
51,
3861,
18697,
62,
51,
5883,
198,
40484,
2488,
33407,
1220,
35,
11770,
14,
5097,
62,
3697,
9947,
62,
2538,
38,
43300,
1485,
198,
40484,
2488,
33407,
376,
7340,
49,
14079,
35,
11770,
14,
3697,
9947,
62,
51,
3861,
18697,
62,
17614,
1485,
198,
31631,
300,
23047,
5550,
20032,
17941,
25261,
3268,
16879,
2043,
2751,
16034,
1220,
67,
5908,
14,
23047,
62,
22560,
62,
35927,
62,
15042,
1485,
7473,
43001,
2751,
45698,
42,
49277,
43638,
5805,
7597,
360,
4261,
6234,
26112,
41796,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_gui_page_addonline 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,
url TYPE string VALUE 'url',
package TYPE string VALUE 'package',
branch_name TYPE string VALUE 'branch_name',
display_name TYPE string VALUE 'display_name',
folder_logic TYPE string VALUE 'folder_logic',
ignore_subpackages TYPE string VALUE 'ignore_subpackages',
master_lang_only TYPE string VALUE 'master_lang_only',
END OF c_id.
CONSTANTS:
BEGIN OF c_event,
go_back TYPE string VALUE 'go-back',
choose_package TYPE string VALUE 'choose-package',
create_package TYPE string VALUE 'create-package',
choose_branch TYPE string VALUE 'choose-branch',
add_online_repo TYPE string VALUE 'add-repo-online',
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_form_util TYPE REF TO zcl_abapgit_html_form_utils.
DATA mo_validation_log TYPE REF TO zcl_abapgit_string_map .
METHODS validate_form
IMPORTING
io_form_data TYPE REF TO zcl_abapgit_string_map
RETURNING
VALUE(ro_validation_log) TYPE REF TO zcl_abapgit_string_map
RAISING
zcx_abapgit_exception.
METHODS get_form_schema
RETURNING
VALUE(ro_form) TYPE REF TO zcl_abapgit_html_form.
ENDCLASS.
CLASS zcl_abapgit_gui_page_addonline 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_addonline.
CREATE OBJECT lo_component.
ri_page = zcl_abapgit_gui_page_hoc=>create(
iv_page_title = 'New Online Repository'
ii_child_component = lo_component ).
ENDMETHOD.
METHOD get_form_schema.
ro_form = zcl_abapgit_html_form=>create(
iv_form_id = 'add-repo-online-form'
iv_help_page = 'https://docs.abapgit.org/guide-online-install.html' ).
ro_form->text(
iv_name = c_id-url
iv_required = abap_true
iv_label = 'Git Repository URL'
iv_hint = 'HTTPS address of the repository to clone'
iv_placeholder = 'https://github.com/...git'
)->text(
iv_name = c_id-package
iv_side_action = c_event-choose_package
iv_required = abap_true
iv_upper_case = abap_true
iv_label = 'Package'
iv_hint = 'SAP package for repository (should be a dedicated one)'
iv_placeholder = 'Z... / $...'
)->text(
iv_name = c_id-branch_name
iv_side_action = c_event-choose_branch
iv_label = 'Branch'
iv_hint = 'Switch to a specific branch on clone (default: autodetect)'
iv_placeholder = 'Autodetect default branch'
)->radio(
iv_name = c_id-folder_logic
iv_default_value = zif_abapgit_dot_abapgit=>c_folder_logic-prefix
iv_label = 'Folder Logic'
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
)->text(
iv_name = c_id-display_name
iv_label = 'Display Name'
iv_hint = 'Name to show instead of original repository name (optional)'
)->checkbox(
iv_name = c_id-ignore_subpackages
iv_label = 'Ignore Subpackages'
iv_hint = 'Synchronize root package only'
)->checkbox(
iv_name = c_id-master_lang_only
iv_label = 'Serialize Main Language Only'
iv_hint = 'Ignore translations, serialize just main language'
)->command(
iv_label = 'Clone Online Repo'
iv_cmd_type = zif_abapgit_html_form=>c_cmd_type-input_main
iv_action = c_event-add_online_repo
)->command(
iv_label = 'Create Package'
iv_action = c_event-create_package
)->command(
iv_label = 'Back'
iv_action = c_event-go_back ).
ENDMETHOD.
METHOD validate_form.
DATA lx_err TYPE REF TO zcx_abapgit_exception.
ro_validation_log = mo_form_util->validate( io_form_data ).
IF io_form_data->get( c_id-url ) IS NOT INITIAL.
TRY.
zcl_abapgit_repo_srv=>get_instance( )->validate_url( io_form_data->get( c_id-url ) ).
CATCH zcx_abapgit_exception INTO lx_err.
ro_validation_log->set(
iv_key = c_id-url
iv_val = lx_err->get_text( ) ).
ENDTRY.
ENDIF.
IF io_form_data->get( c_id-package ) IS NOT INITIAL.
TRY.
zcl_abapgit_repo_srv=>get_instance( )->validate_package(
iv_package = |{ io_form_data->get( c_id-package ) }|
iv_ign_subpkg = |{ io_form_data->get( c_id-ignore_subpackages ) }| ).
CATCH zcx_abapgit_exception INTO lx_err.
ro_validation_log->set(
iv_key = c_id-package
iv_val = lx_err->get_text( ) ).
ENDTRY.
ENDIF.
IF io_form_data->get( c_id-folder_logic ) <> zif_abapgit_dot_abapgit=>c_folder_logic-prefix
AND io_form_data->get( c_id-folder_logic ) <> zif_abapgit_dot_abapgit=>c_folder_logic-full.
ro_validation_log->set(
iv_key = c_id-folder_logic
iv_val = |Invalid folder logic { io_form_data->get( c_id-folder_logic )
}. Must be { zif_abapgit_dot_abapgit=>c_folder_logic-prefix
} or { zif_abapgit_dot_abapgit=>c_folder_logic-full } | ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
DATA: ls_repo_params TYPE zif_abapgit_services_repo=>ty_repo_params,
lo_new_online_repo TYPE REF TO zcl_abapgit_repo_online.
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-create_package.
mo_form_data->set(
iv_key = c_id-package
iv_val = zcl_abapgit_services_basis=>create_package(
iv_prefill_package = |{ mo_form_data->get( c_id-package ) }| ) ).
IF mo_form_data->get( c_id-package ) IS NOT INITIAL.
mo_validation_log = validate_form( mo_form_data ).
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.
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.
mo_validation_log = validate_form( mo_form_data ).
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.
WHEN c_event-choose_branch.
mo_validation_log = validate_form( mo_form_data ).
IF mo_validation_log->has( c_id-url ) = abap_true.
mo_validation_log->set(
iv_key = c_id-branch_name
iv_val = 'Check URL issues' ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render. " Display errors
RETURN.
ENDIF.
mo_form_data->set(
iv_key = c_id-branch_name
iv_val = zcl_abapgit_ui_factory=>get_popups( )->branch_list_popup( mo_form_data->get( c_id-url ) )-name ).
IF mo_form_data->get( c_id-branch_name ) IS INITIAL.
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
ELSE.
mo_form_data->set(
iv_key = c_id-branch_name
iv_val = replace( " strip technical
val = mo_form_data->get( c_id-branch_name )
sub = zif_abapgit_definitions=>c_git_branch-heads_prefix
with = '' ) ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
ENDIF.
WHEN c_event-add_online_repo.
mo_validation_log = validate_form( mo_form_data ).
IF mo_validation_log->is_empty( ) = abap_true.
mo_form_data->to_abap( CHANGING cs_container = ls_repo_params ).
lo_new_online_repo = zcl_abapgit_services_repo=>new_online( ls_repo_params ).
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_repo_view
EXPORTING
iv_key = lo_new_online_repo->get_key( ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page_replacing.
ELSE.
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render. " Display errors
ENDIF.
ENDCASE.
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.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
2860,
25119,
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,
628,
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,
628,
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,
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,
19016,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
6371,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
5301,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
26495,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
8478,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
1671,
3702,
62,
3672,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
3359,
62,
3672,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
13812,
62,
3672,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
9483,
62,
6404,
291,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
43551,
62,
6404,
291,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
8856,
62,
7266,
43789,
41876,
4731,
26173,
8924,
705,
46430,
62,
7266,
43789,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4958,
62,
17204,
62,
8807,
220,
220,
41876,
4731,
26173,
8924,
705,
9866,
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,
220,
41876,
4731,
26173,
8924,
705,
2188,
12,
1891,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
3853,
62,
26495,
220,
41876,
4731,
26173,
8924,
705,
6679,
577,
12,
26495,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
2251,
62,
26495,
220,
41876,
4731,
26173,
8924,
705,
17953,
12,
26495,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
3853,
62,
1671,
3702,
220,
220,
41876,
4731,
26173,
8924,
705,
6679,
577,
12,
1671,
3702,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
751,
62,
25119,
62,
260,
7501,
41876,
4731,
26173,
8924,
705,
2860,
12,
260,
7501,
12,
25119,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
15596,
13,
628,
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,
687,
62,
22602,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
687,
62,
26791,
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,
764,
628,
220,
220,
220,
337,
36252,
50,
26571,
62,
687,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
687,
62,
7890,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
8841,
62,
8899,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
12102,
341,
62,
6404,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
8841,
62,
8899,
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,
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,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
2860,
25119,
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,
628,
220,
220,
220,
42865,
2376,
62,
42895,
41876,
4526,
37,
5390,
1976,
565,
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,
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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
] |
*&---------------------------------------------------------------------*
*& Report zaf_r_extend_rds_based_service
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zaf_r_extend_rds_based_service.
"todo's
"check usage of CL_BSA_SADL_M2M_TRANSFORMER to transform the SADL XML to a structure and vice versa.
CLASS cl_sadl_based_segw_project DEFINITION .
PUBLIC SECTION.
TYPES:
BEGIN OF ts_mpc_type_of_cds_view,
cds_view_name TYPE string,
mpc_get_entity_type_name TYPE string,
mpc_get_entityset_type_name TYPE string,
END OF ts_mpc_type_of_cds_view,
tt_mpc_type_of_cds_view TYPE STANDARD TABLE OF ts_mpc_type_of_cds_view WITH EMPTY KEY.
METHODS: constructor IMPORTING io_segw_project_name TYPE /iwbep/i_sbd_ga-project
RAISING cx_parameter_invalid,
get_sadl_xml RETURNING VALUE(sadl_xml) TYPE string
RAISING cx_sadl_gw_no_service_api,
get_merged_sadl_xml IMPORTING sadl_xml_source_project TYPE string
sadl_xml_extended_project TYPE string
RETURNING VALUE(sadl_xml_merged) TYPE string,
get_dpc_ext_class_name RETURNING VALUE(class_name) TYPE string,
get_mpc_ext_class_name RETURNING VALUE(class_name) TYPE string,
get_dpc_class_name RETURNING VALUE(class_name) TYPE string,
get_mpc_class_name RETURNING VALUE(class_name) TYPE string,
get_segw_project_name RETURNING VALUE(project_name) TYPE string.
"methods A012345678901234567890123456789.
METHODS get_mpc_type_names
IMPORTING
i_cds_view_names TYPE table_of_strings
RETURNING VALUE(r_mpc_types_of_cds_views) TYPE tt_mpc_type_of_cds_view.
METHODS insert_sadl_xml_into_dpc
IMPORTING
!iv_sadl_xml TYPE string
iv_src_segw_project_name TYPE string
CHANGING
generated_code_definition TYPE rswsourcet
generated_code_implementation TYPE rswsourcet
RAISING
/iwbep/cx_sbcm_exception .
METHODS insert_sadl_xml_into_mpc_ext
IMPORTING
!iv_sadl_xml TYPE string
iv_src_segw_project_name TYPE string
CHANGING
generated_code_definition TYPE rswsourcet
generated_code_implementation TYPE rswsourcet
RAISING
/iwbep/cx_sbcm_exception .
METHODS get_cds_views_from_sadl_xml
IMPORTING sadl_xml TYPE string
RETURNING VALUE(cds_view_names) TYPE table_of_strings.
METHODS create_get_entity_set_methods
IMPORTING
cds_view_names TYPE table_of_strings
CHANGING
generated_code_definition TYPE rswsourcet
generated_code_implementation TYPE rswsourcet
generated_types_definition TYPE rswsourcet.
METHODS create_generic_get_methods
IMPORTING
cds_view_names TYPE table_of_strings
CHANGING
generated_code_definition TYPE rswsourcet
generated_code_implementation TYPE rswsourcet.
PROTECTED SECTION. " Visible only in child classes
PRIVATE SECTION. " Visible only internally
DATA segw_project_name TYPE /iwbep/i_sbd_ga-project.
DATA segw_project TYPE REF TO /iwbep/if_sbdm_project.
CONSTANTS suffix_length TYPE i VALUE 3.
CONSTANTS cds_view_name_length TYPE i VALUE 30.
DATA dpc_ext_class_name TYPE string.
DATA mpc_ext_class_name TYPE string.
DATA dpc_class_name TYPE string.
DATA mpc_class_name TYPE string.
ENDCLASS.
CLASS cl_sadl_based_segw_project IMPLEMENTATION.
METHOD constructor.
DATA:service_builder_dm_factory TYPE REF TO /iwbep/if_sbdm_factory,
service_builder_dm_manager TYPE REF TO /iwbep/if_sbdm_manager,
lt_range TYPE /iwbep/if_sbdm_manager=>ty_t_range_prjct_name.
segw_project_name = io_segw_project_name.
service_builder_dm_factory = /iwbep/cl_sbdm=>get_factory( ).
service_builder_dm_manager = /iwbep/cl_sbdm=>get_manager( ).
lt_range = VALUE #( (
sign = 'I'
option = 'EQ'
low = segw_project_name
) ).
READ TABLE service_builder_dm_manager->find_projects( lt_range ) INTO segw_project INDEX 1.
IF sy-subrc NE 0.
RAISE EXCEPTION TYPE cx_demo_dyn_t100
MESSAGE ID '/IWBEP/SBUIP'
TYPE 'E'
NUMBER '001'
WITH segw_project_name.
ENDIF.
LOOP AT segw_project->get_generated_artifacts( ) INTO DATA(generated_artifact).
IF generated_artifact->get_tadir_data( )-trobj_type = 'CLAS'.
DATA(class_name) = generated_artifact->get_tadir_data( )-trobj_name.
DATA(mpc_ext_suffix) = substring( val = class_name len = strlen( '_MPC_EXT' ) off = strlen( class_name ) - strlen( '_MPC_EXT' ) ).
DATA(dpc_ext_suffix) = substring( val = class_name len = strlen( '_DPC_EXT' ) off = strlen( class_name ) - strlen( '_DPC_EXT' ) ).
DATA(mpc_suffix) = substring( val = class_name len = strlen( '_MPC' ) off = strlen( class_name ) - strlen( '_MPC' ) ).
DATA(dpc_suffix) = substring( val = class_name len = strlen( '_DPC' ) off = strlen( class_name ) - strlen( '_DPC' ) ).
IF mpc_ext_suffix = '_MPC_EXT'.
mpc_ext_class_name = generated_artifact->get_tadir_data( )-trobj_name.
ELSEIF dpc_ext_suffix = '_DPC_EXT'.
dpc_ext_class_name = generated_artifact->get_tadir_data( )-trobj_name.
ELSEIF dpc_suffix = '_DPC'.
dpc_class_name = generated_artifact->get_tadir_data( )-trobj_name.
ELSEIF dpc_suffix = '_MPC'.
mpc_class_name = generated_artifact->get_tadir_data( )-trobj_name.
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD get_sadl_xml.
DATA lo_service_api TYPE REF TO cl_sadl_gw_service_api .
TRY.
lo_service_api = cl_sadl_gw_service_api=>get_service_api( io_project = segw_project ).
CATCH /iwbep/cx_sbcm_exception.
"handle exception
ENDTRY.
TRY.
lo_service_api->get_and_update_sadl_xml( IMPORTING ev_sadl_xml = sadl_xml ).
CATCH /iwbep/cx_sbcm_exception.
"handle exception
ENDTRY.
"lo_service_api->get_sadl( IMPORTING es_sadl = DATA(sadl_definition) ).
ENDMETHOD.
METHOD get_merged_sadl_xml.
DATA string_1 TYPE string.
DATA remaining_string TYPE string.
DATA data_sources_string TYPE string.
DATA data_sources_target_string TYPE string.
DATA structures_string TYPE string.
DATA structures_target_string TYPE string.
DATA mv_sadl_xml_merged TYPE string.
SPLIT sadl_xml_source_project AT '<sadl:dataSource' INTO string_1 remaining_string.
SPLIT remaining_string AT '<sadl:resultSet>' INTO data_sources_string remaining_string.
data_sources_string = '<sadl:dataSource' && data_sources_string.
SPLIT remaining_string AT '</sadl:resultSet>' INTO structures_string remaining_string.
SPLIT sadl_xml_extended_project AT '<sadl:dataSource' INTO string_1 remaining_string.
SPLIT remaining_string AT '<sadl:resultSet>' INTO data_sources_target_string remaining_string.
data_sources_target_string = '<sadl:dataSource' && data_sources_target_string.
SPLIT remaining_string AT '</sadl:resultSet>' INTO structures_target_string remaining_string.
sadl_xml_merged = string_1 &&
data_sources_string &&
data_sources_target_string &&
'<sadl:resultSet>' &&
structures_string &&
structures_target_string &&
'</sadl:resultSet>' &&
remaining_string.
WRITE : / mv_sadl_xml_merged.
ENDMETHOD.
METHOD insert_sadl_xml_into_dpc.
DATA(lv_timestamp) = cl_sadl_gw_model_sb_gen_mpc_pr=>get_generation_timestamp( segw_project ).
APPEND | METHODS if_sadl_gw_dpc_util~get_dpc REDEFINITION .| TO generated_code_definition ##NO_TEXT.
APPEND | METHOD if_sadl_gw_dpc_util~get_dpc. | TO generated_code_implementation ##NO_TEXT.
APPEND | CONSTANTS: co_gen_timestamp TYPE timestamp VALUE '{ lv_timestamp }'. | TO generated_code_implementation ##NO_TEXT.
APPEND | DATA(lv_sadl_xml) = | TO generated_code_implementation ##NO_TEXT.
* === Large SADL must be split, we split it after 50 rows
SPLIT iv_sadl_xml AT '>' INTO TABLE DATA(lt_string).
DATA(lv_lines) = lines( lt_string ).
LOOP AT lt_string ASSIGNING FIELD-SYMBOL(<s_line>).
<s_line> = | \|{ <s_line> }>\| |.
IF sy-tabix = lv_lines. " Last line
<s_line> = |{ <s_line> }.|.
ELSE.
IF sy-tabix MOD 50 = 0.
<s_line> = |{ <s_line> }.|.
APPEND <s_line> TO generated_code_implementation .
<s_line> = | lv_sadl_xml = \|\{ lv_sadl_xml \}\| &| ##no_text.
ELSE.
<s_line> = |{ <s_line> } &|.
ENDIF.
ENDIF.
APPEND <s_line> TO generated_code_implementation .
ENDLOOP.
APPEND | ro_dpc = cl_sadl_gw_dpc_factory=>create_for_sadl( iv_sadl_xml = lv_sadl_xml | TO generated_code_implementation ##NO_TEXT.
APPEND | iv_timestamp = co_gen_timestamp | TO generated_code_implementation ##NO_TEXT.
APPEND | iv_uuid = CONV #( '{ iv_src_segw_project_name }' ) | TO generated_code_implementation ##NO_TEXT.
APPEND | io_context = me->mo_context ). | TO generated_code_implementation ##NO_TEXT.
APPEND |ENDMETHOD.| TO generated_code_implementation ##NO_TEXT.
ENDMETHOD.
METHOD get_cds_views_from_sadl_xml.
DATA(ls_sadl_definition) = cl_bsa_sadl_m2m_transformer=>get_instance( )->xml_to_abap_structure( iv_sadl_xml = sadl_xml ).
LOOP AT ls_sadl_definition-structures REFERENCE INTO DATA(lr_structure).
" Entry in structures correlates to entry in data sources
READ TABLE ls_sadl_definition-data_sources WITH KEY name = lr_structure->data_source
type = 'CDS' TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0 AND lr_structure->exposure = 'TRUE'.
"INSERT CONV #( lr_structure->data_source ) INTO TABLE cds_view_names.
INSERT CONV #( lr_structure->name ) INTO TABLE cds_view_names.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD create_get_entity_set_methods.
* DATA generated_code_definition TYPE rswsourcet .
* DATA generated_code_implementation TYPE rswsourcet .
DATA method_name_get_entityset TYPE string.
DATA method_name_get_entity TYPE string.
DATA type_name_entity TYPE string.
DATA type_name_entityset TYPE string.
DATA tab_name_entity TYPE string.
DATA tab_name_entityset TYPE string.
"DATA generated_types_definition TYPE rswsourcet .
DATA(mpc_type_names) = get_mpc_type_names( cds_view_names ).
LOOP AT cds_view_names INTO DATA(cds_view_name).
"leave 2 characters to generate a unique name '<...>_get_entityset'
READ TABLE mpc_type_names INTO DATA(mpc_type_name) WITH KEY cds_view_name = cds_view_name.
IF sy-subrc = 0.
type_name_entity = mpc_type_name-mpc_get_entity_type_name .
type_name_entityset = mpc_type_name-mpc_get_entityset_type_name .
ELSE.
type_name_entity = 'TS_' .
type_name_entityset = 'TT_' .
ENDIF.
DATA(get_entityset_suffix) = '_get_entityset'.
DATA(get_entity_suffix) = '_get_entity'.
DATA(tab_entityset_suffix) = '_entityset'.
DATA(tab_entity_suffix) = '_entity'.
DATA(mandatory_name_components) = get_entityset_suffix.
DATA(length_mandatory_name_comp) = strlen( mandatory_name_components ).
DATA(remaining_num_characters) = cds_view_name_length - length_mandatory_name_comp.
IF strlen( cds_view_name ) > remaining_num_characters - suffix_length.
method_name_get_entityset = substring( val = cds_view_name len = remaining_num_characters - suffix_length ) && get_entityset_suffix.
method_name_get_entity = substring( val = cds_view_name len = remaining_num_characters - suffix_length ) && get_entity_suffix.
* type_name_entity = 'TS_' && substring( val = cds_view_name len = remaining_num_characters - suffix_length ) .
* type_name_entityset = 'TT_' && substring( val = cds_view_name len = remaining_num_characters - suffix_length ) .
tab_name_entityset = substring( val = cds_view_name len = remaining_num_characters - suffix_length ) && tab_entityset_suffix.
tab_name_entity = substring( val = cds_view_name len = remaining_num_characters - suffix_length ) && tab_entity_suffix.
ELSE.
method_name_get_entityset = cds_view_name && get_entityset_suffix.
method_name_get_entity = cds_view_name && get_entity_suffix.
* type_name_entity = 'TS_' && cds_view_name.
* type_name_entityset = 'TT_' && cds_view_name .
tab_name_entityset = cds_view_name && tab_entityset_suffix.
tab_name_entity = cds_view_name && tab_entity_suffix.
ENDIF.
APPEND | METHODS { method_name_get_entity } | TO generated_code_definition ##NO_TEXT.
APPEND | IMPORTING | TO generated_code_definition ##NO_TEXT.
APPEND | !io_tech_request_context TYPE REF TO /iwbep/if_mgw_req_entity OPTIONAL | TO generated_code_definition ##NO_TEXT.
APPEND | EXPORTING | TO generated_code_definition ##NO_TEXT.
APPEND | !er_entity TYPE { mpc_class_name }=>{ type_name_entity } "use code completion to select correct type from MPC . | TO generated_code_definition ##NO_TEXT.
APPEND | !es_response_context TYPE /iwbep/if_mgw_appl_srv_runtime=>ty_s_mgw_response_entity_cntxt | TO generated_code_definition ##NO_TEXT.
APPEND | RAISING | TO generated_code_definition ##NO_TEXT.
APPEND | /iwbep/cx_mgw_busi_exception | TO generated_code_definition ##NO_TEXT.
APPEND | /iwbep/cx_mgw_tech_exception . | TO generated_code_definition ##NO_TEXT.
APPEND | METHODS { method_name_get_entityset } | TO generated_code_definition ##NO_TEXT.
APPEND | IMPORTING | TO generated_code_definition ##NO_TEXT.
APPEND | !io_tech_request_context TYPE REF TO /iwbep/if_mgw_req_entityset OPTIONAL | TO generated_code_definition ##NO_TEXT.
APPEND | EXPORTING | TO generated_code_definition ##NO_TEXT.
APPEND | !et_entityset TYPE { mpc_class_name }=>{ type_name_entityset } "use code completion to select correct type from MPC . | TO generated_code_definition ##NO_TEXT.
APPEND | !es_response_context TYPE /iwbep/if_mgw_appl_srv_runtime=>ty_s_mgw_response_context | TO generated_code_definition ##NO_TEXT.
APPEND | RAISING | TO generated_code_definition ##NO_TEXT.
APPEND | /iwbep/cx_mgw_busi_exception | TO generated_code_definition ##NO_TEXT.
APPEND | /iwbep/cx_mgw_tech_exception . | TO generated_code_definition ##NO_TEXT.
" create code for implementation part
APPEND | method { method_name_get_entity }. | TO generated_code_implementation ##NO_TEXT.
APPEND | if_sadl_gw_dpc_util~get_dpc( )->get_entity( EXPORTING io_tech_request_context = io_tech_request_context | TO generated_code_implementation ##NO_TEXT.
APPEND | IMPORTING es_data = er_entity ). | TO generated_code_implementation ##NO_TEXT.
APPEND | endmethod. | TO generated_code_implementation ##NO_TEXT.
APPEND | method { method_name_get_entityset }. | TO generated_code_implementation ##NO_TEXT.
APPEND | if_sadl_gw_dpc_util~get_dpc( )->get_entityset( EXPORTING io_tech_request_context = io_tech_request_context | TO generated_code_implementation ##NO_TEXT.
APPEND | IMPORTING et_data = et_entityset | TO generated_code_implementation ##NO_TEXT.
APPEND | es_response_context = es_response_context ). | TO generated_code_implementation ##NO_TEXT.
APPEND | endmethod. | TO generated_code_implementation ##NO_TEXT.
ENDLOOP.
ENDMETHOD.
METHOD create_generic_get_methods.
DATA method_name_get_entityset TYPE string.
DATA method_name_get_entity TYPE string.
DATA tab_name_entity TYPE string.
DATA tab_name_entityset TYPE string.
DATA generated_code_get_entity TYPE rswsourcet.
DATA generated_code_get_entityset TYPE rswsourcet.
DATA(tab_entityset_suffix) = '_entityset'.
DATA(tab_entity_suffix) = '_entity'.
APPEND | METHODS /iwbep/if_mgw_appl_srv_runtime~get_entityset REDEFINITION . | TO generated_code_definition ##NO_TEXT.
APPEND | METHODS /iwbep/if_mgw_appl_srv_runtime~get_entity REDEFINITION . | TO generated_code_definition ##NO_TEXT.
CLEAR generated_code_get_entityset.
APPEND | METHOD /iwbep/if_mgw_appl_srv_runtime~get_entityset. | TO generated_code_get_entityset ##NO_TEXT.
APPEND | DATA(my_entity_name) = io_tech_request_context->get_entity_set_name( ). | TO generated_code_get_entityset ##NO_TEXT.
APPEND | case io_tech_request_context->get_entity_set_name( ). | TO generated_code_get_entityset ##NO_TEXT.
CLEAR generated_code_get_entity .
APPEND | METHOD /iwbep/if_mgw_appl_srv_runtime~get_entity. | TO generated_code_get_entity ##NO_TEXT.
APPEND | DATA(my_entity_name) = io_tech_request_context->get_entity_set_name( ). | TO generated_code_get_entity ##NO_TEXT.
APPEND | case io_tech_request_context->get_entity_set_name( ). | TO generated_code_get_entity ##NO_TEXT.
LOOP AT cds_view_names INTO DATA(cds_view_name).
"leave 2 characters to generate a unique name '<...>_get_entityset'
DATA(get_entityset_suffix) = '_get_entityset'.
DATA(get_entity_suffix) = '_get_entity'.
DATA(mandatory_name_components) = get_entityset_suffix.
DATA(length_mandatory_name_comp) = strlen( mandatory_name_components ).
DATA(remaining_num_characters) = cds_view_name_length - length_mandatory_name_comp.
IF strlen( cds_view_name ) > remaining_num_characters - suffix_length.
method_name_get_entityset = substring( val = cds_view_name len = remaining_num_characters - suffix_length ) && get_entityset_suffix.
method_name_get_entity = substring( val = cds_view_name len = remaining_num_characters - suffix_length ) && get_entity_suffix.
tab_name_entityset = substring( val = cds_view_name len = remaining_num_characters - suffix_length ) && tab_entityset_suffix.
tab_name_entity = substring( val = cds_view_name len = remaining_num_characters - suffix_length ) && tab_entity_suffix.
ELSE.
method_name_get_entityset = cds_view_name && get_entityset_suffix.
method_name_get_entity = cds_view_name && get_entity_suffix.
tab_name_entityset = cds_view_name && tab_entityset_suffix.
tab_name_entity = cds_view_name && tab_entity_suffix.
ENDIF.
APPEND |WHEN '{ cds_view_name }'. | TO generated_code_get_entityset ##NO_TEXT.
APPEND | { method_name_get_entityset }( EXPORTING io_tech_request_context = io_tech_request_context | TO generated_code_get_entityset ##NO_TEXT.
APPEND | IMPORTING et_entityset = data({ tab_name_entityset }) | TO generated_code_get_entityset ##NO_TEXT.
APPEND | es_response_context = es_response_context ). | TO generated_code_get_entityset ##NO_TEXT.
APPEND | IF { tab_name_entityset } IS NOT INITIAL. | TO generated_code_get_entityset ##NO_TEXT.
APPEND | copy_data_to_ref( EXPORTING is_data = { tab_name_entityset } | TO generated_code_get_entityset ##NO_TEXT.
APPEND | CHANGING cr_data = er_entityset ). | TO generated_code_get_entityset ##NO_TEXT.
APPEND | ENDIF. | TO generated_code_get_entityset ##NO_TEXT.
APPEND |WHEN '{ cds_view_name }'. | TO generated_code_get_entity ##NO_TEXT.
APPEND | { method_name_get_entity }( EXPORTING io_tech_request_context = io_tech_request_context | TO generated_code_get_entity ##NO_TEXT.
APPEND | IMPORTING er_entity = data({ tab_name_entity }) | TO generated_code_get_entity ##NO_TEXT.
APPEND | es_response_context = es_response_context ). | TO generated_code_get_entity ##NO_TEXT.
APPEND | IF { tab_name_entity } IS NOT INITIAL. | TO generated_code_get_entity ##NO_TEXT.
APPEND | copy_data_to_ref( EXPORTING is_data = { tab_name_entity } | TO generated_code_get_entity ##NO_TEXT.
APPEND | CHANGING cr_data = er_entity ). | TO generated_code_get_entity ##NO_TEXT.
APPEND | ENDIF. | TO generated_code_get_entity ##NO_TEXT.
ENDLOOP.
APPEND | WHEN OTHERS. | TO generated_code_get_entity ##NO_TEXT.
APPEND | super->/iwbep/if_mgw_appl_srv_runtime~get_entity( EXPORTING iv_entity_name = iv_entity_name | TO generated_code_get_entity ##NO_TEXT.
APPEND | iv_entity_set_name = iv_entity_set_name | TO generated_code_get_entity ##NO_TEXT.
APPEND | iv_source_name = iv_source_name | TO generated_code_get_entity ##NO_TEXT.
APPEND | it_key_tab = it_key_tab | TO generated_code_get_entity ##NO_TEXT.
APPEND | it_navigation_path = it_navigation_path | TO generated_code_get_entity ##NO_TEXT.
APPEND | io_tech_request_context = io_tech_request_context | TO generated_code_get_entity ##NO_TEXT.
APPEND | IMPORTING er_entity = er_entity | TO generated_code_get_entity ##NO_TEXT.
APPEND | es_response_context = es_response_context ). | TO generated_code_get_entity ##NO_TEXT.
APPEND | ENDCASE. | TO generated_code_get_entity ##NO_TEXT.
APPEND | ENDMETHOD. | TO generated_code_get_entity ##NO_TEXT.
APPEND | WHEN OTHERS. | TO generated_code_get_entityset ##NO_TEXT.
APPEND | super->/iwbep/if_mgw_appl_srv_runtime~get_entityset( EXPORTING iv_entity_name = iv_entity_name | TO generated_code_get_entityset ##NO_TEXT.
APPEND | iv_entity_set_name = iv_entity_set_name | TO generated_code_get_entityset ##NO_TEXT.
APPEND | iv_source_name = iv_source_name | TO generated_code_get_entityset ##NO_TEXT.
APPEND | it_filter_select_options = it_filter_select_options | TO generated_code_get_entityset ##NO_TEXT.
APPEND | it_order = it_order | TO generated_code_get_entityset ##NO_TEXT.
APPEND | is_paging = is_paging | TO generated_code_get_entityset ##NO_TEXT.
APPEND | it_key_tab = it_key_tab | TO generated_code_get_entityset ##NO_TEXT.
APPEND | it_navigation_path = it_navigation_path | TO generated_code_get_entityset ##NO_TEXT.
APPEND | iv_filter_string = iv_filter_string | TO generated_code_get_entityset ##NO_TEXT.
APPEND | iv_search_string = iv_search_string | TO generated_code_get_entityset ##NO_TEXT.
APPEND | io_tech_request_context = io_tech_request_context | TO generated_code_get_entityset ##NO_TEXT.
APPEND | IMPORTING er_entityset = er_entityset | TO generated_code_get_entityset ##NO_TEXT.
APPEND | es_response_context = es_response_context ). | TO generated_code_get_entityset ##NO_TEXT.
APPEND | ENDCASE. | TO generated_code_get_entityset ##NO_TEXT.
APPEND | ENDMETHOD. | TO generated_code_get_entityset ##NO_TEXT.
APPEND LINES OF generated_code_get_entity TO generated_code_implementation.
APPEND LINES OF generated_code_get_entityset TO generated_code_implementation.
ENDMETHOD.
METHOD get_dpc_ext_class_name.
class_name = dpc_ext_class_name.
ENDMETHOD.
METHOD get_mpc_ext_class_name.
class_name = mpc_ext_class_name.
ENDMETHOD.
METHOD get_dpc_class_name.
class_name = dpc_class_name.
ENDMETHOD.
METHOD get_mpc_class_name.
class_name = mpc_class_name.
ENDMETHOD.
METHOD insert_sadl_xml_into_mpc_ext.
DATA(lv_timestamp) = cl_sadl_gw_model_sb_gen_mpc_pr=>get_generation_timestamp( segw_project ).
APPEND | METHODS define REDEFINITION. | TO generated_code_definition ##NO_TEXT.
APPEND | METHODS if_sadl_gw_model_exposure_data~get_model_exposure REDEFINITION. | TO generated_code_definition ##NO_TEXT.
APPEND | METHOD define.| TO generated_code_implementation.
APPEND | super->define( ).| TO generated_code_implementation.
APPEND | ENDMETHOD.| TO generated_code_implementation.
APPEND | METHOD if_sadl_gw_model_exposure_data~get_model_exposure.| TO generated_code_implementation.
APPEND | CONSTANTS: co_gen_timestamp TYPE timestamp VALUE '{ lv_timestamp }'. | TO generated_code_implementation ##NO_TEXT.
APPEND | DATA(lv_sadl_xml) = | TO generated_code_implementation ##NO_TEXT.
* === Large SADL must be split, we split it after 50 rows
SPLIT iv_sadl_xml AT '>' INTO TABLE DATA(lt_string).
DATA(lv_lines) = lines( lt_string ).
LOOP AT lt_string ASSIGNING FIELD-SYMBOL(<s_line>).
<s_line> = | \|{ <s_line> }>\| |.
IF sy-tabix = lv_lines. " Last line
<s_line> = |{ <s_line> }.|.
ELSE.
IF sy-tabix MOD 50 = 0.
<s_line> = |{ <s_line> }.|.
APPEND <s_line> TO generated_code_implementation .
<s_line> = | lv_sadl_xml = \|\{ lv_sadl_xml \}\| &| ##no_text.
ELSE.
<s_line> = |{ <s_line> } &|.
ENDIF.
ENDIF.
APPEND <s_line> TO generated_code_implementation .
ENDLOOP.
APPEND | ro_model_exposure = cl_sadl_gw_model_exposure=>get_exposure_xml( iv_uuid = CONV #( '{ iv_src_segw_project_name }' ) | TO generated_code_implementation ##NO_TEXT.
APPEND | iv_timestamp = co_gen_timestamp | TO generated_code_implementation ##NO_TEXT.
APPEND | iv_sadl_xml = lv_sadl_xml ). | TO generated_code_implementation ##NO_TEXT.
APPEND | ENDMETHOD. | TO generated_code_implementation ##NO_TEXT.
ENDMETHOD.
METHOD get_segw_project_name.
project_name = segw_project_name.
ENDMETHOD.
METHOD get_mpc_type_names.
DATA et_type TYPE seoo_types_r .
DATA result_tab TYPE match_result_tab.
et_type = cl_sadl_gw_gen_api_access=>get_instance( )->seo_type_read_all( VALUE #( clsname = mpc_class_name ) ).
LOOP AT i_cds_view_names INTO DATA(cds_view_name).
LOOP AT et_type INTO DATA(ls_type).
FIND ALL OCCURRENCES OF to_upper( cds_view_name ) IN
ls_type-typesrc
RESULTS result_tab.
IF result_tab IS NOT INITIAL.
LOOP AT result_tab INTO DATA(result).
DATA(cds_view_name_length) = strlen( cds_view_name ).
DATA(character_before) = substring( val = ls_type-typesrc off = result-offset - 1 len = 1 ).
DATA(character_after) = substring( val = ls_type-typesrc off = result-offset + result-length len = 1 ).
IF character_after = '.'.
DATA(entity_type_name) = ls_type-cmpname.
DATA(search_get_entityset_type) = |type standard table of { ls_type-cmpname }|.
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
IF search_get_entityset_type IS NOT INITIAL.
LOOP AT et_type INTO ls_type.
FIND ALL OCCURRENCES OF search_get_entityset_type IN
ls_type-typesrc
RESULTS result_tab.
IF result_tab IS NOT INITIAL.
"out->write( ls_type-cmpname ).
DATA(entityset_type_name) = ls_type-cmpname.
ENDIF.
ENDLOOP.
APPEND VALUE #( cds_view_name = cds_view_name
mpc_get_entity_type_name = entity_type_name
mpc_get_entityset_type_name = entityset_type_name ) TO r_mpc_types_of_cds_views.
ENDIF.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
PARAMETERS: src_proj TYPE /iwbep/i_sbd_ga-project,
ext_proj TYPE /iwbep/i_sbd_ga-project.
DATA filename TYPE string.
DATA path_to_file TYPE string.
DATA path_and_filename TYPE string.
DATA useraction TYPE i.
DATA gui_download_data TYPE TABLE OF string.
DATA generated_dpc_code_definition TYPE rswsourcet .
DATA get_entity_and_set_definition TYPE rswsourcet .
DATA generated_dpc_code_implement TYPE rswsourcet .
DATA generated_types_definition TYPE rswsourcet .
DATA generated_mpc_code_definition TYPE rswsourcet .
DATA generated_mpc_code_implement TYPE rswsourcet .
TRY.
DATA(source_segw_project) = NEW cl_sadl_based_segw_project( src_proj ).
DATA(extended_segw_project) = NEW cl_sadl_based_segw_project( ext_proj ).
TRY.
DATA(sadl_xml_source_project) = source_segw_project->get_sadl_xml( ).
DATA(sadl_xml_extended_project) = extended_segw_project->get_sadl_xml( ).
CATCH /iwbep/cx_sbcm_exception INTO DATA(get_sadl_xml_exception).
WRITE: / |Exception occured: { get_sadl_xml_exception->get_text( ) }|.
EXIT.
ENDTRY.
DATA(merged_sadl_xml) = extended_segw_project->get_merged_sadl_xml(
sadl_xml_source_project = sadl_xml_source_project
sadl_xml_extended_project = sadl_xml_extended_project
).
DATA(new_cds_view_names) = extended_segw_project->get_cds_views_from_sadl_xml( sadl_xml_extended_project ).
LOOP AT new_cds_view_names INTO DATA(new_cds_view_name).
WRITE : / new_cds_view_name.
ENDLOOP.
WRITE : / |extended dpc_ext class name { extended_segw_project->get_dpc_ext_class_name( ) }|.
WRITE : / |extended mpc_ext class name { extended_segw_project->get_mpc_ext_class_name( ) }|.
WRITE : / |extended dpc class name { extended_segw_project->get_dpc_class_name( ) }|.
WRITE : / |extended mpc class name { extended_segw_project->get_mpc_class_name( ) }|.
"generated_dpc_code_definition
APPEND | CLASS { extended_segw_project->get_dpc_ext_class_name( ) } DEFINITION | TO generated_dpc_code_definition ##NO_TEXT.
APPEND | CLASS { extended_segw_project->get_dpc_ext_class_name( ) } IMPLEMENTATION.| TO generated_dpc_code_implement ##NO_TEXT.
APPEND | PUBLIC | TO generated_dpc_code_definition ##NO_TEXT.
APPEND | INHERITING FROM { extended_segw_project->get_dpc_class_name( ) } | TO generated_dpc_code_definition ##NO_TEXT.
APPEND | CREATE PUBLIC . | TO generated_dpc_code_definition ##NO_TEXT.
APPEND | PUBLIC SECTION. | TO generated_dpc_code_definition ##NO_TEXT.
"get timestamp from extended project
extended_segw_project->insert_sadl_xml_into_dpc(
EXPORTING
iv_sadl_xml = merged_sadl_xml
iv_src_segw_project_name = source_segw_project->get_segw_project_name( )
CHANGING
generated_code_definition = generated_dpc_code_definition
generated_code_implementation = generated_dpc_code_implement
).
* CATCH /iwbep/cx_sbcm_exception.
extended_segw_project->create_generic_get_methods(
EXPORTING
cds_view_names = new_cds_view_names
CHANGING
generated_code_definition = generated_dpc_code_definition
generated_code_implementation = generated_dpc_code_implement
).
APPEND | PROTECTED SECTION. | TO generated_dpc_code_definition ##NO_TEXT.
extended_segw_project->create_get_entity_set_methods(
EXPORTING
cds_view_names = new_cds_view_names
CHANGING
generated_types_definition = generated_types_definition
generated_code_definition = get_entity_and_set_definition
"generated_code_definition = generated_dpc_code_definition
generated_code_implementation = generated_dpc_code_implement
).
APPEND LINES OF generated_types_definition TO generated_dpc_code_definition.
APPEND LINES OF get_entity_and_set_definition TO generated_dpc_code_definition.
APPEND | ENDCLASS . | TO generated_dpc_code_definition ##NO_TEXT.
APPEND | ENDCLASS . | TO generated_dpc_code_implement ##NO_TEXT.
APPEND |CLASS { extended_segw_project->get_mpc_ext_class_name( ) } DEFINITION | TO generated_mpc_code_definition ##NO_TEXT.
APPEND |PUBLIC | TO generated_mpc_code_definition ##NO_TEXT.
APPEND |INHERITING FROM { extended_segw_project->get_mpc_class_name( ) } | TO generated_mpc_code_definition ##NO_TEXT.
APPEND |CREATE PUBLIC . | TO generated_mpc_code_definition ##NO_TEXT.
APPEND | PUBLIC SECTION. | TO generated_mpc_code_definition ##NO_TEXT.
APPEND |CLASS { extended_segw_project->get_mpc_ext_class_name( ) } IMPLEMENTATION. | TO generated_mpc_code_implement ##NO_TEXT.
extended_segw_project->insert_sadl_xml_into_mpc_ext(
EXPORTING
iv_sadl_xml = merged_sadl_xml
iv_src_segw_project_name = source_segw_project->get_segw_project_name( )
CHANGING
generated_code_definition = generated_mpc_code_definition
generated_code_implementation = generated_mpc_code_implement
).
APPEND | PROTECTED SECTION. | TO generated_mpc_code_definition ##NO_TEXT.
APPEND | PRIVATE SECTION. | TO generated_mpc_code_definition ##NO_TEXT.
APPEND |ENDCLASS. | TO generated_mpc_code_definition ##NO_TEXT.
APPEND |ENDCLASS. | TO generated_mpc_code_implement ##NO_TEXT.
LOOP AT generated_mpc_code_definition INTO DATA(generated_code_line).
APPEND generated_code_line TO gui_download_data.
ENDLOOP.
LOOP AT generated_mpc_code_implement INTO generated_code_line.
APPEND generated_code_line TO gui_download_data.
ENDLOOP.
APPEND '**************************' TO gui_download_data.
APPEND '* DPC_EXT Code goes here *' TO gui_download_data.
APPEND '**************************' TO gui_download_data.
LOOP AT generated_dpc_code_definition INTO generated_code_line.
APPEND generated_code_line TO gui_download_data.
ENDLOOP.
LOOP AT generated_dpc_code_implement INTO generated_code_line.
APPEND generated_code_line TO gui_download_data.
ENDLOOP.
* Show the file download dialog
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
window_title = | ABAP sourcecode for { ext_proj } |
default_file_name = |{ extended_segw_project->get_segw_project_name( ) }_MPC_EXT_and_DPC_EXT|
default_extension = 'txt'
CHANGING
filename = filename
path = path_to_file
fullpath = path_and_filename
user_action = useraction
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
IF useraction <> cl_gui_frontend_services=>action_ok.
EXIT.
ENDIF.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = filename
CHANGING
data_tab = gui_download_data
EXCEPTIONS
OTHERS = 24.
CATCH cx_root INTO DATA(sadl_merge_exception).
WRITE: / |Exception occured: { sadl_merge_exception->get_text( ) }|.
ENDTRY.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
1976,
1878,
62,
81,
62,
2302,
437,
62,
4372,
82,
62,
3106,
62,
15271,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
198,
9,
5,
10097,
30934,
9,
198,
2200,
15490,
1976,
1878,
62,
81,
62,
2302,
437,
62,
4372,
82,
62,
3106,
62,
15271,
13,
198,
198,
1,
83,
24313,
338,
198,
1,
9122,
8748,
286,
7852,
62,
33,
4090,
62,
50,
2885,
43,
62,
44,
17,
44,
62,
5446,
15037,
21389,
1137,
284,
6121,
262,
311,
2885,
43,
23735,
284,
257,
4645,
290,
7927,
25470,
13,
198,
198,
31631,
537,
62,
82,
324,
75,
62,
3106,
62,
325,
70,
86,
62,
16302,
5550,
20032,
17941,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
40379,
62,
3149,
66,
62,
4906,
62,
1659,
62,
66,
9310,
62,
1177,
11,
198,
220,
220,
220,
220,
220,
220,
220,
269,
9310,
62,
1177,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
285,
14751,
62,
1136,
62,
26858,
62,
4906,
62,
3672,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
285,
14751,
62,
1136,
62,
26858,
2617,
62,
4906,
62,
3672,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
40379,
62,
3149,
66,
62,
4906,
62,
1659,
62,
66,
9310,
62,
1177,
11,
198,
220,
220,
220,
220,
220,
256,
83,
62,
3149,
66,
62,
4906,
62,
1659,
62,
66,
9310,
62,
1177,
41876,
49053,
9795,
43679,
3963,
40379,
62,
3149,
66,
62,
4906,
62,
1659,
62,
66,
9310,
62,
1177,
13315,
38144,
9936,
35374,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
23772,
30023,
9863,
2751,
33245,
62,
325,
70,
86,
62,
16302,
62,
3672,
41876,
220,
1220,
14246,
65,
538,
14,
72,
62,
82,
17457,
62,
4908,
12,
16302,
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,
43213,
62,
17143,
2357,
62,
259,
12102,
11,
198,
220,
220,
220,
220,
220,
651,
62,
82,
324,
75,
62,
19875,
30826,
4261,
15871,
26173,
8924,
7,
82,
324,
75,
62,
19875,
8,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
43213,
62,
82,
324,
75,
62,
70,
86,
62,
3919,
62,
15271,
62,
15042,
11,
198,
220,
220,
220,
220,
220,
651,
62,
647,
2004,
62,
82,
324,
75,
62,
19875,
30023,
9863,
2751,
6507,
75,
62,
19875,
62,
10459,
62,
16302,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6507,
75,
62,
19875,
62,
2302,
1631,
62,
16302,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
82,
324,
75,
62,
19875,
62,
647,
2004,
8,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
651,
62,
67,
14751,
62,
2302,
62,
4871,
62,
3672,
220,
30826,
4261,
15871,
26173,
8924,
7,
4871,
62,
3672,
8,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
651,
62,
3149,
66,
62,
2302,
62,
4871,
62,
3672,
220,
30826,
4261,
15871,
26173,
8924,
7,
4871,
62,
3672,
8,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
651,
62,
67,
14751,
62,
4871,
62,
3672,
220,
30826,
4261,
15871,
26173,
8924,
7,
4871,
62,
3672,
8,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
651,
62,
3149,
66,
62,
4871,
62,
3672,
220,
30826,
4261,
15871,
26173,
8924,
7,
4871,
62,
3672,
8,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
651,
62,
325,
70,
86,
62,
16302,
62,
3672,
220,
30826,
4261,
15871,
26173,
8924,
7,
16302,
62,
3672,
8,
41876,
4731,
13,
198,
220,
220,
220,
366,
24396,
82,
317,
486,
1954,
2231,
3134,
4531,
486,
1954,
2231,
3134,
4531,
486,
1954,
2231,
3134,
4531,
13,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
3149,
66,
62,
4906,
62,
14933,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
66,
9310,
62,
1177,
62,
14933,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
3084,
62,
1659,
62,
37336,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
3149,
66,
62,
19199,
62,
1659,
62,
66,
9310,
62,
33571,
8,
41876,
256,
83,
62,
3149,
66,
62,
4906,
62,
1659,
62,
66,
9310,
62,
1177,
13,
628,
220,
220,
220,
337,
36252,
50,
7550,
62,
82,
324,
75,
62,
19875,
62,
20424,
62,
67,
14751,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
82,
324,
75,
62,
19875,
220,
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,
21628,
62,
10677,
62,
325,
70,
86,
62,
16302,
62,
3672,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
7560,
62,
8189,
62,
46758,
220,
220,
220,
220,
41876,
374,
2032,
82,
454,
66,
316,
198,
220,
220,
220,
220,
220,
220,
220,
7560,
62,
8189,
62,
320,
32851,
41876,
374,
2032,
82,
454,
66,
316,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1220,
14246,
65,
538,
14,
66,
87,
62,
36299,
11215,
62,
1069,
4516,
764,
628,
220,
220,
220,
337,
36252,
50,
7550,
62
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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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
] |
class ZLNKECL_AWS_S3 definition
public
inheriting from ZLNKECL_AWS_INHERIT_SWITCH
create public .
*"* public components of class ZLNKECL_AWS_S3
*"* do not include other source files here!!!
public section.
constants C_SERVICE_NAME type STRING value 's3'. "#EC NOTEXT
type-pools ABAP .
methods CONSTRUCTOR
importing
!I_USER_NAME type ZLNKEUSERNAME_DE optional
!I_CREATE type ABAP_BOOL default ABAP_FALSE
!I_DBG type ABAP_BOOL default ABAP_FALSE
raising
ZLNKECX_AWS_S3 .
methods GET_SERVICE
exporting
!E_HTTP_STATUS type I
!E_RESPONSE_HEADERS type TIHTTPNVP
!E_RESPONSE_CONTENT type STRING
raising
ZLNKECX_AWS_S3 .
class-methods GET_HOST_NAME
returning
value(E_HOST_NAME) type STRING .
protected section.
*"* protected components of class ZLNKECL_AWS_S3
*"* do not include other source files here!!!
private section.
*"* private components of class ZLNKECL_AWS_S3
*"* do not include other source files here!!!
ENDCLASS.
CLASS ZLNKECL_AWS_S3 IMPLEMENTATION.
METHOD constructor.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 9th April 2014
* Object constructor
*--------------------------------------------------------------------*
DATA: l_destination_exists TYPE abap_bool.
DATA: l_region TYPE ZLNKEregion_de.
DATA: l_msg TYPE string. "#EC NEEDED
DATA: l_tabname TYPE tabname.
CALL METHOD super->constructor.
attr_service_name = c_service_name.
* Parameter i_create is true when bucket creation
CHECK i_create = abap_false.
attr_user = i_user_name.
attr_dbg = i_dbg.
* For SaaS credentials are not coming from ZLNKEuser
IF running_as_saas( ) = abap_false.
* Get keys from user
SELECT SINGLE access_key secr_access_key aws_account_id
INTO (attr_access_key, attr_secret_access_key, attr_aws_account_id)
FROM ZLNKEuser
WHERE user_name = i_user_name.
IF sy-subrc <> 0.
* 020 AWS S3 User & not found
MESSAGE i020 WITH i_user_name INTO l_msg.
ZLNKEcx_aws_s3=>raise_from_sy_msg( ).
ENDIF.
ELSE.
* Is SaaS.
* Avoid syntax error in case Stand-alone (table ZLNKEACTIV_CODE is not delivered)
l_tabname = 'ZLNKEACTIV_CODE'.
TRY.
* Get the aws account ID
SELECT SINGLE aws_account_id "#EC *
INTO attr_aws_account_id
FROM (l_tabname).
CATCH cx_sy_dynamic_osql_semantics.
* Should not happen!
* 078 Table & not found
MESSAGE i078 WITH l_tabname INTO l_msg.
ZLNKEcx_aws_s3=>raise_from_sy_msg( ).
ENDTRY.
ENDIF.
* Checks if HTTP to ext destination exists
l_region = c_default_region.
CALL METHOD ZLNKEcl_rfc_connections=>http_dest_to_ext_exists_region
EXPORTING
i_region = l_region
RECEIVING
e_destination_exists = l_destination_exists.
IF l_destination_exists = abap_false.
* HTTP to ext destination does not exist. Create it.
CALL METHOD ZLNKEcl_rfc_connections=>create_http_dest_to_ext_region
EXPORTING
i_region = l_region.
ENDIF.
ENDMETHOD.
METHOD get_host_name.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 17th July 2014
* Returns the hostname for S3
*--------------------------------------------------------------------*
CONCATENATE c_service_name
'.'
c_host_name
INTO e_host_name.
ENDMETHOD.
METHOD get_service.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 15th April 2014
* Executes request to AWS S3 to get service
*--------------------------------------------------------------------*
DATA: l_rfcddest TYPE rfcdest.
DATA: l_request TYPE string.
DATA: l_region TYPE ZLNKEregion_de.
DATA: l_response_xcontent TYPE xstring.
l_region = c_default_region.
l_rfcddest = ZLNKEcl_rfc_connections=>get_httpdest_by_region(
l_region ).
l_request = '/'.
CALL METHOD rest
EXPORTING
i_rfcdest = l_rfcddest
i_region = c_default_region
i_http_method = ZLNKEcl_http=>c_method_get
i_request = l_request
i_body_hash = ZLNKEcl_hash=>c_empty_body_sha256
IMPORTING
e_http_status = e_http_status
e_response_headers = e_response_headers
e_response_xcontent = l_response_xcontent.
CALL METHOD ZLNKEcl_string_conversions=>xstring_to_string
EXPORTING
input = l_response_xcontent
IMPORTING
output = e_response_content.
ENDMETHOD.
ENDCLASS.
| [
4871,
1168,
43,
46888,
2943,
43,
62,
12298,
50,
62,
50,
18,
6770,
198,
220,
1171,
198,
220,
10639,
1780,
422,
1168,
43,
46888,
2943,
43,
62,
12298,
50,
62,
1268,
16879,
2043,
62,
17887,
31949,
198,
220,
2251,
1171,
764,
198,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1168,
43,
46888,
2943,
43,
62,
12298,
50,
62,
50,
18,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
11377,
2665,
13,
628,
220,
38491,
327,
62,
35009,
27389,
62,
20608,
2099,
19269,
2751,
1988,
705,
82,
18,
4458,
25113,
2943,
5626,
13918,
628,
220,
2099,
12,
7742,
82,
9564,
2969,
764,
198,
220,
5050,
7102,
46126,
1581,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
29904,
62,
20608,
2099,
1168,
43,
45,
7336,
29904,
20608,
62,
7206,
11902,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
43387,
6158,
2099,
9564,
2969,
62,
8202,
3535,
4277,
9564,
2969,
62,
37,
23719,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
11012,
38,
2099,
9564,
2969,
62,
8202,
3535,
4277,
9564,
2969,
62,
37,
23719,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
1168,
43,
46888,
2943,
55,
62,
12298,
50,
62,
50,
18,
764,
198,
220,
5050,
17151,
62,
35009,
27389,
198,
220,
220,
220,
39133,
198,
220,
220,
220,
220,
220,
5145,
36,
62,
40717,
62,
35744,
2937,
2099,
314,
198,
220,
220,
220,
220,
220,
5145,
36,
62,
19535,
47,
1340,
5188,
62,
37682,
4877,
2099,
31598,
40717,
45,
8859,
198,
220,
220,
220,
220,
220,
5145,
36,
62,
19535,
47,
1340,
5188,
62,
37815,
3525,
2099,
19269,
2751,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
1168,
43,
46888,
2943,
55,
62,
12298,
50,
62,
50,
18,
764,
198,
220,
1398,
12,
24396,
82,
17151,
62,
39,
10892,
62,
20608,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
36,
62,
39,
10892,
62,
20608,
8,
2099,
19269,
2751,
764,
198,
24326,
2665,
13,
198,
9,
1,
9,
6861,
6805,
286,
1398,
1168,
43,
46888,
2943,
43,
62,
12298,
50,
62,
50,
18,
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,
43,
46888,
2943,
43,
62,
12298,
50,
62,
50,
18,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
43,
46888,
2943,
43,
62,
12298,
50,
62,
50,
18,
30023,
2538,
10979,
6234,
13,
628,
198,
49273,
23772,
13,
198,
9,
10097,
650,
9,
198,
9,
5834,
25,
16920,
19109,
198,
9,
6434,
25,
38317,
72,
16319,
11329,
11,
860,
400,
3035,
1946,
198,
9,
9515,
23772,
198,
9,
10097,
650,
9,
198,
220,
42865,
25,
300,
62,
16520,
1883,
62,
1069,
1023,
41876,
450,
499,
62,
30388,
13,
198,
220,
42865,
25,
300,
62,
36996,
41876,
1168,
43,
45,
7336,
36996,
62,
2934,
13,
198,
220,
42865,
25,
300,
62,
19662,
41876,
4731,
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,
25113,
2943,
36465,
1961,
198,
220,
42865,
25,
300,
62,
8658,
3672,
41876,
7400,
3672,
13,
628,
220,
42815,
337,
36252,
2208,
3784,
41571,
273,
13,
628,
220,
708,
81,
62,
15271,
62,
3672,
796,
269,
62,
15271,
62,
3672,
13,
198,
198,
9,
25139,
2357,
1312,
62,
17953,
318,
2081,
618,
19236,
6282,
198,
220,
5870,
25171,
1312,
62,
17953,
796,
450,
499,
62,
9562,
13,
628,
220,
708,
81,
62,
7220,
796,
1312,
62,
7220,
62,
3672,
13,
198,
220,
708,
81,
62,
9945,
70,
796,
1312,
62,
9945,
70,
13,
198,
198,
9,
1114,
311,
7252,
50,
18031,
389,
407,
2406,
422,
1168,
43,
45,
7336,
7220,
198,
220,
16876,
2491,
62,
292,
62,
11400,
292,
7,
1267,
796,
450,
499,
62,
9562,
13,
198,
9,
220,
220,
3497,
8251,
422,
2836,
198,
220,
220,
220,
33493,
311,
2751,
2538,
1895,
62,
2539,
792,
81,
62,
15526,
62,
2539,
3253,
82,
62,
23317,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
39319,
357,
35226,
62,
15526,
62,
2539,
11,
708,
81,
62,
21078,
62,
15526,
62,
2539,
11,
708,
81,
62,
8356,
62,
23317,
62,
312,
8,
198,
220,
220,
220,
16034,
1168,
43,
45,
7336,
7220,
198,
220,
220,
220,
33411,
2836,
62,
3672,
796,
1312,
62,
7220,
62,
3672,
13,
628,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
9,
220,
220,
220,
220,
657,
1238,
197,
12298,
50,
311,
18,
11787,
1222,
407,
1043,
198,
220,
220,
220,
220,
220,
337,
1546,
4090,
8264,
1312,
33618,
13315,
1312,
62,
7220,
62,
3672,
39319,
300,
62,
19662,
13,
198,
220,
220,
220,
220,
220,
1168,
43,
45,
7336,
66,
87,
62,
8356,
62,
82,
18,
14804,
40225,
62,
6738,
62,
1837,
62,
19662,
7,
6739,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
17852,
5188,
13,
198,
9,
220,
220,
1148,
311,
7252,
50,
13,
198,
9,
220,
220,
24390,
15582,
4049,
287,
1339,
5751,
12,
17749,
357,
11487,
1168,
43,
45,
7336,
10659,
3824,
62,
34,
16820,
318,
407,
6793,
8,
198,
220,
220,
220,
300,
62,
8658,
3672,
796,
705,
57,
43,
45,
7336,
10659,
3824,
62,
34,
16820,
4458,
198,
220,
220,
220,
7579,
56,
13,
198,
9,
220,
220,
220,
220,
220,
220,
3497,
262,
3253,
82,
1848,
4522,
198,
220,
220,
220,
220,
220,
220,
220,
33493,
311,
2751,
2538,
3253,
82,
62,
23317,
62,
312,
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,
1635,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
39319,
708,
81,
62,
8356,
62,
23317,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16034,
357,
75,
62,
8658,
3672,
737,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
1837
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_aoc_check_29 DEFINITION
PUBLIC
INHERITING FROM zcl_aoc_super
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor .
METHODS check
REDEFINITION .
METHODS get_attributes
REDEFINITION .
METHODS if_ci_test~query_attributes
REDEFINITION .
METHODS put_attributes
REDEFINITION .
PROTECTED SECTION.
PRIVATE SECTION.
DATA mv_name TYPE seoclsname.
ENDCLASS.
CLASS ZCL_AOC_CHECK_29 IMPLEMENTATION.
METHOD check.
* abapOpenChecks
* https://github.com/larshp/abapOpenChecks
* MIT License
DATA: lv_name TYPE string,
lv_str TYPE string,
lv_level TYPE stmnt_levl.
FIELD-SYMBOLS: <ls_level> LIKE LINE OF io_scan->levels,
<ls_statement> LIKE LINE OF io_scan->statements,
<ls_token> LIKE LINE OF io_scan->tokens.
LOOP AT io_scan->levels ASSIGNING <ls_level> WHERE type = io_scan->gc_level-program.
lv_level = sy-tabix.
LOOP AT io_scan->statements ASSIGNING <ls_statement>
WHERE type <> io_scan->gc_statement-comment
AND type <> io_scan->gc_statement-comment_in_stmnt
AND level = lv_level.
READ TABLE io_scan->tokens ASSIGNING <ls_token> INDEX <ls_statement>-from.
IF sy-subrc <> 0 OR <ls_token>-str <> 'CLASS'.
CONTINUE.
ENDIF.
READ TABLE io_scan->tokens ASSIGNING <ls_token> INDEX <ls_statement>-from + 1.
ASSERT sy-subrc = 0.
lv_name = <ls_token>-str.
TRANSLATE lv_name TO UPPER CASE.
CLEAR lv_str.
LOOP AT io_scan->tokens ASSIGNING <ls_token>
FROM <ls_statement>-from + 2
TO <ls_statement>-to.
IF lv_str IS INITIAL.
lv_str = <ls_token>-str.
ELSE.
CONCATENATE lv_str <ls_token>-str INTO lv_str SEPARATED BY space.
ENDIF.
ENDLOOP.
IF NOT lv_str CP '*FOR TESTING*'.
CONTINUE.
ENDIF.
IF object_type = 'CLAS'
AND strlen( <ls_level>-name ) = 32
AND <ls_level>-name+30(2) = 'CU'.
CONTINUE.
ENDIF.
IF NOT lv_name CP mv_name.
inform( p_sub_obj_name = <ls_level>-name
p_line = <ls_token>-row
p_kind = mv_errty
p_test = myname
p_code = '001' ).
ENDIF.
ENDLOOP.
ENDLOOP.
ENDMETHOD.
METHOD constructor.
super->constructor( ).
version = '001'.
position = '029'.
has_attributes = abap_true.
attributes_ok = abap_true.
enable_rfc( ).
mv_name = 'LTCL_+*'.
insert_scimessage(
iv_code = '001'
iv_text = 'Naming, Local test classes'(m01) ).
ENDMETHOD.
METHOD get_attributes.
EXPORT
mv_errty = mv_errty
mv_name = mv_name
TO DATA BUFFER p_attributes.
ENDMETHOD.
METHOD if_ci_test~query_attributes.
zzaoc_top.
zzaoc_fill_att mv_errty 'Error Type' ''. "#EC NOTEXT
zzaoc_fill_att mv_name 'Name' ''. "#EC NOTEXT
zzaoc_popup.
ENDMETHOD.
METHOD put_attributes.
IMPORT
mv_errty = mv_errty
mv_name = mv_name
FROM DATA BUFFER p_attributes. "#EC CI_USE_WANTED
ASSERT sy-subrc = 0.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
64,
420,
62,
9122,
62,
1959,
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,
611,
62,
979,
62,
9288,
93,
22766,
62,
1078,
7657,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
220,
220,
337,
36252,
50,
1234,
62,
1078,
7657,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
42865,
285,
85,
62,
3672,
41876,
384,
420,
7278,
3672,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
32,
4503,
62,
50084,
62,
1959,
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,
85,
62,
3672,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
2536,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
5715,
41876,
336,
76,
429,
62,
2768,
75,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
5715,
29,
220,
220,
220,
220,
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,
7278,
62,
26090,
29,
34178,
48920,
3963,
33245,
62,
35836,
3784,
14269,
3196,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7278,
62,
30001,
29,
220,
220,
220,
220,
34178,
48920,
3963,
33245,
62,
35836,
3784,
83,
482,
641,
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,
85,
62,
5715,
796,
827,
12,
8658,
844,
13,
628,
220,
220,
220,
220,
220,
17579,
3185,
5161,
33245,
62,
35836,
3784,
14269,
3196,
24994,
3528,
15871,
1279,
7278,
62,
26090,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33411,
2099,
1279,
29,
33245,
62,
35836,
3784,
36484,
62,
26090,
12,
23893,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
2099,
1279,
29,
33245,
62,
35836,
3784,
36484,
62,
26090,
12,
23893,
62,
259,
62,
301,
76,
429,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
1241,
796,
300,
85,
62,
5715,
13,
628,
220,
220,
220,
220,
220,
220,
220,
20832,
43679,
33245,
62,
35836,
3784,
83,
482,
641,
24994,
3528,
15871,
1279,
7278,
62,
30001,
29,
24413,
6369,
1279,
7278,
62,
26090,
29,
12,
6738,
13,
198,
220,
220,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
6375,
1279,
7278,
62,
30001,
29,
12,
2536,
1279,
29,
705,
31631,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43659,
8924,
13,
198,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
220,
220,
220,
220,
20832,
43679,
33245,
62,
35836,
3784,
83,
482,
641,
24994,
3528,
15871,
1279,
7278,
62,
30001,
29,
24413,
6369,
1279,
7278,
62,
26090,
29,
12,
6738,
1343,
352,
13,
198,
220,
220,
220,
220,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
3672,
796,
1279,
7278,
62,
30001,
29,
12,
2536,
13,
198,
220,
220,
220,
220,
220,
220,
220,
48213,
8634,
6158,
300,
85,
62,
3672,
5390,
471,
10246,
1137,
42001,
13,
628,
220,
220,
220,
220,
220,
220,
220,
30301,
1503,
300,
85,
62,
2536,
13,
198,
220,
220,
220,
220,
220,
220,
220,
17579,
3185,
5161,
33245,
62,
35836,
3784,
83,
482,
641,
24994,
3528,
15871,
1279,
7278,
62,
30001,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16034,
1279,
7278,
62,
26090,
29,
12,
6738,
1343,
362,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5390,
1279,
7278,
62,
26090,
29,
12,
1462,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16876,
300,
85,
62,
2536,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
2536,
796,
1279,
7278,
62,
30001,
29,
12,
2536,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
39962,
1404,
1677,
6158,
300,
85,
62,
2536,
1279,
7278,
62,
30001,
29,
12,
2536,
39319,
300,
85,
62,
2536,
7946,
27082,
11617,
11050,
2272,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
220,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16876,
5626,
300,
85,
62,
2536,
16932,
705,
9,
13775,
43001,
2751,
9,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43659,
8924,
13,
198,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16876,
2134,
62,
4906,
796,
705,
5097,
1921,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5357,
965,
11925,
7,
1279,
7278,
62,
5715,
29,
12,
3672,
1267,
796,
3933,
198,
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,
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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 ZCL_GTT_STS_SEND_DELETION_IDOC definition
public
final
create private .
public section.
class-methods GET_INSTANCE
importing
!IT_TOR_ROOT type /SCMTMS/T_EM_BO_TOR_ROOT
returning
value(RO_UPDATER) type ref to ZCL_GTT_STS_SEND_DELETION_IDOC
raising
CX_UDM_MESSAGE .
methods PREPARE_IDOC_DATA
importing
!IT_TOR_ROOT type /SCMTMS/T_EM_BO_TOR_ROOT
raising
CX_UDM_MESSAGE .
methods SEND_IDOC_DATA
raising
CX_UDM_MESSAGE .
PROTECTED SECTION.
private section.
types:
BEGIN OF ts_aotype,
tor_type TYPE /scmtms/tor_type,
aot_type TYPE /saptrx/aotype,
server_name TYPE /saptrx/trxservername,
END OF ts_aotype .
types:
tt_aotype TYPE STANDARD TABLE OF ts_aotype WITH EMPTY KEY .
types:
tt_trxas_appobj_ctab TYPE STANDARD TABLE OF trxas_appobj_ctab_wa
WITH EMPTY KEY .
types:
BEGIN OF ts_idoc_data,
trxserv TYPE /saptrx/trxserv,
appsys TYPE logsys,
appobj_dtabs TYPE tt_trxas_appobj_ctab,
END OF ts_idoc_data .
types:
tt_idoc_data TYPE STANDARD TABLE OF ts_idoc_data WITH EMPTY KEY .
constants CV_IDOC_TYPE_EHPOST01 type EDI_IDOCTP value 'AOPOST' ##NO_TEXT.
constants CV_MSG_TYPE_AOPOST type EDI_MESTYP value 'AOPOST' ##NO_TEXT.
constants CV_PARTNER_TYPE type EDI_RCVPRT value 'LS' ##NO_TEXT.
constants CV_SEG_E1EHPAO type EDILSEGTYP value 'E1EHPAO' ##NO_TEXT.
constants CV_SEG_E1EHPTID type EDILSEGTYP value 'E1EHPTID' ##NO_TEXT.
constants CV_STRUCTURE_PKG type DEVCLASS value '/SAPTRX/SCEM_AI_R3' ##NO_TEXT.
constants:
BEGIN OF cs_obj_type,
tms_tor TYPE /saptrx/trk_obj_type VALUE 'TMS_TOR',
END OF cs_obj_type .
constants:
BEGIN OF cs_change_mode,
insert TYPE updkz_d VALUE 'I',
update TYPE updkz_d VALUE 'U',
delete TYPE updkz_d VALUE 'D',
undefined TYPE updkz_d VALUE 'T',
END OF cs_change_mode .
data MV_APPSYS type LOGSYS .
data MT_AOTYPE type TT_AOTYPE .
data MT_IDOC_DATA type TT_IDOC_DATA .
data MV_TZONE type TIMEZONE ##NEEDED.
methods SEND_IDOC_EHPOST01
importing
!IV_APPSYS type LOGSYS
!IS_TRXSERV type /SAPTRX/TRXSERV
!IT_APPOBJ_DTABS type TRXAS_APPOBJ_CTABS .
methods FILL_IDOC_APPOBJ_DTABS
importing
!IS_AOTYPE type TS_AOTYPE
!IS_TOR_ROOT type /SCMTMS/S_EM_BO_TOR_ROOT
changing
!CS_IDOC_DATA type TS_IDOC_DATA .
methods FILL_IDOC_TRXSERV
importing
!IS_AOTYPE type TS_AOTYPE
changing
!CS_IDOC_DATA type TS_IDOC_DATA .
methods INITIATE
importing
!IT_TOR_ROOT type /SCMTMS/T_EM_BO_TOR_ROOT
raising
CX_UDM_MESSAGE .
class-methods IS_GTT_ENABLED
returning
value(RV_RESULT) type ABAP_BOOL .
class-methods IS_EXTRACTOR_EXIST
importing
!IV_TRK_OBJ_TYPE type CLIKE
returning
value(RV_RESULT) type ABAP_BOOL .
class-methods THROW_EXCEPTION
importing
!IV_TEXTID type SOTR_CONC default ''
raising
CX_UDM_MESSAGE .
ENDCLASS.
CLASS ZCL_GTT_STS_SEND_DELETION_IDOC IMPLEMENTATION.
METHOD fill_idoc_appobj_dtabs.
cs_idoc_data-appobj_dtabs = VALUE #( BASE cs_idoc_data-appobj_dtabs (
trxservername = cs_idoc_data-trxserv-trx_server_id
appobjtype = is_aotype-aot_type
appobjid = is_tor_root-tor_id
update_indicator = cs_change_mode-delete ) ).
ENDMETHOD.
METHOD fill_idoc_trxserv.
SELECT SINGLE /saptrx/trxserv~trx_server_id
/saptrx/trxserv~trx_server
INTO ( cs_idoc_data-trxserv-trx_server_id,
cs_idoc_data-trxserv-trx_server )
FROM /saptrx/trxserv
WHERE trx_server_id = is_aotype-server_name.
ENDMETHOD.
METHOD get_instance.
IF is_gtt_enabled( ) = abap_true.
ro_updater = NEW #( ).
ro_updater->initiate( it_tor_root ).
ELSE.
MESSAGE e006(zgtt_sts) INTO DATA(lv_dummy) ##needed.
throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD initiate.
CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
IMPORTING
own_logical_system = mv_appsys
EXCEPTIONS
own_logical_system_not_defined = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e007(zgtt_sts) INTO DATA(lv_dummy) ##needed.
throw_exception( ).
ENDIF.
CALL FUNCTION 'GET_SYSTEM_TIMEZONE'
IMPORTING
timezone = mv_tzone
EXCEPTIONS
customizing_missing = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e003(zgtt_sts) INTO lv_dummy.
throw_exception( ).
ENDIF.
SELECT /scmtms/c_torty~type AS tor_type,
/scmtms/c_torty~aotype AS aot_type,
/saptrx/aotypes~trxservername AS server_name
INTO TABLE @mt_aotype
FROM /scmtms/c_torty
JOIN /saptrx/aotypes ON /scmtms/c_torty~aotype = /saptrx/aotypes~aotype
FOR ALL ENTRIES IN @it_tor_root
WHERE /scmtms/c_torty~type = @it_tor_root-tor_type AND
/saptrx/aotypes~trk_obj_type = @cs_obj_type-tms_tor AND
/saptrx/aotypes~torelevant = @abap_true. "#EC CI_BUFFJOIN
IF sy-subrc <> 0.
MESSAGE e008(zgtt_sts) INTO lv_dummy.
throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD is_extractor_exist.
DATA: lv_count TYPE i VALUE 0.
SELECT COUNT(*)
INTO lv_count
FROM /saptrx/aotypes
WHERE trk_obj_type = iv_trk_obj_type
AND torelevant = abap_true. "#EC CI_BYPASS
rv_result = boolc( lv_count > 0 ).
ENDMETHOD.
METHOD is_gtt_enabled.
DATA lv_extflag TYPE flag.
rv_result = abap_false.
" Check package dependent BADI disabling
CALL FUNCTION 'GET_R3_EXTENSION_SWITCH'
EXPORTING
i_structure_package = cv_structure_pkg
IMPORTING
e_active = lv_extflag
EXCEPTIONS
not_existing = 1
object_not_existing = 2
no_extension_object = 3
OTHERS = 4.
IF sy-subrc = 0 AND lv_extflag = abap_true.
" Check if any tracking server defined
CALL FUNCTION '/SAPTRX/EVENT_MGR_CHECK'
EXCEPTIONS
no_event_mgr_available = 1
OTHERS = 2.
"Check whether at least 1 active extractor exists for every object
IF sy-subrc = 0.
rv_result = is_extractor_exist( iv_trk_obj_type = cs_obj_type-tms_tor ).
ENDIF.
ENDIF.
ENDMETHOD.
METHOD prepare_idoc_data.
DATA ls_idoc_data TYPE ts_idoc_data.
LOOP AT it_tor_root ASSIGNING FIELD-SYMBOL(<ls_tor_root>).
CLEAR: ls_idoc_data.
ls_idoc_data-appsys = mv_appsys.
ASSIGN mt_aotype[ tor_type = <ls_tor_root>-tor_type ] TO FIELD-SYMBOL(<ls_aotype>).
fill_idoc_trxserv(
EXPORTING
is_aotype = <ls_aotype>
CHANGING
cs_idoc_data = ls_idoc_data ).
fill_idoc_appobj_dtabs(
EXPORTING
is_aotype = <ls_aotype>
is_tor_root = <ls_tor_root>
CHANGING
cs_idoc_data = ls_idoc_data ).
IF ls_idoc_data-appobj_dtabs[] IS NOT INITIAL.
APPEND ls_idoc_data TO mt_idoc_data.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD send_idoc_data.
LOOP AT mt_idoc_data ASSIGNING FIELD-SYMBOL(<ls_idoc_data>).
send_idoc_ehpost01(
iv_appsys = <ls_idoc_data>-appsys
is_trxserv = <ls_idoc_data>-trxserv
it_appobj_dtabs = <ls_idoc_data>-appobj_dtabs ).
ENDLOOP.
ENDMETHOD.
METHOD send_idoc_ehpost01.
DATA:
ls_e1ehpao TYPE e1ehpao,
ls_e1ehptid TYPE e1ehptid,
ls_master_idoc_control TYPE edidc,
lt_master_idoc_data TYPE edidd_tt,
ls_master_idoc_data TYPE edidd,
lt_communication_idoc_control TYPE edidc_tt,
lr_appobj_dtabs TYPE REF TO trxas_appobj_ctab_wa.
ls_master_idoc_control-rcvprt = cv_partner_type.
ls_master_idoc_control-rcvprn = is_trxserv-trx_server.
ls_master_idoc_control-mestyp = cv_msg_type_aopost.
ls_master_idoc_control-idoctp = cv_idoc_type_ehpost01.
LOOP AT it_appobj_dtabs REFERENCE INTO lr_appobj_dtabs WHERE trxservername = is_trxserv-trx_server_id.
CLEAR ls_e1ehpao.
ls_master_idoc_data-mandt = sy-mandt.
ls_master_idoc_data-segnam = cv_seg_e1ehpao.
ls_e1ehpao-appsys = iv_appsys.
ls_e1ehpao-appobjtype = lr_appobj_dtabs->appobjtype.
ls_e1ehpao-appobjid = lr_appobj_dtabs->appobjid.
ls_e1ehpao-update_indicator = lr_appobj_dtabs->update_indicator.
ls_master_idoc_data-sdata = ls_e1ehpao.
INSERT ls_master_idoc_data INTO TABLE lt_master_idoc_data.
" Dummy entry for TID is needed, since this is mandatory segment in the IDOC
CLEAR ls_e1ehptid.
ls_master_idoc_data-segnam = cv_seg_e1ehptid.
ls_master_idoc_data-sdata = ls_e1ehptid.
INSERT ls_master_idoc_data INTO TABLE lt_master_idoc_data.
ENDLOOP.
IF lt_master_idoc_data IS INITIAL.
RETURN.
ENDIF.
CALL FUNCTION 'MASTER_IDOC_DISTRIBUTE'
EXPORTING
master_idoc_control = ls_master_idoc_control
TABLES
communication_idoc_control = lt_communication_idoc_control
master_idoc_data = lt_master_idoc_data.
ENDMETHOD.
METHOD throw_exception.
RAISE EXCEPTION TYPE cx_udm_message
EXPORTING
textid = iv_textid
m_msgid = sy-msgid
m_msgty = sy-msgty
m_msgno = sy-msgno
m_msgv1 = sy-msgv1
m_msgv2 = sy-msgv2
m_msgv3 = sy-msgv3
m_msgv4 = sy-msgv4.
ENDMETHOD.
ENDCLASS.
| [
4871,
1168,
5097,
62,
38,
15751,
62,
2257,
50,
62,
50,
10619,
62,
7206,
2538,
24131,
62,
2389,
4503,
6770,
198,
220,
1171,
198,
220,
2457,
198,
220,
2251,
2839,
764,
198,
198,
11377,
2665,
13,
628,
220,
1398,
12,
24396,
82,
17151,
62,
38604,
19240,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
2043,
62,
32961,
62,
13252,
2394,
2099,
1220,
6173,
13752,
5653,
14,
51,
62,
3620,
62,
8202,
62,
32961,
62,
13252,
2394,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
13252,
62,
52,
5760,
23261,
8,
2099,
1006,
284,
1168,
5097,
62,
38,
15751,
62,
2257,
50,
62,
50,
10619,
62,
7206,
2538,
24131,
62,
2389,
4503,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
327,
55,
62,
8322,
44,
62,
44,
1546,
4090,
8264,
764,
198,
220,
5050,
22814,
47,
12203,
62,
2389,
4503,
62,
26947,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
2043,
62,
32961,
62,
13252,
2394,
2099,
1220,
6173,
13752,
5653,
14,
51,
62,
3620,
62,
8202,
62,
32961,
62,
13252,
2394,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
327,
55,
62,
8322,
44,
62,
44,
1546,
4090,
8264,
764,
198,
220,
5050,
311,
10619,
62,
2389,
4503,
62,
26947,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
327,
55,
62,
8322,
44,
62,
44,
1546,
4090,
8264,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
19734,
2665,
13,
628,
220,
3858,
25,
198,
220,
220,
220,
347,
43312,
3963,
40379,
62,
64,
8690,
11,
198,
220,
220,
220,
220,
220,
7332,
62,
4906,
220,
220,
220,
41876,
1220,
1416,
16762,
907,
14,
13165,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
257,
313,
62,
4906,
220,
220,
220,
41876,
1220,
82,
2373,
40914,
14,
64,
8690,
11,
198,
220,
220,
220,
220,
220,
4382,
62,
3672,
41876,
1220,
82,
2373,
40914,
14,
2213,
87,
2655,
933,
480,
11,
198,
220,
220,
220,
23578,
3963,
40379,
62,
64,
8690,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
256,
83,
62,
64,
8690,
41876,
49053,
9795,
43679,
3963,
40379,
62,
64,
8690,
13315,
38144,
9936,
35374,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
256,
83,
62,
2213,
87,
292,
62,
1324,
26801,
62,
310,
397,
41876,
49053,
9795,
43679,
3963,
491,
87,
292,
62,
1324,
26801,
62,
310,
397,
62,
10247,
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,
13315,
38144,
9936,
35374,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
347,
43312,
3963,
40379,
62,
312,
420,
62,
7890,
11,
198,
220,
220,
220,
220,
220,
491,
87,
3168,
220,
220,
220,
220,
220,
41876,
1220,
82,
2373,
40914,
14,
2213,
87,
3168,
11,
198,
220,
220,
220,
220,
220,
6725,
893,
220,
220,
220,
220,
220,
220,
41876,
17259,
893,
11,
198,
220,
220,
220,
220,
220,
598,
26801,
62,
67,
8658,
82,
41876,
256,
83,
62,
2213,
87,
292,
62,
1324,
26801,
62,
310,
397,
11,
198,
220,
220,
220,
23578,
3963,
40379,
62,
312,
420,
62,
7890,
764,
198,
220,
3858,
25,
198,
220,
220,
220,
256,
83,
62,
312,
420,
62,
7890,
41876,
49053,
9795,
43679,
3963,
40379,
62,
312,
420,
62,
7890,
220,
13315,
38144,
9936,
35374,
764,
628,
220,
38491,
26196,
62,
2389,
4503,
62,
25216,
62,
36,
14082,
10892,
486,
2099,
8392,
40,
62,
2389,
46,
4177,
47,
1988,
705,
32,
3185,
10892,
6,
22492,
15285,
62,
32541,
13,
198,
220,
38491,
26196,
62,
5653,
38,
62,
25216,
62,
32,
3185,
10892,
2099,
8392,
40,
62,
44,
6465,
48232,
1988,
705,
32,
3185,
10892,
6,
22492,
15285,
62,
32541,
13,
198,
220,
38491,
26196,
62,
30709,
21479,
62,
25216,
2099,
8392,
40,
62,
7397,
53,
4805,
51,
1988,
705,
6561,
6,
22492,
15285,
62,
32541,
13,
198,
220,
38491,
26196,
62,
5188,
38,
62,
36,
16,
42413,
4537,
46,
2099,
8392,
4146,
5188,
38,
9936,
47,
1988,
705,
36,
16,
42413,
4537,
46,
6,
22492,
15285,
62,
32541,
13,
198,
220,
38491,
26196,
62,
5188,
38,
62,
36,
16,
42413,
11571,
2389,
2099,
8392,
4146,
5188,
38,
9936,
47,
1988,
705,
36,
16,
42413,
11571,
2389,
6,
22492,
15285,
62,
32541,
13,
198,
220,
38491,
26196,
62,
46126,
11335,
62,
40492,
38,
2099,
5550,
53,
31631,
1988,
31051,
50,
2969,
5446,
55,
14,
6173,
3620,
62,
20185,
62,
49,
18,
6,
22492,
15285,
62,
32541,
13,
198,
220,
38491,
25,
198,
220,
220,
220,
347,
43312,
3963,
50115,
62,
26801,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
256,
907,
62,
13165,
41876,
1220,
82,
2373,
40914,
14,
2213,
74,
62,
26801,
62,
4906,
26173,
8924,
705,
51,
5653,
62,
32961,
3256,
198,
220,
220,
220,
23578,
3963,
50115,
62,
26801,
62,
4906,
764,
198,
220,
38491,
25,
198,
220,
220,
220,
347,
43312,
3963,
50115,
62,
3803,
62,
14171,
11,
198,
220,
220,
220,
220,
220,
7550,
220,
220,
220,
41876,
2325,
74,
89,
62,
67,
26173,
8924,
705,
40,
3256,
198,
220,
220,
220,
220,
220,
4296,
220,
220,
220,
41876,
2325,
74,
89,
62,
67,
26173,
8924,
705,
52,
3256,
198,
220,
220,
220,
220,
220,
12233,
220,
220,
220,
41876,
2325,
74,
89,
62,
67,
26173,
8924,
705,
35,
3256,
198,
220,
220,
220,
220,
220,
28721,
41876,
2325,
74,
89,
62,
67,
26173,
8924,
705,
51,
3256,
198,
220,
220,
220,
23578,
3963,
50115,
62,
3803,
62,
14171,
764,
198,
220,
1366,
32947,
62,
2969,
3705,
16309,
2099,
41605,
50,
16309,
764,
198,
220,
1366,
19308,
62,
32,
2394,
56,
11401,
2099,
26653,
62,
32,
2394,
56,
11401,
764,
198,
220,
1366,
19308,
62,
2389,
4503,
62,
26947,
2099,
26653,
62,
2389,
4503,
62,
26947,
764,
198,
220,
1366,
32947,
62,
51,
57,
11651,
2099,
20460,
57,
11651,
220,
22492,
12161,
1961,
1961,
13,
628,
220,
5050,
311,
10619,
62,
2389,
4503,
62,
36,
14082,
10892,
486,
198,
220,
220,
220,
33332,
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,
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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
] |
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.
TYPES: BEGIN OF ty_tabl_extras,
tddat TYPE tddat,
END OF ty_tabl_extras.
"! get additional data like table authorization group
"! @parameter iv_tabname | name of the table
METHODS read_extras IMPORTING iv_tabname TYPE ddobjname
RETURNING VALUE(rs_tabl_extras) TYPE ty_tabl_extras.
"! Update additional data
"! @parameter iv_tabname | name of the table
"! @parameter is_tabl_extras | additional table data
METHODS update_extras IMPORTING iv_tabname TYPE ddobjname
is_tabl_extras TYPE ty_tabl_extras.
"! Delete additional data
"! @parameter iv_tabname | name of the table
METHODS delete_extras IMPORTING iv_tabname TYPE ddobjname.
"! Serialize IDoc Segment type/definition if exits
"! @parameter io_xml | XML writer
"! @raising zcx_abapgit_exception | Exceptions
METHODS serialize_idoc_segment IMPORTING io_xml TYPE REF TO zif_abapgit_xml_output
RAISING zcx_abapgit_exception.
"! Deserialize IDoc Segment type/definition if exits
"! @parameter io_xml | XML writer
"! @parameter iv_package | Target package
"! @parameter rv_deserialized | It's a segment and was desserialized
"! @raising zcx_abapgit_exception | Exceptions
METHODS deserialize_idoc_segment IMPORTING io_xml TYPE REF TO zif_abapgit_xml_input
iv_package TYPE devclass
RETURNING VALUE(rv_deserialized) TYPE abap_bool
RAISING zcx_abapgit_exception.
"! Delete the IDoc Segment type if exists
"! @parameter rv_deleted | It's a segment and was deleted
"! @raising zcx_abapgit_exception | Exceptions
METHODS delete_idoc_segment RETURNING VALUE(rv_deleted) TYPE abap_bool
RAISING zcx_abapgit_exception.
PRIVATE SECTION.
TYPES:
ty_dd03p_tt TYPE STANDARD TABLE OF dd03p .
TYPES:
BEGIN OF ty_dd02_texts,
ddlanguage TYPE dd02t-ddlanguage,
ddtext TYPE dd02t-ddtext,
END OF ty_dd02_texts,
tt_dd02_texts TYPE STANDARD TABLE OF ty_dd02_texts.
CONSTANTS c_longtext_id_tabl TYPE dokil-id VALUE 'TB' ##NO_TEXT.
CONSTANTS:
BEGIN OF c_s_dataname,
segment_definition TYPE string VALUE 'SEGMENT_DEFINITION',
tabl_extras TYPE string VALUE 'TABL_EXTRAS',
END OF c_s_dataname.
METHODS clear_dd03p_fields
CHANGING
!ct_dd03p TYPE ty_dd03p_tt .
"! Check if structure is an IDoc segment
"! @parameter rv_is_idoc_segment | It's an IDoc segment or not
METHODS is_idoc_segment
RETURNING
VALUE(rv_is_idoc_segment) TYPE abap_bool.
METHODS clear_dd03p_fields_common
CHANGING
!cs_dd03p TYPE dd03p .
METHODS clear_dd03p_fields_dataelement
CHANGING
!cs_dd03p TYPE dd03p .
METHODS:
serialize_texts
IMPORTING io_xml TYPE REF TO zif_abapgit_xml_output
RAISING zcx_abapgit_exception,
deserialize_texts
IMPORTING io_xml TYPE REF TO zif_abapgit_xml_input
is_dd02v TYPE dd02v
RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS zcl_abapgit_object_tabl IMPLEMENTATION.
METHOD clear_dd03p_fields.
CONSTANTS lc_comptype_dataelement TYPE comptype VALUE 'E'.
DATA: lv_masklen TYPE c LENGTH 4.
FIELD-SYMBOLS: <ls_dd03p> TYPE dd03p.
* remove nested structures
DELETE ct_dd03p WHERE depth <> '00'.
* remove fields from .INCLUDEs
DELETE ct_dd03p WHERE adminfield <> '0'.
LOOP AT ct_dd03p ASSIGNING <ls_dd03p> WHERE NOT rollname IS INITIAL.
clear_dd03p_fields_common( CHANGING cs_dd03p = <ls_dd03p> ).
lv_masklen = <ls_dd03p>-masklen.
IF lv_masklen = '' OR NOT lv_masklen CO '0123456789'.
* make sure the field contains valid data, or the XML will dump
CLEAR <ls_dd03p>-masklen.
ENDIF.
IF <ls_dd03p>-comptype = lc_comptype_dataelement.
clear_dd03p_fields_dataelement( CHANGING cs_dd03p = <ls_dd03p> ).
ENDIF.
IF <ls_dd03p>-shlporigin = 'D'.
* search help from domain
CLEAR: <ls_dd03p>-shlpfield,
<ls_dd03p>-shlpname.
ENDIF.
* XML output assumes correct field content
IF <ls_dd03p>-routputlen = ' '.
CLEAR <ls_dd03p>-routputlen.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD clear_dd03p_fields_common.
CLEAR: cs_dd03p-ddlanguage,
cs_dd03p-dtelmaster,
cs_dd03p-logflag,
cs_dd03p-ddtext,
cs_dd03p-reservedte,
cs_dd03p-reptext,
cs_dd03p-scrtext_s,
cs_dd03p-scrtext_m,
cs_dd03p-scrtext_l.
ENDMETHOD.
METHOD clear_dd03p_fields_dataelement.
* type specified via data element
CLEAR: cs_dd03p-domname,
cs_dd03p-inttype,
cs_dd03p-intlen,
cs_dd03p-mask,
cs_dd03p-memoryid,
cs_dd03p-headlen,
cs_dd03p-scrlen1,
cs_dd03p-scrlen2,
cs_dd03p-scrlen3,
cs_dd03p-datatype,
cs_dd03p-leng,
cs_dd03p-outputlen,
cs_dd03p-deffdname,
cs_dd03p-convexit,
cs_dd03p-entitytab,
cs_dd03p-dommaster,
cs_dd03p-domname3l,
cs_dd03p-decimals,
cs_dd03p-lowercase,
cs_dd03p-signflag.
ENDMETHOD.
METHOD delete_extras.
DELETE FROM tddat WHERE tabname = iv_tabname.
ENDMETHOD.
METHOD delete_idoc_segment.
DATA lv_segment_type TYPE edilsegtyp.
DATA lv_result LIKE sy-subrc.
IF is_idoc_segment( ) = abap_false.
rv_deleted = abap_false.
RETURN. "previous XML version or no IDoc segment
ENDIF.
rv_deleted = abap_true.
lv_segment_type = ms_item-obj_name.
CALL FUNCTION 'SEGMENT_DELETE'
EXPORTING
segmenttyp = lv_segment_type
IMPORTING
result = lv_result
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0 OR lv_result <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD deserialize_idoc_segment.
DATA lv_result LIKE sy-subrc.
DATA lt_segment_definitions TYPE ty_segment_definitions.
DATA lv_package TYPE devclass.
DATA lv_uname TYPE sy-uname.
FIELD-SYMBOLS <ls_segment_definition> TYPE ty_segment_definition.
rv_deserialized = abap_false.
TRY.
io_xml->read( EXPORTING iv_name = c_s_dataname-segment_definition
CHANGING cg_data = lt_segment_definitions ).
CATCH zcx_abapgit_exception.
RETURN. "previous XML version or no IDoc segment
ENDTRY.
IF lines( lt_segment_definitions ) = 0.
RETURN. "no IDoc segment
ENDIF.
rv_deserialized = abap_true.
lv_package = iv_package.
LOOP AT lt_segment_definitions ASSIGNING <ls_segment_definition>.
<ls_segment_definition>-segmentheader-presp =
<ls_segment_definition>-segmentheader-pwork = cl_abap_syst=>get_user_name( ).
CALL FUNCTION 'SEGMENT_READ'
EXPORTING
segmenttyp = <ls_segment_definition>-segmentheader-segtyp
IMPORTING
result = lv_result
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0 OR lv_result <> 0.
CALL FUNCTION 'SEGMENT_CREATE'
IMPORTING
segmentdefinition = <ls_segment_definition>-segmentdefinition
TABLES
segmentstructure = <ls_segment_definition>-segmentstructures
CHANGING
segmentheader = <ls_segment_definition>-segmentheader
devclass = lv_package
EXCEPTIONS
OTHERS = 1.
ELSE.
CALL FUNCTION 'SEGMENT_MODIFY'
CHANGING
segmentheader = <ls_segment_definition>-segmentheader
devclass = lv_package
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0.
CALL FUNCTION 'SEGMENTDEFINITION_MODIFY'
TABLES
segmentstructure = <ls_segment_definition>-segmentstructures
CHANGING
segmentdefinition = <ls_segment_definition>-segmentdefinition
EXCEPTIONS
OTHERS = 1.
ENDIF.
ENDIF.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDLOOP.
lv_uname = cl_abap_syst=>get_user_name( ).
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_test_modus = abap_false
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = ms_item-obj_type
wi_tadir_obj_name = ms_item-obj_name
wi_tadir_author = lv_uname
wi_tadir_devclass = iv_package
wi_tadir_masterlang = mv_language
iv_set_edtflag = abap_true
iv_delflag = abap_false
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from TR_TADIR_INTERFACE' ).
ENDIF.
ENDMETHOD.
METHOD deserialize_texts.
DATA: lv_name TYPE ddobjname,
ls_dd02v_tmp TYPE dd02v,
lt_i18n_langs TYPE TABLE OF langu,
lt_dd02_texts TYPE tt_dd02_texts.
FIELD-SYMBOLS: <lv_lang> LIKE LINE OF lt_i18n_langs,
<ls_dd02_text> LIKE LINE OF lt_dd02_texts.
lv_name = ms_item-obj_name.
io_xml->read( EXPORTING iv_name = 'I18N_LANGS'
CHANGING cg_data = lt_i18n_langs ).
io_xml->read( EXPORTING iv_name = 'DD02_TEXTS'
CHANGING cg_data = lt_dd02_texts ).
SORT lt_i18n_langs.
SORT lt_dd02_texts BY ddlanguage. " Optimization
LOOP AT lt_i18n_langs ASSIGNING <lv_lang>.
" Table description
ls_dd02v_tmp = is_dd02v.
READ TABLE lt_dd02_texts ASSIGNING <ls_dd02_text> WITH KEY ddlanguage = <lv_lang>.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |DD02_TEXTS cannot find lang { <lv_lang> } in XML| ).
ENDIF.
MOVE-CORRESPONDING <ls_dd02_text> TO ls_dd02v_tmp.
CALL FUNCTION 'DDIF_TABL_PUT'
EXPORTING
name = lv_name
dd02v_wa = ls_dd02v_tmp
EXCEPTIONS
tabl_not_found = 1
name_inconsistent = 2
tabl_inconsistent = 3
put_failure = 4
put_refused = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |error from DDIF_TABL_PUT @TEXTS, { sy-subrc }| ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD is_idoc_segment.
DATA lv_segment_type TYPE edilsegtyp.
lv_segment_type = ms_item-obj_name.
SELECT SINGLE segtyp
FROM edisegment
INTO lv_segment_type
WHERE segtyp = lv_segment_type.
rv_is_idoc_segment = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD read_extras.
SELECT SINGLE * FROM tddat INTO rs_tabl_extras-tddat WHERE tabname = iv_tabname.
ENDMETHOD.
METHOD serialize_idoc_segment.
DATA lv_segment_type TYPE edilsegtyp.
DATA lv_result LIKE sy-subrc.
DATA lv_devclass TYPE devclass.
DATA lt_segmentdefinitions TYPE STANDARD TABLE OF edisegmdef.
DATA ls_segment_definition TYPE ty_segment_definition.
DATA lt_segment_definitions TYPE ty_segment_definitions.
FIELD-SYMBOLS: <ls_segemtndefinition> TYPE edisegmdef.
IF is_idoc_segment( ) = abap_false.
RETURN.
ENDIF.
lv_segment_type = ms_item-obj_name.
CALL FUNCTION 'SEGMENT_READ'
EXPORTING
segmenttyp = lv_segment_type
IMPORTING
result = lv_result
TABLES
segmentdefinition = lt_segmentdefinitions
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0 OR lv_result <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
LOOP AT lt_segmentdefinitions ASSIGNING <ls_segemtndefinition>.
CLEAR ls_segment_definition.
CALL FUNCTION 'SEGMENTDEFINITION_READ'
EXPORTING
segmenttyp = <ls_segemtndefinition>-segtyp
IMPORTING
result = lv_result
devclass = lv_devclass
segmentheader = ls_segment_definition-segmentheader
segmentdefinition = ls_segment_definition-segmentdefinition
TABLES
segmentstructure = ls_segment_definition-segmentstructures
CHANGING
version = <ls_segemtndefinition>-version
EXCEPTIONS
no_authority = 1
segment_not_existing = 2
OTHERS = 3.
IF sy-subrc <> 0 OR lv_result <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
zcl_abapgit_object_idoc=>clear_idoc_segement_fields(
CHANGING cg_structure = ls_segment_definition-segmentdefinition ).
zcl_abapgit_object_idoc=>clear_idoc_segement_fields(
CHANGING cg_structure = ls_segment_definition-segmentheader ).
APPEND ls_segment_definition TO lt_segment_definitions.
ENDLOOP.
io_xml->add( iv_name = c_s_dataname-segment_definition
ig_data = lt_segment_definitions ).
ENDMETHOD.
METHOD serialize_texts.
DATA: lv_name TYPE ddobjname,
lv_index TYPE i,
ls_dd02v TYPE dd02v,
lt_dd02_texts TYPE tt_dd02_texts,
lt_i18n_langs TYPE TABLE OF langu.
FIELD-SYMBOLS: <lv_lang> LIKE LINE OF lt_i18n_langs,
<ls_dd02_text> LIKE LINE OF lt_dd02_texts.
IF io_xml->i18n_params( )-serialize_master_lang_only = abap_true.
RETURN.
ENDIF.
lv_name = ms_item-obj_name.
" Collect additional languages, skip master lang - it was serialized already
SELECT DISTINCT ddlanguage AS langu INTO TABLE lt_i18n_langs
FROM dd02v
WHERE tabname = lv_name
AND ddlanguage <> mv_language. "#EC CI_SUBRC
LOOP AT lt_i18n_langs ASSIGNING <lv_lang>.
lv_index = sy-tabix.
CALL FUNCTION 'DDIF_TABL_GET'
EXPORTING
name = lv_name
langu = <lv_lang>
IMPORTING
dd02v_wa = ls_dd02v
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc <> 0 OR ls_dd02v-ddlanguage IS INITIAL.
DELETE lt_i18n_langs INDEX lv_index. " Don't save this lang
CONTINUE.
ENDIF.
APPEND INITIAL LINE TO lt_dd02_texts ASSIGNING <ls_dd02_text>.
MOVE-CORRESPONDING ls_dd02v TO <ls_dd02_text>.
ENDLOOP.
SORT lt_i18n_langs ASCENDING.
SORT lt_dd02_texts BY ddlanguage ASCENDING.
IF lines( lt_i18n_langs ) > 0.
io_xml->add( iv_name = 'I18N_LANGS'
ig_data = lt_i18n_langs ).
io_xml->add( iv_name = 'DD02_TEXTS'
ig_data = lt_dd02_texts ).
ENDIF.
ENDMETHOD.
METHOD update_extras.
IF is_tabl_extras-tddat IS INITIAL.
delete_extras( iv_tabname = iv_tabname ).
ELSE.
MODIFY tddat FROM is_tabl_extras-tddat.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
TYPES: BEGIN OF ty_data,
as4user TYPE dd02l-as4user,
as4date TYPE dd02l-as4date,
as4time TYPE dd02l-as4time,
END OF ty_data.
DATA: lt_data TYPE STANDARD TABLE OF ty_data WITH DEFAULT KEY,
ls_data LIKE LINE OF lt_data.
SELECT as4user as4date as4time
FROM dd02l INTO TABLE lt_data
WHERE tabname = ms_item-obj_name
AND as4local = 'A'
AND as4vers = '0000'.
SELECT as4user as4date as4time
APPENDING TABLE lt_data
FROM dd09l
WHERE tabname = ms_item-obj_name
AND as4local = 'A'
AND as4vers = '0000'.
SELECT as4user as4date as4time
APPENDING TABLE lt_data
FROM dd12l
WHERE sqltab = ms_item-obj_name
AND as4local = 'A'
AND as4vers = '0000'.
SORT lt_data BY as4date DESCENDING as4time DESCENDING.
READ TABLE lt_data INDEX 1 INTO ls_data.
IF sy-subrc = 0.
rv_user = ls_data-as4user.
ELSE.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_objname TYPE rsedd0-ddobjname,
lv_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 data 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.
delete_ddic( iv_objtype = 'T'
iv_no_ask = lv_no_ask ).
delete_longtexts( c_longtext_id_tabl ).
delete_extras( iv_tabname = lv_objname ).
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,
lv_refs TYPE abap_bool,
ls_extras TYPE ty_tabl_extras.
FIELD-SYMBOLS: <ls_dd03p> TYPE dd03p.
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 ).
" DDIC Step: Replace REF TO class/interface with generic reference to avoid cyclic dependency
LOOP AT lt_dd03p ASSIGNING <ls_dd03p> WHERE datatype = 'REF'.
IF iv_step = zif_abapgit_object=>gc_step_id-ddic.
<ls_dd03p>-rollname = 'OBJECT'.
ELSE.
lv_refs = abap_true.
ENDIF.
ENDLOOP.
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 ).
" DDIC Step: Remove referenced to search helps
IF iv_step = zif_abapgit_object=>gc_step_id-ddic.
CLEAR: lt_dd35v, lt_dd36m.
ENDIF.
IF iv_step = zif_abapgit_object=>gc_step_id-late AND lv_refs = abap_false AND lines( lt_dd35v ) = 0.
RETURN. " already active
ENDIF.
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_texts( io_xml = io_xml
is_dd02v = ls_dd02v ).
deserialize_longtexts( io_xml ).
io_xml->read( EXPORTING iv_name = c_s_dataname-tabl_extras
CHANGING cg_data = ls_extras ).
update_extras( iv_tabname = lv_name
is_tabl_extras = ls_extras ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_tabname TYPE dd02l-tabname.
lv_tabname = ms_item-obj_name.
CALL FUNCTION 'DD_GET_NAMETAB_HEADER'
EXPORTING
tabname = lv_tabname
EXCEPTIONS
not_found = 1
OTHERS = 2.
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
DATA: li_local_version_output TYPE REF TO zif_abapgit_xml_output,
li_local_version_input TYPE REF TO zif_abapgit_xml_input.
CREATE OBJECT li_local_version_output TYPE zcl_abapgit_xml_output.
me->zif_abapgit_object~serialize( li_local_version_output ).
CREATE OBJECT li_local_version_input
TYPE zcl_abapgit_xml_input
EXPORTING
iv_xml = li_local_version_output->render( ).
CREATE OBJECT ri_comparator TYPE zcl_abapgit_object_tabl_compar
EXPORTING
ii_local = li_local_version_input.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-ddic TO rt_steps.
APPEND zif_abapgit_object=>gc_step_id-late TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-ddic = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = exists_a_lock_entry_for( iv_lock_object = 'ESDICT'
iv_argument = |{ ms_item-obj_type }{ ms_item-obj_name }| ).
ENDMETHOD.
METHOD zif_abapgit_object~jump.
jump_se11( 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,
ls_extras TYPE ty_tabl_extras.
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( iv_name = 'DD03P_TABLE'
ig_data = lt_dd03p ).
io_xml->add( iv_name = 'DD05M_TABLE'
ig_data = lt_dd05m ).
io_xml->add( iv_name = 'DD08V_TABLE'
ig_data = lt_dd08v ).
io_xml->add( iv_name = 'DD12V'
ig_data = lt_dd12v ).
io_xml->add( iv_name = 'DD17V'
ig_data = lt_dd17v ).
io_xml->add( iv_name = 'DD35V_TALE'
ig_data = lt_dd35v ).
io_xml->add( iv_name = 'DD36M'
ig_data = lt_dd36m ).
serialize_texts( io_xml ).
serialize_longtexts( ii_xml = io_xml
iv_longtext_id = c_longtext_id_tabl ).
serialize_idoc_segment( io_xml ).
ls_extras = read_extras( iv_tabname = lv_name ).
io_xml->add( iv_name = c_s_dataname-tabl_extras
ig_data = ls_extras ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
8658,
75,
5550,
20032,
17941,
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,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
8658,
75,
62,
2302,
8847,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
1860,
265,
41876,
256,
1860,
265,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
8658,
75,
62,
2302,
8847,
13,
628,
220,
220,
220,
366,
0,
651,
3224,
1366,
588,
3084,
19601,
1448,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
8658,
3672,
930,
1438,
286,
262,
3084,
198,
220,
220,
220,
337,
36252,
50,
1100,
62,
2302,
8847,
30023,
9863,
2751,
21628,
62,
8658,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
49427,
26801,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
3808,
62,
8658,
75,
62,
2302,
8847,
8,
41876,
1259,
62,
8658,
75,
62,
2302,
8847,
13,
628,
220,
220,
220,
366,
0,
10133,
3224,
1366,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
8658,
3672,
930,
1438,
286,
262,
3084,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
318,
62,
8658,
75,
62,
2302,
8847,
930,
3224,
3084,
1366,
198,
220,
220,
220,
337,
36252,
50,
4296,
62,
2302,
8847,
30023,
9863,
2751,
21628,
62,
8658,
3672,
220,
220,
220,
220,
41876,
49427,
26801,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
8658,
75,
62,
2302,
8847,
41876,
1259,
62,
8658,
75,
62,
2302,
8847,
13,
628,
220,
220,
220,
366,
0,
23520,
3224,
1366,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
8658,
3672,
930,
1438,
286,
262,
3084,
198,
220,
220,
220,
337,
36252,
50,
12233,
62,
2302,
8847,
30023,
9863,
2751,
21628,
62,
8658,
3672,
41876,
49427,
26801,
3672,
13,
628,
220,
220,
220,
366,
0,
23283,
1096,
4522,
420,
1001,
5154,
2099,
14,
46758,
611,
30151,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
33245,
62,
19875,
930,
23735,
6260,
198,
220,
220,
220,
366,
0,
2488,
32741,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
930,
1475,
11755,
198,
220,
220,
220,
337,
36252,
50,
11389,
1096,
62,
312,
420,
62,
325,
5154,
30023,
9863,
2751,
33245,
62,
19875,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
19875,
62,
22915,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
366,
0,
2935,
48499,
1096,
4522,
420,
1001,
5154,
2099,
14,
46758,
611,
30151,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
33245,
62,
19875,
930,
23735,
6260,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
26495,
930,
12744,
5301,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
374,
85,
62,
8906,
48499,
1143,
930,
632,
338,
257,
10618,
290,
373,
288,
408,
48499,
1143,
198,
220,
220,
220,
366,
0,
2488,
32741,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
930,
1475,
11755,
198,
220,
220,
220,
337,
36252,
50,
748,
48499,
1096,
62,
312,
420,
62,
325,
5154,
30023,
9863,
2751,
33245,
62,
19875,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
19875,
62,
15414,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
26495,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
8906,
48499,
1143,
8,
41876,
450,
499,
62,
30388,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_object_sxci DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
PRIVATE SECTION.
TYPES: BEGIN OF ty_classic_badi_implementation,
implementation_data TYPE impl_data,
function_codes TYPE seex_fcode_table,
control_composites TYPE seex_coco_table,
customer_includes TYPE seex_table_table,
screens TYPE seex_screen_table,
filters TYPE seex_filter_table,
END OF ty_classic_badi_implementation.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_SXCI IMPLEMENTATION.
METHOD zif_abapgit_object~changed_by.
rv_user = c_user_unknown.
ENDMETHOD.
METHOD zif_abapgit_object~compare_to_remote_version.
CREATE OBJECT ro_comparison_result TYPE zcl_abapgit_comparison_null.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_implementation_name TYPE rsexscrn-imp_name.
lv_implementation_name = ms_item-obj_name.
CALL FUNCTION 'SXO_IMPL_DELETE'
EXPORTING
imp_name = lv_implementation_name
no_dialog = abap_true
EXCEPTIONS
imp_not_existing = 1
action_canceled = 2
access_failure = 3
data_inconsistency = 4
OTHERS = 5.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SXO_IMPL_DELETE' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_badi_definition TYPE badi_data,
lo_filter_object TYPE REF TO cl_badi_flt_struct,
lo_filter_values_object TYPE REF TO cl_badi_flt_values_alv,
lv_korrnum TYPE trkorr,
lv_filter_type_enhanceability TYPE rsexscrn-flt_ext,
lv_package TYPE devclass,
ls_classic_badi_implementation TYPE ty_classic_badi_implementation.
io_xml->read(
EXPORTING
iv_name = 'SXCI'
CHANGING
cg_data = ls_classic_badi_implementation ).
CALL FUNCTION 'SXO_BADI_READ'
EXPORTING
exit_name = ls_classic_badi_implementation-implementation_data-exit_name
IMPORTING
badi = ls_badi_definition
filter_obj = lo_filter_object
EXCEPTIONS
read_failure = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SXO_BADI_READ' ).
ENDIF.
lv_package = iv_package.
CREATE OBJECT lo_filter_values_object
EXPORTING
filter_object = lo_filter_object
filter_values = ls_classic_badi_implementation-filters.
CALL FUNCTION 'SXO_IMPL_SAVE'
EXPORTING
impl = ls_classic_badi_implementation-implementation_data
flt_ext = lv_filter_type_enhanceability
filter_val_obj = lo_filter_values_object
genflag = abap_true
no_dialog = abap_true
TABLES
fcodes_to_insert = ls_classic_badi_implementation-function_codes
cocos_to_insert = ls_classic_badi_implementation-control_composites
intas_to_insert = ls_classic_badi_implementation-customer_includes
sscrs_to_insert = ls_classic_badi_implementation-screens
CHANGING
korrnum = lv_korrnum
devclass = lv_package
EXCEPTIONS
save_failure = 1
action_canceled = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SXO_IMPL_SAVE' ).
ENDIF.
CALL FUNCTION 'SXO_IMPL_ACTIVE'
EXPORTING
imp_name = ls_classic_badi_implementation-implementation_data-imp_name
no_dialog = abap_true
EXCEPTIONS
badi_not_existing = 1
imp_not_existing = 2
already_active = 3
data_inconsistency = 4
activation_not_admissable = 5
action_canceled = 6
access_failure = 7
OTHERS = 8.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SXO_IMPL_ACTIVE' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_implementation_name TYPE rsexscrn-imp_name.
lv_implementation_name = ms_item-obj_name.
CALL FUNCTION 'SXV_IMP_EXISTS'
EXPORTING
imp_name = lv_implementation_name
EXCEPTIONS
not_existing = 1
data_inconsistency = 2
OTHERS = 3.
rv_bool = boolc( sy-subrc = 0 ).
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 = ms_item-obj_type
in_new_window = abap_true
EXCEPTIONS
not_executed = 1
invalid_object_type = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from RS_TOOL_ACCESS' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lv_implementation_name TYPE rsexscrn-imp_name,
lv_exit_name TYPE rsexscrn-exit_name,
lo_filter_object TYPE REF TO cl_badi_flt_struct,
ls_badi_definition TYPE badi_data,
lo_filter_values_object TYPE REF TO cl_badi_flt_values_alv,
lt_methods TYPE seex_mtd_table,
ls_classic_badi_implementation TYPE ty_classic_badi_implementation.
lv_implementation_name = ms_item-obj_name.
CALL FUNCTION 'SXV_EXIT_FOR_IMP'
EXPORTING
imp_name = lv_implementation_name
IMPORTING
exit_name = lv_exit_name
TABLES
filters = ls_classic_badi_implementation-filters
EXCEPTIONS
data_inconsistency = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SXV_EXIT_FOR_IMP' ).
ENDIF.
CALL FUNCTION 'SXO_BADI_READ'
EXPORTING
exit_name = lv_exit_name
IMPORTING
badi = ls_badi_definition
filter_obj = lo_filter_object
TABLES
fcodes = ls_classic_badi_implementation-function_codes
cocos = ls_classic_badi_implementation-control_composites
intas = ls_classic_badi_implementation-customer_includes
scrns = ls_classic_badi_implementation-screens
methods = lt_methods
EXCEPTIONS
read_failure = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SXO_BADI_READ' ).
ENDIF.
CALL FUNCTION 'SXO_IMPL_FOR_BADI_READ'
EXPORTING
imp_name = lv_implementation_name
exit_name = lv_exit_name
inter_name = ls_badi_definition-inter_name
filter_obj = lo_filter_object
no_create_filter_values_obj = abap_true
IMPORTING
impl = ls_classic_badi_implementation-implementation_data
filter_values_obj = lo_filter_values_object
TABLES
fcodes = ls_classic_badi_implementation-function_codes
cocos = ls_classic_badi_implementation-control_composites
intas = ls_classic_badi_implementation-customer_includes
scrns = ls_classic_badi_implementation-screens
CHANGING
methods = lt_methods
EXCEPTIONS
read_failure = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SXO_IMPL_FOR_BADI_READ' ).
ENDIF.
CLEAR: ls_classic_badi_implementation-implementation_data-aname,
ls_classic_badi_implementation-implementation_data-adate,
ls_classic_badi_implementation-implementation_data-atime,
ls_classic_badi_implementation-implementation_data-uname,
ls_classic_badi_implementation-implementation_data-udate,
ls_classic_badi_implementation-implementation_data-utime,
ls_classic_badi_implementation-implementation_data-active.
io_xml->add( iv_name = 'SXCI'
ig_data = ls_classic_badi_implementation ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
82,
87,
979,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
49421,
62,
65,
9189,
62,
320,
32851,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7822,
62,
7890,
41876,
4114,
62,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2163,
62,
40148,
220,
220,
220,
220,
220,
41876,
766,
87,
62,
69,
8189,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1630,
62,
785,
1930,
2737,
220,
41876,
766,
87,
62,
66,
25634,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6491,
62,
42813,
220,
220,
41876,
766,
87,
62,
11487,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8947,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
766,
87,
62,
9612,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
766,
87,
62,
24455,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
49421,
62,
65,
9189,
62,
320,
32851,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
50,
55,
25690,
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,
374,
85,
62,
7220,
796,
269,
62,
7220,
62,
34680,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5589,
533,
62,
1462,
62,
47960,
62,
9641,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
686,
62,
785,
1845,
1653,
62,
20274,
41876,
1976,
565,
62,
397,
499,
18300,
62,
785,
1845,
1653,
62,
8423,
13,
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,
320,
32851,
62,
3672,
41876,
374,
8044,
1416,
35906,
12,
11011,
62,
3672,
13,
628,
220,
220,
220,
300,
85,
62,
320,
32851,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
50,
55,
46,
62,
3955,
6489,
62,
7206,
2538,
9328,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
848,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
320,
32851,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
645,
62,
38969,
519,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
848,
62,
1662,
62,
25687,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2223,
62,
66,
590,
992,
220,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
1895,
62,
32165,
495,
220,
220,
220,
220,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
1939,
684,
396,
1387,
796,
604,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
642,
13,
628,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
18224,
422,
44205,
46,
62,
3955,
6489,
62,
7206,
2538,
9328,
6,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
8906,
48499,
1096,
13,
628,
220,
220,
220,
42865,
25,
43979,
62,
65,
9189,
62,
46758,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
2089,
72,
62,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
24455,
62,
15252,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
537,
62,
65,
9189,
62,
69,
2528,
62,
7249,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
24455,
62,
27160,
62,
15252,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
537,
62,
65,
9189,
62,
69,
2528,
62,
27160,
62,
282,
85,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
74,
38890,
22510,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
491,
74,
38890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
24455,
62,
4906,
62,
16550,
590,
1799,
220,
41876,
374,
8044,
1416,
35906,
12,
69,
2528,
62,
2302,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
26495,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1614,
4871,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
49421,
62,
65,
9189,
62,
320,
32851,
41876,
1259,
62,
49421,
62,
65,
9189,
62,
320,
32851,
13,
628,
220,
220,
220,
33245,
62,
19875,
3784,
961,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3672,
796,
705,
50,
55,
25690,
6,
198,
220,
220,
220,
220,
220,
5870,
15567
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS ltcl_call_transformation DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL.
PRIVATE SECTION.
METHODS test1_xml FOR TESTING RAISING cx_static_check.
METHODS test2_xml FOR TESTING RAISING cx_static_check.
METHODS test1_json FOR TESTING RAISING cx_static_check.
METHODS test2_json_fs FOR TESTING RAISING cx_static_check.
METHODS test3_json_table FOR TESTING RAISING cx_static_check.
METHODS test3_json_table_fs FOR TESTING RAISING cx_static_check.
METHODS invalid_input FOR TESTING RAISING cx_static_check.
METHODS empty_input FOR TESTING RAISING cx_static_check.
METHODS convert_json_to_sxml
IMPORTING iv_json TYPE string
RETURNING VALUE(rv_xml) TYPE string
RAISING cx_static_check.
METHODS json_to_sxml1 FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_call_transformation IMPLEMENTATION.
METHOD convert_json_to_sxml.
DATA lo_writer TYPE REF TO cl_sxml_string_writer.
lo_writer = cl_sxml_string_writer=>create( ).
CALL TRANSFORMATION id SOURCE XML iv_json RESULT XML lo_writer.
rv_xml = cl_abap_conv_codepage=>create_in( )->convert( lo_writer->get_output( ) ).
ENDMETHOD.
METHOD json_to_sxml1.
DATA lv_xml TYPE string.
* todo
* lv_xml = convert_json_to_sxml( '{}' ).
* WRITE '@KERNEL console.dir(lv_xml.get());'.
* cl_abap_unit_assert=>assert_equals(
* act = lv_xml
* exp = '<object/>' ).
ENDMETHOD.
METHOD test3_json_table.
TYPES: BEGIN OF ty_message,
field TYPE i,
val TYPE string,
END OF ty_message.
DATA tab TYPE STANDARD TABLE OF ty_message WITH DEFAULT KEY.
DATA row LIKE LINE OF tab.
DATA lv_input TYPE string.
lv_input = '{"DATA": [{"FIELD": 321, "VAL": "hello"}]}'.
CALL TRANSFORMATION id SOURCE XML lv_input RESULT data = tab.
cl_abap_unit_assert=>assert_equals(
act = lines( tab )
exp = 1 ).
READ TABLE tab INDEX 1 INTO row.
cl_abap_unit_assert=>assert_subrc( ).
cl_abap_unit_assert=>assert_equals(
act = row-field
exp = 321 ).
" cl_abap_unit_assert=>assert_equals(
" act = row-val
" exp = 'hello' ).
ENDMETHOD.
METHOD test3_json_table_fs.
TYPES: BEGIN OF ty_message,
field TYPE i,
END OF ty_message.
DATA tab TYPE STANDARD TABLE OF ty_message WITH DEFAULT KEY.
DATA row LIKE LINE OF tab.
FIELD-SYMBOLS <fs> TYPE any.
DATA lv_input TYPE string.
lv_input = '{"DATA": [{"FIELD": 321}]}'.
ASSIGN tab TO <fs>.
CALL TRANSFORMATION id SOURCE XML lv_input RESULT data = <fs>.
cl_abap_unit_assert=>assert_equals(
act = lines( tab )
exp = 1 ).
READ TABLE tab INDEX 1 INTO row.
cl_abap_unit_assert=>assert_subrc( ).
cl_abap_unit_assert=>assert_equals(
act = row-field
exp = 321 ).
ENDMETHOD.
METHOD test2_json_fs.
DATA: BEGIN OF ls_message,
field TYPE i,
END OF ls_message.
FIELD-SYMBOLS <fs> LIKE ls_message.
DATA lv_input TYPE string.
lv_input = '{"DATA": {"FIELD": 321}}'.
ASSIGN ls_message TO <fs>.
CALL TRANSFORMATION id SOURCE XML lv_input RESULT data = <fs>.
cl_abap_unit_assert=>assert_equals(
act = <fs>-field
exp = 321 ).
ENDMETHOD.
METHOD test1_json.
DATA: BEGIN OF ls_message,
field TYPE i,
END OF ls_message.
DATA lv_input TYPE string.
lv_input = '{"DATA": {"FIELD": 321}}'.
CALL TRANSFORMATION id SOURCE XML lv_input RESULT data = ls_message.
cl_abap_unit_assert=>assert_equals(
act = ls_message-field
exp = 321 ).
ENDMETHOD.
METHOD empty_input.
DATA ls_message TYPE i.
DATA lv_input TYPE string.
lv_input = ''.
TRY.
CALL TRANSFORMATION id SOURCE XML lv_input RESULT data = ls_message.
CATCH cx_xslt_runtime_error.
ENDTRY.
ENDMETHOD.
METHOD invalid_input.
DATA ls_message TYPE i.
DATA lv_json TYPE string.
lv_json = 'invalid'.
TRY.
CALL TRANSFORMATION id SOURCE XML lv_json RESULT data = ls_message.
cl_abap_unit_assert=>fail( ).
CATCH cx_xslt_format_error.
RETURN.
ENDTRY.
ENDMETHOD.
METHOD test1_xml.
DATA lv_xml TYPE string.
DATA: BEGIN OF ls_foo,
foo TYPE i,
END OF ls_foo.
lv_xml = |<?xml version="1.0" encoding="utf-16"?>\n| &&
|<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">\n| &&
| <asx:values>\n| &&
| <DATA>\n| &&
| <FOO>2</FOO>\n| &&
| </DATA>\n| &&
| </asx:values>\n| &&
|</asx:abap>|.
CALL TRANSFORMATION id
SOURCE XML lv_xml
RESULT data = ls_foo.
cl_abap_unit_assert=>assert_equals(
act = ls_foo-foo
exp = 2 ).
ENDMETHOD.
METHOD test2_xml.
DATA li_git TYPE REF TO if_ixml_element.
DATA li_abap TYPE REF TO if_ixml_node.
DATA li_stream_factory TYPE REF TO if_ixml_stream_factory.
DATA li_istream TYPE REF TO if_ixml_istream.
DATA li_element TYPE REF TO if_ixml_element.
DATA li_version TYPE REF TO if_ixml_node.
DATA li_parser TYPE REF TO if_ixml_parser.
DATA lv_xml TYPE string.
DATA mi_ixml TYPE REF TO if_ixml.
DATA mi_xml_doc TYPE REF TO if_ixml_document.
DATA lt_rtab TYPE abap_trans_resbind_tab.
FIELD-SYMBOLS <ls_rtab> LIKE LINE OF lt_rtab.
DATA: BEGIN OF ls_data,
foo TYPE i,
END OF ls_data.
lv_xml = |<?xml version="1.0" encoding="utf-16"?>\n| &&
|<abapGit version="v1.0.0">\n| &&
| <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">\n| &&
| <asx:values>\n| &&
| <DATA>\n| &&
| <FOO>2</FOO>\n| &&
| </DATA>\n| &&
| </asx:values>\n| &&
| </asx:abap>\n| &&
|</abapGit>|.
mi_ixml = cl_ixml=>create( ).
mi_xml_doc = mi_ixml->create_document( ).
li_stream_factory = mi_ixml->create_stream_factory( ).
li_istream = li_stream_factory->create_istream_string( lv_xml ).
li_parser = mi_ixml->create_parser( stream_factory = li_stream_factory
istream = li_istream
document = mi_xml_doc ).
li_parser->add_strip_space_element( ).
cl_abap_unit_assert=>assert_equals(
act = li_parser->parse( )
exp = 0 ).
li_istream->close( ).
* fix()
li_git ?= mi_xml_doc->find_from_name_ns( depth = 0
name = 'abapGit' ).
li_abap = li_git->get_first_child( ).
mi_xml_doc->get_root( )->remove_child( li_git ).
mi_xml_doc->get_root( )->append_child( li_abap ).
* CALL TRANSFORMATION
CALL TRANSFORMATION id
OPTIONS value_handling = 'accept_data_loss'
SOURCE XML mi_xml_doc
RESULT data = ls_data.
cl_abap_unit_assert=>assert_equals(
act = ls_data-foo
exp = 2 ).
* via dynamic table
CLEAR ls_data.
APPEND INITIAL LINE TO lt_rtab ASSIGNING <ls_rtab>.
<ls_rtab>-name = 'DATA'.
GET REFERENCE OF ls_data INTO <ls_rtab>-value.
CALL TRANSFORMATION id
OPTIONS value_handling = 'accept_data_loss'
SOURCE XML mi_xml_doc
RESULT (lt_rtab).
cl_abap_unit_assert=>assert_equals(
act = ls_data-foo
exp = 2 ).
ENDMETHOD.
ENDCLASS. | [
31631,
300,
83,
565,
62,
13345,
62,
7645,
1161,
5550,
20032,
17941,
7473,
43001,
2751,
45698,
42,
49277,
43638,
5805,
7597,
360,
4261,
6234,
6006,
9863,
25261,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
16,
62,
19875,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
17,
62,
19875,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
628,
220,
220,
220,
337,
36252,
50,
1332,
16,
62,
17752,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
17,
62,
17752,
62,
9501,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
18,
62,
17752,
62,
11487,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
18,
62,
17752,
62,
11487,
62,
9501,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
12515,
62,
15414,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
6565,
62,
15414,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
628,
220,
220,
220,
337,
36252,
50,
10385,
62,
17752,
62,
1462,
62,
82,
19875,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
17752,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
19875,
8,
41876,
4731,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
33918,
62,
1462,
62,
82,
19875,
16,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
13345,
62,
7645,
1161,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
10385,
62,
17752,
62,
1462,
62,
82,
19875,
13,
198,
220,
220,
220,
42865,
2376,
62,
16002,
41876,
4526,
37,
5390,
537,
62,
82,
19875,
62,
8841,
62,
16002,
13,
198,
220,
220,
220,
2376,
62,
16002,
796,
537,
62,
82,
19875,
62,
8841,
62,
16002,
14804,
17953,
7,
6739,
198,
220,
220,
220,
42815,
44069,
35036,
4686,
311,
31033,
23735,
21628,
62,
17752,
15731,
16724,
23735,
2376,
62,
16002,
13,
198,
220,
220,
220,
374,
85,
62,
19875,
796,
537,
62,
397,
499,
62,
42946,
62,
19815,
538,
496,
14804,
17953,
62,
259,
7,
1267,
3784,
1102,
1851,
7,
2376,
62,
16002,
3784,
1136,
62,
22915,
7,
1267,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
33918,
62,
1462,
62,
82,
19875,
16,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
19875,
41876,
4731,
13,
198,
9,
284,
4598,
198,
9,
220,
220,
220,
300,
85,
62,
19875,
796,
10385,
62,
17752,
62,
1462,
62,
82,
19875,
7,
705,
90,
92,
6,
6739,
198,
9,
220,
220,
220,
44423,
705,
31,
42,
28778,
3698,
8624,
13,
15908,
7,
6780,
62,
19875,
13,
1136,
35430,
4458,
198,
9,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
198,
9,
220,
220,
220,
220,
220,
719,
796,
300,
85,
62,
19875,
198,
9,
220,
220,
220,
220,
220,
1033,
796,
705,
27,
15252,
15913,
6,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
18,
62,
17752,
62,
11487,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
20500,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2214,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1188,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
20500,
13,
198,
220,
220,
220,
42865,
7400,
41876,
49053,
9795,
43679,
3963,
1259,
62,
20500,
13315,
5550,
38865,
35374,
13,
198,
220,
220,
220,
42865,
5752,
34178,
48920,
3963,
7400,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
15414,
41876,
4731,
13,
198,
220,
220,
220,
300,
85,
62,
15414,
796,
705,
4895,
26947,
1298,
685,
4895,
44603,
1298,
39595,
11,
366,
23428,
1298,
366,
31373,
20662,
48999,
4458,
198,
220,
220,
220,
42815,
44069,
35036,
4686,
311,
31033,
23735,
300,
85,
62,
15414,
15731,
16724,
1366,
796,
7400,
13,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
198,
220,
220,
220,
220,
220,
719,
796,
3951,
7,
7400,
1267,
198,
220,
220,
220,
220,
220,
1033,
796,
352,
6739,
198,
220,
220,
220,
20832,
43679,
7400,
24413,
6369,
352,
39319,
5752,
13,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
7266,
6015,
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,
5752,
12,
3245,
198,
220,
220,
220,
220,
220,
1033,
796,
39595,
6739,
198,
220,
220,
220,
366,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
198,
220,
220,
220,
366,
220,
220,
719,
796,
5752,
12,
2100,
198,
220,
220,
220,
366,
220,
220,
1033,
796,
705,
31373,
6,
6739,
220,
220,
220,
220,
220,
220,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
18,
62,
17752,
62,
11487,
62,
9501,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
20500,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2214,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
20500,
13,
198,
220,
220,
220,
42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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
] |
*&---------------------------------------------------------------------*
*& Include ZXSEUU21
*&---------------------------------------------------------------------*
BREAK-POINT.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
40348,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1168,
55,
5188,
30100,
2481,
198,
9,
5,
10097,
30934,
9,
198,
40438,
10206,
12,
16402,
12394,
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
] |
CLASS zcl_abapgit_serialize DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor
IMPORTING
!io_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit OPTIONAL
!is_local_settings TYPE zif_abapgit_persistence=>ty_repo-local_settings OPTIONAL
RAISING
zcx_abapgit_exception .
METHODS on_end_of_task
IMPORTING
!p_task TYPE clike ##NEEDED.
METHODS serialize
IMPORTING
!iv_package TYPE devclass OPTIONAL
!it_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
!ii_log TYPE REF TO zif_abapgit_log OPTIONAL
!iv_force_sequential TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(rt_files) TYPE zif_abapgit_definitions=>ty_files_item_tt
RAISING
zcx_abapgit_exception .
METHODS files_local
IMPORTING
!iv_package TYPE devclass
!ii_log TYPE REF TO zif_abapgit_log
!it_filter TYPE zif_abapgit_definitions=>ty_tadir_tt OPTIONAL
!ii_data_config TYPE REF TO zif_abapgit_data_config OPTIONAL
RETURNING
VALUE(rt_files) TYPE zif_abapgit_definitions=>ty_files_item_tt
RAISING
zcx_abapgit_exception .
PROTECTED SECTION.
TYPES:
BEGIN OF ty_unsupported_count,
obj_type TYPE tadir-object,
obj_name TYPE tadir-obj_name,
count TYPE i,
END OF ty_unsupported_count .
TYPES:
ty_unsupported_count_tt TYPE HASHED TABLE OF ty_unsupported_count WITH UNIQUE KEY obj_type .
TYPES:
ty_char32 TYPE c LENGTH 32 .
CLASS-DATA gv_max_threads TYPE i .
DATA mt_files TYPE zif_abapgit_definitions=>ty_files_item_tt .
DATA mv_free TYPE i .
DATA mi_log TYPE REF TO zif_abapgit_log .
DATA mv_group TYPE rzlli_apcl .
DATA mo_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit.
DATA ms_local_settings TYPE zif_abapgit_persistence=>ty_repo-local_settings.
DATA ms_i18n_params TYPE zif_abapgit_definitions=>ty_i18n_params.
METHODS add_apack
IMPORTING
!iv_package TYPE devclass
CHANGING
!ct_files TYPE zif_abapgit_definitions=>ty_files_item_tt
RAISING
zcx_abapgit_exception .
METHODS add_data
IMPORTING
!ii_data_config TYPE REF TO zif_abapgit_data_config
CHANGING
!ct_files TYPE zif_abapgit_definitions=>ty_files_item_tt
RAISING
zcx_abapgit_exception .
METHODS add_dot_abapgit
CHANGING
!ct_files TYPE zif_abapgit_definitions=>ty_files_item_tt
RAISING
zcx_abapgit_exception .
METHODS add_to_return
IMPORTING
!iv_path TYPE string
!is_file_item TYPE zif_abapgit_objects=>ty_serialization .
METHODS run_parallel
IMPORTING
!is_tadir TYPE zif_abapgit_definitions=>ty_tadir
!iv_task TYPE ty_char32
RAISING
zcx_abapgit_exception .
METHODS run_sequential
IMPORTING
!is_tadir TYPE zif_abapgit_definitions=>ty_tadir
RAISING
zcx_abapgit_exception .
METHODS add_objects
IMPORTING
!iv_package TYPE devclass
!ii_log TYPE REF TO zif_abapgit_log
!it_filter TYPE zif_abapgit_definitions=>ty_tadir_tt OPTIONAL
CHANGING
VALUE(ct_files) TYPE zif_abapgit_definitions=>ty_files_item_tt
RAISING
zcx_abapgit_exception .
METHODS determine_max_threads
IMPORTING
!iv_force_sequential TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(rv_threads) TYPE i
RAISING
zcx_abapgit_exception .
METHODS filter_unsupported_objects
CHANGING
!ct_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt .
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_abapgit_serialize IMPLEMENTATION.
METHOD add_apack.
DATA ls_apack_file TYPE zif_abapgit_definitions=>ty_file.
FIELD-SYMBOLS <ls_file> LIKE LINE OF ct_files.
ls_apack_file = zcl_abapgit_apack_helper=>to_file( iv_package ).
IF ls_apack_file IS NOT INITIAL.
APPEND INITIAL LINE TO ct_files ASSIGNING <ls_file>.
<ls_file>-file = ls_apack_file.
ENDIF.
ENDMETHOD.
METHOD add_data.
DATA lt_files TYPE zif_abapgit_definitions=>ty_files_tt.
DATA ls_file LIKE LINE OF lt_files.
FIELD-SYMBOLS <ls_return> LIKE LINE OF ct_files.
IF ii_data_config IS INITIAL.
RETURN.
ENDIF.
lt_files = ii_data_config->to_json( ).
LOOP AT lt_files INTO ls_file.
APPEND INITIAL LINE TO ct_files ASSIGNING <ls_return>.
<ls_return>-file = ls_file.
" Derive object from config filename (namespace + escaping)
zcl_abapgit_filename_logic=>file_to_object(
EXPORTING
iv_filename = <ls_return>-file-filename
iv_path = <ls_return>-file-path
io_dot = mo_dot_abapgit
IMPORTING
es_item = <ls_return>-item ).
<ls_return>-item-obj_type = zif_abapgit_data_config=>c_data_type-tabu.
ENDLOOP.
lt_files = zcl_abapgit_data_factory=>get_serializer( )->serialize( ii_data_config ).
LOOP AT lt_files INTO ls_file.
APPEND INITIAL LINE TO ct_files ASSIGNING <ls_return>.
<ls_return>-file = ls_file.
" Derive object from data filename (namespace + escaping)
zcl_abapgit_filename_logic=>file_to_object(
EXPORTING
iv_filename = <ls_return>-file-filename
iv_path = <ls_return>-file-path
io_dot = mo_dot_abapgit
IMPORTING
es_item = <ls_return>-item ).
ENDLOOP.
ENDMETHOD.
METHOD add_dot_abapgit.
FIELD-SYMBOLS: <ls_file> LIKE LINE OF ct_files.
APPEND INITIAL LINE TO ct_files ASSIGNING <ls_file>.
<ls_file>-file = mo_dot_abapgit->to_file( ).
ENDMETHOD.
METHOD add_objects.
DATA: lo_filter TYPE REF TO zcl_abapgit_repo_filter,
lv_force TYPE abap_bool,
lt_found LIKE ct_files,
lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt.
lt_tadir = zcl_abapgit_factory=>get_tadir( )->read(
iv_package = iv_package
iv_ignore_subpackages = ms_local_settings-ignore_subpackages
iv_only_local_objects = ms_local_settings-only_local_objects
io_dot = mo_dot_abapgit
ii_log = ii_log ).
lo_filter = NEW #( ).
lo_filter->apply( EXPORTING it_filter = it_filter
CHANGING ct_tadir = lt_tadir ).
* if there are less than 10 objects run in single thread
* this helps a lot when debugging, plus performance gain
* with low number of objects does not matter much
lv_force = xsdbool( lines( lt_tadir ) < 10 ).
lt_found = serialize(
iv_package = iv_package
it_tadir = lt_tadir
ii_log = ii_log
iv_force_sequential = lv_force ).
APPEND LINES OF lt_found TO ct_files.
ENDMETHOD.
METHOD add_to_return.
FIELD-SYMBOLS: <ls_file> LIKE LINE OF is_file_item-files,
<ls_return> LIKE LINE OF mt_files.
LOOP AT is_file_item-files ASSIGNING <ls_file>.
APPEND INITIAL LINE TO mt_files ASSIGNING <ls_return>.
<ls_return>-file = <ls_file>.
<ls_return>-file-path = iv_path.
<ls_return>-item = is_file_item-item.
ENDLOOP.
ENDMETHOD.
METHOD constructor.
DATA lo_settings TYPE REF TO zcl_abapgit_settings.
lo_settings = zcl_abapgit_persist_factory=>get_settings( )->read( ).
IF zcl_abapgit_factory=>get_environment( )->is_merged( ) = abap_true
OR lo_settings->get_parallel_proc_disabled( ) = abap_true.
gv_max_threads = 1.
ENDIF.
mv_group = 'parallel_generators'.
mo_dot_abapgit = io_dot_abapgit.
ms_local_settings = is_local_settings.
" Determine I18N parameters
IF io_dot_abapgit IS NOT INITIAL.
ms_i18n_params-main_language = io_dot_abapgit->get_main_language( ).
ms_i18n_params-main_language_only = is_local_settings-main_language_only.
ms_i18n_params-translation_languages = zcl_abapgit_lxe_texts=>get_translation_languages(
iv_main_language = io_dot_abapgit->get_main_language( )
it_i18n_languages = io_dot_abapgit->get_i18n_languages( ) ).
ENDIF.
IF ms_i18n_params-main_language IS INITIAL.
ms_i18n_params-main_language = sy-langu.
ENDIF.
ENDMETHOD.
METHOD determine_max_threads.
IF iv_force_sequential = abap_true.
rv_threads = 1.
RETURN.
ENDIF.
IF gv_max_threads >= 1.
* SPBT_INITIALIZE gives error PBT_ENV_ALREADY_INITIALIZED if called
* multiple times in same session
rv_threads = gv_max_threads.
RETURN.
ENDIF.
CALL FUNCTION 'FUNCTION_EXISTS'
EXPORTING
funcname = 'Z_ABAPGIT_SERIALIZE_PARALLEL'
EXCEPTIONS
function_not_exist = 1
OTHERS = 2.
IF sy-subrc <> 0.
gv_max_threads = 1.
ELSE.
* todo, add possibility to set group name in user exit
CALL FUNCTION 'SPBT_INITIALIZE'
EXPORTING
group_name = mv_group
IMPORTING
free_pbt_wps = gv_max_threads
EXCEPTIONS
invalid_group_name = 1
internal_error = 2
pbt_env_already_initialized = 3
currently_no_resources_avail = 4
no_pbt_resources_found = 5
cant_init_different_pbt_groups = 6
OTHERS = 7.
IF sy-subrc <> 0.
* fallback to running sequentially. If SPBT_INITIALIZE fails, check transactions
* RZ12, SM50, SM21, SARFC
gv_max_threads = 1.
ENDIF.
ENDIF.
IF gv_max_threads > 1.
gv_max_threads = gv_max_threads - 1.
ENDIF.
ASSERT gv_max_threads >= 1.
IF gv_max_threads > 32.
* https://en.wikipedia.org/wiki/Amdahl%27s_law
gv_max_threads = 32.
ENDIF.
rv_threads = gv_max_threads.
ENDMETHOD.
METHOD files_local.
* serializes objects, including .abapgit.xml, apack, and takes into account local settings
add_dot_abapgit( CHANGING ct_files = rt_files ).
add_apack(
EXPORTING
iv_package = iv_package
CHANGING
ct_files = rt_files ).
add_data(
EXPORTING
ii_data_config = ii_data_config
CHANGING
ct_files = rt_files ).
add_objects(
EXPORTING
iv_package = iv_package
ii_log = ii_log
it_filter = it_filter
CHANGING
ct_files = rt_files ).
ENDMETHOD.
METHOD filter_unsupported_objects.
DATA: ls_unsupported_count TYPE ty_unsupported_count,
lt_supported_types TYPE zcl_abapgit_objects=>ty_types_tt,
lt_unsupported_count TYPE ty_unsupported_count_tt.
FIELD-SYMBOLS: <ls_tadir> LIKE LINE OF ct_tadir,
<ls_unsupported_count> TYPE ty_unsupported_count.
lt_supported_types = zcl_abapgit_objects=>supported_list( ).
LOOP AT ct_tadir ASSIGNING <ls_tadir>.
CLEAR: ls_unsupported_count.
READ TABLE lt_supported_types WITH KEY table_line = <ls_tadir>-object TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
CONTINUE.
ENDIF.
READ TABLE lt_unsupported_count ASSIGNING <ls_unsupported_count>
WITH TABLE KEY obj_type = <ls_tadir>-object.
IF sy-subrc <> 0.
ls_unsupported_count-obj_type = <ls_tadir>-object.
ls_unsupported_count-count = 1.
ls_unsupported_count-obj_name = <ls_tadir>-obj_name.
INSERT ls_unsupported_count INTO TABLE lt_unsupported_count ASSIGNING <ls_unsupported_count>.
ELSE.
CLEAR: <ls_unsupported_count>-obj_name.
<ls_unsupported_count>-count = <ls_unsupported_count>-count + 1.
ENDIF.
CLEAR: <ls_tadir>-object.
ENDLOOP.
IF lt_unsupported_count IS INITIAL.
RETURN.
ENDIF.
DELETE ct_tadir WHERE object IS INITIAL.
IF mi_log IS BOUND.
LOOP AT lt_unsupported_count ASSIGNING <ls_unsupported_count>.
IF <ls_unsupported_count>-count = 1.
mi_log->add_error( iv_msg = |Object type { <ls_unsupported_count>-obj_type } not supported, {
<ls_unsupported_count>-obj_name } ignored| ).
ELSE.
mi_log->add_error( iv_msg = |Object type { <ls_unsupported_count>-obj_type } not supported, {
<ls_unsupported_count>-count } objects ignored| ).
ENDIF.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD on_end_of_task.
* this method will be called from the parallel processing, thus it must be public
DATA: lv_result TYPE xstring,
lv_path TYPE string,
lv_mess TYPE c LENGTH 200,
ls_file_item TYPE zif_abapgit_objects=>ty_serialization.
RECEIVE RESULTS FROM FUNCTION 'Z_ABAPGIT_SERIALIZE_PARALLEL'
IMPORTING
ev_result = lv_result
ev_path = lv_path
EXCEPTIONS
error = 1
system_failure = 2 MESSAGE lv_mess
communication_failure = 3 MESSAGE lv_mess
OTHERS = 4.
IF sy-subrc <> 0.
IF NOT mi_log IS INITIAL.
IF NOT lv_mess IS INITIAL.
mi_log->add_error( lv_mess ).
ELSE.
mi_log->add_error( |{ sy-msgv1 }{ sy-msgv2 }{ sy-msgv3 }{ sy-msgv3 }| ).
ENDIF.
ENDIF.
ELSE.
IMPORT data = ls_file_item FROM DATA BUFFER lv_result. "#EC CI_SUBRC
ASSERT sy-subrc = 0.
add_to_return( is_file_item = ls_file_item
iv_path = lv_path ).
ENDIF.
mv_free = mv_free + 1.
ENDMETHOD.
METHOD run_parallel.
DATA: lv_msg TYPE c LENGTH 100,
lv_free LIKE mv_free.
ASSERT mv_free > 0.
DO.
CALL FUNCTION 'Z_ABAPGIT_SERIALIZE_PARALLEL'
STARTING NEW TASK iv_task
DESTINATION IN GROUP mv_group
CALLING on_end_of_task ON END OF TASK
EXPORTING
iv_obj_type = is_tadir-object
iv_obj_name = is_tadir-obj_name
iv_devclass = is_tadir-devclass
iv_path = is_tadir-path
iv_language = ms_i18n_params-main_language
iv_main_language_only = ms_i18n_params-main_language_only
it_translation_langs = ms_i18n_params-translation_languages
EXCEPTIONS
system_failure = 1 MESSAGE lv_msg
communication_failure = 2 MESSAGE lv_msg
resource_failure = 3
OTHERS = 4.
IF sy-subrc = 3.
lv_free = mv_free.
WAIT UNTIL mv_free <> lv_free UP TO 1 SECONDS.
CONTINUE.
ELSEIF sy-subrc <> 0.
ASSERT lv_msg = '' AND 0 = 1.
ENDIF.
EXIT.
ENDDO.
mv_free = mv_free - 1.
ENDMETHOD.
METHOD run_sequential.
DATA: lx_error TYPE REF TO zcx_abapgit_exception,
ls_file_item TYPE zif_abapgit_objects=>ty_serialization.
ls_file_item-item-obj_type = is_tadir-object.
ls_file_item-item-obj_name = is_tadir-obj_name.
ls_file_item-item-devclass = is_tadir-devclass.
TRY.
ls_file_item = zcl_abapgit_objects=>serialize(
is_item = ls_file_item-item
iv_language = ms_i18n_params-main_language
iv_main_language_only = ms_i18n_params-main_language_only
it_translation_langs = ms_i18n_params-translation_languages ).
add_to_return( is_file_item = ls_file_item
iv_path = is_tadir-path ).
CATCH zcx_abapgit_exception INTO lx_error.
IF NOT mi_log IS INITIAL.
mi_log->add_exception(
ix_exc = lx_error
is_item = ls_file_item-item ).
ENDIF.
ENDTRY.
ENDMETHOD.
METHOD serialize.
* serializes only objects
DATA: lv_max TYPE i,
li_progress TYPE REF TO zif_abapgit_progress,
li_exit TYPE REF TO zif_abapgit_exit,
lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt.
FIELD-SYMBOLS: <ls_tadir> LIKE LINE OF it_tadir.
CLEAR mt_files.
lv_max = determine_max_threads( iv_force_sequential ).
mv_free = lv_max.
mi_log = ii_log.
lt_tadir = it_tadir.
filter_unsupported_objects( CHANGING ct_tadir = lt_tadir ).
li_progress = zcl_abapgit_progress=>get_instance( lines( lt_tadir ) ).
LOOP AT lt_tadir ASSIGNING <ls_tadir>.
li_progress->show(
iv_current = sy-tabix
iv_text = |Serialize { <ls_tadir>-obj_name }, { lv_max } threads| ).
IF lv_max = 1.
run_sequential( <ls_tadir> ).
ELSE.
run_parallel(
is_tadir = <ls_tadir>
iv_task = |{ sy-tabix }| ).
WAIT UNTIL mv_free > 0 UP TO 120 SECONDS.
ENDIF.
ENDLOOP.
WAIT UNTIL mv_free = lv_max UP TO 120 SECONDS.
rt_files = mt_files.
FREE mt_files.
* Call postprocessing
li_exit = zcl_abapgit_exit=>get_instance( ).
li_exit->serialize_postprocess(
EXPORTING
iv_package = iv_package
ii_log = ii_log
CHANGING
ct_files = rt_files ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
46911,
1096,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
26518,
62,
397,
499,
18300,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
12001,
62,
33692,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
12001,
62,
33692,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
319,
62,
437,
62,
1659,
62,
35943,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
79,
62,
35943,
41876,
537,
522,
22492,
12161,
1961,
1961,
13,
198,
220,
220,
220,
337,
36252,
50,
11389,
1096,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26495,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1614,
4871,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
83,
324,
343,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
83,
324,
343,
62,
926,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
6404,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
3174,
62,
3107,
1843,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
16624,
8,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
16624,
62,
9186,
62,
926,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
3696,
62,
12001,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26495,
220,
220,
220,
220,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
6404,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
24455,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
83,
324,
343,
62,
926,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
7890,
62,
11250,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
7890,
62,
11250,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
16624,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
16624,
62,
9186,
62,
926,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
403,
15999,
62,
9127,
11,
198,
220,
220,
220,
220,
220,
220,
220,
26181,
62,
4906,
41876,
36264,
343,
12,
15252,
11,
198,
220,
220,
220,
220,
220,
220,
220,
26181,
62,
3672,
41876,
36264,
343,
12,
26801,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
954,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
403,
15999,
62,
9127,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
403,
15999,
62,
9127,
62,
926,
41876,
367,
11211,
1961,
43679,
3963,
1259,
62,
403,
15999,
62,
9127,
13315,
4725,
33866,
8924,
35374,
26181,
62,
4906,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
10641,
2624,
41876,
269,
406,
49494,
3933,
764,
628,
220,
220,
220,
42715,
12,
26947,
308,
85,
62,
9806,
62,
16663,
82,
41876,
1312,
764,
198,
220,
220,
220,
42865,
45079,
62,
16624,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
16624,
62,
9186,
62,
926,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
5787,
41876,
1312,
764,
198,
220,
220,
220,
42865,
21504,
62,
6404,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
8094,
41876,
374,
89,
15516,
62,
499,
565,
764,
198,
220,
220,
220,
42865,
6941,
62,
26518,
62,
397,
499,
18300,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
13,
198,
220,
220,
220,
42865,
13845,
62,
12001,
62,
33692,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
12001,
62,
33692,
13,
198,
220,
220,
220,
42865,
13845,
62,
72,
1507,
77,
62,
37266,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
72,
1507,
77,
62,
37266,
13,
628,
220,
220,
220,
337,
36252,
50,
751,
62,
499,
441,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26495,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_syntax_highlighter DEFINITION
PUBLIC
ABSTRACT
CREATE PUBLIC .
PUBLIC SECTION.
CLASS-METHODS create
IMPORTING
!iv_filename TYPE string
RETURNING
VALUE(ro_instance) TYPE REF TO zcl_abapgit_syntax_highlighter .
METHODS process_line
IMPORTING
!iv_line TYPE string
RETURNING
VALUE(rv_line) TYPE string .
PROTECTED SECTION.
TYPES:
BEGIN OF ty_match,
token TYPE char1, " Type of matches
offset TYPE i, " Beginning position of the string that should be formatted
length TYPE i, " Length of the string that should be formatted
text_tag TYPE string, " Type of text tag
END OF ty_match.
TYPES:
ty_match_tt TYPE STANDARD TABLE OF ty_match WITH DEFAULT KEY.
TYPES:
BEGIN OF ty_rule,
regex TYPE REF TO cl_abap_regex,
token TYPE char1,
style TYPE string,
relevant_submatch TYPE i,
END OF ty_rule.
CONSTANTS c_token_none TYPE c VALUE '.'.
DATA mt_rules TYPE STANDARD TABLE OF ty_rule.
METHODS add_rule
IMPORTING
iv_regex TYPE string
iv_token TYPE c
iv_style TYPE string
iv_submatch TYPE i OPTIONAL.
METHODS parse_line
IMPORTING iv_line TYPE string
EXPORTING et_matches TYPE ty_match_tt.
METHODS order_matches ABSTRACT
IMPORTING iv_line TYPE string
CHANGING ct_matches TYPE ty_match_tt.
METHODS extend_matches
IMPORTING iv_line TYPE string
CHANGING ct_matches TYPE ty_match_tt.
METHODS format_line
IMPORTING iv_line TYPE string
it_matches TYPE ty_match_tt
RETURNING VALUE(rv_line) TYPE string.
METHODS apply_style
IMPORTING iv_line TYPE string
iv_class TYPE string
RETURNING VALUE(rv_line) TYPE string.
ENDCLASS.
CLASS zcl_abapgit_syntax_highlighter IMPLEMENTATION.
METHOD add_rule.
DATA ls_rule LIKE LINE OF mt_rules.
CREATE OBJECT ls_rule-regex
EXPORTING
pattern = iv_regex
ignore_case = abap_true.
ls_rule-token = iv_token.
ls_rule-style = iv_style.
ls_rule-relevant_submatch = iv_submatch.
APPEND ls_rule TO mt_rules.
ENDMETHOD.
METHOD apply_style.
DATA lv_escaped TYPE string.
lv_escaped = escape( val = iv_line format = cl_abap_format=>e_html_attr ).
IF iv_class IS NOT INITIAL.
rv_line = |<span class="{ iv_class }">{ lv_escaped }</span>|.
ELSE.
rv_line = lv_escaped.
ENDIF.
ENDMETHOD.
METHOD create.
" Create instance of highighter dynamically dependent on syntax type
IF iv_filename CP '*.abap'.
CREATE OBJECT ro_instance TYPE zcl_abapgit_syntax_abap.
ELSEIF iv_filename CP '*.xml'.
CREATE OBJECT ro_instance TYPE zcl_abapgit_syntax_xml.
ELSE.
CLEAR ro_instance.
ENDIF.
ENDMETHOD.
METHOD extend_matches.
DATA: lv_line_len TYPE i,
lv_last_pos TYPE i VALUE 0,
lv_length TYPE i,
ls_match TYPE ty_match.
FIELD-SYMBOLS <ls_match> TYPE ty_match.
lv_line_len = strlen( iv_line ).
SORT ct_matches BY offset.
" Add entries refering to parts of text that should not be formatted
LOOP AT ct_matches ASSIGNING <ls_match>.
IF <ls_match>-offset > lv_last_pos.
lv_length = <ls_match>-offset - lv_last_pos.
ls_match-token = c_token_none.
ls_match-offset = lv_last_pos.
ls_match-length = lv_length.
INSERT ls_match INTO ct_matches INDEX sy-tabix.
ENDIF.
lv_last_pos = <ls_match>-offset + <ls_match>-length.
ENDLOOP.
" Add remainder of the string
IF lv_line_len > lv_last_pos.
lv_length = lv_line_len - lv_last_pos.
ls_match-token = c_token_none.
ls_match-offset = lv_last_pos.
ls_match-length = lv_length.
APPEND ls_match TO ct_matches.
ENDIF.
ENDMETHOD.
METHOD format_line.
DATA:
lv_chunk TYPE string,
ls_rule LIKE LINE OF mt_rules.
FIELD-SYMBOLS <ls_match> TYPE ty_match.
LOOP AT it_matches ASSIGNING <ls_match>.
lv_chunk = substring( val = iv_line off = <ls_match>-offset len = <ls_match>-length ).
CLEAR ls_rule. " Failed read equals no style
READ TABLE mt_rules INTO ls_rule WITH KEY token = <ls_match>-token.
lv_chunk = me->apply_style( iv_line = lv_chunk
iv_class = ls_rule-style ).
rv_line = rv_line && lv_chunk.
ENDLOOP.
ENDMETHOD.
METHOD parse_line.
DATA:
lo_regex TYPE REF TO cl_abap_regex,
lo_matcher TYPE REF TO cl_abap_matcher,
lt_result TYPE match_result_tab,
ls_match TYPE ty_match.
FIELD-SYMBOLS:
<ls_regex> LIKE LINE OF mt_rules,
<ls_result> TYPE match_result,
<ls_submatch> LIKE LINE OF <ls_result>-submatches.
CLEAR et_matches.
" Process syntax-dependent regex table and find all matches
LOOP AT mt_rules ASSIGNING <ls_regex>.
lo_regex = <ls_regex>-regex.
lo_matcher = lo_regex->create_matcher( text = iv_line ).
lt_result = lo_matcher->find_all( ).
" Save matches into custom table with predefined tokens
LOOP AT lt_result ASSIGNING <ls_result>.
CLEAR: ls_match.
IF <ls_regex>-relevant_submatch = 0.
ls_match-token = <ls_regex>-token.
ls_match-offset = <ls_result>-offset.
ls_match-length = <ls_result>-length.
APPEND ls_match TO et_matches.
ELSE.
READ TABLE <ls_result>-submatches ASSIGNING <ls_submatch> INDEX <ls_regex>-relevant_submatch.
"submatch might be empty if only discarted parts matched
IF sy-subrc = 0 and <ls_submatch>-offset >= 0 and <ls_submatch>-length > 0.
ls_match-token = <ls_regex>-token.
ls_match-offset = <ls_submatch>-offset.
ls_match-length = <ls_submatch>-length.
APPEND ls_match TO et_matches.
ENDIF.
ENDIF.
ENDLOOP.
ENDLOOP.
ENDMETHOD.
METHOD process_line.
DATA: lt_matches TYPE ty_match_tt.
IF strlen( iv_line ) = 0.
RETURN.
ENDIF.
me->parse_line( EXPORTING iv_line = iv_line
IMPORTING et_matches = lt_matches ).
me->order_matches( EXPORTING iv_line = iv_line
CHANGING ct_matches = lt_matches ).
me->extend_matches( EXPORTING iv_line = iv_line
CHANGING ct_matches = lt_matches ).
rv_line = me->format_line( iv_line = iv_line
it_matches = lt_matches ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
1837,
41641,
62,
8929,
75,
4799,
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,
42715,
12,
49273,
50,
2251,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
34345,
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,
305,
62,
39098,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
1837,
41641,
62,
8929,
75,
4799,
764,
198,
220,
220,
220,
337,
36252,
50,
1429,
62,
1370,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
1370,
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,
1370,
8,
41876,
4731,
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,
15699,
11,
198,
220,
220,
220,
220,
220,
220,
220,
11241,
220,
220,
220,
41876,
1149,
16,
11,
220,
366,
5994,
286,
7466,
198,
220,
220,
220,
220,
220,
220,
220,
11677,
220,
220,
41876,
1312,
11,
220,
220,
220,
220,
220,
366,
25976,
2292,
286,
262,
4731,
326,
815,
307,
39559,
198,
220,
220,
220,
220,
220,
220,
220,
4129,
220,
220,
41876,
1312,
11,
220,
220,
220,
220,
220,
366,
22313,
286,
262,
4731,
326,
815,
307,
39559,
198,
220,
220,
220,
220,
220,
220,
220,
2420,
62,
12985,
41876,
4731,
11,
366,
5994,
286,
2420,
7621,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
15699,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
15699,
62,
926,
220,
41876,
49053,
9795,
43679,
3963,
1259,
62,
15699,
13315,
5550,
38865,
35374,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
25135,
11,
198,
220,
220,
220,
220,
220,
220,
220,
40364,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
260,
25636,
11,
198,
220,
220,
220,
220,
220,
220,
220,
11241,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3918,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
5981,
62,
7266,
15699,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
25135,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
30001,
62,
23108,
41876,
269,
26173,
8924,
705,
2637,
13,
628,
220,
220,
220,
42865,
45079,
62,
38785,
41876,
49053,
9795,
43679,
3963,
1259,
62,
25135,
13,
628,
220,
220,
220,
337,
36252,
50,
751,
62,
25135,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
260,
25636,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
30001,
220,
220,
220,
41876,
269,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
7635,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
7266,
15699,
41876,
1312,
39852,
2849,
1847,
13,
628,
220,
220,
220,
337,
36252,
50,
21136,
62,
1370,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
1370,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
2123,
62,
6759,
2052,
41876,
1259,
62,
15699,
62,
926,
13,
628,
220,
220,
220,
337,
36252,
50,
1502,
62,
6759,
2052,
9564,
18601,
10659,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
1370,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
220,
269,
83,
62,
6759,
2052,
41876,
1259,
62,
15699,
62,
926,
13,
628,
220,
220,
220,
337,
36252,
50,
9117,
62,
6759,
2052,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
1370,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
220,
269,
83,
62,
6759,
2052,
41876,
1259,
62,
15699,
62,
926,
13,
628,
220,
220,
220,
337,
36252,
50,
5794,
62,
1370,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
1370,
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,
340,
62,
6759,
2052,
220,
220,
220,
220,
41876,
1259,
62,
15699,
62,
926,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
1370,
8,
41876,
4731,
13,
628,
220,
220,
220,
337,
36252,
50,
4174,
62,
7635,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
1370,
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,
21628,
62,
4871,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
1370,
8,
41876,
4731,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
1837,
41641,
62,
8929,
75,
4799,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
751,
62,
25135,
13,
628,
220,
220,
220,
42865,
43979,
62,
25135,
34178,
48920,
3963,
45079,
62,
38785,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
43979,
62,
25135,
12,
260,
25636,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
3912,
220,
220,
220,
220,
796,
21628,
62,
260,
25636,
198,
220,
220,
220,
220,
220,
220,
220,
8856,
62,
7442,
796,
450,
499,
62,
7942,
13,
628
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS ltcl_test DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL.
PRIVATE SECTION.
METHODS: test FOR TESTING.
ENDCLASS. "ltcl_Test
CLASS ltcl_test IMPLEMENTATION.
METHOD test.
zcl_abappgp_unit_test=>subpacket_identity(
iv_data = 'A'
iv_type = zif_abappgp_constants=>c_sub_type-trust_signature ).
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
83,
565,
62,
9288,
5550,
20032,
17941,
7473,
43001,
2751,
360,
4261,
6234,
6006,
9863,
45698,
42,
49277,
43638,
5805,
7597,
25261,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
1332,
7473,
43001,
2751,
13,
198,
198,
10619,
31631,
13,
220,
220,
220,
220,
220,
220,
366,
2528,
565,
62,
14402,
198,
198,
31631,
300,
83,
565,
62,
9288,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
1332,
13,
628,
220,
220,
220,
1976,
565,
62,
397,
1324,
31197,
62,
20850,
62,
9288,
14804,
7266,
8002,
316,
62,
738,
414,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
7890,
796,
705,
32,
6,
198,
220,
220,
220,
220,
220,
21628,
62,
4906,
796,
1976,
361,
62,
397,
1324,
31197,
62,
9979,
1187,
14804,
66,
62,
7266,
62,
4906,
12,
38087,
62,
12683,
1300,
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
] |
class ZCL_BC_UTILITIES definition
public
create public .
public section.
class-methods ADD_1_IF_TRUE
importing
!IF_BOOLEAN type ABAP_BOOL
returning
value(RD_RESULT) type SY-TABIX .
protected section.
private section.
ENDCLASS.
CLASS ZCL_BC_UTILITIES IMPLEMENTATION.
METHOD add_1_if_true.
IF if_boolean EQ abap_true.
rd_result = 1.
ELSE.
rd_result = 0.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
4871,
1168,
5097,
62,
2749,
62,
3843,
4146,
30383,
6770,
198,
220,
1171,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
1398,
12,
24396,
82,
27841,
62,
16,
62,
5064,
62,
5446,
8924,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
5064,
62,
33,
6684,
2538,
1565,
2099,
9564,
2969,
62,
8202,
3535,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
35257,
62,
19535,
16724,
8,
2099,
19704,
12,
5603,
3483,
55,
764,
198,
24326,
2665,
13,
198,
19734,
2665,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
2749,
62,
3843,
4146,
30383,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
751,
62,
16,
62,
361,
62,
7942,
13,
628,
220,
220,
220,
16876,
611,
62,
2127,
21052,
36529,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
374,
67,
62,
20274,
796,
352,
13,
198,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
374,
67,
62,
20274,
796,
657,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_html_form DEFINITION
PUBLIC
FINAL
CREATE PRIVATE .
PUBLIC SECTION.
INTERFACES zif_abapgit_html_form .
INTERFACES zif_abapgit_gui_hotkeys .
CLASS-METHODS create
IMPORTING
!iv_form_id TYPE csequence OPTIONAL
!iv_help_page TYPE csequence OPTIONAL
RETURNING
VALUE(ro_form) TYPE REF TO zcl_abapgit_html_form .
METHODS render
IMPORTING
!iv_form_class TYPE csequence DEFAULT 'dialog-form'
!io_values TYPE REF TO zcl_abapgit_string_map
!io_validation_log TYPE REF TO zcl_abapgit_string_map OPTIONAL
RETURNING
VALUE(ri_html) TYPE REF TO zif_abapgit_html
RAISING
zcx_abapgit_exception .
METHODS command
IMPORTING
!iv_label TYPE csequence
!iv_action TYPE csequence
!iv_cmd_type TYPE i DEFAULT zif_abapgit_html_form=>c_cmd_type-input
RETURNING
VALUE(ro_self) TYPE REF TO zcl_abapgit_html_form .
METHODS text
IMPORTING
!iv_label TYPE csequence
!iv_name TYPE csequence
!iv_hint TYPE csequence OPTIONAL
!iv_required TYPE abap_bool DEFAULT abap_false
!iv_upper_case TYPE abap_bool DEFAULT abap_false
!iv_readonly TYPE abap_bool DEFAULT abap_false
!iv_password TYPE abap_bool DEFAULT abap_false
!iv_condense TYPE abap_bool OPTIONAL
!iv_placeholder TYPE csequence OPTIONAL
!iv_side_action TYPE csequence OPTIONAL
!iv_min TYPE i DEFAULT cl_abap_math=>min_int4
!iv_max TYPE i DEFAULT cl_abap_math=>max_int4
RETURNING
VALUE(ro_self) TYPE REF TO zcl_abapgit_html_form .
METHODS textarea
IMPORTING
!iv_label TYPE csequence
!iv_name TYPE csequence
!iv_hint TYPE csequence OPTIONAL
!iv_required TYPE abap_bool DEFAULT abap_false
!iv_readonly TYPE abap_bool DEFAULT abap_false
!iv_placeholder TYPE csequence OPTIONAL
!iv_rows TYPE i OPTIONAL
!iv_cols TYPE i OPTIONAL
RETURNING
VALUE(ro_self) TYPE REF TO zcl_abapgit_html_form .
METHODS number
IMPORTING
!iv_label TYPE csequence
!iv_name TYPE csequence
!iv_hint TYPE csequence OPTIONAL
!iv_required TYPE abap_bool DEFAULT abap_false
!iv_readonly TYPE abap_bool DEFAULT abap_false
!iv_min TYPE i DEFAULT cl_abap_math=>min_int4
!iv_max TYPE i DEFAULT cl_abap_math=>max_int4
RETURNING
VALUE(ro_self) TYPE REF TO zcl_abapgit_html_form .
METHODS checkbox
IMPORTING
!iv_label TYPE csequence
!iv_name TYPE csequence
!iv_hint TYPE csequence OPTIONAL
RETURNING
VALUE(ro_self) TYPE REF TO zcl_abapgit_html_form .
METHODS radio
IMPORTING
!iv_label TYPE csequence
!iv_name TYPE csequence
!iv_default_value TYPE csequence OPTIONAL
!iv_hint TYPE csequence OPTIONAL
RETURNING
VALUE(ro_self) TYPE REF TO zcl_abapgit_html_form .
METHODS option
IMPORTING
!iv_label TYPE csequence
!iv_value TYPE csequence
RETURNING
VALUE(ro_self) TYPE REF TO zcl_abapgit_html_form .
METHODS table
IMPORTING
!iv_label TYPE csequence
!iv_name TYPE csequence
!iv_hint TYPE csequence OPTIONAL
RETURNING
VALUE(ro_self) TYPE REF TO zcl_abapgit_html_form .
METHODS column
IMPORTING
!iv_label TYPE csequence
!iv_width TYPE csequence OPTIONAL
!iv_readonly TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(ro_self) TYPE REF TO zcl_abapgit_html_form .
METHODS start_group
IMPORTING
!iv_label TYPE csequence
!iv_name TYPE csequence
!iv_hint TYPE csequence OPTIONAL
RETURNING
VALUE(ro_self) TYPE REF TO zcl_abapgit_html_form .
METHODS hidden
IMPORTING
!iv_name TYPE csequence
RETURNING
VALUE(ro_self) TYPE REF TO zcl_abapgit_html_form .
METHODS get_fields
RETURNING
VALUE(rt_fields) TYPE zif_abapgit_html_form=>ty_fields .
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_attr,
value TYPE string,
error TYPE string,
hint TYPE string,
readonly TYPE string,
placeholder TYPE string,
required TYPE string,
autofocus TYPE string,
END OF ty_attr .
DATA mt_fields TYPE zif_abapgit_html_form=>ty_fields .
DATA:
mt_commands TYPE STANDARD TABLE OF zif_abapgit_html_form=>ty_command .
DATA mv_form_id TYPE string .
DATA mv_help_page TYPE string .
METHODS render_field
IMPORTING
!ii_html TYPE REF TO zif_abapgit_html
!io_values TYPE REF TO zcl_abapgit_string_map
!io_validation_log TYPE REF TO zcl_abapgit_string_map
!is_field TYPE zif_abapgit_html_form=>ty_field
!iv_autofocus TYPE abap_bool .
METHODS render_field_text
IMPORTING
!ii_html TYPE REF TO zif_abapgit_html
!is_field TYPE zif_abapgit_html_form=>ty_field
!is_attr TYPE ty_attr .
METHODS render_field_textarea
IMPORTING
!ii_html TYPE REF TO zif_abapgit_html
!is_field TYPE zif_abapgit_html_form=>ty_field
!is_attr TYPE ty_attr .
METHODS render_field_checkbox
IMPORTING
!ii_html TYPE REF TO zif_abapgit_html
!is_field TYPE zif_abapgit_html_form=>ty_field
!is_attr TYPE ty_attr .
METHODS render_field_radio
IMPORTING
!ii_html TYPE REF TO zif_abapgit_html
!is_field TYPE zif_abapgit_html_form=>ty_field
!is_attr TYPE ty_attr .
METHODS render_field_table
IMPORTING
!ii_html TYPE REF TO zif_abapgit_html
!is_field TYPE zif_abapgit_html_form=>ty_field
!is_attr TYPE ty_attr
!io_values TYPE REF TO zcl_abapgit_string_map .
METHODS render_command
IMPORTING
!ii_html TYPE REF TO zif_abapgit_html
!is_cmd TYPE zif_abapgit_html_form=>ty_command .
METHODS render_field_hidden
IMPORTING
!ii_html TYPE REF TO zif_abapgit_html
!is_field TYPE zif_abapgit_html_form=>ty_field
!is_attr TYPE ty_attr .
ENDCLASS.
CLASS zcl_abapgit_html_form IMPLEMENTATION.
METHOD checkbox.
DATA ls_field LIKE LINE OF mt_fields.
ls_field-type = zif_abapgit_html_form=>c_field_type-checkbox.
ls_field-name = iv_name.
ls_field-label = iv_label.
ls_field-hint = iv_hint.
APPEND ls_field TO mt_fields.
ro_self = me.
ENDMETHOD.
METHOD column.
FIELD-SYMBOLS <ls_last> LIKE LINE OF mt_fields.
DATA ls_column LIKE LINE OF <ls_last>-subitems.
DATA lv_size TYPE i.
lv_size = lines( mt_fields ).
ASSERT lv_size > 0. " Exception ? Maybe add zcx_no_check ?
READ TABLE mt_fields INDEX lv_size ASSIGNING <ls_last>.
ASSERT sy-subrc = 0.
ASSERT <ls_last>-type = zif_abapgit_html_form=>c_field_type-table.
ls_column-label = iv_label.
ls_column-value = iv_width.
ls_column-readonly = iv_readonly.
APPEND ls_column TO <ls_last>-subitems.
ro_self = me.
ENDMETHOD.
METHOD command.
DATA ls_cmd LIKE LINE OF mt_commands.
ASSERT iv_cmd_type BETWEEN 1 AND 4.
ls_cmd-label = iv_label.
ls_cmd-action = iv_action.
ls_cmd-cmd_type = iv_cmd_type.
APPEND ls_cmd TO mt_commands.
ro_self = me.
ENDMETHOD.
METHOD create.
DATA lv_ts TYPE timestampl.
ro_form = NEW #( ).
ro_form->mv_form_id = iv_form_id.
ro_form->mv_help_page = iv_help_page.
IF ro_form->mv_form_id IS INITIAL.
GET TIME STAMP FIELD lv_ts.
ro_form->mv_form_id = |form_{ lv_ts }|.
ENDIF.
ENDMETHOD.
METHOD get_fields.
rt_fields = mt_fields.
ENDMETHOD.
METHOD hidden.
DATA ls_field LIKE LINE OF mt_fields.
ls_field-type = zif_abapgit_html_form=>c_field_type-hidden.
ls_field-name = iv_name.
APPEND ls_field TO mt_fields.
ro_self = me.
ENDMETHOD.
METHOD number.
DATA ls_field LIKE LINE OF mt_fields.
ls_field-type = zif_abapgit_html_form=>c_field_type-number.
ls_field-name = iv_name.
ls_field-label = iv_label.
ls_field-readonly = iv_readonly.
ls_field-min = iv_min.
ls_field-max = iv_max.
ls_field-hint = iv_hint.
ls_field-required = iv_required.
APPEND ls_field TO mt_fields.
ro_self = me.
ENDMETHOD.
METHOD option.
FIELD-SYMBOLS <ls_last> LIKE LINE OF mt_fields.
DATA ls_option LIKE LINE OF <ls_last>-subitems.
DATA lv_size TYPE i.
lv_size = lines( mt_fields ).
ASSERT lv_size > 0. " Exception ? Maybe add zcx_no_check ?
READ TABLE mt_fields INDEX lv_size ASSIGNING <ls_last>.
ASSERT sy-subrc = 0.
ASSERT <ls_last>-type = zif_abapgit_html_form=>c_field_type-radio. " Or dropdown - TODO in future
ls_option-label = iv_label.
ls_option-value = iv_value.
APPEND ls_option TO <ls_last>-subitems.
ro_self = me.
ENDMETHOD.
METHOD radio.
DATA ls_field LIKE LINE OF mt_fields.
ls_field-type = zif_abapgit_html_form=>c_field_type-radio.
ls_field-name = iv_name.
ls_field-label = iv_label.
ls_field-default_value = iv_default_value.
ls_field-hint = iv_hint.
APPEND ls_field TO mt_fields.
ro_self = me.
ENDMETHOD.
METHOD render.
FIELD-SYMBOLS <ls_field> LIKE LINE OF mt_fields.
FIELD-SYMBOLS <ls_cmd> LIKE LINE OF mt_commands.
DATA lv_hint TYPE string.
DATA ls_form_id TYPE string.
DATA ls_form_action TYPE string.
DATA lv_cur_group TYPE string.
DATA lv_url TYPE string.
DATA lv_autofocus TYPE abap_bool.
IF mv_form_id IS NOT INITIAL.
ls_form_id = | id="{ mv_form_id }"|.
ENDIF.
LOOP AT mt_commands ASSIGNING <ls_cmd> WHERE cmd_type = zif_abapgit_html_form=>c_cmd_type-input_main.
ls_form_action = | action="sapevent:{ <ls_cmd>-action }"|.
EXIT.
ENDLOOP.
ri_html = NEW zcl_abapgit_html( ).
ri_html->add( |<div class="dialog { iv_form_class }">| ). " to center use 'dialog-form-center'
ri_html->add( |<form method="post"{ ls_form_id }{ ls_form_action }>| ).
" Add hidden button that triggers main command when pressing enter
LOOP AT mt_commands ASSIGNING <ls_cmd> WHERE cmd_type = zif_abapgit_html_form=>c_cmd_type-input_main.
ri_html->add( |<button type="submit" formaction="sapevent:{ <ls_cmd>-action }" class="hidden-submit"|
&& | aria-hidden="true" tabindex="-1"></button>| ).
EXIT.
ENDLOOP.
lv_autofocus = abap_true.
LOOP AT mt_fields ASSIGNING <ls_field>.
AT FIRST.
IF <ls_field>-type <> zif_abapgit_html_form=>c_field_type-field_group.
ri_html->add( |<ul>| ).
ENDIF.
ENDAT.
IF <ls_field>-type = zif_abapgit_html_form=>c_field_type-field_group.
IF lv_cur_group IS NOT INITIAL AND lv_cur_group <> <ls_field>-name.
ri_html->add( |</ul>| ).
ri_html->add( |</fieldset>| ).
ENDIF.
IF <ls_field>-hint IS NOT INITIAL.
lv_hint = | title="{ <ls_field>-hint }"|.
ELSE.
lv_hint = ''.
ENDIF.
lv_cur_group = <ls_field>-name.
ri_html->add( |<fieldset name="{ <ls_field>-name }">| ).
ri_html->add( |<legend{ lv_hint }>{ <ls_field>-label }</legend>| ).
ri_html->add( |<ul>| ).
CONTINUE.
ENDIF.
render_field(
ii_html = ri_html
io_values = io_values
io_validation_log = io_validation_log
is_field = <ls_field>
iv_autofocus = lv_autofocus ).
lv_autofocus = abap_false.
AT LAST.
ri_html->add( |</ul>| ).
IF lv_cur_group IS NOT INITIAL.
ri_html->add( |</fieldset>| ).
ENDIF.
ENDAT.
ENDLOOP.
ri_html->add( |<ul>| ).
ri_html->add( |<li class="dialog-commands">| ).
IF mv_help_page IS NOT INITIAL.
lv_url = escape( val = mv_help_page
format = cl_abap_format=>e_url ).
ri_html->add_a(
iv_txt = zcl_abapgit_gui_buttons=>help( )
iv_act = |{ zif_abapgit_definitions=>c_action-url }?url={ lv_url }|
iv_class = 'dialog-help'
iv_title = 'Help' ).
ENDIF.
LOOP AT mt_commands ASSIGNING <ls_cmd>.
render_command(
ii_html = ri_html
is_cmd = <ls_cmd> ).
ENDLOOP.
ri_html->add( |</li>| ).
ri_html->add( |</ul>| ).
ri_html->add( |</form>| ).
ri_html->add( |</div>| ).
zcl_abapgit_ui_factory=>get_gui_services(
)->get_hotkeys_ctl(
)->register_hotkeys( zif_abapgit_gui_hotkeys~get_hotkey_actions( ) ).
ENDMETHOD.
METHOD render_command.
CASE is_cmd-cmd_type.
WHEN zif_abapgit_html_form=>c_cmd_type-link.
ii_html->add_a(
iv_txt = is_cmd-label
iv_act = is_cmd-action
iv_class = 'dialog-commands' ).
WHEN zif_abapgit_html_form=>c_cmd_type-button.
ii_html->add( |<button type="submit" name="action" value="{ is_cmd-action }"|
&& | class="action-commands">{ is_cmd-label }</button>| ).
WHEN zif_abapgit_html_form=>c_cmd_type-input.
ii_html->add( |<input type="submit" value="{ is_cmd-label }" formaction="sapevent:{ is_cmd-action }">| ).
WHEN zif_abapgit_html_form=>c_cmd_type-input_main.
ii_html->add( |<input type="submit" value="{ is_cmd-label }" class="main">| ).
WHEN OTHERS.
ASSERT 0 = 1.
ENDCASE.
ENDMETHOD.
METHOD render_field.
DATA:
ls_attr TYPE ty_attr,
lv_item_class TYPE string.
" Get value and validation error
ls_attr-value = escape( val = io_values->get( is_field-name )
format = cl_abap_format=>e_html_attr ).
IF io_validation_log IS BOUND.
ls_attr-error = io_validation_log->get( is_field-name ).
IF ls_attr-error IS NOT INITIAL.
ls_attr-error = escape( val = ls_attr-error
format = cl_abap_format=>e_html_text ).
ls_attr-error = |<small>{ ls_attr-error }</small>|.
ENDIF.
ENDIF.
" Prepare field attributes
IF is_field-required = abap_true.
ls_attr-required = ' <em>*</em>'.
ENDIF.
IF is_field-hint IS NOT INITIAL.
ls_attr-hint = escape( val = is_field-hint
format = cl_abap_format=>e_html_attr ).
ls_attr-hint = | title="{ ls_attr-hint }"|.
ENDIF.
IF is_field-placeholder IS NOT INITIAL.
ls_attr-placeholder = escape( val = is_field-placeholder
format = cl_abap_format=>e_html_attr ).
ls_attr-placeholder = | placeholder="{ ls_attr-placeholder }"|.
ENDIF.
IF is_field-readonly = abap_true.
ls_attr-readonly = ' readonly'.
ENDIF.
IF iv_autofocus = abap_true.
ls_attr-autofocus = ' autofocus'.
ENDIF.
" Prepare item class
lv_item_class = is_field-item_class.
IF ls_attr-error IS NOT INITIAL.
lv_item_class = condense( lv_item_class && ' error' ).
ENDIF.
IF is_field-type = zif_abapgit_html_form=>c_field_type-text AND is_field-max BETWEEN 1 AND 20.
" Reduced width for short fields
lv_item_class = lv_item_class && ' w40'.
ENDIF.
IF lv_item_class IS NOT INITIAL.
lv_item_class = | class="{ lv_item_class }"|.
ENDIF.
" Render field
ii_html->add( |<li{ lv_item_class }>| ).
CASE is_field-type.
WHEN zif_abapgit_html_form=>c_field_type-text OR zif_abapgit_html_form=>c_field_type-number.
render_field_text(
ii_html = ii_html
is_field = is_field
is_attr = ls_attr ).
WHEN zif_abapgit_html_form=>c_field_type-textarea.
render_field_textarea(
ii_html = ii_html
is_field = is_field
is_attr = ls_attr ).
WHEN zif_abapgit_html_form=>c_field_type-checkbox.
render_field_checkbox(
ii_html = ii_html
is_field = is_field
is_attr = ls_attr ).
WHEN zif_abapgit_html_form=>c_field_type-radio.
render_field_radio(
ii_html = ii_html
is_field = is_field
is_attr = ls_attr ).
WHEN zif_abapgit_html_form=>c_field_type-table.
render_field_table(
ii_html = ii_html
is_field = is_field
is_attr = ls_attr
io_values = io_values ).
WHEN zif_abapgit_html_form=>c_field_type-hidden.
render_field_hidden(
ii_html = ii_html
is_field = is_field
is_attr = ls_attr ).
WHEN OTHERS.
ASSERT 1 = 0.
ENDCASE.
ii_html->add( '</li>' ).
ENDMETHOD.
METHOD render_field_checkbox.
DATA lv_checked TYPE string.
IF is_attr-error IS NOT INITIAL.
ii_html->add( is_attr-error ).
ENDIF.
IF is_attr-value = abap_true OR is_attr-value = 'on'.
" boolc return ` ` which is not initial -> bug after 1st validation
lv_checked = ' checked'.
ENDIF.
ii_html->add( |<input type="checkbox" name="{ is_field-name }" id="{ is_field-name }"| &&
|{ lv_checked }{ is_attr-readonly }{ is_attr-autofocus }>| ).
ii_html->add( |<label for="{ is_field-name }"{ is_attr-hint }>{ is_field-label }</label>| ).
ENDMETHOD.
METHOD render_field_hidden.
ii_html->add( |<input type="hidden" name="{ is_field-name }" id="{ is_field-name }" value="{ is_attr-value }">| ).
ENDMETHOD.
METHOD render_field_radio.
DATA:
lv_checked TYPE string,
lv_opt_id TYPE string,
lv_opt_value TYPE string.
FIELD-SYMBOLS <ls_opt> LIKE LINE OF is_field-subitems.
ii_html->add( |<label{ is_attr-hint }>{ is_field-label }</label>| ).
IF is_attr-error IS NOT INITIAL.
ii_html->add( is_attr-error ).
ENDIF.
ii_html->add( |<div class="radio-container">| ).
LOOP AT is_field-subitems ASSIGNING <ls_opt>.
lv_opt_value = escape( val = <ls_opt>-value
format = cl_abap_format=>e_html_attr ).
CLEAR lv_checked.
IF is_attr-value = lv_opt_value OR ( is_attr-value IS INITIAL AND lv_opt_value = is_field-default_value ).
lv_checked = ' checked'.
ENDIF.
lv_opt_id = |{ is_field-name }{ sy-tabix }|.
ii_html->add( |<input type="radio" name="{ is_field-name }" id="{ lv_opt_id }"|
&& | value="{ lv_opt_value }"{ lv_checked }{ is_attr-autofocus }>| ).
ii_html->add( |<label for="{ lv_opt_id }">{ <ls_opt>-label }</label>| ).
ENDLOOP.
ii_html->add( '</div>' ).
ENDMETHOD.
METHOD render_field_table.
DATA:
lv_value TYPE string,
lv_readonly TYPE string,
lv_rows TYPE i,
lv_cell_id TYPE string.
FIELD-SYMBOLS <ls_subitem> LIKE LINE OF is_field-subitems.
ii_html->add( |<label for="{ is_field-name }"{ is_attr-hint }>{ is_field-label }</label>| ).
IF is_attr-error IS NOT INITIAL.
ii_html->add( is_attr-error ).
ENDIF.
lv_rows = io_values->get( |{ is_field-name }-{ zif_abapgit_html_form=>c_rows }| ).
" Render table only if there are some data rows
IF lv_rows > 0.
ii_html->add( |<table name="{ is_field-name }" id="{ is_field-name }" class="table-container">| ).
ii_html->add( |<thead>| ).
ii_html->add( |<tr>| ).
LOOP AT is_field-subitems ASSIGNING <ls_subitem>.
CLEAR lv_value.
IF <ls_subitem>-value IS NOT INITIAL.
lv_value = escape( val = <ls_subitem>-value
format = cl_abap_format=>e_html_attr ).
lv_value = | width="{ lv_value }"|.
ENDIF.
ii_html->add( |<td{ lv_value }>{ <ls_subitem>-label }</td>| ).
ENDLOOP.
ii_html->add( |</tr>| ).
ii_html->add( |</thead>| ).
ii_html->add( |<tbody>| ).
DO lv_rows TIMES.
lv_rows = sy-index.
ii_html->add( |<tr>| ).
LOOP AT is_field-subitems ASSIGNING <ls_subitem>.
lv_cell_id = |{ is_field-name }-{ lv_rows }-{ sy-tabix }|.
lv_value = escape( val = io_values->get( lv_cell_id )
format = cl_abap_format=>e_html_attr ).
CLEAR lv_readonly.
IF <ls_subitem>-readonly = abap_true.
lv_readonly = | readonly|.
ENDIF.
ii_html->add( |<td><input type="text" name="{ lv_cell_id }" id="{
lv_cell_id }" value="{ lv_value }"{ lv_readonly }></td>| ).
ENDLOOP.
ii_html->add( |</tr>| ).
ENDDO.
ii_html->add( |</tbody>| ).
ii_html->add( |</table>| ).
ELSE.
ii_html->add( |<input type="text" name="{ is_field-name }" id="{
is_field-name }" value="Not available" readonly>| ).
ENDIF.
" Hidden field with number of rows to simplify getting values from form
lv_value = |{ is_field-name }-{ zif_abapgit_html_form=>c_rows }|.
ii_html->add( |<input type="number" name="{ lv_value }" id="{ lv_value }"|
&& | value="{ lv_rows }" style="display:none">| ).
ENDMETHOD.
METHOD render_field_text.
DATA:
lv_type TYPE string,
lv_maxlength TYPE string.
ii_html->add( |<label for="{ is_field-name }"{ is_attr-hint }>{ is_field-label }{ is_attr-required }</label>| ).
IF is_attr-error IS NOT INITIAL.
ii_html->add( is_attr-error ).
ENDIF.
IF is_field-side_action IS NOT INITIAL.
ii_html->add( '<div class="input-container">' ). " Ugly :(
ENDIF.
IF is_field-type = zif_abapgit_html_form=>c_field_type-number.
lv_type = 'number'.
ELSEIF is_field-password = abap_true.
lv_type = 'password'.
ELSE.
lv_type = 'text'.
ENDIF.
IF is_field-max > 0.
lv_maxlength = |maxlength={ is_field-max }|.
ENDIF.
ii_html->add( |<input type="{ lv_type }" name="{ is_field-name }" id="{ is_field-name }"|
&& | value="{ is_attr-value }" { is_field-dblclick }{ is_attr-placeholder }|
&& |{ is_attr-readonly }{ is_attr-autofocus } { lv_maxlength }>| ).
IF is_field-side_action IS NOT INITIAL.
ii_html->add( '</div>' ).
ii_html->add( '<div class="command-container">' ).
ii_html->add( |<input type="submit" value="…" formaction="sapevent:{ is_field-side_action }"|
&& | title="{ is_field-label }">| ).
ii_html->add( '</div>' ).
ENDIF.
ENDMETHOD.
METHOD render_field_textarea.
DATA lv_rows TYPE string.
DATA lv_cols TYPE string.
DATA lv_html TYPE string.
ii_html->add( |<label for="{ is_field-name }"{ is_attr-hint }>{ is_field-label }{ is_attr-required }</label>| ).
IF is_attr-error IS NOT INITIAL.
ii_html->add( is_attr-error ).
ENDIF.
IF is_field-rows > 0.
lv_rows = | rows="{ is_field-rows }"|.
ELSE.
lv_rows = lines( zcl_abapgit_convert=>split_string( is_attr-value ) ).
ENDIF.
IF is_field-cols > 0.
lv_cols = | cols="{ is_field-cols }"|.
ENDIF.
" Avoid adding line-breaks inside textarea tag (except for the actual value)
lv_html = |<textarea name="{ is_field-name }" id="{ is_field-name }"{ lv_rows }{ lv_cols }|
&& |{ is_attr-readonly }{ is_attr-autofocus }{ is_attr-placeholder }>|.
lv_html = lv_html && escape( val = is_attr-value
format = cl_abap_format=>e_html_attr ).
lv_html = lv_html && |</textarea>|.
ii_html->add( lv_html ).
ENDMETHOD.
METHOD start_group.
DATA ls_field LIKE LINE OF mt_fields.
ls_field-type = zif_abapgit_html_form=>c_field_type-field_group.
ls_field-label = iv_label.
ls_field-name = iv_name.
ls_field-hint = iv_hint.
APPEND ls_field TO mt_fields.
ro_self = me.
ENDMETHOD.
METHOD table.
DATA ls_field LIKE LINE OF mt_fields.
ls_field-type = zif_abapgit_html_form=>c_field_type-table.
ls_field-name = iv_name.
ls_field-label = iv_label.
ls_field-hint = iv_hint.
APPEND ls_field TO mt_fields.
ro_self = me.
ENDMETHOD.
METHOD text.
DATA ls_field LIKE LINE OF mt_fields.
ls_field-type = zif_abapgit_html_form=>c_field_type-text.
ls_field-name = iv_name.
ls_field-label = iv_label.
ls_field-upper_case = iv_upper_case.
ls_field-readonly = iv_readonly.
ls_field-min = iv_min.
ls_field-max = iv_max.
ls_field-password = iv_password.
ls_field-condense = iv_condense.
ls_field-hint = iv_hint.
ls_field-required = iv_required.
ls_field-placeholder = iv_placeholder.
IF iv_side_action IS NOT INITIAL AND mv_form_id IS NOT INITIAL.
ls_field-item_class = 'with-command'.
ls_field-side_action = iv_side_action.
ls_field-dblclick = | ondblclick="document.getElementById('{ mv_form_id }').action = 'sapevent:|
&& |{ iv_side_action }'; document.getElementById('{ mv_form_id }').submit()"|.
ENDIF.
APPEND ls_field TO mt_fields.
ro_self = me.
ENDMETHOD.
METHOD textarea.
DATA ls_field LIKE LINE OF mt_fields.
ls_field-type = zif_abapgit_html_form=>c_field_type-textarea.
ls_field-name = iv_name.
ls_field-label = iv_label.
ls_field-readonly = iv_readonly.
ls_field-hint = iv_hint.
ls_field-required = iv_required.
ls_field-placeholder = iv_placeholder.
ls_field-rows = iv_rows.
ls_field-cols = iv_cols.
APPEND ls_field TO mt_fields.
ro_self = me.
ENDMETHOD.
METHOD zif_abapgit_gui_hotkeys~get_hotkey_actions.
DATA: ls_hotkey_action LIKE LINE OF rt_hotkey_actions.
FIELD-SYMBOLS: <ls_command> TYPE zif_abapgit_html_form=>ty_command.
ls_hotkey_action-ui_component = 'Form'.
READ TABLE mt_commands WITH KEY cmd_type = zif_abapgit_html_form=>c_cmd_type-input_main
ASSIGNING <ls_command>.
IF sy-subrc = 0.
ls_hotkey_action-description = <ls_command>-label.
ls_hotkey_action-action = <ls_command>-action.
ls_hotkey_action-hotkey = |Enter|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ENDIF.
READ TABLE mt_commands WITH KEY action = zif_abapgit_definitions=>c_action-go_back
ASSIGNING <ls_command>.
IF sy-subrc = 0.
ls_hotkey_action-description = <ls_command>-label.
ls_hotkey_action-action = <ls_command>-action.
ls_hotkey_action-hotkey = |F3|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
687,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
4810,
3824,
6158,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
6494,
62,
687,
764,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
8940,
13083,
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,
452,
62,
687,
62,
312,
220,
220,
220,
41876,
269,
43167,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
16794,
62,
7700,
220,
41876,
269,
43167,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
687,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
687,
764,
198,
220,
220,
220,
337,
36252,
50,
8543,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
687,
62,
4871,
220,
220,
220,
220,
41876,
269,
43167,
5550,
38865,
705,
38969,
519,
12,
687,
6,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
27160,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
8841,
62,
8899,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
12102,
341,
62,
6404,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
8841,
62,
8899,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
6494,
8,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6494,
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,
3141,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
18242,
220,
220,
220,
220,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
2673,
220,
220,
220,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
28758,
62,
4906,
220,
220,
41876,
1312,
5550,
38865,
1976,
361,
62,
397,
499,
18300,
62,
6494,
62,
687,
14804,
66,
62,
28758,
62,
4906,
12,
15414,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
944,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
687,
764,
198,
220,
220,
220,
337,
36252,
50,
2420,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
18242,
220,
220,
220,
220,
220,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
71,
600,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
43167,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
35827,
220,
220,
220,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
45828,
62,
7442,
220,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
961,
8807,
220,
220,
220,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
28712,
220,
220,
220,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
17561,
1072,
220,
220,
220,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
5372,
13829,
41876,
269,
43167,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
1589,
62,
2673,
41876,
269,
43167,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
1084,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
5550,
38865,
537,
62,
397,
499,
62,
11018,
14804,
1084,
62,
600,
19,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
9806,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
5550,
38865,
537,
62,
397,
499,
62,
11018,
14804,
9806,
62,
600,
19,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
944,
8,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
687,
764,
198,
220,
220,
220,
337,
36252,
50,
2420,
20337,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
18242,
220,
220,
220,
220,
220,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
71,
600,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
43167,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
35827,
220,
220,
220,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
961,
8807,
220,
220,
220,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
5372,
13829,
41876,
269,
43167,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
8516,
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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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
] |
"! <p class="shorttext synchronized" lang="en">Environment determination for BOBF objects</p>
CLASS zcl_advoat_oea_bobf_env_srv DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES:
zif_advoat_oea_env_service.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_used_obj_external,
external_type TYPE trobjtype,
name TYPE seu_objkey,
END OF ty_used_obj_external,
ty_used_objects_external TYPE TABLE OF ty_used_obj_external,
BEGIN OF ty_bo_properties,
const_interface TYPE /bobf/obm_obj-const_interface,
object_model_cds_view_name TYPE c LENGTH 30,
END OF ty_bo_properties,
BEGIN OF ty_bo_node,
data_type TYPE /bobf/obm_node-data_type,
data_data_type TYPE /bobf/obm_node-data_data_type,
data_table_type TYPE /bobf/obm_node-data_table_type,
database_table TYPE /bobf/obm_node-database_table,
auth_check_class TYPE /bobf/obm_node-auth_check_class,
object_model_cds_view_name TYPE c LENGTH 30,
object_mdl_active_persistence TYPE tabname,
draft_class TYPE classname,
draft_data_type TYPE tabname,
object_mdl_draft_persistence TYPE tabname,
END OF ty_bo_node.
METHODS:
find_bo_properties
IMPORTING
!bo_name TYPE /bobf/obm_name
CHANGING
!used_objects TYPE ty_used_objects_external,
find_actions
IMPORTING
!bo_name TYPE /bobf/obm_name
CHANGING
!used_objects TYPE ty_used_objects_external,
find_determinatations
IMPORTING
!bo_name TYPE /bobf/obm_name
CHANGING
!used_objects TYPE ty_used_objects_external,
find_validations
IMPORTING
!bo_name TYPE /bobf/obm_name
CHANGING
!used_objects TYPE ty_used_objects_external,
find_nodes
IMPORTING
!bo_name TYPE /bobf/obm_name
CHANGING
!used_objects TYPE ty_used_objects_external,
find_alt_keys
IMPORTING
!bo_name TYPE /bobf/obm_name
CHANGING
!used_objects TYPE ty_used_objects_external.
ENDCLASS.
CLASS zcl_advoat_oea_bobf_env_srv IMPLEMENTATION.
METHOD find_actions.
SELECT act_class,
param_data_type,
export_param_s,
export_param_tt
FROM /bobf/act_list
WHERE name = @bo_name
AND act_class <> ''
INTO TABLE @DATA(bo_actions).
LOOP AT bo_actions ASSIGNING FIELD-SYMBOL(<action>).
used_objects = VALUE #( BASE used_objects
( name = <action>-act_class external_type = zif_advoat_c_tadir_type=>class )
( name = <action>-param_data_type external_type = zif_advoat_c_object_type=>structure )
( name = <action>-export_param_s external_type = zif_advoat_c_object_type=>structure )
( name = <action>-export_param_tt external_type = zif_advoat_c_tadir_type=>table_type ) ).
ENDLOOP.
ENDMETHOD.
METHOD find_alt_keys.
SELECT data_type,
data_table_type
FROM /bobf/obm_altkey
WHERE name = @bo_name
INTO TABLE @DATA(bo_alt_keys).
LOOP AT bo_alt_keys ASSIGNING FIELD-SYMBOL(<alt_key>).
used_objects = VALUE #( BASE used_objects
( name = <alt_key>-data_type external_type = zif_advoat_c_object_type=>structure )
( name = <alt_key>-data_table_type external_type = zif_advoat_c_tadir_type=>table_type ) ).
ENDLOOP.
ENDMETHOD.
METHOD find_bo_properties.
DATA bo_properties TYPE ty_bo_properties.
" 1) Select properties for NW >= 740
SELECT SINGLE const_interface
FROM /bobf/obm_obj
WHERE name = @bo_name
INTO CORRESPONDING FIELDS OF @bo_properties.
IF sy-subrc <> 0.
RETURN.
ENDIF.
" 2) Try to select properties for NW > 740
DATA(select_list) = `object_model_cds_view_name`.
TRY.
SELECT SINGLE (select_list)
FROM /bobf/obm_obj
WHERE name = @bo_name
INTO CORRESPONDING FIELDS OF @bo_properties.
CATCH cx_sy_dynamic_osql_semantics ##NO_HANDLER.
ENDTRY.
used_objects = VALUE #( BASE used_objects
( name = bo_properties-const_interface external_type = zif_advoat_c_tadir_type=>interface )
( name = bo_properties-object_model_cds_view_name external_type = zif_advoat_c_tadir_type=>structured_object ) ).
ENDMETHOD.
METHOD find_determinatations.
SELECT det_class
FROM /bobf/det_list
WHERE name = @bo_name
AND det_class <> ''
INTO TABLE @DATA(bo_determinations).
LOOP AT bo_determinations ASSIGNING FIELD-SYMBOL(<determination>).
APPEND VALUE #(
name = <determination>-det_class
external_type = zif_advoat_c_tadir_type=>class ) TO used_objects.
ENDLOOP.
ENDMETHOD.
METHOD find_nodes.
DATA: bo_nodes TYPE TABLE OF ty_bo_node.
FIELD-SYMBOLS: <node> TYPE zcl_advoat_oea_bobf_env_srv=>ty_bo_node.
" 1) Select properties for NW >= 740
SELECT node~data_type,
node~data_data_type,
node~data_table_type,
node~database_table,
node~auth_check_class
FROM /bobf/obm_bo AS bo
INNER JOIN /bobf/obm_node AS node
ON bo~bo_key = node~bo_key
WHERE bo~bo_name = @bo_name
INTO CORRESPONDING FIELDS OF TABLE @bo_nodes.
IF sy-subrc <> 0.
RETURN.
ENDIF.
LOOP AT bo_nodes ASSIGNING <node>.
used_objects = VALUE #( BASE used_objects
( name = <node>-data_type external_type = zif_advoat_c_object_type=>structure )
( name = <node>-data_data_type external_type = zif_advoat_c_object_type=>structure )
( name = <node>-data_table_type external_type = zif_advoat_c_tadir_type=>table_type )
( name = <node>-database_table external_type = zif_advoat_c_tadir_type=>table )
( name = <node>-auth_check_class external_type = zif_advoat_c_tadir_type=>class ) ).
ENDLOOP.
" 2) Try to select properties for NW > 740
DATA(select_list) = `node~object_model_cds_view_name, ` && |\r\n| &&
`mode~object_mdl_active_persistence, ` && |\r\n| &&
`mode~draft_class, ` && |\r\n| &&
`mode~draft_data_type, ` && |\r\n| &&
`mode~object_mdl_active_persistence`.
TRY.
SELECT (select_list)
FROM /bobf/obm_bo AS bo
INNER JOIN /bobf/obm_node AS node
ON bo~bo_key = node~bo_key
WHERE bo~bo_name = @bo_name
INTO CORRESPONDING FIELDS OF TABLE @bo_nodes.
CATCH cx_sy_dynamic_osql_semantics ##NO_HANDLER.
RETURN.
ENDTRY.
LOOP AT bo_nodes ASSIGNING <node>.
used_objects = VALUE #( BASE used_objects
( name = <node>-object_model_cds_view_name external_type = zif_advoat_c_tadir_type=>structured_object )
( name = <node>-object_mdl_active_persistence external_type = zif_advoat_c_tadir_type=>table )
( name = <node>-draft_class external_type = zif_advoat_c_tadir_type=>class )
( name = <node>-draft_data_type external_type = zif_advoat_c_object_type=>structure )
( name = <node>-object_mdl_draft_persistence external_type = zif_advoat_c_tadir_type=>table ) ).
ENDLOOP.
ENDMETHOD.
METHOD find_validations.
SELECT val_class
FROM /bobf/val_list
WHERE name = @bo_name
AND val_class <> ''
INTO TABLE @DATA(bo_validations).
LOOP AT bo_validations ASSIGNING FIELD-SYMBOL(<validation>).
APPEND VALUE #(
name = <validation>-val_class
external_type = zif_advoat_c_tadir_type=>class ) TO used_objects.
ENDLOOP.
ENDMETHOD.
METHOD zif_advoat_oea_env_service~determine_used_objects.
DATA: used_objects_data TYPE ty_used_objects_external.
DATA(bo_name) = CONV /bobf/obm_name( name ).
find_bo_properties(
EXPORTING bo_name = bo_name
CHANGING used_objects = used_objects_data ).
find_actions(
EXPORTING bo_name = bo_name
CHANGING used_objects = used_objects_data ).
find_determinatations(
EXPORTING bo_name = bo_name
CHANGING used_objects = used_objects_data ).
find_validations(
EXPORTING bo_name = bo_name
CHANGING used_objects = used_objects_data ).
find_nodes(
EXPORTING bo_name = bo_name
CHANGING used_objects = used_objects_data ).
find_alt_keys(
EXPORTING bo_name = bo_name
CHANGING used_objects = used_objects_data ).
SORT used_objects_data.
DELETE ADJACENT DUPLICATES FROM used_objects_data.
LOOP AT used_objects_data ASSIGNING FIELD-SYMBOL(<used_obj_data>) WHERE name IS NOT INITIAL.
APPEND zcl_advoat_oea_factory=>create_used_object(
name = <used_obj_data>-name
external_type = <used_obj_data>-external_type ) TO result.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
31441,
12123,
329,
347,
9864,
37,
5563,
3556,
79,
29,
198,
31631,
1976,
565,
62,
324,
13038,
265,
62,
2577,
64,
62,
65,
672,
69,
62,
24330,
62,
27891,
85,
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,
25,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
324,
13038,
265,
62,
2577,
64,
62,
24330,
62,
15271,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
1484,
62,
26801,
62,
22615,
11,
198,
220,
220,
220,
220,
220,
220,
220,
7097,
62,
4906,
41876,
4161,
50007,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
384,
84,
62,
26801,
2539,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
1484,
62,
26801,
62,
22615,
11,
628,
220,
220,
220,
220,
220,
1259,
62,
1484,
62,
48205,
62,
22615,
41876,
43679,
3963,
1259,
62,
1484,
62,
26801,
62,
22615,
11,
628,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
2127,
62,
48310,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1500,
62,
39994,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
672,
76,
62,
26801,
12,
9979,
62,
39994,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
19849,
62,
66,
9310,
62,
1177,
62,
3672,
41876,
269,
406,
49494,
1542,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
2127,
62,
48310,
11,
628,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
2127,
62,
17440,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
4906,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
672,
76,
62,
17440,
12,
7890,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
7890,
62,
4906,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
672,
76,
62,
17440,
12,
7890,
62,
7890,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
11487,
62,
4906,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
672,
76,
62,
17440,
12,
7890,
62,
11487,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
6831,
62,
11487,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
672,
76,
62,
17440,
12,
48806,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
6284,
62,
9122,
62,
4871,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
672,
76,
62,
17440,
12,
18439,
62,
9122,
62,
4871,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
19849,
62,
66,
9310,
62,
1177,
62,
3672,
220,
220,
220,
41876,
269,
406,
49494,
1542,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
9132,
75,
62,
5275,
62,
19276,
13274,
41876,
7400,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4538,
62,
4871,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1398,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4538,
62,
7890,
62,
4906,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
7400,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
9132,
75,
62,
35679,
62,
19276,
13274,
220,
41876,
7400,
3672,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
2127,
62,
17440,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
1064,
62,
2127,
62,
48310,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
2127,
62,
3672,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
672,
76,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
1484,
62,
48205,
41876,
1259,
62,
1484,
62,
48205,
62,
22615,
11,
198,
220,
220,
220,
220,
220,
1064,
62,
4658,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
2127,
62,
3672,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
672,
76,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
1484,
62,
48205,
41876,
1259,
62,
1484,
62,
48205,
62,
22615,
11,
198,
220,
220,
220,
220,
220,
1064,
62,
67,
13221,
265,
602,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
2127,
62,
3672,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
672,
76,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
1484,
62,
48205,
41876,
1259,
62,
1484,
62,
48205,
62,
22615,
11,
198,
220,
220,
220,
220,
220,
1064,
62,
12102,
602,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
2127,
62,
3672,
220,
220,
220,
220,
220,
41876,
1220,
65,
672,
69,
14,
672,
76,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
1484,
62,
48205,
41876,
1259,
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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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
] |
INTERFACE zif_agt_test_dtel PUBLIC.
DATA foobar TYPE zagt_test_dtel.
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
363,
83,
62,
9288,
62,
28664,
417,
44731,
13,
198,
220,
42865,
11511,
30973,
41876,
1976,
363,
83,
62,
9288,
62,
28664,
417,
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
] |
*---------------------------------------------------------------------*
* program for: VIEWFRAME_ZCILIB_SETT_V
* generation date: 27.12.2018 at 10:11:42
* view maintenance generator version: #001407#
*---------------------------------------------------------------------*
FUNCTION VIEWFRAME_ZCILIB_SETT_V .
DATA: ENQUEUE_PROCESSED TYPE C. "flag: view enqueued by VIEWFRAME_...
*-<<<-------------------------------------------------------------->>>>*
* Entrypoint after changing maintenance mode (show <--> update) *
*-<<<-------------------------------------------------------------->>>>*
DO.
*----------------------------------------------------------------------*
* Select data from database *
*----------------------------------------------------------------------*
CALL FUNCTION 'VIEWPROC_ZCILIB_SETT_V'
EXPORTING
FCODE = READ
VIEW_ACTION = VIEW_ACTION
VIEW_NAME = VIEW_NAME
TABLES
EXCL_CUA_FUNCT = EXCL_CUA_FUNCT
EXTRACT = ZCILIB_SETT_V_EXTRACT
TOTAL = ZCILIB_SETT_V_TOTAL
X_HEADER = X_HEADER
X_NAMTAB = X_NAMTAB
DBA_SELLIST = DBA_SELLIST
DPL_SELLIST = DPL_SELLIST
CORR_KEYTAB = E071K_TAB
EXCEPTIONS
MISSING_CORR_NUMBER = 1
NO_VALUE_FOR_SUBSET_IDENT = 2.
CASE SY-SUBRC.
WHEN 1.
RAISE MISSING_CORR_NUMBER.
WHEN 2.
RAISE NO_VALUE_FOR_SUBSET_IDENT.
ENDCASE.
*-<<<-------------------------------------------------------------->>>>*
* Entrypoint after saving data into database *
* Entrypoint after refreshing selected entries from database *
*-<<<-------------------------------------------------------------->>>>*
DO.
*----------------------------------------------------------------------*
* Edit data *
*----------------------------------------------------------------------*
DO.
CALL FUNCTION 'VIEWPROC_ZCILIB_SETT_V'
EXPORTING
FCODE = EDIT
VIEW_ACTION = MAINT_MODE
VIEW_NAME = VIEW_NAME
CORR_NUMBER = CORR_NUMBER
IMPORTING
UCOMM = FUNCTION
UPDATE_REQUIRED = STATUS_ZCILIB_SETT_V-UPD_FLAG
TABLES
EXCL_CUA_FUNCT = EXCL_CUA_FUNCT
EXTRACT = ZCILIB_SETT_V_EXTRACT
TOTAL = ZCILIB_SETT_V_TOTAL
X_HEADER = X_HEADER
X_NAMTAB = X_NAMTAB
DBA_SELLIST = DBA_SELLIST
DPL_SELLIST = DPL_SELLIST
CORR_KEYTAB = E071K_TAB
EXCEPTIONS
MISSING_CORR_NUMBER = 1
NO_VALUE_FOR_SUBSET_IDENT = 2.
CASE SY-SUBRC.
WHEN 1.
IF MAINT_MODE EQ TRANSPORTIEREN AND VIEW_ACTION EQ AENDERN.
MOVE VIEW_ACTION TO MAINT_MODE.
ELSE.
PERFORM BEFORE_LEAVING_FRAME_FUNCTION
USING X_HEADER-FRM_BF_END.
RAISE MISSING_CORR_NUMBER.
ENDIF.
WHEN 2.
RAISE NO_VALUE_FOR_SUBSET_IDENT.
WHEN OTHERS.
EXIT.
ENDCASE.
ENDDO.
*----------------------------------------------------------------------*
* Handle usercommands... *
* ...at first handle commands which could cause loss of data *
*----------------------------------------------------------------------*
IF FUNCTION EQ BACK. FUNCTION = END. ENDIF.
IF ( FUNCTION EQ SWITCH_TO_SHOW_MODE OR
FUNCTION EQ GET_ANOTHER_VIEW OR
FUNCTION EQ SWITCH_TRANSP_TO_UPD_MODE OR
FUNCTION EQ END ) AND
STATUS_ZCILIB_SETT_V-UPD_FLAG NE SPACE.
PERFORM BEENDEN.
CASE SY-SUBRC.
WHEN 0.
CALL FUNCTION 'VIEWPROC_ZCILIB_SETT_V'
EXPORTING
FCODE = SAVE
VIEW_ACTION = MAINT_MODE
VIEW_NAME = VIEW_NAME
CORR_NUMBER = CORR_NUMBER
IMPORTING
UPDATE_REQUIRED = STATUS_ZCILIB_SETT_V-UPD_FLAG
TABLES
EXCL_CUA_FUNCT = EXCL_CUA_FUNCT
EXTRACT = ZCILIB_SETT_V_EXTRACT
TOTAL = ZCILIB_SETT_V_TOTAL
X_HEADER = X_HEADER
X_NAMTAB = X_NAMTAB
DBA_SELLIST = DBA_SELLIST
DPL_SELLIST = DPL_SELLIST
CORR_KEYTAB = E071K_TAB
EXCEPTIONS
MISSING_CORR_NUMBER = 1
NO_VALUE_FOR_SUBSET_IDENT = 2
SAVING_CORRECTION_FAILED = 3.
CASE SY-SUBRC.
WHEN 0.
IF STATUS_ZCILIB_SETT_V-UPD_FLAG EQ SPACE. EXIT. ENDIF.
WHEN 1. RAISE MISSING_CORR_NUMBER.
WHEN 2. RAISE NO_VALUE_FOR_SUBSET_IDENT.
WHEN 3.
ENDCASE.
WHEN 8. EXIT.
WHEN 12.
ENDCASE.
*----------------------------------------------------------------------*
* ...2nd: transport request *
*----------------------------------------------------------------------*
ELSEIF FUNCTION EQ TRANSPORT.
IF STATUS_ZCILIB_SETT_V-UPD_FLAG NE SPACE.
PERFORM TRANSPORTIEREN.
CASE SY-SUBRC.
WHEN 0.
CALL FUNCTION 'VIEWPROC_ZCILIB_SETT_V'
EXPORTING
FCODE = SAVE
VIEW_ACTION = MAINT_MODE
VIEW_NAME = VIEW_NAME
CORR_NUMBER = CORR_NUMBER
IMPORTING
UPDATE_REQUIRED =
STATUS_ZCILIB_SETT_V-UPD_FLAG
TABLES
EXCL_CUA_FUNCT = EXCL_CUA_FUNCT
EXTRACT = ZCILIB_SETT_V_EXTRACT
TOTAL = ZCILIB_SETT_V_TOTAL
X_HEADER = X_HEADER
X_NAMTAB = X_NAMTAB
DBA_SELLIST = DBA_SELLIST
DPL_SELLIST = DPL_SELLIST
CORR_KEYTAB = E071K_TAB
EXCEPTIONS
MISSING_CORR_NUMBER = 1
NO_VALUE_FOR_SUBSET_IDENT = 2
SAVING_CORRECTION_FAILED = 3.
CASE SY-SUBRC.
WHEN 0. MAINT_MODE = TRANSPORTIEREN.
WHEN 1. RAISE MISSING_CORR_NUMBER.
WHEN 2. RAISE NO_VALUE_FOR_SUBSET_IDENT.
WHEN 3.
ENDCASE.
WHEN 8.
EXIT.
WHEN 12.
ENDCASE.
ELSE.
MAINT_MODE = TRANSPORTIEREN.
ENDIF.
*----------------------------------------------------------------------*
* ...now reset or save requests *
*----------------------------------------------------------------------*
ELSEIF FUNCTION EQ RESET_LIST OR
FUNCTION EQ RESET_ENTRY OR
FUNCTION EQ SAVE.
*----------------------------------------------------------------------*
* Refresh selected entries from database or save data into database *
*----------------------------------------------------------------------*
CALL FUNCTION 'VIEWPROC_ZCILIB_SETT_V'
EXPORTING
FCODE = FUNCTION
VIEW_ACTION = MAINT_MODE
VIEW_NAME = VIEW_NAME
CORR_NUMBER = CORR_NUMBER
IMPORTING
UPDATE_REQUIRED = STATUS_ZCILIB_SETT_V-UPD_FLAG
TABLES
EXCL_CUA_FUNCT = EXCL_CUA_FUNCT
EXTRACT = ZCILIB_SETT_V_EXTRACT
TOTAL = ZCILIB_SETT_V_TOTAL
X_HEADER = X_HEADER
X_NAMTAB = X_NAMTAB
DBA_SELLIST = DBA_SELLIST
DPL_SELLIST = DPL_SELLIST
CORR_KEYTAB = E071K_TAB
EXCEPTIONS
MISSING_CORR_NUMBER = 1
NO_VALUE_FOR_SUBSET_IDENT = 2
SAVING_CORRECTION_FAILED = 3.
CASE SY-SUBRC.
WHEN 1. RAISE MISSING_CORR_NUMBER.
WHEN 2. RAISE NO_VALUE_FOR_SUBSET_IDENT.
WHEN 3.
ENDCASE.
ELSE.
EXIT.
ENDIF.
ENDDO.
*----------------------------------------------------------------------*
* ...now other commands... *
*----------------------------------------------------------------------*
CASE FUNCTION.
WHEN SWITCH_TO_SHOW_MODE.
* change maintenance mode from update to show
PERFORM ENQUEUE USING 'D' X_HEADER-FRM_AF_ENQ. "dequeue view
CLEAR ENQUEUE_PROCESSED.
VIEW_ACTION = ANZEIGEN.
WHEN SWITCH_TO_UPDATE_MODE.
* change maintenance mode from show to update
PERFORM ENQUEUE USING 'E' X_HEADER-FRM_AF_ENQ. "enqueue view
IF SY-SUBRC EQ 0.
MOVE 'X' TO ENQUEUE_PROCESSED.
VIEW_ACTION = AENDERN.
ENDIF.
WHEN SWITCH_TRANSP_TO_UPD_MODE.
* change maintenance mode from transport to update
VIEW_ACTION = AENDERN.
WHEN TRANSPORT.
* change maintenance mode from update to transport
VIEW_ACTION = TRANSPORTIEREN.
WHEN OTHERS.
IF ENQUEUE_PROCESSED NE SPACE.
PERFORM ENQUEUE USING 'D' X_HEADER-FRM_AF_ENQ. "dequeue view
ENDIF.
PERFORM BEFORE_LEAVING_FRAME_FUNCTION USING X_HEADER-FRM_BF_END.
EXIT.
ENDCASE.
ENDDO.
ENDFUNCTION.
| [
9,
10097,
30934,
9,
198,
9,
220,
220,
220,
1430,
329,
25,
220,
220,
49880,
10913,
10067,
62,
57,
34,
4146,
9865,
62,
28480,
51,
62,
53,
198,
9,
220,
220,
5270,
3128,
25,
2681,
13,
1065,
13,
7908,
379,
838,
25,
1157,
25,
3682,
198,
9,
220,
220,
1570,
9262,
17301,
2196,
25,
1303,
405,
1415,
2998,
2,
198,
9,
10097,
30934,
9,
198,
42296,
4177,
2849,
49880,
10913,
10067,
62,
57,
34,
4146,
9865,
62,
28480,
51,
62,
53,
220,
220,
220,
220,
220,
220,
764,
628,
220,
42865,
25,
12964,
48,
8924,
8924,
62,
4805,
4503,
7597,
1961,
41876,
327,
13,
366,
32109,
25,
1570,
551,
4188,
1739,
416,
49880,
10913,
10067,
62,
986,
198,
198,
9,
12,
16791,
27,
47232,
26171,
16471,
9,
198,
9,
21617,
4122,
706,
5609,
9262,
4235,
357,
12860,
1279,
46904,
4296,
8,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
12,
16791,
27,
47232,
26171,
16471,
9,
198,
220,
8410,
13,
198,
9,
10097,
23031,
9,
198,
9,
9683,
1366,
422,
6831,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
10097,
23031,
9,
198,
34,
7036,
29397,
4177,
2849,
705,
28206,
4805,
4503,
62,
57,
34,
4146,
9865,
62,
28480,
51,
62,
53,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10029,
16820,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
20832,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49880,
62,
44710,
220,
220,
220,
796,
49880,
62,
44710,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49880,
62,
20608,
220,
220,
220,
220,
220,
796,
49880,
62,
20608,
198,
220,
220,
220,
220,
220,
220,
220,
220,
309,
6242,
28378,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
5097,
62,
34,
34970,
62,
42296,
4177,
796,
7788,
5097,
62,
34,
34970,
62,
42296,
4177,
198,
6369,
5446,
10659,
796,
1168,
34,
4146,
9865,
62,
28480,
51,
62,
53,
62,
6369,
5446,
10659,
198,
51,
27510,
796,
1168,
34,
4146,
9865,
62,
28480,
51,
62,
53,
62,
51,
27510,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1395,
62,
37682,
1137,
220,
220,
220,
220,
220,
220,
796,
1395,
62,
37682,
1137,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1395,
62,
45,
2390,
5603,
33,
220,
220,
220,
220,
220,
220,
796,
1395,
62,
45,
2390,
5603,
33,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
360,
4339,
62,
5188,
3069,
8808,
220,
220,
220,
796,
360,
4339,
62,
5188,
3069,
8808,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
360,
6489,
62,
5188,
3069,
8808,
220,
220,
220,
796,
360,
6489,
62,
5188,
3069,
8808,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23929,
49,
62,
20373,
5603,
33,
220,
220,
220,
796,
412,
2998,
16,
42,
62,
5603,
33,
198,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49684,
2751,
62,
44879,
49,
62,
41359,
13246,
220,
220,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8005,
62,
39488,
62,
13775,
62,
12564,
4462,
2767,
62,
25256,
796,
362,
13,
198,
220,
220,
220,
42001,
19704,
12,
50,
10526,
7397,
13,
198,
220,
220,
220,
220,
220,
42099,
352,
13,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
24352,
49684,
2751,
62,
44879,
49,
62,
41359,
13246,
13,
198,
220,
220,
220,
220,
220,
42099,
362,
13,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
24352,
8005,
62,
39488,
62,
13775,
62,
12564,
4462,
2767,
62,
25256,
13,
198,
220,
220,
220,
23578,
34,
11159,
13,
198,
9,
12,
16791,
27,
47232,
26171,
16471,
9,
198,
9,
21617,
4122,
706,
8914,
1366,
656,
6831,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
21617,
4122,
706,
23056,
6163,
12784,
422,
6831,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
12,
16791,
27,
47232,
26171,
16471,
9,
198,
220,
220,
220,
8410,
13,
198,
9,
10097,
23031,
9,
198,
9,
5312,
1366,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
10097,
23031,
9,
198,
220,
220,
220,
220,
220,
8410,
13,
198,
34,
7036,
29397,
4177,
2849,
705,
28206,
4805,
4503,
62,
57,
34,
4146,
9865,
62,
28480,
51,
62,
53,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10029,
16820,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
48483,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49880,
62,
44710,
220,
220,
220,
220,
796,
8779,
12394,
62,
49058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49880,
62,
20608,
220,
220,
220,
220,
220,
220,
796,
49880,
62,
20608,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23929,
49,
62
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_object_shma DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_SHMA IMPLEMENTATION.
METHOD zif_abapgit_object~changed_by.
rv_user = c_user_unknown.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
" We can't use FM SHMA_DELETE_AREA because it depends
" on the corresponding class, but in abapGit it has its own
" lifecycle. Therefore we have to reimplement most of the
" FMs logic
CONSTANTS: lc_request_delete TYPE i VALUE 4.
DATA: lv_request TYPE i,
lv_area_name TYPE shm_area_name,
lv_order TYPE e070-trkorr,
lv_korrnum TYPE tadir-korrnum,
lv_objname TYPE tadir-obj_name,
lv_task TYPE e070-trkorr,
lv_append TYPE abap_bool,
ls_tadir TYPE tadir,
ls_tdevc TYPE tdevc,
lo_cts_if TYPE REF TO object.
lv_area_name = ms_item-obj_name.
TRY.
CALL FUNCTION 'ENQUEUE_E_SHM_AREA'
EXPORTING
mode_shma_attributes = 'E'
area_name = lv_area_name
x_area_name = ' '
_scope = '2'
_wait = ' '
_collect = ' '
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error deleting SHMA { ms_item-obj_name }| ).
ENDIF.
CALL METHOD ('\PROGRAM=SAPMSHM_MONITOR\CLASS=LCL_SHMM')=>('FREE_AREA_BY_NAME')
EXPORTING
area_name = lv_area_name
affect_server = cl_shm_area=>affect_all_servers.
CREATE OBJECT lo_cts_if TYPE ('\FUNCTION-POOL=SHMA\CLASS=LCL_CTS_INTERFACE')
EXPORTING
area = lv_area_name.
CALL METHOD lo_cts_if->('CHECK_AREA')
EXPORTING
request = lc_request_delete
IMPORTING
access_mode = lv_request
appendable = lv_append.
IF lv_request <> lc_request_delete.
zcx_abapgit_exception=>raise( |Error deleting SHMA { ms_item-obj_name }| ).
ENDIF.
CALL METHOD lo_cts_if->('INSERT_AREA')
EXPORTING
request = lc_request_delete
IMPORTING
order = lv_order
task = lv_task.
DELETE FROM shma_attributes WHERE area_name = lv_area_name.
DELETE FROM shma_start WHERE area_name = lv_area_name.
lv_korrnum = lv_order.
lv_objname = lv_area_name.
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_read_only = abap_true
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = 'SHMA'
wi_tadir_obj_name = lv_objname
IMPORTING
new_tadir_entry = ls_tadir
EXCEPTIONS
OTHERS = 0.
CALL FUNCTION 'TR_DEVCLASS_GET'
EXPORTING
iv_devclass = ls_tadir-devclass
IMPORTING
es_tdevc = ls_tdevc
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0 AND ls_tdevc-korrflag IS INITIAL.
" TADIR entries for local objects must be deleted 'by hand'
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_test_modus = abap_false
wi_delete_tadir_entry = abap_true
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = 'SHMA'
wi_tadir_obj_name = lv_objname
wi_tadir_korrnum = lv_korrnum
EXCEPTIONS
OTHERS = 0.
ENDIF.
CALL METHOD ('\PROGRAM=SAPLSHMA\CLASS=LCL_SHMA_HELPER')=>('DELETE_RUNTIME_SETTINGS')
EXPORTING
area_name = lv_area_name.
CALL FUNCTION 'DEQUEUE_E_SHM_AREA'
EXPORTING
mode_shma_attributes = 'E'
area_name = lv_area_name
x_area_name = ' '
_scope = '3'
_synchron = ' '
_collect = ' '.
CATCH cx_root.
zcx_abapgit_exception=>raise( |Error deleting SHMA { ms_item-obj_name }| ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lv_area_name TYPE shm_area_name,
ls_area_attributes TYPE shma_attributes.
lv_area_name = ms_item-obj_name.
io_xml->read(
EXPORTING
iv_name = 'AREA_ATTRIBUTES'
CHANGING
cg_data = ls_area_attributes ).
tadir_insert( iv_package ).
TRY.
CALL METHOD ('\PROGRAM=SAPLSHMA\CLASS=LCL_SHMA_HELPER')=>('INSERT_AREA')
EXPORTING
area_name = lv_area_name
attributes = ls_area_attributes
force_overwrite = abap_true
no_class_generation = abap_true
silent_mode = abap_true.
CATCH cx_root.
zcx_abapgit_exception=>raise( |Error serializing SHMA { ms_item-obj_name }| ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_area_name TYPE shm_area_name.
SELECT SINGLE area_name
FROM shma_attributes
INTO lv_area_name
WHERE area_name = ms_item-obj_name.
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
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.
DATA: ls_bcdata TYPE bdcdata,
lt_bcdata TYPE STANDARD TABLE OF bdcdata.
ls_bcdata-program = 'SAPLSHMA'.
ls_bcdata-dynpro = '0100'.
ls_bcdata-dynbegin = 'X'.
APPEND ls_bcdata TO lt_bcdata.
CLEAR ls_bcdata.
ls_bcdata-fnam = 'SHMA_ATTRIBUTES-AREA_NAME'.
ls_bcdata-fval = ms_item-obj_name.
APPEND ls_bcdata TO lt_bcdata.
CLEAR ls_bcdata.
ls_bcdata-fnam = 'BDC_OKCODE'.
ls_bcdata-fval = '=SHOW'.
APPEND ls_bcdata TO lt_bcdata.
CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
STARTING NEW TASK 'GIT'
EXPORTING
tcode = 'SHMA'
mode_val = 'E'
TABLES
using_tab = lt_bcdata
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from ABAP4_CALL_TRANSACTION, SHMA' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lv_area_name TYPE shm_area_name,
ls_area_attributes TYPE shma_attributes.
lv_area_name = ms_item-obj_name.
TRY.
CALL METHOD ('\PROGRAM=SAPLSHMA\CLASS=LCL_SHMA_HELPER')=>('READ_AREA_ATTRIBUTES_ALL')
EXPORTING
area_name = lv_area_name
IMPORTING
area_attributes = ls_area_attributes.
CLEAR: ls_area_attributes-chg_user,
ls_area_attributes-chg_date,
ls_area_attributes-chg_time,
ls_area_attributes-cls_gen_user,
ls_area_attributes-cls_gen_date,
ls_area_attributes-cls_gen_time.
io_xml->add( iv_name = 'AREA_ATTRIBUTES'
ig_data = ls_area_attributes ).
CATCH cx_root.
zcx_abapgit_exception=>raise( |Error serializing SHMA { ms_item-obj_name }| ).
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
1477,
2611,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
9693,
5673,
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,
374,
85,
62,
7220,
796,
269,
62,
7220,
62,
34680,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
33678,
13,
628,
220,
220,
220,
366,
775,
460,
470,
779,
18695,
6006,
5673,
62,
7206,
2538,
9328,
62,
12203,
32,
780,
340,
8338,
198,
220,
220,
220,
366,
319,
262,
11188,
1398,
11,
475,
287,
450,
499,
38,
270,
340,
468,
663,
898,
198,
220,
220,
220,
366,
3868,
47510,
13,
8447,
356,
423,
284,
21123,
26908,
749,
286,
262,
198,
220,
220,
220,
366,
376,
10128,
9156,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
300,
66,
62,
25927,
62,
33678,
41876,
1312,
26173,
8924,
604,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
25927,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
20337,
62,
3672,
41876,
427,
76,
62,
20337,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
2875,
220,
220,
220,
220,
41876,
304,
43509,
12,
2213,
74,
38890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
74,
38890,
22510,
220,
220,
41876,
36264,
343,
12,
74,
38890,
22510,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
26801,
3672,
220,
220,
41876,
36264,
343,
12,
26801,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
35943,
220,
220,
220,
220,
220,
41876,
304,
43509,
12,
2213,
74,
38890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
33295,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
83,
324,
343,
220,
220,
220,
220,
41876,
36264,
343,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
83,
7959,
66,
220,
220,
220,
220,
41876,
256,
7959,
66,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
310,
82,
62,
361,
220,
220,
220,
41876,
4526,
37,
5390,
2134,
13,
628,
220,
220,
220,
300,
85,
62,
20337,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
1677,
48,
8924,
8924,
62,
36,
62,
9693,
44,
62,
12203,
32,
6,
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,
4235,
62,
1477,
2611,
62,
1078,
7657,
796,
705,
36,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1989,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
20337,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2124,
62,
20337,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
29982,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
17,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
17077,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4808,
33327,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3215,
62,
5354,
220,
220,
220,
220,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1080,
62,
32165,
495,
220,
220,
220,
220,
220,
220,
796,
362,
198,
220,
220,
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,
796,
513,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
930,
12331,
34817,
6006,
5673,
1391,
13845,
62,
9186,
12,
26801,
62,
3672,
1782,
91,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
220,
220,
220,
220,
42815,
337,
36252,
19203,
59,
4805,
7730,
24115,
28,
50,
2969,
5653,
36905,
62,
27857,
2043,
1581,
59,
31631,
28,
43,
5097,
62,
9693,
12038,
11537,
14804,
10786,
39274,
62,
12203,
32,
62,
17513,
62,
20608,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1989,
62,
3672,
220,
220,
220,
220,
796,
300,
85,
62,
20337,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2689,
62,
15388,
796,
537,
62,
1477,
76,
62,
20337,
14804,
2001,
478,
62,
439,
62,
2655,
690,
13,
628,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
2376,
62,
310,
82,
62,
361,
41876,
19203,
59,
42296,
4177,
2849,
12,
16402,
3535,
28,
9693,
5673
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
"!<h1>YIF_A2G_SERIALIZE</h1>
"! <p class="shorttext synchronized" lang="en">Cmp. Appl. - Abap 2 Google - Serialiser instances</p>
"!<p>This class serilize different object with same caracteristics.</p>
INTERFACE yif_a2g_serialize
PUBLIC .
ENDINTERFACE.
| [
40484,
27,
71,
16,
29,
56,
5064,
62,
32,
17,
38,
62,
35009,
12576,
35400,
3556,
71,
16,
29,
198,
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
34,
3149,
13,
39100,
13,
532,
2275,
499,
362,
3012,
532,
23283,
5847,
10245,
3556,
79,
29,
198,
40484,
27,
79,
29,
1212,
1398,
1055,
346,
1096,
1180,
2134,
351,
976,
1097,
7321,
3969,
25970,
79,
29,
198,
41358,
49836,
331,
361,
62,
64,
17,
70,
62,
46911,
1096,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_boolean DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
CLASS-METHODS parse
IMPORTING
!it_tokens TYPE stokesx_tab
RETURNING
VALUE(ro_node) TYPE REF TO zcl_aoc_boolean_node .
PROTECTED SECTION.
CLASS-METHODS is_comparator
IMPORTING
!io_tokens TYPE REF TO zcl_aoc_boolean_tokens
RETURNING
VALUE(rv_comparator) TYPE i .
CLASS-METHODS parse_internal
IMPORTING
!io_tokens TYPE REF TO zcl_aoc_boolean_tokens
RETURNING
VALUE(ro_node) TYPE REF TO zcl_aoc_boolean_node .
CLASS-METHODS parse_not
IMPORTING
!io_tokens TYPE REF TO zcl_aoc_boolean_tokens
RETURNING
VALUE(ro_node) TYPE REF TO zcl_aoc_boolean_node .
CLASS-METHODS parse_paren
IMPORTING
!io_tokens TYPE REF TO zcl_aoc_boolean_tokens
RETURNING
VALUE(ro_node) TYPE REF TO zcl_aoc_boolean_node .
CLASS-METHODS remove_method_calls
IMPORTING
!io_tokens TYPE REF TO zcl_aoc_boolean_tokens .
CLASS-METHODS remove_templates
IMPORTING
!io_tokens TYPE REF TO zcl_aoc_boolean_tokens .
CLASS-METHODS simplify
IMPORTING
!it_tokens TYPE stokesx_tab
RETURNING
VALUE(ro_tokens) TYPE REF TO zcl_aoc_boolean_tokens .
CLASS-METHODS remove_calculations
IMPORTING
!io_tokens TYPE REF TO zcl_aoc_boolean_tokens .
CLASS-METHODS remove_strings
IMPORTING
!io_tokens TYPE REF TO zcl_aoc_boolean_tokens .
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_AOC_BOOLEAN IMPLEMENTATION.
METHOD is_comparator.
DATA: lv_token2 TYPE string,
lv_token3 TYPE string,
lv_token4 TYPE string.
lv_token2 = io_tokens->get_token( 2 )-str.
lv_token3 = io_tokens->get_token( 3 )-str.
lv_token4 = io_tokens->get_token( 4 )-str.
rv_comparator = 0.
IF ( lv_token2 = 'IS' AND lv_token3 = 'NOT' )
OR ( lv_token2 = 'NOT' AND lv_token3 = 'IN' ).
rv_comparator = 2.
ELSEIF ( lv_token2 = 'IS' AND lv_token3 = 'INSTANCE' AND lv_token4 = 'OF' )
OR lv_token2 = 'BETWEEN'.
rv_comparator = 3.
ELSEIF lv_token2 = '='
OR lv_token2 = '<>'
OR lv_token2 = '<'
OR lv_token2 = 'GT'
OR lv_token2 = '>'
OR lv_token2 = 'LT'
OR lv_token2 = '>='
OR lv_token2 = 'GE'
OR lv_token2 = 'NS'
OR lv_token2 = '<='
OR lv_token2 = 'LE'
OR lv_token2 = 'NE'
OR lv_token2 = 'NA'
OR lv_token2 = 'CO'
OR lv_token2 = 'CA'
OR lv_token2 = 'CS'
OR lv_token2 = 'CN'
OR lv_token2 = 'IN'
OR lv_token2 = 'CP'
OR lv_token2 = 'NP'
OR lv_token2 = 'IS'
OR lv_token2 = 'EQ'.
rv_comparator = 1.
ENDIF.
ENDMETHOD.
METHOD parse.
* returns initial RO_NODE in case of parser errors
DATA: lo_tokens TYPE REF TO zcl_aoc_boolean_tokens.
lo_tokens = simplify( it_tokens ).
ro_node = parse_internal( lo_tokens ).
ENDMETHOD.
METHOD parse_internal.
DATA: lv_token1 TYPE string,
lv_token2 TYPE string,
lo_node LIKE ro_node,
lv_comparator TYPE i.
lv_token1 = io_tokens->get_token( 1 )-str.
lv_token2 = io_tokens->get_token( 2 )-str.
lv_comparator = is_comparator( io_tokens ).
IF lv_comparator > 0 AND io_tokens->get_length( ) >= 3.
CREATE OBJECT ro_node
EXPORTING
iv_type = zcl_aoc_boolean_node=>c_type-compare.
io_tokens->eat( 2 + lv_comparator ).
ELSEIF io_tokens->get_length( ) = 1 OR lv_token2 = 'AND' OR lv_token2 = 'OR'.
* Predicative method call, 740SP08 logical expression
CREATE OBJECT ro_node
EXPORTING
iv_type = zcl_aoc_boolean_node=>c_type-compare.
io_tokens->eat( 1 ).
ELSEIF lv_token1 = 'NOT'.
io_tokens->eat( 1 ).
ro_node = parse_not( io_tokens ).
ELSEIF lv_token1 = '('.
ro_node = parse_paren( io_tokens ).
ELSEIF lv_token1 = 'AND'.
CREATE OBJECT ro_node
EXPORTING
iv_type = zcl_aoc_boolean_node=>c_type-and.
io_tokens->eat( 1 ).
lo_node = parse_internal( io_tokens ).
ro_node->append_child( lo_node ).
ELSEIF lv_token1 = 'OR'.
CREATE OBJECT ro_node
EXPORTING
iv_type = zcl_aoc_boolean_node=>c_type-or.
io_tokens->eat( 1 ).
lo_node = parse_internal( io_tokens ).
ro_node->append_child( lo_node ).
ELSE.
* parser error
RETURN.
ENDIF.
* parse remaining
IF io_tokens->get_length( ) > 0.
lo_node = parse_internal( io_tokens ).
IF lo_node IS INITIAL.
* parser error
CLEAR ro_node.
RETURN.
ENDIF.
lo_node->prepend_child( ro_node ).
ro_node = lo_node.
ENDIF.
ENDMETHOD.
METHOD parse_not.
DATA: lo_node TYPE REF TO zcl_aoc_boolean_node,
lv_end TYPE i,
lo_split TYPE REF TO zcl_aoc_boolean_tokens.
CREATE OBJECT ro_node
EXPORTING
iv_type = zcl_aoc_boolean_node=>c_type-not.
IF io_tokens->get_token( 1 )-str = '('.
lv_end = io_tokens->find_end_paren( 1 ).
lo_split = io_tokens->eat( lv_end ).
ELSE.
lo_split = io_tokens->eat( 3 ).
ENDIF.
lo_node = parse_internal( lo_split ).
ro_node->append_child( lo_node ).
ENDMETHOD.
METHOD parse_paren.
DATA: lo_node TYPE REF TO zcl_aoc_boolean_node,
lv_end TYPE i,
lo_split TYPE REF TO zcl_aoc_boolean_tokens.
ASSERT io_tokens->get_token( 1 )-str = '('.
CREATE OBJECT ro_node
EXPORTING
iv_type = zcl_aoc_boolean_node=>c_type-paren.
lv_end = io_tokens->find_end_paren( 1 ).
lo_split = io_tokens->eat( lv_end ).
* remove start and end paren
lo_split = lo_split->split(
iv_start = 1
iv_end = lo_split->get_length( ) - 1 ).
lo_node = parse_internal( lo_split ).
ro_node->append_child( lo_node ).
ENDMETHOD.
METHOD remove_calculations.
DATA: lv_before TYPE i,
lt_tokens TYPE stokesx_tab,
ls_token LIKE LINE OF lt_tokens,
ls_prev LIKE LINE OF lt_tokens,
ls_next LIKE LINE OF lt_tokens,
lv_index TYPE i.
lt_tokens = io_tokens->get_tokens( ).
DO.
lv_before = lines( lt_tokens ).
LOOP AT lt_tokens INTO ls_token.
lv_index = sy-tabix.
CLEAR: ls_prev, ls_next.
READ TABLE lt_tokens INDEX lv_index - 1 INTO ls_prev. "#EC CI_SUBRC
READ TABLE lt_tokens INDEX lv_index + 1 INTO ls_next. "#EC CI_SUBRC
CASE ls_token-str.
WHEN '+' OR '-' OR '*' OR '/' OR 'MOD' OR 'DIV' OR 'BIT-AND' OR 'BIT-OR' OR '&&'.
IF ls_next-str <> '('
AND ls_prev-str <> '='
AND ls_prev-str <> '<>'
AND ls_prev-str <> '<'
AND ls_prev-str <> 'GT'
AND ls_prev-str <> '>'
AND ls_prev-str <> 'LT'
AND ls_prev-str <> '>='
AND ls_prev-str <> 'GE'
AND ls_prev-str <> 'NS'
AND ls_prev-str <> '<='
AND ls_prev-str <> 'LE'
AND ls_prev-str <> 'NE'
AND ls_prev-str <> 'NA'
AND ls_prev-str <> 'CO'
AND ls_prev-str <> 'CA'
AND ls_prev-str <> 'CS'
AND ls_prev-str <> 'CN'
AND ls_prev-str <> 'IN'
AND ls_prev-str <> 'CP'
AND ls_prev-str <> 'NP'
AND ls_prev-str <> 'IS'
AND ls_prev-str <> 'EQ'.
DO 2 TIMES.
DELETE lt_tokens INDEX lv_index.
ENDDO.
EXIT.
ENDIF.
ENDCASE.
* remove paren introduced by calculations
IF ls_prev-str = '(' AND ls_next-str = ')'.
DELETE lt_tokens INDEX lv_index + 1.
DELETE lt_tokens INDEX lv_index - 1.
EXIT.
ELSEIF ls_prev-str = '|' AND ls_next-str = '|'.
* quick workaround for string templates, todo
DELETE lt_tokens INDEX lv_index + 1.
DELETE lt_tokens INDEX lv_index - 1.
EXIT.
ENDIF.
ENDLOOP.
IF lines( lt_tokens ) = lv_before.
EXIT.
ENDIF.
ENDDO.
io_tokens->set_tokens( lt_tokens ).
ENDMETHOD.
METHOD remove_method_calls.
DATA: ls_token TYPE stokesx,
lv_end TYPE i,
lv_restart TYPE abap_bool,
lv_index TYPE i.
DO.
lv_restart = abap_false.
LOOP AT io_tokens->get_tokens( ) INTO ls_token.
lv_index = sy-tabix.
FIND REGEX '^[\w<>\/~\-=#]+\($' IN ls_token-str.
IF sy-subrc = 0.
lv_end = io_tokens->find_end_paren( lv_index ).
CASE io_tokens->get_token( lv_index - 1 )-str.
WHEN 'NEW' OR 'CONV' OR 'COND' OR 'VALUE'.
lv_index = lv_index - 1.
ENDCASE.
io_tokens->replace(
iv_str = 'METHOD'
iv_start = lv_index
iv_end = lv_end ).
lv_restart = abap_true.
EXIT.
ENDIF.
* table comprehensions
FIND REGEX '^[\w<>~\-=]+\[$' IN ls_token-str.
IF sy-subrc = 0.
lv_end = io_tokens->find_end_square( lv_index ).
io_tokens->replace(
iv_str = 'TABLEC'
iv_start = lv_index
iv_end = lv_end ).
lv_restart = abap_true.
EXIT.
ENDIF.
ENDLOOP.
IF lv_restart = abap_false.
EXIT.
ENDIF.
ENDDO.
ENDMETHOD.
METHOD remove_strings.
LOOP AT io_tokens->get_tokens( ) TRANSPORTING NO FIELDS WHERE type = scan_token_type-literal.
io_tokens->replace(
iv_str = 'str'
iv_start = sy-tabix ).
ENDLOOP.
ENDMETHOD.
METHOD remove_templates.
DATA: lv_start TYPE i,
lv_escaped TYPE i,
lv_index TYPE i,
lt_tokens TYPE stokesx_tab.
FIELD-SYMBOLS: <ls_token> LIKE LINE OF lt_tokens.
lt_tokens = io_tokens->get_tokens( ).
LOOP AT lt_tokens ASSIGNING <ls_token>.
lv_index = sy-tabix.
IF <ls_token>-str = '|' AND lv_start IS INITIAL.
<ls_token>-str = 'TEMPLATE'.
lv_start = lv_index.
ELSEIF <ls_token>-str = '{' AND NOT lv_start IS INITIAL.
lv_escaped = lv_escaped + 1.
ELSEIF <ls_token>-str = '}' AND NOT lv_start IS INITIAL.
lv_escaped = lv_escaped - 1.
ELSEIF <ls_token>-str = '|' AND lv_escaped = 0.
DELETE lt_tokens FROM lv_start + 1 TO lv_index.
ENDIF.
ENDLOOP.
io_tokens->set_tokens( lt_tokens ).
ENDMETHOD.
METHOD simplify.
* todo: string templates?
* todo: change identifiers, so no keywords are possible
CREATE OBJECT ro_tokens EXPORTING it_tokens = it_tokens.
remove_templates( ro_tokens ).
remove_strings( ro_tokens ).
remove_method_calls( ro_tokens ).
remove_calculations( ro_tokens ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
64,
420,
62,
2127,
21052,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
21136,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
83,
482,
641,
220,
220,
220,
220,
41876,
336,
3369,
87,
62,
8658,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
17440,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
17440,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
318,
62,
785,
1845,
1352,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
83,
482,
641,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
785,
1845,
1352,
8,
41876,
1312,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
21136,
62,
32538,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
83,
482,
641,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
17440,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
17440,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
21136,
62,
1662,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
83,
482,
641,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
17440,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
17440,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
21136,
62,
11730,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
83,
482,
641,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
17440,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
17440,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
4781,
62,
24396,
62,
66,
5691,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
83,
482,
641,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
4781,
62,
11498,
17041,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
83,
482,
641,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
30276,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
83,
482,
641,
220,
220,
220,
220,
220,
220,
41876,
336,
3369,
87,
62,
8658,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
83,
482,
641,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
4781,
62,
9948,
3129,
602,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
83,
482,
641,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
4781,
62,
37336,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
83,
482,
641,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
764,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
32,
4503,
62,
33,
6684,
2538,
1565,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
318,
62,
785,
1845,
1352,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
30001,
17,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
30001,
18,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
30001,
19,
41876,
4731,
13,
628,
198,
220,
220,
220,
300,
85,
62,
30001,
17,
796,
33245,
62,
83,
482,
641,
3784,
1136,
62,
30001,
7,
362,
1267,
12,
2536,
13,
198,
220,
220,
220,
300,
85,
62,
30001,
18,
796,
33245,
62,
83,
482,
641,
3784,
1136,
62,
30001,
7,
513,
1267,
12,
2536,
13,
198,
220,
220,
220,
300,
85,
62,
30001,
19,
796,
33245,
62,
83,
482,
641,
3784,
1136,
62,
30001,
7,
604,
1267,
12,
2536,
13,
628,
220,
220,
220,
374,
85,
62,
785,
1845,
1352,
796,
657,
13,
628,
220,
220,
220,
16876,
357,
300,
85,
62,
30001,
17,
796,
705,
1797,
6,
5357,
300,
85,
62,
30001,
18,
796,
705,
11929,
6,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
6375,
357,
300,
85,
62,
30001,
17,
796,
705,
11929,
6,
5357,
300,
85,
62,
30001,
18,
796,
705,
1268,
6,
6739,
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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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
] |
* regenerated at 05/10/2017 02:12:26
*******************************************************************
* System-defined Include-files. *
*******************************************************************
INCLUDE LZADF_FGTOP. " Global Data
INCLUDE LZADF_FGUXX. " Function Modules
*******************************************************************
* User-defined Include-files (if necessary). *
*******************************************************************
* INCLUDE LZADF_FGF... " Subroutines
* INCLUDE LZADF_FGO... " PBO-Modules
* INCLUDE LZADF_FGI... " PAI-Modules
* INCLUDE LZADF_FGE... " Events
* INCLUDE LZADF_FGP... " Local class implement.
* INCLUDE LZADF_FGT99. " ABAP Unit tests
INCLUDE LZADF_FGF00 . " subprograms
INCLUDE LZADF_FGI00 . " PAI modules
INCLUDE LSVIMFXX . " subprograms
INCLUDE LSVIMOXX . " PBO modules
INCLUDE LSVIMIXX . " PAI modules
*INCLUDE lzadf_fgf01.
INCLUDE lzadf_fgi01.
INCLUDE lzadf_fgf01.
| [
9,
16935,
515,
379,
8870,
14,
940,
14,
5539,
7816,
25,
1065,
25,
2075,
198,
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,
2885,
37,
62,
37,
19555,
3185,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
8060,
6060,
198,
220,
3268,
5097,
52,
7206,
406,
57,
2885,
37,
62,
30386,
52,
8051,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
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,
2885,
37,
62,
37,
21713,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
3834,
81,
448,
1127,
198,
9,
3268,
5097,
52,
7206,
406,
57,
2885,
37,
62,
37,
11230,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
350,
8202,
12,
5841,
5028,
198,
9,
3268,
5097,
52,
7206,
406,
57,
2885,
37,
62,
37,
18878,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
8147,
40,
12,
5841,
5028,
198,
9,
3268,
5097,
52,
7206,
406,
57,
2885,
37,
62,
37,
8264,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
18715,
198,
9,
3268,
5097,
52,
7206,
406,
57,
2885,
37,
62,
37,
16960,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
10714,
1398,
3494,
13,
198,
9,
3268,
5097,
52,
7206,
406,
57,
2885,
37,
62,
37,
19555,
2079,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
9564,
2969,
11801,
5254,
198,
220,
3268,
5097,
52,
7206,
406,
57,
2885,
37,
62,
37,
21713,
405,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
366,
850,
23065,
82,
198,
220,
3268,
5097,
52,
7206,
406,
57,
2885,
37,
62,
37,
18878,
405,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
366,
8147,
40,
13103,
198,
220,
3268,
5097,
52,
7206,
30948,
53,
3955,
37,
8051,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
366,
850,
23065,
82,
198,
220,
3268,
5097,
52,
7206,
30948,
53,
3955,
46,
8051,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
366,
350,
8202,
13103,
198,
220,
3268,
5097,
52,
7206,
30948,
53,
3955,
40,
8051,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
366,
8147,
40,
13103,
198,
198,
9,
1268,
5097,
52,
7206,
300,
89,
324,
69,
62,
40616,
69,
486,
13,
198,
198,
1268,
5097,
52,
7206,
300,
89,
324,
69,
62,
69,
12397,
486,
13,
198,
198,
1268,
5097,
52,
7206,
300,
89,
324,
69,
62,
40616,
69,
486,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
************************************************************************
************************************************************************
* ██████╗ ██████╗ ███████╗ *
* ██╔══██╗ ██╔════╝ ██╔════╝ *
* ██████╔╝ ██║ ███████╗ *
* ██╔══██╗ ██║ ╚════██║ *
* ██║ ██║██╗╚██████╗██╗███████║ *
* ╚═╝ ╚═╝╚═╝ ╚═════╝╚═╝╚══════╝ *
************************************************************************
************************************************************************
* Request Control System
* This tool enabble to:
* Standardize requests
* Copy request transport tool
* Log Transport
************************************************************************
* Gui Version(2008 - 2016)
* Bruno Rodrigues(BSR) - [email protected]
* Web Version(2016 - 2017)
* Bruno Rodrigues(BSR) - [email protected]
* Wanderson Oliveira - [email protected]
* Paulo Cabral - [email protected]
* Rafael Viana -
************************************************************************
* All rights Reserved©®
************************************************************************
class zcl_ca_ctrlreq_request definition
public
create public.
public section.
interfaces zif_ca_ctrlreq_request .
aliases:
cc_tipo for zif_ca_ctrlreq_request~cc_tipo,
cc_tipo_transporte for zif_ca_ctrlreq_request~cc_tipo_transporte.
methods constructor
importing
!i_request type ztca_requests-trkorr optional
!i_demanda type ztca_requests-demanda
!i_tipo_demanda type ztca_requests-tipo_demanda
!i_process_area type ztca_requests-process_area
!i_modulo type ztca_requests-modulo
!i_consultor type ztca_requests-consultor
!i_funcional type ztca_requests-funcional
!i_data type ztca_requests-data
!i_descricao_sem_prefixo type ztca_requests-as4text
!i_tipo_request type ztca_requests-trfunction
!i_request_origem type ztca_requests-request_origem .
protected section.
private section.
types: begin of ty_cod_request,
trkorr type e070-trkorr,
end of ty_cod_request,
tty_cod_requests type sorted table of ty_cod_request with unique key trkorr.
constants:
c_radix(3) value 'Rdx' type c .
constants:
c_cr(2) value 'CR' type c .
data gv_request type ztca_requests-trkorr .
data gv_modulo type ztca_requests-modulo .
data gv_consultor type ztca_requests-consultor .
data gv_funcional type ztca_requests-funcional .
data gv_data type ztca_requests-data .
data gv_descricao_sem_prefixo type ztca_requests-as4text .
data gv_tipo_request type ztca_requests-trfunction .
data gv_request_origem type ztca_requests-request_origem .
data gv_demanda type ztca_requests-demanda .
data gv_tipo_demanda type ztca_requests-tipo_demanda .
data gv_process_area type ztca_requests-process_area .
data gv_hora_exportacao type ztca_requests-horaex .
data gv_data_exportacao type ztca_requests-dataex .
methods libera_request_task
importing
i_request_ou_task type e070-trkorr
raising
zcx_ca_ctrlreq_excecoes.
endclass.
class zcl_ca_ctrlreq_request implementation.
method constructor.
me->gv_request = i_request.
me->gv_demanda = i_demanda.
me->gv_tipo_demanda = i_tipo_demanda.
me->gv_process_area = i_process_area.
me->gv_modulo = i_modulo.
me->gv_consultor = i_consultor.
me->gv_funcional = i_funcional.
me->gv_data = i_data.
me->gv_descricao_sem_prefixo = i_descricao_sem_prefixo.
me->gv_tipo_request = i_tipo_request.
me->gv_request_origem = i_request_origem.
endmethod.
method libera_request_task.
data et_messages type ctsgerrmsgs.
call function 'TRINT_RELEASE_REQUEST'
exporting
iv_trkorr = i_request_ou_task
iv_dialog = abap_off
iv_without_objects_check = abap_true
iv_without_locking = abap_true
importing
et_messages = et_messages
exceptions
cts_initialization_failure = 1
enqueue_failed = 2
no_authorization = 3
invalid_request = 4
request_already_released = 5
repeat_too_early = 6
object_lock_error = 7
object_check_error = 8
docu_missing = 9
db_access_error = 10
action_aborted_by_user = 11
export_failed = 12
execute_objects_check = 13
release_in_bg_mode = 14
release_in_bg_mode_w_objchk = 15
error_in_export_methods = 16
object_lang_error = 17
others = 18.
if sy-subrc <> 0.
if sy-subrc = 5.
raise exception type zcx_ca_ctrlreq_excecoes
exporting
textid = zcx_ca_ctrlreq_excecoes=>request_ja_liberada
request_task = i_request_ou_task.
else.
message id sy-msgid type sy-msgty
number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4
into data(ls_texto_mensagem).
raise exception type zcx_ca_ctrlreq_excecoes
exporting
textid = zcx_ca_ctrlreq_excecoes=>erro_liberar_request
mensagem_erro_liberar_request = ls_texto_mensagem
t_mensagens_erro = et_messages.
endif.
endif.
endmethod.
method zif_ca_ctrlreq_request~check_valido_copiar.
data lt_qtidade type i.
me->zif_ca_ctrlreq_request~is_valida_salvar( ).
if not ( me->gv_tipo_request = cc_tipo-workbench or
me->gv_tipo_request = cc_tipo-customizing ).
raise exception type zcx_ca_ctrlreq_excecoes
exporting
textid = zcx_ca_ctrlreq_excecoes=>erro_criar_copia.
endif.
* DATA(l_request_origem) = me->zif_ca_ctrlreq_request~get_request_origem( ).
*
* IF l_request_origem IS NOT INITIAL.
*
* RAISE EXCEPTION TYPE zcx_ca_ctrlreq_excecoes
* EXPORTING
* textid = zcx_ca_ctrlreq_excecoes=>campo_invalido
* msgv1 = text-007.
*
* ENDIF.
data(lo_banco_dados) = zcl_ca_ctrlreq_banco_dados=>get_instance( ).
"Seleciona as Tasks da Request original
data(lt_trkorr) = lo_banco_dados->get_task_request( me->gv_request ).
append me->gv_request to lt_trkorr.
"Verifica se a request tem objetos
select count(*)
from e071
into lt_qtidade
for all entries in lt_trkorr
where trkorr eq lt_trkorr-table_line.
if lt_qtidade = 0.
raise exception type zcx_ca_ctrlreq_excecoes
exporting
textid = zcx_ca_ctrlreq_excecoes=>request_sem_objetos.
endif.
endmethod.
method zif_ca_ctrlreq_request~check_valido_criar_referencia.
me->zif_ca_ctrlreq_request~is_valida_salvar( ).
if not ( me->gv_tipo_request = cc_tipo-workbench or
me->gv_tipo_request = cc_tipo-customizing ).
raise exception type zcx_ca_ctrlreq_excecoes
exporting
textid = zcx_ca_ctrlreq_excecoes=>erro_criar_copia.
endif.
endmethod.
method zif_ca_ctrlreq_request~cria_copia.
me->zif_ca_ctrlreq_request~check_valido_copiar( ).
r_request = cast zif_ca_ctrlreq_request( new zcl_ca_ctrlreq_request(
i_demanda = me->zif_ca_ctrlreq_request~get_demanda( )
i_tipo_demanda = me->zif_ca_ctrlreq_request~get_tipo_demanda( )
i_modulo = me->zif_ca_ctrlreq_request~get_modulo( )
i_consultor = me->zif_ca_ctrlreq_request~get_consultor( )
i_funcional = me->zif_ca_ctrlreq_request~get_funcional( )
i_data = me->zif_ca_ctrlreq_request~get_data( )
i_descricao_sem_prefixo = me->zif_ca_ctrlreq_request~get_descricao( )
i_tipo_request = cc_tipo-transporte_copia
i_request_origem = me->zif_ca_ctrlreq_request~get_request( )
i_process_area = me->zif_ca_ctrlreq_request~get_process_area( ) ) ).
endmethod.
method zif_ca_ctrlreq_request~cria_referencia.
me->zif_ca_ctrlreq_request~check_valido_criar_referencia( ).
r_request = cast zif_ca_ctrlreq_request( new zcl_ca_ctrlreq_request(
i_demanda = me->zif_ca_ctrlreq_request~get_demanda( )
i_tipo_demanda = me->zif_ca_ctrlreq_request~get_tipo_demanda( )
i_modulo = me->zif_ca_ctrlreq_request~get_modulo( )
i_consultor = me->zif_ca_ctrlreq_request~get_consultor( )
i_funcional = me->zif_ca_ctrlreq_request~get_funcional( )
i_data = me->zif_ca_ctrlreq_request~get_data( )
i_descricao_sem_prefixo = me->zif_ca_ctrlreq_request~get_descricao( )
i_tipo_request = me->zif_ca_ctrlreq_request~get_tipo_request( )
i_request_origem = me->zif_ca_ctrlreq_request~get_request( )
i_process_area = me->zif_ca_ctrlreq_request~get_process_area( ) ) ).
endmethod.
method zif_ca_ctrlreq_request~get_consultor.
r_consultor = gv_consultor .
endmethod.
method zif_ca_ctrlreq_request~get_data.
r_data = gv_data.
endmethod.
method zif_ca_ctrlreq_request~get_data_exportacao.
r_data_exportacao = gv_data_exportacao .
endmethod.
method zif_ca_ctrlreq_request~get_demanda.
r_demanda = gv_demanda.
endmethod.
method zif_ca_ctrlreq_request~get_descricao.
r_descricao = gv_descricao_sem_prefixo.
endmethod.
method zif_ca_ctrlreq_request~get_descricao_padrao_sotreq.
constants cc_separador type c length 1 value '_' ##NO_TEXT.
case gv_tipo_request.
when cc_tipo-workbench.
data(lv_tipo_request) = cc_tipo_transporte-workbench.
when cc_tipo-customizing.
lv_tipo_request = cc_tipo_transporte-customizing.
when cc_tipo-transporte_copia.
lv_tipo_request = cc_tipo_transporte-transporte_copia.
endcase.
concatenate lv_tipo_request gv_modulo gv_process_area into r_info_request separated by cc_separador.
concatenate gv_tipo_demanda gv_demanda into data(vl_demanda).
concatenate r_info_request vl_demanda gv_descricao_sem_prefixo into r_info_request separated by cc_separador.
endmethod.
method zif_ca_ctrlreq_request~get_funcional.
r_funcional = gv_funcional.
endmethod.
method zif_ca_ctrlreq_request~get_hora_exportacao.
r_hora_exportacao = gv_hora_exportacao .
endmethod.
method zif_ca_ctrlreq_request~get_modulo.
r_modulo = gv_modulo.
endmethod.
method zif_ca_ctrlreq_request~get_process_area.
r_process_area = gv_process_area.
endmethod.
method zif_ca_ctrlreq_request~get_request.
r_request = gv_request.
endmethod.
method zif_ca_ctrlreq_request~get_request_origem.
r_request_origem = gv_request_origem.
endmethod.
method zif_ca_ctrlreq_request~get_tasks.
if me->gv_request is initial.
raise exception type zcx_ca_ctrlreq_excecoes
exporting
textid = zcx_ca_ctrlreq_excecoes=>request_invalida.
endif.
"Seleciona as Tasks da Request original
rt_cod_request = zcl_ca_ctrlreq_banco_dados=>get_instance( )->get_task_request( me->gv_request ).
endmethod.
method zif_ca_ctrlreq_request~get_tasks_request_origem.
if me->zif_ca_ctrlreq_request~sou_uma_copia_valida( ) = abap_false.
raise exception type zcx_ca_ctrlreq_excecoes
exporting
textid = zcx_ca_ctrlreq_excecoes=>copia_invalida.
endif.
"Seleciona as Tasks da Request original
rt_cod_request = zcl_ca_ctrlreq_banco_dados=>get_instance( )->get_task_request( me->gv_request_origem ).
endmethod.
method zif_ca_ctrlreq_request~get_tipo_demanda.
r_tipo_demanda = gv_tipo_demanda.
endmethod.
method zif_ca_ctrlreq_request~get_tipo_request.
r_tipo_request = gv_tipo_request.
endmethod.
method zif_ca_ctrlreq_request~is_liberada.
constants: c_liberada type e070-trstatus value 'R',
c_liberada_n type e070-trstatus value 'N'.
try.
if zcl_ca_ctrlreq_banco_dados=>get_instance( )->get_status_request( me->gv_request ) = c_liberada or
zcl_ca_ctrlreq_banco_dados=>get_instance( )->get_status_request( me->gv_request ) = c_liberada_n.
r_resultado = abap_true.
endif.
catch zcx_ca_ctrlreq_excecoes.
endtry.
endmethod.
method zif_ca_ctrlreq_request~is_valida_salvar.
if gv_tipo_request is initial.
raise exception type zcx_ca_ctrlreq_excecoes
exporting
textid = zcx_ca_ctrlreq_excecoes=>campo_invalido
msgv1 = text-001.
endif.
if gv_modulo is initial.
raise exception type zcx_ca_ctrlreq_excecoes
exporting
textid = zcx_ca_ctrlreq_excecoes=>campo_invalido
msgv1 = text-002.
endif.
if gv_tipo_demanda is initial.
raise exception type zcx_ca_ctrlreq_excecoes
exporting
textid = zcx_ca_ctrlreq_excecoes=>campo_invalido
msgv1 = text-003.
endif.
if gv_demanda is initial.
raise exception type zcx_ca_ctrlreq_excecoes
exporting
textid = zcx_ca_ctrlreq_excecoes=>campo_invalido
msgv1 = text-004.
endif.
if gv_descricao_sem_prefixo is initial.
raise exception type zcx_ca_ctrlreq_excecoes
exporting
textid = zcx_ca_ctrlreq_excecoes=>campo_invalido
msgv1 = text-005.
endif.
if gv_process_area is initial.
raise exception type zcx_ca_ctrlreq_excecoes
exporting
textid = zcx_ca_ctrlreq_excecoes=>campo_invalido
msgv1 = text-006.
endif.
endmethod.
method zif_ca_ctrlreq_request~is_workbench.
if gv_tipo_request = cc_tipo-workbench.
r_workbench = abap_true.
else.
r_workbench = abap_false.
endif.
endmethod.
method zif_ca_ctrlreq_request~release_request.
data et_messages type ctsgerrmsgs.
if me->gv_request is initial.
raise exception type zcx_ca_ctrlreq_excecoes
exporting
textid = zcx_ca_ctrlreq_excecoes=>request_invalida.
endif.
me->zif_ca_ctrlreq_request~is_valida_salvar( ).
zcl_ca_ctrlreq_bapis_requests=>get_instance( )->liberar_request( me ).
endmethod.
method zif_ca_ctrlreq_request~set_data_exportacao.
gv_data_exportacao = i_data_exportacao.
endmethod.
method zif_ca_ctrlreq_request~set_descricao.
gv_descricao_sem_prefixo = i_descricao.
endmethod.
method zif_ca_ctrlreq_request~set_hora_exportacao.
gv_hora_exportacao = i_hora_exportacao.
endmethod.
method zif_ca_ctrlreq_request~set_process_area.
gv_process_area = i_process_area.
endmethod.
method zif_ca_ctrlreq_request~set_request.
gv_request = i_request.
endmethod.
method zif_ca_ctrlreq_request~set_request_origem.
gv_request_origem = i_request_origem.
endmethod.
method zif_ca_ctrlreq_request~set_tipo_request.
gv_tipo_request = i_tipo_request.
endmethod.
method zif_ca_ctrlreq_request~sou_uma_copia_valida.
r_resultado = abap_true.
try.
me->zif_ca_ctrlreq_request~is_valida_salvar( ).
catch zcx_ca_ctrlreq_excecoes.
r_resultado = abap_false.
return.
endtry.
if me->gv_tipo_request <> cc_tipo-transporte_copia.
r_resultado = abap_false.
return.
endif.
if me->zif_ca_ctrlreq_request~get_request_origem( ) is initial.
r_resultado = abap_false.
return.
endif.
endmethod.
method zif_ca_ctrlreq_request~importar_imediat_qa.
zcl_ca_ctrlreq_bapis_requests=>get_instance( )->importar_request( me ).
endmethod.
endclass.
| [
17174,
17174,
4557,
198,
17174,
17174,
4557,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23287,
20503,
8115,
22880,
245,
220,
220,
220,
220,
23287,
20503,
8115,
22880,
245,
220,
220,
23287,
20503,
9968,
22880,
245,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23287,
8115,
22880,
242,
31732,
9968,
22880,
245,
220,
220,
23287,
8115,
22880,
242,
31732,
31732,
22880,
251,
220,
220,
23287,
8115,
22880,
242,
31732,
31732,
22880,
251,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23287,
20503,
8115,
22880,
242,
22880,
251,
220,
220,
23287,
8115,
22880,
239,
220,
220,
220,
220,
220,
220,
220,
23287,
20503,
9968,
22880,
245,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23287,
8115,
22880,
242,
31732,
9968,
22880,
245,
220,
220,
23287,
8115,
22880,
239,
220,
220,
220,
220,
220,
220,
220,
2343,
243,
248,
31732,
31732,
9968,
22880,
239,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23287,
8115,
22880,
239,
220,
23287,
8115,
22880,
239,
9968,
22880,
245,
22880,
248,
20503,
9968,
22880,
245,
9968,
22880,
245,
20503,
9968,
8115,
22880,
239,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2343,
243,
248,
28670,
22880,
251,
220,
2343,
243,
248,
28670,
22880,
251,
22880,
248,
28670,
22880,
251,
2343,
243,
248,
31732,
31732,
28670,
22880,
251,
22880,
248,
28670,
22880,
251,
22880,
248,
31732,
31732,
31732,
22880,
251,
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,
4557,
198,
17174,
17174,
4557,
198,
9,
19390,
6779,
4482,
198,
9,
770,
2891,
551,
397,
903,
284,
25,
198,
9,
8997,
1096,
7007,
198,
9,
17393,
2581,
4839,
2891,
198,
9,
5972,
19940,
198,
17174,
17174,
4557,
198,
9,
1962,
72,
10628,
7,
11528,
532,
1584,
8,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31045,
16114,
947,
7,
4462,
49,
8,
532,
45033,
418,
346,
6862,
13,
81,
31,
14816,
13,
785,
198,
9,
5313,
10628,
7,
5304,
532,
2177,
8,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31045,
16114,
947,
7,
4462,
49,
8,
532,
45033,
418,
346,
6862,
13,
81,
31,
14816,
13,
785,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22420,
882,
30012,
8704,
220,
220,
532,
11569,
882,
13,
86,
418,
31,
14816,
13,
785,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34410,
15976,
1373,
220,
220,
220,
220,
220,
220,
220,
220,
532,
279,
2518,
1219,
1416,
397,
1373,
31,
14816,
13,
785,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31918,
569,
7484,
220,
220,
220,
220,
220,
220,
220,
220,
532,
198,
17174,
17174,
4557,
198,
9,
1439,
2489,
33876,
16224,
7461,
198,
17174,
17174,
4557,
628,
1398,
1976,
565,
62,
6888,
62,
44755,
42180,
62,
25927,
6770,
198,
220,
1171,
198,
220,
2251,
1171,
13,
628,
220,
220,
1171,
2665,
13,
628,
220,
220,
220,
220,
20314,
1976,
361,
62,
6888,
62,
44755,
42180,
62,
25927,
764,
628,
220,
220,
220,
220,
47217,
25,
198,
220,
220,
220,
220,
220,
36624,
62,
22504,
78,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
329,
1976,
361,
62,
6888,
62,
44755,
42180,
62,
25927,
93,
535,
62,
22504,
78,
11,
198,
220,
220,
220,
220,
220,
36624,
62,
22504,
78,
62,
7645,
634,
68,
329,
1976,
361,
62,
6888,
62,
44755,
42180,
62,
25927,
93,
535,
62,
22504,
78,
62,
7645,
634,
68,
13,
628,
220,
220,
220,
220,
5050,
23772,
198,
220,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
25927,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
1976,
83,
6888,
62,
8897,
3558,
12,
2213,
74,
38890,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
9536,
5282,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
1976,
83,
6888,
62,
8897,
3558,
12,
9536,
5282,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
22504,
78,
62,
9536,
5282,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
1976,
83,
6888,
62,
8897,
3558,
12,
22504,
78,
62,
9536,
5282,
198,
220,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
14681,
62,
20337,
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
] |
"!@testing /DMO/I_TRAVEL_TUM
class ztc_bo_tdf_v2_trans_buff4 definition
public
final
create public
for testing
duration short
risk level harmless.
public section.
protected section.
private section.
endclass.
class ztc_bo_tdf_v2_trans_buff4 implementation.
endclass.
| [
40484,
31,
33407,
1220,
35,
11770,
14,
40,
62,
51,
3861,
18697,
62,
51,
5883,
198,
4871,
1976,
23047,
62,
2127,
62,
83,
7568,
62,
85,
17,
62,
7645,
62,
36873,
19,
6770,
198,
220,
1171,
198,
220,
2457,
198,
220,
2251,
1171,
198,
220,
329,
4856,
198,
220,
9478,
1790,
198,
220,
2526,
1241,
23585,
13,
628,
220,
1171,
2665,
13,
198,
220,
6861,
2665,
13,
198,
220,
2839,
2665,
13,
198,
198,
437,
4871,
13,
628,
198,
198,
4871,
1976,
23047,
62,
2127,
62,
83,
7568,
62,
85,
17,
62,
7645,
62,
36873,
19,
7822,
13,
198,
198,
437,
4871,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
FUNCTION zgtt_mia_ote_dl_item.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(I_APPSYS) TYPE /SAPTRX/APPLSYSTEM
*" REFERENCE(I_APP_OBJ_TYPES) TYPE /SAPTRX/AOTYPES
*" REFERENCE(I_ALL_APPL_TABLES) TYPE TRXAS_TABCONTAINER
*" REFERENCE(I_APP_TYPE_CNTL_TABS) TYPE TRXAS_APPTYPE_TABS
*" REFERENCE(I_APP_OBJECTS) TYPE TRXAS_APPOBJ_CTABS
*" TABLES
*" E_CONTROL_DATA STRUCTURE /SAPTRX/CONTROL_DATA
*" E_LOGTABLE STRUCTURE BAPIRET2 OPTIONAL
*" EXCEPTIONS
*" PARAMETER_ERROR
*" CDATA_DETERMINATION_ERROR
*" TABLE_DETERMINATION_ERROR
*" STOP_PROCESSING
*"----------------------------------------------------------------------
DATA: lo_udm_message TYPE REF TO cx_udm_message,
ls_bapiret TYPE bapiret2.
TRY.
zcl_gtt_mia_ef_performer=>get_control_data(
EXPORTING
is_definition = VALUE #(
maintab = zif_gtt_mia_app_constants=>cs_tabledef-dl_item_new
mastertab = zif_gtt_mia_app_constants=>cs_tabledef-dl_header_new )
io_tp_factory = NEW zcl_gtt_mia_tp_factory_dli( )
iv_appsys = i_appsys
is_app_obj_types = i_app_obj_types
it_all_appl_tables = i_all_appl_tables
it_app_type_cntl_tabs = i_app_type_cntl_tabs
it_app_objects = i_app_objects
CHANGING
ct_control_data = e_control_data[] ).
CATCH cx_udm_message INTO lo_udm_message.
zcl_gtt_mia_tools=>get_errors_log(
EXPORTING
io_umd_message = lo_udm_message
iv_appsys = i_appsys
IMPORTING
es_bapiret = ls_bapiret ).
" add error message
APPEND ls_bapiret TO e_logtable.
" throw corresponding exception
CASE lo_udm_message->textid.
WHEN zif_gtt_mia_ef_constants=>cs_errors-stop_processing.
RAISE stop_processing.
WHEN zif_gtt_mia_ef_constants=>cs_errors-table_determination.
RAISE table_determination_error.
ENDCASE.
ENDTRY.
ENDFUNCTION.
| [
42296,
4177,
2849,
1976,
70,
926,
62,
20730,
62,
1258,
62,
25404,
62,
9186,
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,
40,
62,
2969,
3705,
16309,
8,
41876,
220,
1220,
50,
2969,
5446,
55,
14,
2969,
6489,
23060,
25361,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
40,
62,
24805,
62,
9864,
41,
62,
9936,
47,
1546,
8,
41876,
220,
1220,
50,
2969,
5446,
55,
14,
32,
2394,
48232,
1546,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
40,
62,
7036,
62,
2969,
6489,
62,
5603,
9148,
1546,
8,
41876,
220,
7579,
55,
1921,
62,
5603,
2749,
1340,
30339,
1137,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
40,
62,
24805,
62,
25216,
62,
34,
11251,
43,
62,
5603,
4462,
8,
41876,
220,
7579,
55,
1921,
62,
24805,
25216,
62,
5603,
4462,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
40,
62,
24805,
62,
9864,
41,
2943,
4694,
8,
41876,
220,
7579,
55,
1921,
62,
24805,
9864,
41,
62,
4177,
32,
4462,
198,
9,
1,
220,
309,
6242,
28378,
198,
9,
1,
220,
220,
220,
220,
220,
412,
62,
10943,
5446,
3535,
62,
26947,
19269,
18415,
11335,
220,
1220,
50,
2969,
5446,
55,
14,
10943,
5446,
3535,
62,
26947,
198,
9,
1,
220,
220,
220,
220,
220,
412,
62,
25294,
38148,
19269,
18415,
11335,
220,
347,
17614,
26087,
17,
39852,
2849,
1847,
198,
9,
1,
220,
7788,
42006,
11053,
198,
9,
1,
220,
220,
220,
220,
220,
29463,
2390,
2767,
1137,
62,
24908,
198,
9,
1,
220,
220,
220,
220,
220,
6458,
13563,
62,
35,
2767,
1137,
23678,
6234,
62,
24908,
198,
9,
1,
220,
220,
220,
220,
220,
43679,
62,
35,
2767,
1137,
23678,
6234,
62,
24908,
198,
9,
1,
220,
220,
220,
220,
220,
44934,
62,
4805,
4503,
7597,
2751,
198,
9,
1,
10097,
23031,
198,
220,
42865,
25,
2376,
62,
463,
76,
62,
20500,
41876,
4526,
37,
5390,
43213,
62,
463,
76,
62,
20500,
11,
198,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
65,
499,
557,
83,
220,
220,
220,
220,
41876,
275,
499,
557,
83,
17,
13,
628,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
1976,
565,
62,
70,
926,
62,
20730,
62,
891,
62,
525,
16354,
14804,
1136,
62,
13716,
62,
7890,
7,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
46758,
220,
220,
220,
220,
220,
220,
220,
220,
796,
26173,
8924,
1303,
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,
220,
220,
220,
1388,
8658,
220,
220,
796,
1976,
361,
62,
70,
926,
62,
20730,
62,
1324,
62,
9979,
1187,
14804,
6359,
62,
83,
4510,
891,
12,
25404,
62,
9186,
62,
3605,
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,
4958,
8658,
796,
1976,
361,
62,
70,
926,
62,
20730,
62,
1324,
62,
9979,
1187,
14804,
6359,
62,
83,
4510,
891,
12,
25404,
62,
25677,
62,
3605,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
34788,
62,
69,
9548,
220,
220,
220,
220,
220,
220,
220,
220,
796,
12682,
1976,
565,
62,
70,
926,
62,
20730,
62,
34788,
62,
69,
9548,
62,
67,
4528,
7,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
1324,
17597,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
1312,
62,
1324,
17597,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
1324,
62,
26801,
62,
19199,
220,
220,
220,
220,
220,
796,
1312,
62,
1324,
62,
26801,
62,
19199,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
439,
62,
1324,
75,
62,
83,
2977,
220,
220,
220,
796,
1312,
62,
439,
62,
1324,
75,
62,
83,
2977,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
1324,
62,
4906,
62,
66,
429,
75,
62,
8658,
82,
796,
1312,
62,
1324,
62,
4906,
62,
66,
429,
75,
62,
8658,
82,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
1324,
62,
48205,
220,
220,
220,
220,
220,
220,
220,
796,
1312,
62,
1324,
62,
48205,
198,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
83,
62,
13716,
62,
7890,
220,
220,
220,
220,
220,
220,
796,
304,
62,
13716,
62,
7890,
21737,
6739,
628,
220,
220,
220,
327,
11417,
43213,
62,
463,
76,
62,
20500,
39319,
2376,
62,
463,
76,
62,
20500,
13,
198,
220,
220,
220,
220,
220,
1976,
565,
62,
70,
926,
62,
20730,
62,
31391,
14804,
1136,
62,
48277,
62,
6404,
7,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
388,
67,
62,
20500,
796,
2376,
62,
463,
76,
62,
20500,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
1324,
17597,
220,
220,
220,
220,
220,
796,
1312,
62,
1324,
17597,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1658,
62,
65,
499,
557,
83,
220,
220,
220,
220,
796,
43979,
62,
65,
499,
557,
83,
6739,
628,
220,
220,
220,
220,
220,
366,
751,
4049,
3275,
198,
220,
220,
220,
220,
220,
43504,
10619,
43979,
62,
65,
499,
557,
83,
5390,
304,
62,
6404,
11487,
13,
628,
220,
220,
220,
220,
220,
366,
3714,
11188,
6631,
198,
220,
220,
220,
220,
220,
42001,
2376,
62,
463,
76,
62,
20500,
3784,
5239,
312,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42099,
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,
1,
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
] |
REPORT zaoc_orphaned_includes.
TABLES: tadir.
TYPES: BEGIN OF ty_output,
obj_name TYPE tadir-obj_name,
devclass TYPE tadir-devclass,
genflag TYPE tadir-genflag,
END OF ty_output.
SELECT-OPTIONS: s_devc FOR tadir-devclass OBLIGATORY.
START-OF-SELECTION.
PERFORM run.
FORM run RAISING cx_salv_msg.
DATA: lt_tadir TYPE STANDARD TABLE OF tadir WITH DEFAULT KEY,
lv_subc TYPE reposrc-subc,
lo_alv TYPE REF TO cl_salv_table,
lt_usage TYPE senvi_tab,
lt_output TYPE STANDARD TABLE OF ty_output WITH DEFAULT KEY,
lt_main TYPE STANDARD TABLE OF program WITH NON-UNIQUE DEFAULT KEY.
FIELD-SYMBOLS: <ls_output> LIKE LINE OF lt_output,
<ls_tadir> LIKE LINE OF lt_tadir.
SELECT * FROM tadir INTO TABLE lt_tadir
WHERE devclass IN s_devc
AND pgmid = 'R3TR'
AND object = 'PROG'. "#EC CI_GENBUFF "#EC CI_SUBRC
LOOP AT lt_tadir ASSIGNING <ls_tadir>.
SELECT SINGLE subc INTO lv_subc FROM reposrc
WHERE progname = <ls_tadir>-obj_name AND r3state = 'A'.
IF sy-subrc <> 0 OR lv_subc <> 'I'.
CONTINUE.
ENDIF.
CLEAR lt_main.
CALL FUNCTION 'RS_GET_MAINPROGRAMS'
EXPORTING
name = <ls_tadir>-obj_name
TABLES
mainprograms = lt_main
EXCEPTIONS
cancelled = 1
OTHERS = 2.
IF sy-subrc <> 0 OR lines( lt_main ) > 0.
CONTINUE.
ENDIF.
* sometimes the main program is not generated, so also check where-used,
CLEAR lt_usage.
CALL FUNCTION 'REPOSITORY_ENVIRONMENT_SET'
EXPORTING
obj_type = 'PROG'
object_name = <ls_tadir>-obj_name
online_force = abap_true
TABLES
environment = lt_usage
EXCEPTIONS
batch = 1
batchjob_error = 2
not_executed = 3
OTHERS = 4.
IF lines( lt_usage ) > 0.
CONTINUE.
ENDIF.
APPEND INITIAL LINE TO lt_output ASSIGNING <ls_output>.
MOVE-CORRESPONDING <ls_tadir> TO <ls_output>.
ENDLOOP.
cl_salv_table=>factory(
IMPORTING
r_salv_table = lo_alv
CHANGING
t_table = lt_output ).
lo_alv->get_functions( )->set_all( ).
lo_alv->display( ).
ENDFORM.
| [
2200,
15490,
1976,
64,
420,
62,
13425,
22739,
62,
42813,
13,
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,
26181,
62,
3672,
41876,
36264,
343,
12,
26801,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
1614,
4871,
41876,
36264,
343,
12,
7959,
4871,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
2429,
32109,
220,
41876,
36264,
343,
12,
5235,
32109,
11,
198,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
22915,
13,
198,
198,
46506,
12,
3185,
51,
11053,
25,
264,
62,
7959,
66,
7473,
36264,
343,
12,
7959,
4871,
440,
9148,
3528,
1404,
15513,
13,
198,
198,
2257,
7227,
12,
19238,
12,
46506,
2849,
13,
198,
220,
19878,
21389,
1057,
13,
198,
198,
21389,
1057,
17926,
1797,
2751,
43213,
62,
21680,
85,
62,
19662,
13,
628,
220,
42865,
25,
300,
83,
62,
83,
324,
343,
220,
41876,
49053,
9795,
43679,
3963,
36264,
343,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
7266,
66,
220,
220,
41876,
1128,
418,
6015,
12,
7266,
66,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
282,
85,
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,
26060,
220,
41876,
3308,
8903,
62,
8658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
22915,
41876,
49053,
9795,
43679,
3963,
1259,
62,
22915,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
12417,
220,
220,
41876,
49053,
9795,
43679,
3963,
1430,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
13,
628,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
22915,
29,
34178,
48920,
3963,
300,
83,
62,
22915,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1279,
7278,
62,
83,
324,
343,
29,
220,
34178,
48920,
3963,
300,
83,
62,
83,
324,
343,
13,
628,
220,
33493,
1635,
16034,
36264,
343,
39319,
43679,
300,
83,
62,
83,
324,
343,
198,
220,
220,
220,
33411,
1614,
4871,
3268,
264,
62,
7959,
66,
198,
220,
220,
220,
5357,
23241,
13602,
796,
705,
49,
18,
5446,
6,
198,
220,
220,
220,
5357,
2134,
796,
705,
4805,
7730,
4458,
220,
220,
220,
220,
220,
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,
24994,
3528,
15871,
1279,
7278,
62,
83,
324,
343,
28401,
198,
220,
220,
220,
33493,
311,
2751,
2538,
850,
66,
39319,
300,
85,
62,
7266,
66,
16034,
1128,
418,
6015,
198,
220,
220,
220,
220,
220,
33411,
1172,
3672,
796,
1279,
7278,
62,
83,
324,
343,
29,
12,
26801,
62,
3672,
5357,
374,
18,
5219,
796,
705,
32,
4458,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
6375,
300,
85,
62,
7266,
66,
1279,
29,
705,
40,
4458,
198,
220,
220,
220,
220,
220,
43659,
8924,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
30301,
1503,
300,
83,
62,
12417,
13,
198,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
6998,
62,
18851,
62,
5673,
1268,
4805,
7730,
24115,
50,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
220,
220,
220,
796,
1279,
7278,
62,
83,
324,
343,
29,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
309,
6242,
28378,
198,
220,
220,
220,
220,
220,
220,
220,
1388,
23065,
82,
796,
300,
83,
62,
12417,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
16769,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
796,
362,
13,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
6375,
3951,
7,
300,
83,
62,
12417,
1267,
1875,
657,
13,
198,
220,
220,
220,
220,
220,
43659,
8924,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
198,
9,
3360,
262,
1388,
1430,
318,
407,
7560,
11,
523,
635,
2198,
810,
12,
1484,
11,
198,
220,
220,
220,
30301,
1503,
300,
83,
62,
26060,
13,
198,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
35316,
2640,
2043,
15513,
62,
1677,
53,
4663,
1340,
10979,
62,
28480,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
26181,
62,
4906,
220,
220,
220,
220,
220,
220,
796,
705,
4805,
7730,
6,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
3672,
220,
220,
220,
796,
1279,
7278,
62,
83,
324,
343,
29,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
2691,
62,
3174,
220,
220,
796,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
309,
6242,
28378,
198,
220,
220,
220,
220,
220,
220,
220,
2858,
220,
220,
220,
796,
300,
83,
62,
26060,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
15458,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
15458,
21858,
62,
18224,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
407,
62,
18558,
7241,
220,
220,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
796,
604,
13,
198,
220,
220,
220,
16876,
3951,
7,
300,
83,
62,
26060,
1267,
1875,
657,
13,
198,
220,
220,
220,
220,
220,
43659,
8924,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
43504,
10619,
3268,
2043,
12576,
48920,
5390,
300,
83,
62,
22915,
24994,
3528,
15871,
1279,
7278,
62,
22915,
28401,
198,
220,
220,
220,
13070,
6089,
12,
44879,
19535
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_gui_page_codi_base DEFINITION PUBLIC ABSTRACT INHERITING FROM zcl_abapgit_gui_page.
PUBLIC SECTION.
METHODS:
zif_abapgit_gui_event_handler~on_event
REDEFINITION.
PROTECTED SECTION.
CONSTANTS:
BEGIN OF c_actions,
rerun TYPE string VALUE 'rerun' ##NO_TEXT,
sort_1 TYPE string VALUE 'sort_1' ##NO_TEXT,
sort_2 TYPE string VALUE 'sort_2' ##NO_TEXT,
sort_3 TYPE string VALUE 'sort_3' ##NO_TEXT,
stage TYPE string VALUE 'stage' ##NO_TEXT,
commit TYPE string VALUE 'commit' ##NO_TEXT,
END OF c_actions .
DATA mo_repo TYPE REF TO zcl_abapgit_repo .
DATA mt_result TYPE scit_alvlist .
METHODS render_variant
IMPORTING
!iv_variant TYPE sci_chkv
RETURNING
VALUE(ri_html) TYPE REF TO zif_abapgit_html .
METHODS render_result
IMPORTING
!ii_html TYPE REF TO zif_abapgit_html
!it_result TYPE scit_alvlist .
METHODS render_result_line
IMPORTING
!ii_html TYPE REF TO zif_abapgit_html
!is_result TYPE scir_alvlist .
METHODS build_nav_link
IMPORTING
!is_result TYPE scir_alvlist
RETURNING
VALUE(rv_link) TYPE string .
METHODS jump
IMPORTING
!is_item TYPE zif_abapgit_definitions=>ty_item
!is_sub_item TYPE zif_abapgit_definitions=>ty_item
!iv_line_number TYPE i
RAISING
zcx_abapgit_exception .
METHODS build_base_menu
RETURNING
VALUE(ro_menu) TYPE REF TO zcl_abapgit_html_toolbar .
PRIVATE SECTION.
CONSTANTS c_object_separator TYPE c LENGTH 1 VALUE '|'.
CONSTANTS c_ci_sig TYPE string VALUE 'cinav:'.
ENDCLASS.
CLASS zcl_abapgit_gui_page_codi_base IMPLEMENTATION.
METHOD build_base_menu.
DATA:
lo_sort_menu TYPE REF TO zcl_abapgit_html_toolbar.
CREATE OBJECT lo_sort_menu.
lo_sort_menu->add(
iv_txt = 'By Object, Check, Sub-object'
iv_act = c_actions-sort_1
)->add(
iv_txt = 'By Object, Sub-object, Line'
iv_act = c_actions-sort_2
)->add(
iv_txt = 'By Check, Object, Sub-object'
iv_act = c_actions-sort_3 ).
CREATE OBJECT ro_menu.
ro_menu->add( iv_txt = 'Sort'
io_sub = lo_sort_menu ).
ro_menu->add( iv_txt = 'Re-Run'
iv_act = c_actions-rerun
iv_cur = abap_false ).
ENDMETHOD.
METHOD build_nav_link.
rv_link = |{ c_ci_sig }| &&
|{ is_result-objtype }{ is_result-objname }| &&
|{ c_object_separator }{ is_result-sobjtype }{ is_result-sobjname }| &&
|{ c_object_separator }{ is_result-line }|.
ENDMETHOD.
METHOD jump.
DATA: lo_test TYPE REF TO cl_ci_test_root,
ls_info TYPE scir_rest,
lo_result TYPE REF TO cl_ci_result_root,
lv_adt_jump_enabled TYPE abap_bool,
lv_line_number TYPE i,
ls_item TYPE zif_abapgit_definitions=>ty_item,
ls_sub_item TYPE zif_abapgit_definitions=>ty_item.
FIELD-SYMBOLS: <ls_result> TYPE scir_alvlist.
IF is_sub_item IS NOT INITIAL.
READ TABLE mt_result WITH KEY objtype = is_item-obj_type
objname = is_item-obj_name
sobjtype = is_sub_item-obj_type
sobjname = is_sub_item-obj_name
line = iv_line_number
ASSIGNING <ls_result>.
ELSE.
READ TABLE mt_result WITH KEY objtype = is_item-obj_type
objname = is_item-obj_name
line = iv_line_number
ASSIGNING <ls_result>.
ENDIF.
ASSERT <ls_result> IS ASSIGNED.
ls_item-obj_name = <ls_result>-objname.
ls_item-obj_type = <ls_result>-objtype.
ls_sub_item-obj_name = <ls_result>-sobjname.
ls_sub_item-obj_type = <ls_result>-sobjtype.
" see SCI_LCL_DYNP_530 / HANDLE_DOUBLE_CLICK
lv_adt_jump_enabled = zcl_abapgit_persist_factory=>get_settings( )->read( )->get_adt_jump_enabled( ).
TRY.
IF lv_adt_jump_enabled = abap_true.
lv_line_number = <ls_result>-line.
zcl_abapgit_objects=>jump(
is_item = ls_item
iv_sub_obj_name = ls_sub_item-obj_name
iv_line_number = lv_line_number ).
RETURN.
ENDIF.
CATCH zcx_abapgit_exception.
ENDTRY.
TRY.
CALL METHOD ('CL_CI_TESTS')=>('GET_TEST_REF')
EXPORTING
p_test = <ls_result>-test
RECEIVING
p_result = lo_test.
CATCH cx_root.
zcx_abapgit_exception=>raise( |Jump to object not supported in your NW release| ).
ENDTRY.
lo_result = lo_test->get_result_node( <ls_result>-kind ).
MOVE-CORRESPONDING <ls_result> TO ls_info.
lo_result->set_info( ls_info ).
lo_result->if_ci_test~navigate( ).
ENDMETHOD.
METHOD render_result.
CONSTANTS: lc_limit TYPE i VALUE 500.
FIELD-SYMBOLS: <ls_result> TYPE scir_alvlist.
ii_html->add( '<div class="ci-result">' ).
LOOP AT it_result ASSIGNING <ls_result> TO lc_limit.
render_result_line(
ii_html = ii_html
is_result = <ls_result> ).
ENDLOOP.
ii_html->add( '</div>' ).
IF lines( it_result ) > lc_limit.
ii_html->add( '<div class="dummydiv warning">' ).
ii_html->add( ii_html->icon( 'exclamation-triangle' ) ).
ii_html->add( |Only first { lc_limit } findings shown in list!| ).
ii_html->add( '</div>' ).
ENDIF.
ENDMETHOD.
METHOD render_result_line.
DATA: lv_class TYPE string,
lv_obj_txt TYPE string,
lv_msg TYPE string,
lv_line TYPE i,
ls_mtdkey TYPE seocpdkey.
CASE is_result-kind.
WHEN 'E'.
lv_class = 'ci-error'.
WHEN 'W'.
lv_class = 'ci-warning'.
WHEN OTHERS.
lv_class = 'ci-info'.
ENDCASE.
lv_msg = escape( val = is_result-text
format = cl_abap_format=>e_html_attr ).
IF is_result-sobjname IS INITIAL OR
( is_result-sobjname = is_result-objname AND
is_result-sobjtype = is_result-objtype ).
lv_obj_txt = |{ is_result-objtype } { is_result-objname }|.
ELSEIF is_result-objtype = 'CLAS' OR
( is_result-objtype = 'PROG' AND NOT is_result-sobjname+30(*) IS INITIAL ).
TRY.
CASE is_result-sobjname+30(*).
WHEN 'CCDEF'.
lv_obj_txt = |CLAS { is_result-objname } : Local Definitions|.
WHEN 'CCIMP'.
lv_obj_txt = |CLAS { is_result-objname } : Local Implementations|.
WHEN 'CCMAC'.
lv_obj_txt = |CLAS { is_result-objname } : Macros|.
WHEN 'CCAU'.
lv_obj_txt = |CLAS { is_result-objname } : Test Classes|.
WHEN 'CU'.
lv_obj_txt = |CLAS { is_result-objname } : Public Section|.
WHEN 'CO'.
lv_obj_txt = |CLAS { is_result-objname } : Protected Section|.
WHEN 'CI'.
lv_obj_txt = |CLAS { is_result-objname } : Private Section|.
WHEN OTHERS.
cl_oo_classname_service=>get_method_by_include(
EXPORTING
incname = is_result-sobjname
RECEIVING
mtdkey = ls_mtdkey
EXCEPTIONS
class_not_existing = 1
method_not_existing = 2
OTHERS = 3 ).
IF sy-subrc = 0.
lv_obj_txt = |CLAS { ls_mtdkey-clsname }->{ ls_mtdkey-cpdname }|.
ELSE.
lv_obj_txt = |{ is_result-objtype } { is_result-sobjname }|.
ENDIF.
ENDCASE.
CATCH cx_root.
lv_obj_txt = ''. "use default below
ENDTRY.
ENDIF.
IF lv_obj_txt IS INITIAL.
lv_obj_txt = |{ is_result-objtype } { is_result-objname } > { is_result-sobjtype } { is_result-sobjname }|.
ENDIF.
lv_line = is_result-line. " convert from numc to integer
lv_obj_txt = |{ lv_obj_txt } [ @{ lv_line } ]|.
ii_html->add( |<li class="{ lv_class }">| ).
ii_html->add_a(
iv_txt = lv_obj_txt
iv_act = build_nav_link( is_result )
iv_typ = zif_abapgit_html=>c_action_type-sapevent ).
ii_html->add( |<span>{ lv_msg }</span>| ).
ii_html->add( '</li>' ).
ENDMETHOD.
METHOD render_variant.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->add( '<div class="ci-head">' ).
ri_html->add( |Code inspector check variant: <span class="ci-variant">{ iv_variant }</span>| ).
ri_html->add( `</div>` ).
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
DATA: ls_item TYPE zif_abapgit_definitions=>ty_item,
ls_sub_item TYPE zif_abapgit_definitions=>ty_item,
lv_temp TYPE string,
lv_main_object TYPE string,
lv_sub_object TYPE string,
lv_line_number_s TYPE string,
lv_line_number TYPE i.
lv_temp = replace( val = ii_event->mv_action
regex = |^{ c_ci_sig }|
with = `` ).
IF lv_temp <> ii_event->mv_action. " CI navigation request detected
SPLIT lv_temp AT c_object_separator INTO lv_main_object lv_sub_object lv_line_number_s.
ls_item-obj_type = lv_main_object(4).
ls_item-obj_name = lv_main_object+4(*).
IF lv_sub_object IS NOT INITIAL.
ls_sub_item-obj_type = lv_sub_object(4).
ls_sub_item-obj_name = lv_sub_object+4(*).
ENDIF.
lv_line_number = lv_line_number_s.
jump( is_item = ls_item
is_sub_item = ls_sub_item
iv_line_number = lv_line_number ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-no_more_act.
ENDIF.
CASE ii_event->mv_action.
WHEN c_actions-sort_1.
SORT mt_result BY objtype objname test code sobjtype sobjname line col.
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN c_actions-sort_2.
SORT mt_result BY objtype objname sobjtype sobjname line col test code.
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN c_actions-sort_3.
SORT mt_result BY test code objtype objname sobjtype sobjname line col.
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
ENDCASE.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
19815,
72,
62,
8692,
5550,
20032,
17941,
44731,
9564,
18601,
10659,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
62,
30281,
93,
261,
62,
15596,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
13,
628,
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,
4658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
302,
5143,
220,
41876,
4731,
26173,
8924,
705,
260,
5143,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3297,
62,
16,
41876,
4731,
26173,
8924,
705,
30619,
62,
16,
6,
220,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3297,
62,
17,
41876,
4731,
26173,
8924,
705,
30619,
62,
17,
6,
220,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3297,
62,
18,
41876,
4731,
26173,
8924,
705,
30619,
62,
18,
6,
220,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3800,
220,
41876,
4731,
26173,
8924,
705,
14247,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4589,
41876,
4731,
26173,
8924,
705,
41509,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
4658,
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,
45079,
62,
20274,
41876,
629,
270,
62,
282,
85,
4868,
764,
628,
220,
220,
220,
337,
36252,
50,
8543,
62,
25641,
415,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
25641,
415,
220,
220,
220,
41876,
20681,
62,
354,
74,
85,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
6494,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6494,
764,
198,
220,
220,
220,
337,
36252,
50,
8543,
62,
20274,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
6494,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6494,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
20274,
41876,
629,
270,
62,
282,
85,
4868,
764,
198,
220,
220,
220,
337,
36252,
50,
8543,
62,
20274,
62,
1370,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
6494,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6494,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
20274,
41876,
629,
343,
62,
282,
85,
4868,
764,
198,
220,
220,
220,
337,
36252,
50,
1382,
62,
28341,
62,
8726,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
20274,
220,
220,
220,
220,
41876,
629,
343,
62,
282,
85,
4868,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8726,
8,
41876,
4731,
764,
198,
220,
220,
220,
337,
36252,
50,
4391,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
9186,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
7266,
62,
9186,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
1370,
62,
17618,
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,
764,
198,
220,
220,
220,
337,
36252,
50,
1382,
62,
8692,
62,
26272,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
26272,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
25981,
5657,
764,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
15252,
62,
25512,
1352,
41876,
269,
406,
49494,
352,
26173,
8924,
705,
91,
4458,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
979,
62,
82,
328,
41876,
4731,
26173,
8924,
705,
17879,
615,
25,
4458,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
19815,
72,
62,
8692,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1382,
62,
8692,
62,
26272,
13,
628,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
2376,
62,
30619,
62,
26272,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
25981,
5657,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
2376,
62,
30619,
62,
26272,
13,
628,
220,
220,
220,
2376,
62,
30619,
62,
26272,
3784,
2860,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
14116,
796,
705,
3886,
9515,
11,
6822,
11,
3834,
12,
15252,
6,
198,
220,
220,
220,
220,
220,
21628,
62,
529,
796,
269,
62,
4658,
12,
30619,
62,
16,
198,
220,
220,
220,
1267,
3784,
2860,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
14116,
796,
705,
3886,
9515,
11,
3834,
12,
15252,
11,
6910,
6,
198,
220,
220,
220,
220,
220,
21628,
62,
529,
796,
269,
62,
4658,
12,
30619,
62,
17,
198,
220,
220,
220,
1267,
3784,
2860,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
14116,
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,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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
] |
CLASS ycl_addict_transport_request DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
TYPES as4text_range TYPE RANGE OF e07t-as4text.
TYPES as4user_range TYPE RANGE OF e070-as4user.
TYPES date_range TYPE RANGE OF dats.
TYPES obj_name_range TYPE RANGE OF e071-obj_name .
TYPES object_range TYPE RANGE OF e071-object.
TYPES pgmid_range TYPE RANGE OF e071-pgmid.
TYPES trfunction_range TYPE RANGE OF e070-trfunction.
TYPES trstatus_range TYPE RANGE OF e070-trstatus.
TYPES request_attribute_list TYPE STANDARD TABLE OF e070a WITH EMPTY KEY.
TYPES request_key_list TYPE STANDARD TABLE OF e071k WITH EMPTY KEY.
TYPES request_nametab_list TYPE STANDARD TABLE OF e071kf WITH EMPTY KEY.
TYPES request_object_list TYPE STANDARD TABLE OF e071 WITH EMPTY KEY.
TYPES trkorr_list TYPE STANDARD TABLE OF trkorr WITH KEY table_line.
TYPES user_list TYPE STANDARD TABLE OF xubname WITH EMPTY KEY.
TYPES: BEGIN OF content_dict,
objects TYPE request_object_list,
keys TYPE request_key_list,
nametabs TYPE request_nametab_list,
attributes TYPE request_attribute_list,
END OF content_dict.
TYPES: BEGIN OF request_type_dict,
pgmid TYPE e071-pgmid,
object TYPE e071-object,
END OF request_type_dict.
TYPES: BEGIN OF request_param_dict,
trkorr_rng TYPE ytt_addict_trkorr_rng,
trfunction_rng TYPE ytt_addict_trfunction_rng,
trstatus_rng TYPE trstatus_range,
as4user_rng TYPE as4user_range,
as4text_rng TYPE as4text_range,
as4date_rng TYPE date_range,
must_have_subtask TYPE abap_bool,
srch_strkorr TYPE abap_bool,
ignore_trkorr TYPE abap_bool,
END OF request_param_dict.
TYPES: BEGIN OF request_and_object_dict,
trkorr TYPE e070-trkorr,
as4text TYPE e07t-as4text,
strkorr TYPE e070-strkorr,
pgmid TYPE e071-pgmid,
object TYPE e071-object,
obj_name TYPE e071-obj_name,
END OF request_and_object_dict,
request_and_object_list TYPE STANDARD TABLE OF request_and_object_dict WITH EMPTY KEY.
TYPES: BEGIN OF request_obj_dict,
trkorr TYPE trkorr,
obj TYPE REF TO ycl_addict_transport_request,
END OF request_obj_dict,
request_obj_list TYPE STANDARD TABLE OF request_obj_dict WITH EMPTY KEY.
CONSTANTS: BEGIN OF domain,
trfunction TYPE domname VALUE 'TRFUNCTION',
END OF domain.
CONSTANTS: BEGIN OF object,
cinc TYPE e071-object VALUE 'CINC',
clas TYPE e071-object VALUE 'CLAS',
clsd TYPE e071-object VALUE 'CLSD',
cpub TYPE e071-object VALUE 'CPUB',
cpri TYPE e071-object VALUE 'CPRI',
doma TYPE e071-object VALUE 'DOMA',
domd TYPE e071-object VALUE 'DOMD',
dted TYPE e071-object VALUE 'DTED',
dtel TYPE e071-object VALUE 'DTEL',
tabd TYPE e071-object VALUE 'TABD',
tabl TYPE e071-object VALUE 'TABL',
tdat TYPE e071-object VALUE 'TDAT',
intf TYPE e071-object VALUE 'INTF',
meth TYPE e071-object VALUE 'METH',
prog TYPE e071-object VALUE 'PROG',
END OF object.
CONSTANTS: BEGIN OF pgmid,
corr TYPE e071-pgmid VALUE 'CORR',
limu TYPE e071-pgmid VALUE 'LIMU',
r3tr TYPE e071-pgmid VALUE 'R3TR',
END OF pgmid.
CONSTANTS: BEGIN OF trfunction,
cust TYPE trfunction VALUE 'W',
cust_task TYPE trfunction VALUE 'Q',
toc TYPE trfunction VALUE 'T',
unclass TYPE trfunction VALUE 'X',
wb TYPE trfunction VALUE 'K',
END OF trfunction.
CONSTANTS: BEGIN OF trstatus,
modif TYPE trstatus VALUE 'D',
modif_prot TYPE trstatus VALUE 'L',
END OF trstatus.
DATA trkorr TYPE trkorr READ-ONLY .
CLASS-METHODS create_new_request
IMPORTING !trfunction TYPE trfunction
!as4text TYPE as4text OPTIONAL
!users TYPE user_list OPTIONAL
!target TYPE tr_target OPTIONAL
RETURNING VALUE(output) TYPE REF TO ycl_addict_transport_request
RAISING ycx_addict_table_content
ycx_addict_function_subrc.
CLASS-METHODS get_as4text_safe
IMPORTING !trkorr TYPE trkorr
RETURNING VALUE(output) TYPE as4text .
CLASS-METHODS get_empty_open_requests
IMPORTING !trkorr_rng TYPE ytt_addict_trfunction_rng
RETURNING VALUE(output) TYPE ytt_addict_trkorr_det
RAISING ycx_addict_table_content
ycx_addict_function_subrc.
CLASS-METHODS get_instance
IMPORTING !trkorr TYPE trkorr
!top TYPE abap_bool DEFAULT abap_false
RETURNING VALUE(output) TYPE REF TO ycl_addict_transport_request
RAISING ycx_addict_table_content.
CLASS-METHODS get_modified_objects
IMPORTING
!obj TYPE ytt_addict_e071_obj_key
RETURNING
VALUE(output) TYPE ytt_addict_e071_obj_key.
CLASS-METHODS get_open_status_rng RETURNING VALUE(output) TYPE trstatus_range.
CLASS-METHODS get_open_requests
IMPORTING !as4text_rng TYPE as4text_range OPTIONAL
!trfunction_rng TYPE ytt_addict_trfunction_rng OPTIONAL
!must_have_subtask TYPE abap_bool OPTIONAL
RETURNING VALUE(output) TYPE ytt_addict_trkorr_det.
CLASS-METHODS get_request_list
IMPORTING !param TYPE request_param_dict
RETURNING VALUE(output) TYPE ytt_addict_trkorr_det.
CLASS-METHODS get_request_and_objects
IMPORTING !tags TYPE ytt_addict_e071_obj_key
RETURNING VALUE(output) TYPE request_and_object_list.
CLASS-METHODS get_request_objects
IMPORTING !trkorr_rng TYPE ytt_addict_trkorr_rng
!pgmid_rng TYPE pgmid_range OPTIONAL
!read_creation TYPE abap_bool DEFAULT abap_false
EXPORTING !list TYPE ycl_addict_dol_model=>dol_list
!list_wr TYPE ycl_addict_dol_model=>dol_list_wr.
CLASS-METHODS get_requests_containing_obj
IMPORTING !obj TYPE ytt_addict_e071_obj_key
!top TYPE abap_bool DEFAULT abap_true
!holistic_cls TYPE abap_bool DEFAULT abap_false
!trfunction_rng TYPE ytt_addict_trfunction_rng OPTIONAL
RETURNING VALUE(req) TYPE request_and_object_list.
CLASS-METHODS get_source_client_safe
IMPORTING !trkorr TYPE trkorr
RETURNING VALUE(client) TYPE e070c-client .
CLASS-METHODS get_toc_safety_safe
IMPORTING !trkorr TYPE trkorr
RETURNING VALUE(safe) TYPE abap_bool .
CLASS-METHODS get_user_creatable_trf_rng
RETURNING VALUE(func) TYPE ytt_addict_trfunction_rng .
CLASS-METHODS is_obj_type_class_related
IMPORTING !obj_type TYPE request_type_dict
RETURNING VALUE(related) TYPE abap_bool .
METHODS add_objects
IMPORTING !obj TYPE ytt_addict_e071_obj_key
!sort_and_compress TYPE abap_bool DEFAULT abap_false
RAISING ycx_addict_function_subrc
RESUMABLE(ycx_addict_sort_and_compress).
METHODS add_objects_from_request
IMPORTING !from TYPE trkorr_list
!wait TYPE abap_bool DEFAULT abap_false
!sort_and_compress TYPE abap_bool DEFAULT abap_false
RAISING ycx_addict_function_subrc
RESUMABLE(ycx_addict_sort_and_compress)
ycx_addict_table_content .
METHODS complete_shi_piece_list RAISING ycx_addict_sh_piece_list_comp.
METHODS create_subtask IMPORTING !user TYPE user_list.
METHODS delete RAISING ycx_addict_function_subrc.
METHODS delete_empty_subtasks
RAISING ycx_addict_function_subrc
ycx_addict_table_content.
METHODS delete_object
IMPORTING !obj TYPE ysaddict_e071_obj_key
RAISING ycx_addict_function_subrc.
METHODS get_content
RETURNING VALUE(content) TYPE content_dict
RAISING ycx_addict_function_subrc
ycx_addict_table_content .
METHODS get_objects
IMPORTING !pgmid_rng TYPE pgmid_range OPTIONAL
!object_rng TYPE object_range OPTIONAL
!obj_name_rng TYPE obj_name_range OPTIONAL
!devclass_rng TYPE ycl_addict_package=>package_range OPTIONAL
RETURNING VALUE(objects) TYPE request_object_list
RAISING ycx_addict_function_subrc
ycx_addict_table_content.
METHODS get_header RETURNING VALUE(header) TYPE e070.
METHODS get_obj_related_requests
IMPORTING !include_self TYPE abap_bool DEFAULT abap_false
!top TYPE abap_bool DEFAULT abap_true
!obj_name_rng TYPE obj_name_range OPTIONAL
!holistic_cls TYPE abap_bool DEFAULT abap_false
!trfunction_rng TYPE ytt_addict_trfunction_rng OPTIONAL
!devclass_rng TYPE ycl_addict_package=>package_range OPTIONAL
RETURNING VALUE(list) TYPE request_and_object_list
RAISING ycx_addict_function_subrc
ycx_addict_table_content .
METHODS get_source_client RETURNING VALUE(client) TYPE e070c-client .
METHODS get_subtasks
IMPORTING !only_empty TYPE abap_bool DEFAULT abap_false
RETURNING VALUE(subtask) TYPE request_obj_list
RAISING ycx_addict_function_subrc
ycx_addict_table_content.
METHODS get_text RETURNING VALUE(as4text) TYPE as4text.
METHODS has_locked_object RETURNING VALUE(has) TYPE abap_bool.
METHODS has_merge
RETURNING VALUE(has) TYPE abap_bool
RAISING ycx_addict_data_read.
METHODS is_empty
RETURNING VALUE(empty) TYPE abap_bool
RAISING ycx_addict_function_subrc
ycx_addict_table_content.
METHODS is_toc_safe
RETURNING VALUE(safe) TYPE abap_bool
RAISING ycx_addict_class_method.
METHODS release
IMPORTING !rel_subtasks_too TYPE abap_bool
!del_empty_subtasks TYPE abap_bool DEFAULT abap_true
!wait_until_released TYPE abap_bool DEFAULT abap_false
!max_rel_wait TYPE i OPTIONAL
!compl_sh_piece_list TYPE abap_bool DEFAULT abap_true
EXPORTING rel_wait_success TYPE abap_bool
RAISING ycx_addict_function_subrc
ycx_addict_table_content.
METHODS sort_and_compress RAISING ycx_addict_sort_and_compress.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES request_object_type_set TYPE HASHED TABLE OF request_type_dict
WITH UNIQUE KEY primary_key COMPONENTS pgmid object.
TYPES: BEGIN OF clazy_flag_dict,
class_related_obj_tags TYPE abap_bool,
dev_req_rng TYPE abap_bool,
END OF clazy_flag_dict.
TYPES: BEGIN OF clazy_val_dict,
class_related_obj_tag TYPE request_object_type_set,
dev_req_rng TYPE ytt_addict_trkorr_rng,
END OF clazy_val_dict.
TYPES: BEGIN OF lazy_flag_dict,
as4text TYPE abap_bool,
content TYPE abap_bool,
e070 TYPE abap_bool,
empty TYPE abap_bool,
source_client TYPE abap_bool,
toc_safe TYPE abap_bool,
END OF lazy_flag_dict.
TYPES: BEGIN OF lazy_val_dict,
as4text TYPE as4text,
content TYPE content_dict,
e070 TYPE e070,
empty TYPE abap_bool,
source_client TYPE e070c-client,
toc_safe TYPE abap_bool,
END OF lazy_val_dict.
TYPES abap_bool_list TYPE STANDARD TABLE OF abap_bool WITH EMPTY KEY.
TYPES obj_name_list TYPE STANDARD TABLE OF e071-obj_name WITH EMPTY KEY.
TYPES: BEGIN OF multiton_dict,
trkorr TYPE trkorr,
top TYPE abap_bool,
obj TYPE REF TO ycl_addict_transport_request,
END OF multiton_dict,
multiton_set TYPE HASHED TABLE OF multiton_dict
WITH UNIQUE KEY primary_key COMPONENTS trkorr top.
CONSTANTS: BEGIN OF table,
e070 TYPE tabname VALUE 'E070',
END OF table.
CONSTANTS: BEGIN OF tcode,
shi_piece_list TYPE sytcode VALUE 'YADDICT001',
END OF tcode.
CLASS-DATA clazy_flag TYPE clazy_flag_dict.
CLASS-DATA clazy_val TYPE clazy_val_dict.
CLASS-DATA multitons TYPE multiton_set.
DATA lazy_flag TYPE lazy_flag_dict.
DATA lazy_val TYPE lazy_val_dict.
CLASS-METHODS build_dev_req_rng.
CLASS-METHODS release_single
IMPORTING !trkorr TYPE trkorr
!req TYPE REF TO ycl_addict_transport_request OPTIONAL
!wait_until_released TYPE abap_bool DEFAULT abap_false
!max_rel_wait TYPE i
!compl_sh_piece_list TYPE abap_bool DEFAULT abap_true
EXPORTING !rel_wait_success TYPE abap_bool
RAISING ycx_addict_function_subrc
ycx_addict_table_content.
ENDCLASS.
CLASS ycl_addict_transport_request IMPLEMENTATION.
METHOD add_objects.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Appends the given objects to the transport request
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
DATA t071 TYPE STANDARD TABLE OF e071 WITH DEFAULT KEY.
" Add objects """""""""""""""""""""""""""""""""""""""""""""""""""
CHECK obj IS NOT INITIAL.
t071 = CORRESPONDING #( obj ).
CALL FUNCTION 'TRINT_APPEND_TO_COMM_ARRAYS'
EXPORTING
wi_error_table = abap_true
wi_trkorr = me->trkorr
iv_append_at_order = abap_true
TABLES
wt_e071 = t071[]
EXCEPTIONS
key_check_keysyntax_error = 1
ob_check_obj_error = 2
tr_lockmod_failed = 3
tr_lock_enqueue_failed = 4
tr_wrong_order_type = 5
tr_order_update_error = 6
file_access_error = 7
ob_no_systemname = 8
OTHERS = 9
##FM_SUBRC_OK.
ycx_addict_function_subrc=>raise_if_sysubrc_not_initial( 'TRINT_APPEND_TO_COMM_ARRAYS' ).
" Sort & Compress """""""""""""""""""""""""""""""""""""""""""""""
IF sort_and_compress = abap_true.
TRY.
sort_and_compress( ).
CATCH ycx_addict_sort_and_compress INTO DATA(sac).
RAISE RESUMABLE EXCEPTION sac.
ENDTRY.
ENDIF.
ENDMETHOD.
METHOD add_objects_from_request.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Appends objects of a request to this request
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Build a list of requests & tasks """"""""""""""""""""""""""""""
DATA(trkorr_from) = from.
LOOP AT from ASSIGNING FIELD-SYMBOL(<from>).
APPEND LINES OF VALUE trkorr_list(
FOR _subtask IN get_instance(
trkorr = <from>
top = abap_true
)->get_subtasks( ) ( _subtask-trkorr )
) TO trkorr_from.
ENDLOOP.
SORT trkorr_from BY table_line.
DELETE ADJACENT DUPLICATES FROM trkorr_from COMPARING table_line.
" Append """"""""""""""""""""""""""""""""""""""""""""""""""""""""
LOOP AT trkorr_from ASSIGNING <from>.
CALL FUNCTION 'TR_COPY_COMM'
EXPORTING
wi_dialog = abap_false
wi_trkorr_from = <from>
wi_trkorr_to = me->trkorr
wi_without_documentation = abap_true
EXCEPTIONS
db_access_error = 1
trkorr_from_not_exist = 2
trkorr_to_is_repair = 3
trkorr_to_locked = 4
trkorr_to_not_exist = 5
trkorr_to_released = 6
user_not_owner = 7
no_authorization = 8
wrong_client = 9
wrong_category = 10
object_not_patchable = 11
OTHERS = 12
##FM_SUBRC_OK ##NUMBER_OK.
ycx_addict_function_subrc=>raise_if_sysubrc_not_initial( 'TR_COPY_COMM' ).
CHECK wait = abap_true.
WAIT UP TO 1 SECONDS.
ENDLOOP.
" Sort & Compress """""""""""""""""""""""""""""""""""""""""""""""
IF sort_and_compress = abap_true.
TRY.
sort_and_compress( ).
CATCH ycx_addict_sort_and_compress INTO DATA(sac).
RAISE RESUMABLE EXCEPTION sac.
ENDTRY.
ENDIF.
ENDMETHOD.
METHOD build_dev_req_rng.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Builds a range of requests in the development system
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
CHECK ycl_addict_transport_request=>clazy_flag-dev_req_rng IS INITIAL.
ycl_addict_transport_request=>clazy_val-dev_req_rng = VALUE #( (
sign = ycl_addict_toolkit=>sign-include
option = ycl_addict_toolkit=>option-cp
low = |{ sy-sysid }K*| ) ).
ycl_addict_transport_request=>clazy_flag-dev_req_rng = abap_true.
ENDMETHOD.
METHOD complete_shi_piece_list.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Completes the piece list within the request
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
TRY.
DATA(bdc) = NEW ycl_addict_bdc( ).
bdc->add_scr(
prg = 'RS_STREE_OBJECTS_TO_REQ_GET'
dyn = '1000' ).
bdc->add_fld(:
nam = 'BDC_OKCODE' val = '=ONLI' ),
nam = 'P_TRKORR' val = CONV #( me->trkorr ) ).
bdc->add_scr(
prg = 'RS_STREE_OBJECTS_TO_REQ_GET'
dyn = '0100' ).
bdc->add_fld(
nam = 'BDC_OKCODE'
val = '=ENTER' ).
bdc->add_scr(
prg = 'RS_STREE_OBJECTS_TO_REQ_GET'
dyn = '1000' ).
bdc->add_fld(
nam = 'BDC_OKCODE'
val = '/EE' ).
bdc->submit(
tcode = me->tcode-shi_piece_list
option = VALUE #( dismode = ycl_addict_bdc=>dismode-none )
validate_msg = abap_true ).
CATCH cx_root INTO DATA(diaper).
RAISE EXCEPTION TYPE ycx_addict_sh_piece_list_comp
EXPORTING
previous = diaper
trkorr = me->trkorr.
ENDTRY.
ENDMETHOD.
METHOD create_new_request.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Creates a new transport request
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
DATA head TYPE trwbo_request_header.
DATA final_as4text TYPE as4text.
IF users IS SUPPLIED.
DATA(user) = VALUE scts_users(
FOR _user IN users (
user = _user
type = ycl_addict_transport_request=>trfunction-unclass ) ).
ENDIF.
DATA(auto_prefix) = ycl_addict_toolkit=>get_system_definitions( )-auto_request_prefix.
final_as4text = COND #(
WHEN as4text IS SUPPLIED
THEN as4text
ELSE |{ auto_prefix } Request| ).
CLEAR head.
CALL FUNCTION 'TR_INSERT_REQUEST_WITH_TASKS'
EXPORTING
iv_type = trfunction
iv_text = final_as4text
it_users = user
iv_target = target
IMPORTING
es_request_header = head
EXCEPTIONS
insert_failed = 1
enqueue_failed = 2
OTHERS = 3
##FM_SUBRC_OK.
ycx_addict_function_subrc=>raise_if_sysubrc_not_initial( 'TR_INSERT_REQUEST_WITH_TASKS' ).
output = get_instance( head-trkorr ).
ENDMETHOD.
METHOD create_subtask.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Creates a new subtask within the request
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
DATA msg TYPE STANDARD TABLE OF tr004.
DATA tr005 TYPE STANDARD TABLE OF tr005.
CLEAR: tr005, msg.
tr005 = VALUE #( FOR _user IN user ( as4user = _user ) ).
CALL FUNCTION 'TR40_TASK_ADD'
EXPORTING
iv_trkorr = me->trkorr
TABLES
tt_userlist = tr005
tt_msg = msg.
ENDMETHOD.
METHOD delete.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Deletes the transport request
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
CALL FUNCTION 'TRINT_DELETE_COMM'
EXPORTING
wi_dialog = abap_false
wi_trkorr = me->trkorr
iv_without_any_checks = abap_true
iv_without_user_check = abap_true
iv_without_ctsproject_check = abap_true
EXCEPTIONS
file_access_error = 1
order_already_released = 2
order_contains_c_member = 3
order_contains_locked_entries = 4
order_is_refered = 5
repair_order = 6
user_not_owner = 7
delete_was_cancelled = 8
objects_free_but_still_locks = 9
order_lock_failed = 10
wrong_client = 11
project_still_referenced = 12
successors_already_released = 13
OTHERS = 14
##FM_SUBRC_OK ##NUMBER_OK.
ycx_addict_function_subrc=>raise_if_sysubrc_not_initial( 'TRINT_DELETE_COMM' ).
ENDMETHOD.
METHOD delete_empty_subtasks.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Deletes the empty subtasks within the request
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
LOOP AT get_subtasks( only_empty = abap_true ) ASSIGNING FIELD-SYMBOL(<sub>).
<sub>-obj->delete( ).
ENDLOOP.
ENDMETHOD.
METHOD delete_object.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Deletes an object from within the request
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
DATA(e071) = CORRESPONDING e071( obj ).
e071-trkorr = me->trkorr.
DATA(req) = VALUE trwbo_request( ).
CALL FUNCTION 'TRINT_DELETE_COMM_OBJECT_KEYS'
EXPORTING
is_e071_delete = e071
iv_dialog_flag = abap_false
CHANGING
cs_request = req
EXCEPTIONS
e_bad_target_request = 1
e_database_access_error = 2
e_empty_lockkey = 3
e_wrong_source_client = 4
n_no_deletion_of_c_objects = 5
n_no_deletion_of_corr_entry = 6
n_object_entry_doesnt_exist = 7
n_request_already_released = 8
n_request_from_other_system = 9
r_user_cancelled = 10
r_user_didnt_confirm = 11
r_foreign_lock = 12
w_bigger_lock_in_same_order = 13
w_duplicate_entry = 14
w_no_authorization = 15
w_user_not_owner = 16
OTHERS = 17
##FM_SUBRC_OK ##NUMBER_OK.
ycx_addict_function_subrc=>raise_if_sysubrc_not_initial( 'TRINT_DELETE_COMM_OBJECT_KEYS' ).
ENDMETHOD.
METHOD get_as4text_safe.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns the request description without generating exception
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
TRY.
output = get_instance( trkorr )->get_text( ).
CATCH cx_root ##no_handler .
ENDTRY.
ENDMETHOD.
METHOD get_content.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns the content of the request
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
IF me->lazy_flag-content IS INITIAL.
CALL FUNCTION 'TR_READ_COMM'
EXPORTING
wi_trkorr = me->trkorr
wi_dialog = abap_false
wi_langu = sy-langu
wi_sel_e071 = abap_true
wi_sel_e071k = abap_true
iv_sel_e071kf = abap_true
iv_sel_e070a = abap_true
TABLES
wt_e071 = me->lazy_val-content-objects
wt_e071k = me->lazy_val-content-keys
et_e071kf = me->lazy_val-content-nametabs
et_e070a = me->lazy_val-content-attributes
EXCEPTIONS
not_exist_e070 = 1
no_authorization = 2
OTHERS = 3
##FM_SUBRC_OK.
ycx_addict_function_subrc=>raise_if_sysubrc_not_initial( 'TR_READ_COMM' ).
LOOP AT get_subtasks( ) ASSIGNING FIELD-SYMBOL(<sub>).
DATA(sub_content) = <sub>-obj->get_content( ).
APPEND LINES OF:
sub_content-objects TO me->lazy_val-content-objects,
sub_content-keys TO me->lazy_val-content-keys,
sub_content-nametabs TO me->lazy_val-content-nametabs,
sub_content-attributes TO me->lazy_val-content-attributes.
ENDLOOP.
me->lazy_flag-content = abap_true.
ENDIF.
content = me->lazy_val-content.
ENDMETHOD.
METHOD get_empty_open_requests.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns empty open requests
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
SELECT trkorr FROM e070 AS request
WHERE trkorr IN @trkorr_rng AND
( strkorr = @space OR strkorr IS NULL ) AND
( NOT EXISTS ( SELECT trkorr FROM e071 WHERE trkorr = request~trkorr ) ) AND
( NOT EXISTS ( SELECT trkorr FROM e070 AS task
WHERE strkorr = request~trkorr AND
EXISTS ( SELECT trkorr FROM e071 WHERE trkorr = task~trkorr ) ) )
INTO TABLE @DATA(trkorr).
LOOP AT trkorr ASSIGNING FIELD-SYMBOL(<trkorr>).
CHECK NOT get_instance( <trkorr>-trkorr )->is_empty( ).
DELETE trkorr.
CONTINUE.
ENDLOOP.
IF trkorr IS INITIAL.
RETURN.
ENDIF.
output = get_request_list( VALUE #(
trkorr_rng = VALUE #( FOR _trkorr IN trkorr (
option = ycl_addict_toolkit=>option-eq
sign = ycl_addict_toolkit=>sign-include
low = _trkorr ) )
trstatus_rng = get_open_status_rng( )
srch_strkorr = abap_false
ignore_trkorr = abap_false ) ).
ENDMETHOD.
METHOD get_header.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns request header
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
IF me->lazy_flag-e070 IS INITIAL.
SELECT SINGLE * FROM e070
WHERE trkorr = @me->trkorr
INTO CORRESPONDING FIELDS OF @me->lazy_val-e070.
me->lazy_flag-e070 = abap_true.
ENDIF.
header = me->lazy_val-e070.
ENDMETHOD.
METHOD get_instance.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Factory
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
ASSIGN ycl_addict_transport_request=>multitons[
KEY primary_key COMPONENTS
trkorr = trkorr
top = top
] TO FIELD-SYMBOL(<mt>).
IF sy-subrc <> 0.
DATA(mt) = VALUE multiton_dict(
trkorr = trkorr
top = top ).
SELECT SINGLE trkorr, strkorr
FROM e070
WHERE trkorr = @trkorr
INTO @DATA(e070).
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE ycx_addict_table_content
EXPORTING
textid = ycx_addict_table_content=>no_entry_for_objectid
objectid = CONV #( trkorr )
tabname = ycl_addict_transport_request=>table-e070.
ENDIF.
mt-obj = NEW #( ).
mt-obj->trkorr = SWITCH #( top
WHEN abap_false THEN e070-trkorr
WHEN abap_true THEN COND #(
WHEN e070-strkorr IS NOT INITIAL THEN e070-strkorr
ELSE e070-trkorr ) ).
INSERT mt INTO TABLE ycl_addict_transport_request=>multitons ASSIGNING <mt>.
ENDIF.
output = <mt>-obj.
ENDMETHOD.
METHOD get_modified_objects.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns modified objects within the request
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
DATA(req) = get_requests_containing_obj(
obj = obj
top = abap_true
holistic_cls = abap_true ).
DELETE req WHERE trkorr+0(3) <> sy-sysid.
SORT req BY pgmid object obj_name.
DELETE ADJACENT DUPLICATES FROM req COMPARING pgmid object obj_name. " Binary Search
LOOP AT obj ASSIGNING FIELD-SYMBOL(<obj>).
READ TABLE req ASSIGNING FIELD-SYMBOL(<req>)
WITH KEY pgmid = <obj>-pgmid
object = <obj>-object
obj_name = <obj>-obj_name
BINARY SEARCH.
IF sy-subrc = 0.
APPEND <obj> TO output.
CONTINUE.
ENDIF.
CHECK is_obj_type_class_related( CORRESPONDING #( <obj> ) ).
LOOP AT req ASSIGNING <req> WHERE obj_name+0(30) = <obj>-obj_name+0(30).
APPEND CORRESPONDING #( <req> ) TO output.
ENDLOOP.
CHECK sy-subrc = 0.
APPEND <obj> TO output.
ENDLOOP.
ENDMETHOD.
METHOD get_objects.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns objects within the request
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
objects = get_content( )-objects.
DELETE objects WHERE NOT (
pgmid IN pgmid_rng AND
object IN object_rng AND
obj_name IN obj_name_rng ).
IF NOT ( devclass_rng IS NOT INITIAL AND
object IS NOT INITIAL ).
RETURN.
ENDIF.
DATA(dc) = ycl_addict_package=>get_package_of_objects( CORRESPONDING #( objects ) ).
LOOP AT objects ASSIGNING FIELD-SYMBOL(<object>).
ASSIGN dc[ KEY primary_key COMPONENTS
key = VALUE #( pgmid = <object>-pgmid
object = <object>-object
obj_name = <object>-obj_name )
] TO FIELD-SYMBOL(<dc>).
CHECK sy-subrc = 0 AND <dc>-devclass NOT IN devclass_rng.
DELETE objects.
CONTINUE.
ENDLOOP.
ENDMETHOD.
METHOD get_obj_related_requests.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns requests related to the given objects
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
list = get_requests_containing_obj(
obj = CORRESPONDING #( get_objects(
obj_name_rng = obj_name_rng
devclass_rng = devclass_rng ) )
top = top
holistic_cls = holistic_cls
trfunction_rng = trfunction_rng ).
IF include_self = abap_true.
RETURN.
ENDIF.
TRY.
DATA(head) = get_header( ).
DELETE list WHERE
trkorr = head-trkorr OR
trkorr = head-strkorr OR
( strkorr IS NOT INITIAL AND
( strkorr = head-trkorr OR
strkorr = head-strkorr ) ).
IF head-strkorr IS NOT INITIAL.
DATA(shead) = get_instance( head-strkorr )->get_header( ).
DELETE list WHERE
trkorr = shead-trkorr OR
strkorr = shead-trkorr.
ENDIF.
CATCH cx_root ##no_handler .
ENDTRY.
ENDMETHOD.
METHOD get_open_requests.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns a list of corresponding open requests
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
output = get_request_list( VALUE #(
trfunction_rng = COND #(
WHEN trfunction_rng IS NOT INITIAL THEN trfunction_rng
ELSE get_user_creatable_trf_rng( ) )
trstatus_rng = get_open_status_rng( )
as4text_rng = as4text_rng
must_have_subtask = must_have_subtask ) ).
ENDMETHOD.
METHOD get_open_status_rng.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns a range of open request statuses
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
output = VALUE #(
option = ycl_addict_toolkit=>option-eq
sign = ycl_addict_toolkit=>sign-include
( low = ycl_addict_transport_request=>trstatus-modif )
( low = ycl_addict_transport_request=>trstatus-modif_prot ) ).
ENDMETHOD.
METHOD get_requests_containing_obj.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns a list of requests which contain the provided objects
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
DATA obj_name_rng TYPE RANGE OF e071-obj_name.
DATA obj_name_tmp TYPE obj_name_list.
CHECK obj IS NOT INITIAL.
" Find requests containing those objects """"""""""""""""""""""""
build_dev_req_rng( ).
SELECT trkorr, pgmid, object, obj_name
FROM e071
FOR ALL ENTRIES IN @obj
WHERE trkorr IN @ycl_addict_transport_request=>clazy_val-dev_req_rng AND
pgmid = @obj-pgmid AND
object = @obj-object AND
obj_name = @obj-obj_name
INTO TABLE @DATA(e071).
" Do holistic search if requested """""""""""""""""""""""""""""""
" Holistic means:
"
" If the request contains X=>Y, any other request containing
" any other X artifact is also related.
"
" (X: Class, Y: Method, Type, etc.)
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
IF holistic_cls = abap_true.
LOOP AT obj ASSIGNING FIELD-SYMBOL(<obj>).
CHECK is_obj_type_class_related( CORRESPONDING #( <obj> ) ) = abap_true.
CLEAR obj_name_tmp.
SPLIT <obj>-obj_name AT space INTO TABLE obj_name_tmp.
APPEND VALUE #(
option = ycl_addict_toolkit=>option-cp
sign = ycl_addict_toolkit=>sign-include
low = |{ COND #( WHEN obj_name_tmp IS INITIAL THEN <obj>-obj_name ELSE obj_name_tmp[ 1 ] ) }*|
) TO obj_name_rng.
ENDLOOP.
SORT obj_name_rng BY option sign low high.
DELETE ADJACENT DUPLICATES FROM obj_name_rng COMPARING option sign low high.
IF obj_name_rng IS NOT INITIAL.
SELECT trkorr, pgmid, object, obj_name
FROM e071
WHERE trkorr IN @ycl_addict_transport_request=>clazy_val-dev_req_rng AND
( pgmid = @yif_addict_dol_obj=>pgmid-r3tr OR
pgmid = @yif_addict_dol_obj=>pgmid-limu ) AND
obj_name IN @obj_name_rng
APPENDING CORRESPONDING FIELDS OF TABLE @e071. "#EC CI_NOFIRST
ENDIF.
ENDIF.
" Build a list of found requests """"""""""""""""""""""""""""""""
SORT e071 BY trkorr pgmid object obj_name.
DELETE ADJACENT DUPLICATES FROM e071 COMPARING trkorr pgmid object obj_name.
LOOP AT e071 ASSIGNING FIELD-SYMBOL(<e071>).
TRY.
DATA(found_request) = get_instance(
trkorr = <e071>-trkorr
top = top ).
DATA(head) = found_request->get_header( ).
APPEND VALUE #(
trkorr = head-trkorr
as4text = found_request->get_text( )
strkorr = head-strkorr
pgmid = <e071>-pgmid
object = <e071>-object
obj_name = <e071>-obj_name
) TO req.
CATCH cx_root ##no_Handler .
ENDTRY.
ENDLOOP.
" Filter by request type if wanted """"""""""""""""""""""""""""""
IF trfunction_rng IS NOT INITIAL.
LOOP AT req ASSIGNING FIELD-SYMBOL(<req>).
TRY.
CHECK get_instance(
trkorr = <req>-trkorr
top = abap_true
)->get_header( )-trfunction NOT IN trfunction_rng.
DELETE req.
CONTINUE.
CATCH cx_root ##no_handler.
ENDTRY.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD get_request_and_objects.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns corresponding requests with their contents
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
CHECK tags IS NOT INITIAL.
SELECT e070~trkorr, e07t~as4text, e070~strkorr, e071~obj_name
FROM e071
INNER JOIN e070 ON e070~trkorr = e071~trkorr
LEFT JOIN e07t ON e07t~trkorr = e071~trkorr AND
e07t~langu = @sy-langu
FOR ALL ENTRIES IN @tags
WHERE pgmid = @tags-pgmid AND
object = @tags-object AND
obj_name = @tags-obj_name
INTO CORRESPONDING FIELDS OF TABLE @output ##TOO_MANY_ITAB_FIELDS .
ENDMETHOD.
METHOD get_request_list.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns a list of corresponding requests
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Raw list """"""""""""""""""""""""""""""""""""""""""""""""""""""
IF param-ignore_trkorr = abap_false.
SELECT e070~trkorr, e070~trfunction, e070~trstatus,
e07t~as4text, e070~as4user, e070~strkorr,
e070~as4date, e070~as4time,
e070~tarsystem
FROM e070
LEFT JOIN e07t ON e07t~trkorr = e070~trkorr
WHERE e070~trkorr IN @param-trkorr_rng AND
e070~trfunction IN @param-trfunction_rng AND
e070~trstatus IN @param-trstatus_rng AND
e070~as4date IN @param-as4date_rng AND
e070~as4user IN @param-as4user_rng
APPENDING CORRESPONDING FIELDS OF TABLE @output ##TOO_MANY_ITAB_FIELDS.
ENDIF.
IF param-srch_strkorr = abap_true.
SELECT e070~trkorr, e070~trfunction, e070~trstatus, e07t~as4text,
e070~as4user, e070~strkorr, e070~as4date, e070~as4time,
e070~tarsystem
FROM e070
LEFT JOIN e07t ON e07t~trkorr = e070~strkorr
WHERE e070~strkorr IN @param-trkorr_rng AND
e070~trfunction IN @param-trfunction_rng AND
e070~trstatus IN @param-trstatus_rng AND
e070~as4date IN @param-as4date_rng AND
e070~as4user IN @param-as4user_rng
APPENDING CORRESPONDING FIELDS OF TABLE @output ##TOO_MANY_ITAB_FIELDS.
ENDIF.
DELETE output WHERE as4text NOT IN param-as4text_rng.
SORT output BY trkorr.
DELETE ADJACENT DUPLICATES FROM output COMPARING trkorr.
" Subtask check """""""""""""""""""""""""""""""""""""""""""""""""
IF param-must_have_subtask = abap_true AND
output IS NOT INITIAL.
SELECT trkorr, strkorr FROM e070
FOR ALL ENTRIES IN @output
WHERE strkorr = @output-trkorr AND
trstatus IN (@ycl_addict_transport_request=>trstatus-modif,
@ycl_addict_transport_request=>trstatus-modif_prot)
INTO TABLE @data(task).
SORT task BY strkorr.
LOOP AT output ASSIGNING FIELD-SYMBOL(<list>).
READ TABLE task TRANSPORTING NO FIELDS
WITH KEY strkorr = <list>-trkorr
BINARY SEARCH.
CHECK sy-subrc <> 0.
DELETE output.
CONTINUE.
ENDLOOP.
ENDIF.
" Domain texts """"""""""""""""""""""""""""""""""""""""""""""""""
TRY.
DATA(domain_trf) = ycl_addict_domain_line=>get_instance( ycl_addict_transport_request=>domain-trfunction ).
LOOP AT output ASSIGNING <list>.
TRY.
<list>-trftxt = domain_trf->domain->get_value_text( CONV #( <list>-trfunction ) ).
CATCH cx_root ##no_Handler .
ENDTRY.
ENDLOOP.
CATCH cx_root ##no_Handler.
ENDTRY.
ENDMETHOD.
METHOD get_request_objects.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns objects within the request
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
DATA trkorr TYPE RANGE OF e070-trkorr.
CLEAR: list, list_wr.
" Detect requests """""""""""""""""""""""""""""""""""""""""""""""
SELECT @ycl_addict_toolkit=>option-eq AS option,
@ycl_addict_toolkit=>sign-include AS sign,
trkorr AS low
FROM e070
WHERE trkorr IN @trkorr_rng OR
strkorr IN @trkorr_rng
APPENDING CORRESPONDING FIELDS OF TABLE @trkorr ##TOO_MANY_ITAB_FIELDS.
SELECT @ycl_addict_toolkit=>option-eq AS option,
@ycl_addict_toolkit=>sign-include AS sign,
strkorr AS low
FROM e070
WHERE trkorr IN @trkorr_rng OR
strkorr IN @trkorr_rng
APPENDING CORRESPONDING FIELDS OF TABLE @trkorr ##TOO_MANY_ITAB_FIELDS .
SORT trkorr BY low.
DELETE ADJACENT DUPLICATES FROM trkorr COMPARING low.
IF trkorr IS INITIAL.
RETURN.
ENDIF.
" Detect objects """"""""""""""""""""""""""""""""""""""""""""""""
DATA(active_pgmid_rng) = COND #(
WHEN pgmid_rng IS SUPPLIED
THEN pgmid_rng
ELSE VALUE #( ( option = ycl_addict_toolkit=>option-eq
sign = ycl_addict_toolkit=>sign-include
low = yif_addict_dol_obj=>pgmid-r3tr ) ) ).
SELECT DISTINCT
e071~trkorr, e071~pgmid, e071~object, e071~obj_name,
e07t~as4text
FROM e071
LEFT JOIN e07t ON e07t~trkorr = e071~trkorr AND
e07t~langu = @sy-langu
WHERE e071~trkorr IN @trkorr AND
e071~pgmid IN @active_pgmid_rng
ORDER BY e071~pgmid, e071~object, e071~obj_name
INTO CORRESPONDING FIELDS OF TABLE @list_wr
##too_many_itab_fields.
DELETE ADJACENT DUPLICATES FROM list_wr COMPARING trkorr pgmid object obj_name.
" Correct object names """"""""""""""""""""""""""""""""""""""""""
LOOP AT list_wr ASSIGNING FIELD-SYMBOL(<list>).
IF is_obj_type_class_related( CORRESPONDING #( <list> ) ).
DATA(main_pgmid) = ycl_addict_transport_request=>pgmid-r3tr.
DATA(main_object) = ycl_addict_transport_request=>object-clas.
DATA(main_obj_name) = CONV yd_addict_dol_obj_name( <list>-obj_name+0(30) ).
ELSE.
main_pgmid = <list>-pgmid.
main_object = <list>-object.
main_obj_name = <list>-obj_name.
ENDIF.
TRY.
ycl_addict_dol_model=>get_dol_obj(
EXPORTING object = main_object
IMPORTING dol = DATA(dol) ).
CATCH cx_root.
CONTINUE.
ENDTRY.
IF dol->is_deleted(
pgmid = main_pgmid
object = main_object
obj_name = main_obj_name ).
DELETE list_wr.
CONTINUE.
ENDIF.
<list>-object_txt = dol->get_object_txt(
pgmid = main_pgmid
object = main_object ).
<list>-ddtext = dol->get_ddtext(
pgmid = main_pgmid
object = main_object
obj_name = main_obj_name ).
ENDLOOP.
list = CORRESPONDING #( list_wr ).
SORT list BY pgmid object obj_name.
DELETE ADJACENT DUPLICATES FROM list COMPARING pgmid object obj_name.
" Created new? """"""""""""""""""""""""""""""""""""""""""""""""""
IF read_creation = abap_false.
RETURN.
ENDIF.
DATA(e071_tmp) = CORRESPONDING e071tab( list_wr ).
IF e071_tmp IS INITIAL.
RETURN.
ENDIF.
SELECT e071~trkorr, e071~object, e071~obj_name, e070~strkorr, e070~as4date, e070~as4time
FROM e071
INNER JOIN e070 ON e070~trkorr = e071~trkorr
FOR ALL ENTRIES IN @e071_tmp
WHERE e071~pgmid = @ycl_addict_transport_request=>pgmid-r3tr AND
e071~object = @e071_tmp-object AND
e071~obj_name = @e071_tmp-obj_name
INTO TABLE @DATA(req_history).
SORT req_history BY object obj_name as4date as4time.
DELETE ADJACENT DUPLICATES FROM req_history COMPARING object obj_name.
LOOP AT list_wr ASSIGNING FIELD-SYMBOL(<wr>).
ASSIGN req_history[ object = <wr>-object
obj_name = <wr>-obj_name
] TO FIELD-SYMBOL(<history>).
<wr>-creation = xsdbool(
sy-subrc = 0 AND
( <history>-trkorr = <wr>-trkorr OR
<history>-strkorr = <wr>-trkorr ) ).
ENDLOOP.
ENDMETHOD.
METHOD get_source_client.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns the source client of the request
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
IF me->lazy_flag-source_client = abap_false.
SELECT SINGLE client INTO me->lazy_val-source_client FROM e070c WHERE trkorr = me->trkorr.
me->lazy_flag-source_client = abap_true.
ENDIF.
client = me->lazy_val-source_client.
ENDMETHOD.
METHOD get_source_client_safe.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns the source client of the request suppressing errors
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
TRY.
client = ycl_addict_transport_request=>get_instance( trkorr )->get_source_client( ).
CATCH cx_root ##no_handler .
ENDTRY.
ENDMETHOD.
METHOD get_subtasks.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns subtasks of the request
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
SELECT trkorr FROM e070
WHERE strkorr = @me->trkorr
INTO CORRESPONDING FIELDS OF TABLE @subtask ##TOO_MANY_ITAB_FIELDS .
LOOP AT subtask ASSIGNING FIELD-SYMBOL(<subtask>).
<subtask>-obj = ycl_addict_transport_request=>get_instance( <subtask>-trkorr ).
IF only_empty = abap_true AND <subtask>-obj->is_empty( ) = abap_false.
DELETE subtask.
CONTINUE.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD get_text.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns text of request
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
IF me->lazy_flag-as4text = abap_false.
SELECT SINGLE as4text FROM e07t
WHERE trkorr = @me->trkorr AND
langu = @sy-langu
INTO @me->lazy_val-as4text.
IF sy-subrc <> 0.
SELECT SINGLE as4text FROM e07t
WHERE trkorr = @me->trkorr
INTO @me->lazy_val-as4text ##WARN_OK. "#EC CI_NOORDER
ENDIF.
me->lazy_flag-as4text = abap_true.
ENDIF.
as4text = me->lazy_val-as4text.
ENDMETHOD.
METHOD get_toc_safety_safe.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns TOC safety, suppressing errors
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
TRY.
safe = get_instance( trkorr )->is_toc_safe( ).
CATCH cx_root ##no_Handler .
ENDTRY.
ENDMETHOD.
METHOD get_user_creatable_trf_rng.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Returns a range of TR functions, which can be created by a user
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
func = VALUE #(
option = ycl_addict_toolkit=>option-eq
sign = ycl_addict_toolkit=>sign-include
( low = ycl_addict_transport_request=>trfunction-cust )
( low = ycl_addict_transport_request=>trfunction-toc )
( low = ycl_addict_transport_request=>trfunction-wb ) ).
ENDMETHOD.
METHOD has_locked_object.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Does the Request contain a locked object?
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
SELECT SINGLE lockflag FROM e071
WHERE trkorr = @me->trkorr AND
lockflag = @abap_true
INTO @data(dummy) ##WARN_OK.
has = xsdbool( sy-subrc = 0 ).
ENDMETHOD.
METHOD has_merge.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Does the Request contain a merged Request?
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
TRY.
DATA(content) = get_content( ).
has = xsdbool( line_exists( content-objects[
pgmid = 'CORR'
object = 'MERG' ] ) ).
CATCH cx_root INTO DATA(diaper).
RAISE EXCEPTION TYPE ycx_addict_data_read
EXPORTING
textid = ycx_addict_data_read=>cant_read_data_type
previous = diaper
objectid = CONV #( me->trkorr )
data_type = CONV #( TEXT-407 ).
ENDTRY.
ENDMETHOD.
METHOD is_empty.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Is Request completely empty?
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
IF me->lazy_flag-empty = abap_false.
me->lazy_val-empty = boolc( get_content( ) IS INITIAL ).
me->lazy_flag-empty = abap_true.
ENDIF.
empty = me->lazy_val-empty.
ENDMETHOD.
METHOD is_obj_type_class_related.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Is the provided object type related to a class?
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
IF ycl_addict_transport_request=>clazy_flag-class_related_obj_tags = abap_false.
ycl_addict_transport_request=>clazy_val-class_related_obj_tag = VALUE #(
( pgmid = ycl_addict_transport_request=>pgmid-limu
object = ycl_addict_transport_request=>object-cinc )
( pgmid = ycl_addict_transport_request=>pgmid-limu
object = ycl_addict_transport_request=>object-clsd )
( pgmid = ycl_addict_transport_request=>pgmid-limu
object = ycl_addict_transport_request=>object-cpri )
( pgmid = ycl_addict_transport_request=>pgmid-limu
object = ycl_addict_transport_request=>object-cpub )
( pgmid = ycl_addict_transport_request=>pgmid-limu
object = ycl_addict_transport_request=>object-meth )
( pgmid = ycl_addict_transport_request=>pgmid-r3tr
object = ycl_addict_transport_request=>object-clas )
( pgmid = ycl_addict_transport_request=>pgmid-r3tr
object = ycl_addict_transport_request=>object-intf ) ).
ycl_addict_transport_request=>clazy_flag-class_related_obj_tags = abap_true.
ENDIF.
related = xsdbool( line_exists(
ycl_addict_transport_request=>clazy_val-class_related_obj_tag[
KEY primary_key COMPONENTS
pgmid = obj_type-pgmid
object = obj_type-object ] ) ).
ENDMETHOD.
METHOD is_toc_safe.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Is this Request safe enough to be included in a ToC?
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
IF me->lazy_flag-toc_safe = abap_false.
DATA(rules) = ycl_addict_toolkit=>get_system_rules( ).
me->lazy_val-toc_safe = rules->is_request_toc_safe( me->trkorr ).
me->lazy_flag-toc_safe = abap_true.
ENDIF.
safe = me->lazy_val-toc_safe.
ENDMETHOD.
METHOD release.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Release the Request
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
CLEAR rel_wait_success.
DATA(wait_success) = VALUE abap_bool_list( ).
IF del_empty_subtasks = abap_true.
delete_empty_subtasks( ).
ENDIF.
" Release subtasks if wanted """"""""""""""""""""""""""""""""""""
DATA(max_wait) = COND i(
WHEN max_rel_wait IS NOT INITIAL
THEN max_rel_wait
ELSE ycl_addict_toolkit=>get_system_definitions( )-max_wait ).
IF rel_subtasks_too = abap_true.
DATA(sub) = get_subtasks( ).
LOOP AT sub ASSIGNING FIELD-SYMBOL(<sub>).
release_single(
EXPORTING trkorr = <sub>-trkorr
req = <sub>-obj
wait_until_released = wait_until_released
max_rel_wait = max_wait
compl_sh_piece_list = compl_sh_piece_list
IMPORTING rel_wait_success = DATA(this_wait_success) ).
APPEND this_wait_success TO wait_success.
CLEAR this_wait_success.
ENDLOOP.
ENDIF.
" Release the Request itself """"""""""""""""""""""""""""""""""""
release_single(
EXPORTING trkorr = me->trkorr
req = me
wait_until_released = wait_until_released
max_rel_wait = max_rel_wait
compl_sh_piece_list = compl_sh_piece_list
IMPORTING rel_wait_success = this_wait_success ).
APPEND this_wait_success TO wait_success.
CLEAR this_wait_success.
" Success? """"""""""""""""""""""""""""""""""""""""""""""""""""""
SORT wait_success BY table_line.
DELETE ADJACENT DUPLICATES FROM wait_success COMPARING table_line.
rel_wait_success = xsdbool(
wait_until_released = abap_true AND
wait_success IS NOT INITIAL AND
( NOT line_exists( wait_success[ table_line = abap_false ] ) ) ).
ENDMETHOD.
METHOD release_single.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Releases a single request
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
DATA request TYPE REF TO ycl_addict_transport_request.
CLEAR rel_wait_success.
" Detect & check request """"""""""""""""""""""""""""""""""""""""
request = COND #( WHEN req IS INITIAL
THEN get_instance( trkorr )
ELSE req ).
IF NOT request->get_header( )-trstatus IN get_open_status_rng( ).
RETURN.
ENDIF.
" Complete piece list """""""""""""""""""""""""""""""""""""""""""
IF compl_sh_piece_list = abap_true.
TRY.
request->complete_shi_piece_list( ).
CATCH cx_root ##no_handler.
ENDTRY.
ENDIF.
" Release """""""""""""""""""""""""""""""""""""""""""""""""""""""
CALL FUNCTION 'TR_RELEASE_REQUEST'
EXPORTING
iv_trkorr = trkorr
iv_dialog = abap_true
iv_as_background_job = abap_false
iv_success_message = abap_false
iv_display_export_log = abap_false
iv_simulation = abap_false
EXCEPTIONS
cts_initialization_failure = 1
enqueue_failed = 2
no_authorization = 3
invalid_request = 4
request_already_released = 5
repeat_too_early = 6
error_in_export_methods = 7
object_check_error = 8
docu_missing = 9
db_access_error = 10
action_aborted_by_user = 11
export_failed = 12
OTHERS = 13
##FM_SUBRC_OK ##NUMBER_OK.
IF sy-subrc <> 5.
ycx_addict_function_subrc=>raise_if_sysubrc_not_initial( 'TR_RELEASE_REQUEST' ).
ENDIF.
" Wait until released (if wanted) """""""""""""""""""""""""""""""
IF wait_until_released = abap_true.
DATA(max_wait) = COND i(
WHEN max_rel_wait IS NOT INITIAL
THEN max_rel_wait
ELSE ycl_addict_toolkit=>get_system_definitions( )-max_wait ).
DATA(total_wait) = 0.
DO.
IF request->has_locked_object( ) = abap_false.
rel_wait_success = abap_true.
EXIT.
ENDIF.
WAIT UP TO 1 SECONDS.
ADD 1 TO total_wait.
CHECK total_wait > max_wait.
rel_wait_success = abap_false.
EXIT.
ENDDO.
ENDIF.
ENDMETHOD.
METHOD sort_and_compress.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sort and compress request
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
TRY.
CALL FUNCTION 'TRINT_SORT_AND_COMPRESS_COMM'
EXPORTING
iv_trkorr = me->trkorr
EXCEPTIONS
request_doesnt_exist = 1
request_released = 2
no_authorization = 3
update_error = 4
OTHERS = 5
##FM_SUBRC_OK.
IF sy-subrc <> 2.
ycx_addict_function_subrc=>raise_if_sysubrc_not_initial( 'TRINT_SORT_AND_COMPRESS_COMM' ).
ENDIF.
CATCH cx_root INTO DATA(diaper).
RAISE EXCEPTION TYPE ycx_addict_sort_and_compress
EXPORTING
textid = ycx_addict_sort_and_compress=>soc_function_error
previous = diaper
trkorr = me->trkorr.
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
565,
62,
2860,
713,
62,
7645,
634,
62,
25927,
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,
355,
19,
5239,
62,
9521,
41876,
371,
27746,
3963,
304,
2998,
83,
12,
292,
19,
5239,
13,
198,
220,
220,
220,
24412,
47,
1546,
355,
19,
7220,
62,
9521,
41876,
371,
27746,
3963,
304,
43509,
12,
292,
19,
7220,
13,
198,
220,
220,
220,
24412,
47,
1546,
3128,
62,
9521,
41876,
371,
27746,
3963,
288,
1381,
13,
198,
220,
220,
220,
24412,
47,
1546,
26181,
62,
3672,
62,
9521,
41876,
371,
27746,
3963,
304,
2998,
16,
12,
26801,
62,
3672,
764,
198,
220,
220,
220,
24412,
47,
1546,
2134,
62,
9521,
41876,
371,
27746,
3963,
304,
2998,
16,
12,
15252,
13,
198,
220,
220,
220,
24412,
47,
1546,
23241,
13602,
62,
9521,
41876,
371,
27746,
3963,
304,
2998,
16,
12,
6024,
13602,
13,
198,
220,
220,
220,
24412,
47,
1546,
491,
8818,
62,
9521,
41876,
371,
27746,
3963,
304,
43509,
12,
2213,
8818,
13,
198,
220,
220,
220,
24412,
47,
1546,
491,
13376,
62,
9521,
41876,
371,
27746,
3963,
304,
43509,
12,
2213,
13376,
13,
628,
220,
220,
220,
24412,
47,
1546,
2581,
62,
42348,
62,
4868,
41876,
49053,
9795,
43679,
3963,
304,
43509,
64,
13315,
38144,
9936,
35374,
13,
198,
220,
220,
220,
24412,
47,
1546,
2581,
62,
2539,
62,
4868,
41876,
49053,
9795,
43679,
3963,
304,
2998,
16,
74,
13315,
38144,
9936,
35374,
13,
198,
220,
220,
220,
24412,
47,
1546,
2581,
62,
7402,
316,
397,
62,
4868,
41876,
49053,
9795,
43679,
3963,
304,
2998,
16,
74,
69,
13315,
38144,
9936,
35374,
13,
198,
220,
220,
220,
24412,
47,
1546,
2581,
62,
15252,
62,
4868,
41876,
49053,
9795,
43679,
3963,
304,
2998,
16,
13315,
38144,
9936,
35374,
13,
198,
220,
220,
220,
24412,
47,
1546,
491,
74,
38890,
62,
4868,
41876,
49053,
9795,
43679,
3963,
491,
74,
38890,
13315,
35374,
3084,
62,
1370,
13,
198,
220,
220,
220,
24412,
47,
1546,
2836,
62,
4868,
41876,
49053,
9795,
43679,
3963,
2124,
549,
3672,
13315,
38144,
9936,
35374,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
2695,
62,
11600,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5563,
220,
220,
220,
41876,
2581,
62,
15252,
62,
4868,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8251,
220,
220,
220,
220,
220,
220,
41876,
2581,
62,
2539,
62,
4868,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
299,
321,
316,
8937,
220,
220,
41876,
2581,
62,
7402,
316,
397,
62,
4868,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12608,
41876,
2581,
62,
42348,
62,
4868,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
2695,
62,
11600,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
2581,
62,
4906,
62,
11600,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23241,
13602,
220,
41876,
304,
2998,
16,
12,
6024,
13602,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2134,
41876,
304,
2998,
16,
12,
15252,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
2581,
62,
4906,
62,
11600,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
2581,
62,
17143,
62,
11600,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
491,
74,
38890,
62,
81,
782,
220,
220,
220,
220,
220,
220,
220,
41876,
331,
926,
62,
2860,
713,
62,
2213,
74,
38890,
62,
81,
782,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
491,
8818,
62,
81,
782,
220,
220,
220,
41876,
331,
926,
62,
2860,
713,
62,
2213,
8818,
62,
81,
782,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
491,
13376,
62,
81,
782,
220,
220,
220,
220,
220,
41876,
491,
13376,
62,
9521,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
355,
19,
7220,
62,
81,
782,
220,
220,
220,
220,
220,
220,
41876,
355,
19,
7220,
62,
9521,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
355,
19,
5239,
62,
81,
782,
220,
220,
220,
220,
220,
220,
41876,
355,
19,
5239,
62,
9521,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
355,
19,
4475,
62,
81,
782,
220,
220,
220,
220,
220,
220,
41876,
3128,
62,
9521,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1276,
62,
14150,
62,
7266,
35943,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19677,
354,
62,
2536,
74,
38890,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8856,
62,
2213,
74,
38890,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
2581,
62,
17143,
62,
11600,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
2581,
62,
392,
62,
15252,
62,
11600,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
491,
74,
38890,
220,
220,
41876,
304,
43509,
12,
2213,
74,
38890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
355,
19,
5239,
220,
41876,
304,
2998,
83,
12,
292,
19,
5239,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
965,
74,
38890,
220,
41876,
304,
43509,
12,
2536,
74,
38890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23241,
13602,
220,
220,
220,
41876,
304,
2998,
16,
12,
6024,
13602,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2134,
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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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
] |
class ZLNKECL_AWS_SIGN_V4_BASE definition
public
abstract
create public .
*"* public components of class ZLNKECL_AWS_SIGN_V4_BASE
*"* do not include other source files here!!!
public section.
constants C_EMPTY_BODY_SHA256 type STRING value 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'. "#EC NOTEXT
methods CONSTRUCTOR
importing
!I_HTTP_REQUEST type ref to IF_HTTP_REQUEST
!I_ENDPOINT_URL type STRING
!I_HTTP_METHOD type STRING
!I_SERVICE_NAME type STRING
!I_REGION type STRING .
protected section.
*"* protected components of class ZLNKECL_AWS_SIGN_V4_BASE
*"* do not include other source files here!!!
data LR_ATTR_HTTP_REQUEST type ref to CL_HTTP_REQUEST .
constants C_SCHEME type STRING value 'AWS4'. "#EC NOTEXT
constants C_ALGORITHM type STRING value 'HMAC-SHA256'. "#EC NOTEXT
constants C_TERMINATOR type STRING value 'aws4_request'. "#EC NOTEXT
data ATTR_SERVICE_NAME type STRING .
data ATTR_REGION type STRING .
methods GET_CANONICALIZEHEADERNAMES
returning
value(E_CANONICALIZEHEADERNAMES) type STRING .
methods GET_CANONICALIZEDHEADERSTRING
returning
value(E_CANONICALIZEDHEADERSTRING) type STRING .
methods GET_CANONICALREQUEST
importing
!I_CANONICALIZEDQUERYPARAMETERS type STRING
!I_CANONICALIZEDHEADERNAMES type STRING
!I_CANONICALIZEDHEADERS type STRING
!I_BODYHASH type STRING
returning
value(E_CANONICALREQUEST) type STRING .
methods GET_CANONICALIZEDQUERYSTRING
returning
value(E_CANONICALIZEDQUERYSTRING) type STRING .
methods GET_STRINGTOSIGN
importing
!I_SCHEME type STRING
!I_ALGORITHM type STRING
!I_DATETIME type STRING
!I_SCOPE type STRING
!I_CANONICALREQUEST type STRING
returning
value(E_STRINGTOSIGN) type STRING
raising
CX_ABAP_MESSAGE_DIGEST .
methods HMAC_SIGN_KSTRING
importing
!I_STRING type STRING
!I_KEY type STRING
!I_ALGORITHM type STRING default 'SHA256'
returning
value(E_SIGNATURE) type XSTRING
raising
CX_ABAP_MESSAGE_DIGEST .
methods HMAC_SIGN_KXSTRING
importing
!I_STRING type STRING
!I_XKEY type XSTRING
!I_ALGORITHM type STRING default 'SHA256'
returning
value(E_SIGNATURE) type XSTRING
raising
CX_ABAP_MESSAGE_DIGEST .
methods GET_TSTMP_ISO8601BASICFORMAT
importing
!I_DATE type DATUM default SY-DATUM
!I_TIME type UZEIT default SY-UZEIT
preferred parameter I_DATE
returning
value(E_TSTMP_ISO8601BASICFORMAT) type STRING .
methods GET_HOST
returning
value(E_HOST) type STRING .
methods GET_DATE_TIME_UTC
exporting
!E_DATE_UTC type DATS
!E_TIME_UTC type TIMS .
private section.
*"* private components of class ZLNKECL_AWS_SIGN_V4_BASE
*"* do not include other source files here!!!
data ATTR_ENDPOINT_URL type STRING .
data ATTR_HTTP_METHOD type STRING .
methods GET_CANONICALIZEDRESOURCEPATH
returning
value(E_CANONICALIZEDRESOURCEPATH) type STRING .
type-pools ABAP .
methods GET_HEADERNAMETOBEINCLUDED
importing
!I_HEADER_NAME type STRING
returning
value(E_HEADERNAMETOINCLUDE) type ABAP_BOOL .
ENDCLASS.
CLASS ZLNKECL_AWS_SIGN_V4_BASE IMPLEMENTATION.
METHOD CONSTRUCTOR.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 25th March 2014
* Object constructor
*--------------------------------------------------------------------*
lr_attr_http_request ?= i_http_request.
attr_endpoint_url = i_endpoint_url.
attr_http_method = i_http_method.
attr_service_name = i_service_name.
attr_region = i_region.
ENDMETHOD.
METHOD GET_CANONICALIZEDHEADERSTRING.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 26th March 2014
* Returns the canonical header string
*--------------------------------------------------------------------*
DATA: lt_ihttpnvp TYPE tihttpnvp.
DATA: l_value_pair TYPE string.
FIELD-SYMBOLS: <fs_ihttpnvp> TYPE ihttpnvp.
lr_attr_http_request->get_header_fields(
CHANGING fields = lt_ihttpnvp ).
* Convert to lowercase the header names...
LOOP AT lt_ihttpnvp ASSIGNING <fs_ihttpnvp>.
TRANSLATE <fs_ihttpnvp>-name TO LOWER CASE. "#EC SYNTCHAR
ENDLOOP.
* ... and remove unwanted headers
LOOP AT lt_ihttpnvp ASSIGNING <fs_ihttpnvp>.
IF get_headernametobeincluded( <fs_ihttpnvp>-name ) = abap_false.
DELETE lt_ihttpnvp INDEX sy-tabix.
ENDIF.
ENDLOOP.
* Sort header fields by name
SORT lt_ihttpnvp BY name.
LOOP AT lt_ihttpnvp ASSIGNING <fs_ihttpnvp>.
CONDENSE <fs_ihttpnvp>-value.
CONCATENATE <fs_ihttpnvp>-name
<fs_ihttpnvp>-value
INTO l_value_pair
SEPARATED BY ':'.
CONCATENATE e_canonicalizedheaderstring
l_value_pair
INTO e_canonicalizedheaderstring.
* Adds LF
CONCATENATE e_canonicalizedheaderstring
cl_abap_char_utilities=>newline
INTO e_canonicalizedheaderstring.
ENDLOOP.
ENDMETHOD.
METHOD get_canonicalizedquerystring.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 26th March 2014
* Returns the canonical query string
*--------------------------------------------------------------------*
TYPES: BEGIN OF typ_string_pair,
name TYPE string,
value TYPE string,
END OF typ_string_pair.
DATA: l_path TYPE string, "#EC NEEDED
l_parameters TYPE string.
DATA: lt_parameters TYPE STANDARD TABLE OF string.
DATA: lt_param_value TYPE STANDARD TABLE OF typ_string_pair,
ls_param_value TYPE typ_string_pair.
FIELD-SYMBOLS: <fs_parameter> TYPE string.
SPLIT attr_endpoint_url AT '?' INTO l_path l_parameters.
SPLIT l_parameters AT '&' INTO TABLE lt_parameters.
* Encode
LOOP AT lt_parameters ASSIGNING <fs_parameter>.
CLEAR ls_param_value.
SPLIT <fs_parameter> AT '=' INTO ls_param_value-name
ls_param_value-value.
CALL METHOD cl_http_utility=>if_http_utility~escape_url
EXPORTING
unescaped = ls_param_value-name
RECEIVING
escaped = ls_param_value-name.
CALL METHOD cl_http_utility=>if_http_utility~escape_url
EXPORTING
unescaped = ls_param_value-value
RECEIVING
escaped = ls_param_value-value.
APPEND ls_param_value TO lt_param_value.
ENDLOOP.
* According to http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html
* the sorting occurs after encoding.
SORT lt_param_value BY name.
LOOP AT lt_param_value INTO ls_param_value.
IF sy-tabix > 1.
CONCATENATE e_canonicalizedquerystring
'&'
INTO e_canonicalizedquerystring.
ENDIF.
CONCATENATE e_canonicalizedquerystring
ls_param_value-name
'='
ls_param_value-value
INTO e_canonicalizedquerystring.
ENDLOOP.
* We wish to have a . instead of %2e
REPLACE ALL OCCURRENCES OF '%2e' IN e_canonicalizedquerystring WITH '.'.
ENDMETHOD.
METHOD get_canonicalizedresourcepath.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 26th March 2014
* Returns the canonical resource path
*--------------------------------------------------------------------*
DATA: l_endpoint_url TYPE string,
l_host TYPE string, "#EC NEEDED
l_parameters TYPE string, "#EC NEEDED
l_resource TYPE string.
l_endpoint_url = attr_endpoint_url.
REPLACE 'http://' WITH space INTO l_endpoint_url.
REPLACE 'https://' WITH space INTO l_endpoint_url.
SPLIT l_endpoint_url AT '/' INTO l_host l_resource.
IF l_resource IS INITIAL.
e_canonicalizedresourcepath = '/'.
ELSE.
SPLIT l_resource AT '?' INTO l_resource l_parameters.
IF l_resource IS INITIAL.
* Arrive here when l_resource is something like ?marker=myFile
e_canonicalizedresourcepath = '/'.
ELSE.
e_canonicalizedresourcepath = l_resource.
IF e_canonicalizedresourcepath(1) <> '/'.
CONCATENATE '/'
e_canonicalizedresourcepath
INTO e_canonicalizedresourcepath.
ENDIF.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD GET_CANONICALIZEHEADERNAMES.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 26th March 2014
* Returns the canonical header names
*--------------------------------------------------------------------*
DATA: lt_ihttpnvp TYPE tihttpnvp.
FIELD-SYMBOLS: <fs_ihttpnvp> TYPE ihttpnvp.
lr_attr_http_request->get_header_fields(
CHANGING fields = lt_ihttpnvp ).
* Convert to lowercase the header names...
LOOP AT lt_ihttpnvp ASSIGNING <fs_ihttpnvp>.
TRANSLATE <fs_ihttpnvp>-name TO LOWER CASE. "#EC SYNTCHAR
ENDLOOP.
* ... and remove unwanted headers
LOOP AT lt_ihttpnvp ASSIGNING <fs_ihttpnvp>.
IF get_headernametobeincluded( <fs_ihttpnvp>-name ) = abap_false.
DELETE lt_ihttpnvp INDEX sy-tabix.
ENDIF.
ENDLOOP.
* Sort header fields by name
SORT lt_ihttpnvp BY name.
LOOP AT lt_ihttpnvp ASSIGNING <fs_ihttpnvp>.
IF sy-tabix = 1.
e_canonicalizeheadernames = <fs_ihttpnvp>-name.
ELSE.
CONCATENATE e_canonicalizeheadernames
<fs_ihttpnvp>-name
INTO e_canonicalizeheadernames
SEPARATED BY ';'.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD GET_CANONICALREQUEST.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 26th March 2014
* Returns the canonical request
*--------------------------------------------------------------------*
DATA: l_canonicalizedresourcepath TYPE string.
l_canonicalizedresourcepath = get_canonicalizedresourcepath( ).
CONCATENATE attr_http_method
cl_abap_char_utilities=>newline
l_canonicalizedresourcepath
cl_abap_char_utilities=>newline
i_canonicalizedqueryparameters
cl_abap_char_utilities=>newline
i_canonicalizedheaders
cl_abap_char_utilities=>newline
i_canonicalizedheadernames
cl_abap_char_utilities=>newline
i_bodyhash
INTO e_canonicalrequest.
ENDMETHOD.
METHOD get_date_time_utc.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 30th July 2014
* Returns date and time UTC
*--------------------------------------------------------------------*
DATA: l_timestamp TYPE timestamp.
DATA: l_time_zone TYPE timezone.
GET TIME STAMP FIELD l_timestamp.
l_time_zone = 'UTC'.
CONVERT TIME STAMP l_timestamp
TIME ZONE l_time_zone
INTO DATE e_date_utc TIME e_time_utc.
ENDMETHOD.
METHOD GET_HEADERNAMETOBEINCLUDED.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 26th March 2014
* Returns true for certain header names, according to
* http://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-header-based-auth.html
*--------------------------------------------------------------------*
e_headernametoinclude = abap_false.
IF i_header_name = 'host'
OR i_header_name = 'content-type'
OR i_header_name = 'content-md5'.
e_headernametoinclude = abap_true.
ELSE.
IF STRLEN( i_header_name ) >= 6.
IF i_header_name(6) = 'x-amz-'.
e_headernametoinclude = abap_true.
ENDIF.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD GET_HOST.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 26th March 2014
* Returns the hostname
*--------------------------------------------------------------------*
DATA: l_path TYPE string,
l_parameters TYPE string, "#EC NEEDED
l_resource TYPE string. "#EC NEEDED
SPLIT attr_endpoint_url AT '?' INTO l_path l_parameters.
REPLACE 'http://' WITH space INTO l_path.
REPLACE 'https://' WITH space INTO l_path.
SPLIT l_path AT '/' INTO e_host l_resource.
CONDENSE e_host.
ENDMETHOD.
METHOD get_stringtosign.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 26th March 2014
* Returns the string to sign
*--------------------------------------------------------------------*
DATA: l_hash_canonicalrequest TYPE string.
l_hash_canonicalrequest = ZLNKEcl_hash=>hash_sha256_for_char(
i_canonicalrequest ).
CONCATENATE i_scheme '-' i_algorithm
cl_abap_char_utilities=>newline
i_datetime
cl_abap_char_utilities=>newline
i_scope
cl_abap_char_utilities=>newline
l_hash_canonicalrequest
INTO e_stringtosign.
ENDMETHOD.
METHOD GET_TSTMP_ISO8601BASICFORMAT.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 26th March 2014
* Given a date and time returns a Timestamp in ISO8601 Basic Format
*--------------------------------------------------------------------*
CONCATENATE i_date 'T' i_time 'Z' INTO e_tstmp_iso8601basicformat.
ENDMETHOD.
METHOD HMAC_SIGN_KSTRING.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 26th March 2014
* Calculates HMAC-SHA256 given a string and a key as string
*--------------------------------------------------------------------*
DATA: l_xkey TYPE xstring.
CALL METHOD cl_abap_hmac=>string_to_xstring
EXPORTING
if_input = i_key
RECEIVING
er_output = l_xkey.
CALL METHOD cl_abap_hmac=>calculate_hmac_for_char
EXPORTING
if_algorithm = i_algorithm
if_key = l_xkey
if_data = i_string
IMPORTING
ef_hmacxstring = e_signature.
ENDMETHOD.
METHOD HMAC_SIGN_KXSTRING.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 26th March 2014
* Calculates HMAC-SHA256 given a string and a key as xstring
*--------------------------------------------------------------------*
CALL METHOD cl_abap_hmac=>calculate_hmac_for_char
EXPORTING
if_algorithm = i_algorithm
if_key = i_xkey
if_data = i_string
IMPORTING
ef_hmacxstring = e_signature.
ENDMETHOD.
ENDCLASS.
| [
4871,
1168,
43,
46888,
2943,
43,
62,
12298,
50,
62,
46224,
62,
53,
19,
62,
33,
11159,
6770,
198,
220,
1171,
198,
220,
12531,
198,
220,
2251,
1171,
764,
198,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1168,
43,
46888,
2943,
43,
62,
12298,
50,
62,
46224,
62,
53,
19,
62,
33,
11159,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
11377,
2665,
13,
628,
220,
38491,
327,
62,
39494,
9936,
62,
33,
33076,
62,
37596,
11645,
2099,
19269,
2751,
1988,
705,
68,
18,
65,
15,
66,
2598,
27728,
16072,
16,
66,
19442,
1878,
19881,
19,
66,
23,
38565,
21855,
24,
1731,
1983,
3609,
3901,
68,
19,
33300,
65,
24,
2682,
6888,
33781,
2079,
16,
65,
3695,
4309,
65,
45432,
4458,
25113,
2943,
5626,
13918,
628,
220,
5050,
7102,
46126,
1581,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
40717,
62,
2200,
35780,
2099,
1006,
284,
16876,
62,
40717,
62,
2200,
35780,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
1677,
6322,
46,
12394,
62,
21886,
2099,
19269,
2751,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
40717,
62,
49273,
2099,
19269,
2751,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
35009,
27389,
62,
20608,
2099,
19269,
2751,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
31553,
2849,
2099,
19269,
2751,
764,
198,
24326,
2665,
13,
198,
9,
1,
9,
6861,
6805,
286,
1398,
1168,
43,
46888,
2943,
43,
62,
12298,
50,
62,
46224,
62,
53,
19,
62,
33,
11159,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
628,
220,
1366,
37491,
62,
1404,
5446,
62,
40717,
62,
2200,
35780,
2099,
1006,
284,
7852,
62,
40717,
62,
2200,
35780,
764,
198,
220,
38491,
327,
62,
50,
3398,
3620,
36,
2099,
19269,
2751,
1988,
705,
12298,
50,
19,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
1847,
38,
1581,
10554,
44,
2099,
19269,
2751,
1988,
705,
36905,
2246,
12,
37596,
11645,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
5781,
23678,
25633,
2099,
19269,
2751,
1988,
705,
8356,
19,
62,
25927,
4458,
25113,
2943,
5626,
13918,
198,
220,
1366,
5161,
5446,
62,
35009,
27389,
62,
20608,
2099,
19269,
2751,
764,
198,
220,
1366,
5161,
5446,
62,
31553,
2849,
2099,
19269,
2751,
764,
628,
220,
5050,
17151,
62,
44565,
1340,
20151,
35400,
37682,
28778,
29559,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
36,
62,
44565,
1340,
20151,
35400,
37682,
28778,
29559,
8,
2099,
19269,
2751,
764,
198,
220,
5050,
17151,
62,
44565,
1340,
20151,
14887,
1961,
37682,
1137,
18601,
2751,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
36,
62,
44565,
1340,
20151,
14887,
1961,
37682,
1137,
18601,
2751,
8,
2099,
19269,
2751,
764,
198,
220,
5050,
17151,
62,
44565,
1340,
20151,
2200,
35780,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
44565,
1340,
20151,
14887,
1961,
10917,
19664,
27082,
2390,
2767,
4877,
2099,
19269,
2751,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
44565,
1340,
20151,
14887,
1961,
37682,
28778,
29559,
2099,
19269,
2751,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
44565,
1340,
20151,
14887,
1961,
37682,
4877,
2099,
19269,
2751,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
33,
33076,
39,
11211,
2099,
19269,
2751,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
36,
62,
44565,
1340,
20151,
2200,
35780,
8,
2099,
19269,
2751,
764,
198,
220,
5050,
17151,
62,
44565,
1340,
20151,
14887,
1961,
10917,
19664,
18601,
2751,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
36,
62,
44565,
1340,
20151,
14887,
1961,
10917,
19664,
18601,
2751,
8,
2099,
19269,
2751,
764,
198,
220,
5050,
17151,
62,
18601,
2751,
51,
2640,
16284,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
50,
3398,
3620,
36,
2099,
19269,
2751,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
1847,
38,
1581,
10554,
44,
2099,
19269,
2751,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
35,
1404,
2767,
12789,
2099,
19269,
2751,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
6173,
32135,
2099,
19269,
2751,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
44565,
1340,
20151,
2200,
35780,
2099,
19269,
2751,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
36,
62,
18601,
2751,
51,
2640,
16284,
8,
2099,
19269,
2751,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
327,
55,
62,
6242,
2969,
62,
44,
1546,
4090,
8264,
62,
35,
3528,
6465,
764,
198,
220,
5050,
25904,
2246,
62,
46224,
62,
42,
18601,
2751,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
18601,
2751,
2099,
19269,
2751,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
20373,
2099,
19269,
2751,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
1847,
38,
1581,
10554,
44,
2099,
19269,
2751,
4277,
705,
37596,
11645,
6,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
36,
62,
46224,
40086,
8,
2099,
1395,
18601,
2751,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
327,
55,
62,
6242,
2969,
62,
44,
1546,
4090,
8264,
62,
35,
3528,
6465,
764,
198,
220,
5050,
25904,
2246,
62,
46224,
62,
42,
55,
18601,
2751,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
18601,
2751,
2099,
19269,
2751,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
55,
20373,
2099,
1395,
18601,
2751,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
1847,
38,
1581,
10554,
44,
2099,
19269,
2751,
4277,
705,
37596,
11645,
6,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
36,
62,
46224,
40086,
8,
2099,
1395,
18601,
2751,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
327,
55,
62,
6242,
2969,
62,
44,
1546,
4090,
8264,
62,
35,
3528,
6465,
764,
198,
220,
5050,
17151,
62,
51,
2257,
7378,
62,
40734,
4521,
486,
33,
1921,
2149,
21389,
1404,
198,
220,
220,
220,
33332
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_generate_demo_data_mipo DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_generate_demo_data_mipo IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
DELETE FROM zrap_atrav_mipo.
DELETE FROM zrap_abook_mipo.
INSERT zrap_atrav_mipo FROM (
SELECT
FROM /dmo/travel
FIELDS
uuid( ) AS travel_uuid ,
travel_id AS travel_id ,
agency_id AS agency_id ,
customer_id AS customer_id ,
begin_date AS begin_date ,
end_date AS end_date ,
booking_fee AS booking_fee ,
total_price AS total_price ,
currency_code AS currency_code ,
description AS description ,
CASE status
WHEN 'B' THEN 'A' " accepted
WHEN 'X' THEN 'X' " cancelled
ELSE 'O' " open
END AS overall_status ,
createdby AS created_by ,
createdat AS created_at ,
lastchangedby AS last_changed_by ,
lastchangedat AS last_changed_at ,
lastchangedat AS local_last_changed_at
ORDER BY travel_id UP TO 200 ROWS
).
COMMIT WORK.
" insert booking demo data
INSERT zrap_abook_mipo FROM (
SELECT
FROM /dmo/booking AS booking
JOIN zrap_atrav_mipo AS z
ON booking~travel_id = z~travel_id
FIELDS
uuid( ) AS booking_uuid ,
z~travel_uuid AS travel_uuid ,
booking~booking_id AS booking_id ,
booking~booking_date AS booking_date ,
booking~customer_id AS customer_id ,
booking~carrier_id AS carrier_id ,
booking~connection_id AS connection_id ,
booking~flight_date AS flight_date ,
booking~flight_price AS flight_price ,
booking~currency_code AS currency_code ,
z~created_by AS created_by ,
z~last_changed_by AS last_changed_by ,
z~last_changed_at AS local_last_changed_by
).
COMMIT WORK.
out->write( 'Travel and booking demo data inserted.').
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
8612,
378,
62,
9536,
78,
62,
7890,
62,
76,
541,
78,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
23255,
37,
2246,
1546,
611,
62,
2238,
62,
324,
83,
62,
4871,
5143,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
8612,
378,
62,
9536,
78,
62,
7890,
62,
76,
541,
78,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
611,
62,
2238,
62,
324,
83,
62,
4871,
5143,
93,
12417,
13,
628,
220,
220,
220,
5550,
2538,
9328,
16034,
1976,
2416,
62,
265,
4108,
62,
76,
541,
78,
13,
198,
220,
220,
220,
5550,
2538,
9328,
16034,
1976,
2416,
62,
397,
566,
62,
76,
541,
78,
13,
628,
220,
220,
220,
29194,
17395,
1976,
2416,
62,
265,
4108,
62,
76,
541,
78,
16034,
357,
198,
220,
220,
220,
220,
220,
220,
220,
33493,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16034,
1220,
67,
5908,
14,
35927,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18930,
3698,
5258,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
27112,
7,
220,
1267,
220,
220,
220,
220,
220,
7054,
3067,
62,
12303,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
837,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3067,
62,
312,
220,
220,
220,
220,
7054,
3067,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
837,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4086,
62,
312,
220,
220,
220,
220,
7054,
4086,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
837,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6491,
62,
312,
220,
220,
7054,
6491,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
837,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2221,
62,
4475,
220,
220,
220,
7054,
2221,
62,
4475,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
837,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
886,
62,
4475,
220,
220,
220,
220,
220,
7054,
886,
62,
4475,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
837,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25452,
62,
39071,
220,
220,
7054,
25452,
62,
39071,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
837,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2472,
62,
20888,
220,
220,
7054,
2472,
62,
20888,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
837,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7395,
62,
8189,
7054,
7395,
62,
8189,
220,
220,
220,
220,
220,
220,
220,
220,
837,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6764,
220,
220,
7054,
6764,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
837,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42001,
3722,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42099,
705,
33,
6,
42243,
705,
32,
6,
366,
6292,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42099,
705,
55,
6,
42243,
705,
55,
6,
366,
16769,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17852,
5188,
705,
46,
6,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
1280,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7054,
4045,
62,
13376,
220,
220,
220,
220,
220,
220,
220,
837,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2727,
1525,
220,
220,
220,
220,
7054,
2727,
62,
1525,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
837,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2727,
265,
220,
220,
220,
220,
7054,
2727,
62,
265,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
837,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
938,
40985,
1525,
7054,
938,
62,
40985,
62,
1525,
220,
220,
220,
220,
220,
220,
837,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
938,
40985,
265,
7054,
938,
62,
40985,
62,
265,
220,
220,
220,
220,
220,
220,
837,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
938,
40985,
265,
7054,
1957,
62,
12957,
62,
40985,
62,
265,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
38678,
11050,
3067,
62,
312,
15958,
5390,
939,
371,
22845,
198,
220,
220,
220,
220,
220,
6739,
198,
220,
220,
220,
22240,
2043,
30936,
13,
628,
220,
220,
220,
366,
7550,
25452,
13605,
1366,
198,
220,
220,
220,
29194,
17395,
1976,
2416,
62,
397,
566,
62,
76,
541,
78,
16034,
357,
198,
220,
220,
220,
220,
220,
220,
220,
33493,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
16034,
220,
220,
1220,
67,
5908,
14,
2070,
278,
220,
220,
220,
7054,
25452,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
32357,
1268,
1976,
2416,
62,
265,
4108,
62,
76,
541,
78,
7054,
1976,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6177,
220,
220,
25452,
93,
35927,
62,
312,
796,
1976,
93,
35927,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18930,
3698,
5258,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
27112,
7,
1267,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7054,
25452,
62,
12303,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
837,
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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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
] |
************************************************************************
************************************************************************
* ██████╗ ██████╗ ███████╗ *
* ██╔══██╗ ██╔════╝ ██╔════╝ *
* ██████╔╝ ██║ ███████╗ *
* ██╔══██╗ ██║ ╚════██║ *
* ██║ ██║██╗╚██████╗██╗███████║ *
* ╚═╝ ╚═╝╚═╝ ╚═════╝╚═╝╚══════╝ *
************************************************************************
************************************************************************
* Request Control System
* This tool enabble to:
* Standardize requests
* Copy request transport tool
* Log Transport
************************************************************************
* Gui Version(2008 - 2016)
* Bruno Rodrigues(BSR) - [email protected]
* Web Version(2016 - 2017)
* Bruno Rodrigues(BSR) - [email protected]
* Wanderson Oliveira - [email protected]
* Paulo Cabral - [email protected]
* Rafael Viana -
************************************************************************
* All rights Reserved©®
************************************************************************
CLASS zcl_ca_ctrlreq_request_reposit DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_ca_ctrlreq_request_reposit .
CLASS-METHODS
get_instance
RETURNING
VALUE(r_return) TYPE REF TO zif_ca_ctrlreq_request_reposit .
PROTECTED SECTION.
PRIVATE SECTION.
CLASS-DATA
go_instance TYPE REF TO zcl_ca_ctrlreq_request_reposit .
DATA:
gt_bdcdata TYPE bdcdata_tab ,
gt_agrupa_msg TYPE TABLE OF bdcmsgcoll ,
gv_hora_inicio TYPE sy-uzeit ,
gv_hora_fim TYPE sy-uzeit ,
go_shdb TYPE REF TO zif_ca_ctrlreq_shdb,
go_bapi_request TYPE REF TO zif_ca_ctrlreq_bapis_requests,
go_banco_dados TYPE REF TO zif_ca_ctrlreq_banco_dados .
METHODS limpa_tabela
CHANGING
!ct_request TYPE zif_ca_ctrlreq_banco_dados=>ty_ztca_requests_tab .
METHODS salva_request_banco_dados
IMPORTING
io_request TYPE REF TO zif_ca_ctrlreq_request
RAISING
zcx_ca_ctrlreq_excecoes .
METHODS atualiza_request
IMPORTING
io_request TYPE REF TO zif_ca_ctrlreq_request
RAISING
zcx_ca_ctrlreq_excecoes .
METHODS salva_request
IMPORTING
!i_shdb TYPE REF TO zif_ca_ctrlreq_shdb OPTIONAL
!i_bapi_request TYPE REF TO zif_ca_ctrlreq_bapis_requests OPTIONAL
CHANGING
co_request TYPE REF TO zif_ca_ctrlreq_request
RAISING
zcx_ca_ctrlreq_excecoes .
METHODS monta_request_importacao
IMPORTING
iv_descricao TYPE e07t-as4text
iv_trfunction TYPE e070-trfunction
iv_request TYPE e070-trkorr
CHANGING
co_request TYPE REF TO zif_ca_ctrlreq_request
RAISING
zcx_ca_ctrlreq_excecoes .
ENDCLASS.
CLASS ZCL_CA_CTRLREQ_REQUEST_REPOSIT IMPLEMENTATION.
METHOD atualiza_request.
zcl_ca_ctrlreq_bapis_requests=>get_instance( )->atualiza_descricao_request( io_request ).
me->salva_request_banco_dados( io_request ).
ENDMETHOD.
METHOD get_instance.
IF go_instance IS NOT BOUND.
go_instance = NEW #( ).
ENDIF.
r_return = go_instance.
ENDMETHOD.
METHOD limpa_tabela.
DATA: lt_e070 TYPE zif_ca_ctrlreq_request=>tty_cod_requests,
lo_banco_dados TYPE REF TO zif_ca_ctrlreq_banco_dados,
lv_commit_work TYPE abap_bool.
lv_commit_work = abap_false.
lo_banco_dados = zcl_ca_ctrlreq_banco_dados=>get_instance( ).
SELECT trkorr
INTO TABLE lt_e070
FROM e070
FOR ALL ENTRIES IN ct_request
WHERE trkorr = ct_request-trkorr.
* AND trfunction IN ('K','W').
LOOP AT ct_request INTO DATA(wa_request).
READ TABLE lt_e070 INTO DATA(wa_e070) WITH KEY trkorr = wa_request-trkorr.
IF sy-subrc NE 0.
TRY.
lo_banco_dados->deletar_request( wa_request-trkorr ).
CATCH zcx_ca_ctrlreq_excecoes INTO DATA(ex).
ENDTRY.
DELETE ct_request WHERE trkorr EQ wa_request-trkorr.
lv_commit_work = abap_true.
ENDIF.
ENDLOOP.
IF lv_commit_work EQ abap_true.
lo_banco_dados->commit_work( ).
ENDIF.
ENDMETHOD.
METHOD monta_request_importacao.
DATA: lw_request TYPE ztca_requests,
lv_trfunction TYPE e070-trfunction,
lv_demanda(9),
lv_tipo(2).
SPLIT iv_descricao AT '_' INTO lv_trfunction
lw_request-modulo
lw_request-process_area
lv_demanda(9)
lw_request-as4text.
co_request = NEW zcl_ca_ctrlreq_request(
i_request = iv_request
i_demanda = CONV #( lv_demanda+2(7) )
i_tipo_demanda = lv_demanda(2)
i_process_area = lw_request-process_area
i_modulo = lw_request-modulo
i_consultor = lw_request-consultor
i_funcional = lw_request-funcional
i_data = sy-datum
i_descricao_sem_prefixo = lw_request-as4text
i_tipo_request = iv_trfunction
i_request_origem = lw_request-request_origem
).
ENDMETHOD.
METHOD salva_request.
DATA(lv_hora_inicio) = sy-uzeit.
go_banco_dados = zcl_ca_ctrlreq_banco_dados=>get_instance( ).
* IF sy-uname = zif_ca_ctrlreq_request=>cc_usuario_teste-wanderson or
* sy-uname = zif_ca_ctrlreq_request=>cc_usuario_teste-rafael .
IF i_bapi_request IS NOT BOUND.
go_bapi_request = zcl_ca_ctrlreq_bapis_requests=>get_instance( ).
ELSE.
go_bapi_request = i_bapi_request.
ENDIF.
go_bapi_request->criar_request( CHANGING c_request = co_request ).
*
* ELSE.
*
* "Cria o SHDB
* IF i_shdb IS NOT BOUND.
* go_shdb = NEW zcl_ca_ctrlreq_shdb( ).
* ELSE.
* go_shdb = i_shdb.
* ENDIF.
*
* go_shdb->executa_shdb( CHANGING c_request = co_request ).
*
* ENDIF.
*
*
* DATA(lv_hora_fim) = sy-uzeit.
*
IF co_request->get_tipo_request( ) = zif_ca_ctrlreq_request=>cc_tipo-transporte_copia.
"Transporta a cópia
co_request->release_request( ).
ENDIF.
* WHEN zif_ca_ctrlreq_request=>cc_tipo-customizing OR
* zif_ca_ctrlreq_request=>cc_tipo-workbench.
*
* IF sy-uname <> zif_ca_ctrlreq_request=>cc_usuario_teste-rafael.
*
*
*
* "Pega o numero da request
*
*
*
* DATA(lv_request) = go_banco_dados->get_request_hora(
* EXPORTING
* i_hora_inicio = lv_hora_inicio
* i_hora_fim = lv_hora_fim ).
*
* IF lv_request IS NOT INITIAL.
*
* co_request->set_request( lv_request ).
*
* ELSE.
*
* RAISE EXCEPTION TYPE zcx_ca_ctrlreq_excecoes
* EXPORTING
* textid = zcx_ca_ctrlreq_excecoes=>erro_shdb_se10.
*
* ENDIF.
*
* ENDIF.
*
* ENDCASE.
TRY.
me->salva_request_banco_dados( co_request ).
CLEANUP INTO DATA(lo_excecao).
go_banco_dados->rollback( ).
ENDTRY.
ENDMETHOD.
METHOD salva_request_banco_dados.
go_banco_dados = zcl_ca_ctrlreq_banco_dados=>get_instance( ).
DATA(wa_request) = me->zif_ca_ctrlreq_request_reposit~objeto_to_wa( io_request ).
IF io_request->get_tipo_request( ) EQ zif_ca_ctrlreq_request=>cc_tipo-transporte_copia.
go_banco_dados->deletar_request_copia( wa_request-request_origem ).
ENDIF.
TRY.
go_banco_dados->salvar_request( wa_request ).
go_banco_dados->commit_work( ).
CATCH zcx_ca_ctrlreq_excecoes INTO DATA(ex).
go_banco_dados->rollback( ).
RAISE EXCEPTION ex.
ENDTRY.
ENDMETHOD.
METHOD zif_ca_ctrlreq_request_reposit~get_request.
IF i_request IS INITIAL.
RAISE EXCEPTION TYPE zcx_ca_ctrlreq_excecoes
EXPORTING
textid = zcx_ca_ctrlreq_excecoes=>request_invalida.
ENDIF.
DATA(lw_dados_request) = zcl_ca_ctrlreq_banco_dados=>get_instance( )->get_request( i_request = i_request ).
r_request = NEW zcl_ca_ctrlreq_request(
!i_request = lw_dados_request-trkorr
!i_demanda = lw_dados_request-demanda
!i_tipo_demanda = lw_dados_request-tipo_demanda
!i_process_area = lw_dados_request-process_area
!i_modulo = lw_dados_request-modulo
!i_consultor = lw_dados_request-consultor
!i_funcional = lw_dados_request-funcional
!i_data = lw_dados_request-data
!i_descricao_sem_prefixo = lw_dados_request-as4text
!i_tipo_request = lw_dados_request-trfunction
!i_request_origem = lw_dados_request-request_origem ).
ENDMETHOD.
METHOD zif_ca_ctrlreq_request_reposit~get_requests.
IF iw_range IS INITIAL.
RAISE EXCEPTION TYPE zcx_ca_ctrlreq_excecoes
EXPORTING
textid = zcx_ca_ctrlreq_excecoes=>nenhum_filtro_informado.
ENDIF.
DATA(lo_banco_dados) = zcl_ca_ctrlreq_banco_dados=>get_instance( ).
DATA(lt_request) = lo_banco_dados->get_requests( iw_range ).
me->limpa_tabela( CHANGING ct_request = lt_request ).
IF lt_request IS INITIAL.
RETURN.
ENDIF.
DATA(lo_info_reques) = NEW zcl_ca_ctrlreq_info_request( ).
LOOP AT lt_request INTO DATA(lw_request).
INSERT INITIAL LINE INTO TABLE rt_report ASSIGNING FIELD-SYMBOL(<lf_report>).
MOVE-CORRESPONDING lw_request TO <lf_report>.
lo_info_reques->get_status_transp_ambientes(
EXPORTING
iw_ambientes = iw_ambientes
CHANGING
c_request = <lf_report> ).
* Apaga as cópias das request que foram para a PRD.
IF <lf_report>-prd = abap_true.
DELETE lt_request WHERE request_origem = <lf_report>-trkorr and trfunction = zcl_ca_ctrlreq_request=>cc_tipo-transporte_copia.
DELETE rt_report WHERE request_origem = <lf_report>-trkorr and trfunction = zcl_ca_ctrlreq_request=>cc_tipo-transporte_copia.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD zif_ca_ctrlreq_request_reposit~importa_request.
IF i_request IS INITIAL.
RAISE EXCEPTION TYPE zcx_ca_ctrlreq_excecoes
EXPORTING
textid = zcx_ca_ctrlreq_excecoes=>request_invalida.
ENDIF.
DATA: lw_e07t TYPE e07t,
lv_trfunction TYPE e070-trfunction,
lv_trstatus TYPE e070-trstatus,
lv_as4user TYPE e070-as4user,
lv_message TYPE syst_msgv,
lv_request_cadastrada TYPE ztca_requests-trkorr.
"Verifica se a request já está na tabela Z
SELECT SINGLE trkorr
FROM ztca_requests
INTO lv_request_cadastrada
WHERE trkorr = i_request.
IF lv_request_cadastrada IS NOT INITIAL.
RAISE EXCEPTION TYPE zcx_ca_ctrlreq_excecoes
EXPORTING
textid = zcx_ca_ctrlreq_excecoes=>request_ja_existe.
ENDIF.
SELECT SINGLE * FROM e07t
INTO lw_e07t
WHERE trkorr EQ i_request AND
langu EQ sy-langu.
IF lw_e07t IS INITIAL.
RAISE EXCEPTION TYPE zcx_ca_ctrlreq_excecoes
EXPORTING
textid = zcx_ca_ctrlreq_excecoes=>request_invalida.
ENDIF.
SELECT SINGLE trfunction trstatus as4user
FROM e070
INTO ( lv_trfunction, lv_trstatus, lv_as4user )
WHERE trkorr EQ i_request.
IF NOT ( lv_trfunction EQ zif_ca_ctrlreq_request=>cc_tipo-workbench ) AND
NOT ( lv_trfunction EQ zif_ca_ctrlreq_request=>cc_tipo-customizing ) .
RAISE EXCEPTION TYPE zcx_ca_ctrlreq_excecoes
EXPORTING
textid = zcx_ca_ctrlreq_excecoes=>tipo_invalido.
ENDIF.
CALL FUNCTION 'YLC_UTL_CHECK_NAME'
EXPORTING
input = lw_e07t-as4text " Descrição breve dos objetos Repository
IMPORTING
ev_message = lv_message " Mensagem de retorno
EXCEPTIONS
invalid = 1
OTHERS = 2.
IF sy-subrc EQ 0 ."AND lw_e07t-as4text(1) <> lv_trfunction.
me->monta_request_importacao(
EXPORTING
iv_descricao = lw_e07t-as4text
iv_trfunction = lv_trfunction
iv_request = i_request
CHANGING
co_request = r_request
).
ELSE.
IF lv_trstatus NE zif_ca_ctrlreq_request=>cc_status_req-mod.
RAISE EXCEPTION TYPE zcx_ca_ctrlreq_excecoes
EXPORTING
textid = zcx_ca_ctrlreq_excecoes=>request_ja_liberada
request_task = i_request.
ELSEIF lv_trstatus NE zif_ca_ctrlreq_request=>cc_status_req-mod.
RAISE EXCEPTION TYPE zcx_ca_ctrlreq_excecoes
EXPORTING
textid = zcx_ca_ctrlreq_excecoes=>request_ja_liberada
request_task = i_request.
ELSEIF sy-uname NE lv_as4user.
RAISE EXCEPTION TYPE zcx_ca_ctrlreq_excecoes
EXPORTING
textid = zcx_ca_ctrlreq_excecoes=>user_invalido
usuario = lv_as4user.
ELSE.
RAISE EXCEPTION TYPE zcx_ca_ctrlreq_excecoes
EXPORTING
textid = zcx_ca_ctrlreq_excecoes=>descricao_invalida
msgv1 = lv_message.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD zif_ca_ctrlreq_request_reposit~objeto_to_wa.
rw_request-trkorr = io_request->get_request( ).
rw_request-demanda = io_request->get_demanda( ).
rw_request-tipo_demanda = io_request->get_tipo_demanda( ).
rw_request-process_area = io_request->get_process_area( ).
rw_request-consultor = io_request->get_consultor( ).
rw_request-as4text = io_request->get_descricao( ).
rw_request-funcional = io_request->get_funcional( ).
rw_request-data = sy-datum.
rw_request-hora = sy-uzeit.
rw_request-modulo = io_request->get_modulo( ).
rw_request-trfunction = io_request->get_tipo_request( ).
rw_request-request_origem = io_request->get_request_origem( ).
rw_request-horaex = io_request->get_hora_exportacao( ).
rw_request-dataex = io_request->get_data_exportacao( ).
ENDMETHOD.
METHOD zif_ca_ctrlreq_request_reposit~salvar.
c_request->is_valida_salvar( ).
" Atualiza a request
IF c_request->get_request( ) IS NOT INITIAL.
me->atualiza_request( c_request ).
ELSE.
me->salva_request(
EXPORTING
i_shdb = i_shdb
i_bapi_request = i_bapi_request
CHANGING
co_request = c_request ).
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
17174,
17174,
4557,
198,
17174,
17174,
4557,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23287,
20503,
8115,
22880,
245,
220,
220,
220,
220,
23287,
20503,
8115,
22880,
245,
220,
220,
23287,
20503,
9968,
22880,
245,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23287,
8115,
22880,
242,
31732,
9968,
22880,
245,
220,
220,
23287,
8115,
22880,
242,
31732,
31732,
22880,
251,
220,
220,
23287,
8115,
22880,
242,
31732,
31732,
22880,
251,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23287,
20503,
8115,
22880,
242,
22880,
251,
220,
220,
23287,
8115,
22880,
239,
220,
220,
220,
220,
220,
220,
220,
23287,
20503,
9968,
22880,
245,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23287,
8115,
22880,
242,
31732,
9968,
22880,
245,
220,
220,
23287,
8115,
22880,
239,
220,
220,
220,
220,
220,
220,
220,
2343,
243,
248,
31732,
31732,
9968,
22880,
239,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23287,
8115,
22880,
239,
220,
23287,
8115,
22880,
239,
9968,
22880,
245,
22880,
248,
20503,
9968,
22880,
245,
9968,
22880,
245,
20503,
9968,
8115,
22880,
239,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1635,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2343,
243,
248,
28670,
22880,
251,
220,
2343,
243,
248,
28670,
22880,
251,
22880,
248,
28670,
22880,
251,
2343,
243,
248,
31732,
31732,
28670,
22880,
251,
22880,
248,
28670,
22880,
251,
22880,
248,
31732,
31732,
31732,
22880,
251,
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,
4557,
198,
17174,
17174,
4557,
198,
9,
19390,
6779,
4482,
198,
9,
770,
2891,
551,
397,
903,
284,
25,
198,
9,
8997,
1096,
7007,
198,
9,
17393,
2581,
4839,
2891,
198,
9,
5972,
19940,
198,
17174,
17174,
4557,
198,
9,
1962,
72,
10628,
7,
11528,
532,
1584,
8,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31045,
16114,
947,
7,
4462,
49,
8,
532,
45033,
418,
346,
6862,
13,
81,
31,
14816,
13,
785,
198,
9,
5313,
10628,
7,
5304,
532,
2177,
8,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31045,
16114,
947,
7,
4462,
49,
8,
532,
45033,
418,
346,
6862,
13,
81,
31,
14816,
13,
785,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22420,
882,
30012,
8704,
220,
220,
532,
11569,
882,
13,
86,
418,
31,
14816,
13,
785,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34410,
15976,
1373,
220,
220,
220,
220,
220,
220,
220,
220,
532,
279,
2518,
1219,
1416,
397,
1373,
31,
14816,
13,
785,
198,
9,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31918,
569,
7484,
220,
220,
220,
220,
220,
220,
220,
220,
532,
198,
17174,
17174,
4557,
198,
9,
1439,
2489,
33876,
16224,
7461,
198,
17174,
17174,
4557,
198,
198,
31631,
1976,
565,
62,
6888,
62,
44755,
42180,
62,
25927,
62,
260,
1930,
270,
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,
6888,
62,
44755,
42180,
62,
25927,
62,
260,
1930,
270,
764,
628,
220,
220,
220,
42715,
12,
49273,
50,
198,
220,
220,
220,
220,
220,
651,
62,
39098,
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,
62,
7783,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
6888,
62,
44755,
42180,
62,
25927,
62,
260,
1930,
270,
764,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
42715,
12,
26947,
198,
220,
220,
220,
220,
220,
467,
62,
39098,
41876,
4526,
37,
5390,
1976,
565,
62,
6888,
62,
44755,
42180,
62,
25927,
62,
260,
1930,
270,
764,
628,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
308,
83,
62,
17457,
66,
7890,
220,
220,
220,
220,
220,
41876,
275,
17896,
7890,
62,
8658,
837,
198,
220,
220,
220,
220,
220,
308,
83,
62,
363,
622,
8957,
62,
19662,
220,
220,
41876,
43679,
3963,
275,
17896,
19662,
26000,
837,
198,
220,
220,
220,
220,
220,
308,
85,
62,
71,
5799,
62,
259,
46441,
220,
41876,
827,
12,
84,
2736,
270,
837,
198,
220,
220,
220,
220,
220,
308,
85,
62,
71,
5799,
62,
69,
320,
220,
220,
220,
220,
41876,
827,
12,
84,
2736,
270,
837,
198,
220,
220,
220,
220,
220,
467,
62,
1477,
9945,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
6888,
62,
44755,
42180,
62,
1477,
9945,
11,
198,
220,
220,
220,
220,
220,
467,
62,
65,
15042,
62,
25927,
41876,
4526,
37,
5390,
1976,
361,
62,
6888,
62,
44755,
42180
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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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
] |
CLASS y_check_number_interfaces DEFINITION
PUBLIC
INHERITING FROM y_check_base
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor .
PROTECTED SECTION.
METHODS execute_check REDEFINITION.
METHODS inspect_tokens REDEFINITION.
PRIVATE SECTION.
DATA interface_counter TYPE i VALUE 0.
METHODS checkif_error
IMPORTING index TYPE i
statement TYPE sstmnt.
ENDCLASS.
CLASS Y_CHECK_NUMBER_INTERFACES IMPLEMENTATION.
METHOD checkif_error.
DATA(check_configuration) = detect_check_configuration( error_count = interface_counter
statement = 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
parameter_01 = |{ interface_counter }|
parameter_02 = |{ check_configuration-threshold }| ).
ENDMETHOD.
METHOD constructor.
super->constructor( ).
settings-pseudo_comment = '"#EC NMBR_INTERFACES' ##NO_TEXT.
settings-threshold = 4.
settings-documentation = |{ c_docs_path-checks }number-interfaces.md|.
set_check_message( 'Number of interfaces must be lower than &2! (&1>=&2)' ).
ENDMETHOD.
METHOD execute_check.
LOOP AT ref_scan_manager->get_structures( ) ASSIGNING FIELD-SYMBOL(<structure>)
WHERE stmnt_type EQ scan_struc_stmnt_type-class_definition OR
stmnt_type EQ scan_struc_stmnt_type-interface.
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.
READ TABLE ref_scan_manager->get_statements( ) INTO DATA(statement_for_message)
INDEX <structure>-stmnt_from.
interface_counter = 0.
LOOP AT ref_scan_manager->get_statements( ) ASSIGNING FIELD-SYMBOL(<statement>)
FROM <structure>-stmnt_from TO <structure>-stmnt_to.
inspect_tokens( statement = <statement> ).
ENDLOOP.
checkif_error( index = <structure>-stmnt_from
statement = statement_for_message ).
ENDLOOP.
ENDMETHOD.
METHOD inspect_tokens.
CHECK get_token_abs( statement-from ) EQ 'INTERFACES'.
ADD 1 TO interface_counter.
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
62,
9122,
62,
17618,
62,
3849,
32186,
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,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
12260,
62,
9122,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
10104,
62,
83,
482,
641,
23848,
36,
20032,
17941,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
7071,
62,
24588,
41876,
1312,
26173,
8924,
657,
13,
628,
220,
220,
220,
337,
36252,
50,
2198,
361,
62,
18224,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
6376,
220,
220,
220,
220,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2643,
41876,
264,
301,
76,
429,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
575,
62,
50084,
62,
41359,
13246,
62,
41358,
37,
2246,
1546,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
2198,
361,
62,
18224,
13,
198,
220,
220,
220,
42865,
7,
9122,
62,
11250,
3924,
8,
796,
4886,
62,
9122,
62,
11250,
3924,
7,
4049,
62,
9127,
796,
7071,
62,
24588,
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,
2643,
796,
2643,
6739,
198,
220,
220,
220,
16876,
2198,
62,
11250,
3924,
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,
5298,
62,
18224,
7,
2643,
62,
5715,
220,
220,
220,
220,
220,
796,
2643,
12,
5715,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2643,
62,
9630,
220,
220,
220,
220,
220,
796,
6376,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2643,
62,
6738,
220,
220,
220,
220,
220,
220,
796,
2643,
12,
6738,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4049,
62,
49336,
220,
220,
220,
220,
220,
220,
796,
2198,
62,
11250,
3924,
12,
3448,
78,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11507,
62,
486,
220,
220,
220,
220,
220,
220,
220,
220,
796,
930,
90,
7071,
62,
24588,
1782,
91,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11507,
62,
2999,
220,
220,
220,
220,
220,
220,
220,
220,
796,
930,
90,
2198,
62,
11250,
3924,
12,
400,
10126,
1782,
91,
6739,
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,
6460,
12,
7752,
12003,
62,
23893,
796,
705,
1,
2,
2943,
399,
10744,
49,
62,
41358,
37,
2246,
1546,
6,
22492,
15285,
62,
32541,
13,
198,
220,
220,
220,
6460,
12,
400,
10126,
796,
604,
13,
198,
220,
220,
220,
6460,
12,
22897,
341,
796,
930,
90,
269,
62,
31628,
62,
6978,
12,
42116,
1782,
17618,
12,
3849,
32186,
13,
9132,
91,
13,
628,
220,
220,
220,
900,
62,
9122,
62,
20500,
7,
705,
15057,
286,
20314,
1276,
307,
2793,
621,
1222,
17,
0,
35494,
16,
29,
28,
5,
17,
33047,
6739,
198,
220,
23578,
49273,
13,
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,
4871,
62,
46758,
6375,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
336,
76,
429,
62,
4906,
36529,
9367,
62,
19554,
66,
62,
301,
76,
429,
62,
4906,
12,
39994,
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,
20832,
43679,
1006,
62,
35836,
62,
37153,
3784,
1136,
62,
14269,
3196,
7,
1267,
39319,
42865,
7,
26090,
62,
1640,
62,
20500,
8,
198,
220,
220,
220,
220,
220,
220,
220,
24413,
6369,
1279,
301,
5620,
29,
12,
301,
76,
429,
62,
6738,
13,
198,
220,
220,
220,
220,
220,
7071,
62,
24588,
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,
2643,
796,
1279,
26090,
29,
6739,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class YEA_BASE_QUERY definition
public
final
create public .
public section.
interfaces YEA_QUERY .
methods CONSTRUCTOR
importing
!URI_QUERY type STRING .
protected section.
private section.
data _KEYS type YEA_KEY_VALUES .
ENDCLASS.
CLASS YEA_BASE_QUERY IMPLEMENTATION.
method constructor.
" data(uri_clean) = cl_http_utility=>if_http_utility~unescape_url( uri_query ).
split uri_query at '&' into table data(query_splits).
loop at query_splits assigning field-symbol(<u_q>).
split <u_q> at '=' into table data(query_values).
data kv type yea_key_value.
try.
kv-key = cl_http_utility=>if_http_utility~unescape_url( query_values[ 1 ] ).
kv-value = cl_http_utility=>if_http_utility~unescape_url( query_values[ 2 ] ).
catch cx_root.
endtry.
if ( kv is not initial ).
append kv to _keys.
clear kv.
endif.
endloop.
endmethod.
method YEA_QUERY~GET.
try.
returning = _keys[ key = argument ]-value.
catch cx_root.
endtry.
endmethod.
method YEA_QUERY~HAS.
try.
data(found) = _keys[ key = argument ].
returning = abap_true.
catch cx_root.
endtry.
endmethod.
method yea_query~list.
returning = _keys.
endmethod.
ENDCLASS.
| [
4871,
575,
16412,
62,
33,
11159,
62,
10917,
19664,
6770,
198,
220,
1171,
198,
220,
2457,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
20314,
575,
16412,
62,
10917,
19664,
764,
628,
220,
5050,
7102,
46126,
1581,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
47269,
62,
10917,
19664,
2099,
19269,
2751,
764,
198,
24326,
2665,
13,
198,
19734,
2665,
13,
628,
220,
1366,
4808,
7336,
16309,
2099,
575,
16412,
62,
20373,
62,
23428,
35409,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
575,
16412,
62,
33,
11159,
62,
10917,
19664,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
2446,
23772,
13,
198,
220,
220,
220,
366,
1366,
7,
9900,
62,
27773,
8,
796,
537,
62,
4023,
62,
315,
879,
14804,
361,
62,
4023,
62,
315,
879,
93,
403,
41915,
62,
6371,
7,
2956,
72,
62,
22766,
6739,
198,
220,
220,
220,
6626,
2956,
72,
62,
22766,
379,
705,
5,
6,
656,
3084,
1366,
7,
22766,
62,
22018,
896,
737,
198,
220,
220,
220,
9052,
379,
12405,
62,
22018,
896,
38875,
2214,
12,
1837,
23650,
7,
27,
84,
62,
80,
29,
737,
198,
220,
220,
220,
220,
220,
6626,
1279,
84,
62,
80,
29,
379,
705,
11639,
656,
3084,
1366,
7,
22766,
62,
27160,
737,
198,
220,
220,
220,
220,
220,
1366,
479,
85,
2099,
44642,
62,
2539,
62,
8367,
13,
198,
220,
220,
220,
220,
220,
1949,
13,
198,
220,
220,
220,
220,
220,
220,
220,
479,
85,
12,
2539,
220,
220,
796,
537,
62,
4023,
62,
315,
879,
14804,
361,
62,
4023,
62,
315,
879,
93,
403,
41915,
62,
6371,
7,
12405,
62,
27160,
58,
352,
2361,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
479,
85,
12,
8367,
796,
537,
62,
4023,
62,
315,
879,
14804,
361,
62,
4023,
62,
315,
879,
93,
403,
41915,
62,
6371,
7,
12405,
62,
27160,
58,
362,
2361,
6739,
198,
220,
220,
220,
220,
220,
4929,
43213,
62,
15763,
13,
198,
220,
220,
220,
220,
220,
886,
28311,
13,
198,
220,
220,
220,
220,
220,
611,
357,
479,
85,
318,
407,
4238,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
24443,
479,
85,
284,
4808,
13083,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1598,
479,
85,
13,
198,
220,
220,
220,
220,
220,
45762,
13,
198,
220,
220,
220,
886,
26268,
13,
198,
220,
886,
24396,
13,
628,
198,
220,
2446,
575,
16412,
62,
10917,
19664,
93,
18851,
13,
198,
220,
220,
220,
1949,
13,
198,
220,
220,
220,
220,
220,
8024,
796,
4808,
13083,
58,
1994,
796,
4578,
2361,
12,
8367,
13,
198,
220,
220,
220,
4929,
43213,
62,
15763,
13,
198,
220,
220,
220,
886,
28311,
13,
198,
220,
886,
24396,
13,
628,
198,
220,
2446,
575,
16412,
62,
10917,
19664,
93,
39,
1921,
13,
198,
220,
220,
220,
1949,
13,
198,
220,
220,
220,
220,
220,
1366,
7,
9275,
8,
796,
4808,
13083,
58,
1994,
796,
4578,
20740,
198,
220,
220,
220,
220,
220,
8024,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
4929,
43213,
62,
15763,
13,
198,
220,
220,
220,
886,
28311,
13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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
] |
FUNCTION zgtt_mia_ote_dl_hdr.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(I_APPSYS) TYPE /SAPTRX/APPLSYSTEM
*" REFERENCE(I_APP_OBJ_TYPES) TYPE /SAPTRX/AOTYPES
*" REFERENCE(I_ALL_APPL_TABLES) TYPE TRXAS_TABCONTAINER
*" REFERENCE(I_APP_TYPE_CNTL_TABS) TYPE TRXAS_APPTYPE_TABS
*" REFERENCE(I_APP_OBJECTS) TYPE TRXAS_APPOBJ_CTABS
*" TABLES
*" E_CONTROL_DATA STRUCTURE /SAPTRX/CONTROL_DATA
*" E_LOGTABLE STRUCTURE BAPIRET2 OPTIONAL
*" EXCEPTIONS
*" PARAMETER_ERROR
*" CDATA_DETERMINATION_ERROR
*" TABLE_DETERMINATION_ERROR
*" STOP_PROCESSING
*"----------------------------------------------------------------------
DATA: lo_udm_message TYPE REF TO cx_udm_message,
ls_bapiret TYPE bapiret2.
TRY.
zcl_gtt_mia_ef_performer=>get_control_data(
EXPORTING
is_definition = VALUE #( maintab = zif_gtt_mia_app_constants=>cs_tabledef-dl_header_new )
io_tp_factory = NEW zcl_gtt_mia_tp_factory_dlh( )
iv_appsys = i_appsys
is_app_obj_types = i_app_obj_types
it_all_appl_tables = i_all_appl_tables
it_app_type_cntl_tabs = i_app_type_cntl_tabs
it_app_objects = i_app_objects
CHANGING
ct_control_data = e_control_data[] ).
CATCH cx_udm_message INTO lo_udm_message.
zcl_gtt_mia_tools=>get_errors_log(
EXPORTING
io_umd_message = lo_udm_message
iv_appsys = i_appsys
IMPORTING
es_bapiret = ls_bapiret ).
" add error message
APPEND ls_bapiret TO e_logtable.
" throw corresponding exception
CASE lo_udm_message->textid.
WHEN zif_gtt_mia_ef_constants=>cs_errors-stop_processing.
RAISE stop_processing.
WHEN zif_gtt_mia_ef_constants=>cs_errors-table_determination.
RAISE table_determination_error.
ENDCASE.
ENDTRY.
ENDFUNCTION.
| [
42296,
4177,
2849,
1976,
70,
926,
62,
20730,
62,
1258,
62,
25404,
62,
71,
7109,
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,
40,
62,
2969,
3705,
16309,
8,
41876,
220,
1220,
50,
2969,
5446,
55,
14,
2969,
6489,
23060,
25361,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
40,
62,
24805,
62,
9864,
41,
62,
9936,
47,
1546,
8,
41876,
220,
1220,
50,
2969,
5446,
55,
14,
32,
2394,
48232,
1546,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
40,
62,
7036,
62,
2969,
6489,
62,
5603,
9148,
1546,
8,
41876,
220,
7579,
55,
1921,
62,
5603,
2749,
1340,
30339,
1137,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
40,
62,
24805,
62,
25216,
62,
34,
11251,
43,
62,
5603,
4462,
8,
41876,
220,
7579,
55,
1921,
62,
24805,
25216,
62,
5603,
4462,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
40,
62,
24805,
62,
9864,
41,
2943,
4694,
8,
41876,
220,
7579,
55,
1921,
62,
24805,
9864,
41,
62,
4177,
32,
4462,
198,
9,
1,
220,
309,
6242,
28378,
198,
9,
1,
220,
220,
220,
220,
220,
412,
62,
10943,
5446,
3535,
62,
26947,
19269,
18415,
11335,
220,
1220,
50,
2969,
5446,
55,
14,
10943,
5446,
3535,
62,
26947,
198,
9,
1,
220,
220,
220,
220,
220,
412,
62,
25294,
38148,
19269,
18415,
11335,
220,
347,
17614,
26087,
17,
39852,
2849,
1847,
198,
9,
1,
220,
7788,
42006,
11053,
198,
9,
1,
220,
220,
220,
220,
220,
29463,
2390,
2767,
1137,
62,
24908,
198,
9,
1,
220,
220,
220,
220,
220,
6458,
13563,
62,
35,
2767,
1137,
23678,
6234,
62,
24908,
198,
9,
1,
220,
220,
220,
220,
220,
43679,
62,
35,
2767,
1137,
23678,
6234,
62,
24908,
198,
9,
1,
220,
220,
220,
220,
220,
44934,
62,
4805,
4503,
7597,
2751,
198,
9,
1,
10097,
23031,
198,
220,
42865,
25,
2376,
62,
463,
76,
62,
20500,
41876,
4526,
37,
5390,
43213,
62,
463,
76,
62,
20500,
11,
198,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
65,
499,
557,
83,
220,
220,
220,
220,
41876,
275,
499,
557,
83,
17,
13,
628,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
1976,
565,
62,
70,
926,
62,
20730,
62,
891,
62,
525,
16354,
14804,
1136,
62,
13716,
62,
7890,
7,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
46758,
220,
220,
220,
220,
220,
220,
220,
220,
796,
26173,
8924,
1303,
7,
1388,
8658,
796,
1976,
361,
62,
70,
926,
62,
20730,
62,
1324,
62,
9979,
1187,
14804,
6359,
62,
83,
4510,
891,
12,
25404,
62,
25677,
62,
3605,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
34788,
62,
69,
9548,
220,
220,
220,
220,
220,
220,
220,
220,
796,
12682,
1976,
565,
62,
70,
926,
62,
20730,
62,
34788,
62,
69,
9548,
62,
25404,
71,
7,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
1324,
17597,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
1312,
62,
1324,
17597,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
1324,
62,
26801,
62,
19199,
220,
220,
220,
220,
220,
796,
1312,
62,
1324,
62,
26801,
62,
19199,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
439,
62,
1324,
75,
62,
83,
2977,
220,
220,
220,
796,
1312,
62,
439,
62,
1324,
75,
62,
83,
2977,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
1324,
62,
4906,
62,
66,
429,
75,
62,
8658,
82,
796,
1312,
62,
1324,
62,
4906,
62,
66,
429,
75,
62,
8658,
82,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
1324,
62,
48205,
220,
220,
220,
220,
220,
220,
220,
796,
1312,
62,
1324,
62,
48205,
198,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
83,
62,
13716,
62,
7890,
220,
220,
220,
220,
220,
220,
796,
304,
62,
13716,
62,
7890,
21737,
6739,
628,
220,
220,
220,
327,
11417,
43213,
62,
463,
76,
62,
20500,
39319,
2376,
62,
463,
76,
62,
20500,
13,
198,
220,
220,
220,
220,
220,
1976,
565,
62,
70,
926,
62,
20730,
62,
31391,
14804,
1136,
62,
48277,
62,
6404,
7,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
388,
67,
62,
20500,
796,
2376,
62,
463,
76,
62,
20500,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
1324,
17597,
220,
220,
220,
220,
220,
796,
1312,
62,
1324,
17597,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1658,
62,
65,
499,
557,
83,
220,
220,
220,
220,
796,
43979,
62,
65,
499,
557,
83,
6739,
628,
220,
220,
220,
220,
220,
366,
751,
4049,
3275,
198,
220,
220,
220,
220,
220,
43504,
10619,
43979,
62,
65,
499,
557,
83,
5390,
304,
62,
6404,
11487,
13,
628,
220,
220,
220,
220,
220,
366,
3714,
11188,
6631,
198,
220,
220,
220,
220,
220,
42001,
2376,
62,
463,
76,
62,
20500,
3784,
5239,
312,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42099,
1976,
361,
62,
70,
926,
62,
20730,
62,
891,
62,
9979,
1187,
14804,
6359,
62,
48277,
12,
11338,
62,
36948,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17926,
24352,
2245,
62,
36948,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42099,
1976,
361,
62,
70,
926,
62,
20730,
62,
891,
62,
9979,
1187,
14804,
6359,
62,
48277,
12,
11487,
62,
40869,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17926,
24352,
3084,
62,
40869,
62,
18224,
13,
198,
220,
220,
220,
220,
220,
23578,
34,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
"! <p class="shorttext synchronized" lang="en">Nodes of Column Tree Model</p>
CLASS zcl_uitb_ctm_nodes DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
TYPES:
BEGIN OF ty_s_node_data,
node_key TYPE tm_nodekey,
data TYPE REF TO data,
END OF ty_s_node_data.
TYPES: ty_t_node_data TYPE STANDARD TABLE OF ty_s_node_data WITH KEY node_key.
DATA mt_node_data TYPE ty_t_node_data READ-ONLY.
"! <p class="shorttext synchronized" lang="en">Adds a new node to the model</p>
METHODS add_node
IMPORTING
!iv_node_key TYPE tm_nodekey OPTIONAL
!iv_relative_node_key TYPE tm_nodekey OPTIONAL
!iv_relationship TYPE i DEFAULT cl_tree_model=>relat_last_child
!iv_drag_drop_id TYPE i OPTIONAL
!if_folder TYPE as4flag OPTIONAL
!if_hidden TYPE as4flag OPTIONAL
!if_disabled TYPE as4flag OPTIONAL
!iv_style TYPE int4 OPTIONAL
!if_no_branch TYPE as4flag OPTIONAL
!if_expander TYPE as4flag OPTIONAL
if_use_prop_font TYPE abap_bool OPTIONAL
!iv_image TYPE tv_image OPTIONAL
!iv_expanded_image TYPE tv_image OPTIONAL
!ir_user_object TYPE REF TO object OPTIONAL
ir_user_data TYPE REF TO data OPTIONAL
!if_items_incomplete TYPE as4flag OPTIONAL
!it_item_table TYPE treemcitab
RETURNING
VALUE(rr_node) TYPE REF TO zcl_uitb_ctm_node
RAISING
zcx_uitb_tree_error .
"! <p class="shorttext synchronized" lang="en">Adds multiple new nodes to the model</p>
METHODS add_nodes
IMPORTING
!it_node_table TYPE treemcnota
!it_item_table TYPE treemcitac
RAISING
zcx_uitb_tree_error .
"! <p class="shorttext synchronized" lang="en">Collapses all nodes</p>
METHODS collapse_all_nodes .
"! <p class="shorttext synchronized" lang="en">Collapse selected nodes</p>
"!
METHODS collapse_selected_nodes
IMPORTING
if_collapse_sub_tree TYPE abap_bool DEFAULT abap_true
RAISING
zcx_uitb_tree_error.
"! <p class="shorttext synchronized" lang="en">Collapses a single node</p>
METHODS collapse_node
IMPORTING
!iv_node_key TYPE tm_nodekey
!if_collapse_subtree TYPE abap_bool OPTIONAL .
METHODS constructor
IMPORTING
!ir_model TYPE REF TO cl_column_tree_model
!if_auto_node_key TYPE abap_bool OPTIONAL .
"! <p class="shorttext synchronized" lang="en">Deletes all nodes from the model</p>
METHODS delete_all_nodes .
"! <p class="shorttext synchronized" lang="en">Delete a single node from the model</p>
METHODS delete_node
IMPORTING
!iv_node_key TYPE tm_nodekey
RAISING
zcx_uitb_tree_error .
"! <p class="shorttext synchronized" lang="en">Deletes multiple nodes from the model</p>
METHODS delete_nodes
IMPORTING
!it_node_key_table TYPE treemnotab
RAISING
zcx_uitb_tree_error .
"! <p class="shorttext synchronized" lang="en">Expands a single node</p>
METHODS expand_node
IMPORTING
!iv_node_key TYPE tm_nodekey
!if_expand_predecessors TYPE abap_bool OPTIONAL
!if_expand_subtree TYPE abap_bool OPTIONAL
!iv_level_count TYPE i OPTIONAL .
"! <p class="shorttext synchronized" lang="en">Expand the selected_nodes</p>
"!
METHODS expand_selected_nodes
IMPORTING
if_expand_sub_tree TYPE abap_bool DEFAULT abap_true
RAISING
zcx_uitb_tree_error.
"! <p class="shorttext synchronized" lang="en">Expand given nodes</p>
METHODS expand_nodes
IMPORTING
!it_node_key TYPE treemnotab .
"! <p class="shorttext synchronized" lang="en">Expands root nodes</p>
METHODS expand_root_nodes
IMPORTING
!if_expand_subtree TYPE abap_bool DEFAULT abap_true
!iv_level_count TYPE i OPTIONAL .
"! <p class="shorttext synchronized" lang="en">Retrieve all nodes that are expanded</p>
METHODS get_expanded_nodes
IMPORTING
!if_no_hidden_nodes TYPE abap_bool OPTIONAL
RETURNING
VALUE(result) TYPE treemnotab .
"! <p class="shorttext synchronized" lang="en">Gets a specific node for a key</p>
METHODS get_node
IMPORTING
!iv_node_key TYPE tm_nodekey
RETURNING
VALUE(rr_node) TYPE REF TO zcl_uitb_ctm_node.
"! <p class="shorttext synchronized" lang="en">Retrieves references of the root nodes</p>
"!
"! @parameter rt_root_nodes | <p class="shorttext synchronized" lang="en">References List of the root nodes</p>
METHODS get_root_nodes
RETURNING
VALUE(rt_root_nodes) TYPE zcl_uitb_ctm_node=>ty_t_ctm_node .
"! <p class="shorttext synchronized" lang="en">Retrieves keys of the root nodes</p>
"!
"! @parameter rt_root_node_keys | <p class="shorttext synchronized" lang="en">List of keys of the root nodes</p>
METHODS get_root_node_keys
RETURNING
VALUE(rt_root_node_keys) TYPE treemnotab .
"! <p class="shorttext synchronized" lang="en">Gets the current top node</p>
METHODS get_top_node
RETURNING
VALUE(rr_node) TYPE REF TO zcl_uitb_ctm_node.
"! <p class="shorttext synchronized" lang="en">Sets the first root node as the new top node</p>
METHODS set_first_root_node_as_top .
"! <p class="shorttext synchronized" lang="en">Set the top node to be selected and in the view box</p>
METHODS set_top_node
IMPORTING
!iv_node_key TYPE tm_nodekey .
"! <p class="shorttext synchronized" lang="en">Toggles expanded state of given nodes</p>
METHODS toggle_node
IMPORTING
!iv_node_key TYPE tm_nodekey .
"! <p class="shorttext synchronized" lang="en">Updates user data of node</p>
METHODS update_node_user_data
IMPORTING
iv_node_key TYPE tm_nodekey
ir_user_data TYPE REF TO data.
"! <p class="shorttext synchronized" lang="en">Checks if the given node has user data</p>
"!
METHODS node_has_user_data
IMPORTING
iv_node_key TYPE tm_nodekey
RETURNING
VALUE(rf_has_user_data) TYPE abap_bool.
PROTECTED SECTION.
PRIVATE SECTION.
DATA mr_model TYPE REF TO cl_column_tree_model .
DATA mf_auto_node_key TYPE abap_bool .
CLASS-DATA mv_last_node_key TYPE i .
METHODS get_next_node_key
RETURNING
VALUE(rv_new_node_key) TYPE tm_nodekey .
METHODS get_selected_nodes
RETURNING
VALUE(rt_node_keys) TYPE treemnotab
RAISING
zcx_uitb_tree_error.
ENDCLASS.
CLASS zcl_uitb_ctm_nodes IMPLEMENTATION.
METHOD add_node.
DATA(lv_node_key) = iv_node_key.
IF lv_node_key IS INITIAL.
ASSERT mf_auto_node_key = abap_true.
*.... Create node key
lv_node_key = get_next_node_key( ).
ENDIF.
DATA(lt_items) = it_item_table.
LOOP AT lt_items ASSIGNING FIELD-SYMBOL(<ls_item>).
IF <ls_item>-class IS INITIAL.
<ls_item>-class = cl_item_tree_model=>item_class_text.
ENDIF.
IF if_use_prop_font = abap_true.
<ls_item>-font = cl_item_tree_model=>item_font_prop.
ENDIF.
ENDLOOP.
mr_model->add_node(
EXPORTING
node_key = lv_node_key " Schlüssel des Knotens
relative_node_key = iv_relative_node_key " Schlüssel des verwandten Knotens
relationship = iv_relationship " Verwandschaftsbeziehung
drag_drop_id = iv_drag_drop_id
isfolder = if_folder " 'X': Knoten ist Ordner; ' ': Knoten ist Blatt
hidden = if_hidden " 'X': Knoten ist unsichtbar
disabled = if_disabled " 'X': Knoten kann nicht selektiert werden
style = iv_style " siehe Methodendokumentation
no_branch = if_no_branch " 'X': Keine Hierarchielinie zeichnen
expander = if_expander " siehe Methodendokumentation
image = iv_image " siehe Methodendokumentation
expanded_image = iv_expanded_image " siehe Methodendokumentation
user_object = ir_user_object " User Objekt
items_incomplete = if_items_incomplete " siehe Methodendokumentation
item_table = lt_items " Items des Knotens
EXCEPTIONS
node_key_exists = 1
node_key_empty = 2
illegal_relationship = 3
relative_node_not_found = 4
error_in_item_table = 5
OTHERS = 6 ).
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_uitb_tree_error.
ELSE.
rr_node = get_node( lv_node_key ).
IF ir_user_data IS SUPPLIED.
rr_node->set_user_data( ir_user_data ).
ENDIF.
ENDIF.
ENDMETHOD.
METHOD add_nodes.
mr_model->add_nodes(
EXPORTING
node_table = it_node_table
EXCEPTIONS
error_in_node_table = 1
OTHERS = 2 ).
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_uitb_tree_error.
ENDIF.
mr_model->add_items(
EXPORTING
item_table = it_item_table
EXCEPTIONS
node_not_found = 1
error_in_item_table = 2
OTHERS = 3 ).
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_uitb_tree_error.
ENDIF.
ENDMETHOD.
METHOD collapse_all_nodes.
mr_model->collapse_all_nodes( ).
ENDMETHOD.
METHOD collapse_node.
mr_model->collapse_node(
node_key = iv_node_key
collapse_subtree = if_collapse_subtree ).
ENDMETHOD.
METHOD constructor.
mf_auto_node_key = if_auto_node_key.
mr_model = ir_model.
ENDMETHOD.
METHOD delete_all_nodes.
mr_model->delete_all_nodes( ).
CLEAR mt_node_data.
ENDMETHOD.
METHOD delete_node.
mr_model->delete_node(
EXPORTING
node_key = iv_node_key " Schlüssel des Knotens
EXCEPTIONS
node_not_found = 1
OTHERS = 2 ).
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_uitb_tree_error.
ELSE.
DELETE mt_node_data WHERE node_key = iv_node_key.
ENDIF.
ENDMETHOD.
METHOD delete_nodes.
DATA: lt_node_range TYPE RANGE OF tm_nodekey.
mr_model->delete_nodes(
EXPORTING
node_key_table = it_node_key_table " Tabelle mit Knotenschlüsseln
EXCEPTIONS
error_in_node_key_table = 1
OTHERS = 2 ).
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_uitb_tree_error.
ELSE.
lt_node_range = VALUE #( LET i = 'I' eq = 'EQ' IN FOR node IN it_node_key_table ( sign = i option = eq low = node ) ).
DELETE mt_node_data WHERE node_key IN lt_node_range.
ENDIF.
ENDMETHOD.
METHOD expand_node.
mr_model->expand_node(
EXPORTING
node_key = iv_node_key " Schlüssel des Knotens
expand_predecessors = if_expand_predecessors " 'X': Vorgänger des Knotens expandieren
expand_subtree = if_expand_subtree " 'X': alle Nachfahren expandieren
level_count = iv_level_count " Anzahl zu expandierende Nachfolgeebenen
EXCEPTIONS
OTHERS = 1 ).
ENDMETHOD.
METHOD expand_nodes.
mr_model->expand_nodes(
EXPORTING
node_key_table = it_node_key
EXCEPTIONS
OTHERS = 1 ).
ENDMETHOD.
METHOD expand_root_nodes.
mr_model->expand_root_nodes(
EXPORTING
expand_subtree = if_expand_subtree
level_count = iv_level_count
EXCEPTIONS
OTHERS = 1 ).
ENDMETHOD.
METHOD get_expanded_nodes.
mr_model->get_expanded_nodes(
EXPORTING no_hidden_nodes = if_no_hidden_nodes
IMPORTING node_key_table = result
EXCEPTIONS OTHERS = 1 ).
ENDMETHOD.
METHOD get_next_node_key.
IF mv_last_node_key IS INITIAL.
mv_last_node_key = 1.
ELSE.
ADD 1 TO mv_last_node_key.
ENDIF.
rv_new_node_key = mv_last_node_key.
*.. Check if the nodekey is still free
WHILE mr_model->node_key_in_tree( rv_new_node_key ).
ADD 1 TO mv_last_node_key.
rv_new_node_key = mv_last_node_key.
ENDWHILE.
ENDMETHOD.
METHOD get_node.
mr_model->node_get_properties(
EXPORTING
node_key = iv_node_key
EXCEPTIONS
node_not_found = 1
OTHERS = 2 ).
IF sy-subrc = 0.
rr_node = NEW #(
ir_model = mr_model
iv_node_key = iv_node_key
ir_nodes = me ).
ENDIF.
ENDMETHOD.
METHOD get_root_nodes.
TRY.
rt_root_nodes = VALUE #( FOR node_key IN get_root_node_keys( ) ( get_node( node_key ) ) ).
CATCH zcx_uitb_tree_error ##needed.
"handle exception
ENDTRY.
ENDMETHOD.
METHOD get_root_node_keys.
mr_model->get_root_nodes( IMPORTING node_key_table = rt_root_node_keys ).
ENDMETHOD.
METHOD get_top_node.
mr_model->get_top_node(
IMPORTING
node_key = DATA(lv_top_node) " Node key
EXCEPTIONS
control_not_existing = 1
control_dead = 2
cntl_system_error = 3
failed = 4
OTHERS = 5 ).
IF sy-subrc = 0.
CHECK lv_top_node IS NOT INITIAL.
rr_node = get_node( lv_top_node ).
ENDIF.
ENDMETHOD.
METHOD set_first_root_node_as_top.
DATA(lv_first_root_node) = mr_model->get_first_root_node( ).
CHECK lv_first_root_node IS NOT INITIAL.
set_top_node( iv_node_key = lv_first_root_node ).
ENDMETHOD.
METHOD set_top_node.
mr_model->set_top_node( iv_node_key ).
ENDMETHOD.
METHOD toggle_node.
DATA(lt_expanded_nodes) = get_expanded_nodes( ).
IF line_exists( lt_expanded_nodes[ table_line = iv_node_key ] ).
collapse_node( iv_node_key ).
ELSE.
expand_node( iv_node_key ).
ENDIF.
ENDMETHOD.
METHOD collapse_selected_nodes.
LOOP AT get_selected_nodes( ) ASSIGNING FIELD-SYMBOL(<lv_node>).
mr_model->collapse_node(
EXPORTING
node_key = <lv_node>
collapse_subtree = if_collapse_sub_tree
EXCEPTIONS
node_not_found = 1
OTHERS = 2 ).
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_uitb_tree_error.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD expand_selected_nodes.
LOOP AT get_selected_nodes( ) ASSIGNING FIELD-SYMBOL(<lv_node>).
expand_node(
iv_node_key = <lv_node>
if_expand_subtree = if_expand_sub_tree ).
ENDLOOP.
ENDMETHOD.
METHOD get_selected_nodes.
mr_model->get_selected_nodes(
IMPORTING
node_key_table = rt_node_keys
EXCEPTIONS
control_not_existing = 1
control_dead = 2
cntl_system_error = 3
failed = 4
multiple_node_selection_only = 5
OTHERS = 6 ).
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_uitb_tree_error.
ENDIF.
ENDMETHOD.
METHOD update_node_user_data.
ASSIGN mt_node_data[ node_key = iv_node_key ] TO FIELD-SYMBOL(<ls_node_data>).
IF sy-subrc = 0.
<ls_node_data>-data = ir_user_data.
ELSE.
mt_node_data = VALUE #( BASE mt_node_data ( node_key = iv_node_key data = ir_user_data ) ).
ENDIF.
ENDMETHOD.
METHOD node_has_user_data.
rf_has_user_data = xsdbool( line_exists( mt_node_data[ node_key = iv_node_key ] ) ).
ENDMETHOD.
ENDCLASS.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
45,
4147,
286,
29201,
12200,
9104,
3556,
79,
29,
198,
31631,
1976,
565,
62,
5013,
65,
62,
310,
76,
62,
77,
4147,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
82,
62,
17440,
62,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
10139,
62,
2539,
41876,
256,
76,
62,
17440,
2539,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1366,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
82,
62,
17440,
62,
7890,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
1259,
62,
83,
62,
17440,
62,
7890,
41876,
49053,
9795,
43679,
3963,
1259,
62,
82,
62,
17440,
62,
7890,
13315,
35374,
10139,
62,
2539,
13,
628,
220,
220,
220,
42865,
45079,
62,
17440,
62,
7890,
41876,
1259,
62,
83,
62,
17440,
62,
7890,
20832,
12,
1340,
11319,
13,
628,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
46245,
257,
649,
10139,
284,
262,
2746,
3556,
79,
29,
198,
220,
220,
220,
337,
36252,
50,
751,
62,
17440,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
17440,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
256,
76,
62,
17440,
2539,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
43762,
62,
17440,
62,
2539,
41876,
256,
76,
62,
17440,
2539,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
39468,
1056,
220,
220,
220,
220,
220,
41876,
1312,
5550,
38865,
537,
62,
21048,
62,
19849,
14804,
2411,
265,
62,
12957,
62,
9410,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
7109,
363,
62,
14781,
62,
312,
220,
220,
220,
220,
220,
41876,
1312,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
361,
62,
43551,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
355,
19,
32109,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
361,
62,
30342,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
355,
19,
32109,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
361,
62,
47730,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
355,
19,
32109,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
7635,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
493,
19,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
361,
62,
3919,
62,
1671,
3702,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
355,
19,
32109,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
361,
62,
11201,
4066,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
355,
19,
32109,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
611,
62,
1904,
62,
22930,
62,
10331,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
9060,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
31557,
62,
9060,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
11201,
12249,
62,
9060,
220,
220,
220,
41876,
31557,
62,
9060,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
343,
62,
7220,
62,
15252,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
2134,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
4173,
62,
7220,
62,
7890,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1366,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
361,
62,
23814,
62,
259,
20751,
220,
41876,
355,
19,
32109,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
9186,
62,
11487,
220,
220,
220,
220,
220,
220,
220,
41876,
2054,
368,
47992,
397,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
21062,
62,
17440,
8,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
5013,
65,
62,
310,
76,
62,
17440,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
5013,
65,
62,
21048,
62,
18224,
764,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
46245,
3294,
649,
13760,
284,
262,
2746,
3556,
79,
29,
198,
220,
220,
220,
337,
36252,
50,
751,
62,
77,
4147,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
17440,
62,
11487,
41876,
2054,
368,
66,
1662,
64,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
9186,
62,
11487,
41876,
2054,
368,
47992,
330,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
5013,
65,
62,
21048,
62,
18224,
764,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
22667,
45903,
477,
13760,
3556,
79,
29,
198,
220,
220,
220,
337,
36252,
50,
9807,
62,
439,
62,
77,
4147,
764,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
22667,
7512,
6163,
13760,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
198,
220,
220,
220,
337,
36252,
50,
9807,
62,
34213,
62,
77,
4147,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
611,
62,
26000,
7512,
62,
7266,
62,
21048,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
"! <h1>API for Getting a Travel</h1>
"!
"! <p>
"! Function module to get a single Travel instance with all related Bookings and
"! Booking Supplements related to the importing Travel ID.
"! </p>
"!
"!
"! @parameter iv_travel_id | Travel ID
"! @parameter iv_include_buffer | Include any changes that have not yet been committed
"! @parameter es_travel | Travel Data like /DMO/TRAVEL10 related to the importing Travel ID
"! @parameter et_booking | Table of Bookings like /DMO/BOOKING10 related to the importing Travel ID
"! @parameter et_booking_supplement | Table of Booking Supplements like /DMO/BOOK_SUP_10 related to the importing Travel ID
"! @parameter et_messages | Table of occurred messages
"!
FUNCTION /DMO/FLIGHT_TRAVEL_READ10.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IV_TRAVEL_ID) TYPE /DMO/TRAVEL_ID10
*" REFERENCE(IV_INCLUDE_BUFFER) TYPE ABAP_BOOLEAN DEFAULT
*" ABAP_TRUE
*" EXPORTING
*" REFERENCE(ES_TRAVEL) TYPE /DMO/TRAVEL10
*" REFERENCE(ET_BOOKING) TYPE /DMO/IF_FLIGHT_LEGACY10=>TT_BOOKING
*" REFERENCE(ET_BOOKING_SUPPLEMENT) TYPE
*" /DMO/IF_FLIGHT_LEGACY10=>TT_BOOKING_SUPPLEMENT
*" REFERENCE(ET_MESSAGES) TYPE /DMO/IF_FLIGHT_LEGACY10=>TT_MESSAGE
*"----------------------------------------------------------------------
CLEAR es_travel.
CLEAR et_booking.
CLEAR et_booking_supplement.
CLEAR et_messages.
/dmo/cl_flight_legacy10=>get_instance( )->get_travel( EXPORTING iv_travel_id = iv_travel_id
iv_include_buffer = iv_include_buffer
IMPORTING es_travel = es_travel
et_booking = et_booking
et_booking_supplement = et_booking_supplement
et_messages = DATA(lt_messages) ).
/dmo/cl_flight_legacy10=>get_instance( )->convert_messages( EXPORTING it_messages = lt_messages
IMPORTING et_messages = et_messages ).
ENDFUNCTION.
| [
40484,
1279,
71,
16,
29,
17614,
329,
18067,
257,
13524,
3556,
71,
16,
29,
198,
40484,
198,
40484,
1279,
79,
29,
198,
40484,
15553,
8265,
284,
651,
257,
2060,
13524,
4554,
351,
477,
3519,
4897,
654,
290,
198,
40484,
4897,
278,
8105,
3639,
3519,
284,
262,
33332,
13524,
4522,
13,
198,
40484,
7359,
79,
29,
198,
40484,
198,
40484,
198,
40484,
2488,
17143,
2357,
21628,
62,
35927,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
13524,
4522,
198,
40484,
2488,
17143,
2357,
21628,
62,
17256,
62,
22252,
220,
220,
220,
220,
930,
40348,
597,
2458,
326,
423,
407,
1865,
587,
5364,
198,
40484,
2488,
17143,
2357,
1658,
62,
35927,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
13524,
6060,
588,
1220,
35,
11770,
14,
51,
3861,
18697,
940,
3519,
284,
262,
33332,
13524,
4522,
198,
40484,
2488,
17143,
2357,
2123,
62,
2070,
278,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
8655,
286,
4897,
654,
588,
1220,
35,
11770,
14,
39453,
2751,
940,
3519,
284,
262,
33332,
13524,
4522,
198,
40484,
2488,
17143,
2357,
2123,
62,
2070,
278,
62,
18608,
1732,
930,
8655,
286,
4897,
278,
8105,
3639,
588,
1220,
35,
11770,
14,
39453,
62,
40331,
62,
940,
3519,
284,
262,
33332,
13524,
4522,
198,
40484,
2488,
17143,
2357,
2123,
62,
37348,
1095,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
8655,
286,
5091,
6218,
198,
40484,
198,
42296,
4177,
2849,
1220,
35,
11770,
14,
3697,
9947,
62,
51,
3861,
18697,
62,
15675,
940,
13,
198,
9,
1,
10097,
23031,
198,
9,
1,
9,
1,
14565,
26491,
25,
198,
9,
1,
220,
30023,
9863,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
3824,
62,
51,
3861,
18697,
62,
2389,
8,
41876,
220,
1220,
35,
11770,
14,
51,
3861,
18697,
62,
2389,
940,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
3824,
62,
1268,
5097,
52,
7206,
62,
19499,
45746,
8,
41876,
220,
9564,
2969,
62,
33,
6684,
2538,
1565,
5550,
38865,
198,
9,
1,
220,
220,
220,
220,
220,
220,
9564,
2969,
62,
5446,
8924,
198,
9,
1,
220,
7788,
15490,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
1546,
62,
51,
3861,
18697,
8,
41876,
220,
1220,
35,
11770,
14,
51,
3861,
18697,
940,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
2767,
62,
39453,
2751,
8,
41876,
220,
1220,
35,
11770,
14,
5064,
62,
3697,
9947,
62,
2538,
38,
43300,
940,
14804,
15751,
62,
39453,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
2767,
62,
39453,
2751,
62,
40331,
16437,
10979,
8,
41876,
198,
9,
1,
220,
220,
220,
220,
220,
220,
220,
1220,
35,
11770,
14,
5064,
62,
3697,
9947,
62,
2538,
38,
43300,
940,
14804,
15751,
62,
39453,
2751,
62,
40331,
16437,
10979,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
2767,
62,
44,
1546,
4090,
48075,
8,
41876,
220,
1220,
35,
11770,
14,
5064,
62,
3697,
9947,
62,
2538,
38,
43300,
940,
14804,
15751,
62,
44,
1546,
4090,
8264,
198,
9,
1,
10097,
23031,
198,
220,
30301,
1503,
1658,
62,
35927,
13,
198,
220,
30301,
1503,
2123,
62,
2070,
278,
13,
198,
220,
30301,
1503,
2123,
62,
2070,
278,
62,
18608,
1732,
13,
198,
220,
30301,
1503,
2123,
62,
37348,
1095,
13,
628,
220,
1220,
67,
5908,
14,
565,
62,
22560,
62,
1455,
1590,
940,
14804,
1136,
62,
39098,
7,
1267,
3784,
1136,
62,
35927,
7,
7788,
15490,
2751,
21628,
62,
35927,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
35927,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
17256,
62,
22252,
220,
220,
220,
220,
796,
21628,
62,
17256,
62,
22252,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
1658,
62,
35927,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
1658,
62,
35927,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2123,
62,
2070,
278,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
2123,
62,
2070,
278,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2123,
62,
2070,
278,
62,
18608,
1732,
796,
2123,
62,
2070,
278,
62,
18608,
1732,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2123,
62,
37348,
1095,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
42865,
7,
2528,
62,
37348,
1095,
8,
6739,
628,
220,
1220,
67,
5908,
14,
565,
62
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
*"* use this source file for any type of declarations (class
*"* definitions, interfaces or type declarations) you need for
*"* components in the private section
INTERFACE lif_doc.
TYPES:
BEGIN OF ty_progname_split_result,
fugr_group TYPE rs38l_area,
class_is_name TYPE abap_bool,
class_name TYPE seoclsname,
class_is_method_name TYPE abap_bool,
class_method_name TYPE seocpdname,
END OF ty_progname_split_result,
BEGIN OF ty_tadir_objkey,
pgmid type tadir-pgmid,
object type tadir-object,
obj_name type tadir-obj_name,
end OF ty_tadir_objkey,
BEGIN OF ty_e071_to_tadir_objkey,
e071_objkey type zcl_envysis=>ty_e071_objkey,
tadir_objkey type ty_tadir_objkey,
END OF ty_e071_to_tadir_objkey,
tt_e071_to_tadir_objkey type STANDARD TABLE OF ty_e071_to_tadir_objkey with empty key,
BEGIN OF ty_devc_required_objects,
super_package TYPE devclass,
sub_packages TYPE STANDARD TABLE OF devclass WITH EMPTY KEY,
interfaces TYPE STANDARD TABLE OF scomifnam WITH EMPTY KEY,
END OF ty_devc_required_objects,
ty_lt_incl TYPE STANDARD TABLE OF rseuinc WITH DEFAULT KEY,
ty_lt_cross TYPE STANDARD TABLE OF cross WITH DEFAULT KEY,
ty_lt_dd03p TYPE STANDARD TABLE OF dd03p WITH DEFAULT KEY,
ty_lt_dd08v TYPE STANDARD TABLE OF dd08v WITH DEFAULT KEY,
ty_lt_dd35v TYPE STANDARD TABLE OF dd35v WITH DEFAULT KEY,
ty_lt_dd26v TYPE STANDARD TABLE OF dd26v WITH DEFAULT KEY,
ty_devclasses TYPE STANDARD TABLE OF tadir-devclass WITH DEFAULT KEY,
BEGIN OF ty_tdevc,
devclass TYPE tdevc-devclass,
dlvunit TYPE tdevc-dlvunit,
parentcl TYPE tdevc-parentcl,
END OF ty_tdevc,
ty_tdevc_lines TYPE HASHED TABLE OF ty_tdevc WITH UNIQUE KEY devclass,
tt_e071_key TYPE HASHED TABLE OF zcl_envysis=>ty_e071_objkey WITH UNIQUE KEY pgmid object obj_name,
tt_e071_key_new TYPE STANDARD TABLE OF zcl_envysis=>ty_e071_objkey WITH DEFAULT KEY,
ty_lt_wbcrossgt TYPE STANDARD TABLE OF wbcrossgt WITH DEFAULT KEY,
BEGIN OF ty_dd03l,
tabname TYPE dd03l-tabname,
fieldname TYPE dd03l-fieldname,
precfield TYPE dd03l-precfield,
reftype TYPE dd03l-reftype,
comptype TYPE dd03l-comptype,
rollname TYPE dd03l-rollname,
END OF ty_dd03l,
BEGIN OF ty_tcode_info,
tcode TYPE sytcode,
type TYPE zcl_tcode=>ty_transaction_type,
s_report TYPE zcl_tcode=>ty_report,
s_dialog TYPE zcl_tcode=>ty_dialog,
s_object TYPE zcl_tcode=>ty_object,
s_parameter TYPE zcl_tcode=>ty_parameter,
s_variant TYPE zcl_tcode=>ty_variant,
END OF ty_tcode_info.
METHODS ddif_tabl_get
IMPORTING
name TYPE ddobjname
EXPORTING
et_dd03p TYPE ty_lt_dd03p
et_dd08v TYPE ty_lt_dd08v
et_dd35v TYPE ty_lt_dd35v.
METHODS ddif_view_get
IMPORTING
viewname TYPE ddobjname
RETURNING
VALUE(rt_dd26v) TYPE ty_lt_dd26v.
METHODS ddif_ttyp_get
IMPORTING
ttypname TYPE ddobjname
RETURNING
VALUE(rs_dd40v) TYPE dd40v.
METHODS ddif_dtel_get
IMPORTING
rollname TYPE ddobjname
EXPORTING
dd04v TYPE dd04v
tpara TYPE tpara.
METHODS ddif_doma_get
IMPORTING
domname TYPE ddobjname
RETURNING
VALUE(dd01v) TYPE dd01v.
METHODS function_exists
IMPORTING
funcname TYPE rs38l-name
RETURNING
VALUE(include) TYPE trdir-name.
METHODS rs_get_all_includes
IMPORTING
progname TYPE syrepid
RETURNING
VALUE(includes) TYPE ty_lt_incl.
METHODS ddif_typeinfo_get
IMPORTING
typename TYPE tabname
EXPORTING
typekind TYPE ddtypekind
gotstate TYPE ddgotstate.
METHODS ddif_shlp_get
IMPORTING
shlpname TYPE ddobjname
RETURNING
VALUE(dd30v) TYPE dd30v.
METHODS ddif_enqu_get
IMPORTING
lockobject TYPE ddobjname
RETURNING
VALUE(dd25v) TYPE dd25v.
METHODS rs_progname_concatenate
IMPORTING
VALUE(fugr_group) TYPE rs38l-area OPTIONAL
VALUE(fugr_include_number) TYPE tfdir-include OPTIONAL
VALUE(sldb_name) TYPE ldbd-ldbname OPTIONAL
VALUE(menu_name) TYPE tstc-tcode OPTIONAL
VALUE(type_name) TYPE trdir-name OPTIONAL
VALUE(mst_name) TYPE dd02l-tabname OPTIONAL
VALUE(cntx_name) TYPE trdir-name OPTIONAL
VALUE(clas_name) TYPE seoclass-clsname OPTIONAL
VALUE(intf_name) TYPE seoclass-clsname OPTIONAL
EXPORTING
VALUE(fugr_progname_group) TYPE trdir-name
VALUE(fugr_progname_include) TYPE trdir-name
VALUE(fugr_progname_top) TYPE trdir-name
VALUE(fugr_progname_uxx) TYPE trdir-name
VALUE(sldb_progname_db) TYPE trdir-name
VALUE(sldb_progname_sel) TYPE trdir-name
VALUE(menu_progname) TYPE trdir-name
VALUE(type_progname) TYPE trdir-name
VALUE(mst_progname) TYPE trdir-name
VALUE(cntx_progname) TYPE trdir-name
VALUE(intf_progname) TYPE trdir-name
VALUE(clas_progname) TYPE trdir-name
RAISING
zcx_envysis.
"! Converts E071 into TADIR object WI_E071 = { LIMU FUNC GUI_UPLOAD } -> WE_TADIR = { R3TR FUGR SFES }
"! @parameter wi_e071 | Example: LIMU FUNC GUI_UPLOAD
"! @parameter we_tadir | Example: R3TR FUGR SFES
METHODS tr_check_type
IMPORTING
wi_e071 TYPE e071
EXPORTING
we_tadir TYPE tadir.
METHODS convert_e071_to_tadir_objkeys
IMPORTING
e071_objkeys TYPE tt_e071_key
returning
value(e071_to_tadir_objkeys) TYPE tt_e071_to_tadir_objkey.
METHODS rs_progname_split
IMPORTING
include TYPE progname
RETURNING
VALUE(result) TYPE ty_progname_split_result.
METHODS select_tdevc
IMPORTING
devclasses TYPE ty_devclasses
RETURNING
VALUE(tdevc_lines) TYPE ty_tdevc_lines.
METHODS select_tadir_1
IMPORTING
packages TYPE zcl_envysis=>ty_packages
RETURNING
VALUE(rt_e071_key) TYPE tt_e071_key.
METHODS select_tadir_2
IMPORTING
it_e071_key_new TYPE tt_e071_key_new
RETURNING
VALUE(tadir_lines) TYPE zcl_envysis=>ty_tadir_lines.
METHODS select_tadir_3
IMPORTING
e071_objkey TYPE zcl_envysis=>ty_e071_objkey
RETURNING
VALUE(devclass) TYPE tadir-devclass.
METHODS get_oo_info_of_include
IMPORTING
include TYPE rseuinc
RETURNING
VALUE(clif) TYPE REF TO if_oo_clif_incl_naming.
METHODS select_wbcrossgt
IMPORTING
includes TYPE ty_lt_incl
RETURNING
VALUE(wbcrossgt_lines) TYPE ty_lt_wbcrossgt.
METHODS select_dd03l
IMPORTING
tabname TYPE wbcrossgt-name
fieldname TYPE wbcrossgt-name
RETURNING
VALUE(dd03l) TYPE ty_dd03l.
METHODS get_tcode_required_objects
IMPORTING
i_tcode TYPE tcode
RETURNING
VALUE(result) TYPE ty_tcode_info.
METHODS get_objects_needed_by_package
IMPORTING
i_package_name TYPE devclass
RETURNING
VALUE(result) TYPE ty_devc_required_objects.
METHODS select_cross
IMPORTING
includes TYPE ty_lt_incl
RETURNING
VALUE(cross_lines) TYPE ty_lt_cross.
METHODS select_trdir
IMPORTING
progname TYPE syrepid
RETURNING
VALUE(r_subc) TYPE trdir-subc.
ENDINTERFACE.
| [
9,
1,
9,
779,
428,
2723,
2393,
329,
597,
2099,
286,
31713,
357,
4871,
198,
9,
1,
9,
17336,
11,
20314,
393,
2099,
31713,
8,
345,
761,
329,
198,
9,
1,
9,
6805,
287,
262,
2839,
2665,
198,
41358,
49836,
3868,
62,
15390,
13,
628,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
1676,
70,
3672,
62,
35312,
62,
20274,
11,
198,
220,
220,
220,
220,
220,
31497,
81,
62,
8094,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
44608,
2548,
75,
62,
20337,
11,
198,
220,
220,
220,
220,
220,
1398,
62,
271,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
1398,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
384,
420,
7278,
3672,
11,
198,
220,
220,
220,
220,
220,
1398,
62,
271,
62,
24396,
62,
3672,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
1398,
62,
24396,
62,
3672,
220,
220,
220,
41876,
384,
420,
30094,
3672,
11,
198,
220,
220,
220,
23578,
3963,
1259,
62,
1676,
70,
3672,
62,
35312,
62,
20274,
11,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
83,
324,
343,
62,
26801,
2539,
11,
198,
220,
220,
220,
23241,
13602,
2099,
36264,
343,
12,
6024,
13602,
11,
198,
220,
220,
220,
2134,
2099,
36264,
343,
12,
15252,
11,
198,
220,
220,
220,
26181,
62,
3672,
2099,
36264,
343,
12,
26801,
62,
3672,
11,
198,
220,
220,
220,
886,
3963,
1259,
62,
83,
324,
343,
62,
26801,
2539,
11,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
68,
2998,
16,
62,
1462,
62,
83,
324,
343,
62,
26801,
2539,
11,
198,
220,
220,
220,
304,
2998,
16,
62,
26801,
2539,
2099,
1976,
565,
62,
24330,
3097,
14804,
774,
62,
68,
2998,
16,
62,
26801,
2539,
11,
198,
220,
220,
220,
36264,
343,
62,
26801,
2539,
2099,
1259,
62,
83,
324,
343,
62,
26801,
2539,
11,
198,
220,
220,
220,
23578,
3963,
1259,
62,
68,
2998,
16,
62,
1462,
62,
83,
324,
343,
62,
26801,
2539,
11,
198,
220,
220,
220,
256,
83,
62,
68,
2998,
16,
62,
1462,
62,
83,
324,
343,
62,
26801,
2539,
2099,
49053,
9795,
43679,
3963,
1259,
62,
68,
2998,
16,
62,
1462,
62,
83,
324,
343,
62,
26801,
2539,
351,
6565,
1994,
11,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
7959,
66,
62,
35827,
62,
48205,
11,
198,
220,
220,
220,
220,
220,
2208,
62,
26495,
41876,
1614,
4871,
11,
198,
220,
220,
220,
220,
220,
850,
62,
43789,
220,
41876,
49053,
9795,
43679,
3963,
1614,
4871,
13315,
38144,
9936,
35374,
11,
198,
220,
220,
220,
220,
220,
20314,
220,
220,
220,
41876,
49053,
9795,
43679,
3963,
629,
296,
361,
7402,
13315,
38144,
9936,
35374,
11,
198,
220,
220,
220,
23578,
3963,
1259,
62,
7959,
66,
62,
35827,
62,
48205,
11,
198,
220,
220,
220,
1259,
62,
2528,
62,
259,
565,
220,
220,
220,
41876,
49053,
9795,
43679,
3963,
374,
325,
84,
1939,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
1259,
62,
2528,
62,
19692,
220,
220,
41876,
49053,
9795,
43679,
3963,
3272,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
1259,
62,
2528,
62,
1860,
3070,
79,
220,
220,
41876,
49053,
9795,
43679,
3963,
49427,
3070,
79,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
1259,
62,
2528,
62,
1860,
2919,
85,
220,
220,
41876,
49053,
9795,
43679,
3963,
49427,
2919,
85,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
1259,
62,
2528,
62,
1860,
2327,
85,
220,
220,
41876,
49053,
9795,
43679,
3963,
49427,
2327,
85,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
1259,
62,
2528,
62,
1860,
2075,
85,
220,
220,
41876,
49053,
9795,
43679,
3963,
49427,
2075,
85,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
1259,
62,
7959,
37724,
41876,
49053,
9795,
43679,
3963,
36264,
343,
12,
7959,
4871,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
83,
7959,
66,
11,
198,
220,
220,
220,
220,
220,
1614,
4871,
41876,
256,
7959,
66,
12,
7959,
4871,
11,
198,
220,
220,
220,
220,
220,
288,
6780,
20850,
220,
41876,
256,
7959,
66,
12,
67,
6780,
20850,
11,
198,
220,
220,
220,
220,
220,
2560,
565,
41876,
256,
7959,
66,
12,
8000,
565,
11,
198,
220,
220,
220,
23578,
3963,
1259,
62,
83,
7959,
66,
11,
198,
220,
220,
220,
1259,
62,
83,
7959,
66,
62,
6615,
220,
41876,
367,
11211,
1961,
43679,
3963,
1259,
62,
83,
7959,
66,
13315,
4725,
33866,
8924,
35374,
1614,
4871,
11,
198,
220,
220,
220,
256,
83,
62,
68,
2998,
16,
62,
2539,
220,
220,
220,
220,
41876,
367,
11211,
1961,
43679,
3963,
1976,
565,
62,
24330,
3097,
14804,
774,
62,
68,
2998,
16,
62,
26801,
2539,
13315,
4725,
33866,
8924,
35374,
23241,
13602,
2134,
26181,
62,
3672,
11,
198,
220,
220,
220,
256,
83,
62,
68,
2998,
16,
62,
2539,
62,
3605,
41876,
49053,
9795,
43679,
3963,
1976,
565,
62,
24330,
3097,
14804,
774,
62,
68,
2998,
16,
62,
26801,
2539,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
1259,
62,
2528,
62,
86,
15630,
1214,
13655,
41876,
49053,
9795,
43679,
3963,
266,
15630,
1214,
13655,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
1860,
3070,
75,
11,
198,
220,
220,
220,
220,
220,
7400,
3672,
220,
220,
41876,
49427,
3070,
75,
12,
8658,
3672,
11,
198,
220,
220,
220,
220,
220,
2214,
3672,
41876,
49427,
3070,
75,
12,
3245,
3672,
11,
198,
220,
220,
220,
220,
220,
3718,
3245,
41876,
49427,
3070,
75,
12,
3866,
66,
3245,
11,
198,
220,
220,
220,
220,
220,
302,
701,
2981,
220,
220,
41876,
49427,
3070,
75,
12,
260,
701,
2981,
11,
198,
220,
220,
220,
220,
220,
401,
457,
2981,
220,
41876,
49427,
3070,
75,
12,
785,
457,
2981,
11,
198,
220,
220,
220,
220,
220,
4836,
3672,
220,
41876,
49427,
3070,
75,
12,
2487,
3672,
11,
198,
220,
220,
220,
23578,
3963,
1259,
62,
1860,
3070,
75,
11,
198,
220,
220,
220,
347,
43312,
3963,
1259,
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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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
] |
CLASS zcl_abapgit_object_smim DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
PROTECTED SECTION.
PRIVATE SECTION.
METHODS get_filename
IMPORTING iv_url TYPE string
RETURNING VALUE(rv_filename) TYPE string.
METHODS find_content
IMPORTING iv_url TYPE string
RETURNING VALUE(rv_content) TYPE xstring
RAISING zcx_abapgit_exception.
METHODS build_filename
IMPORTING iv_filename TYPE string
RETURNING VALUE(rv_filename) TYPE string.
METHODS get_url_for_io
EXPORTING ev_url TYPE string
ev_is_folder TYPE abap_bool
RAISING zcx_abapgit_not_found
zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_SMIM IMPLEMENTATION.
METHOD build_filename.
CONCATENATE ms_item-obj_name ms_item-obj_type iv_filename
INTO rv_filename SEPARATED BY '.'.
TRANSLATE rv_filename TO LOWER CASE.
ENDMETHOD.
METHOD find_content.
DATA: lv_filename TYPE string,
lt_files TYPE zif_abapgit_definitions=>ty_files_tt.
FIELD-SYMBOLS: <ls_file> LIKE LINE OF lt_files.
lv_filename = get_filename( iv_url ).
lv_filename = build_filename( lv_filename ).
lt_files = mo_files->get_files( ).
READ TABLE lt_files ASSIGNING <ls_file> WITH KEY filename = lv_filename.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'SMIM, file not found' ).
ENDIF.
rv_content = <ls_file>-data.
ENDMETHOD.
METHOD get_filename.
DATA: lv_lines TYPE i,
lt_strings TYPE TABLE OF string.
SPLIT iv_url AT '/' INTO TABLE lt_strings.
lv_lines = lines( lt_strings ).
ASSERT lv_lines > 0.
READ TABLE lt_strings INDEX lv_lines INTO rv_filename.
ASSERT sy-subrc = 0.
ENDMETHOD.
METHOD get_url_for_io.
DATA: ls_io TYPE skwf_io,
lv_url TYPE skwf_url,
ls_smimloio TYPE smimloio,
lv_loio TYPE sdok_docid.
lv_loio = ms_item-obj_name.
CLEAR ev_url.
CLEAR ev_is_folder.
SELECT SINGLE * FROM smimloio INTO ls_smimloio
WHERE loio_id = lv_loio. "#EC CI_GENBUFF
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_abapgit_not_found.
ENDIF.
IF ls_smimloio-lo_class = wbmr_c_skwf_folder_class.
ev_is_folder = abap_true.
ls_io-objtype = skwfc_obtype_folder.
ELSE.
ls_io-objtype = skwfc_obtype_loio.
ENDIF.
ls_io-class = ls_smimloio-lo_class.
ls_io-objid = ls_smimloio-loio_id.
CALL FUNCTION 'SKWF_NMSPC_IO_ADDRESS_GET'
EXPORTING
io = ls_io
IMPORTING
url = lv_url.
ev_url = lv_url.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
DATA: lv_loio TYPE sdok_docid.
lv_loio = ms_item-obj_name.
SELECT SINGLE chng_user FROM smimloio INTO rv_user
WHERE loio_id = lv_loio. "#EC CI_GENBUFF
IF sy-subrc <> 0 OR rv_user IS INITIAL.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: li_api TYPE REF TO if_mr_api,
lv_url TYPE string.
TRY.
get_url_for_io(
IMPORTING
ev_url = lv_url ).
CATCH zcx_abapgit_not_found.
RETURN.
ENDTRY.
li_api = cl_mime_repository_api=>if_mr_api~get_api( ).
li_api->delete(
EXPORTING
i_url = lv_url
i_delete_children = abap_true
EXCEPTIONS
parameter_missing = 1
error_occured = 2
cancelled = 3
permission_failure = 4
not_found = 5
OTHERS = 6 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from delete' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lv_url TYPE string,
lv_folder TYPE abap_bool,
lv_content TYPE xstring,
lv_filename TYPE skwf_filnm,
lv_io TYPE sdok_docid,
lv_class TYPE smimloio-lo_class,
ls_skwf_io TYPE skwf_io,
li_api TYPE REF TO if_mr_api.
li_api = cl_mime_repository_api=>if_mr_api~get_api( ).
lv_io = ms_item-obj_name.
io_xml->read( EXPORTING iv_name = 'URL'
CHANGING cg_data = lv_url ).
io_xml->read( EXPORTING iv_name = 'FOLDER'
CHANGING cg_data = lv_folder ).
io_xml->read( EXPORTING iv_name = 'CLASS'
CHANGING cg_data = lv_class ).
ls_skwf_io-objid = lv_io.
IF lv_folder = abap_true.
li_api->create_folder(
EXPORTING
i_url = lv_url
i_language = sy-langu
i_dev_package = iv_package
i_folder_loio = ls_skwf_io
EXCEPTIONS
parameter_missing = 1
error_occured = 2
cancelled = 3
permission_failure = 4
folder_exists = 5
OTHERS = 6 ).
IF sy-subrc <> 5 AND sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error frrom SMIM create_folder' ).
ENDIF.
ELSE.
lv_filename = get_filename( lv_url ).
ls_skwf_io-class = lv_class.
IF ls_skwf_io-class IS INITIAL.
cl_wb_mime_repository=>determine_io_class(
EXPORTING
filename = lv_filename
IMPORTING
io_class = ls_skwf_io-class ).
CONCATENATE ls_skwf_io-class '_L' INTO ls_skwf_io-class.
ENDIF.
lv_content = find_content( lv_url ).
li_api->put(
EXPORTING
i_url = lv_url
i_content = lv_content
i_dev_package = iv_package
i_new_loio = ls_skwf_io
EXCEPTIONS
parameter_missing = 1
error_occured = 2
cancelled = 3
permission_failure = 4
data_inconsistency = 5
new_loio_already_exists = 6
is_folder = 7
OTHERS = 8 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SMIM put' ).
ENDIF.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_loio TYPE sdok_docid.
lv_loio = ms_item-obj_name.
SELECT SINGLE loio_id FROM smimloio INTO lv_loio
WHERE loio_id = lv_loio. "#EC CI_GENBUFF
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
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.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = ms_item-obj_name
object_type = ms_item-obj_type.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lv_url TYPE string,
lv_folder TYPE abap_bool,
lv_filename TYPE string,
lv_class TYPE smimloio-lo_class,
ls_file TYPE zif_abapgit_definitions=>ty_file,
lv_content TYPE xstring,
li_api TYPE REF TO if_mr_api,
lv_loio TYPE sdok_docid.
lv_loio = ms_item-obj_name.
TRY.
get_url_for_io(
IMPORTING
ev_url = lv_url
ev_is_folder = lv_folder ).
CATCH zcx_abapgit_not_found.
RETURN.
ENDTRY.
IF lv_folder = abap_false.
li_api = cl_mime_repository_api=>if_mr_api~get_api( ).
li_api->get(
EXPORTING
i_url = lv_url
IMPORTING
e_content = lv_content
EXCEPTIONS
parameter_missing = 1
error_occured = 2
not_found = 3
permission_failure = 4
OTHERS = 5 ).
IF sy-subrc <> 0 AND sy-subrc <> 2 AND sy-subrc <> 3.
zcx_abapgit_exception=>raise( 'error from mime api->get:' && sy-msgv1 ).
ENDIF.
lv_filename = get_filename( lv_url ).
CLEAR ls_file.
ls_file-filename = build_filename( lv_filename ).
ls_file-path = '/'.
ls_file-data = lv_content.
mo_files->add( ls_file ).
SELECT SINGLE lo_class FROM smimloio INTO lv_class
WHERE loio_id = lv_loio. "#EC CI_GENBUFF
ENDIF.
io_xml->add( iv_name = 'URL'
ig_data = lv_url ).
io_xml->add( iv_name = 'FOLDER'
ig_data = lv_folder ).
io_xml->add( iv_name = 'CLASS'
ig_data = lv_class ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
5796,
320,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
34345,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
6371,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
34345,
8,
41876,
4731,
13,
628,
220,
220,
220,
337,
36252,
50,
1064,
62,
11299,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
6371,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
11299,
8,
41876,
2124,
8841,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
337,
36252,
50,
1382,
62,
34345,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
34345,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
34345,
8,
41876,
4731,
13,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
6371,
62,
1640,
62,
952,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
819,
62,
6371,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
819,
62,
271,
62,
43551,
41876,
450,
499,
62,
30388,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1662,
62,
9275,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
12310,
3955,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1382,
62,
34345,
13,
628,
220,
220,
220,
39962,
1404,
1677,
6158,
13845,
62,
9186,
12,
26801,
62,
3672,
13845,
62,
9186,
12,
26801,
62,
4906,
21628,
62,
34345,
198,
220,
220,
220,
220,
220,
39319,
374,
85,
62,
34345,
7946,
27082,
11617,
11050,
705,
2637,
13,
198,
220,
220,
220,
48213,
8634,
6158,
374,
85,
62,
34345,
5390,
406,
36048,
42001,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1064,
62,
11299,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
34345,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
16624,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
16624,
62,
926,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
7753,
29,
34178,
48920,
3963,
300,
83,
62,
16624,
13,
628,
198,
220,
220,
220,
300,
85,
62,
34345,
796,
651,
62,
34345,
7,
21628,
62,
6371,
6739,
628,
220,
220,
220,
300,
85,
62,
34345,
796,
1382,
62,
34345,
7,
300,
85,
62,
34345,
6739,
628,
220,
220,
220,
300,
83,
62,
16624,
796,
6941,
62,
16624,
3784,
1136,
62,
16624,
7,
6739,
628,
220,
220,
220,
20832,
43679,
300,
83,
62,
16624,
24994,
3528,
15871,
1279,
7278,
62,
7753,
29,
13315,
35374,
29472,
796,
300,
85,
62,
34345,
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,
12310,
3955,
11,
2393,
407,
1043,
6,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
374,
85,
62,
11299,
796,
1279,
7278,
62,
7753,
29,
12,
7890,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
34345,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
6615,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
37336,
41876,
43679,
3963,
4731,
13,
628,
198,
220,
220,
220,
46341,
2043,
21628,
62,
6371,
5161,
31051,
6,
39319,
43679,
300,
83,
62,
37336,
13,
198,
220,
220,
220,
300,
85,
62,
6615,
796,
3951,
7,
300,
83,
62,
37336,
6739,
198,
220,
220,
220,
24994,
17395,
300,
85,
62,
6615,
1875,
657,
13,
198,
220,
220,
220,
20832,
43679,
300,
83,
62,
37336,
24413,
6369,
300,
85,
62,
6615,
39319,
374,
85,
62,
34345,
13,
198,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
6371,
62,
1640,
62,
952,
13,
628,
220,
220,
220,
42865,
25,
43979,
62,
952,
220,
220,
220,
220,
220,
220,
41876,
1341,
86,
69,
62,
952,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
6371,
220,
220,
220,
220,
220,
41876,
1341,
86,
69,
62,
6371,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
5796,
320,
5439,
952,
41876,
895,
320,
5439,
952,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
5439,
952,
220,
220,
220,
220,
41876,
45647,
482,
62,
15390,
312,
13,
628,
198,
220,
220,
220,
300,
85,
62,
5439,
952,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
30301,
1503,
819,
62,
6371,
13,
198,
220,
220,
220,
30301,
1503,
819,
62,
271,
62,
43551,
13,
628,
220,
220,
220,
33493,
311,
2751,
2538,
1635,
16034,
895,
320,
5439,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*&---------------------------------------------------------------------*
*& Report zuitb_test_alv
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT zuitb_test_alv.
TYPES: BEGIN OF ty_s_data,
plant TYPE werks_d,
datab TYPE datab,
datbi TYPE datbi,
END OF ty_s_data.
DATA: gt_data TYPE STANDARD TABLE OF ty_s_data.
gt_data = VALUE #(
( plant = '1001' datab = '20180101' datbi = '20181231' )
( plant = '1001' datab = '20180101' datbi = '20181231' )
( plant = '1001' datab = '20180101' datbi = '20181231' )
( plant = '1001' datab = '20180101' datbi = '20181231' )
( plant = '1001' datab = '20180101' datbi = '20181231' )
).
CLASS cl_alv_tester DEFINITION.
PUBLIC SECTION.
METHODS test_dialog.
METHODS test_modal_dialog.
PRIVATE SECTION.
METHODS on_function
FOR EVENT function_chosen OF zcl_uitb_alv_events
IMPORTING
ev_function
ev_tag.
ENDCLASS.
CLASS cl_alv_tester IMPLEMENTATION.
METHOD on_function.
IF ev_function = 'MODAL'.
test_modal_dialog( ).
ELSEIF ev_function = 'DIALOG'.
test_dialog( ).
ENDIF.
ENDMETHOD.
METHOD test_dialog.
DATA(lo_alv_dialog) = zcl_uitb_alv=>create_alv(
ir_data = REF #( gt_data )
iv_display_type = zif_uitb_c_alv_display_types=>dialog
).
lo_alv_dialog->set_popup_dimensions(
iv_top = 0
iv_left = 0
iv_right = 500
iv_bottom = 500
).
lo_alv_dialog->get_display_settings( )->set_title( 'ALV in dialog' ).
DATA(lo_functions) = lo_alv_dialog->get_functions( ).
lo_functions->set_default( abap_true ).
lo_functions->add_function(
iv_name = 'MODAL'
iv_icon = |{ icon_abap }|
iv_text = 'Call modal dialog'
).
SET HANDLER: on_function FOR lo_alv_dialog->get_events( ).
lo_alv_dialog->display( ).
ENDMETHOD.
METHOD test_modal_dialog.
DATA(lo_alv_modal_dialog) = zcl_uitb_alv=>create_alv(
ir_data = REF #( gt_data )
iv_display_type = zif_uitb_c_alv_display_types=>modal_dialog
).
lo_alv_modal_dialog->set_popup_dimensions(
iv_top = 2
iv_left = 10
iv_right = 120
iv_bottom = 20
).
lo_alv_modal_dialog->get_display_settings( )->set_title( 'ALV in modal dialog' ).
DATA(lo_functions) = lo_alv_modal_dialog->get_functions( ).
lo_functions->set_default( abap_true ).
lo_functions->add_function(
iv_name = 'DIALOG'
iv_icon = |{ icon_abap }|
iv_text = 'Call Dialog'
).
SET HANDLER: on_function FOR lo_alv_modal_dialog->get_events( ).
lo_alv_modal_dialog->display( ).
ENDMETHOD.
ENDCLASS.
START-OF-SELECTION.
NEW cl_alv_tester( )->test_modal_dialog( ).
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
1976,
5013,
65,
62,
9288,
62,
282,
85,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
198,
9,
5,
10097,
30934,
9,
198,
2200,
15490,
1976,
5013,
65,
62,
9288,
62,
282,
85,
13,
198,
198,
9936,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
82,
62,
7890,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
4618,
41876,
266,
263,
591,
62,
67,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
4818,
397,
41876,
4818,
397,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
4818,
8482,
41876,
4818,
8482,
11,
198,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
82,
62,
7890,
13,
198,
198,
26947,
25,
308,
83,
62,
7890,
41876,
49053,
9795,
43679,
3963,
1259,
62,
82,
62,
7890,
13,
198,
198,
13655,
62,
7890,
796,
26173,
8924,
1303,
7,
198,
220,
357,
4618,
796,
705,
47705,
6,
4818,
397,
796,
705,
7908,
486,
486,
6,
4818,
8482,
796,
705,
7908,
1065,
3132,
6,
1267,
198,
220,
357,
4618,
796,
705,
47705,
6,
4818,
397,
796,
705,
7908,
486,
486,
6,
4818,
8482,
796,
705,
7908,
1065,
3132,
6,
1267,
198,
220,
357,
4618,
796,
705,
47705,
6,
4818,
397,
796,
705,
7908,
486,
486,
6,
4818,
8482,
796,
705,
7908,
1065,
3132,
6,
1267,
198,
220,
357,
4618,
796,
705,
47705,
6,
4818,
397,
796,
705,
7908,
486,
486,
6,
4818,
8482,
796,
705,
7908,
1065,
3132,
6,
1267,
198,
220,
357,
4618,
796,
705,
47705,
6,
4818,
397,
796,
705,
7908,
486,
486,
6,
4818,
8482,
796,
705,
7908,
1065,
3132,
6,
1267,
198,
737,
198,
198,
31631,
537,
62,
282,
85,
62,
4879,
353,
5550,
20032,
17941,
13,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
1332,
62,
38969,
519,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
4666,
282,
62,
38969,
519,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
319,
62,
8818,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
49261,
2163,
62,
354,
5233,
3963,
1976,
565,
62,
5013,
65,
62,
282,
85,
62,
31534,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
819,
62,
8818,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
819,
62,
12985,
13,
198,
10619,
31631,
13,
198,
198,
31631,
537,
62,
282,
85,
62,
4879,
353,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
319,
62,
8818,
13,
198,
220,
220,
220,
16876,
819,
62,
8818,
796,
705,
33365,
1847,
4458,
198,
220,
220,
220,
220,
220,
1332,
62,
4666,
282,
62,
38969,
519,
7,
6739,
198,
220,
220,
220,
17852,
5188,
5064,
819,
62,
8818,
796,
705,
35,
12576,
7730,
4458,
198,
220,
220,
220,
220,
220,
1332,
62,
38969,
519,
7,
6739,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
62,
38969,
519,
13,
198,
220,
220,
220,
42865,
7,
5439,
62,
282,
85,
62,
38969,
519,
8,
796,
1976,
565,
62,
5013,
65,
62,
282,
85,
14804,
17953,
62,
282,
85,
7,
198,
220,
220,
220,
220,
220,
4173,
62,
7890,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
4526,
37,
1303,
7,
308,
83,
62,
7890,
1267,
198,
220,
220,
220,
220,
220,
21628,
62,
13812,
62,
4906,
220,
220,
220,
220,
220,
220,
220,
220,
796,
1976,
361,
62,
5013,
65,
62,
66,
62,
282,
85,
62,
13812,
62,
19199,
14804,
38969,
519,
198,
220,
220,
220,
6739,
198,
220,
220,
220,
2376,
62,
282,
85,
62,
38969,
519,
3784,
2617,
62,
12924,
929,
62,
27740,
5736,
7,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
4852,
220,
220,
220,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
9464,
220,
220,
796,
657,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3506,
220,
796,
5323,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
22487,
796,
5323,
198,
220,
220,
220,
6739,
198,
220,
220,
220,
2376,
62,
282,
85,
62,
38969,
519,
3784,
1136,
62,
13812,
62,
33692,
7,
1267,
3784,
2617,
62,
7839,
7,
705,
1847,
53,
287,
17310,
6,
6739,
198,
220,
220,
220,
42865,
7,
5439,
62,
12543,
2733,
8,
796,
2376,
62,
282,
85,
62,
38969,
519,
3784,
1136,
62,
12543,
2733,
7,
6739,
198,
220,
220,
220,
2376,
62,
12543,
2733,
3784,
2617,
62,
12286,
7,
450,
499,
62,
7942,
6739,
198,
220,
220,
220,
2376,
62,
12543,
2733,
3784,
2860,
62,
8818,
7,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
33365,
1847,
6,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
4749,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
930,
90,
7196,
62,
397,
499,
1782,
91,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
5239,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
14134,
953,
282,
17310,
6,
198,
220,
220,
220,
6739,
198,
220,
220,
220,
25823,
367,
6981,
39878,
25,
319,
62,
8818,
7473,
2376,
62,
282,
85,
62,
38969,
519,
3784,
1136,
62,
31534,
7,
6739,
198,
220,
220,
220,
2376,
62,
282,
85,
62,
38969,
519,
3784,
13812,
7,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
62,
4666,
282,
62,
38969,
519,
13,
198,
220,
220,
220,
42865,
7,
5439,
62,
282,
85,
62,
4666,
282,
62,
38969,
519,
8,
796,
1976,
565,
62,
5013,
65,
62,
282,
85,
14804,
17953,
62,
282,
85,
7,
198,
220,
220,
220,
220,
220,
220,
220,
4173,
62,
7890,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
4526,
37,
1303,
7,
308,
83,
62,
7890,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
13812,
62,
4906,
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,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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
] |
INTERFACE zif_dbgl_snapshots
PUBLIC .
METHODS compare_or_record
IMPORTING
name TYPE clike
actual TYPE any
RETURNING VALUE(unequal) TYPE sap_bool
RAISING
zcx_dbgl_snapshot.
METHODS commit_changes
RAISING
zcx_dbgl_snapshot.
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
9945,
4743,
62,
45380,
20910,
198,
220,
44731,
764,
628,
220,
337,
36252,
50,
8996,
62,
273,
62,
22105,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
1438,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
4036,
41876,
597,
198,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
1726,
13255,
8,
41876,
31841,
62,
30388,
198,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
9945,
4743,
62,
45380,
9442,
13,
628,
220,
337,
36252,
50,
4589,
62,
36653,
198,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
9945,
4743,
62,
45380,
9442,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class /OOP/CL_OBJECT definition
public
create public .
public section.
*"* public components of class /OOP/CL_OBJECT
*"* do not include other source files here!!!
type-pools ABAP .
methods CLONE
returning
value(RETURNING) type ref to /OOP/CL_OBJECT .
methods EQUALS
importing
!OBJ type ref to /OOP/CL_OBJECT
returning
value(RETURNING) type ABAP_BOOL .
methods GETCLASS
final
returning
value(RETURNING) type ref to CL_ABAP_OBJECTDESCR .
protected section.
*"* protected components of class /OOP/CL_OBJECT
*"* do not include other source files here!!!
private section.
*"* private components of class /OOP/CL_OBJECT
*"* do not include other source files here!!!
ENDCLASS.
CLASS /OOP/CL_OBJECT IMPLEMENTATION.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method /OOP/CL_OBJECT->CLONE
* +-------------------------------------------------------------------------------------------------+
* | [<-()] RETURNING TYPE REF TO /OOP/CL_OBJECT
* +--------------------------------------------------------------------------------------</SIGNATURE>
method clone.
raise exception type /oop/cx_clonenotsupported.
" Any implementation of this method MUST follow these rules:
" - TRUE: x->clone( ) <> x
" - TRUE: x->clone( )->getclass( ) = x->getclass( )
" - TRUE: x->clone( )->equals( x )
" - TRUE: x->clone( )->hashcode( ) = x->hashcode( )
" - The clone object should be independent of the original object, which means
" you must also clone all mutable objects which comprise the internal "deep structure"
" of the object being cloned.
" - In case of arrays only the array object must be cloned and not the objects inside
" the array, resulting in a "shallow copy"
"
" IMPORTANT
" This method does NOT behave like it does in Java.
" The difference is, it will NEVER return an instance of an object (in Java, when a class
" implements the Cloneable interface, this method will return an instance of that class).
" This means you CANNOT rely on calling super->clone( ) to get an instance,
" if none of the superclasses implement the clone( ) method.
" In practice, this means you will have to create the instance yourself if you want to
" make your objects cloneable. In the case of abstract classes this won't be possible,
" which means you cannot use super->clone( ) and you have to write an implementation in
" each concrete subclass.
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method /OOP/CL_OBJECT->EQUALS
* +-------------------------------------------------------------------------------------------------+
* | [--->] OBJ TYPE REF TO /OOP/CL_OBJECT
* | [<-()] RETURNING TYPE ABAP_BOOL
* +--------------------------------------------------------------------------------------</SIGNATURE>
method equals.
" Only compare reference by default
if me = obj.
returning = abap_true.
return.
else.
returning = abap_false.
return.
endif.
" Override this method to implement a more specific comparison
" If you override this method, you MUST override the hashcode method too,
" such that two objects which are equal, also have the same hashcode.
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method /OOP/CL_OBJECT->GETCLASS
* +-------------------------------------------------------------------------------------------------+
* | [<-()] RETURNING TYPE REF TO CL_ABAP_OBJECTDESCR
* +--------------------------------------------------------------------------------------</SIGNATURE>
method getclass.
returning ?= cl_abap_typedescr=>describe_by_object_ref( me ).
endmethod.
ENDCLASS.
| [
4871,
1220,
46,
3185,
14,
5097,
62,
9864,
23680,
6770,
201,
198,
220,
1171,
201,
198,
220,
2251,
1171,
764,
201,
198,
201,
198,
11377,
2665,
13,
201,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1220,
46,
3185,
14,
5097,
62,
9864,
23680,
201,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
201,
198,
220,
2099,
12,
7742,
82,
9564,
2969,
764,
201,
198,
201,
198,
220,
5050,
7852,
11651,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
1006,
284,
1220,
46,
3185,
14,
5097,
62,
9864,
23680,
764,
201,
198,
220,
5050,
46886,
23333,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
9864,
41,
2099,
1006,
284,
1220,
46,
3185,
14,
5097,
62,
9864,
23680,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
9564,
2969,
62,
8202,
3535,
764,
201,
198,
220,
5050,
17151,
31631,
201,
198,
220,
2457,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
1006,
284,
7852,
62,
6242,
2969,
62,
9864,
23680,
30910,
9419,
764,
201,
198,
24326,
2665,
13,
201,
198,
9,
1,
9,
6861,
6805,
286,
1398,
1220,
46,
3185,
14,
5097,
62,
9864,
23680,
201,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
201,
198,
19734,
2665,
13,
201,
198,
9,
1,
9,
2839,
6805,
286,
1398,
1220,
46,
3185,
14,
5097,
62,
9864,
23680,
201,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
201,
198,
10619,
31631,
13,
201,
198,
201,
198,
201,
198,
201,
198,
31631,
1220,
46,
3185,
14,
5097,
62,
9864,
23680,
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,
5097,
62,
9864,
23680,
3784,
5097,
11651,
201,
198,
9,
1343,
10097,
3880,
19529,
201,
198,
9,
930,
685,
27,
12,
3419,
60,
30826,
4261,
15871,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1220,
46,
3185,
14,
5097,
62,
9864,
23680,
201,
198,
9,
1343,
10097,
19351,
438,
3556,
46224,
40086,
29,
201,
198,
24396,
17271,
13,
201,
198,
220,
5298,
6631,
2099,
1220,
11224,
14,
66,
87,
62,
565,
34481,
1747,
84,
4926,
276,
13,
201,
198,
201,
198,
220,
366,
4377,
7822,
286,
428,
2446,
17191,
1061,
777,
3173,
25,
201,
198,
220,
366,
532,
26751,
25,
220,
220,
2124,
3784,
21018,
7,
1267,
1279,
29,
2124,
201,
198,
220,
366,
532,
26751,
25,
220,
220,
2124,
3784,
21018,
7,
1267,
3784,
1136,
4871,
7,
1267,
796,
2124,
3784,
1136,
4871,
7,
1267,
201,
198,
220,
366,
532,
26751,
25,
220,
220,
2124,
3784,
21018,
7,
1267,
3784,
4853,
874,
7,
2124,
1267,
201,
198,
220,
366,
532,
26751,
25,
220,
220,
2124,
3784,
21018,
7,
1267,
3784,
17831,
8189,
7,
1267,
796,
2124,
3784,
17831,
8189,
7,
1267,
201,
198,
220,
366,
532,
383,
17271,
2134,
815,
307,
4795,
286,
262,
2656,
2134,
11,
543,
1724,
201,
198,
220,
366,
220,
220,
345,
1276,
635,
17271,
477,
4517,
540,
5563,
543,
28889,
262,
5387,
366,
22089,
4645,
1,
201,
198,
220,
366,
220,
220,
286,
262,
2134,
852,
537,
12004,
13,
201,
198,
220,
366,
532,
554,
1339,
286,
26515,
691,
262,
7177,
2134,
1276,
307,
537,
12004,
290,
407,
262,
5563,
2641,
201,
198,
220,
366,
220,
220,
262,
7177,
11,
7186,
287,
257,
366,
1477,
12154,
4866,
1,
201,
198,
220,
366,
201,
198,
220,
366,
30023,
9863,
8643,
201,
198,
220,
366,
770,
2446,
857,
5626,
17438,
588,
340,
857,
287,
7349,
13,
201,
198,
220,
366,
383,
3580,
318,
11,
340,
481,
33602,
1441,
281,
4554,
286,
281,
2134,
357,
259,
7349,
11,
618,
257,
1398,
201,
198,
220,
366,
23986,
262,
30698,
540,
7071,
11,
428,
2446,
481,
1441,
281,
4554,
286,
326,
1398,
737,
201,
198,
220,
366,
770,
1724,
345,
15628,
11929,
8814,
319,
4585,
2208,
3784,
21018,
7,
1267,
284,
651,
281,
4554,
11,
201,
198,
220,
366,
611,
4844,
286,
262,
2208,
37724,
3494,
262,
17271,
7,
1267,
2446,
13,
201,
198,
220,
366,
554,
3357,
11,
428,
1724,
345,
481,
423,
284,
2251,
262,
4554,
3511,
611,
345,
765,
284,
201,
198,
220,
366,
787,
534,
5563,
17271,
540,
13,
554,
262,
1339,
286,
12531,
6097,
428,
1839,
470,
307,
1744,
11,
201,
198,
220,
366,
543,
1724,
345,
2314,
779,
2208,
3784,
21018,
7,
1267,
290,
345,
423,
284,
3551,
281,
7822,
287,
201,
198,
220,
366,
1123,
10017,
47611,
13,
201,
198,
201,
198,
437,
24396,
13,
201,
198,
201,
198,
201,
198,
9,
1279,
46224,
40086,
29,
10097,
19351,
6329,
10,
201,
198,
9,
930,
2262,
590,
5094,
11789,
1220,
46,
3185,
14,
5097,
62,
9864,
23680,
3784,
36,
10917,
23333,
201,
198,
9,
1343,
10097,
3880,
19529,
201,
198,
9,
930,
685,
438,
3784,
60,
25334,
41,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1220,
46,
3185,
14,
5097,
62,
9864,
23680,
201,
198,
9,
930,
685,
27,
12,
3419,
60,
30826,
4261,
15871,
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,
9564,
2969,
62,
8202,
3535,
201,
198,
9,
1343,
10097,
19351,
438,
3556,
46224,
40086,
29,
201,
198,
24396,
21767,
13,
201,
198,
220,
366,
5514,
8996,
4941,
416,
4277,
201,
198,
220,
611,
502,
796,
26181,
13,
201,
198,
220,
220,
220,
8024,
796,
450,
499,
62,
7942,
13,
201,
198,
220,
220,
220,
1441,
13,
201,
198,
220,
2073,
13,
201,
198,
220,
220,
220,
8024,
796,
450,
499,
62,
9562,
13,
201,
198,
220,
220,
220,
1441,
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,
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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 ZSAPLINK_DATA_ELEMENTS definition
public
inheriting from ZSAPLINK
final
create public .
public section.
methods CHECKEXISTS
redefinition .
methods CREATEIXMLDOCFROMOBJECT
redefinition .
methods CREATEOBJECTFROMIXMLDOC
redefinition .
protected section.
methods DELETEOBJECT
redefinition .
methods GETOBJECTTYPE
redefinition .
private section.
endclass. "ZSAPLINK_DATA_ELEMENTS definition
*----------------------------------------------------------------------*
* class ZSAPLINK_DATA_ELEMENTS implementation.
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class ZSAPLINK_DATA_ELEMENTS implementation.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version. |
*| |
*| SAPlink is distributed in the hope that it will be useful, |
*| but WITHOUT ANY WARRANTY; without even the implied warranty of |
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
*| GNU General Public License for more details. |
*| |
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the |
*| Free Software Foundation, Inc., |
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
*\---------------------------------------------------------------------/
METHOD CHECKEXISTS.
* Plugin created by:
* Thomas Jung
* [email protected]
DATA: l_name TYPE ddobjname,
dd04v_wa type dd04v.
l_name = objname.
CALL FUNCTION 'DDIF_DTEL_GET'
EXPORTING
name = l_name
IMPORTING
DD04V_WA = DD04V_WA
EXCEPTIONS
ILLEGAL_INPUT = 1
OTHERS = 2.
IF sy-subrc = 0 AND dd04v_wa-ROLLNAME IS NOT INITIAL.
exists = 'X'.
ENDIF.
ENDMETHOD.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version. |
*| |
*| SAPlink is distributed in the hope that it will be useful, |
*| but WITHOUT ANY WARRANTY; without even the implied warranty of |
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
*| GNU General Public License for more details. |
*| |
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the |
*| Free Software Foundation, Inc., |
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
*\---------------------------------------------------------------------/
METHOD createixmldocfromobject.
* Plugin created by:
* Thomas Jung
* [email protected]
DATA: gotstate TYPE ddgotstate,
dd04v_wa TYPE dd04v,
tpara_wa TYPE tpara.
*xml nodes
DATA rootnode TYPE REF TO if_ixml_element.
DATA tpara_node TYPE REF TO if_ixml_element.
DATA rc TYPE sysubrc.
DATA _dtelname TYPE ddobjname.
_dtelname = objname.
CALL FUNCTION 'DDIF_DTEL_GET'
EXPORTING
name = _dtelname
langu = sy-langu
IMPORTING
gotstate = gotstate
dd04v_wa = dd04v_wa
tpara_wa = tpara_wa
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc <> 0 OR dd04v_wa-rollname IS INITIAL.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_found.
ENDIF.
* Create parent node
DATA _objtype TYPE string.
_objtype = getobjecttype( ).
rootnode = xmldoc->create_element( _objtype ).
setattributesfromstructure( node = rootnode structure = dd04v_wa ).
tpara_node = xmldoc->create_element( 'tpara' ).
setattributesfromstructure( node = tpara_node structure = tpara_wa ).
rc = rootnode->append_child( tpara_node ).
*\--------------------------------------------------------------------/
rc = xmldoc->append_child( rootnode ).
ixmldocument = xmldoc.
ENDMETHOD.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version. |
*| |
*| SAPlink is distributed in the hope that it will be useful, |
*| but WITHOUT ANY WARRANTY; without even the implied warranty of |
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
*| GNU General Public License for more details. |
*| |
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the |
*| Free Software Foundation, Inc., |
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
*\---------------------------------------------------------------------/
METHOD createobjectfromixmldoc.
* Plugin created by:
* Thomas Jung
* [email protected]
DATA: gotstate TYPE ddgotstate,
dd04v_wa TYPE dd04v,
tpara_wa TYPE tpara.
*xml nodes
DATA rootnode TYPE REF TO if_ixml_element.
DATA tpara_node TYPE REF TO if_ixml_element.
DATA node TYPE REF TO if_ixml_element.
DATA filter TYPE REF TO if_ixml_node_filter.
DATA iterator TYPE REF TO if_ixml_node_iterator.
DATA rc TYPE sysubrc.
DATA _dtelname TYPE ddobjname.
DATA _devclass TYPE devclass.
DATA checkexists TYPE flag.
DATA _objtype TYPE string.
_devclass = devclass.
_objtype = getobjecttype( ).
xmldoc = ixmldocument.
rootnode = xmldoc->find_from_name( _objtype ).
CALL METHOD getstructurefromattributes
EXPORTING
node = rootnode
CHANGING
structure = dd04v_wa.
objname = dd04v_wa-rollname.
checkexists = checkexists( ).
IF checkexists IS NOT INITIAL.
IF overwrite IS INITIAL.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>existing.
ELSE.
* delete object for new install
deleteobject( ).
ENDIF.
ENDIF.
* retrieve Domain details
FREE: filter, iterator, node.
filter = xmldoc->create_filter_name( 'tpara' ).
iterator = xmldoc->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
IF node IS NOT INITIAL.
CALL METHOD getstructurefromattributes
EXPORTING
node = node
CHANGING
structure = tpara_wa.
ENDIF.
DATA : l_pgmid TYPE tadir-pgmid,
l_object TYPE tadir-object,
l_obj_name TYPE tadir-obj_name,
l_dd_objname TYPE ddobjname,
l_srcsystem TYPE tadir-srcsystem,
l_author TYPE tadir-author,
l_devclass TYPE tadir-devclass,
l_masterlang TYPE tadir-masterlang.
l_pgmid = 'R3TR'.
l_object = _objtype.
l_obj_name = objname.
l_dd_objname = objname.
l_srcsystem = sy-sysid.
l_author = sy-uname.
l_devclass = _devclass.
l_masterlang = sy-langu.
DATA: itadir TYPE tadir.
itadir-pgmid = l_pgmid.
itadir-object = l_object.
itadir-obj_name = l_obj_name.
itadir-srcsystem = l_srcsystem.
itadir-author = l_author.
itadir-devclass = l_devclass.
itadir-masterlang = l_masterlang.
MODIFY tadir FROM itadir.
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_test_modus = ' '
wi_delete_tadir_entry = 'X'
wi_tadir_pgmid = l_pgmid
wi_tadir_object = l_object
wi_tadir_obj_name = l_obj_name
wi_tadir_srcsystem = l_srcsystem
wi_tadir_author = l_author
wi_tadir_devclass = l_devclass
wi_tadir_masterlang = l_masterlang
iv_set_edtflag = ''
EXCEPTIONS
tadir_entry_not_existing = 1
tadir_entry_ill_type = 2
no_systemname = 3
no_systemtype = 4
original_system_conflict = 5
object_reserved_for_devclass = 6
object_exists_global = 7
object_exists_local = 8
object_is_distributed = 9
obj_specification_not_unique = 10
no_authorization_to_delete = 11
devclass_not_existing = 12
simultanious_set_remove_repair = 13
order_missing = 14
no_modification_of_head_syst = 15
pgmid_object_not_allowed = 16
masterlanguage_not_specified = 17
devclass_not_specified = 18
specify_owner_unique = 19
loc_priv_objs_no_repair = 20
gtadir_not_reached = 21
object_locked_for_order = 22
change_of_class_not_allowed = 23
no_change_from_sap_to_tmp = 24
OTHERS = 25.
IF sy-subrc NE 0.
CASE sy-subrc.
WHEN 1 OR 9 OR 7 OR 8. "OK! - Doesn't exist yet
WHEN 11 OR 23 OR 24.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_authorized.
WHEN 22.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>locked.
WHEN OTHERS.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>system_error.
ENDCASE.
ENDIF.
CALL FUNCTION 'DDIF_DTEL_PUT'
EXPORTING
name = l_dd_objname
dd04v_wa = dd04v_wa
EXCEPTIONS
dtel_not_found = 1
name_inconsistent = 2
dtel_inconsistent = 3
put_failure = 4
put_refused = 5
OTHERS = 6.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>system_error.
ENDIF.
DATA: trobjtype TYPE trobjtype,
trobj_name TYPE trobj_name.
trobjtype = l_object.
trobj_name = l_obj_name.
CALL FUNCTION 'RS_INSERT_INTO_WORKING_AREA'
EXPORTING
object = trobjtype
obj_name = trobj_name
EXCEPTIONS
wrong_object_name = 1.
name = objName.
ENDMETHOD.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version. |
*| |
*| SAPlink is distributed in the hope that it will be useful, |
*| but WITHOUT ANY WARRANTY; without even the implied warranty of |
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
*| GNU General Public License for more details. |
*| |
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the |
*| Free Software Foundation, Inc., |
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
*\---------------------------------------------------------------------/
method DELETEOBJECT.
* Plugin created by:
* Thomas Jung
* [email protected]
endmethod.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version. |
*| |
*| SAPlink is distributed in the hope that it will be useful, |
*| but WITHOUT ANY WARRANTY; without even the implied warranty of |
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
*| GNU General Public License for more details. |
*| |
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the |
*| Free Software Foundation, Inc., |
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
*\---------------------------------------------------------------------/
method GETOBJECTTYPE.
* Plugin created by:
* Thomas Jung
* [email protected]
objecttype = 'DTEL'. "Data Elements
endmethod.
endclass. "ZSAPLINK_DATA_ELEMENTS implementation | [
4871,
1168,
50,
2969,
43,
17248,
62,
26947,
62,
36,
2538,
28957,
6770,
198,
220,
1171,
198,
220,
10639,
1780,
422,
1168,
50,
2969,
43,
17248,
198,
220,
2457,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
5050,
5870,
25171,
6369,
1797,
4694,
198,
220,
220,
220,
34087,
17750,
764,
198,
220,
5050,
29244,
6158,
10426,
5805,
38715,
10913,
2662,
9864,
23680,
198,
220,
220,
220,
34087,
17750,
764,
198,
220,
5050,
29244,
1404,
4720,
33,
23680,
10913,
2662,
10426,
5805,
38715,
198,
220,
220,
220,
34087,
17750,
764,
198,
24326,
2665,
13,
628,
220,
5050,
5550,
28882,
4720,
33,
23680,
198,
220,
220,
220,
34087,
17750,
764,
198,
220,
5050,
17151,
9864,
23680,
25216,
198,
220,
220,
220,
34087,
17750,
764,
198,
19734,
2665,
13,
198,
437,
4871,
13,
366,
57,
50,
2969,
43,
17248,
62,
26947,
62,
36,
2538,
28957,
6770,
628,
198,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
1398,
1168,
50,
2969,
43,
17248,
62,
26947,
62,
36,
2538,
28957,
7822,
13,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
4871,
1168,
50,
2969,
43,
17248,
62,
26947,
62,
36,
2538,
28957,
7822,
13,
628,
198,
16208,
10097,
30934,
59,
198,
9,
91,
220,
220,
770,
2393,
318,
636,
286,
48323,
8726,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
48323,
8726,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
220,
220,
930,
198,
9,
91,
220,
220,
340,
739,
262,
2846,
286,
262,
22961,
3611,
5094,
13789,
355,
3199,
930,
198,
9,
91,
220,
220,
416,
262,
3232,
10442,
5693,
26,
2035,
2196,
362,
286,
262,
13789,
11,
930,
198,
9,
91,
220,
220,
393,
357,
265,
534,
3038,
8,
597,
1568,
2196,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
48323,
8726,
318,
9387,
287,
262,
2911,
326,
340,
481,
307,
4465,
11,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
475,
42881,
15529,
34764,
56,
26,
1231,
772,
262,
17142,
18215,
286,
220,
220,
220,
930,
198,
9,
91,
220,
220,
34482,
3398,
1565,
5603,
25382,
393,
376,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
13,
220,
4091,
262,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
22961,
3611,
5094,
13789,
329,
517,
3307,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
921,
815,
423,
2722,
257,
4866,
286,
262,
22961,
3611,
5094,
13789,
930,
198,
9,
91,
220,
220,
1863,
351,
48323,
8726,
26,
611,
407,
11,
3551,
284,
262,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
3232,
10442,
5693,
11,
3457,
1539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
220,
220,
6885,
14021,
520,
11,
19383,
22343,
11,
6182,
11,
8779,
220,
657,
2481,
940,
12,
1485,
486,
220,
4916,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
59,
10097,
30934,
14,
198,
49273,
5870,
25171,
6369,
1797,
4694,
13,
198,
198,
9,
220,
220,
220,
220,
220,
42636,
2727,
416,
25,
198,
9,
220,
220,
220,
220,
220,
5658,
27134,
198,
9,
220,
220,
220,
220,
220,
294,
16911,
13,
73,
2150,
16,
31,
14816,
13,
785,
628,
220,
42865,
25,
300,
62,
3672,
41876,
49427,
26801,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
49427,
3023,
85,
62,
10247,
2099,
49427,
3023,
85,
13,
198,
220,
300,
62,
3672,
796,
26181,
3672,
13,
628,
220,
42815,
29397,
4177,
2849,
705,
16458,
5064,
62,
24544,
3698,
62,
18851,
6,
198,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
62,
3672,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
20084,
3023,
53,
62,
15543,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
20084,
3023,
53,
62,
15543,
198,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
14639,
2538,
38,
1847,
62,
1268,
30076,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
INTERFACE zif_gtt_sts_ef_constants
PUBLIC .
CONSTANTS:
BEGIN OF cs_system_fields,
actual_bisiness_timezone TYPE /saptrx/paramname VALUE 'ACTUAL_BUSINESS_TIMEZONE',
actual_bisiness_datetime TYPE /saptrx/paramname VALUE 'ACTUAL_BUSINESS_DATETIME',
actual_technical_timezone TYPE /saptrx/paramname VALUE 'ACTUAL_TECHNICAL_TIMEZONE',
actual_technical_datetime TYPE /saptrx/paramname VALUE 'ACTUAL_TECHNICAL_DATETIME',
END OF cs_system_fields .
CONSTANTS:
BEGIN OF cs_parameter,
ref_planned_event_milestone TYPE /saptrx/paramname VALUE 'REF_PLANNED_EVENT_MILESTONE',
ref_planned_event_locid2 TYPE /saptrx/paramname VALUE 'REF_PLANNED_EVENT_LOCID2',
ref_planned_event_loctype TYPE /saptrx/paramname VALUE 'REF_PLANNED_EVENT_LOCTYPE',
ref_planned_event_locid1 TYPE /saptrx/paramname VALUE 'REF_PLANNED_EVENT_LOCID1',
estimated_datetime TYPE /saptrx/paramname VALUE 'ESTIMATED_DATETIME',
estimated_timezone TYPE /saptrx/paramname VALUE 'ESTIMATED_TIMEZONE',
stop_id TYPE /saptrx/paramname VALUE 'STOP_ID',
additional_match_key TYPE /saptrx/paramname VALUE 'ADDITIONAL_MATCH_KEY',
END OF cs_parameter .
CONSTANTS cv_logistic_location TYPE string VALUE 'LogisticLocation' ##NO_TEXT.
CONSTANTS:
BEGIN OF cs_errors,
wrong_parameter TYPE sotr_conc VALUE '1216f03004ce11ebbf450050c2490048',
cdata_determination TYPE sotr_conc VALUE '1216f03004ce11ebbf460050c2490048',
table_determination TYPE sotr_conc VALUE '1216f03004ce11ebbf470050c2490048',
stop_processing TYPE sotr_conc VALUE '1216f03004ce11ebbf480050c2490048',
END OF cs_errors .
CONSTANTS:
BEGIN OF cs_condition,
true TYPE zif_gtt_sts_ef_types=>tv_condition VALUE 'T',
false TYPE zif_gtt_sts_ef_types=>tv_condition VALUE 'F',
END OF cs_condition .
CONSTANTS:
BEGIN OF cs_change_mode,
insert TYPE updkz_d VALUE 'I',
update TYPE updkz_d VALUE 'U',
delete TYPE updkz_d VALUE 'D',
undefined TYPE updkz_d VALUE 'T',
END OF cs_change_mode .
CONSTANTS cv_aot TYPE string VALUE 'AOT' ##NO_TEXT.
CONSTANTS cv_max_end_date TYPE /saptrx/tid_end_date_tsloc VALUE '099991231000000' ##NO_TEXT.
CONSTANTS:
BEGIN OF cs_version,
gtt10 TYPE /saptrx/em_version VALUE 'GTT1.0',
gtt20 TYPE /saptrx/em_version VALUE 'GTT2.0',
END OF cs_version .
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
70,
926,
62,
6448,
62,
891,
62,
9979,
1187,
198,
220,
44731,
764,
628,
198,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
347,
43312,
3963,
50115,
62,
10057,
62,
25747,
11,
198,
220,
220,
220,
220,
220,
4036,
62,
41907,
1272,
62,
2435,
11340,
220,
41876,
1220,
82,
2373,
40914,
14,
17143,
3672,
26173,
8924,
705,
10659,
25620,
62,
45346,
44180,
62,
34694,
57,
11651,
3256,
198,
220,
220,
220,
220,
220,
4036,
62,
41907,
1272,
62,
19608,
8079,
220,
41876,
1220,
82,
2373,
40914,
14,
17143,
3672,
26173,
8924,
705,
10659,
25620,
62,
45346,
44180,
62,
35,
1404,
2767,
12789,
3256,
198,
220,
220,
220,
220,
220,
4036,
62,
47944,
62,
2435,
11340,
41876,
1220,
82,
2373,
40914,
14,
17143,
3672,
26173,
8924,
705,
10659,
25620,
62,
51,
25994,
45,
20151,
62,
34694,
57,
11651,
3256,
198,
220,
220,
220,
220,
220,
4036,
62,
47944,
62,
19608,
8079,
41876,
1220,
82,
2373,
40914,
14,
17143,
3672,
26173,
8924,
705,
10659,
25620,
62,
51,
25994,
45,
20151,
62,
35,
1404,
2767,
12789,
3256,
198,
220,
220,
220,
23578,
3963,
50115,
62,
10057,
62,
25747,
764,
198,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
347,
43312,
3963,
50115,
62,
17143,
2357,
11,
198,
220,
220,
220,
220,
220,
1006,
62,
36800,
62,
15596,
62,
25433,
13631,
41876,
1220,
82,
2373,
40914,
14,
17143,
3672,
26173,
8924,
705,
31688,
62,
6489,
22846,
1961,
62,
20114,
3525,
62,
44,
4146,
6465,
11651,
3256,
198,
220,
220,
220,
220,
220,
1006,
62,
36800,
62,
15596,
62,
17946,
312,
17,
220,
220,
220,
41876,
1220,
82,
2373,
40914,
14,
17143,
3672,
26173,
8924,
705,
31688,
62,
6489,
22846,
1961,
62,
20114,
3525,
62,
29701,
2389,
17,
3256,
198,
220,
220,
220,
220,
220,
1006,
62,
36800,
62,
15596,
62,
5439,
310,
2981,
220,
220,
41876,
1220,
82,
2373,
40914,
14,
17143,
3672,
26173,
8924,
705,
31688,
62,
6489,
22846,
1961,
62,
20114,
3525,
62,
21982,
4177,
56,
11401,
3256,
198,
220,
220,
220,
220,
220,
1006,
62,
36800,
62,
15596,
62,
17946,
312,
16,
220,
220,
220,
41876,
1220,
82,
2373,
40914,
14,
17143,
3672,
26173,
8924,
705,
31688,
62,
6489,
22846,
1961,
62,
20114,
3525,
62,
29701,
2389,
16,
3256,
198,
220,
220,
220,
220,
220,
6108,
62,
19608,
8079,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
82,
2373,
40914,
14,
17143,
3672,
26173,
8924,
705,
6465,
3955,
11617,
62,
35,
1404,
2767,
12789,
3256,
198,
220,
220,
220,
220,
220,
6108,
62,
2435,
11340,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
82,
2373,
40914,
14,
17143,
3672,
26173,
8924,
705,
6465,
3955,
11617,
62,
34694,
57,
11651,
3256,
198,
220,
220,
220,
220,
220,
2245,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
82,
2373,
40914,
14,
17143,
3672,
26173,
8924,
705,
2257,
3185,
62,
2389,
3256,
198,
220,
220,
220,
220,
220,
3224,
62,
15699,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
82,
2373,
40914,
14,
17143,
3672,
26173,
8924,
705,
29266,
17941,
1847,
62,
44,
11417,
62,
20373,
3256,
198,
220,
220,
220,
23578,
3963,
50115,
62,
17143,
2357,
764,
198,
220,
7102,
2257,
1565,
4694,
269,
85,
62,
6404,
2569,
62,
24886,
41876,
4731,
26173,
8924,
705,
11187,
2569,
14749,
6,
22492,
15285,
62,
32541,
13,
198,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
347,
43312,
3963,
50115,
62,
48277,
11,
198,
220,
220,
220,
220,
220,
2642,
62,
17143,
2357,
220,
220,
220,
220,
41876,
264,
313,
81,
62,
1102,
66,
26173,
8924,
705,
1065,
1433,
69,
3070,
22914,
344,
1157,
1765,
19881,
2231,
405,
1120,
66,
1731,
12865,
2780,
3256,
198,
220,
220,
220,
220,
220,
269,
7890,
62,
40869,
41876,
264,
313,
81,
62,
1102,
66,
26173,
8924,
705,
1065,
1433,
69,
3070,
22914,
344,
1157,
1765,
19881,
3510,
405,
1120,
66,
1731,
12865,
2780,
3256,
198,
220,
220,
220,
220,
220,
3084,
62,
40869,
41876,
264,
313,
81,
62,
1102,
66,
26173,
8924,
705,
1065,
1433,
69,
3070,
22914,
344,
1157,
1765,
19881,
2857,
405,
1120,
66,
1731,
12865,
2780,
3256,
198,
220,
220,
220,
220,
220,
2245,
62,
36948,
220,
220,
220,
220,
41876,
264,
313,
81,
62,
1102,
66,
26173,
8924,
705,
1065,
1433,
69,
3070,
22914,
344,
1157,
1765,
19881,
2780,
405,
1120,
66,
1731,
12865,
2780,
3256,
198,
220,
220,
220,
23578,
3963,
50115,
62,
48277,
764,
198,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
347,
43312,
3963,
50115,
62,
31448,
11,
198,
220,
220,
220,
220,
220,
2081,
220,
41876,
1976,
361,
62,
70,
926,
62,
6448,
62,
891,
62,
19199,
14804,
14981,
62,
31448,
26173,
8924,
705,
51,
3256,
198,
220,
220,
220,
220,
220,
3991,
41876,
1976,
361,
62,
70,
926,
62,
6448,
62,
891,
62,
19199,
14804,
14981,
62,
31448,
26173,
8924,
705,
37,
3256,
198,
220,
220,
220,
23578,
3963,
50115,
62,
31448,
764,
198,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
347,
43312,
3963,
50115,
62,
3803,
62,
14171,
11,
198,
220,
220,
220,
220,
220,
7550,
220,
220,
220,
41876,
2325,
74,
89,
62,
67,
26173,
8924,
705,
40,
3256,
198,
220,
220,
220,
220,
220,
4296,
220,
220,
220,
41876,
2325,
74,
89,
62,
67,
26173,
8924,
705,
52,
3256,
198,
220,
220,
220,
220,
220,
12233,
220,
220,
220,
41876,
2325,
74,
89,
62,
67,
26173,
8924,
705,
35,
3256,
198,
220,
220,
220,
220,
220,
28721,
41876,
2325,
74,
89,
62,
67,
26173,
8924,
705,
51,
3256,
198,
220,
220,
220,
23578,
3963,
50115,
62,
3803,
62,
14171,
764,
198,
220,
7102,
2257,
1565,
4694,
269,
85,
62,
64,
313,
41876,
4731,
26173,
8924,
705,
32,
2394,
6,
22492,
15285,
62,
32541,
13,
198,
220,
7102,
2257,
1565,
4694,
269,
85,
62,
9806,
62,
437,
62,
4475,
41876,
1220,
82,
2373,
40914,
14,
83,
312,
62,
437,
62,
4475,
62,
912,
17946,
26173,
8924,
705,
15,
24214,
1065,
3132,
10535,
6,
22492,
15285,
62,
32541,
13,
198,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
class zcl_mail_static definition
public
final
create public .
*"* public components of class ZCL_MAIL_STATIC
*"* do not include other source files here!!!
public section.
constants default_sender type string value '[email protected]' ##NO_TEXT.
class-methods send
importing
!i_from type simple default default_sender
!i_to type simple
!i_subject type simple
!i_message type simple
!it_attachments type zifiles optional
!i_immediately type abap_bool default abap_true
!i_express type abap_bool default abap_true
!i_commit type abap_bool default abap_false
raising
zcx_generic .
class-methods send_mass
importing
!i_from type simple default default_sender
!it_to type stringtab
!i_subject type simple
!i_message type simple
!it_attachments type zifiles
!i_commit type abap_bool default abap_false
raising
zcx_generic .
class-methods send_by_user
importing
!i_from type simple default default_sender
!i_user type simple default sy-uname
!i_subject type simple
!i_message type simple
!it_attachments type zifiles optional
!i_commit type abap_bool default abap_false
raising
zcx_generic .
class-methods send_by_users
importing
!i_from type simple default default_sender
!it_users type stringtab
!i_subject type simple
!i_message type simple
!it_attachments type zifiles optional
!i_commit type abap_bool default abap_false
raising
zcx_generic .
protected section.
*"* protected components of class ZCL_MAIL_STATIC
*"* do not include other source files here!!!
private section.
*"* private components of class ZCL_MAIL_STATIC
*"* do not include other source files here!!!
ENDCLASS.
CLASS ZCL_MAIL_STATIC IMPLEMENTATION.
method send.
data l_from type string.
l_from = i_from.
if l_from is initial.
l_from = sy-uname.
endif.
data l_to type string.
l_to = i_to.
if l_to is initial.
return.
endif.
data l_subject type so_obj_des.
l_subject = i_subject.
data l_html type string.
l_html = '<!DOCTYPE html><html><meta charset="utf-8"><head></head><body>%BODY%</body></html>'. "#EC NOTEXT
replace '%BODY%' in l_html with i_message.
do.
data l_offset type i.
l_offset = ( sy-index - 1 ) * 255.
try.
data lt_html type soli_tab.
data ls_html like line of lt_html.
ls_html-line = l_html+l_offset.
insert ls_html into table lt_html.
catch cx_root.
exit.
endtry.
enddo.
" Get Business Communication Service
try.
data lr_bcs type ref to cl_bcs.
lr_bcs = cl_bcs=>create_persistent( ).
data lx_root type ref to cx_root.
catch cx_root into lx_root.
zcx_generic=>raise( ix_root = lx_root ).
endtry.
" Create multirelated
data lr_multi type ref to cl_gbt_multirelated_service.
create object lr_multi.
lr_multi->set_main_html( lt_html ).
" Create document
try.
data lr_document type ref to cl_document_bcs.
lr_document =
cl_document_bcs=>create_from_multirelated(
i_subject = l_subject
i_multirel_service = lr_multi ).
catch cx_root into lx_root.
zcx_generic=>raise( ix_root = lx_root ).
endtry.
" Set document
try.
lr_bcs->set_document( lr_document ).
catch cx_root into lx_root.
zcx_generic=>raise( ix_root = lx_root ).
endtry.
" Create sender
find '@' in l_from.
if sy-subrc eq 0.
data l_email type ad_smtpadr.
l_email = l_from.
try.
data lr_sender type ref to if_sender_bcs.
lr_sender = cl_cam_address_bcs=>create_internet_address( l_email ).
catch cx_root into lx_root.
zcx_generic=>raise( ix_root = lx_root ).
endtry.
else.
data l_user type uname.
l_user = l_from.
try.
lr_sender = cl_sapuser_bcs=>create( l_user ).
catch cx_root into lx_root.
zcx_generic=>raise( ix_root = lx_root ).
endtry.
endif.
" Set sender
try.
lr_bcs->set_sender( lr_sender ).
catch cx_root into lx_root.
zcx_generic=>raise( ix_root = lx_root ).
endtry.
" Create recipient
find '@' in l_to.
if sy-subrc eq 0.
l_email = l_to.
try.
data lr_recipient type ref to if_recipient_bcs.
lr_recipient = cl_cam_address_bcs=>create_internet_address( l_email ).
catch cx_root into lx_root.
zcx_generic=>raise( ix_root = lx_root ).
endtry.
else.
l_user = l_to.
try.
lr_recipient = cl_sapuser_bcs=>create( l_user ).
catch cx_root into lx_root.
zcx_generic=>raise( ix_root = lx_root ).
endtry.
endif.
" Set recipient
try.
lr_bcs->add_recipient(
i_recipient = lr_recipient
i_express = i_express ).
catch cx_root into lx_root.
zcx_generic=>raise( ix_root = lx_root ).
endtry.
" Attach attachment
field-symbols <ls_attachment> like line of it_attachments.
loop at it_attachments assigning <ls_attachment>.
data l_size type i.
l_size = xstrlen( <ls_attachment>-data ).
data lt_solix type solix_tab.
clear lt_solix.
zcl_convert_static=>xtext2xtable(
exporting i_data = <ls_attachment>-data
importing et_data = lt_solix ).
*** lt_solix = cl_document_bcs=>xstring_to_solix( <ls_attachment>-data ).
data l_attachment_subject type sood-objdes.
l_attachment_subject = <ls_attachment>-name.
data l_attachment_type type soodk-objtp.
l_attachment_type = 'BIN'.
if l_size ne 0.
data l_attachment_size type so_obj_len.
l_attachment_size = zcl_abap_static=>value2text( l_size ).
endif.
data lt_attachment_header type soli_tab.
field-symbols <l_attachment_header> like line of lt_attachment_header.
append initial line to lt_attachment_header assigning <l_attachment_header>.
<l_attachment_header>-line = '&SO_FILENAME=' && <ls_attachment>-name.
append initial line to lt_attachment_header assigning <l_attachment_header>.
<l_attachment_header>-line = '&SO_FORMAT=BIN'.
try.
lr_document->add_attachment(
i_attachment_subject = l_attachment_subject
i_attachment_type = l_attachment_type
i_attachment_size = l_attachment_size
i_attachment_header = lt_attachment_header
i_att_content_hex = lt_solix ).
catch cx_root into lx_root.
zcx_generic=>raise( ix_root = lx_root ).
endtry.
endloop.
" Set send immediately
try.
lr_bcs->set_send_immediately( i_immediately ).
catch cx_root into lx_root.
zcx_generic=>raise( ix_root = lx_root ).
endtry.
" Send
try.
lr_bcs->send( ).
catch cx_root into lx_root.
zcx_generic=>raise( ix_root = lx_root ).
endtry.
if i_commit eq abap_true.
zcl_abap_static=>commit( ).
endif.
endmethod.
method send_by_user.
data l_email type string.
l_email = zcl_user_static=>get_email( i_user ).
check l_email is not initial.
data l_name type string.
l_name = zcl_user_static=>get_name( i_user ).
data l_message type string.
l_message = i_message.
replace '%NAME%' in l_message with l_name.
replace '%FIO%' in l_message with l_name.
send(
i_from = i_from
i_to = l_email
i_subject = i_subject
i_message = l_message
it_attachments = it_attachments
i_commit = i_commit ).
endmethod.
method send_by_users.
data lt_users like it_users.
lt_users = it_users.
sort lt_users.
delete adjacent duplicates from lt_users.
data l_user like line of lt_users.
loop at lt_users into l_user.
send_by_user(
i_from = i_from
i_user = l_user
i_subject = i_subject
i_message = i_message
it_attachments = it_attachments
i_commit = abap_false ).
endloop.
if i_commit eq abap_true.
zcl_abap_static=>commit( ).
endif.
endmethod.
method send_mass.
data l_to like line of it_to.
loop at it_to into l_to.
send(
i_from = i_from
i_to = l_to
i_subject = i_subject
i_message = i_message
it_attachments = it_attachments
i_commit = abap_false ).
endloop.
if i_commit eq abap_true.
zcl_abap_static=>commit( ).
endif.
endmethod.
ENDCLASS.
| [
4871,
1976,
565,
62,
4529,
62,
12708,
6770,
198,
220,
1171,
198,
220,
2457,
198,
220,
2251,
1171,
764,
198,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1168,
5097,
62,
5673,
4146,
62,
35744,
2149,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
220,
1171,
2665,
13,
628,
220,
220,
220,
38491,
4277,
62,
82,
2194,
2099,
4731,
1988,
705,
10951,
31,
39722,
13,
785,
6,
22492,
15285,
62,
32541,
13,
628,
220,
220,
220,
1398,
12,
24396,
82,
3758,
198,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
6738,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
2829,
4277,
4277,
62,
82,
2194,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
1462,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
2829,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
32796,
220,
220,
220,
220,
220,
2099,
2829,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
20500,
220,
220,
220,
220,
220,
2099,
2829,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
47348,
902,
2099,
1976,
361,
2915,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
320,
23802,
220,
2099,
450,
499,
62,
30388,
4277,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
42712,
220,
220,
220,
220,
220,
2099,
450,
499,
62,
30388,
4277,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
41509,
220,
220,
220,
220,
220,
220,
2099,
450,
499,
62,
30388,
4277,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
41357,
764,
198,
220,
220,
220,
1398,
12,
24396,
82,
3758,
62,
22208,
198,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
6738,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
2829,
4277,
4277,
62,
82,
2194,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
1462,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
4731,
8658,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
32796,
220,
220,
220,
220,
220,
2099,
2829,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
20500,
220,
220,
220,
220,
220,
2099,
2829,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
47348,
902,
2099,
1976,
361,
2915,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
41509,
220,
220,
220,
220,
220,
220,
2099,
450,
499,
62,
30388,
4277,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
41357,
764,
198,
220,
220,
220,
1398,
12,
24396,
82,
3758,
62,
1525,
62,
7220,
198,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
6738,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
2829,
4277,
4277,
62,
82,
2194,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
7220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
2829,
4277,
827,
12,
403,
480,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
32796,
220,
220,
220,
220,
220,
2099,
2829,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
20500,
220,
220,
220,
220,
220,
2099,
2829,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
47348,
902,
2099,
1976,
361,
2915,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
41509,
220,
220,
220,
220,
220,
220,
2099,
450,
499,
62,
30388,
4277,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
41357,
764,
198,
220,
220,
220,
1398,
12,
24396,
82,
3758,
62,
1525,
62,
18417,
198,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
6738,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
2829,
4277,
4277,
62,
82,
2194,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
18417,
220,
220,
220,
220,
220,
220,
2099,
4731,
8658,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
32796,
220,
220,
220,
220,
220,
2099,
2829,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
20500,
220,
220,
220,
220,
220,
2099,
2829,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
47348,
902,
2099,
1976,
361,
2915,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
72,
62,
41509,
220,
220,
220,
220,
220,
220,
2099,
450,
499,
62,
30388,
4277,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
41357,
764,
198,
220,
6861,
2665,
13,
198,
9,
1,
9,
6861,
6805,
286,
1398,
1168,
5097,
62,
5673,
4146,
62,
35744,
2149,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
220,
2839,
2665,
13,
198,
9,
1,
9,
2839,
6805,
286,
1398,
1168,
5097,
62,
5673,
4146,
62,
35744,
2149,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
5673,
4146,
62,
35744,
2149,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
2446,
3758,
13,
628,
220,
220,
220,
1366,
300,
62,
6738,
2099,
4731,
13,
198,
220,
220,
220,
300,
62,
6738,
220,
796,
1312,
62,
6738,
13,
628,
220,
220,
220,
611,
300,
62,
6738,
318,
4238,
13,
198,
220,
220,
220,
220,
220,
300,
62,
6738,
796,
827,
12,
403,
480,
13,
198,
220,
220,
220,
45762,
13,
628,
220,
220,
220,
1366,
300,
62,
1462,
2099,
4731,
13,
198,
220,
220,
220,
300,
62,
1462,
220,
796,
1312,
62,
1462,
13,
628,
220,
220,
220,
611,
300,
62,
1462,
318,
4238,
13,
198,
220,
220,
220,
220,
220,
1441,
13,
198,
220,
220,
220,
45762,
13,
628
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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ACES if_oo_adt_intrnl_classrun.
ALIASES write FOR if_oo_adt_intrnl_classrun~write .
ALIASES write_data FOR if_oo_adt_intrnl_classrun~write_data .
ALIASES write_text FOR if_oo_adt_intrnl_classrun~write_text .
ALIASES display FOR if_oo_adt_intrnl_classrun~display .
ALIASES begin_section FOR if_oo_adt_intrnl_classrun~begin_section.
ALIASES end_section FOR if_oo_adt_intrnl_classrun~end_section .
ALIASES line FOR if_oo_adt_intrnl_classrun~line .
ALIASES next_section FOR if_oo_adt_intrnl_classrun~next_section .
ALIASES get FOR if_oo_adt_intrnl_classrun~get .
ENDINTERFACE.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
11627,
1631,
5984,
51,
8624,
3556,
79,
29,
198,
41358,
49836,
1976,
361,
62,
324,
83,
1102,
198,
220,
44731,
764,
198,
220,
23255,
37,
2246,
1546,
611,
62,
2238,
62,
324,
83,
62,
600,
81,
21283,
62,
4871,
5143,
13,
628,
220,
8355,
43429,
1546,
3551,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
611,
62,
2238,
62,
324,
83,
62,
600,
81,
21283,
62,
4871,
5143,
93,
13564,
220,
220,
220,
220,
220,
220,
220,
764,
198,
220,
8355,
43429,
1546,
3551,
62,
7890,
220,
220,
220,
220,
7473,
611,
62,
2238,
62,
324,
83,
62,
600,
81,
21283,
62,
4871,
5143,
93,
13564,
62,
7890,
220,
220,
764,
198,
220,
8355,
43429,
1546,
3551,
62,
5239,
220,
220,
220,
220,
7473,
611,
62,
2238,
62,
324,
83,
62,
600,
81,
21283,
62,
4871,
5143,
93,
13564,
62,
5239,
220,
220,
764,
198,
220,
8355,
43429,
1546,
3359,
220,
220,
220,
220,
220,
220,
220,
7473,
611,
62,
2238,
62,
324,
83,
62,
600,
81,
21283,
62,
4871,
5143,
93,
13812,
220,
220,
220,
220,
220,
764,
198,
220,
8355,
43429,
1546,
2221,
62,
5458,
220,
7473,
611,
62,
2238,
62,
324,
83,
62,
600,
81,
21283,
62,
4871,
5143,
93,
27471,
62,
5458,
13,
198,
220,
8355,
43429,
1546,
886,
62,
5458,
220,
220,
220,
7473,
611,
62,
2238,
62,
324,
83,
62,
600,
81,
21283,
62,
4871,
5143,
93,
437,
62,
5458,
220,
764,
198,
220,
8355,
43429,
1546,
1627,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
611,
62,
2238,
62,
324,
83,
62,
600,
81,
21283,
62,
4871,
5143,
93,
1370,
220,
220,
220,
220,
220,
220,
220,
220,
764,
198,
220,
8355,
43429,
1546,
1306,
62,
5458,
220,
220,
7473,
611,
62,
2238,
62,
324,
83,
62,
600,
81,
21283,
62,
4871,
5143,
93,
19545,
62,
5458,
764,
198,
220,
8355,
43429,
1546,
651,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
611,
62,
2238,
62,
324,
83,
62,
600,
81,
21283,
62,
4871,
5143,
93,
1136,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
198,
10619,
41358,
49836,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS lhc_Contactlist DEFINITION INHERITING FROM cl_abap_behavior_handler.
PUBLIC SECTION.
PRIVATE SECTION.
METHODS notifyContact FOR MODIFY
IMPORTING keys FOR ACTION ContactlistEntity~notifyContact RESULT result.
METHODS validate_contactlist FOR VALIDATE ON SAVE
IMPORTING keys
FOR ContactlistEntity~validateContactlist.
ENDCLASS.
CLASS lhc_Contactlist IMPLEMENTATION.
METHOD notifyContact.
" Read changed data for action result
READ ENTITIES OF zcct_i_contactlist IN LOCAL MODE
ENTITY ContactlistEntity
FIELDS ( contactlist_id
casefile_id
contact_firstname
contact_lastname
contact_telephone_number_1
contact_telephone_number_2
contact_telephone_number_3
contact_mail_address
contact_address_street
contact_address_plz
contact_address_city
contact_address_country
contact_address_housenumber
contact_has_been_notified
)
WITH VALUE #( FOR key IN keys ( contactlist_id = key-contactlist_id ) )
RESULT DATA(lt_contact).
result = VALUE #( FOR contact IN lt_contact ( contactlist_id = contact-contactlist_id
%param = contact ) ).
DATA container TYPE zcl_test_contactperson=>ty_struct.
LOOP AT lt_contact INTO DATA(con).
IF con-contact_has_been_notified = abap_true.
CONTINUE.
ENDIF.
container = VALUE zcl_test_contactperson=>ty_struct(
contact_firstname = con-contact_firstname
contact_lastname = con-contact_lastname
contact_address_country = con-contact_address_country
contact_address_city = con-contact_address_city
contact_address_plz = con-contact_address_plz
contact_address_street = con-contact_address_street
contact_address_housenumber = con-contact_address_housenumber
contact_mail_address = con-contact_mail_address
contact_telephone_number_1 = con-contact_telephone_number_1
contact_telephone_number_2 = con-contact_telephone_number_2
contact_telephone_number_3 = con-contact_telephone_number_3
contact_has_been_notified = COND i( WHEN con-contact_has_been_notified = abap_true THEN 0
ELSE 0 )
).
zcl_test_contactperson=>notifyContactpersons( iv_struct = container ).
ENDLOOP.
" Modify in local mode: BO-related updates that are not relevant for authorization checks
MODIFY ENTITIES OF zcct_i_contactlist IN LOCAL MODE
ENTITY ContactlistEntity
UPDATE FIELDS ( contact_has_been_notified )
WITH VALUE #( FOR key IN keys ( contactlist_id = key-contactlist_id
contact_has_been_notified = 'X' ) ) " Accepted
FAILED failed
REPORTED reported.
ENDMETHOD.
METHOD validate_contactlist.
"Read Contact
READ ENTITIES OF zcct_i_contactlist IN LOCAL MODE
ENTITY ContactlistEntity
FROM VALUE #(
FOR ls_key
IN keys ( %key-contactlist_id = ls_key-contactlist_id
%control = VALUE #( contactlist_id = if_abap_behv=>mk-on
contact_firstname = if_abap_behv=>mk-on
contact_lastname = if_abap_behv=>mk-on
casefile_id = if_abap_behv=>mk-on ) ) )
RESULT DATA(lt_contactlist).
* " Check if casefile ID exist
SELECT FROM zcct_i_casefile
FIELDS casefile_id
FOR ALL ENTRIES IN @lt_contactlist
WHERE casefile_id = @lt_contactlist-casefile_id
INTO TABLE @DATA(lt_casefile_db).
" Raise msg for non existing customer id
LOOP AT lt_contactlist INTO DATA(lt_contact).
" Check associated with casefile
IF lt_contact-casefile_id IS NOT INITIAL AND NOT line_exists( lt_casefile_db[ casefile_id = lt_contact-casefile_id ] ).
APPEND VALUE #( contactlist_id = lt_contact-contactlist_id ) TO failed-ContactlistEntity.
APPEND VALUE #( contactlist_id = lt_contact-contactlist_id
%msg = new_message( id = zif_cct_messages=>msgid
number = zif_cct_messages=>msgno-associated_casefile_not_valid
v1 = lt_contact-casefile_id
severity = if_abap_behv_message=>severity-error )
%element-casefile_id = if_abap_behv=>mk-on ) TO reported-ContactlistEntity.
ENDIF.
"Check first name
IF lt_contact-contact_firstname IS INITIAL.
APPEND VALUE #( contactlist_id = lt_contact-contactlist_id ) TO failed-ContactlistEntity.
APPEND VALUE #( contactlist_id = lt_contact-contactlist_id
%msg = new_message( id = zif_cct_messages=>msgid
number = zif_cct_messages=>msgno-first_name_required
severity = if_abap_behv_message=>severity-error )
%element-contact_firstname = if_abap_behv=>mk-on ) TO reported-ContactlistEntity.
ENDIF.
"Check last name
IF lt_contact-contact_lastname IS INITIAL.
APPEND VALUE #( contactlist_id = lt_contact-contactlist_id ) TO failed-ContactlistEntity.
APPEND VALUE #( contactlist_id = lt_contact-contactlist_id
%msg = new_message( id = zif_cct_messages=>msgid
number = zif_cct_messages=>msgno-last_name_required
severity = if_abap_behv_message=>severity-error )
%element-contact_lastname = if_abap_behv=>mk-on ) TO reported-ContactlistEntity.
ENDIF.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
71,
66,
62,
17829,
4868,
5550,
20032,
17941,
3268,
16879,
2043,
2751,
16034,
537,
62,
397,
499,
62,
46571,
62,
30281,
13,
198,
220,
44731,
44513,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
19361,
17829,
7473,
19164,
5064,
56,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
8251,
7473,
40282,
14039,
4868,
32398,
93,
1662,
1958,
17829,
15731,
16724,
1255,
13,
198,
220,
220,
220,
337,
36252,
50,
26571,
62,
32057,
4868,
220,
220,
220,
220,
220,
220,
220,
7473,
26173,
2389,
6158,
6177,
14719,
6089,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
8251,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
14039,
4868,
32398,
93,
12102,
378,
17829,
4868,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
71,
66,
62,
17829,
4868,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
19361,
17829,
13,
628,
220,
220,
220,
366,
4149,
3421,
1366,
329,
2223,
1255,
198,
220,
220,
220,
20832,
47353,
30383,
3963,
1976,
66,
310,
62,
72,
62,
32057,
4868,
3268,
37347,
1847,
337,
16820,
198,
220,
220,
220,
220,
220,
220,
220,
220,
47353,
9050,
14039,
4868,
32398,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18930,
3698,
5258,
357,
2800,
4868,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1339,
7753,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
11085,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
12957,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
46813,
4862,
62,
17618,
62,
16,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
46813,
4862,
62,
17618,
62,
17,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
46813,
4862,
62,
17618,
62,
18,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
4529,
62,
21975,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
21975,
62,
25662,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
21975,
62,
489,
89,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
21975,
62,
19205,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
21975,
62,
19315,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
21975,
62,
71,
516,
268,
4494,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
10134,
62,
47436,
62,
1662,
1431,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
26173,
8924,
1303,
7,
7473,
1994,
3268,
8251,
357,
2800,
4868,
62,
312,
796,
1994,
12,
32057,
4868,
62,
312,
1267,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
15731,
16724,
42865,
7,
2528,
62,
32057,
737,
628,
220,
220,
220,
1255,
796,
26173,
8924,
1303,
7,
7473,
2800,
3268,
300,
83,
62,
32057,
357,
2800,
4868,
62,
312,
796,
2800,
12,
32057,
4868,
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,
4064,
17143,
220,
220,
220,
796,
2800,
1267,
6739,
628,
198,
220,
220,
220,
42865,
9290,
41876,
1976,
565,
62,
9288,
62,
32057,
6259,
14804,
774,
62,
7249,
13,
198,
220,
220,
220,
17579,
3185,
5161,
220,
300,
83,
62,
32057,
39319,
42865,
7,
1102,
737,
198,
220,
220,
220,
220,
220,
16876,
369,
12,
32057,
62,
10134,
62,
47436,
62,
1662,
1431,
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,
198,
220,
220,
220,
220,
220,
9290,
796,
26173,
8924,
1976,
565,
62,
9288,
62,
32057,
6259,
14804,
774,
62,
7249,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
11085,
3672,
796,
369,
12,
32057,
62,
11085,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
12957,
3672,
796,
369,
12,
32057,
62,
12957,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
21975,
62,
19315,
796,
369,
12,
32057,
62,
21975,
62,
19315,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
21975,
62,
19205,
796,
369,
12,
32057,
62,
21975,
62,
19205,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
21975,
62,
489,
89,
796,
369,
12,
32057,
62,
21975,
62,
489,
89,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
21975,
62,
25662,
796,
369,
12,
32057,
62,
21975,
62,
25662,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
21975,
62,
71,
516,
268,
4494,
796,
369,
12,
32057,
62,
21975,
62,
71,
516,
268,
4494,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2800,
62,
4529,
62,
21975,
796,
369,
12,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
INTERFACE if_http_response PUBLIC.
INTERFACES if_http_entity.
TYPES: ty_fields TYPE STANDARD TABLE OF string WITH DEFAULT KEY.
METHODS:
get_header_fields
CHANGING
fields TYPE ty_fields,
set_status
IMPORTING
code TYPE i
reason TYPE string,
set_cdata
IMPORTING data TYPE string,
set_data
IMPORTING data TYPE string,
redirect
IMPORTING
url TYPE string
permanently TYPE i OPTIONAL
protocol_dependent TYPE i OPTIONAL,
get_data
RETURNING VALUE(val) TYPE xstring,
get_cdata
RETURNING VALUE(val) TYPE string,
set_cookie
IMPORTING
name TYPE string
value TYPE string
path TYPE string OPTIONAL
domain TYPE string OPTIONAL
expires TYPE string OPTIONAL
secure TYPE i OPTIONAL,
set_compression,
set_header_field
IMPORTING
name TYPE string
value TYPE string,
get_header_field
IMPORTING name TYPE string
RETURNING VALUE(val) TYPE string,
get_content_type
RETURNING VALUE(val) TYPE string,
set_content_type
IMPORTING type TYPE string,
get_raw_message
RETURNING VALUE(val) TYPE xstring,
get_multipart
IMPORTING index TYPE string
RETURNING VALUE(entity) TYPE REF TO if_http_entity,
num_multiparts
RETURNING VALUE(num) TYPE string,
delete_header_field
IMPORTING
name TYPE string,
delete_cookie_at_client
IMPORTING
name TYPE string
path TYPE string OPTIONAL
domain TYPE string OPTIONAL,
get_status
EXPORTING
code TYPE i
reason TYPE string.
ENDINTERFACE. | [
41358,
49836,
611,
62,
4023,
62,
26209,
44731,
13,
198,
220,
23255,
37,
2246,
1546,
611,
62,
4023,
62,
26858,
13,
628,
220,
24412,
47,
1546,
25,
1259,
62,
25747,
41876,
49053,
9795,
43679,
3963,
4731,
13315,
5550,
38865,
35374,
13,
628,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
651,
62,
25677,
62,
25747,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
7032,
41876,
1259,
62,
25747,
11,
198,
220,
220,
220,
900,
62,
13376,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
2438,
220,
220,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
1738,
41876,
4731,
11,
198,
220,
220,
220,
900,
62,
66,
7890,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
1366,
41876,
4731,
11,
198,
220,
220,
220,
900,
62,
7890,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
1366,
41876,
4731,
11,
198,
220,
220,
220,
18941,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
19016,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
15043,
41876,
1312,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
8435,
62,
21186,
41876,
1312,
39852,
2849,
1847,
11,
198,
220,
220,
220,
651,
62,
7890,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
2100,
8,
41876,
2124,
8841,
11,
198,
220,
220,
220,
651,
62,
66,
7890,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
2100,
8,
41876,
4731,
11,
198,
220,
220,
220,
900,
62,
44453,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
3108,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
7386,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
27396,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
5713,
41876,
1312,
39852,
2849,
1847,
11,
198,
220,
220,
220,
900,
62,
5589,
2234,
11,
198,
220,
220,
220,
900,
62,
25677,
62,
3245,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
41876,
4731,
11,
198,
220,
220,
220,
651,
62,
25677,
62,
3245,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
1438,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
2100,
8,
41876,
4731,
11,
198,
220,
220,
220,
651,
62,
11299,
62,
4906,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
2100,
8,
41876,
4731,
11,
198,
220,
220,
220,
900,
62,
11299,
62,
4906,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
2099,
41876,
4731,
11,
198,
220,
220,
220,
651,
62,
1831,
62,
20500,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
2100,
8,
41876,
2124,
8841,
11,
198,
220,
220,
220,
651,
62,
16680,
541,
433,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
6376,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
26858,
8,
41876,
4526,
37,
5390,
611,
62,
4023,
62,
26858,
11,
198,
220,
220,
220,
997,
62,
16680,
541,
5889,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
22510,
8,
41876,
4731,
11,
198,
220,
220,
220,
12233,
62,
25677,
62,
3245,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
41876,
4731,
11,
198,
220,
220,
220,
12233,
62,
44453,
62,
265,
62,
16366,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
3108,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
7386,
41876,
4731,
39852,
2849,
1847,
11,
198,
220,
220,
220,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class ZSAPLINK_SMARTFORM definition
public
inheriting from ZSAPLINK
final
create public .
public section.
methods CHECKEXISTS
redefinition .
methods CREATEIXMLDOCFROMOBJECT
redefinition .
methods CREATEOBJECTFROMIXMLDOC
redefinition .
protected section.
methods DELETEOBJECT
redefinition .
methods GETOBJECTTYPE
redefinition .
private section.
endclass. "ZSAPLINK_SMARTFORM definition
*----------------------------------------------------------------------*
* class ZSAPLINK_SMARTFORM implementation.
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class ZSAPLINK_SMARTFORM implementation.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version. |
*| |
*| SAPlink is distributed in the hope that it will be useful, |
*| but WITHOUT ANY WARRANTY; without even the implied warranty of |
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
*| GNU General Public License for more details. |
*| |
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the |
*| Free Software Foundation, Inc., |
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
*\---------------------------------------------------------------------/
METHOD checkexists .
SELECT SINGLE formname FROM stxfadm INTO objname WHERE formname = objname.
IF sy-subrc = 0.
exists = 'X'.
ENDIF.
ENDMETHOD.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version. |
*| |
*| SAPlink is distributed in the hope that it will be useful, |
*| but WITHOUT ANY WARRANTY; without even the implied warranty of |
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
*| GNU General Public License for more details. |
*| |
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the |
*| Free Software Foundation, Inc., |
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
*\---------------------------------------------------------------------/
METHOD createixmldocfromobject .
DATA rootnode TYPE REF TO if_ixml_element.
DATA sourcenode TYPE REF TO if_ixml_element.
DATA rc TYPE sysubrc.
DATA sourcestring TYPE string.
DATA _objtype TYPE string.
DATA: l_filename TYPE string,
l_file_filter TYPE string,
l_user_action TYPE i.
DATA: wa_node type ssfgnode,
l_element TYPE REF TO if_ixml_element.
DATA: l_language_str TYPE string,
l_language(2) TYPE c.
DATA: l_lines TYPE i,
l_splitted_name_tab TYPE TABLE OF string.
DATA: l_stylename TYPE tdssname,
l_stylevari TYPE tdvariant,
l_save_style TYPE tdssname.
TYPES: t_raw(250) TYPE x.
CONSTANTS: c_xml_ns_uri_sf(255) TYPE c
VALUE 'urn:sap-com:SmartForms:2000:internal-structure',"#EC NOTEXT
c_xml_ns_uri_ifr(255) TYPE c
VALUE 'urn:sap-com:sdixml-ifr:2000'. "#EC NOTEXT
DATA: g_ixml TYPE REF TO if_ixml,
xml_macro_rc TYPE i,
xml_document TYPE REF TO if_ixml_document,
xml_ns_prefix_sf TYPE string,
xml_ns_uri_sf TYPE string,
xml_ns_uri_ifr TYPE string,
xml_document_size TYPE i,
xml_xtable TYPE TABLE OF t_raw,
xml_xtable2 TYPE TABLE OF string,
sform_name TYPE tdsfname.
DATA ref_ssf TYPE REF TO cl_ssf_fb_smart_form.
sform_name = objname.
IF g_ixml IS INITIAL.
g_ixml = cl_ixml=>create( ).
ENDIF.
xml_document = g_ixml->create_document( ).
xml_ns_prefix_sf = 'sf'.
xml_ns_uri_sf = c_xml_ns_uri_sf.
xml_ns_uri_ifr = c_xml_ns_uri_ifr.
CLEAR: xml_document_size, xml_xtable[], xml_xtable2[].
CREATE OBJECT ref_ssf.
TRY.
CALL METHOD ref_ssf->load
EXPORTING
im_formname = sform_name.
ref_ssf->xml_init( ).
CALL METHOD ref_ssf->xml_download
EXPORTING
parent = xml_document
CHANGING
document = xml_document.
* namespace
l_element = xml_document->get_root_element( ).
l_element->set_attribute( name = xml_ns_prefix_sf
namespace = 'xmlns'
value = xml_ns_uri_sf ).
l_element->set_attribute( name = 'xmlns'
value = xml_ns_uri_ifr ).
* language
WRITE sy-langu TO l_language.
l_language_str = l_language.
xml_macro_rc = l_element->set_attribute(
name = 'language'
namespace = xml_ns_prefix_sf
value = l_language_str ).
* convert DOM to xml
CALL FUNCTION 'SDIXML_DOM_TO_XML'
EXPORTING
document = xml_document
IMPORTING
size = xml_document_size
TABLES
xml_as_table = xml_xtable
EXCEPTIONS
OTHERS = 1.
CHECK sy-subrc EQ 0.
_objtype = getobjecttype( ).
rootnode = xmldoc->create_element( _objtype ).
DATA: wa_stxfadm TYPE stxfadm.
SELECT SINGLE * FROM stxfadm INTO wa_stxfadm WHERE formname = objname.
setattributesfromstructure( node = rootnode structure = wa_stxfadm
).
sourcenode = xmldoc->create_element( 'smartform' ).
xml_xtable2 = xml_xtable[].
sourcestring = buildsourcestring( sourcetable = xml_xtable2[] ).
rc = sourcenode->if_ixml_node~set_value( sourcestring ).
rc = rootnode->append_child( sourcenode ).
rc = xmldoc->append_child( rootnode ).
ixmldocument = xmldoc.
FREE: xml_document, xml_xtable[], xml_document_size.
CATCH cx_ssf_fb .
CLEAR ixmldocument.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>not_found.
ENDTRY.
ENDMETHOD.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version. |
*| |
*| SAPlink is distributed in the hope that it will be useful, |
*| but WITHOUT ANY WARRANTY; without even the implied warranty of |
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
*| GNU General Public License for more details. |
*| |
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the |
*| Free Software Foundation, Inc., |
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
*\---------------------------------------------------------------------/
METHOD createobjectfromixmldoc .
TYPES: t_raw(250) TYPE x.
DATA rootnode TYPE REF TO if_ixml_element.
DATA progattribs TYPE trdir.
DATA sourcenode TYPE REF TO if_ixml_element.
DATA l_xml_node TYPE REF TO if_ixml_element.
DATA source TYPE string.
DATA sourcetable TYPE table_of_strings.
DATA _objtype TYPE string.
DATA checkexists TYPE flag.
DATA: wa_stxfadm TYPE stxfadm,
formname TYPE tdsfname,
master_language TYPE sylangu,
lv_devclass TYPE devclass,
korrnum TYPE trkorr,
modif_language TYPE sylangu.
DATA: g_ixml TYPE REF TO if_ixml,
xml_macro_rc TYPE i,
xml_document TYPE REF TO if_ixml_document,
l_element TYPE REF TO if_ixml_element,
xml_ns_prefix_sf TYPE string,
xml_ns_uri_sf TYPE string,
xml_ns_uri_ifr TYPE string,
xml_document_size TYPE i,
xml_xtable TYPE TABLE OF t_raw,
l_ns_uri TYPE string,
l_name TYPE string,
l_language TYPE string,
p_dequeue TYPE tdbool,
l_cancel TYPE tdsfflag,
sf_exception TYPE REF TO cx_ssf_fb.
DATA: ref_ssf TYPE REF TO cl_ssf_fb_smart_form,
l_upload_smartform TYPE REF TO cl_ssf_fb_smart_form.
_objtype = getobjecttype( ).
xmldoc = ixmldocument.
rootnode = xmldoc->find_from_name( _objtype ).
CALL METHOD getstructurefromattributes
EXPORTING
node = rootnode
CHANGING
structure = wa_stxfadm.
objname = wa_stxfadm-formname.
checkexists = checkexists( ).
IF checkexists IS NOT INITIAL.
IF overwrite IS INITIAL.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING textid = zcx_saplink=>existing.
ELSE.
* delete object for new install
deleteobject( ).
ENDIF.
ENDIF.
sourcenode = rootnode->find_from_name( 'smartform' ).
source = sourcenode->get_value( ).
sourcetable = buildtablefromstring( source ).
xml_xtable = sourcetable.
xml_document_size = STRLEN( source ).
CREATE OBJECT ref_ssf.
formname = objname.
* Check access permission and enqueue smart form
master_language = sy-langu.
TRY.
CALL METHOD ref_ssf->enqueue
EXPORTING
suppress_corr_check = space
language_upd_exit = ' '
master_language = master_language
mode = 'INSERT'
formname = formname
IMPORTING
devclass = lv_devclass
new_master_language = master_language
korrnum = korrnum
modification_language = modif_language.
CATCH cx_ssf_fb INTO sf_exception.
CASE sf_exception->textid.
WHEN cx_ssf_fb=>enqueued_by_user OR cx_ssf_fb=>enqueue_system_failure.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING msg = 'Enqueued by user'.
WHEN cx_ssf_fb=>no_modify_permission OR cx_ssf_fb=>no_show_permission.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING msg = 'Permission Error'.
WHEN cx_ssf_fb=>permission_failure.
EXIT.
WHEN cx_ssf_fb=>request_language_denied.
RAISE EXCEPTION TYPE zcx_saplink
EXPORTING msg = 'Language request denied'.
WHEN OTHERS.
EXIT.
ENDCASE.
ENDTRY.
CALL FUNCTION 'SDIXML_XML_TO_DOM'
EXPORTING
xml = xml_xtable[]
size = xml_document_size
IMPORTING
document = xml_document
EXCEPTIONS
OTHERS = 1.
l_xml_node = xml_document->get_root_element( ).
l_ns_uri = l_xml_node->get_namespace_uri( ).
l_name = l_xml_node->get_name( ).
l_element ?= l_xml_node->query_interface( ixml_iid_element ).
l_language = l_element->get_attribute( name = 'language'
namespace = xml_ns_prefix_sf ).
CREATE OBJECT l_upload_smartform.
CALL METHOD l_upload_smartform->xml_upload
EXPORTING
dom = l_xml_node
formname = formname
language = master_language
CHANGING
sform = ref_ssf.
ref_ssf = l_upload_smartform.
PERFORM save_form IN PROGRAM saplstxb
USING
' ' 'X'
CHANGING
ref_ssf
l_cancel.
FREE: xml_document.
* dequeue form
ref_ssf->dequeue( formname = formname ).
* successful install
name = objname.
ENDMETHOD.
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version. |
*| |
*| SAPlink is distributed in the hope that it will be useful, |
*| but WITHOUT ANY WARRANTY; without even the implied warranty of |
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
*| GNU General Public License for more details. |
*| |
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the |
*| Free Software Foundation, Inc., |
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
*\---------------------------------------------------------------------/
METHOD deleteobject .
CALL FUNCTION 'FB_DELETE_FORM'
EXPORTING
I_FORMNAME = OBJNAME
* I_FORMTYPE = ' '
* I_WITH_DIALOG = 'X'
* I_WITH_CONFIRM_DIALOG = 'X'
* IMPORTING
* O_FORMNAME =
EXCEPTIONS
NO_NAME = 1
NO_FORM = 2
FORM_LOCKED = 3
NO_ACCESS_PERMISSION = 4
ILLEGAL_LANGUAGE = 5
ILLEGAL_FORMTYPE = 6
OTHERS = 7
.
IF sy-subrc <> 0.
ENDIF.
ENDMETHOD. "createobjectfromixmldoc
*/---------------------------------------------------------------------\
*| This file is part of SAPlink. |
*| |
*| SAPlink is free software; you can redistribute it and/or modify |
*| it under the terms of the GNU General Public License as published |
*| by the Free Software Foundation; either version 2 of the License, |
*| or (at your option) any later version. |
*| |
*| SAPlink is distributed in the hope that it will be useful, |
*| but WITHOUT ANY WARRANTY; without even the implied warranty of |
*| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
*| GNU General Public License for more details. |
*| |
*| You should have received a copy of the GNU General Public License |
*| along with SAPlink; if not, write to the |
*| Free Software Foundation, Inc., |
*| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
*\---------------------------------------------------------------------/
method GETOBJECTTYPE .
objectType = 'SSFO'. "SAP Smartforms
endmethod.
endclass. "ZSAPLINK_SMARTFORM implementation | [
4871,
1168,
50,
2969,
43,
17248,
62,
12310,
7227,
21389,
6770,
201,
198,
220,
1171,
201,
198,
220,
10639,
1780,
422,
1168,
50,
2969,
43,
17248,
201,
198,
220,
2457,
201,
198,
220,
2251,
1171,
764,
201,
198,
201,
198,
11377,
2665,
13,
201,
198,
201,
198,
220,
5050,
5870,
25171,
6369,
1797,
4694,
201,
198,
220,
220,
220,
34087,
17750,
764,
201,
198,
220,
5050,
29244,
6158,
10426,
5805,
38715,
10913,
2662,
9864,
23680,
201,
198,
220,
220,
220,
34087,
17750,
764,
201,
198,
220,
5050,
29244,
1404,
4720,
33,
23680,
10913,
2662,
10426,
5805,
38715,
201,
198,
220,
220,
220,
34087,
17750,
764,
201,
198,
24326,
2665,
13,
201,
198,
201,
198,
220,
5050,
5550,
28882,
4720,
33,
23680,
201,
198,
220,
220,
220,
34087,
17750,
764,
201,
198,
220,
5050,
17151,
9864,
23680,
25216,
201,
198,
220,
220,
220,
34087,
17750,
764,
201,
198,
19734,
2665,
13,
201,
198,
437,
4871,
13,
366,
57,
50,
2969,
43,
17248,
62,
12310,
7227,
21389,
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,
12310,
7227,
21389,
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,
12310,
7227,
21389,
7822,
13,
201,
198,
201,
198,
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,
48323,
8726,
318,
1479,
3788,
26,
345,
460,
17678,
4163,
340,
290,
14,
273,
13096,
220,
220,
930,
201,
198,
9,
91,
220,
220,
340,
739,
262,
2846,
286,
262,
22961,
3611,
5094,
13789,
355,
3199,
930,
201,
198,
9,
91,
220,
220,
416,
262,
3232,
10442,
5693,
26,
2035,
2196,
362,
286,
262,
13789,
11,
930,
201,
198,
9,
91,
220,
220,
393,
357,
265,
534,
3038,
8,
597,
1568,
2196,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
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,
48323,
8726,
318,
9387,
287,
262,
2911,
326,
340,
481,
307,
4465,
11,
220,
220,
220,
220,
220,
220,
220,
930,
201,
198,
9,
91,
220,
220,
475,
42881,
15529,
34764,
56,
26,
1231,
772,
262,
17142,
18215,
286,
220,
220,
220,
930,
201,
198,
9,
91,
220,
220,
34482,
3398,
1565,
5603,
25382,
393,
376,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
13,
220,
4091,
262,
220,
220,
220,
220,
930,
201,
198,
9,
91,
220,
220,
22961,
3611,
5094,
13789,
329,
517,
3307,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
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,
921,
815,
423,
2722,
257,
4866,
286,
262,
22961,
3611,
5094,
13789,
930,
201,
198,
9,
91,
220,
220,
1863,
351,
48323,
8726,
26,
611,
407,
11,
3551,
284,
262,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
201,
198,
9,
91,
220,
220,
3232,
10442,
5693,
11,
3457,
1539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
201,
198,
9,
91,
220,
220,
6885,
14021,
520,
11,
19383,
22343,
11,
6182,
11,
8779,
220,
657,
2481,
940,
12,
1485,
486,
220,
4916,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
201,
198,
9,
59,
10097,
30934,
14,
201,
198,
49273,
1125,
66,
365,
87,
1023,
764,
201,
198,
201,
198,
220,
33493,
311,
2751,
2538,
1296,
3672,
16034,
336,
26152,
324,
76,
39319,
26181,
3672,
33411,
1296,
3672,
796,
26181,
3672,
13,
201,
198,
220,
16876,
827,
12,
7266,
6015,
796,
657,
13,
201,
198,
220,
220,
220,
7160,
796,
705,
55,
4458,
201,
198,
220,
23578,
5064,
13,
201,
198,
201,
198,
10619,
49273,
13,
201,
198,
201,
198,
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
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS ltc_function_tests DEFINITION FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PROTECTED SECTION.
TYPES t_itab TYPE STANDARD TABLE OF scarr WITH KEY carrid.
DATA scarr_old TYPE t_itab.
DATA scarr_new TYPE t_itab.
DATA: inserts TYPE t_itab,
updates TYPE t_itab,
deletes TYPE t_itab.
METHODS compare_tables RAISING zcx_table_comparison.
METHODS fill_client
CHANGING
scarr TYPE t_itab.
METHODS no_change FOR TESTING RAISING cx_static_check.
METHODS delete_row FOR TESTING RAISING cx_static_check.
METHODS add_row FOR TESTING RAISING cx_static_check.
METHODS change_row FOR TESTING RAISING cx_static_check.
METHODS unsorted_rows_are_the_same FOR TESTING RAISING cx_static_check.
METHODS multiple_changes FOR TESTING RAISING cx_static_check.
PRIVATE SECTION.
METHODS deletes_should_be IMPORTING VALUE(i_scarr) TYPE t_itab OPTIONAL.
METHODS changes_should_be IMPORTING VALUE(i_scarr) TYPE t_itab OPTIONAL.
METHODS inserts_should_be IMPORTING VALUE(i_scarr) TYPE t_itab OPTIONAL.
ENDCLASS.
CLASS ltc_function_tests IMPLEMENTATION.
METHOD no_change.
scarr_old = VALUE #( ( carrid = 'AA' ) ).
scarr_new = VALUE #( ( carrid = 'AA' ) ).
compare_tables( ).
inserts_should_be( ).
changes_should_be( ).
deletes_should_be( ).
ENDMETHOD.
METHOD add_row.
scarr_old = VALUE #( ( carrid = 'AA' ) ).
scarr_new = VALUE #( ( carrid = 'AA' ) ( carrid = 'BB' ) ).
compare_tables( ).
inserts_should_be( VALUE #( ( carrid = 'BB' ) ) ).
changes_should_be( ).
deletes_should_be( ).
ENDMETHOD.
METHOD change_row.
scarr_old = VALUE #( ( carrid = 'AA' ) ).
scarr_new = VALUE #( ( carrid = 'AA' carrname = 'ABC' ) ).
compare_tables( ).
inserts_should_be( ).
changes_should_be( VALUE #( ( carrid = 'AA' carrname = 'ABC' ) ) ).
deletes_should_be( ).
ENDMETHOD.
METHOD delete_row.
scarr_old = VALUE #( ( carrid = 'AA' ) ).
scarr_new = VALUE #( ).
compare_tables( ).
inserts_should_be( ).
changes_should_be( ).
deletes_should_be( VALUE #( ( carrid = 'AA' ) ) ).
ENDMETHOD.
METHOD unsorted_rows_are_the_same.
scarr_old = VALUE #( ( carrid = 'AA' ) ( carrid = 'BB' ) ).
scarr_new = VALUE #( ( carrid = 'BB' ) ( carrid = 'AA' ) ).
compare_tables( ).
inserts_should_be( ).
changes_should_be( ).
deletes_should_be( ).
ENDMETHOD.
METHOD multiple_changes.
scarr_old = VALUE #( ( carrid = `AA` ) ( carrid = `BB` ) ( carrid = `CC` ) ( carrid = `DD` ) ( carrid = 'EE' carrname = 'Foo' ) ).
scarr_new = VALUE #( ( carrid = `AA` ) ( carrid = `CC` ) ( carrid = `DD` ) ( carrid = `EA` ) ( carrid = 'EE' carrname = 'Bar' ) ( carrid = `ZZ` ) ).
compare_tables( ).
inserts_should_be( VALUE #( ( carrid = `EA` ) ( carrid = `ZZ` ) ) ).
changes_should_be( VALUE #( ( carrid = `EE` carrname = `Bar` ) ) ).
deletes_should_be( VALUE #( ( carrid = `BB` ) ) ).
ENDMETHOD.
METHOD compare_tables.
fill_client( CHANGING scarr = scarr_old ).
fill_client( CHANGING scarr = scarr_new ).
zcl_table_comparison_factory=>create_table_comparison( )->compare(
EXPORTING
internal_table_new = scarr_new
internal_table_old = scarr_old
IMPORTING
inserted = inserts
updated = updates
deleted = deletes ).
ENDMETHOD.
METHOD fill_client.
LOOP AT scarr ASSIGNING FIELD-SYMBOL(<scarr_line>).
<scarr_line>-mandt = sy-mandt.
ENDLOOP.
ENDMETHOD.
METHOD inserts_should_be.
fill_client( CHANGING scarr = i_scarr ).
cl_abap_unit_assert=>assert_equals( act = inserts
exp = i_scarr
msg = `Inserts not as expected` ).
ENDMETHOD.
METHOD changes_should_be.
fill_client( CHANGING scarr = i_scarr ).
cl_abap_unit_assert=>assert_equals( act = updates
exp = i_scarr
msg = `Changes not as expected` ).
ENDMETHOD.
METHOD deletes_should_be.
fill_client( CHANGING scarr = i_scarr ).
cl_abap_unit_assert=>assert_equals( act = deletes
exp = i_scarr
msg = `Deletes not as expected` ).
ENDMETHOD.
ENDCLASS.
CLASS ltc_db_compare DEFINITION CREATE PUBLIC FOR TESTING RISK LEVEL HARMLESS DURATION SHORT INHERITING FROM ltc_function_tests.
PUBLIC SECTION.
PROTECTED SECTION.
METHODS compare_tables REDEFINITION.
PRIVATE SECTION.
CLASS-METHODS class_teardown.
CLASS-METHODS class_setup.
METHODS teardown.
CLASS-DATA sql_environment TYPE REF TO if_osql_test_environment.
ENDCLASS.
CLASS ltc_db_compare IMPLEMENTATION.
METHOD class_setup.
sql_environment = cl_osql_test_environment=>create(
i_dependency_list = VALUE #( ( 'SCARR' ) ) ).
sql_environment->clear_doubles( ).
ENDMETHOD.
METHOD class_teardown.
sql_environment->destroy( ).
ENDMETHOD.
METHOD compare_tables.
fill_client( CHANGING scarr = scarr_old ).
fill_client( CHANGING scarr = scarr_new ).
sql_environment->insert_test_data( i_data = scarr_old ).
zcl_table_comparison_factory=>create_table_comparison( )->compare_with_database(
EXPORTING
internal_table = scarr_new
IMPORTING
inserted = inserts
updated = updates
deleted = deletes ).
ENDMETHOD.
METHOD teardown.
sql_environment->clear_doubles( ).
ENDMETHOD.
ENDCLASS.
| [
198,
31631,
300,
23047,
62,
8818,
62,
41989,
5550,
20032,
17941,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
256,
62,
270,
397,
41876,
49053,
9795,
43679,
3963,
629,
3258,
13315,
35374,
1097,
6058,
13,
198,
220,
220,
220,
42865,
629,
3258,
62,
727,
41876,
256,
62,
270,
397,
13,
198,
220,
220,
220,
42865,
629,
3258,
62,
3605,
41876,
256,
62,
270,
397,
13,
628,
220,
220,
220,
42865,
25,
42220,
41876,
256,
62,
270,
397,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5992,
41876,
256,
62,
270,
397,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
28128,
274,
41876,
256,
62,
270,
397,
13,
628,
220,
220,
220,
337,
36252,
50,
8996,
62,
83,
2977,
17926,
1797,
2751,
1976,
66,
87,
62,
11487,
62,
785,
1845,
1653,
13,
198,
220,
220,
220,
337,
36252,
50,
6070,
62,
16366,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
629,
3258,
41876,
256,
62,
270,
397,
13,
628,
220,
220,
220,
337,
36252,
50,
645,
62,
3803,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
12233,
62,
808,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
751,
62,
808,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1487,
62,
808,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
5576,
9741,
62,
8516,
62,
533,
62,
1169,
62,
31642,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
3294,
62,
36653,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
628,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
628,
198,
220,
220,
220,
337,
36252,
50,
28128,
274,
62,
21754,
62,
1350,
30023,
9863,
2751,
26173,
8924,
7,
72,
62,
1416,
3258,
8,
41876,
256,
62,
270,
397,
39852,
2849,
1847,
13,
198,
220,
220,
220,
337,
36252,
50,
2458,
62,
21754,
62,
1350,
30023,
9863,
2751,
26173,
8924,
7,
72,
62,
1416,
3258,
8,
41876,
256,
62,
270,
397,
39852,
2849,
1847,
13,
198,
220,
220,
220,
337,
36252,
50,
42220,
62,
21754,
62,
1350,
30023,
9863,
2751,
26173,
8924,
7,
72,
62,
1416,
3258,
8,
41876,
256,
62,
270,
397,
39852,
2849,
1847,
13,
628,
628,
198,
10619,
31631,
13,
628,
198,
31631,
300,
23047,
62,
8818,
62,
41989,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
645,
62,
3803,
13,
628,
220,
220,
220,
629,
3258,
62,
727,
796,
26173,
8924,
1303,
7,
357,
1097,
6058,
796,
705,
3838,
6,
1267,
6739,
198,
220,
220,
220,
629,
3258,
62,
3605,
796,
26173,
8924,
1303,
7,
357,
1097,
6058,
796,
705,
3838,
6,
1267,
6739,
628,
220,
220,
220,
8996,
62,
83,
2977,
7,
6739,
628,
220,
220,
220,
42220,
62,
21754,
62,
1350,
7,
6739,
198,
220,
220,
220,
2458,
62,
21754,
62,
1350,
7,
6739,
198,
220,
220,
220,
28128,
274,
62,
21754,
62,
1350,
7,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
751,
62,
808,
13,
628,
220,
220,
220,
629,
3258,
62,
727,
796,
26173,
8924,
1303,
7,
357,
1097,
6058,
796,
705,
3838,
6,
1267,
6739,
198,
220,
220,
220,
629,
3258,
62,
3605,
796,
26173,
8924,
1303,
7,
357,
1097,
6058,
796,
705,
3838,
6,
1267,
357,
1097,
6058,
796,
705,
15199,
6,
1267,
6739,
628,
220,
220,
220,
8996,
62,
83,
2977,
7,
6739,
628,
220,
220,
220,
42220,
62,
21754,
62,
1350,
7,
26173,
8924,
1303,
7,
357,
1097,
6058,
796,
705,
15199,
6,
1267,
1267,
6739,
198,
220,
220,
220,
2458,
62,
21754,
62,
1350,
7,
6739,
198,
220,
220,
220,
28128,
274,
62,
21754,
62,
1350,
7,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1487,
62,
808,
13,
628,
220,
220,
220,
629,
3258,
62,
727,
796,
26173,
8924,
1303,
7,
357,
1097,
6058,
796,
705,
3838,
6,
1267,
6739,
198,
220,
220,
220,
629,
3258,
62,
3605,
796,
26173,
8924,
1303,
7,
357,
1097,
6058,
796,
705,
3838,
6,
1097,
81,
3672,
796,
705,
24694,
6,
1267,
6739,
628,
220,
220,
220,
8996,
62,
83,
2977,
7,
6739,
628,
220,
220,
220,
42220,
62,
21754,
62,
1350,
7,
6739,
198,
220,
220,
220,
2458,
62,
21754,
62,
1350,
7,
26173,
8924,
1303,
7,
357,
1097,
6058,
796,
705,
3838,
6,
1097,
81,
3672,
796,
705,
24694,
6,
1267,
1267,
6739,
198,
220,
220,
220,
28128,
274,
62,
21754,
62,
1350,
7,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
12233,
62,
808,
13,
628,
220,
220,
220,
629,
3258,
62,
727,
796,
26173,
8924,
1303,
7,
357,
1097,
6058,
796,
705,
3838,
6,
1267,
6739,
198,
220,
220,
220,
629,
3258,
62,
3605,
796,
26173,
8924,
1303,
7,
6739,
628,
220,
220,
220,
8996,
62,
83,
2977,
7,
6739,
628,
220,
220,
220,
42220,
62,
21754,
62,
1350,
7,
6739,
198,
220,
220,
220,
2458,
62,
21754,
62,
1350,
7,
6739,
198,
220,
220,
220,
28128,
274,
62,
21754,
62,
1350,
7,
26173,
8924,
1303,
7,
357,
1097,
6058,
796,
705,
3838,
6,
1267,
1267,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
5576,
9741,
62,
8516,
62,
533,
62,
1169,
62,
31642,
13,
628,
220,
220,
220,
629,
3258,
62,
727,
796,
26173,
8924,
1303,
7,
357,
1097,
6058,
796,
705,
3838,
6,
1267,
357,
1097,
6058,
796,
705,
15199,
6,
1267,
6739,
198,
220,
220,
220,
629,
3258,
62,
3605,
796,
26173,
8924,
1303,
7,
357,
1097,
6058,
796,
705,
15199,
6,
1267,
357,
1097,
6058,
796,
705,
3838,
6,
1267,
6739,
628,
220,
220,
220,
8996,
62,
83,
2977,
7,
6739,
628,
220,
220,
220,
42220,
62,
21754,
62,
1350,
7,
6739,
198,
220,
220,
220,
2458,
62,
21754,
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,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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
] |
CLASS zcl_abapgit_object_msag 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.
TYPES: BEGIN OF ty_t100_texts,
sprsl TYPE t100-sprsl,
msgnr TYPE t100-msgnr,
text TYPE t100-text,
END OF ty_t100_texts,
tt_t100_texts TYPE STANDARD TABLE OF ty_t100_texts,
tty_t100 TYPE STANDARD TABLE OF t100
WITH NON-UNIQUE DEFAULT KEY,
BEGIN OF ty_longtext,
dokil TYPE dokil,
head TYPE thead,
lines TYPE tline_tab,
END OF ty_longtext,
tty_longtexts TYPE STANDARD TABLE OF ty_longtext
WITH NON-UNIQUE DEFAULT KEY.
METHODS:
serialize_texts
IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_output
RAISING zcx_abapgit_exception,
deserialize_texts
IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_input
RAISING zcx_abapgit_exception,
serialize_longtexts_msag
IMPORTING it_t100 TYPE zcl_abapgit_object_msag=>tty_t100
io_xml TYPE REF TO zcl_abapgit_xml_output
RAISING zcx_abapgit_exception,
delete_msgid IMPORTING iv_message_id TYPE arbgb,
free_access_permission
IMPORTING
i_message_id TYPE arbgb,
delete_documentation
IMPORTING
iv_message_id TYPE arbgb.
ENDCLASS.
CLASS zcl_abapgit_object_msag IMPLEMENTATION.
METHOD delete_documentation.
DATA: lv_key_s TYPE dokhl-object.
CLEAR lv_key_s.
CALL FUNCTION 'DOCU_OBJECT_NAME_CONCATENATE'
EXPORTING
docu_id = 'NA'
element = iv_message_id
addition = ' '
IMPORTING
object = lv_key_s
EXCEPTIONS
OTHERS = 0.
CALL FUNCTION 'DOKU_DELETE_ALL'
EXPORTING
doku_id = 'NA'
doku_object = lv_key_s
generic_use = 'X'
suppress_authority = space
suppress_enqueue = space
suppress_transport = space
EXCEPTIONS
header_without_text = 01
index_without_header = 02
no_authority_for_devclass_xxxx = 03
no_docu_found = 04
object_is_already_enqueued = 05
object_is_enqueued_by_corr = 06
user_break = 07.
ENDMETHOD.
METHOD delete_msgid.
delete_documentation( iv_message_id ).
DELETE FROM t100a WHERE arbgb = iv_message_id.
IF sy-subrc = 0 OR sy-subrc = 4.
CALL FUNCTION 'RS_TREE_OBJECT_PLACEMENT'
EXPORTING
object = iv_message_id
operation = 'DELETE'
program = space
type = 'CN'.
DELETE FROM t100o WHERE arbgb = iv_message_id.
DELETE FROM t100t WHERE arbgb = iv_message_id. "#EC CI_NOFIRST
DELETE FROM t100u WHERE arbgb = iv_message_id.
DELETE FROM t100x WHERE arbgb = iv_message_id.
DELETE FROM t100 WHERE arbgb = iv_message_id.
ENDIF.
ENDMETHOD.
METHOD deserialize_texts.
DATA: lv_msg_id TYPE rglif-message_id,
ls_t100 TYPE t100,
lt_t100t TYPE TABLE OF t100t,
lt_t100_texts TYPE tt_t100_texts,
lt_t100u TYPE TABLE OF t100u.
FIELD-SYMBOLS: <ls_t100_text> TYPE ty_t100_texts.
lv_msg_id = ms_item-obj_name.
SELECT * FROM t100u INTO TABLE lt_t100u
WHERE arbgb = lv_msg_id ORDER BY PRIMARY KEY. "#EC CI_GENBUFF
io_xml->read( EXPORTING iv_name = 'T100_TEXTS'
CHANGING cg_data = lt_t100_texts ).
io_xml->read( EXPORTING iv_name = 'T100T'
CHANGING cg_data = lt_t100t ).
MODIFY t100t FROM TABLE lt_t100t. "#EC CI_SUBRC
LOOP AT lt_t100_texts ASSIGNING <ls_t100_text>.
"check if message exists
READ TABLE lt_t100u TRANSPORTING NO FIELDS
WITH KEY arbgb = lv_msg_id msgnr = <ls_t100_text>-msgnr BINARY SEARCH.
CHECK sy-subrc = 0. "if original message doesn't exist no translations added
MOVE-CORRESPONDING <ls_t100_text> TO ls_t100.
ls_t100-arbgb = lv_msg_id.
MODIFY t100 FROM ls_t100.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100 modify failed' ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD free_access_permission.
CALL FUNCTION 'RS_ACCESS_PERMISSION'
EXPORTING
mode = 'FREE'
object = i_message_id
object_class = 'T100'.
ENDMETHOD.
METHOD serialize_longtexts_msag.
DATA: lv_object TYPE dokhl-object,
lt_objects TYPE STANDARD TABLE OF dokhl-object
WITH NON-UNIQUE DEFAULT KEY,
lt_dokil TYPE zif_abapgit_definitions=>tty_dokil.
FIELD-SYMBOLS: <ls_t100> TYPE t100.
IF lines( it_t100 ) = 0.
RETURN.
ENDIF.
LOOP AT it_t100 ASSIGNING <ls_t100>.
lv_object = <ls_t100>-arbgb && <ls_t100>-msgnr.
INSERT lv_object INTO TABLE lt_objects.
ENDLOOP.
SELECT * FROM dokil
INTO TABLE lt_dokil
FOR ALL ENTRIES IN lt_objects
WHERE id = 'NA'
AND object = lt_objects-table_line.
IF lines( lt_dokil ) > 0.
serialize_longtexts( io_xml = io_xml
it_dokil = lt_dokil ).
ENDIF.
ENDMETHOD.
METHOD serialize_texts.
DATA: lv_msg_id TYPE rglif-message_id,
lt_t100_texts TYPE tt_t100_texts,
lt_t100t TYPE TABLE OF t100t,
lt_i18n_langs TYPE TABLE OF langu.
lv_msg_id = ms_item-obj_name.
" Collect additional languages
" Skip master lang - it has been already serialized
SELECT DISTINCT sprsl AS langu INTO TABLE lt_i18n_langs
FROM t100t
WHERE arbgb = lv_msg_id
AND sprsl <> mv_language. "#EC CI_BYPASS "#EC CI_GENBUFF.
SORT lt_i18n_langs ASCENDING.
IF lines( lt_i18n_langs ) > 0.
SELECT * FROM t100t INTO CORRESPONDING FIELDS OF TABLE lt_t100t
WHERE sprsl <> mv_language
AND arbgb = lv_msg_id. "#EC CI_GENBUFF
SELECT * FROM t100 INTO CORRESPONDING FIELDS OF TABLE lt_t100_texts
FOR ALL ENTRIES IN lt_i18n_langs
WHERE sprsl = lt_i18n_langs-table_line
AND arbgb = lv_msg_id
ORDER BY PRIMARY KEY. "#EC CI_SUBRC "#EC CI_GENBUFF
SORT lt_t100t BY sprsl ASCENDING.
SORT lt_t100_texts BY sprsl msgnr ASCENDING.
io_xml->add( iv_name = 'I18N_LANGS'
ig_data = lt_i18n_langs ).
io_xml->add( iv_name = 'T100T'
ig_data = lt_t100t ).
io_xml->add( iv_name = 'T100_TEXTS'
ig_data = lt_t100_texts ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
SELECT SINGLE lastuser FROM t100a INTO rv_user
WHERE arbgb = ms_item-obj_name. "#EC CI_GENBUFF
IF sy-subrc <> 0 OR rv_user = ''.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~compare_to_remote_version.
CREATE OBJECT ro_comparison_result TYPE zcl_abapgit_comparison_null.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_t100a TYPE t100a,
lv_frozen TYPE flag,
lv_message_id TYPE arbgb,
lv_access_granted TYPE abap_bool.
* parameter SUPPRESS_DIALOG doesnt exist in all versions of FM RS_DELETE_MESSAGE_ID
* replaced with a copy
lv_message_id = ms_item-obj_name.
IF ms_item-obj_name EQ space.
zcx_abapgit_exception=>raise( 'Error from (copy of) RS_DELETE_MESSAGE_ID' )."blank message id
ENDIF.
SELECT SINGLE * FROM t100a INTO lv_t100a WHERE arbgb = ms_item-obj_name.
IF sy-subrc NE 0.
zcx_abapgit_exception=>raise( 'Error from (copy of) RS_DELETE_MESSAGE_ID' )."not found
ENDIF.
CLEAR lv_frozen.
CALL FUNCTION 'RS_ACCESS_PERMISSION'
EXPORTING
authority_check = 'X'
global_lock = 'X'
mode = 'MODIFY'
object = lv_message_id
object_class = 'T100'
IMPORTING
frozen = lv_frozen
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0 OR lv_frozen NE space.
zcx_abapgit_exception=>raise( 'Error from (copy of) RS_DELETE_MESSAGE_ID' )."can't access
ENDIF.
lv_access_granted = abap_true.
CALL FUNCTION 'RS_CORR_INSERT'
EXPORTING
global_lock = 'X'
object = lv_message_id
object_class = 'MSAG'
mode = 'D'
EXCEPTIONS
cancelled = 01
permission_failure = 02.
IF sy-subrc NE 0.
IF lv_access_granted = abap_true.
free_access_permission( lv_message_id ).
ENDIF.
zcx_abapgit_exception=>raise( 'Error from (copy of) RS_DELETE_MESSAGE_ID' )."can't access
ENDIF.
delete_msgid( lv_message_id ).
IF lv_access_granted = abap_true.
free_access_permission( lv_message_id ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
* fm RPY_MESSAGE_ID_INSERT almost works, but not in older versions
DATA: ls_t100a TYPE t100a,
ls_t100t TYPE t100t,
ls_t100u TYPE t100u,
lt_t100 TYPE TABLE OF t100,
lt_before TYPE TABLE OF t100u.
FIELD-SYMBOLS: <ls_t100> LIKE LINE OF lt_t100.
io_xml->read( EXPORTING iv_name = 'T100A'
CHANGING cg_data = ls_t100a ).
io_xml->read( EXPORTING iv_name = 'T100'
CHANGING cg_data = lt_t100 ).
CALL FUNCTION 'RS_CORR_INSERT'
EXPORTING
global_lock = abap_true
devclass = iv_package
object = ls_t100a-arbgb
object_class = 'T100'
mode = 'INSERT'
EXCEPTIONS
cancelled = 01
permission_failure = 02
unknown_objectclass = 03.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error from RS_CORR_INSERT' ).
ENDIF.
SELECT * FROM t100u INTO TABLE lt_before
WHERE arbgb = ls_t100a-arbgb ORDER BY msgnr. "#EC CI_GENBUFF "#EC CI_BYPASS
LOOP AT lt_t100 ASSIGNING <ls_t100>.
DELETE lt_before WHERE msgnr = <ls_t100>-msgnr.
MODIFY t100 FROM <ls_t100>.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100 modify failed' ).
ENDIF.
CLEAR ls_t100u.
MOVE-CORRESPONDING <ls_t100> TO ls_t100u ##enh_ok.
ls_t100u-name = sy-uname.
ls_t100u-datum = sy-datum.
ls_t100u-selfdef = '3'.
MODIFY t100u FROM ls_t100u.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100U modify failed' ).
ENDIF.
ENDLOOP.
ls_t100a-masterlang = mv_language.
ls_t100a-lastuser = sy-uname.
ls_t100a-respuser = sy-uname.
ls_t100a-ldate = sy-datum.
ls_t100a-ltime = sy-uzeit.
MODIFY t100a FROM ls_t100a.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100A modify failed' ).
ENDIF.
ls_t100t-sprsl = mv_language.
ls_t100t-arbgb = ls_t100a-arbgb.
ls_t100t-stext = ls_t100a-stext.
MODIFY t100t FROM ls_t100t.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100T modify failed' ).
ENDIF.
LOOP AT lt_before INTO ls_t100u.
DELETE FROM t100 WHERE arbgb = ls_t100u-arbgb
AND msgnr = ls_t100u-msgnr. "#EC CI_SUBRC
DELETE FROM t100u WHERE arbgb = ls_t100u-arbgb
AND msgnr = ls_t100u-msgnr. "#EC CI_SUBRC
ENDLOOP.
deserialize_longtexts( io_xml ).
deserialize_texts( io_xml ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_arbgb TYPE t100a-arbgb.
SELECT SINGLE arbgb FROM t100a INTO lv_arbgb
WHERE arbgb = ms_item-obj_name. "#EC CI_GENBUFF
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
ENDMETHOD.
METHOD zif_abapgit_object~has_changed_since.
rv_changed = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
DATA: lv_argument TYPE seqg3-garg.
lv_argument = |{ ms_item-obj_name }|.
OVERLAY lv_argument WITH ' '.
lv_argument = lv_argument && '*'.
rv_is_locked = exists_a_lock_entry_for( iv_lock_object = |ES_MSGSI|
iv_argument = lv_argument ).
ENDMETHOD.
METHOD zif_abapgit_object~jump.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = ms_item-obj_name
object_type = 'MSAG'
in_new_window = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lv_msg_id TYPE rglif-message_id,
ls_inf TYPE t100a,
lt_source TYPE tty_t100.
lv_msg_id = ms_item-obj_name.
SELECT SINGLE * FROM t100a INTO ls_inf
WHERE arbgb = lv_msg_id. "#EC CI_GENBUFF
IF sy-subrc <> 0.
RETURN.
ENDIF.
CLEAR ls_inf-respuser.
SELECT * FROM t100 INTO TABLE lt_source
WHERE sprsl = mv_language
AND arbgb = lv_msg_id
ORDER BY PRIMARY KEY. "#EC CI_SUBRC "#EC CI_GENBUFF
CLEAR: ls_inf-lastuser,
ls_inf-ldate,
ls_inf-ltime.
io_xml->add( iv_name = 'T100A'
ig_data = ls_inf ).
io_xml->add( ig_data = lt_source
iv_name = 'T100' ).
serialize_longtexts_msag( it_t100 = lt_source
io_xml = io_xml ).
serialize_texts( io_xml ).
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
907,
363,
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,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
83,
3064,
62,
5239,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
599,
3808,
75,
41876,
256,
3064,
12,
34975,
6649,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13845,
4593,
81,
41876,
256,
3064,
12,
907,
4593,
81,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2420,
220,
41876,
256,
3064,
12,
5239,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
83,
3064,
62,
5239,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
83,
62,
83,
3064,
62,
5239,
82,
41876,
49053,
9795,
43679,
3963,
1259,
62,
83,
3064,
62,
5239,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
774,
62,
83,
3064,
220,
220,
220,
220,
220,
41876,
49053,
9795,
43679,
3963,
256,
3064,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
6511,
5239,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
466,
34553,
41876,
466,
34553,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1182,
220,
41876,
262,
324,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3951,
41876,
256,
1370,
62,
8658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
6511,
5239,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
774,
62,
6511,
5239,
82,
41876,
49053,
9795,
43679,
3963,
1259,
62,
6511,
5239,
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,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
11389,
1096,
62,
5239,
82,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
33245,
62,
19875,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
19875,
62,
22915,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
748,
48499,
1096,
62,
5239,
82,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
33245,
62,
19875,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
19875,
62,
15414,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
11389,
1096,
62,
6511,
5239,
82,
62,
907,
363,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
340,
62,
83,
3064,
41876,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
907,
363,
14804,
42852,
62,
83,
3064,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
19875,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
19875,
62,
22915,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
12233,
62,
19662,
312,
30023,
9863,
2751,
21628,
62,
20500,
62,
312,
220,
220,
220,
220,
220,
220,
220,
41876,
610,
65,
22296,
11,
198,
220,
220,
220,
220,
220,
1479,
62,
15526,
62,
525,
3411,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
20500,
62,
312,
41876,
610,
65,
22296,
11,
198,
220,
220,
220,
220,
220,
12233,
62,
22897,
341,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
20500,
62,
312,
41876,
610,
65,
22296,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
907,
363,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
12233,
62,
22897,
341,
13,
198,
220,
220,
220,
42865,
25,
300,
85,
62,
2539,
62,
82,
41876,
466,
14636,
75,
12,
15252,
13,
628,
220,
220,
220,
30301,
1503,
300,
85,
62,
2539,
62,
82,
13,
198,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
38715,
52,
62,
9864,
23680,
62,
20608,
62,
10943,
34,
1404,
1677,
6158,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
2205,
84,
62,
312,
220,
796,
705,
4535,
6,
198,
220,
220,
220,
220,
220,
220,
220,
5002,
220,
796,
21628,
62,
20500,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
3090,
796,
705,
220,
220,
705,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
220,
220,
796,
300,
85,
62,
2539,
62,
82,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
796,
657,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
35,
11380,
52,
62,
7206,
2538,
9328,
62,
7036,
6,
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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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
] |
*&---------------------------------------------------------------------*
*& Include ZABAPGIT_UTIL
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
* CLASS lcl_time DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_time DEFINITION FINAL.
PUBLIC SECTION.
TYPES: ty_unixtime TYPE c LENGTH 16.
CLASS-METHODS get
RETURNING VALUE(rv_time) TYPE ty_unixtime
RAISING lcx_exception.
PRIVATE SECTION.
CONSTANTS: c_epoch TYPE datum VALUE '19700101'.
ENDCLASS. "lcl_time DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_time IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_time IMPLEMENTATION.
METHOD get.
DATA: lv_i TYPE i,
lv_tz TYPE tznzone,
lv_utcdiff TYPE tznutcdiff,
lv_utcsign TYPE tznutcsign.
lv_i = sy-datum - c_epoch.
lv_i = lv_i * 86400.
lv_i = lv_i + sy-uzeit.
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.
IF sy-subrc <> 0.
lcx_exception=>raise( 'Timezone error' ).
ENDIF.
CASE lv_utcsign.
WHEN '+'.
lv_i = lv_i - lv_utcdiff.
WHEN '-'.
lv_i = lv_i + lv_utcdiff.
ENDCASE.
rv_time = lv_i.
CONDENSE rv_time.
rv_time+11 = lv_utcsign.
rv_time+12 = lv_utcdiff.
ENDMETHOD. "get
ENDCLASS. "lcl_time IMPLEMENTATION
*----------------------------------------------------------------------*
* CLASS lcl_convert DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_convert DEFINITION FINAL.
PUBLIC SECTION.
CLASS-METHODS bitbyte_to_int
IMPORTING iv_bits TYPE clike
RETURNING VALUE(rv_int) TYPE i.
CLASS-METHODS x_to_bitbyte
IMPORTING iv_x TYPE x
RETURNING VALUE(rv_bitbyte) TYPE ty_bitbyte.
CLASS-METHODS string_to_xstring_utf8
IMPORTING iv_string TYPE string
RETURNING VALUE(rv_xstring) TYPE xstring.
CLASS-METHODS xstring_to_string_utf8
IMPORTING iv_data TYPE xstring
RETURNING VALUE(rv_string) TYPE string.
CLASS-METHODS xstring_to_int
IMPORTING iv_xstring TYPE xstring
RETURNING VALUE(rv_i) TYPE i
RAISING lcx_exception.
CLASS-METHODS int_to_xstring
IMPORTING iv_i TYPE i
iv_length TYPE i
RETURNING VALUE(rv_xstring) TYPE xstring.
ENDCLASS. "lcl_convert DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_convert IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_convert IMPLEMENTATION.
METHOD int_to_xstring.
DATA: lv_x TYPE x LENGTH 4.
ASSERT iv_length = 4. " other cases not implemented
lv_x = iv_i.
rv_xstring = lv_x.
ENDMETHOD. "int_to_xstring
METHOD xstring_to_int.
DATA: lv_xstring TYPE xstring,
lv_x TYPE x.
lv_xstring = iv_xstring.
WHILE xstrlen( lv_xstring ) > 0.
lv_x = lv_xstring(1).
rv_i = rv_i * 256 + lv_x.
lv_xstring = lv_xstring+1.
ENDWHILE.
ENDMETHOD. "xstring_to_int
METHOD xstring_to_string_utf8.
DATA: lv_len TYPE i,
lo_obj TYPE REF TO cl_abap_conv_in_ce.
TRY.
lo_obj = cl_abap_conv_in_ce=>create(
input = iv_data
encoding = 'UTF-8' ).
lv_len = xstrlen( iv_data ).
lo_obj->read( EXPORTING n = lv_len
IMPORTING data = rv_string ).
CATCH cx_parameter_invalid_range
cx_sy_codepage_converter_init
cx_sy_conversion_codepage
cx_parameter_invalid_type. "#EC NO_HANDLER
ENDTRY.
ENDMETHOD. "xstring_to_string_utf8
METHOD string_to_xstring_utf8.
DATA: lo_obj TYPE REF TO cl_abap_conv_out_ce.
TRY.
lo_obj = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' ).
lo_obj->convert( EXPORTING data = iv_string
IMPORTING buffer = rv_xstring ).
CATCH cx_parameter_invalid_range
cx_sy_codepage_converter_init
cx_sy_conversion_codepage
cx_parameter_invalid_type. "#EC NO_HANDLER
ENDTRY.
ENDMETHOD. "string_to_xstring_utf8
METHOD bitbyte_to_int.
DATA: lv_bits TYPE string.
lv_bits = iv_bits.
rv_int = 0.
WHILE strlen( lv_bits ) > 0.
rv_int = rv_int * 2.
IF lv_bits(1) = '1'.
rv_int = rv_int + 1.
ENDIF.
lv_bits = lv_bits+1.
ENDWHILE.
ENDMETHOD. "bitbyte_to_int
METHOD x_to_bitbyte.
DATA: lv_b TYPE n.
CLEAR rv_bitbyte.
DO 8 TIMES.
GET BIT sy-index OF iv_x INTO lv_b.
CONCATENATE rv_bitbyte lv_b INTO rv_bitbyte.
ENDDO.
ENDMETHOD. "x_to_bitbyte
ENDCLASS. "lcl_convert IMPLEMENTATION
*----------------------------------------------------------------------*
* CLASS lcl_hash DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_hash DEFINITION FINAL.
PUBLIC SECTION.
TYPES: ty_adler32 TYPE x LENGTH 4.
CLASS-METHODS adler32
IMPORTING iv_xstring TYPE xstring
RETURNING VALUE(rv_checksum) TYPE ty_adler32.
CLASS-METHODS sha1
IMPORTING iv_type TYPE ty_type
iv_data TYPE xstring
RETURNING VALUE(rv_sha1) TYPE ty_sha1
RAISING lcx_exception.
CLASS-METHODS sha1_raw
IMPORTING iv_data TYPE xstring
RETURNING VALUE(rv_sha1) TYPE ty_sha1
RAISING lcx_exception.
ENDCLASS. "lcl_hash DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_hash IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_hash IMPLEMENTATION.
METHOD adler32.
CONSTANTS: lc_adler TYPE i VALUE 65521.
DATA: lv_index TYPE i,
lv_a TYPE i VALUE 1,
lv_b TYPE i VALUE 0,
lv_x TYPE x LENGTH 2,
lv_ca TYPE c LENGTH 4,
lv_cb TYPE c LENGTH 4,
lv_char8 TYPE c LENGTH 8.
DO xstrlen( iv_xstring ) TIMES.
lv_index = sy-index - 1.
lv_a = ( lv_a + iv_xstring+lv_index(1) ) MOD lc_adler.
lv_b = ( lv_b + lv_a ) MOD lc_adler.
ENDDO.
lv_x = lv_a.
lv_ca = lv_x.
lv_x = lv_b.
lv_cb = lv_x.
CONCATENATE lv_cb lv_ca INTO lv_char8.
rv_checksum = lv_char8.
ENDMETHOD. "adler32
METHOD sha1_raw.
DATA: lv_hash TYPE hash160.
CALL FUNCTION 'CALCULATE_HASH_FOR_RAW'
EXPORTING
data = iv_data
IMPORTING
hash = lv_hash
EXCEPTIONS
unknown_alg = 1
param_error = 2
internal_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
lcx_exception=>raise( 'Error while calculating SHA1' ).
ENDIF.
rv_sha1 = lv_hash.
TRANSLATE rv_sha1 TO LOWER CASE.
ENDMETHOD. "sha1_raw
METHOD sha1.
DATA: lv_len TYPE i,
lv_char10 TYPE c LENGTH 10,
lv_string TYPE string,
lv_xstring TYPE xstring.
lv_len = xstrlen( iv_data ).
lv_char10 = lv_len.
CONDENSE lv_char10.
CONCATENATE iv_type lv_char10 INTO lv_string SEPARATED BY space.
lv_xstring = lcl_convert=>string_to_xstring_utf8( lv_string ).
lv_string = lv_xstring.
CONCATENATE lv_string '00' INTO lv_string.
lv_xstring = lv_string.
CONCATENATE lv_xstring iv_data INTO lv_xstring IN BYTE MODE.
rv_sha1 = sha1_raw( lv_xstring ).
ENDMETHOD. "sha1
ENDCLASS. "lcl_hash IMPLEMENTATION
CLASS lcl_path DEFINITION FINAL.
PUBLIC SECTION.
CLASS-METHODS split_file_location
IMPORTING iv_fullpath TYPE string
EXPORTING ev_path TYPE string
ev_filename TYPE string.
CLASS-METHODS is_root
IMPORTING iv_path TYPE string
RETURNING VALUE(rv_yes) TYPE abap_bool.
CLASS-METHODS is_subdir
IMPORTING iv_path TYPE string
iv_parent TYPE string
RETURNING VALUE(rv_yes) TYPE abap_bool.
CLASS-METHODS change_dir
IMPORTING iv_cur_dir TYPE string
iv_cd TYPE string
RETURNING VALUE(rv_path) TYPE string.
CLASS-METHODS get_filename_from_syspath
IMPORTING iv_path TYPE string
RETURNING VALUE(rv_filename) TYPE string.
ENDCLASS. "lcl_path
CLASS lcl_path IMPLEMENTATION.
METHOD split_file_location.
DATA: lv_cnt TYPE i,
lv_off TYPE i,
lv_len TYPE i.
FIND FIRST OCCURRENCE OF REGEX '^/(.*/)?' IN iv_fullpath
MATCH COUNT lv_cnt
MATCH OFFSET lv_off
MATCH LENGTH lv_len.
IF lv_cnt > 0.
ev_path = iv_fullpath+0(lv_len).
ev_filename = iv_fullpath+lv_len.
ELSE.
CLEAR ev_path.
ev_filename = iv_fullpath.
ENDIF.
ENDMETHOD. "split_file_location
METHOD is_root.
rv_yes = boolc( iv_path = '/' ).
ENDMETHOD. "is_root
METHOD is_subdir.
DATA lv_len TYPE i.
DATA lv_last TYPE i.
lv_len = strlen( iv_parent ).
lv_last = lv_len - 1.
rv_yes = boolc( strlen( iv_path ) > lv_len
AND iv_path+0(lv_len) = iv_parent
AND ( iv_parent+lv_last(1) = '/' OR iv_path+lv_len(1) = '/' ) ).
ENDMETHOD. "is_subdir
METHOD change_dir.
DATA lv_last TYPE i.
DATA lv_temp TYPE string.
lv_last = strlen( iv_cur_dir ) - 1.
IF iv_cd = '' OR iv_cd = '.'. " No change
rv_path = iv_cur_dir.
ELSEIF iv_cd+0(1) = '/'. " Absolute path
rv_path = iv_cd.
ELSEIF iv_cd = '..'. " CD back
IF iv_cur_dir = '/' OR iv_cur_dir = ''. " Back from root = root
rv_path = iv_cur_dir.
ELSE.
lv_temp = reverse( iv_cur_dir ).
IF lv_temp+0(1) = '/'.
SHIFT lv_temp BY 1 PLACES LEFT.
ENDIF.
SHIFT lv_temp UP TO '/' LEFT.
rv_path = reverse( lv_temp ).
ENDIF.
ELSEIF iv_cur_dir+lv_last(1) = '/'. " Append cd to cur_dir separated by /
rv_path = iv_cur_dir && iv_cd.
ELSE.
rv_path = iv_cur_dir && '/' && iv_cd.
ENDIF.
" TODO: improve logic and cases
ENDMETHOD. "change_dir
METHOD get_filename_from_syspath.
DATA: lv_split TYPE c LENGTH 1,
lv_index TYPE i,
lt_split TYPE TABLE OF string.
" filename | c:\filename | /dir/filename | \\server\filename
IF iv_path CA '/'.
lv_split = '/'.
ELSE.
lv_split = '\'.
ENDIF.
SPLIT iv_path AT lv_split INTO TABLE lt_split.
lv_index = lines( lt_split ).
READ TABLE lt_split INDEX lv_index INTO rv_filename.
ENDMETHOD. " get_filename_from_syspath.
ENDCLASS. "lcl_path
*----------------------------------------------------------------------*
* CLASS lcl_url DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_url DEFINITION FINAL.
PUBLIC SECTION.
CLASS-METHODS host
IMPORTING iv_repo TYPE string
RETURNING VALUE(rv_host) TYPE string
RAISING lcx_exception.
CLASS-METHODS name
IMPORTING iv_repo TYPE string
RETURNING VALUE(rv_name) TYPE string
RAISING lcx_exception.
CLASS-METHODS path_name
IMPORTING iv_repo TYPE string
RETURNING VALUE(rv_path_name) TYPE string
RAISING lcx_exception.
PRIVATE SECTION.
CLASS-METHODS regex
IMPORTING iv_repo TYPE string
EXPORTING ev_host TYPE string
ev_path TYPE string
ev_name TYPE string
RAISING lcx_exception.
ENDCLASS. "lcl_repo DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_url IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_url IMPLEMENTATION.
METHOD host.
regex( EXPORTING iv_repo = iv_repo
IMPORTING ev_host = rv_host ).
ENDMETHOD. "host
METHOD name.
regex( EXPORTING iv_repo = iv_repo
IMPORTING ev_name = rv_name ).
ENDMETHOD. "short_name
METHOD path_name.
DATA: lv_host TYPE string.
FIND REGEX '(.*://[^/]*)(.*)' IN iv_repo
SUBMATCHES lv_host rv_path_name.
ENDMETHOD. "path_name
METHOD regex.
FIND REGEX '(.*://[^/]*)(.*/)([^\.]*)[\.git]?' IN iv_repo
SUBMATCHES ev_host ev_path ev_name.
IF sy-subrc <> 0.
lcx_exception=>raise( 'Malformed URL' ).
ENDIF.
ENDMETHOD. "url
ENDCLASS. "lcl_repo IMPLEMENTATION
*----------------------------------------------------------------------*
* CLASS lcl_diff DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_diff DEFINITION FINAL.
PUBLIC SECTION.
CONSTANTS: BEGIN OF c_diff,
insert TYPE c LENGTH 1 VALUE 'I',
delete TYPE c LENGTH 1 VALUE 'D',
update TYPE c LENGTH 1 VALUE 'U',
END OF c_diff.
TYPES: BEGIN OF ty_diff,
new_num TYPE c LENGTH 6,
new TYPE string,
result TYPE c LENGTH 1,
old_num TYPE c LENGTH 6,
old TYPE string,
short TYPE abap_bool,
beacon TYPE i,
END OF ty_diff.
TYPES: ty_diffs_tt TYPE STANDARD TABLE OF ty_diff WITH DEFAULT KEY.
TYPES: BEGIN OF ty_count,
insert TYPE i,
delete TYPE i,
update TYPE i,
END OF ty_count.
DATA mt_beacons TYPE ty_string_tt READ-ONLY.
* assumes data is UTF8 based with newlines
* only works with lines up to 255 characters
METHODS constructor
IMPORTING iv_new TYPE xstring
iv_old TYPE xstring.
METHODS get
RETURNING VALUE(rt_diff) TYPE ty_diffs_tt.
METHODS stats
RETURNING VALUE(rs_count) TYPE ty_count.
PRIVATE SECTION.
DATA mt_diff TYPE ty_diffs_tt.
DATA ms_stats TYPE ty_count.
CLASS-METHODS:
unpack
IMPORTING iv_new TYPE xstring
iv_old TYPE xstring
EXPORTING et_new TYPE abaptxt255_tab
et_old TYPE abaptxt255_tab,
render
IMPORTING it_new TYPE abaptxt255_tab
it_old TYPE abaptxt255_tab
it_delta TYPE vxabapt255_tab
RETURNING VALUE(rt_diff) TYPE ty_diffs_tt,
compute
IMPORTING it_new TYPE abaptxt255_tab
it_old TYPE abaptxt255_tab
RETURNING VALUE(rt_delta) TYPE vxabapt255_tab.
METHODS:
calculate_line_num_and_stats,
map_beacons,
shortlist.
ENDCLASS. "lcl_diff DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_diff IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS lcl_diff IMPLEMENTATION.
METHOD get.
rt_diff = mt_diff.
ENDMETHOD. "get
METHOD stats.
rs_count = ms_stats.
ENDMETHOD. "count
METHOD unpack.
DATA: lv_new TYPE string,
lv_old TYPE string.
lv_new = lcl_convert=>xstring_to_string_utf8( iv_new ).
lv_old = lcl_convert=>xstring_to_string_utf8( iv_old ).
SPLIT lv_new AT gc_newline INTO TABLE et_new.
SPLIT lv_old AT gc_newline INTO TABLE et_old.
ENDMETHOD. "unpack
METHOD compute.
DATA: lt_trdirtab_old TYPE TABLE OF trdir,
lt_trdirtab_new TYPE TABLE OF trdir,
lt_trdir_delta TYPE TABLE OF xtrdir.
CALL FUNCTION 'SVRS_COMPUTE_DELTA_REPS'
TABLES
texttab_old = it_old
texttab_new = it_new
trdirtab_old = lt_trdirtab_old
trdirtab_new = lt_trdirtab_new
trdir_delta = lt_trdir_delta
text_delta = rt_delta.
ENDMETHOD. "compute
METHOD shortlist.
DATA: lv_index TYPE i.
FIELD-SYMBOLS: <ls_diff> LIKE LINE OF mt_diff.
IF lines( mt_diff ) < 20.
LOOP AT mt_diff ASSIGNING <ls_diff>.
<ls_diff>-short = abap_true.
ENDLOOP.
ELSE.
LOOP AT mt_diff TRANSPORTING NO FIELDS
WHERE NOT result IS INITIAL AND short = abap_false.
lv_index = sy-tabix.
DO 8 TIMES. " Backward
READ TABLE mt_diff INDEX ( lv_index - sy-index ) ASSIGNING <ls_diff>.
IF sy-subrc <> 0 OR <ls_diff>-short = abap_true. " tab bound or prev marker
EXIT.
ENDIF.
<ls_diff>-short = abap_true.
ENDDO.
DO 8 TIMES. " Forward
READ TABLE mt_diff INDEX ( lv_index + sy-index - 1 ) ASSIGNING <ls_diff>.
IF sy-subrc <> 0. " tab bound reached
EXIT.
ENDIF.
CHECK <ls_diff>-short = abap_false. " skip marked
<ls_diff>-short = abap_true.
ENDDO.
ENDLOOP.
ENDIF.
ENDMETHOD. " shortlist
METHOD calculate_line_num_and_stats.
DATA: lv_new TYPE i VALUE 1,
lv_old TYPE i VALUE 1.
FIELD-SYMBOLS: <ls_diff> LIKE LINE OF mt_diff.
LOOP AT mt_diff ASSIGNING <ls_diff>.
<ls_diff>-new_num = lv_new.
<ls_diff>-old_num = lv_old.
CASE <ls_diff>-result. " Line nums
WHEN c_diff-delete.
lv_old = lv_old + 1.
CLEAR <ls_diff>-new_num.
WHEN c_diff-insert.
lv_new = lv_new + 1.
CLEAR <ls_diff>-old_num.
WHEN OTHERS.
lv_new = lv_new + 1.
lv_old = lv_old + 1.
ENDCASE.
CASE <ls_diff>-result. " Stats
WHEN c_diff-insert.
ms_stats-insert = ms_stats-insert + 1.
WHEN c_diff-delete.
ms_stats-delete = ms_stats-delete + 1.
WHEN c_diff-update.
ms_stats-update = ms_stats-update + 1.
ENDCASE.
ENDLOOP.
ENDMETHOD. " calculate_line_num_and_stats
METHOD map_beacons.
DEFINE _add_regex.
CREATE OBJECT lo_regex
EXPORTING pattern = &1
ignore_case = abap_true ##NO_TEXT.
APPEND lo_regex TO lt_regex_set.
END-OF-DEFINITION.
DATA: lv_beacon_idx TYPE i,
lv_offs TYPE i,
lv_beacon_str TYPE string,
lv_beacon_2lev TYPE string,
lv_submatch TYPE string,
lo_regex TYPE REF TO cl_abap_regex,
lt_regex_set TYPE TABLE OF REF TO cl_abap_regex.
FIELD-SYMBOLS: <ls_diff> LIKE LINE OF mt_diff.
_add_regex '^\s*(CLASS|FORM|MODULE|REPORT|METHOD)\s'.
_add_regex '^\s*START-OF-'.
_add_regex '^\s*INITIALIZATION(\s|\.)'.
LOOP AT mt_diff ASSIGNING <ls_diff>.
CLEAR lv_offs.
<ls_diff>-beacon = lv_beacon_idx.
LOOP AT lt_regex_set INTO lo_regex. "
FIND FIRST OCCURRENCE OF REGEX lo_regex IN <ls_diff>-new SUBMATCHES lv_submatch.
IF sy-subrc = 0. " Match
lv_beacon_str = <ls_diff>-new.
lv_submatch = to_upper( lv_submatch ).
" Get rid of comments and end of line
FIND FIRST OCCURRENCE OF '.' IN lv_beacon_str MATCH OFFSET lv_offs.
IF sy-subrc <> 0.
FIND FIRST OCCURRENCE OF '"' IN lv_beacon_str MATCH OFFSET lv_offs.
ENDIF.
IF lv_offs > 0.
lv_beacon_str = lv_beacon_str(lv_offs).
ENDIF.
IF lv_submatch = 'CLASS'.
lv_beacon_2lev = lv_beacon_str.
ELSEIF lv_submatch = 'METHOD'.
lv_beacon_str = lv_beacon_2lev && ` => ` && lv_beacon_str.
ENDIF.
APPEND lv_beacon_str TO mt_beacons.
lv_beacon_idx = sy-tabix.
<ls_diff>-beacon = lv_beacon_idx.
EXIT. "Loop
ENDIF.
ENDLOOP.
ENDLOOP.
ENDMETHOD. " map_beacons
METHOD constructor.
DATA: lt_delta TYPE vxabapt255_tab,
lt_new TYPE abaptxt255_tab,
lt_old TYPE abaptxt255_tab.
unpack( EXPORTING iv_new = iv_new
iv_old = iv_old
IMPORTING et_new = lt_new
et_old = lt_old ).
lt_delta = compute( it_new = lt_new
it_old = lt_old ).
mt_diff = render( it_new = lt_new
it_old = lt_old
it_delta = lt_delta ).
calculate_line_num_and_stats( ).
map_beacons( ).
shortlist( ).
ENDMETHOD. "diff
METHOD render.
DEFINE _append.
CLEAR ls_diff.
ls_diff-new = &1.
ls_diff-result = &2.
ls_diff-old = &3.
APPEND ls_diff TO rt_diff.
END-OF-DEFINITION.
DATA: lv_oindex TYPE i VALUE 1,
lv_nindex TYPE i VALUE 1,
ls_new LIKE LINE OF it_new,
ls_old LIKE LINE OF it_old,
ls_diff LIKE LINE OF rt_diff,
lt_delta LIKE it_delta,
ls_delta LIKE LINE OF it_delta.
lt_delta = it_delta.
DO.
READ TABLE lt_delta INTO ls_delta WITH KEY number = lv_oindex.
IF sy-subrc = 0.
DELETE lt_delta INDEX sy-tabix.
CASE ls_delta-vrsflag.
WHEN c_diff-delete.
_append '' c_diff-delete ls_delta-line.
lv_oindex = lv_oindex + 1.
WHEN c_diff-insert.
_append ls_delta-line c_diff-insert ''.
lv_nindex = lv_nindex + 1.
WHEN c_diff-update.
CLEAR ls_new.
READ TABLE it_new INTO ls_new INDEX lv_nindex.
ASSERT sy-subrc = 0.
_append ls_new c_diff-update ls_delta-line.
lv_nindex = lv_nindex + 1.
lv_oindex = lv_oindex + 1.
WHEN OTHERS.
ASSERT 0 = 1.
ENDCASE.
ELSE.
CLEAR ls_new.
READ TABLE it_new INTO ls_new INDEX lv_nindex. "#EC CI_SUBRC
lv_nindex = lv_nindex + 1.
CLEAR ls_old.
READ TABLE it_old INTO ls_old INDEX lv_oindex. "#EC CI_SUBRC
lv_oindex = lv_oindex + 1.
_append ls_new '' ls_old.
ENDIF.
IF lv_nindex > lines( it_new ) AND lv_oindex > lines( it_old ).
EXIT. " current loop
ENDIF.
ENDDO.
ENDMETHOD. " render
ENDCLASS. "lcl_diff IMPLEMENTATION
CLASS lcl_login_manager DEFINITION FINAL.
PUBLIC SECTION.
CLASS-METHODS:
load
IMPORTING iv_uri TYPE string
ii_client TYPE REF TO if_http_client OPTIONAL
RETURNING VALUE(rv_authorization) TYPE string
RAISING lcx_exception,
save
IMPORTING iv_uri TYPE string
ii_client TYPE REF TO if_http_client
RAISING lcx_exception,
clear,
set
IMPORTING iv_uri TYPE string
iv_username TYPE string
iv_password TYPE string
RETURNING VALUE(rv_auth) TYPE string
RAISING lcx_exception.
PRIVATE SECTION.
TYPES: BEGIN OF ty_auth,
uri TYPE string,
authorization TYPE string,
END OF ty_auth.
CLASS-DATA: gt_auth TYPE TABLE OF ty_auth WITH DEFAULT KEY.
CLASS-METHODS:
append
IMPORTING iv_uri TYPE string
iv_auth TYPE string
RAISING lcx_exception.
ENDCLASS.
CLASS lcl_login_manager IMPLEMENTATION.
METHOD clear.
CLEAR gt_auth.
ENDMETHOD.
METHOD set.
DATA: lv_concat TYPE string.
ASSERT NOT iv_uri IS INITIAL.
IF iv_username IS INITIAL OR iv_password IS INITIAL.
RETURN.
ENDIF.
CONCATENATE iv_username ':' iv_password INTO lv_concat.
rv_auth = cl_http_utility=>if_http_utility~encode_base64( lv_concat ).
CONCATENATE 'Basic' rv_auth INTO rv_auth
SEPARATED BY space ##NO_TEXT.
append( iv_uri = iv_uri
iv_auth = rv_auth ).
ENDMETHOD.
METHOD load.
DATA: ls_auth LIKE LINE OF gt_auth.
READ TABLE gt_auth INTO ls_auth WITH KEY uri = lcl_url=>host( iv_uri ).
IF sy-subrc = 0.
rv_authorization = ls_auth-authorization.
IF NOT ii_client IS INITIAL.
ii_client->request->set_header_field(
name = 'authorization'
value = ls_auth-authorization ). "#EC NOTEXT
ii_client->propertytype_logon_popup = ii_client->co_disabled.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD save.
DATA: lv_auth TYPE string.
lv_auth = ii_client->request->get_header_field( 'authorization' ). "#EC NOTEXT
IF NOT lv_auth IS INITIAL.
append( iv_uri = iv_uri
iv_auth = lv_auth ).
ENDIF.
ENDMETHOD.
METHOD append.
FIELD-SYMBOLS: <ls_auth> LIKE LINE OF gt_auth.
READ TABLE gt_auth WITH KEY uri = lcl_url=>host( iv_uri )
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
APPEND INITIAL LINE TO gt_auth ASSIGNING <ls_auth>.
<ls_auth>-uri = lcl_url=>host( iv_uri ).
<ls_auth>-authorization = iv_auth.
ENDIF.
ENDMETHOD.
ENDCLASS.
CLASS lcl_progress DEFINITION FINAL.
PUBLIC SECTION.
CLASS-METHODS:
show
IMPORTING
iv_key TYPE string
VALUE(iv_current) TYPE i
iv_total TYPE i
iv_text TYPE csequence.
PRIVATE SECTION.
CLASS-METHODS:
calc_pct
IMPORTING iv_current TYPE i
iv_total TYPE i
RETURNING VALUE(rv_pct) TYPE i.
ENDCLASS.
CLASS lcl_progress IMPLEMENTATION.
METHOD show.
DATA: lv_pct TYPE i,
lv_text TYPE string.
lv_pct = calc_pct( iv_current = iv_current
iv_total = iv_total ).
CONCATENATE iv_key '-' iv_text INTO lv_text SEPARATED BY space.
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
EXPORTING
percentage = lv_pct
text = lv_text.
ENDMETHOD.
METHOD calc_pct.
DATA: lv_f TYPE f.
lv_f = ( iv_current / iv_total ) * 100.
rv_pct = lv_f.
IF rv_pct = 100.
rv_pct = 99.
ENDIF.
ENDMETHOD.
ENDCLASS.
CLASS lcl_log DEFINITION FINAL.
PUBLIC SECTION.
METHODS:
add
IMPORTING
iv_msgv1 TYPE csequence
iv_msgv2 TYPE csequence OPTIONAL
iv_msgv3 TYPE csequence OPTIONAL
iv_msgv4 TYPE csequence OPTIONAL
iv_rc TYPE balsort OPTIONAL,
count
RETURNING VALUE(rv_count) TYPE i,
to_html
RETURNING VALUE(ro_html) TYPE REF TO lcl_html,
clear,
has_rc "For unit tests mainly
IMPORTING iv_rc TYPE balsort
RETURNING VALUE(rv_yes) TYPE abap_bool,
show.
PRIVATE SECTION.
DATA: mt_log TYPE rs_t_msg.
ENDCLASS.
CLASS lcl_log IMPLEMENTATION.
METHOD to_html.
DATA: lv_string TYPE string.
FIELD-SYMBOLS: <ls_log> LIKE LINE OF mt_log.
CREATE OBJECT ro_html.
IF count( ) = 0.
RETURN.
ENDIF.
LOOP AT mt_log ASSIGNING <ls_log>.
CONCATENATE <ls_log>-msgv1 <ls_log>-msgv2 <ls_log>-msgv3 <ls_log>-msgv4
INTO lv_string SEPARATED BY space.
ro_html->add( '<span class="error">' ).
ro_html->add_icon( iv_name = 'alert' iv_class = 'error' ). " warning CSS exists too
ro_html->add( lv_string ).
ro_html->add( '</span>' ).
ENDLOOP.
ENDMETHOD.
METHOD add.
FIELD-SYMBOLS: <ls_log> LIKE LINE OF mt_log.
APPEND INITIAL LINE TO mt_log ASSIGNING <ls_log>.
<ls_log>-msgty = 'W'.
<ls_log>-msgid = '00'.
<ls_log>-msgno = '001'.
<ls_log>-msgv1 = iv_msgv1.
<ls_log>-msgv2 = iv_msgv2.
<ls_log>-msgv3 = iv_msgv3.
<ls_log>-msgv4 = iv_msgv4.
<ls_log>-alsort = iv_rc. " Error code for unit test, not sure about better field
ENDMETHOD.
METHOD show.
CALL FUNCTION 'RSDC_SHOW_MESSAGES_POPUP'
EXPORTING
i_t_msg = mt_log
i_txt = 'Warning'
i_with_s_on_empty = abap_false
i_one_msg_direct = abap_false
i_one_msg_type_s = abap_false
##no_text.
ENDMETHOD.
METHOD count.
rv_count = lines( mt_log ).
ENDMETHOD.
METHOD clear.
CLEAR mt_log.
ENDMETHOD. " clear.
METHOD has_rc.
READ TABLE mt_log WITH KEY alsort = iv_rc TRANSPORTING NO FIELDS.
rv_yes = boolc( sy-subrc = 0 ).
ENDMETHOD. "has_rc
ENDCLASS.
| [
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,
3843,
4146,
198,
9,
5,
10097,
30934,
9,
198,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
565,
62,
2435,
5550,
20032,
17941,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
31631,
300,
565,
62,
2435,
5550,
20032,
17941,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
1259,
62,
403,
6346,
524,
41876,
269,
406,
49494,
1467,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
651,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
2435,
8,
41876,
1259,
62,
403,
6346,
524,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
300,
66,
87,
62,
1069,
4516,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
269,
62,
538,
5374,
41876,
4818,
388,
26173,
8924,
705,
24991,
8298,
486,
4458,
198,
198,
10619,
31631,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
75,
565,
62,
2435,
5550,
20032,
17941,
198,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
565,
62,
2435,
30023,
2538,
10979,
6234,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
31631,
300,
565,
62,
2435,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
651,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
72,
220,
220,
220,
220,
220,
220,
41876,
1312,
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,
198,
220,
220,
220,
300,
85,
62,
72,
796,
827,
12,
19608,
388,
532,
269,
62,
538,
5374,
13,
198,
220,
220,
220,
300,
85,
62,
72,
796,
300,
85,
62,
72,
1635,
807,
2414,
405,
13,
198,
220,
220,
220,
300,
85,
62,
72,
796,
300,
85,
62,
72,
1343,
827,
12,
84,
2736,
270,
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,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
300,
66,
87,
62,
1069,
4516,
14804,
40225,
7,
705,
7575,
11340,
4049,
6,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
42001,
300,
85,
62,
315,
6359,
570,
13,
198,
220,
220,
220,
220,
220,
42099,
705,
10,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
72,
796,
300,
85,
62,
72,
532,
300,
85,
62,
315,
10210,
733,
13,
198,
220,
220,
220,
220,
220,
42099,
705,
12,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
72,
796,
300,
85,
62,
72,
1343,
300,
85,
62,
315,
10210,
733,
13,
198,
220,
220,
220,
23578,
34,
11159,
13,
628,
220,
220,
220,
374,
85,
62,
2435,
796,
300,
85,
62,
72,
13,
198,
220,
220,
220,
7102,
35,
24290,
374,
85,
62,
2435,
13,
198,
220,
220,
220,
374,
85,
62,
2435,
10,
1157,
796,
300,
85,
62,
315,
6359,
570,
13,
198,
220,
220,
220,
374,
85,
62,
2435,
10,
1065,
796,
300,
85,
62,
315,
10210,
733,
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,
1136,
198,
198,
10619,
31631,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
75,
565,
62,
2435,
30023,
2538,
10979,
6234,
198,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
565,
62,
1102,
1851,
5550,
20032,
17941,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
31631,
300,
565,
62,
1102,
1851,
5550,
20032,
17941,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
1643,
26327,
62,
1462,
62,
600,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
9895,
220,
220,
220,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_object_nrob DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
PROTECTED SECTION.
PRIVATE SECTION.
METHODS:
delete_intervals IMPORTING iv_object TYPE inri-object
RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_NROB IMPLEMENTATION.
METHOD delete_intervals.
DATA: lv_error TYPE c LENGTH 1,
ls_error TYPE inrer,
lt_list TYPE STANDARD TABLE OF inriv WITH DEFAULT KEY,
lt_error_iv TYPE STANDARD TABLE OF inriv WITH DEFAULT KEY.
FIELD-SYMBOLS: <ls_list> LIKE LINE OF lt_list.
CALL FUNCTION 'NUMBER_RANGE_INTERVAL_LIST'
EXPORTING
object = iv_object
TABLES
interval = lt_list
EXCEPTIONS
nr_range_nr1_not_found = 1
nr_range_nr1_not_intern = 2
nr_range_nr2_must_be_space = 3
nr_range_nr2_not_extern = 4
nr_range_nr2_not_found = 5
object_not_found = 6
subobject_must_be_space = 7
subobject_not_found = 8
OTHERS = 9.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from NUMBER_RANGE_INTERVAL_LIST' ).
ENDIF.
IF lines( lt_list ) = 0.
RETURN.
ENDIF.
LOOP AT lt_list ASSIGNING <ls_list>.
CLEAR <ls_list>-nrlevel.
<ls_list>-procind = 'D'.
ENDLOOP.
CALL FUNCTION 'NUMBER_RANGE_INTERVAL_UPDATE'
EXPORTING
object = iv_object
IMPORTING
error = ls_error
error_occured = lv_error
TABLES
error_iv = lt_error_iv
interval = lt_list
EXCEPTIONS
object_not_found = 1
OTHERS = 2.
IF sy-subrc <> 0 OR lv_error = abap_true.
zcx_abapgit_exception=>raise( 'error from NUMBER_RANGE_INTERVAL_UPDATE' ).
ENDIF.
CALL FUNCTION 'NUMBER_RANGE_UPDATE_CLOSE'
EXPORTING
object = iv_object
EXCEPTIONS
no_changes_made = 1
object_not_initialized = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from NUMBER_RANGE_UPDATE_CLOSE' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
DATA: lv_objectid TYPE cdhdr-objectid,
lt_cdhdr TYPE cdhdr_tab.
FIELD-SYMBOLS: <ls_cdhdr> LIKE LINE OF lt_cdhdr.
lv_objectid = ms_item-obj_name.
CALL FUNCTION 'CHANGEDOCUMENT_READ_HEADERS'
EXPORTING
objectclass = 'NRKROBJ'
objectid = lv_objectid
TABLES
i_cdhdr = lt_cdhdr
EXCEPTIONS
no_position_found = 1
wrong_access_to_archive = 2
time_zone_conversion_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
rv_user = c_user_unknown.
RETURN.
ENDIF.
SORT lt_cdhdr BY udate DESCENDING utime DESCENDING.
READ TABLE lt_cdhdr INDEX 1 ASSIGNING <ls_cdhdr>.
ASSERT sy-subrc = 0.
rv_user = <ls_cdhdr>-username.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_object TYPE tnro-object.
lv_object = ms_item-obj_name.
delete_intervals( lv_object ).
CALL FUNCTION 'NUMBER_RANGE_OBJECT_DELETE'
EXPORTING
language = mv_language
object = lv_object
EXCEPTIONS
delete_not_allowed = 1
object_not_found = 2
wrong_indicator = 3
OTHERS = 4.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from NUMBER_RANGE_OBJECT_DELETE' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lt_errors TYPE TABLE OF inoer,
ls_attributes TYPE tnro,
ls_text TYPE tnrot.
io_xml->read( EXPORTING iv_name = 'ATTRIBUTES'
CHANGING cg_data = ls_attributes ).
io_xml->read( EXPORTING iv_name = 'TEXT'
CHANGING cg_data = ls_text ).
CALL FUNCTION 'NUMBER_RANGE_OBJECT_UPDATE'
EXPORTING
indicator = 'I'
object_attributes = ls_attributes
object_text = ls_text
TABLES
errors = lt_errors
EXCEPTIONS
object_already_exists = 1
object_attributes_missing = 2
object_not_found = 3
object_text_missing = 4
wrong_indicator = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from NUMBER_RANGE_OBJECT_UPDATE' ).
ENDIF.
CALL FUNCTION 'NUMBER_RANGE_OBJECT_CLOSE'
EXPORTING
object = ls_attributes-object
EXCEPTIONS
object_not_initialized = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from NUMBER_RANGE_OBJECT_CLOSE' ).
ENDIF.
tadir_insert( iv_package ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_object TYPE tnro-object.
SELECT SINGLE object FROM tnro INTO lv_object
WHERE object = 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.
DATA: ls_meta TYPE zif_abapgit_definitions=>ty_metadata.
ls_meta = zif_abapgit_object~get_metadata( ).
IF ls_meta-late_deser = abap_true.
APPEND zif_abapgit_object=>gc_step_id-late TO rt_steps.
ELSEIF ls_meta-ddic = abap_true.
APPEND zif_abapgit_object=>gc_step_id-ddic TO rt_steps.
ELSE.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-late_deser = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
DATA: ls_bcdata TYPE bdcdata,
lt_bcdata TYPE STANDARD TABLE OF bdcdata.
ls_bcdata-program = 'SAPMSNRO'.
ls_bcdata-dynpro = '0150'.
ls_bcdata-dynbegin = 'X'.
APPEND ls_bcdata TO lt_bcdata.
CLEAR ls_bcdata.
ls_bcdata-fnam = 'NRIV-OBJECT'.
ls_bcdata-fval = ms_item-obj_name.
APPEND ls_bcdata TO lt_bcdata.
CLEAR ls_bcdata.
ls_bcdata-fnam = 'BDC_OKCODE'.
ls_bcdata-fval = '=DISP'.
APPEND ls_bcdata TO lt_bcdata.
CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
STARTING NEW TASK 'GIT'
EXPORTING
tcode = 'SNRO'
mode_val = 'E'
TABLES
using_tab = lt_bcdata
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from ABAP4_CALL_TRANSACTION, NROB' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lv_object TYPE tnro-object,
ls_attributes TYPE tnro,
ls_text TYPE tnrot.
lv_object = ms_item-obj_name.
CALL FUNCTION 'NUMBER_RANGE_OBJECT_READ'
EXPORTING
language = mv_language
object = lv_object
IMPORTING
object_attributes = ls_attributes
object_text = ls_text
EXCEPTIONS
object_not_found = 1
OTHERS = 2.
IF sy-subrc = 1.
RETURN.
ELSEIF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from NUMBER_RANGE_OBJECT_READ' ).
ENDIF.
io_xml->add( iv_name = 'ATTRIBUTES'
ig_data = ls_attributes ).
io_xml->add( iv_name = 'TEXT'
ig_data = ls_text ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
77,
22609,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
12233,
62,
3849,
12786,
30023,
9863,
2751,
21628,
62,
15252,
41876,
287,
380,
12,
15252,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
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,
24723,
9864,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
12233,
62,
3849,
12786,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
18224,
220,
220,
220,
41876,
269,
406,
49494,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
18224,
220,
220,
220,
41876,
287,
11751,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
4868,
220,
220,
220,
220,
41876,
49053,
9795,
43679,
3963,
287,
15104,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
18224,
62,
452,
41876,
49053,
9795,
43679,
3963,
287,
15104,
13315,
5550,
38865,
35374,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
4868,
29,
34178,
48920,
3963,
300,
83,
62,
4868,
13,
628,
198,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
41359,
13246,
62,
49,
27746,
62,
41358,
23428,
62,
45849,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
15252,
198,
220,
220,
220,
220,
220,
309,
6242,
28378,
198,
220,
220,
220,
220,
220,
220,
220,
16654,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
83,
62,
4868,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
299,
81,
62,
9521,
62,
48624,
16,
62,
1662,
62,
9275,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
299,
81,
62,
9521,
62,
48624,
16,
62,
1662,
62,
23124,
220,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
299,
81,
62,
9521,
62,
48624,
17,
62,
27238,
62,
1350,
62,
13200,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
299,
81,
62,
9521,
62,
48624,
17,
62,
1662,
62,
1069,
759,
220,
220,
220,
796,
604,
198,
220,
220,
220,
220,
220,
220,
220,
299,
81,
62,
9521,
62,
48624,
17,
62,
1662,
62,
9275,
220,
220,
220,
220,
796,
642,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
1662,
62,
9275,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
718,
198,
220,
220,
220,
220,
220,
220,
220,
850,
15252,
62,
27238,
62,
1350,
62,
13200,
220,
220,
220,
796,
767,
198,
220,
220,
220,
220,
220,
220,
220,
850,
15252,
62,
1662,
62,
9275,
220,
220,
220,
220,
220,
220,
220,
796,
807,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
860,
13,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
18224,
422,
36871,
13246,
62,
49,
27746,
62,
41358,
23428,
62,
45849,
6,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
16876,
3951,
7,
300,
83,
62,
4868,
1267,
796,
657,
13,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
17579,
3185,
5161,
300,
83,
62,
4868,
24994,
3528,
15871,
1279,
7278,
62,
4868,
28401,
198,
220,
220,
220,
220,
220,
30301,
1503,
1279,
7278,
62,
4868,
29,
12,
48624,
5715,
13,
198,
220,
220,
220,
220,
220,
1279,
7278,
62,
4868,
29,
12,
36942,
521,
796,
705,
35,
4458,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
41359,
13246,
62,
49,
27746,
62,
41358,
23428,
62,
16977,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
15252,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
43979,
62,
18224,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
62,
13966,
1522,
220,
220,
220,
796,
300,
85,
62,
18224,
198,
220,
220,
220,
220,
220,
309,
6242,
28378,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
62,
452,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
83,
62,
18224,
62,
452,
198,
220,
220,
220,
220,
220,
220,
220,
16654,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
83,
62,
4868,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
1662,
62,
9275,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4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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
] |
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
CLASS lcl_demo_140 DEFINITION FINAL INHERITING FROM lcl_demo_010.
PUBLIC SECTION.
METHODS:
get_desc_text REDEFINITION,
get_url_base REDEFINITION,
get_templates REDEFINITION.
ENDCLASS.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
CLASS lcl_demo_140 IMPLEMENTATION.
METHOD get_desc_text.
rv_desc_text = ';type=block'(140).
ENDMETHOD.
METHOD get_url_base.
rv_url_base = '/xtt/block/'.
ENDMETHOD.
METHOD get_templates.
APPEND `ZXXT_DEMO_140-XLSX` TO rt_templates.
APPEND `ZXXT_DEMO_140-DOCX` TO rt_templates.
APPEND `ZXXT_DEMO_140-XDP` TO rt_templates.
ENDMETHOD.
ENDCLASS.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
10097,
30934,
9,
198,
31631,
300,
565,
62,
9536,
78,
62,
15187,
5550,
20032,
17941,
25261,
3268,
16879,
2043,
2751,
16034,
300,
565,
62,
9536,
78,
62,
20943,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
651,
62,
20147,
62,
5239,
220,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
651,
62,
6371,
62,
8692,
220,
220,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
651,
62,
11498,
17041,
220,
23848,
36,
20032,
17941,
13,
198,
10619,
31631,
13,
198,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
10097,
30934,
9,
198,
31631,
300,
565,
62,
9536,
78,
62,
15187,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
651,
62,
20147,
62,
5239,
13,
198,
220,
220,
220,
374,
85,
62,
20147,
62,
5239,
796,
705,
26,
4906,
28,
9967,
6,
7,
15187,
737,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
6371,
62,
8692,
13,
198,
220,
220,
220,
374,
85,
62,
6371,
62,
8692,
796,
31051,
742,
83,
14,
9967,
14,
4458,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
11498,
17041,
13,
198,
220,
220,
220,
43504,
10619,
4600,
57,
8051,
51,
62,
39429,
46,
62,
15187,
12,
55,
6561,
55,
63,
5390,
374,
83,
62,
11498,
17041,
13,
198,
220,
220,
220,
43504,
10619,
4600,
57,
8051,
51,
62,
39429,
46,
62,
15187,
12,
38715,
55,
63,
5390,
374,
83,
62,
11498,
17041,
13,
198,
220,
220,
220,
43504,
10619,
4600,
57,
8051,
51,
62,
39429,
46,
62,
15187,
12,
55,
6322,
63,
220,
5390,
374,
83,
62,
11498,
17041,
13,
198,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_object_ddls DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
PROTECTED SECTION.
METHODS open_adt_stob
IMPORTING iv_ddls_name TYPE tadir-obj_name
RAISING zcx_abapgit_exception.
PRIVATE SECTION.
METHODS is_baseinfo_supported
RETURNING
VALUE(rv_supported) TYPE abap_bool .
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_DDLS IMPLEMENTATION.
METHOD is_baseinfo_supported.
DATA:
lr_data_baseinfo TYPE REF TO data,
lx_error TYPE REF TO cx_root.
TRY.
CREATE DATA lr_data_baseinfo TYPE ('IF_DD_DDL_TYPES=>TY_S_BASEINFO_STRING_SAVE').
rv_supported = abap_true.
CATCH cx_root INTO lx_error.
rv_supported = abap_false.
ENDTRY.
ENDMETHOD.
METHOD open_adt_stob.
DATA: lr_data TYPE REF TO data,
lo_ddl TYPE REF TO object,
lx_error TYPE REF TO cx_root.
FIELD-SYMBOLS: <lt_ddnames> TYPE STANDARD TABLE.
FIELD-SYMBOLS: <lt_entity_view> TYPE STANDARD TABLE.
FIELD-SYMBOLS: <lg_ddnames> TYPE any.
FIELD-SYMBOLS: <lg_entity_view> TYPE any.
FIELD-SYMBOLS: <lg_ddname> TYPE any.
FIELD-SYMBOLS: <lg_ddlname> TYPE any.
TRY.
CREATE DATA lr_data TYPE ('IF_DD_DDL_TYPES=>TY_T_DDOBJ').
ASSIGN lr_data->* TO <lt_ddnames>.
CREATE DATA lr_data LIKE LINE OF <lt_ddnames>.
ASSIGN lr_data->* TO <lg_ddnames>.
CREATE DATA lr_data TYPE ('IF_DD_DDL_TYPES=>TY_T_ENTITY_OF_VIEW').
ASSIGN lr_data->* TO <lt_entity_view>.
CREATE DATA lr_data LIKE LINE OF <lt_entity_view>.
ASSIGN lr_data->* TO <lg_entity_view>.
CLEAR <lt_ddnames>.
ASSIGN COMPONENT 'NAME' OF STRUCTURE <lg_ddnames> TO <lg_ddname>.
<lg_ddname> = iv_ddls_name.
INSERT <lg_ddnames> INTO TABLE <lt_ddnames>.
CALL METHOD ('CL_DD_DDL_HANDLER_FACTORY')=>('CREATE')
RECEIVING
handler = lo_ddl.
CALL METHOD lo_ddl->('IF_DD_DDL_HANDLER~GET_VIEWNAME_FROM_ENTITYNAME')
EXPORTING
ddnames = <lt_ddnames>
IMPORTING
view_of_entity = <lt_entity_view>.
READ TABLE <lt_entity_view> ASSIGNING <lg_entity_view> INDEX 1.
IF sy-subrc = 0.
ASSIGN COMPONENT 'DDLNAME' OF STRUCTURE <lg_entity_view> TO <lg_ddlname>.
jump_adt( iv_obj_name = <lg_ddlname>
iv_obj_type = 'DDLS' ).
ENDIF.
CATCH cx_root INTO lx_error.
zcx_abapgit_exception=>raise( iv_text = lx_error->get_text( )
ix_previous = lx_error ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
DATA: lo_ddl TYPE REF TO object,
lr_data TYPE REF TO data,
lx_error TYPE REF TO cx_root.
FIELD-SYMBOLS: <lg_data> TYPE any,
<lg_field> TYPE any.
CREATE DATA lr_data TYPE ('DDDDLSRCV').
ASSIGN lr_data->* TO <lg_data>.
CALL METHOD ('CL_DD_DDL_HANDLER_FACTORY')=>('CREATE')
RECEIVING
handler = lo_ddl.
TRY.
CALL METHOD lo_ddl->('IF_DD_DDL_HANDLER~READ')
EXPORTING
name = ms_item-obj_name
get_state = 'A'
IMPORTING
ddddlsrcv_wa = <lg_data>.
ASSIGN COMPONENT 'AS4USER' OF STRUCTURE <lg_data> TO <lg_field>.
IF sy-subrc = 0.
rv_user = <lg_field>.
ENDIF.
CATCH cx_root INTO lx_error.
zcx_abapgit_exception=>raise( iv_text = lx_error->get_text( )
ix_previous = lx_error ).
ENDTRY.
IF rv_user IS INITIAL.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lo_ddl TYPE REF TO object,
lx_error TYPE REF TO cx_root.
CALL METHOD ('CL_DD_DDL_HANDLER_FACTORY')=>('CREATE')
RECEIVING
handler = lo_ddl.
TRY.
CALL METHOD lo_ddl->('IF_DD_DDL_HANDLER~DELETE')
EXPORTING
name = ms_item-obj_name.
CATCH cx_root INTO lx_error.
zcx_abapgit_exception=>raise(
iv_text = |DDLS, { ms_item-obj_name } { lx_error->get_text( ) }|
ix_previous = lx_error ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA:
lo_ddl TYPE REF TO object,
lr_data TYPE REF TO data,
lr_data_baseinfo TYPE REF TO data,
lx_error TYPE REF TO cx_root.
FIELD-SYMBOLS:
<lg_data> TYPE any,
<lg_data_baseinfo> TYPE any,
<lg_source> TYPE any,
<lg_baseinfo_string> TYPE any,
<lg_baseinfo_ddlname> TYPE any.
TRY.
CREATE DATA lr_data TYPE ('DDDDLSRCV').
ASSIGN lr_data->* TO <lg_data>.
io_xml->read( EXPORTING iv_name = 'DDLS'
CHANGING cg_data = <lg_data> ).
ASSIGN COMPONENT 'SOURCE' OF STRUCTURE <lg_data> TO <lg_source>.
ASSERT sy-subrc = 0.
<lg_source> = mo_files->read_string( 'asddls' ) ##no_text.
CALL METHOD ('CL_DD_DDL_HANDLER_FACTORY')=>('CREATE')
RECEIVING
handler = lo_ddl.
IF is_baseinfo_supported( ) = abap_true.
CREATE DATA lr_data_baseinfo TYPE ('IF_DD_DDL_TYPES=>TY_S_BASEINFO_STRING_SAVE').
ASSIGN lr_data_baseinfo->* TO <lg_data_baseinfo>.
ASSIGN COMPONENT 'BASEINFO_STRING' OF STRUCTURE <lg_data_baseinfo> TO <lg_baseinfo_string>.
ASSERT sy-subrc = 0.
<lg_baseinfo_string> = mo_files->read_string( 'baseinfo' ) ##no_text.
ASSIGN COMPONENT 'DDLNAME' OF STRUCTURE <lg_data_baseinfo> TO <lg_baseinfo_ddlname>.
ASSERT sy-subrc = 0.
<lg_baseinfo_ddlname> = ms_item-obj_name.
CALL METHOD lo_ddl->('IF_DD_DDL_HANDLER~SAVE')
EXPORTING
name = ms_item-obj_name
put_state = 'N'
ddddlsrcv_wa = <lg_data>
baseinfo_string = <lg_data_baseinfo>.
ELSE.
CALL METHOD lo_ddl->('IF_DD_DDL_HANDLER~SAVE')
EXPORTING
name = ms_item-obj_name
put_state = 'N'
ddddlsrcv_wa = <lg_data>.
ENDIF.
CALL METHOD lo_ddl->('IF_DD_DDL_HANDLER~WRITE_TADIR')
EXPORTING
objectname = ms_item-obj_name
devclass = iv_package
prid = 0.
corr_insert( iv_package ).
CATCH cx_root INTO lx_error.
zcx_abapgit_exception=>raise( iv_text = lx_error->get_text( )
ix_previous = lx_error ).
ENDTRY.
zcl_abapgit_objects_activation=>add_item( ms_item ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_state TYPE objstate,
lo_ddl TYPE REF TO object.
CALL METHOD ('CL_DD_DDL_HANDLER_FACTORY')=>('CREATE')
RECEIVING
handler = lo_ddl.
TRY.
CALL METHOD lo_ddl->('IF_DD_DDL_HANDLER~READ')
EXPORTING
name = ms_item-obj_name
get_state = 'A'
IMPORTING
got_state = lv_state.
IF lv_state IS INITIAL.
rv_bool = abap_false.
ELSE.
rv_bool = abap_true.
ENDIF.
CATCH cx_root.
rv_bool = abap_false.
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-ddic TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-ddic = abap_true.
rs_metadata-delete_tadir = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = exists_a_lock_entry_for( iv_lock_object = 'ESDICT'
iv_argument = |{ ms_item-obj_type }{ ms_item-obj_name }| ).
ENDMETHOD.
METHOD zif_abapgit_object~jump.
DATA: lv_typename TYPE typename.
DATA: lv_ddtypekind TYPE ddtypekind.
lv_typename = ms_item-obj_name.
CALL FUNCTION 'DDIF_TYPEINFO_GET'
EXPORTING
typename = lv_typename
IMPORTING
typekind = lv_ddtypekind.
CASE lv_ddtypekind.
WHEN 'STOB'.
me->open_adt_stob( ms_item-obj_name ).
WHEN OTHERS.
zcx_abapgit_exception=>raise( 'DDLS Jump Error' ).
ENDCASE.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lo_ddl TYPE REF TO object,
lr_data TYPE REF TO data,
lr_data_baseinfo TYPE REF TO data,
lt_clr_comps TYPE STANDARD TABLE OF fieldname WITH DEFAULT KEY,
lx_error TYPE REF TO cx_root.
FIELD-SYMBOLS: <lg_data> TYPE any,
<lg_field> TYPE any,
<lv_comp> LIKE LINE OF lt_clr_comps,
<lg_data_baseinfo> TYPE ANY TABLE,
<ls_data_baseinfo> TYPE any,
<lg_ddlname> TYPE any,
<lg_as4local> TYPE any.
TRY.
CREATE DATA lr_data TYPE ('DDDDLSRCV').
ASSIGN lr_data->* TO <lg_data>.
CALL METHOD ('CL_DD_DDL_HANDLER_FACTORY')=>('CREATE')
RECEIVING
handler = lo_ddl.
IF is_baseinfo_supported( ) = abap_true.
CREATE DATA lr_data_baseinfo TYPE ('IF_DD_DDL_TYPES=>TY_T_BASEINFO_STRING').
ASSIGN lr_data_baseinfo->* TO <lg_data_baseinfo>.
ASSIGN lr_data_baseinfo->* TO <ls_data_baseinfo>.
CALL METHOD lo_ddl->('IF_DD_DDL_HANDLER~READ')
EXPORTING
name = ms_item-obj_name
get_state = 'A'
IMPORTING
ddddlsrcv_wa = <lg_data>
baseinfo_string = <lg_data_baseinfo>.
LOOP AT <lg_data_baseinfo> ASSIGNING <ls_data_baseinfo>.
ASSIGN COMPONENT 'DDLNAME' OF STRUCTURE <ls_data_baseinfo> TO <lg_ddlname>.
ASSERT sy-subrc = 0.
ASSIGN COMPONENT 'AS4LOCAL' OF STRUCTURE <ls_data_baseinfo> TO <lg_as4local>.
ASSERT sy-subrc = 0.
IF <lg_ddlname> = ms_item-obj_name AND <lg_as4local> = 'A'.
ASSIGN COMPONENT 'BASEINFO_STRING' OF STRUCTURE <ls_data_baseinfo> TO <lg_field>.
ASSERT sy-subrc = 0.
mo_files->add_string( iv_ext = 'baseinfo'
iv_string = <lg_field> ) ##no_text.
EXIT.
ENDIF.
ENDLOOP.
ELSE.
CALL METHOD lo_ddl->('IF_DD_DDL_HANDLER~READ')
EXPORTING
name = ms_item-obj_name
get_state = 'A'
IMPORTING
ddddlsrcv_wa = <lg_data>.
ENDIF.
CATCH cx_root INTO lx_error.
zcx_abapgit_exception=>raise( iv_text = lx_error->get_text( )
ix_previous = lx_error ).
ENDTRY.
APPEND 'AS4USER' TO lt_clr_comps.
APPEND 'AS4DATE' TO lt_clr_comps.
APPEND 'AS4TIME' TO lt_clr_comps.
APPEND 'ACTFLAG' TO lt_clr_comps.
APPEND 'CHGFLAG' TO lt_clr_comps.
APPEND 'ABAP_LANGUAGE_VERSION' TO lt_clr_comps.
LOOP AT lt_clr_comps ASSIGNING <lv_comp>.
ASSIGN COMPONENT <lv_comp> OF STRUCTURE <lg_data> TO <lg_field>.
IF sy-subrc = 0.
CLEAR <lg_field>.
ENDIF.
ENDLOOP.
ASSIGN COMPONENT 'SOURCE' OF STRUCTURE <lg_data> TO <lg_field>.
ASSERT sy-subrc = 0.
mo_files->add_string( iv_ext = 'asddls'
iv_string = <lg_field> ) ##no_text.
CLEAR <lg_field>.
io_xml->add( iv_name = 'DDLS'
ig_data = <lg_data> ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
1860,
7278,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
1280,
62,
324,
83,
62,
301,
672,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
1860,
7278,
62,
3672,
41876,
36264,
343,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
318,
62,
8692,
10951,
62,
15999,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
15999,
8,
41876,
450,
499,
62,
30388,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
16458,
6561,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
318,
62,
8692,
10951,
62,
15999,
13,
628,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
300,
81,
62,
7890,
62,
8692,
10951,
41876,
4526,
37,
5390,
1366,
11,
198,
220,
220,
220,
220,
220,
300,
87,
62,
18224,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
43213,
62,
15763,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
42865,
300,
81,
62,
7890,
62,
8692,
10951,
41876,
19203,
5064,
62,
16458,
62,
16458,
43,
62,
9936,
47,
1546,
14804,
9936,
62,
50,
62,
33,
11159,
10778,
62,
18601,
2751,
62,
4090,
6089,
27691,
198,
220,
220,
220,
220,
220,
220,
220,
374,
85,
62,
15999,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
15763,
39319,
300,
87,
62,
18224,
13,
198,
220,
220,
220,
220,
220,
220,
220,
374,
85,
62,
15999,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1280,
62,
324,
83,
62,
301,
672,
13,
628,
220,
220,
220,
42865,
25,
300,
81,
62,
7890,
220,
41876,
4526,
37,
5390,
1366,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
1860,
75,
220,
220,
41876,
4526,
37,
5390,
2134,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
87,
62,
18224,
41876,
4526,
37,
5390,
43213,
62,
15763,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
2528,
62,
1860,
14933,
29,
220,
220,
220,
220,
41876,
49053,
9795,
43679,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
2528,
62,
26858,
62,
1177,
29,
41876,
49053,
9795,
43679,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
75,
70,
62,
1860,
14933,
29,
220,
220,
220,
220,
41876,
597,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
75,
70,
62,
26858,
62,
1177,
29,
41876,
597,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
75,
70,
62,
1860,
3672,
29,
220,
220,
220,
220,
220,
41876,
597,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
75,
70,
62,
1860,
75,
3672,
29,
220,
220,
220,
220,
41876,
597,
13,
628,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
42865,
300,
81,
62,
7890,
41876,
19203,
5064,
62,
16458,
62,
16458,
43,
62,
9936,
47,
1546,
14804,
9936,
62,
51,
62,
16458,
9864,
41,
27691,
198,
220,
220,
220,
220,
220,
220,
220,
24994,
16284,
300,
81,
62,
7890,
3784,
9,
5390,
1279,
2528,
62,
1860,
14933,
28401,
628,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
42865,
300,
81,
62,
7890,
34178,
48920,
3963,
1279,
2528,
62,
1860,
14933,
28401,
198,
220,
220,
220,
220,
220,
220,
220,
24994,
16284,
300,
81,
62,
7890,
3784,
9,
5390,
1279,
75,
70,
62,
1860,
14933,
28401,
628,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
42865,
300,
81,
62,
7890,
41876,
19203,
5064,
62,
16458,
62,
16458,
43,
62,
9936,
47,
1546,
14804,
9936,
62,
51,
62,
3525,
9050,
62,
19238,
62,
28206,
27691,
198,
220,
220,
220,
220,
220,
220,
220,
24994,
16284,
300,
81,
62,
7890,
3784,
9,
5390,
1279,
2528,
62,
26858,
62,
1177,
28401,
628,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
42865,
300,
81,
62,
7890,
34178,
48920,
3963,
1279,
2528,
62,
26858,
62,
1177,
28401,
198,
220,
220,
220,
220,
220,
220,
220,
24994,
16284,
300,
81,
62,
7890,
3784,
9,
5390,
1279,
75,
70,
62,
26858,
62,
1177,
28401,
628,
220,
220,
220,
220,
220,
220,
220,
30301,
1503,
1279,
2528,
62,
1860,
14933,
28401,
198,
220,
220,
220,
220,
220,
220,
220,
24994,
16284,
24301,
1340,
3525,
705,
20608,
6,
3963,
19269,
18415,
11335,
1279,
75,
70,
62,
1860,
14933,
29,
5390,
1279,
75,
70,
62,
1860,
3672,
28401,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
75,
70,
62,
1860,
3672,
29,
796,
21628,
62,
1860,
7278,
62,
3672,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29194,
17395,
1279,
75,
70,
62,
1860,
14933,
29,
39319,
43679,
1279,
2528,
62,
1860,
14933,
28401,
628,
220,
220,
220,
220,
220,
220,
220,
42815,
337,
36252,
19203,
5097,
62,
16458,
62,
16458,
43,
62,
39,
6981,
39878,
62,
37,
10659,
15513,
11537,
14804,
10786,
43387,
6158,
11537,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19644,
36,
3824,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21360,
796,
2376,
62,
1860,
75,
13,
628,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_gui_page_merge_res DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_gui_page
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo_online
!io_merge_page TYPE REF TO zcl_abapgit_gui_page_merge
!io_merge TYPE REF TO zcl_abapgit_merge
RAISING
zcx_abapgit_exception .
METHODS zif_abapgit_gui_page~on_event
REDEFINITION .
PROTECTED SECTION.
METHODS render_content REDEFINITION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_file_diff,
path TYPE string,
filename TYPE string,
lstate TYPE char1,
rstate TYPE char1,
fstate TYPE char1, " FILE state - Abstraction for shorter ifs
o_diff TYPE REF TO zcl_abapgit_diff,
changed_by TYPE xubname,
type TYPE string,
END OF ty_file_diff .
TYPES:
tt_file_diff TYPE STANDARD TABLE OF ty_file_diff .
CONSTANTS:
BEGIN OF c_actions,
toggle_mode TYPE string VALUE 'toggle_mode' ##NO_TEXT,
apply_merge TYPE string VALUE 'apply_merge' ##NO_TEXT,
apply_source TYPE string VALUE 'apply_source' ##NO_TEXT,
apply_target TYPE string VALUE 'apply_target' ##NO_TEXT,
cancel TYPE string VALUE 'cancel' ##NO_TEXT,
END OF c_actions .
CONSTANTS:
BEGIN OF c_merge_mode,
selection TYPE string VALUE 'selection' ##NO_TEXT,
merge TYPE string VALUE 'merge' ##NO_TEXT,
END OF c_merge_mode .
DATA mo_merge TYPE REF TO zcl_abapgit_merge .
DATA mo_merge_page TYPE REF TO zcl_abapgit_gui_page_merge .
DATA mo_repo TYPE REF TO zcl_abapgit_repo_online .
DATA ms_diff_file TYPE ty_file_diff .
DATA mv_current_conflict_index TYPE sytabix .
DATA mv_merge_mode TYPE string .
DATA mt_conflicts TYPE zif_abapgit_definitions=>tt_merge_conflict .
METHODS apply_merged_content
IMPORTING
!it_postdata TYPE cnht_post_data_tab
RAISING
zcx_abapgit_exception .
METHODS build_menu
IMPORTING
VALUE(iv_with_conflict) TYPE boolean OPTIONAL
RETURNING
VALUE(ro_menu) TYPE REF TO zcl_abapgit_html_toolbar .
METHODS is_binary
IMPORTING
!iv_d1 TYPE xstring
!iv_d2 TYPE xstring
RETURNING
VALUE(rv_yes) TYPE abap_bool .
METHODS render_beacon
IMPORTING
!is_diff_line TYPE zif_abapgit_definitions=>ty_diff
!is_diff TYPE ty_file_diff
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS render_diff
IMPORTING
!is_diff TYPE ty_file_diff
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html
RAISING
zcx_abapgit_exception .
METHODS render_diff_head
IMPORTING
!is_diff TYPE ty_file_diff
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS render_lines
IMPORTING
!is_diff TYPE ty_file_diff
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS render_line_split
IMPORTING
!is_diff_line TYPE zif_abapgit_definitions=>ty_diff
!iv_fstate TYPE char1
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS render_table_head
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS resolve_diff
RAISING
zcx_abapgit_exception .
METHODS toggle_merge_mode .
ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_PAGE_MERGE_RES IMPLEMENTATION.
METHOD apply_merged_content.
CONSTANTS: lc_replace TYPE string VALUE '<<new>>'.
DATA: BEGIN OF filedata,
merge_content TYPE string,
END OF filedata.
DATA: lv_string TYPE string,
lt_fields TYPE tihttpnvp,
lv_new_file_content TYPE xstring.
FIELD-SYMBOLS: <postdata_line> LIKE LINE OF it_postdata,
<ls_conflict> TYPE zif_abapgit_definitions=>ty_merge_conflict.
LOOP AT it_postdata ASSIGNING <postdata_line>.
lv_string = |{ lv_string }{ <postdata_line> }|.
ENDLOOP.
REPLACE ALL OCCURRENCES OF zif_abapgit_definitions=>gc_crlf IN lv_string WITH lc_replace.
REPLACE ALL OCCURRENCES OF zif_abapgit_definitions=>gc_newline IN lv_string WITH lc_replace.
lt_fields = zcl_abapgit_html_action_utils=>parse_fields_upper_case_name( lv_string ).
zcl_abapgit_html_action_utils=>get_field( EXPORTING name = 'MERGE_CONTENT'
it = lt_fields
CHANGING cv = filedata ).
filedata-merge_content = cl_http_utility=>unescape_url( escaped = filedata-merge_content ).
REPLACE ALL OCCURRENCES OF lc_replace IN filedata-merge_content WITH zif_abapgit_definitions=>gc_newline.
lv_new_file_content = zcl_abapgit_convert=>string_to_xstring_utf8( iv_string = filedata-merge_content ).
READ TABLE mt_conflicts ASSIGNING <ls_conflict> INDEX mv_current_conflict_index.
<ls_conflict>-result_sha1 = zcl_abapgit_hash=>sha1( iv_type = zif_abapgit_definitions=>gc_type-blob
iv_data = lv_new_file_content ).
<ls_conflict>-result_data = lv_new_file_content.
mo_merge->resolve_conflict( is_conflict = <ls_conflict> ).
ENDMETHOD.
METHOD build_menu.
CREATE OBJECT ro_menu.
ro_menu->add( iv_txt = 'Toggle merge mode' iv_act = c_actions-toggle_mode ) ##NO_TEXT.
ro_menu->add( iv_txt = 'Cancel' iv_act = c_actions-cancel ) ##NO_TEXT.
ENDMETHOD.
METHOD constructor.
super->constructor( ).
mo_repo = io_repo.
ms_control-page_title = 'Resolve Conflicts'.
ms_control-page_menu = build_menu( ).
mo_merge_page = io_merge_page.
mo_merge = io_merge.
mv_merge_mode = c_merge_mode-selection.
mv_current_conflict_index = 1.
mt_conflicts = io_merge->get_conflicts( ).
ENDMETHOD.
METHOD is_binary.
DATA: lv_len TYPE i,
lv_idx TYPE i,
lv_x TYPE x.
FIELD-SYMBOLS <lv_data> LIKE iv_d1.
IF iv_d1 IS NOT INITIAL. " One of them might be new and so empty
ASSIGN iv_d1 TO <lv_data>.
ELSE.
ASSIGN iv_d2 TO <lv_data>.
ENDIF.
lv_len = xstrlen( <lv_data> ).
IF lv_len = 0.
RETURN.
ENDIF.
IF lv_len > 100.
lv_len = 100.
ENDIF.
" Simple char range test
" stackoverflow.com/questions/277521/how-to-identify-the-file-content-as-ascii-or-binary
DO lv_len TIMES. " I'm sure there is more efficient way ...
lv_idx = sy-index - 1.
lv_x = <lv_data>+lv_idx(1).
IF NOT ( lv_x BETWEEN 9 AND 13 OR lv_x BETWEEN 32 AND 126 ).
rv_yes = abap_true.
EXIT.
ENDIF.
ENDDO.
ENDMETHOD. " is_binary.
METHOD render_beacon.
DATA: lv_beacon TYPE string.
CREATE OBJECT ro_html.
IF is_diff_line-beacon > 0.
READ TABLE is_diff-o_diff->mt_beacons INTO lv_beacon INDEX is_diff_line-beacon.
ELSE.
lv_beacon = '---'.
ENDIF.
ro_html->add( '<thead class="nav_line">' ).
ro_html->add( '<tr>' ).
ro_html->add( '<th class="num"></th>' ).
ro_html->add( |<th colspan="3">@@ { is_diff_line-new_num } @@ { lv_beacon }</th>| ).
ro_html->add( '</tr>' ).
ro_html->add( '</thead>' ).
ENDMETHOD. " render_beacon.
METHOD render_content.
resolve_diff( ).
IF ms_diff_file IS INITIAL.
zcx_abapgit_exception=>raise( 'no conflict found' ).
ENDIF.
CREATE OBJECT ro_html.
ro_html->add( |<div id="diff-list" data-repo-key="{ mo_repo->get_key( ) }">| ).
ro_html->add( render_diff( ms_diff_file ) ).
ro_html->add( '</div>' ).
ENDMETHOD. "render_content
METHOD render_diff.
DATA: lv_target_content TYPE string.
FIELD-SYMBOLS: <ls_conflict> TYPE zif_abapgit_definitions=>ty_merge_conflict.
CREATE OBJECT ro_html.
ro_html->add( |<div class="diff" data-type="{ is_diff-type
}" data-changed-by="{ is_diff-changed_by
}" data-file="{ is_diff-path && is_diff-filename }">| ). "#EC NOTEXT
ro_html->add( render_diff_head( is_diff ) ).
" Content
IF is_diff-type <> 'binary'.
IF mv_merge_mode EQ c_merge_mode-selection.
ro_html->add( '<div class="diff_content">' ). "#EC NOTEXT
ro_html->add( '<table class="diff_tab syntax-hl">' ). "#EC NOTEXT
ro_html->add( render_table_head( ) ).
ro_html->add( render_lines( is_diff ) ).
ro_html->add( '</table>' ). "#EC NOTEXT
ro_html->add( '</div>' ). "#EC NOTEXT
ELSE.
"Table for Div-Table and textarea
ro_html->add( '<div class="diff_content">' ). "#EC NOTEXT
ro_html->add( '<table>' ). "#EC NOTEXT
ro_html->add( '<thead class="header">' ). "#EC NOTEXT
ro_html->add( '<tr>' ). "#EC NOTEXT
ro_html->add( '<th>Code</th>' ). "#EC NOTEXT
ro_html->add( '<th>Merge - ' ). "#EC NOTEXT
ro_html->add_a( iv_act = 'submitFormById(''merge_form'');' "#EC NOTEXT
iv_txt = 'Apply'
iv_typ = zif_abapgit_definitions=>gc_action_type-onclick
iv_opt = zif_abapgit_definitions=>gc_html_opt-strong ).
ro_html->add( '</th> ' ). "#EC NOTEXT
ro_html->add( '</tr>' ). "#EC NOTEXT
ro_html->add( '</thead>' ). "#EC NOTEXT
ro_html->add( '<td>' ).
"Diff-Table of source and target file
ro_html->add( '<table class="diff_tab syntax-hl">' ). "#EC NOTEXT
ro_html->add( render_table_head( ) ).
ro_html->add( render_lines( is_diff ) ).
ro_html->add( '</table>' ). "#EC NOTEXT
READ TABLE mt_conflicts ASSIGNING <ls_conflict> INDEX mv_current_conflict_index.
IF sy-subrc EQ 0.
lv_target_content = zcl_abapgit_convert=>xstring_to_string_utf8( <ls_conflict>-target_data ).
lv_target_content = escape( val = lv_target_content format = cl_abap_format=>e_html_text ).
ENDIF.
ro_html->add( '</td>' ). "#EC NOTEXT
ro_html->add( '<td>' ). "#EC NOTEXT
ro_html->add( '<div class="form-container">' ).
ro_html->add( |<form id="merge_form" class="aligned-form" accept-charset="UTF-8"| ).
ro_html->add( |method="post" action="sapevent:apply_merge">| ).
ro_html->add( |<textarea id="merge_content" name="merge_content" | ).
ro_html->add( |rows="{ lines( is_diff-o_diff->get( ) ) }">{ lv_target_content }</textarea>| ).
ro_html->add( '<input type="submit" class="hidden-submit">' ).
ro_html->add( '</form>' ). "#EC NOTEXT
ro_html->add( '</div>' ). "#EC NOTEXT
ro_html->add( '</td>' ). "#EC NOTEXT
ro_html->add( '</table>' ). "#EC NOTEXT
ro_html->add( '</div>' ). "#EC NOTEXT
ENDIF.
ELSE.
ro_html->add( '<div class="diff_content paddings center grey">' ). "#EC NOTEXT
ro_html->add( 'The content seems to be binary.' ). "#EC NOTEXT
ro_html->add( 'Cannot display as diff.' ). "#EC NOTEXT
ro_html->add( '</div>' ). "#EC NOTEXT
ENDIF.
ro_html->add( '</div>' ). "#EC NOTEXT
ENDMETHOD. " render_diff
METHOD render_diff_head.
DATA: ls_stats TYPE zif_abapgit_definitions=>ty_count.
CREATE OBJECT ro_html.
ro_html->add( '<div class="diff_head">' ). "#EC NOTEXT
IF is_diff-type <> 'binary' AND is_diff-o_diff IS NOT INITIAL.
ls_stats = is_diff-o_diff->stats( ).
ro_html->add( |<span class="diff_banner diff_ins">+ { ls_stats-insert }</span>| ).
ro_html->add( |<span class="diff_banner diff_del">- { ls_stats-delete }</span>| ).
ro_html->add( |<span class="diff_banner diff_upd">~ { ls_stats-update }</span>| ).
ENDIF.
ro_html->add( |<span class="diff_name">{ is_diff-filename }</span>| ). "#EC NOTEXT
ro_html->add( '</div>' ). "#EC NOTEXT
ENDMETHOD.
METHOD render_lines.
DATA: lo_highlighter TYPE REF TO zcl_abapgit_syntax_highlighter,
lt_diffs TYPE zif_abapgit_definitions=>ty_diffs_tt,
lv_insert_nav TYPE abap_bool.
FIELD-SYMBOLS <ls_diff> LIKE LINE OF lt_diffs.
lo_highlighter = zcl_abapgit_syntax_highlighter=>create( is_diff-filename ).
CREATE OBJECT ro_html.
lt_diffs = is_diff-o_diff->get( ).
LOOP AT lt_diffs ASSIGNING <ls_diff>.
IF <ls_diff>-short = abap_false.
lv_insert_nav = abap_true.
CONTINUE.
ENDIF.
IF lv_insert_nav = abap_true. " Insert separator line with navigation
ro_html->add( render_beacon( is_diff_line = <ls_diff> is_diff = is_diff ) ).
lv_insert_nav = abap_false.
ENDIF.
IF lo_highlighter IS BOUND.
<ls_diff>-new = lo_highlighter->process_line( <ls_diff>-new ).
<ls_diff>-old = lo_highlighter->process_line( <ls_diff>-old ).
ELSE.
<ls_diff>-new = escape( val = <ls_diff>-new format = cl_abap_format=>e_html_attr ).
<ls_diff>-old = escape( val = <ls_diff>-old format = cl_abap_format=>e_html_attr ).
ENDIF.
CONDENSE <ls_diff>-new_num. "get rid of leading spaces
CONDENSE <ls_diff>-old_num.
ro_html->add( render_line_split( is_diff_line = <ls_diff>
iv_fstate = is_diff-fstate ) ).
ENDLOOP.
ENDMETHOD. "render_lines
METHOD render_line_split.
DATA: lv_new TYPE string,
lv_old TYPE string,
lv_merge TYPE string,
lv_mark TYPE string,
lv_bg TYPE string.
CREATE OBJECT ro_html.
" New line
lv_mark = ` `.
IF is_diff_line-result = zif_abapgit_definitions=>c_diff-update.
lv_bg = ' diff_upd'.
lv_mark = `~`.
ELSEIF is_diff_line-result = zif_abapgit_definitions=>c_diff-insert.
lv_bg = ' diff_ins'.
lv_mark = `+`.
ENDIF.
lv_new = |<td class="num" line-num="{ is_diff_line-new_num }"></td>|
&& |<td class="code{ lv_bg }">{ lv_mark }{ is_diff_line-new }</td>|.
" Old line
CLEAR lv_bg.
lv_mark = ` `.
IF is_diff_line-result = zif_abapgit_definitions=>c_diff-update.
lv_bg = ' diff_upd'.
lv_mark = `~`.
ELSEIF is_diff_line-result = zif_abapgit_definitions=>c_diff-delete.
lv_bg = ' diff_del'.
lv_mark = `-`.
ENDIF.
lv_old = |<td class="num" line-num="{ is_diff_line-old_num }"></td>|
&& |<td class="code{ lv_bg }">{ lv_mark }{ is_diff_line-old }</td>|.
" render line, inverse sides if remote is newer
ro_html->add( '<tr>' ). "#EC NOTEXT
ro_html->add( lv_old ). " Target
ro_html->add( lv_new ). " Source
ro_html->add( '</tr>' ). "#EC NOTEXT
ENDMETHOD. "render_line_split
METHOD render_table_head.
CREATE OBJECT ro_html.
IF mv_merge_mode EQ c_merge_mode-selection.
ro_html->add( '<thead class="header">' ). "#EC NOTEXT
ro_html->add( '<tr>' ). "#EC NOTEXT
ro_html->add( '<th class="num"></th>' ). "#EC NOTEXT
ro_html->add( '<form id="target_form" method="post" action="sapevent:apply_target">' ). "#EC NOTEXT
ro_html->add( '<th>Target - ' && mo_merge->get_target_branch( ) && ' - ' ). "#EC NOTEXT
ro_html->add_a( iv_act = 'submitFormById(''target_form'');' "#EC NOTEXT
iv_txt = 'Apply'
iv_typ = zif_abapgit_definitions=>gc_action_type-onclick
iv_opt = zif_abapgit_definitions=>gc_html_opt-strong ).
ro_html->add( '</th> ' ). "#EC NOTEXT
ro_html->add( '</form>' ). "#EC NOTEXT
ro_html->add( '<th class="num"></th>' ). "#EC NOTEXT
ro_html->add( '<form id="source_form" method="post" action="sapevent:apply_source">' ). "#EC NOTEXT
ro_html->add( '<th>Source - ' && mo_merge->get_source_branch( ) &&' - ' ). "#EC NOTEXT
ro_html->add_a( iv_act = 'submitFormById(''source_form'');' "#EC NOTEXT
iv_txt = 'Apply'
iv_typ = zif_abapgit_definitions=>gc_action_type-onclick
iv_opt = zif_abapgit_definitions=>gc_html_opt-strong ).
ro_html->add( '</th> ' ). "#EC NOTEXT
ro_html->add( '</form>' ). "#EC NOTEXT
ro_html->add( '</tr>' ). "#EC NOTEXT
ro_html->add( '</thead>' ). "#EC NOTEXT
ELSE.
ro_html->add( '<thead class="header">' ). "#EC NOTEXT
ro_html->add( '<tr>' ). "#EC NOTEXT
ro_html->add( '<th class="num"></th>' ). "#EC NOTEXT
ro_html->add( '<th>Target - ' && mo_merge->get_target_branch( ) &&'</th> ' ). "#EC NOTEXT
ro_html->add( '<th class="num"></th>' ). "#EC NOTEXT
ro_html->add( '<th>Source - ' && mo_merge->get_source_branch( ) &&'</th> ' ). "#EC NOTEXT
ro_html->add( '</tr>' ). "#EC NOTEXT
ro_html->add( '</thead>' ). "#EC NOTEXT
ENDIF.
ENDMETHOD. " render_table_head.
METHOD resolve_diff.
DATA: lv_offs TYPE i.
FIELD-SYMBOLS: <ls_conflict> TYPE zif_abapgit_definitions=>ty_merge_conflict.
CLEAR ms_diff_file.
READ TABLE mt_conflicts ASSIGNING <ls_conflict> INDEX mv_current_conflict_index.
IF sy-subrc NE 0.
RETURN.
ENDIF.
ms_diff_file-path = <ls_conflict>-path.
ms_diff_file-filename = <ls_conflict>-filename.
ms_diff_file-type = reverse( <ls_conflict>-filename ).
FIND FIRST OCCURRENCE OF '.' IN ms_diff_file-type MATCH OFFSET lv_offs.
ms_diff_file-type = reverse( substring( val = ms_diff_file-type len = lv_offs ) ).
IF ms_diff_file-type <> 'xml' AND ms_diff_file-type <> 'abap'.
ms_diff_file-type = 'other'.
ENDIF.
IF ms_diff_file-type = 'other'
AND is_binary( iv_d1 = <ls_conflict>-source_data iv_d2 = <ls_conflict>-target_data ) = abap_true.
ms_diff_file-type = 'binary'.
ENDIF.
IF ms_diff_file-type <> 'binary'.
CREATE OBJECT ms_diff_file-o_diff
EXPORTING
iv_new = <ls_conflict>-source_data
iv_old = <ls_conflict>-target_data.
ENDIF.
ENDMETHOD.
METHOD toggle_merge_mode.
IF mv_merge_mode EQ c_merge_mode-selection.
mv_merge_mode = c_merge_mode-merge.
ELSE.
mv_merge_mode = c_merge_mode-selection.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_gui_page~on_event.
FIELD-SYMBOLS: <ls_conflict> TYPE zif_abapgit_definitions=>ty_merge_conflict.
CASE iv_action.
WHEN c_actions-apply_merge
OR c_actions-apply_source
OR c_actions-apply_target
OR c_actions-cancel.
CASE iv_action.
WHEN c_actions-apply_merge.
apply_merged_content( it_postdata = it_postdata ).
WHEN c_actions-apply_source.
READ TABLE mt_conflicts ASSIGNING <ls_conflict> INDEX mv_current_conflict_index.
<ls_conflict>-result_sha1 = <ls_conflict>-source_sha1.
<ls_conflict>-result_data = <ls_conflict>-source_data.
mo_merge->resolve_conflict( is_conflict = <ls_conflict> ).
WHEN c_actions-apply_target.
READ TABLE mt_conflicts ASSIGNING <ls_conflict> INDEX mv_current_conflict_index.
<ls_conflict>-result_sha1 = <ls_conflict>-target_sha1.
<ls_conflict>-result_data = <ls_conflict>-target_data.
mo_merge->resolve_conflict( is_conflict = <ls_conflict> ).
ENDCASE.
mv_current_conflict_index = mv_current_conflict_index + 1.
IF mv_current_conflict_index > lines( mt_conflicts ).
CLEAR mv_current_conflict_index.
ENDIF.
IF mv_current_conflict_index IS NOT INITIAL.
ev_state = zif_abapgit_definitions=>gc_event_state-re_render.
ELSE.
ei_page = mo_merge_page.
ev_state = zif_abapgit_definitions=>gc_event_state-go_back.
ENDIF.
WHEN c_actions-toggle_mode.
toggle_merge_mode( ).
ev_state = zif_abapgit_definitions=>gc_event_state-re_render.
ENDCASE.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
647,
469,
62,
411,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
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,
952,
62,
260,
7501,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
647,
469,
62,
7700,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
647,
469,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
647,
469,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
647,
469,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
628,
220,
220,
220,
337,
36252,
50,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
7700,
93,
261,
62,
15596,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
8543,
62,
11299,
23848,
36,
20032,
17941,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
7753,
62,
26069,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3108,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
29472,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
300,
5219,
220,
220,
220,
220,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
374,
5219,
220,
220,
220,
220,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
277,
5219,
220,
220,
220,
220,
41876,
1149,
16,
11,
366,
45811,
1181,
532,
2275,
301,
7861,
329,
12238,
611,
82,
198,
220,
220,
220,
220,
220,
220,
220,
267,
62,
26069,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26069,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3421,
62,
1525,
41876,
2124,
549,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
7753,
62,
26069,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
256,
83,
62,
7753,
62,
26069,
41876,
49053,
9795,
43679,
3963,
1259,
62,
7753,
62,
26069,
764,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
4658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
19846,
62,
14171,
220,
41876,
4731,
26173,
8924,
705,
44256,
62,
14171,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4174,
62,
647,
469,
220,
41876,
4731,
26173,
8924,
705,
39014,
62,
647,
469,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4174,
62,
10459,
41876,
4731,
26173,
8924,
705,
39014,
62,
10459,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4174,
62,
16793,
41876,
4731,
26173,
8924,
705,
39014,
62,
16793,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
14241,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
66,
21130,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
4658,
764,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
647,
469,
62,
14171,
11,
198,
220,
220,
220,
220,
220,
220,
220,
6356,
41876,
4731,
26173,
8924,
705,
49283,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20121,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
647,
469,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
647,
469,
62,
14171,
764,
198,
220,
220,
220,
42865,
6941,
62,
647,
469,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
647,
469,
764,
198,
220,
220,
220,
42865,
6941,
62,
647,
469,
62,
7700,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
647,
469,
764,
198,
220,
220,
220,
42865,
6941,
62,
260,
7501,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
764,
198,
220,
220,
220,
42865,
13845,
62,
26069,
62,
7753,
41876,
1259,
62,
7753,
62,
26069,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
14421,
62,
10414,
13758,
62,
9630,
41876,
827,
8658,
844,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
647,
469,
62,
14171,
41876,
4731,
764,
198,
220,
220,
220,
42865,
45079,
62,
10414,
42267,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
926,
62,
647,
469,
62,
10414,
13758,
764,
628,
220,
220,
220,
337,
36252,
50,
4174,
62,
647,
2004,
62,
11299,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
7353,
7890,
41876,
269,
77,
4352,
62,
7353,
62,
7890,
62,
8658,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
1382,
62,
26272,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
452,
62,
4480,
62,
10414,
13758,
8,
41876,
25131,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
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,
1,
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
] |
*&---------------------------------------------------------------------*
*& Include LZMR1MP00
*&---------------------------------------------------------------------*
CLASS lcl_log IMPLEMENTATION.
METHOD open.
CALL FUNCTION 'BAL_LOG_CREATE'
EXPORTING
i_s_log = VALUE bal_s_log( )
IMPORTING
e_log_handle = gv_handle
EXCEPTIONS
log_header_inconsistent = 1
OTHERS = 2 ##FM_SUBRC_OK.
ENDMETHOD.
METHOD close.
DATA:
lt_msghndl TYPE bal_t_msgh,
lr_msghndl TYPE REF TO balmsghndl,
ls_bal_msg TYPE bal_s_msg,
lv_message TYPE bapi_msg,
lr_return TYPE REF TO bapiret2,
lv_msgty TYPE syst_msgty.
CLEAR et_return.
* Messages
CALL FUNCTION 'BAL_GLB_SEARCH_MSG'
EXPORTING
i_t_log_handle = VALUE bal_t_logh( ( gv_handle ) )
IMPORTING
e_t_msg_handle = lt_msghndl
EXCEPTIONS
msg_not_found = 1
OTHERS = 2.
CHECK syst-subrc EQ 0.
IF et_return IS SUPPLIED OR "Return messages
( iv_dialog EQ abap_true AND "Display message(s) in batch mode
lt_msghndl IS NOT INITIAL AND
syst-batch EQ abap_true ).
LOOP AT lt_msghndl REFERENCE INTO lr_msghndl.
CALL FUNCTION 'BAL_LOG_MSG_READ'
EXPORTING
i_s_msg_handle = VALUE balmsghndl( log_handle = lr_msghndl->log_handle msgnumber = lr_msghndl->msgnumber )
IMPORTING
e_s_msg = ls_bal_msg
EXCEPTIONS
log_not_found = 1
msg_not_found = 2
OTHERS = 3.
IF syst-subrc EQ 0.
INSERT CORRESPONDING bapiret2( ls_bal_msg MAPPING
type = msgty
id = msgid
number = msgno
message_v1 = msgv1
message_v2 = msgv2
message_v3 = msgv3
message_v4 = msgv4 ) INTO TABLE et_return.
ELSE.
CALL FUNCTION 'BAL_LOG_EXCEPTION_READ'
EXPORTING
i_s_msg_handle = VALUE balmsghndl( log_handle = lr_msghndl->log_handle msgnumber = lr_msghndl->msgnumber )
IMPORTING
e_txt_msg = lv_message
EXCEPTIONS
log_not_found = 1
msg_not_found = 2
OTHERS = 3.
CHECK syst-subrc EQ 0.
INSERT VALUE bapiret2( type = 'E' message = lv_message ) INTO TABLE et_return.
ENDIF.
ENDLOOP.
ENDIF.
* Display message(s)
IF iv_dialog EQ abap_true AND
lt_msghndl IS NOT INITIAL.
CASE syst-batch.
WHEN abap_false.
* In dialog mode: Display message(s) by ALV
CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'
EXPORTING
i_t_log_handle = VALUE bal_t_logh( ( gv_handle ) )
EXCEPTIONS
profile_inconsistent = 1
internal_error = 2
no_data_available = 3
no_authority = 4
OTHERS = 5 ##FM_SUBRC_OK.
WHEN abap_true.
* In batch mode: Display message by message
LOOP AT et_return REFERENCE INTO lr_return.
lv_msgty = COND msgty( WHEN syst-tabix EQ lines( et_return ) THEN lr_return->type ELSE COND msgty( WHEN lr_return->type CA 'AEW' THEN 'I' ELSE lr_return->type ) ).
IF lr_return->id IS INITIAL OR lr_return->number IS INITIAL.
MESSAGE lr_return->message TYPE 'E'.
ELSE.
MESSAGE ID lr_return->id TYPE lv_msgty NUMBER lr_return->number WITH lr_return->message_v1 lr_return->message_v2 lr_return->message_v3 lr_return->message_v4.
ENDIF.
ENDLOOP.
ENDCASE.
ENDIF.
CALL FUNCTION 'BAL_LOG_REFRESH'
EXPORTING
i_log_handle = gv_handle
EXCEPTIONS
log_not_found = 1
OTHERS = 2 ##FM_SUBRC_OK.
ENDMETHOD.
METHOD message.
* Add message
CALL FUNCTION 'BAL_LOG_MSG_ADD'
EXPORTING
i_log_handle = gv_handle
i_s_msg = VALUE bal_s_msg( msgty = iv_msgty msgid = iv_msgid msgno = iv_msgno msgv1 = iv_msgv1 msgv2 = iv_msgv2 msgv3 = iv_msgv3 msgv4 = iv_msgv4 )
EXCEPTIONS
log_not_found = 1
msg_inconsistent = 2
log_is_full = 3
OTHERS = 4 ##FM_SUBRC_OK.
ENDMETHOD.
METHOD syst.
DATA:
lr_data TYPE REF TO ts_data_char.
* Only errors
CHECK is_syst-subrc NE 0.
* Add message
message(
iv_msgty = COND syst_msgty( WHEN is_syst-msgty CA 'AE' THEN is_syst-msgty ELSE 'E' )
iv_msgid = is_syst-msgid
iv_msgno = is_syst-msgno
iv_msgv1 = is_syst-msgv1
iv_msgv2 = is_syst-msgv2
iv_msgv3 = is_syst-msgv3
iv_msgv4 = is_syst-msgv4 ).
* Add text
LOOP AT it_data REFERENCE INTO lr_data.
CALL FUNCTION 'BAL_LOG_MSG_ADD_FREE_TEXT'
EXPORTING
i_log_handle = gv_handle
i_msgty = is_syst-msgty
i_text = lr_data->line
EXCEPTIONS
log_not_found = 1
msg_inconsistent = 2
log_is_full = 3
OTHERS = 4 ##FM_SUBRC_OK.
ENDLOOP.
* Raise error
RAISE EXCEPTION TYPE cx_t100_msg
EXPORTING
t100_msgid = is_syst-msgid
t100_msgno = is_syst-msgno
t100_msgv1 = CONV string( is_syst-msgv1 )
t100_msgv2 = CONV string( is_syst-msgv2 )
t100_msgv3 = CONV string( is_syst-msgv3 )
t100_msgv4 = CONV string( is_syst-msgv4 ).
ENDMETHOD.
METHOD exception.
DATA:
lo_exception TYPE REF TO cx_root.
* Root exception
lo_exception = io_exception.
WHILE lo_exception->previous IS NOT INITIAL.
lo_exception = lo_exception->previous.
ENDWHILE.
* Add exception
CALL FUNCTION 'BAL_LOG_EXCEPTION_ADD'
EXPORTING
i_log_handle = gv_handle
i_s_exc = VALUE bal_s_exc( msgty = 'E' exception = lo_exception )
EXCEPTIONS
log_not_found = 1
msg_inconsistent = 2
log_is_full = 3
OTHERS = 4 ##FM_SUBRC_OK.
* Raise error
RAISE EXCEPTION TYPE cx_t100_msg.
ENDMETHOD.
ENDCLASS.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
220,
40348,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
406,
57,
13599,
16,
7378,
405,
198,
9,
5,
10097,
30934,
9,
198,
198,
31631,
300,
565,
62,
6404,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
1280,
13,
198,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
33,
1847,
62,
25294,
62,
43387,
6158,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
82,
62,
6404,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
26173,
8924,
3652,
62,
82,
62,
6404,
7,
1267,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
304,
62,
6404,
62,
28144,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
308,
85,
62,
28144,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
2604,
62,
25677,
62,
1939,
684,
7609,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
362,
22492,
23264,
62,
50,
10526,
7397,
62,
11380,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1969,
13,
198,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
300,
83,
62,
907,
456,
358,
75,
41876,
220,
220,
220,
220,
220,
220,
220,
3652,
62,
83,
62,
907,
456,
11,
198,
220,
220,
220,
220,
220,
300,
81,
62,
907,
456,
358,
75,
41876,
4526,
37,
5390,
3652,
907,
456,
358,
75,
11,
198,
220,
220,
220,
220,
220,
43979,
62,
6893,
62,
19662,
41876,
220,
220,
220,
220,
220,
220,
220,
3652,
62,
82,
62,
19662,
11,
198,
220,
220,
220,
220,
220,
300,
85,
62,
20500,
41876,
220,
220,
220,
220,
220,
220,
220,
275,
15042,
62,
19662,
11,
198,
220,
220,
220,
220,
220,
300,
81,
62,
7783,
220,
41876,
4526,
37,
5390,
275,
499,
557,
83,
17,
11,
198,
220,
220,
220,
220,
220,
300,
85,
62,
19662,
774,
220,
220,
41876,
220,
220,
220,
220,
220,
220,
220,
827,
301,
62,
19662,
774,
13,
628,
220,
220,
220,
30301,
1503,
2123,
62,
7783,
13,
198,
198,
9,
220,
220,
43534,
198,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
33,
1847,
62,
8763,
33,
62,
5188,
31315,
62,
5653,
38,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
83,
62,
6404,
62,
28144,
796,
26173,
8924,
3652,
62,
83,
62,
5439,
456,
7,
357,
308,
85,
62,
28144,
1267,
1267,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
304,
62,
83,
62,
19662,
62,
28144,
796,
300,
83,
62,
907,
456,
358,
75,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
31456,
62,
1662,
62,
9275,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
796,
362,
13,
198,
220,
220,
220,
5870,
25171,
827,
301,
12,
7266,
6015,
36529,
657,
13,
628,
220,
220,
220,
16876,
2123,
62,
7783,
220,
3180,
19549,
49094,
220,
220,
220,
6375,
220,
366,
13615,
6218,
198,
220,
220,
220,
220,
357,
21628,
62,
38969,
519,
220,
36529,
450,
499,
62,
7942,
220,
220,
5357,
366,
23114,
3275,
7,
82,
8,
287,
15458,
4235,
198,
220,
220,
220,
220,
220,
220,
300,
83,
62,
907,
456,
358,
75,
3180,
5626,
3268,
2043,
12576,
5357,
198,
220,
220,
220,
220,
220,
220,
827,
301,
12,
43501,
36529,
450,
499,
62,
7942,
6739,
198,
220,
220,
220,
220,
220,
17579,
3185,
5161,
300,
83,
62,
907,
456,
358,
75,
4526,
24302,
18310,
39319,
300,
81,
62,
907,
456,
358,
75,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
33,
1847,
62,
25294,
62,
5653,
38,
62,
15675,
6,
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,
1312,
62,
82,
62,
19662,
62,
28144,
796,
26173,
8924,
3652,
907,
456,
358,
75,
7,
2604,
62,
28144,
796,
300,
81,
62,
907,
456,
358,
75,
3784,
6404,
62,
28144,
13845,
4593,
4494,
796,
300,
81,
62,
907,
456,
358,
75,
3784,
907,
4593,
4494,
1267,
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,
304,
62,
82,
62,
19662,
220,
220,
220,
220,
220,
220,
220,
796,
43979,
62,
6893,
62,
19662,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2604,
62,
1662,
62,
9275,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
62,
1662,
62,
9275,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
796,
513,
13,
198,
220,
220,
220,
220,
220,
220,
220,
16876,
827,
301,
12,
7266,
6015,
36529,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
29194,
17395,
23929,
19535,
47,
18672,
2751,
275,
499,
557,
83,
17,
7,
43979,
62,
6893,
62,
19662,
337,
24805,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
220,
796,
31456,
774,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
220,
220,
220,
220,
220,
220,
220,
220,
796,
31456,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1271,
220,
220,
220,
220,
796,
31456,
3919,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3275,
62,
85,
16,
796,
31456,
85,
16,
198,
220,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS ltcl_phone_number DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL.
PRIVATE SECTION.
DATA cut TYPE REF TO zcl_phone_number.
METHODS setup.
METHODS test_clean_number FOR TESTING RAISING cx_static_check.
METHODS test_clean_number_dots FOR TESTING RAISING cx_static_check.
METHODS test_clean_number_spaces FOR TESTING RAISING cx_static_check.
METHODS test_fail_nine_digits FOR TESTING RAISING cx_static_check.
METHODS test_fail_11_digits_not_1 FOR TESTING RAISING cx_static_check.
METHODS test_valid_11_digits_1 FOR TESTING RAISING cx_static_check.
METHODS test_valid_11_digits_punct FOR TESTING RAISING cx_static_check.
METHODS test_fail_more_11_digits FOR TESTING RAISING cx_static_check.
METHODS test_fail_letters FOR TESTING RAISING cx_static_check.
METHODS test_fail_punctuations FOR TESTING RAISING cx_static_check.
METHODS test_fail_areacode_0 FOR TESTING RAISING cx_static_check.
METHODS test_fail_areacode_1 FOR TESTING RAISING cx_static_check.
METHODS test_fail_exchangecode_0 FOR TESTING RAISING cx_static_check.
METHODS test_fail_exchangecode_1 FOR TESTING RAISING cx_static_check.
METHODS test_fail_areacode_0_11 FOR TESTING RAISING cx_static_check.
METHODS test_fail_areacode_1_11 FOR TESTING RAISING cx_static_check.
METHODS test_fail_exchangecode_0_11 FOR TESTING RAISING cx_static_check.
METHODS test_fail_exchangecode_1_11 FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_phone_number IMPLEMENTATION.
METHOD setup.
cut = NEW zcl_phone_number( ).
ENDMETHOD.
" cleans the number
METHOD test_clean_number.
cl_abap_unit_assert=>assert_equals(
act = cut->clean( '(223) 456-7890' )
exp = '2234567890' ).
ENDMETHOD.
"cleans numbers with dots
METHOD test_clean_number_dots.
cl_abap_unit_assert=>assert_equals(
act = cut->clean( '223.456.7890' )
exp = '2234567890' ).
ENDMETHOD.
"cleans numbers with multiple spaces
METHOD test_clean_number_spaces.
cl_abap_unit_assert=>assert_equals(
act = cut->clean( '223 456 7890 ' )
exp = '2234567890' ).
ENDMETHOD.
"invalid when 9 digits
METHOD test_fail_nine_digits.
TRY.
cut->clean( '123456789' ).
cl_abap_unit_assert=>fail( ).
CATCH cx_parameter_invalid.
ENDTRY.
ENDMETHOD.
"invalid when 11 digits does not start with a 1
METHOD test_fail_11_digits_not_1.
TRY.
cut->clean( '22234567890' ).
cl_abap_unit_assert=>fail( ).
CATCH cx_parameter_invalid.
ENDTRY.
ENDMETHOD.
"valid when 11 digits and starting with 1
METHOD test_valid_11_digits_1.
cl_abap_unit_assert=>assert_equals(
act = cut->clean( '12234567890' )
exp = '2234567890' ).
ENDMETHOD.
"valid when 11 digits and starting with 1 even with punctuation
METHOD test_valid_11_digits_punct.
cl_abap_unit_assert=>assert_equals(
act = cut->clean( '+1 (223) 456-7890' )
exp = '2234567890' ).
ENDMETHOD.
"invalid when more than 11 digits
METHOD test_fail_more_11_digits.
TRY.
cut->clean( '321234567890' ).
cl_abap_unit_assert=>fail( ).
CATCH cx_parameter_invalid.
ENDTRY.
ENDMETHOD.
"invalid with letters
METHOD test_fail_letters.
TRY.
cut->clean( '123-abc-7890' ).
cl_abap_unit_assert=>fail( ).
CATCH cx_parameter_invalid.
ENDTRY.
ENDMETHOD.
"invalid with punctuations
METHOD test_fail_punctuations.
TRY.
cut->clean( '123-@:!-7890' ).
cl_abap_unit_assert=>fail( ).
CATCH cx_parameter_invalid.
ENDTRY.
ENDMETHOD.
"invalid if area code starts with 0
METHOD test_fail_areacode_0.
TRY.
cut->clean( '(023) 456-7890' ).
cl_abap_unit_assert=>fail( ).
CATCH cx_parameter_invalid.
ENDTRY.
ENDMETHOD.
"invalid if area code starts with 1
METHOD test_fail_areacode_1.
TRY.
cut->clean( '(123) 456-7890' ).
cl_abap_unit_assert=>fail( ).
CATCH cx_parameter_invalid.
ENDTRY.
ENDMETHOD.
"invalid if exchange code starts with 0
METHOD test_fail_exchangecode_0.
TRY.
cut->clean( '(223) 056-7890' ).
cl_abap_unit_assert=>fail( ).
CATCH cx_parameter_invalid.
ENDTRY.
ENDMETHOD.
"invalid if exchange code starts with 1
METHOD test_fail_exchangecode_1.
TRY.
cut->clean( '(223) 156-7890' ).
cl_abap_unit_assert=>fail( ).
CATCH cx_parameter_invalid.
ENDTRY.
ENDMETHOD.
"invalid if area code starts with 0 on valid 11-digit number
METHOD test_fail_areacode_0_11.
TRY.
cut->clean( '1 (023) 456-7890' ).
cl_abap_unit_assert=>fail( ).
CATCH cx_parameter_invalid.
ENDTRY.
ENDMETHOD.
"invalid if area code starts with 1 on valid 11-digit number
METHOD test_fail_areacode_1_11.
TRY.
cut->clean( '1 (123) 456-7890' ).
cl_abap_unit_assert=>fail( ).
CATCH cx_parameter_invalid.
ENDTRY.
ENDMETHOD.
"invalid if exchange code starts with 0 on valid 11-digit number
METHOD test_fail_exchangecode_0_11.
TRY.
cut->clean( '1 (223) 056-7890' ).
cl_abap_unit_assert=>fail( ).
CATCH cx_parameter_invalid.
ENDTRY.
ENDMETHOD.
"invalid if exchange code starts with 1 on valid 11-digit number
METHOD test_fail_exchangecode_1_11.
TRY.
cut->clean( '1 (223) 156-7890' ).
cl_abap_unit_assert=>fail( ).
CATCH cx_parameter_invalid.
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
83,
565,
62,
4862,
62,
17618,
5550,
20032,
17941,
7473,
43001,
2751,
45698,
42,
49277,
43638,
5805,
7597,
360,
4261,
6234,
6006,
9863,
25261,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
42865,
2005,
41876,
4526,
37,
5390,
1976,
565,
62,
4862,
62,
17618,
13,
198,
220,
220,
220,
337,
36252,
50,
9058,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
27773,
62,
17618,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
27773,
62,
17618,
62,
67,
1747,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
27773,
62,
17618,
62,
2777,
2114,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
32165,
62,
30888,
62,
12894,
896,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
32165,
62,
1157,
62,
12894,
896,
62,
1662,
62,
16,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
12102,
62,
1157,
62,
12894,
896,
62,
16,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
12102,
62,
1157,
62,
12894,
896,
62,
79,
16260,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
32165,
62,
3549,
62,
1157,
62,
12894,
896,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
32165,
62,
15653,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
32165,
62,
79,
16260,
6055,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
32165,
62,
533,
330,
1098,
62,
15,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
32165,
62,
533,
330,
1098,
62,
16,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
32165,
62,
1069,
3803,
8189,
62,
15,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
32165,
62,
1069,
3803,
8189,
62,
16,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
32165,
62,
533,
330,
1098,
62,
15,
62,
1157,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
32165,
62,
533,
330,
1098,
62,
16,
62,
1157,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
32165,
62,
1069,
3803,
8189,
62,
15,
62,
1157,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
32165,
62,
1069,
3803,
8189,
62,
16,
62,
1157,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
628,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
4862,
62,
17618,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
2005,
796,
12682,
1976,
565,
62,
4862,
62,
17618,
7,
6739,
198,
220,
23578,
49273,
13,
628,
220,
366,
20658,
262,
1271,
198,
220,
337,
36252,
1332,
62,
27773,
62,
17618,
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,
220,
220,
719,
796,
2005,
3784,
27773,
7,
29513,
22047,
8,
604,
3980,
12,
3695,
3829,
6,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
705,
22047,
2231,
30924,
3829,
6,
6739,
198,
220,
23578,
49273,
13,
628,
220,
366,
2375,
504,
3146,
351,
22969,
198,
220,
337,
36252,
1332,
62,
27773,
62,
17618,
62,
67,
1747,
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,
220,
220,
719,
796,
2005,
3784,
27773,
7,
705,
22047,
13,
29228,
13,
3695,
3829,
6,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
705,
22047,
2231,
30924,
3829,
6,
6739,
198,
220,
23578,
49273,
13,
628,
220,
366,
2375,
504,
3146,
351,
3294,
9029,
198,
220,
337,
36252,
1332,
62,
27773,
62,
17618,
62,
2777,
2114,
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,
220,
220,
719,
796,
2005,
3784,
27773,
7,
705,
22047,
604,
3980,
220,
220,
8699,
3829,
220,
220,
705,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
705,
22047,
2231,
30924,
3829,
6,
6739,
198,
220,
23578,
49273,
13,
628,
220,
366,
259,
12102,
618,
860,
19561,
198,
220,
337,
36252,
1332,
62,
32165,
62,
30888,
62,
12894,
896,
13,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2005,
3784,
27773,
7,
705,
10163,
2231,
3134,
4531,
6,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
17143,
2357,
62,
259,
12102,
13,
198,
220,
220,
220,
23578,
40405,
13,
198,
220,
23578,
49273,
13,
628,
220,
366,
259,
12102,
618,
1367,
19561,
857,
407,
923,
351,
257,
352,
198,
220,
337,
36252,
1332,
62,
32165,
62,
1157,
62,
12894,
896,
62,
1662,
62,
16,
13,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2005,
3784,
27773,
7,
705,
1828,
1954,
2231,
30924,
3829,
6,
6739,
198,
220,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_aoc_boolean DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
CLASS-METHODS parse
IMPORTING
!it_tokens TYPE stokesx_tab
RETURNING
VALUE(ro_node) TYPE REF TO zcl_aoc_boolean_node .
PROTECTED SECTION.
CLASS-METHODS is_comparator
IMPORTING
!io_tokens TYPE REF TO zcl_aoc_boolean_tokens
RETURNING
VALUE(rv_comparator) TYPE i .
CLASS-METHODS parse_internal
IMPORTING
!io_tokens TYPE REF TO zcl_aoc_boolean_tokens
RETURNING
VALUE(ro_node) TYPE REF TO zcl_aoc_boolean_node .
CLASS-METHODS parse_not
IMPORTING
!io_tokens TYPE REF TO zcl_aoc_boolean_tokens
RETURNING
VALUE(ro_node) TYPE REF TO zcl_aoc_boolean_node .
CLASS-METHODS parse_paren
IMPORTING
!io_tokens TYPE REF TO zcl_aoc_boolean_tokens
RETURNING
VALUE(ro_node) TYPE REF TO zcl_aoc_boolean_node .
CLASS-METHODS remove_method_calls
IMPORTING
!io_tokens TYPE REF TO zcl_aoc_boolean_tokens .
CLASS-METHODS remove_templates
IMPORTING
!io_tokens TYPE REF TO zcl_aoc_boolean_tokens .
CLASS-METHODS simplify
IMPORTING
!it_tokens TYPE stokesx_tab
RETURNING
VALUE(ro_tokens) TYPE REF TO zcl_aoc_boolean_tokens .
CLASS-METHODS remove_calculations
IMPORTING
!io_tokens TYPE REF TO zcl_aoc_boolean_tokens .
CLASS-METHODS remove_strings
IMPORTING
!io_tokens TYPE REF TO zcl_aoc_boolean_tokens .
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_AOC_BOOLEAN IMPLEMENTATION.
METHOD is_comparator.
DATA: lv_token2 TYPE string,
lv_token3 TYPE string,
lv_token4 TYPE string.
lv_token2 = io_tokens->get_token( 2 )-str.
lv_token3 = io_tokens->get_token( 3 )-str.
lv_token4 = io_tokens->get_token( 4 )-str.
rv_comparator = 0.
IF ( lv_token2 = 'IS' AND lv_token3 = 'NOT' )
OR ( lv_token2 = 'NOT' AND lv_token3 = 'IN' ).
rv_comparator = 2.
ELSEIF ( lv_token2 = 'IS' AND lv_token3 = 'INSTANCE' AND lv_token4 = 'OF' )
OR lv_token2 = 'BETWEEN'.
rv_comparator = 3.
ELSEIF lv_token2 = '='
OR lv_token2 = '<>'
OR lv_token2 = '<'
OR lv_token2 = 'GT'
OR lv_token2 = '>'
OR lv_token2 = 'LT'
OR lv_token2 = '>='
OR lv_token2 = 'GE'
OR lv_token2 = 'NS'
OR lv_token2 = '<='
OR lv_token2 = 'LE'
OR lv_token2 = 'NE'
OR lv_token2 = 'NA'
OR lv_token2 = 'CO'
OR lv_token2 = 'CA'
OR lv_token2 = 'CS'
OR lv_token2 = 'CN'
OR lv_token2 = 'IN'
OR lv_token2 = 'CP'
OR lv_token2 = 'NP'
OR lv_token2 = 'IS'
OR lv_token2 = 'EQ'.
rv_comparator = 1.
ENDIF.
ENDMETHOD.
METHOD parse.
* returns initial RO_NODE in case of parser errors
DATA: lo_tokens TYPE REF TO zcl_aoc_boolean_tokens.
lo_tokens = simplify( it_tokens ).
ro_node = parse_internal( lo_tokens ).
ENDMETHOD.
METHOD parse_internal.
DATA: lv_token1 TYPE string,
lv_token2 TYPE string,
lo_node LIKE ro_node,
lv_comparator TYPE i.
lv_token1 = io_tokens->get_token( 1 )-str.
lv_token2 = io_tokens->get_token( 2 )-str.
lv_comparator = is_comparator( io_tokens ).
IF lv_comparator > 0 AND io_tokens->get_length( ) >= 3.
CREATE OBJECT ro_node
EXPORTING
iv_type = zcl_aoc_boolean_node=>c_type-compare.
io_tokens->eat( 2 + lv_comparator ).
ELSEIF io_tokens->get_length( ) = 1 OR lv_token2 = 'AND' OR lv_token2 = 'OR'.
* Predicative method call, 740SP08 logical expression
CREATE OBJECT ro_node
EXPORTING
iv_type = zcl_aoc_boolean_node=>c_type-compare.
io_tokens->eat( 1 ).
ELSEIF lv_token1 = 'NOT'.
io_tokens->eat( 1 ).
ro_node = parse_not( io_tokens ).
ELSEIF lv_token1 = '('.
ro_node = parse_paren( io_tokens ).
ELSEIF lv_token1 = 'AND'.
CREATE OBJECT ro_node
EXPORTING
iv_type = zcl_aoc_boolean_node=>c_type-and.
io_tokens->eat( 1 ).
lo_node = parse_internal( io_tokens ).
ro_node->append_child( lo_node ).
ELSEIF lv_token1 = 'OR'.
CREATE OBJECT ro_node
EXPORTING
iv_type = zcl_aoc_boolean_node=>c_type-or.
io_tokens->eat( 1 ).
lo_node = parse_internal( io_tokens ).
ro_node->append_child( lo_node ).
ELSE.
* parser error
RETURN.
ENDIF.
* parse remaining
IF io_tokens->get_length( ) > 0.
lo_node = parse_internal( io_tokens ).
IF lo_node IS INITIAL.
* parser error
CLEAR ro_node.
RETURN.
ENDIF.
lo_node->prepend_child( ro_node ).
ro_node = lo_node.
ENDIF.
ENDMETHOD.
METHOD parse_not.
DATA: lo_node TYPE REF TO zcl_aoc_boolean_node,
lv_end TYPE i,
lo_split TYPE REF TO zcl_aoc_boolean_tokens.
CREATE OBJECT ro_node
EXPORTING
iv_type = zcl_aoc_boolean_node=>c_type-not.
IF io_tokens->get_token( 1 )-str = '('.
lv_end = io_tokens->find_end_paren( 1 ).
lo_split = io_tokens->eat( lv_end ).
ELSE.
lo_split = io_tokens->eat( 3 ).
ENDIF.
lo_node = parse_internal( lo_split ).
ro_node->append_child( lo_node ).
ENDMETHOD.
METHOD parse_paren.
DATA: lo_node TYPE REF TO zcl_aoc_boolean_node,
lv_end TYPE i,
lo_split TYPE REF TO zcl_aoc_boolean_tokens.
ASSERT io_tokens->get_token( 1 )-str = '('.
CREATE OBJECT ro_node
EXPORTING
iv_type = zcl_aoc_boolean_node=>c_type-paren.
lv_end = io_tokens->find_end_paren( 1 ).
lo_split = io_tokens->eat( lv_end ).
* remove start and end paren
lo_split = lo_split->split(
iv_start = 1
iv_end = lo_split->get_length( ) - 1 ).
lo_node = parse_internal( lo_split ).
ro_node->append_child( lo_node ).
ENDMETHOD.
METHOD remove_calculations.
DATA: lv_before TYPE i,
lt_tokens TYPE stokesx_tab,
ls_token LIKE LINE OF lt_tokens,
ls_prev LIKE LINE OF lt_tokens,
ls_next LIKE LINE OF lt_tokens,
lv_index TYPE i.
lt_tokens = io_tokens->get_tokens( ).
DO.
lv_before = lines( lt_tokens ).
LOOP AT lt_tokens INTO ls_token.
lv_index = sy-tabix.
CLEAR: ls_prev, ls_next.
READ TABLE lt_tokens INDEX lv_index - 1 INTO ls_prev. "#EC CI_SUBRC
READ TABLE lt_tokens INDEX lv_index + 1 INTO ls_next. "#EC CI_SUBRC
CASE ls_token-str.
WHEN '+' OR '-' OR '*' OR '/' OR 'MOD' OR 'DIV' OR 'BIT-AND' OR 'BIT-OR' OR '&&'.
IF ls_next-str <> '('.
DO 2 TIMES.
DELETE lt_tokens INDEX lv_index.
ENDDO.
EXIT.
ENDIF.
ENDCASE.
* remove paren introduced by calculations
IF ls_prev-str = '(' AND ls_next-str = ')'.
DELETE lt_tokens INDEX lv_index + 1.
DELETE lt_tokens INDEX lv_index - 1.
EXIT.
ELSEIF ls_prev-str = '|' AND ls_next-str = '|'.
* quick workaround for string templates, todo
DELETE lt_tokens INDEX lv_index + 1.
DELETE lt_tokens INDEX lv_index - 1.
EXIT.
ENDIF.
ENDLOOP.
IF lines( lt_tokens ) = lv_before.
EXIT.
ENDIF.
ENDDO.
io_tokens->set_tokens( lt_tokens ).
ENDMETHOD.
METHOD remove_method_calls.
DATA: ls_token TYPE stokesx,
lv_end TYPE i,
lv_restart TYPE abap_bool,
lv_index TYPE i.
DO.
lv_restart = abap_false.
LOOP AT io_tokens->get_tokens( ) INTO ls_token.
lv_index = sy-tabix.
FIND REGEX '^[\w<>\/~\-=#]+\($' IN ls_token-str.
IF sy-subrc = 0.
lv_end = io_tokens->find_end_paren( lv_index ).
CASE io_tokens->get_token( lv_index - 1 )-str.
WHEN 'NEW' OR 'CONV' OR 'COND' OR 'VALUE'.
lv_index = lv_index - 1.
ENDCASE.
io_tokens->replace(
iv_str = 'METHOD'
iv_start = lv_index
iv_end = lv_end ).
lv_restart = abap_true.
EXIT.
ENDIF.
* table comprehensions
FIND REGEX '^[\w<>~\-=]+\[$' IN ls_token-str.
IF sy-subrc = 0.
lv_end = io_tokens->find_end_square( lv_index ).
io_tokens->replace(
iv_str = 'TABLEC'
iv_start = lv_index
iv_end = lv_end ).
lv_restart = abap_true.
EXIT.
ENDIF.
ENDLOOP.
IF lv_restart = abap_false.
EXIT.
ENDIF.
ENDDO.
ENDMETHOD.
METHOD remove_strings.
LOOP AT io_tokens->get_tokens( ) TRANSPORTING NO FIELDS WHERE type = scan_token_type-literal.
io_tokens->replace(
iv_str = 'str'
iv_start = sy-tabix ).
ENDLOOP.
ENDMETHOD.
METHOD remove_templates.
DATA: lv_start TYPE i,
lv_escaped TYPE i,
lv_index TYPE i,
lt_tokens TYPE stokesx_tab.
FIELD-SYMBOLS: <ls_token> LIKE LINE OF lt_tokens.
lt_tokens = io_tokens->get_tokens( ).
LOOP AT lt_tokens ASSIGNING <ls_token>.
lv_index = sy-tabix.
IF <ls_token>-str = '|' AND lv_start IS INITIAL.
<ls_token>-str = 'TEMPLATE'.
lv_start = lv_index.
ELSEIF <ls_token>-str = '{' AND NOT lv_start IS INITIAL.
lv_escaped = lv_escaped + 1.
ELSEIF <ls_token>-str = '}' AND NOT lv_start IS INITIAL.
lv_escaped = lv_escaped - 1.
ELSEIF <ls_token>-str = '|' AND lv_escaped = 0.
DELETE lt_tokens FROM lv_start + 1 TO lv_index.
ENDIF.
ENDLOOP.
io_tokens->set_tokens( lt_tokens ).
ENDMETHOD.
METHOD simplify.
* todo: string templates?
* todo: change identifiers, so no keywords are possible
CREATE OBJECT ro_tokens EXPORTING it_tokens = it_tokens.
remove_templates( ro_tokens ).
remove_strings( ro_tokens ).
remove_method_calls( ro_tokens ).
remove_calculations( ro_tokens ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
64,
420,
62,
2127,
21052,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
21136,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
83,
482,
641,
220,
220,
220,
220,
41876,
336,
3369,
87,
62,
8658,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
17440,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
17440,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
318,
62,
785,
1845,
1352,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
83,
482,
641,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
785,
1845,
1352,
8,
41876,
1312,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
21136,
62,
32538,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
83,
482,
641,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
17440,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
17440,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
21136,
62,
1662,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
83,
482,
641,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
17440,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
17440,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
21136,
62,
11730,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
83,
482,
641,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
17440,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
17440,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
4781,
62,
24396,
62,
66,
5691,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
83,
482,
641,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
4781,
62,
11498,
17041,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
83,
482,
641,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
30276,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
83,
482,
641,
220,
220,
220,
220,
220,
220,
41876,
336,
3369,
87,
62,
8658,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
83,
482,
641,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
4781,
62,
9948,
3129,
602,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
83,
482,
641,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
4781,
62,
37336,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
83,
482,
641,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
2127,
21052,
62,
83,
482,
641,
764,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
32,
4503,
62,
33,
6684,
2538,
1565,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
318,
62,
785,
1845,
1352,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
30001,
17,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
30001,
18,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
30001,
19,
41876,
4731,
13,
628,
198,
220,
220,
220,
300,
85,
62,
30001,
17,
796,
33245,
62,
83,
482,
641,
3784,
1136,
62,
30001,
7,
362,
1267,
12,
2536,
13,
198,
220,
220,
220,
300,
85,
62,
30001,
18,
796,
33245,
62,
83,
482,
641,
3784,
1136,
62,
30001,
7,
513,
1267,
12,
2536,
13,
198,
220,
220,
220,
300,
85,
62,
30001,
19,
796,
33245,
62,
83,
482,
641,
3784,
1136,
62,
30001,
7,
604,
1267,
12,
2536,
13,
628,
220,
220,
220,
374,
85,
62,
785,
1845,
1352,
796,
657,
13,
628,
220,
220,
220,
16876,
357,
300,
85,
62,
30001,
17,
796,
705,
1797,
6,
5357,
300,
85,
62,
30001,
18,
796,
705,
11929,
6,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
6375,
357,
300,
85,
62,
30001,
17,
796,
705,
11929,
6,
5357,
300,
85,
62,
30001,
18,
796,
705,
1268,
6,
6739,
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,
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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
] |
class ZCX_VIOLATED_POSTCONDITION definition
public
inheriting from CX_NO_CHECK
create public .
public section.
constants ZCX_VIOLATED_POSTCONDITION type SOTR_CONC value '005056B074C91ED981A35452159F2110' ##NO_TEXT.
data MD_CONDITION type ITEX132 .
data MO_ERROR_LOG type ref to ZCL_BC_MESSAGE_HANDLER .
methods CONSTRUCTOR
importing
!TEXTID like TEXTID optional
!PREVIOUS like PREVIOUS optional
!MD_CONDITION type ITEX132 optional
!MO_ERROR_LOG type ref to ZCL_BC_MESSAGE_HANDLER optional .
protected section.
private section.
ENDCLASS.
CLASS ZCX_VIOLATED_POSTCONDITION IMPLEMENTATION.
method CONSTRUCTOR.
CALL METHOD SUPER->CONSTRUCTOR
EXPORTING
TEXTID = TEXTID
PREVIOUS = PREVIOUS
.
IF textid IS INITIAL.
me->textid = ZCX_VIOLATED_POSTCONDITION .
ENDIF.
me->MD_CONDITION = MD_CONDITION .
me->MO_ERROR_LOG = MO_ERROR_LOG .
endmethod.
ENDCLASS.
| [
4871,
1168,
34,
55,
62,
12861,
3535,
11617,
62,
32782,
10943,
35,
17941,
6770,
198,
220,
1171,
198,
220,
10639,
1780,
422,
327,
55,
62,
15285,
62,
50084,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
38491,
1168,
34,
55,
62,
12861,
3535,
11617,
62,
32782,
10943,
35,
17941,
2099,
311,
2394,
49,
62,
10943,
34,
1988,
705,
405,
1120,
3980,
33,
2998,
19,
34,
6420,
1961,
4089,
16,
32,
2327,
37730,
19707,
37,
2481,
940,
6,
22492,
15285,
62,
32541,
13,
198,
220,
1366,
10670,
62,
10943,
35,
17941,
2099,
7283,
6369,
19924,
764,
198,
220,
1366,
13070,
62,
24908,
62,
25294,
2099,
1006,
284,
1168,
5097,
62,
2749,
62,
44,
1546,
4090,
8264,
62,
39,
6981,
39878,
764,
628,
220,
5050,
7102,
46126,
1581,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
32541,
2389,
588,
40383,
2389,
11902,
198,
220,
220,
220,
220,
220,
5145,
46437,
12861,
20958,
588,
22814,
12861,
20958,
11902,
198,
220,
220,
220,
220,
220,
5145,
12740,
62,
10943,
35,
17941,
2099,
7283,
6369,
19924,
11902,
198,
220,
220,
220,
220,
220,
5145,
11770,
62,
24908,
62,
25294,
2099,
1006,
284,
1168,
5097,
62,
2749,
62,
44,
1546,
4090,
8264,
62,
39,
6981,
39878,
11902,
764,
198,
24326,
2665,
13,
198,
19734,
2665,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
34,
55,
62,
12861,
3535,
11617,
62,
32782,
10943,
35,
17941,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
2446,
7102,
46126,
1581,
13,
198,
34,
7036,
337,
36252,
33088,
3784,
10943,
46126,
1581,
198,
6369,
15490,
2751,
198,
32541,
2389,
796,
40383,
2389,
198,
46437,
12861,
20958,
796,
22814,
12861,
20958,
198,
13,
198,
16876,
2420,
312,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
502,
3784,
5239,
312,
796,
1168,
34,
55,
62,
12861,
3535,
11617,
62,
32782,
10943,
35,
17941,
764,
198,
23578,
5064,
13,
198,
1326,
3784,
12740,
62,
10943,
35,
17941,
796,
10670,
62,
10943,
35,
17941,
764,
198,
1326,
3784,
11770,
62,
24908,
62,
25294,
796,
13070,
62,
24908,
62,
25294,
764,
198,
220,
886,
24396,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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">Aggregation field configuration</p>
CLASS zcl_qdrt_aggregation_config DEFINITION
PUBLIC
FINAL
CREATE PUBLIC.
PUBLIC SECTION.
INTERFACES:
zif_qdrt_aggregation_config.
METHODS:
constructor
IMPORTING
aggregation_config TYPE zif_qdrt_aggregation_config=>ty_aggregation_config.
PROTECTED SECTION.
PRIVATE SECTION.
DATA:
aggregation_config TYPE zif_qdrt_aggregation_config=>ty_aggregation_config.
ENDCLASS.
CLASS zcl_qdrt_aggregation_config IMPLEMENTATION.
METHOD constructor.
me->aggregation_config = aggregation_config.
ENDMETHOD.
METHOD zif_qdrt_aggregation_config~get_having_clause.
FIELD-SYMBOLS:
<having_line> TYPE string.
CHECK aggregation_config-having_expressions IS NOT INITIAL.
LOOP AT aggregation_config-having_expressions ASSIGNING FIELD-SYMBOL(<having_expr>).
IF <having_line> IS ASSIGNED.
ENDIF.
APPEND INITIAL LINE TO result ASSIGNING <having_line>.
IF <having_expr>-operation = zif_qdrt_c_filter_ops=>between.
<having_line> = |{ <having_expr>-function }( { <having_expr>-field_name } )| &&
| BETWEEN { cl_abap_dyn_prg=>quote( <having_expr>-value1 ) } AND { cl_abap_dyn_prg=>quote( <having_expr>-value2 ) }|.
ELSE.
<having_line> = |{ <having_expr>-function }( { <having_expr>-field_name } ) { <having_expr>-operation }| &&
| { cl_abap_dyn_prg=>quote( <having_expr>-value1 ) }|.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD zif_qdrt_aggregation_config~get_group_by_clause.
FIELD-SYMBOLS:
<group_by_line> TYPE string.
CHECK aggregation_config-aggregation_expressions IS NOT INITIAL.
LOOP AT aggregation_config-aggregation_expressions ASSIGNING FIELD-SYMBOL(<group_by>).
IF <group_by_line> IS ASSIGNED.
<group_by_line> = |{ <group_by_line> }, |.
ENDIF.
APPEND INITIAL LINE TO result ASSIGNING <group_by_line>.
<group_by_line> = <group_by>-field_name.
ENDLOOP.
ENDMETHOD.
METHOD zif_qdrt_aggregation_config~is_empty.
result = xsdbool( aggregation_config-aggregation_expressions IS INITIAL ).
ENDMETHOD.
METHOD zif_qdrt_aggregation_config~is_field_in_aggr_expr.
result = xsdbool( line_exists( aggregation_config-aggregation_expressions[ field_name = fieldname ] ) ).
ENDMETHOD.
METHOD zif_qdrt_aggregation_config~is_field_in_having_expr.
result = xsdbool( line_exists( aggregation_config-having_expressions[ field_name = fieldname ] ) ).
ENDMETHOD.
ENDCLASS.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
46384,
43068,
2214,
8398,
3556,
79,
29,
198,
31631,
1976,
565,
62,
80,
7109,
83,
62,
9460,
43068,
62,
11250,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
13,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
23255,
37,
2246,
1546,
25,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
80,
7109,
83,
62,
9460,
43068,
62,
11250,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
46500,
62,
11250,
41876,
1976,
361,
62,
80,
7109,
83,
62,
9460,
43068,
62,
11250,
14804,
774,
62,
9460,
43068,
62,
11250,
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,
46500,
62,
11250,
41876,
1976,
361,
62,
80,
7109,
83,
62,
9460,
43068,
62,
11250,
14804,
774,
62,
9460,
43068,
62,
11250,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
80,
7109,
83,
62,
9460,
43068,
62,
11250,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
502,
3784,
9460,
43068,
62,
11250,
796,
46500,
62,
11250,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
80,
7109,
83,
62,
9460,
43068,
62,
11250,
93,
1136,
62,
40965,
62,
565,
682,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
198,
220,
220,
220,
220,
220,
1279,
40965,
62,
1370,
29,
41876,
4731,
13,
628,
220,
220,
220,
5870,
25171,
46500,
62,
11250,
12,
40965,
62,
42712,
507,
3180,
5626,
3268,
2043,
12576,
13,
628,
220,
220,
220,
17579,
3185,
5161,
46500,
62,
11250,
12,
40965,
62,
42712,
507,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
40965,
62,
31937,
29,
737,
198,
220,
220,
220,
220,
220,
16876,
1279,
40965,
62,
1370,
29,
3180,
24994,
16284,
1961,
13,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
220,
220,
43504,
10619,
3268,
2043,
12576,
48920,
5390,
1255,
24994,
3528,
15871,
1279,
40965,
62,
1370,
28401,
198,
220,
220,
220,
220,
220,
16876,
1279,
40965,
62,
31937,
29,
12,
27184,
796,
1976,
361,
62,
80,
7109,
83,
62,
66,
62,
24455,
62,
2840,
14804,
23395,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
40965,
62,
1370,
29,
796,
930,
90,
1279,
40965,
62,
31937,
29,
12,
8818,
1782,
7,
1391,
1279,
40965,
62,
31937,
29,
12,
3245,
62,
3672,
1782,
1267,
91,
11405,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
38651,
8845,
1677,
1391,
537,
62,
397,
499,
62,
67,
2047,
62,
1050,
70,
14804,
22708,
7,
1279,
40965,
62,
31937,
29,
12,
8367,
16,
1267,
1782,
5357,
1391,
537,
62,
397,
499,
62,
67,
2047,
62,
1050,
70,
14804,
22708,
7,
1279,
40965,
62,
31937,
29,
12,
8367,
17,
1267,
1782,
91,
13,
198,
220,
220,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
40965,
62,
1370,
29,
796,
930,
90,
1279,
40965,
62,
31937,
29,
12,
8818,
1782,
7,
1391,
1279,
40965,
62,
31937,
29,
12,
3245,
62,
3672,
1782,
1267,
1391,
1279,
40965,
62,
31937,
29,
12,
27184,
1782,
91,
11405,
198,
220,
220,
220,
220,
220,
220,
220,
220,
930,
1391,
537,
62,
397,
499,
62,
67,
2047,
62,
1050,
70,
14804,
22708,
7,
1279,
40965,
62,
31937,
29,
12,
8367,
16,
1267,
1782,
91,
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,
1976,
361,
62,
80,
7109,
83,
62,
9460,
43068,
62,
11250,
93,
1136,
62,
8094,
62,
1525,
62,
565,
682,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
198,
220,
220,
220,
220,
220,
1279,
8094,
62,
1525,
62,
1370,
29,
41876,
4731,
13,
628,
220,
220,
220,
5870,
25171,
46500,
62,
11250,
12,
9460,
43068,
62,
42712,
507,
3180,
5626,
3268,
2043,
12576,
13,
628,
220,
220,
220,
17579,
3185,
5161,
46500,
62,
11250,
12,
9460,
43068,
62,
42712,
507,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
8094,
62,
1525,
29,
737,
198,
220,
220,
220,
220,
220,
16876,
1279,
8094,
62,
1525,
62,
1370,
29,
3180,
24994,
16284,
1961,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1279,
8094,
62,
1525,
62,
1370,
29,
796,
930,
90,
1279,
8094,
62,
1525,
62,
1370,
29,
8964,
930,
13,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
220,
220,
43504,
10619,
3268,
2043,
12576,
48920,
5390,
1255,
24994,
3528,
15871,
1279,
8094,
62,
1525,
62,
1370,
28401,
198,
220,
220,
220,
220,
220,
1279,
8094,
62,
1525,
62,
1370,
29,
796,
1279,
8094,
62,
1525,
29,
12,
3245,
62,
3672,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
80,
7109,
83,
62,
9460,
43068,
62,
11250,
93,
271,
62,
28920,
13,
198,
220,
220,
220,
1255,
796,
2124,
82,
9945,
970,
7,
46500,
62,
11250,
12,
9460,
43068,
62,
42712,
507,
3180,
3268,
2043,
12576,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1976,
361,
62,
80,
7109,
83,
62,
9460,
43068,
62,
11250,
93,
271,
62,
3245,
62,
259,
62,
363,
2164,
62,
31937,
13,
198,
220,
220,
220,
1255,
796,
2124,
82,
9945,
970,
7,
1627,
62,
1069,
1023,
7,
46500,
62,
11250,
12,
9460,
43068,
62,
42712,
507,
58,
2214,
62,
3672,
796,
2214,
3672,
2361,
1267,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1976,
361,
62,
80,
7109,
83,
62,
9460,
43068,
62,
11250,
93,
271,
62,
3245,
62,
259,
62,
40965,
62,
31937,
13,
198,
220,
220,
220,
1255,
796,
2124,
82,
9945,
970,
7,
1627,
62,
1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1,
1,
1,
1,
1,
1,
1,
1
] |
"! <p class="shorttext synchronized" lang="en">Extracts calculation field out formula</p>
CLASS zcl_dbbr_fe_calc_field_extr DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_dbbr_fe_field_extractor .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_dbbr_fe_calc_field_extr IMPLEMENTATION.
METHOD zif_dbbr_fe_field_extractor~extract_field.
ASSIGN is_statement-tokens TO FIELD-SYMBOL(<lt_tokens>).
DATA(lv_type_string) = <lt_tokens>[ 4 ]-str.
IF contains( val = lv_type_string sub = '-' ).
DATA(lv_type_ref_tab) = substring_before( val = lv_type_string sub = '-' ).
DATA(lv_type_ref_field) = substring_after( val = lv_type_string sub = '-' ).
ENDIF.
rs_field = VALUE zif_dbbr_fe_types=>ty_form_field(
field = <lt_tokens>[ 2 ]-str
type_ref_tab = lv_type_ref_tab
type_ref_field = lv_type_ref_field
type_name = lv_type_string
).
ENDMETHOD.
ENDCLASS.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
11627,
974,
82,
17952,
2214,
503,
10451,
3556,
79,
29,
198,
31631,
1976,
565,
62,
9945,
1671,
62,
5036,
62,
9948,
66,
62,
3245,
62,
2302,
81,
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,
9945,
1671,
62,
5036,
62,
3245,
62,
2302,
40450,
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,
9945,
1671,
62,
5036,
62,
9948,
66,
62,
3245,
62,
2302,
81,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
1976,
361,
62,
9945,
1671,
62,
5036,
62,
3245,
62,
2302,
40450,
93,
2302,
974,
62,
3245,
13,
628,
220,
220,
220,
24994,
16284,
318,
62,
26090,
12,
83,
482,
641,
5390,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
2528,
62,
83,
482,
641,
29,
737,
628,
220,
220,
220,
42865,
7,
6780,
62,
4906,
62,
8841,
8,
796,
1279,
2528,
62,
83,
482,
641,
36937,
604,
2361,
12,
2536,
13,
628,
220,
220,
220,
16876,
4909,
7,
1188,
796,
300,
85,
62,
4906,
62,
8841,
850,
796,
705,
19355,
6739,
198,
220,
220,
220,
220,
220,
42865,
7,
6780,
62,
4906,
62,
5420,
62,
8658,
8,
220,
220,
220,
220,
220,
796,
3293,
1806,
62,
19052,
7,
1188,
796,
300,
85,
62,
4906,
62,
8841,
850,
796,
705,
19355,
6739,
198,
220,
220,
220,
220,
220,
42865,
7,
6780,
62,
4906,
62,
5420,
62,
3245,
8,
220,
220,
220,
796,
3293,
1806,
62,
8499,
7,
1188,
796,
300,
85,
62,
4906,
62,
8841,
850,
796,
705,
19355,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
44608,
62,
3245,
796,
26173,
8924,
1976,
361,
62,
9945,
1671,
62,
5036,
62,
19199,
14804,
774,
62,
687,
62,
3245,
7,
198,
220,
220,
220,
220,
220,
220,
220,
2214,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
1279,
2528,
62,
83,
482,
641,
36937,
362,
2361,
12,
2536,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
5420,
62,
8658,
220,
220,
220,
220,
220,
796,
300,
85,
62,
4906,
62,
5420,
62,
8658,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
5420,
62,
3245,
220,
220,
220,
796,
300,
85,
62,
4906,
62,
5420,
62,
3245,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
4906,
62,
8841,
198,
220,
220,
220,
6739,
628,
220,
23578,
49273,
13,
198,
198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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class ZCL_EXCEL_WORKSHEET definition
public
create public .
public section.
*"* public components of class ZCL_EXCEL_WORKSHEET
*"* do not include other source files here!!!
type-pools ABAP .
interfaces ZIF_EXCEL_SHEET_PRINTSETTINGS .
interfaces ZIF_EXCEL_SHEET_PROPERTIES .
interfaces ZIF_EXCEL_SHEET_PROTECTION .
interfaces ZIF_EXCEL_SHEET_VBA_PROJECT .
types:
begin of MTY_S_OUTLINE_ROW,
ROW_FROM type I,
ROW_TO type I,
COLLAPSED type ABAP_BOOL,
end of MTY_S_OUTLINE_ROW .
types:
MTY_TS_OUTLINES_ROW type sorted table of MTY_S_OUTLINE_ROW with unique key ROW_FROM ROW_TO .
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
data EXCEL type ref to ZCL_EXCEL read-only .
data PRINT_GRIDLINES type ZEXCEL_PRINT_GRIDLINES read-only value ABAP_FALSE. "#EC NOTEXT . " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
data SHEET_CONTENT type ZEXCEL_T_CELL_DATA .
data SHEET_SETUP type ref to ZCL_EXCEL_SHEET_SETUP .
data SHOW_GRIDLINES type ZEXCEL_SHOW_GRIDLINES read-only value ABAP_TRUE. "#EC NOTEXT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
data SHOW_ROWCOLHEADERS type ZEXCEL_SHOW_GRIDLINES read-only value ABAP_TRUE. "#EC NOTEXT . " . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
data STYLES type ZEXCEL_T_SHEET_STYLE .
data TABCOLOR type ZEXCEL_S_TABCOLOR read-only .
methods ADD_COMMENT
importing
!IP_COMMENT type ref to ZCL_EXCEL_COMMENT .
methods ADD_DRAWING
importing
!IP_DRAWING type ref to ZCL_EXCEL_DRAWING .
methods ADD_NEW_COLUMN
importing
!IP_COLUMN type SIMPLE
returning
value(EO_COLUMN) type ref to ZCL_EXCEL_COLUMN .
methods ADD_NEW_STYLE_COND
returning
value(EO_STYLE_COND) type ref to ZCL_EXCEL_STYLE_COND .
methods ADD_NEW_DATA_VALIDATION
returning
value(EO_DATA_VALIDATION) type ref to ZCL_EXCEL_DATA_VALIDATION .
methods ADD_NEW_RANGE
returning
value(EO_RANGE) type ref to ZCL_EXCEL_RANGE .
methods ADD_NEW_ROW
importing
!IP_ROW type SIMPLE
returning
value(EO_ROW) type ref to ZCL_EXCEL_ROW .
methods BIND_ALV
importing
!IO_ALV type ref to OBJECT
!IT_TABLE type standard table
!I_TOP type I default 1
!I_LEFT type I default 1
!TABLE_STYLE type ZEXCEL_TABLE_STYLE optional
!I_TABLE type ABAP_BOOL default ABAP_TRUE
raising
ZCX_EXCEL .
type-pools SLIS .
type-pools SOI .
methods BIND_ALV_OLE2
importing
!I_DOCUMENT_URL type CHAR255 default SPACE
!I_XLS type C default SPACE
!I_SAVE_PATH type STRING
!IO_ALV type ref to CL_GUI_ALV_GRID
!IT_LISTHEADER type SLIS_T_LISTHEADER optional
!I_TOP type I default 1
!I_LEFT type I default 1
!I_COLUMNS_HEADER type C default 'X'
!I_COLUMNS_AUTOFIT type C default 'X'
!I_FORMAT_COL_HEADER type SOI_FORMAT_ITEM optional
!I_FORMAT_SUBTOTAL type SOI_FORMAT_ITEM optional
!I_FORMAT_TOTAL type SOI_FORMAT_ITEM optional
exceptions
MISS_GUIDE
EX_TRANSFER_KKBLO_ERROR
FATAL_ERROR
INV_DATA_RANGE
DIM_MISMATCH_VKEY
DIM_MISMATCH_SEMA
ERROR_IN_SEMA .
methods BIND_TABLE
importing
!IP_TABLE type standard table
!IT_FIELD_CATALOG type ZEXCEL_T_FIELDCATALOG optional
!IS_TABLE_SETTINGS type ZEXCEL_S_TABLE_SETTINGS optional
value(IV_DEFAULT_DESCR) type C optional
exporting
!ES_TABLE_SETTINGS type ZEXCEL_S_TABLE_SETTINGS
raising
ZCX_EXCEL .
methods CALCULATE_COLUMN_WIDTHS
raising
ZCX_EXCEL .
methods CHANGE_CELL_STYLE
importing
!IP_COLUMN type SIMPLE
!IP_ROW type ZEXCEL_CELL_ROW
!IP_COMPLETE type ZEXCEL_S_CSTYLE_COMPLETE optional
!IP_XCOMPLETE type ZEXCEL_S_CSTYLEX_COMPLETE optional
!IP_FONT type ZEXCEL_S_CSTYLE_FONT optional
!IP_XFONT type ZEXCEL_S_CSTYLEX_FONT optional
!IP_FILL type ZEXCEL_S_CSTYLE_FILL optional
!IP_XFILL type ZEXCEL_S_CSTYLEX_FILL optional
!IP_BORDERS type ZEXCEL_S_CSTYLE_BORDERS optional
!IP_XBORDERS type ZEXCEL_S_CSTYLEX_BORDERS optional
!IP_ALIGNMENT type ZEXCEL_S_CSTYLE_ALIGNMENT optional
!IP_XALIGNMENT type ZEXCEL_S_CSTYLEX_ALIGNMENT optional
!IP_NUMBER_FORMAT_FORMAT_CODE type ZEXCEL_NUMBER_FORMAT optional
!IP_PROTECTION type ZEXCEL_S_CSTYLE_PROTECTION optional
!IP_XPROTECTION type ZEXCEL_S_CSTYLEX_PROTECTION optional
!IP_FONT_BOLD type FLAG optional
!IP_FONT_COLOR type ZEXCEL_S_STYLE_COLOR optional
!IP_FONT_COLOR_RGB type ZEXCEL_STYLE_COLOR_ARGB optional
!IP_FONT_COLOR_INDEXED type ZEXCEL_STYLE_COLOR_INDEXED optional
!IP_FONT_COLOR_THEME type ZEXCEL_STYLE_COLOR_THEME optional
!IP_FONT_COLOR_TINT type ZEXCEL_STYLE_COLOR_TINT optional
!IP_FONT_FAMILY type ZEXCEL_STYLE_FONT_FAMILY optional
!IP_FONT_ITALIC type FLAG optional
!IP_FONT_NAME type ZEXCEL_STYLE_FONT_NAME optional
!IP_FONT_SCHEME type ZEXCEL_STYLE_FONT_SCHEME optional
!IP_FONT_SIZE type ZEXCEL_STYLE_FONT_SIZE optional
!IP_FONT_STRIKETHROUGH type FLAG optional
!IP_FONT_UNDERLINE type FLAG optional
!IP_FONT_UNDERLINE_MODE type ZEXCEL_STYLE_FONT_UNDERLINE optional
!IP_FILL_FILLTYPE type ZEXCEL_FILL_TYPE optional
!IP_FILL_ROTATION type ZEXCEL_ROTATION optional
!IP_FILL_FGCOLOR type ZEXCEL_S_STYLE_COLOR optional
!IP_FILL_FGCOLOR_RGB type ZEXCEL_STYLE_COLOR_ARGB optional
!IP_FILL_FGCOLOR_INDEXED type ZEXCEL_STYLE_COLOR_INDEXED optional
!IP_FILL_FGCOLOR_THEME type ZEXCEL_STYLE_COLOR_THEME optional
!IP_FILL_FGCOLOR_TINT type ZEXCEL_STYLE_COLOR_TINT optional
!IP_FILL_BGCOLOR type ZEXCEL_S_STYLE_COLOR optional
!IP_FILL_BGCOLOR_RGB type ZEXCEL_STYLE_COLOR_ARGB optional
!IP_FILL_BGCOLOR_INDEXED type ZEXCEL_STYLE_COLOR_INDEXED optional
!IP_FILL_BGCOLOR_THEME type ZEXCEL_STYLE_COLOR_THEME optional
!IP_FILL_BGCOLOR_TINT type ZEXCEL_STYLE_COLOR_TINT optional
!IP_BORDERS_ALLBORDERS type ZEXCEL_S_CSTYLE_BORDER optional
!IP_FILL_GRADTYPE_TYPE type ZEXCEL_S_GRADIENT_TYPE-TYPE optional
!IP_FILL_GRADTYPE_DEGREE type ZEXCEL_S_GRADIENT_TYPE-DEGREE optional
!IP_XBORDERS_ALLBORDERS type ZEXCEL_S_CSTYLEX_BORDER optional
!IP_BORDERS_DIAGONAL type ZEXCEL_S_CSTYLE_BORDER optional
!IP_FILL_GRADTYPE_BOTTOM type ZEXCEL_S_GRADIENT_TYPE-BOTTOM optional
!IP_FILL_GRADTYPE_TOP type ZEXCEL_S_GRADIENT_TYPE-TOP optional
!IP_XBORDERS_DIAGONAL type ZEXCEL_S_CSTYLEX_BORDER optional
!IP_BORDERS_DIAGONAL_MODE type ZEXCEL_DIAGONAL optional
!IP_FILL_GRADTYPE_RIGHT type ZEXCEL_S_GRADIENT_TYPE-RIGHT optional
!IP_BORDERS_DOWN type ZEXCEL_S_CSTYLE_BORDER optional
!IP_FILL_GRADTYPE_LEFT type ZEXCEL_S_GRADIENT_TYPE-LEFT optional
!IP_FILL_GRADTYPE_POSITION1 type ZEXCEL_S_GRADIENT_TYPE-POSITION1 optional
!IP_XBORDERS_DOWN type ZEXCEL_S_CSTYLEX_BORDER optional
!IP_BORDERS_LEFT type ZEXCEL_S_CSTYLE_BORDER optional
!IP_FILL_GRADTYPE_POSITION2 type ZEXCEL_S_GRADIENT_TYPE-POSITION2 optional
!IP_FILL_GRADTYPE_POSITION3 type ZEXCEL_S_GRADIENT_TYPE-POSITION3 optional
!IP_XBORDERS_LEFT type ZEXCEL_S_CSTYLEX_BORDER optional
!IP_BORDERS_RIGHT type ZEXCEL_S_CSTYLE_BORDER optional
!IP_XBORDERS_RIGHT type ZEXCEL_S_CSTYLEX_BORDER optional
!IP_BORDERS_TOP type ZEXCEL_S_CSTYLE_BORDER optional
!IP_XBORDERS_TOP type ZEXCEL_S_CSTYLEX_BORDER optional
!IP_ALIGNMENT_HORIZONTAL type ZEXCEL_ALIGNMENT optional
!IP_ALIGNMENT_VERTICAL type ZEXCEL_ALIGNMENT optional
!IP_ALIGNMENT_TEXTROTATION type ZEXCEL_TEXT_ROTATION optional
!IP_ALIGNMENT_WRAPTEXT type FLAG optional
!IP_ALIGNMENT_SHRINKTOFIT type FLAG optional
!IP_ALIGNMENT_INDENT type ZEXCEL_INDENT optional
!IP_PROTECTION_HIDDEN type ZEXCEL_CELL_PROTECTION optional
!IP_PROTECTION_LOCKED type ZEXCEL_CELL_PROTECTION optional
!IP_BORDERS_ALLBORDERS_STYLE type ZEXCEL_BORDER optional
!IP_BORDERS_ALLBORDERS_COLOR type ZEXCEL_S_STYLE_COLOR optional
!IP_BORDERS_ALLBO_COLOR_RGB type ZEXCEL_STYLE_COLOR_ARGB optional
!IP_BORDERS_ALLBO_COLOR_INDEXED type ZEXCEL_STYLE_COLOR_INDEXED optional
!IP_BORDERS_ALLBO_COLOR_THEME type ZEXCEL_STYLE_COLOR_THEME optional
!IP_BORDERS_ALLBO_COLOR_TINT type ZEXCEL_STYLE_COLOR_TINT optional
!IP_BORDERS_DIAGONAL_STYLE type ZEXCEL_BORDER optional
!IP_BORDERS_DIAGONAL_COLOR type ZEXCEL_S_STYLE_COLOR optional
!IP_BORDERS_DIAGONAL_COLOR_RGB type ZEXCEL_STYLE_COLOR_ARGB optional
!IP_BORDERS_DIAGONAL_COLOR_INDE type ZEXCEL_STYLE_COLOR_INDEXED optional
!IP_BORDERS_DIAGONAL_COLOR_THEM type ZEXCEL_STYLE_COLOR_THEME optional
!IP_BORDERS_DIAGONAL_COLOR_TINT type ZEXCEL_STYLE_COLOR_TINT optional
!IP_BORDERS_DOWN_STYLE type ZEXCEL_BORDER optional
!IP_BORDERS_DOWN_COLOR type ZEXCEL_S_STYLE_COLOR optional
!IP_BORDERS_DOWN_COLOR_RGB type ZEXCEL_STYLE_COLOR_ARGB optional
!IP_BORDERS_DOWN_COLOR_INDEXED type ZEXCEL_STYLE_COLOR_INDEXED optional
!IP_BORDERS_DOWN_COLOR_THEME type ZEXCEL_STYLE_COLOR_THEME optional
!IP_BORDERS_DOWN_COLOR_TINT type ZEXCEL_STYLE_COLOR_TINT optional
!IP_BORDERS_LEFT_STYLE type ZEXCEL_BORDER optional
!IP_BORDERS_LEFT_COLOR type ZEXCEL_S_STYLE_COLOR optional
!IP_BORDERS_LEFT_COLOR_RGB type ZEXCEL_STYLE_COLOR_ARGB optional
!IP_BORDERS_LEFT_COLOR_INDEXED type ZEXCEL_STYLE_COLOR_INDEXED optional
!IP_BORDERS_LEFT_COLOR_THEME type ZEXCEL_STYLE_COLOR_THEME optional
!IP_BORDERS_LEFT_COLOR_TINT type ZEXCEL_STYLE_COLOR_TINT optional
!IP_BORDERS_RIGHT_STYLE type ZEXCEL_BORDER optional
!IP_BORDERS_RIGHT_COLOR type ZEXCEL_S_STYLE_COLOR optional
!IP_BORDERS_RIGHT_COLOR_RGB type ZEXCEL_STYLE_COLOR_ARGB optional
!IP_BORDERS_RIGHT_COLOR_INDEXED type ZEXCEL_STYLE_COLOR_INDEXED optional
!IP_BORDERS_RIGHT_COLOR_THEME type ZEXCEL_STYLE_COLOR_THEME optional
!IP_BORDERS_RIGHT_COLOR_TINT type ZEXCEL_STYLE_COLOR_TINT optional
!IP_BORDERS_TOP_STYLE type ZEXCEL_BORDER optional
!IP_BORDERS_TOP_COLOR type ZEXCEL_S_STYLE_COLOR optional
!IP_BORDERS_TOP_COLOR_RGB type ZEXCEL_STYLE_COLOR_ARGB optional
!IP_BORDERS_TOP_COLOR_INDEXED type ZEXCEL_STYLE_COLOR_INDEXED optional
!IP_BORDERS_TOP_COLOR_THEME type ZEXCEL_STYLE_COLOR_THEME optional
!IP_BORDERS_TOP_COLOR_TINT type ZEXCEL_STYLE_COLOR_TINT optional
returning
value(EP_GUID) type ZEXCEL_CELL_STYLE
raising
ZCX_EXCEL .
methods CONSTRUCTOR
importing
!IP_EXCEL type ref to ZCL_EXCEL
!IP_TITLE type ZEXCEL_SHEET_TITLE optional
raising
ZCX_EXCEL .
methods DELETE_MERGE
importing
!IP_CELL_COLUMN type SIMPLE optional
!IP_CELL_ROW type ZEXCEL_CELL_ROW optional
raising
ZCX_EXCEL .
methods DELETE_ROW_OUTLINE
importing
!IV_ROW_FROM type I
!IV_ROW_TO type I
raising
ZCX_EXCEL .
methods FREEZE_PANES
importing
!IP_NUM_COLUMNS type I optional
!IP_NUM_ROWS type I optional
raising
ZCX_EXCEL .
methods GET_ACTIVE_CELL
returning
value(EP_ACTIVE_CELL) type STRING
raising
ZCX_EXCEL .
methods GET_CELL
importing
!IP_COLUMN type SIMPLE
!IP_ROW type ZEXCEL_CELL_ROW
exporting
!EP_VALUE type ZEXCEL_CELL_VALUE
!EP_RC type SYSUBRC
!EP_STYLE type ref to ZCL_EXCEL_STYLE
!EP_GUID type ZEXCEL_CELL_STYLE
!EP_FORMULA type ZEXCEL_CELL_FORMULA
raising
ZCX_EXCEL .
methods GET_COLUMN
importing
!IP_COLUMN type SIMPLE
returning
value(EO_COLUMN) type ref to ZCL_EXCEL_COLUMN .
methods GET_COLUMNS
returning
value(EO_COLUMNS) type ref to ZCL_EXCEL_COLUMNS .
methods GET_COLUMNS_ITERATOR
returning
value(EO_ITERATOR) type ref to CL_OBJECT_COLLECTION_ITERATOR .
methods GET_STYLE_COND_ITERATOR
returning
value(EO_ITERATOR) type ref to CL_OBJECT_COLLECTION_ITERATOR .
methods GET_DATA_VALIDATIONS_ITERATOR
returning
value(EO_ITERATOR) type ref to CL_OBJECT_COLLECTION_ITERATOR .
methods GET_DATA_VALIDATIONS_SIZE
returning
value(EP_SIZE) type I .
methods GET_DEFAULT_COLUMN
returning
value(EO_COLUMN) type ref to ZCL_EXCEL_COLUMN .
methods GET_DEFAULT_EXCEL_DATE_FORMAT
returning
value(EP_DEFAULT_EXCEL_DATE_FORMAT) type ZEXCEL_NUMBER_FORMAT .
methods GET_DEFAULT_EXCEL_TIME_FORMAT
returning
value(EP_DEFAULT_EXCEL_TIME_FORMAT) type ZEXCEL_NUMBER_FORMAT .
methods GET_DEFAULT_ROW
returning
value(EO_ROW) type ref to ZCL_EXCEL_ROW .
methods GET_DIMENSION_RANGE
returning
value(EP_DIMENSION_RANGE) type STRING
raising
ZCX_EXCEL .
methods GET_COMMENTS
returning
value(R_COMMENTS) type ref to ZCL_EXCEL_COMMENTS .
methods GET_DRAWINGS
importing
!IP_TYPE type ZEXCEL_DRAWING_TYPE optional
returning
value(R_DRAWINGS) type ref to ZCL_EXCEL_DRAWINGS .
methods GET_COMMENTS_ITERATOR
returning
value(EO_ITERATOR) type ref to CL_OBJECT_COLLECTION_ITERATOR .
methods GET_DRAWINGS_ITERATOR
importing
!IP_TYPE type ZEXCEL_DRAWING_TYPE
returning
value(EO_ITERATOR) type ref to CL_OBJECT_COLLECTION_ITERATOR .
methods GET_FREEZE_CELL
exporting
!EP_ROW type ZEXCEL_CELL_ROW
!EP_COLUMN type ZEXCEL_CELL_COLUMN .
methods GET_GUID
returning
value(EP_GUID) type UUID .
methods GET_HIGHEST_COLUMN
returning
value(R_HIGHEST_COLUMN) type ZEXCEL_CELL_COLUMN
raising
ZCX_EXCEL .
methods GET_HIGHEST_ROW
returning
value(R_HIGHEST_ROW) type INT4
raising
ZCX_EXCEL .
methods GET_HYPERLINKS_ITERATOR
returning
value(EO_ITERATOR) type ref to CL_OBJECT_COLLECTION_ITERATOR .
methods GET_HYPERLINKS_SIZE
returning
value(EP_SIZE) type I .
methods GET_MERGE
returning
value(MERGE_RANGE) type STRING_TABLE
raising
ZCX_EXCEL .
methods GET_PAGEBREAKS
returning
value(RO_PAGEBREAKS) type ref to ZCL_EXCEL_WORKSHEET_PAGEBREAKS
raising
ZCX_EXCEL .
methods GET_RANGES_ITERATOR
returning
value(EO_ITERATOR) type ref to CL_OBJECT_COLLECTION_ITERATOR .
methods GET_ROW
importing
!IP_ROW type INT4
returning
value(EO_ROW) type ref to ZCL_EXCEL_ROW .
methods GET_ROWS
returning
value(EO_ROWS) type ref to ZCL_EXCEL_ROWS .
methods GET_ROWS_ITERATOR
returning
value(EO_ITERATOR) type ref to CL_OBJECT_COLLECTION_ITERATOR .
methods GET_ROW_OUTLINES
returning
value(RT_ROW_OUTLINES) type MTY_TS_OUTLINES_ROW .
methods GET_STYLE_COND
importing
!IP_GUID type ZEXCEL_CELL_STYLE
returning
value(EO_STYLE_COND) type ref to ZCL_EXCEL_STYLE_COND .
methods GET_TABCOLOR
returning
value(EV_TABCOLOR) type ZEXCEL_S_TABCOLOR .
methods GET_TABLES_ITERATOR
returning
value(EO_ITERATOR) type ref to CL_OBJECT_COLLECTION_ITERATOR .
methods GET_TABLES_SIZE
returning
value(EP_SIZE) type I .
methods GET_TITLE
importing
!IP_ESCAPED type FLAG default ''
returning
value(EP_TITLE) type ZEXCEL_SHEET_TITLE .
methods IS_CELL_MERGED
importing
!IP_COLUMN type SIMPLE
!IP_ROW type ZEXCEL_CELL_ROW
returning
value(RP_IS_MERGED) type ABAP_BOOL
raising
ZCX_EXCEL .
methods SET_CELL
importing
!IP_COLUMN type SIMPLE
!IP_ROW type ZEXCEL_CELL_ROW
!IP_VALUE type SIMPLE optional
!IP_FORMULA type ZEXCEL_CELL_FORMULA optional
!IP_STYLE type ZEXCEL_CELL_STYLE optional
!IP_HYPERLINK type ref to ZCL_EXCEL_HYPERLINK optional
!IP_DATA_TYPE type ZEXCEL_CELL_DATA_TYPE optional
!IP_ABAP_TYPE type ABAP_TYPEKIND optional
raising
ZCX_EXCEL .
methods SET_CELL_FORMULA
importing
!IP_COLUMN type SIMPLE
!IP_ROW type ZEXCEL_CELL_ROW
!IP_FORMULA type ZEXCEL_CELL_FORMULA
raising
ZCX_EXCEL .
methods SET_CELL_STYLE
importing
!IP_COLUMN type SIMPLE
!IP_ROW type ZEXCEL_CELL_ROW
!IP_STYLE type ZEXCEL_CELL_STYLE
raising
ZCX_EXCEL .
methods SET_COLUMN_WIDTH
importing
!IP_COLUMN type SIMPLE
!IP_WIDTH_FIX type SIMPLE default 0
!IP_WIDTH_AUTOSIZE type FLAG default 'X'
raising
ZCX_EXCEL .
methods SET_DEFAULT_EXCEL_DATE_FORMAT
importing
!IP_DEFAULT_EXCEL_DATE_FORMAT type ZEXCEL_NUMBER_FORMAT
raising
ZCX_EXCEL .
methods SET_MERGE
importing
!IP_COLUMN_START type SIMPLE default ZCL_EXCEL_COMMON=>C_EXCEL_SHEET_MIN_COL
!IP_COLUMN_END type SIMPLE default ZCL_EXCEL_COMMON=>C_EXCEL_SHEET_MAX_COL
!IP_ROW type ZEXCEL_CELL_ROW default ZCL_EXCEL_COMMON=>C_EXCEL_SHEET_MIN_ROW
!IP_ROW_TO type ZEXCEL_CELL_ROW default ZCL_EXCEL_COMMON=>C_EXCEL_SHEET_MAX_ROW
!IP_STYLE type ZEXCEL_CELL_STYLE optional "added parameter
!IP_VALUE type SIMPLE optional "added parameter
!IP_FORMULA type ZEXCEL_CELL_FORMULA optional "added parameter
raising
ZCX_EXCEL .
methods SET_PRINT_GRIDLINES
importing
!I_PRINT_GRIDLINES type ZEXCEL_PRINT_GRIDLINES .
methods SET_ROW_HEIGHT
importing
!IP_ROW type SIMPLE
!IP_HEIGHT_FIX type SIMPLE
raising
ZCX_EXCEL .
methods SET_ROW_OUTLINE
importing
!IV_ROW_FROM type I
!IV_ROW_TO type I
!IV_COLLAPSED type ABAP_BOOL
raising
ZCX_EXCEL .
methods SET_SHOW_GRIDLINES
importing
!I_SHOW_GRIDLINES type ZEXCEL_SHOW_GRIDLINES .
methods SET_SHOW_ROWCOLHEADERS
importing
!I_SHOW_ROWCOLHEADERS type ZEXCEL_SHOW_ROWCOLHEADER .
methods SET_TABCOLOR
importing
!IV_TABCOLOR type ZEXCEL_S_TABCOLOR .
methods SET_TABLE
importing
!IP_TABLE type standard table
!IP_HDR_STYLE type ZEXCEL_CELL_STYLE optional
!IP_BODY_STYLE type ZEXCEL_CELL_STYLE optional
!IP_TABLE_TITLE type STRING
!IP_TOP_LEFT_COLUMN type ZEXCEL_CELL_COLUMN_ALPHA default 'B'
!IP_TOP_LEFT_ROW type ZEXCEL_CELL_ROW default 3
!IP_TRANSPOSE type XFELD optional
!IP_NO_HEADER type XFELD optional
raising
ZCX_EXCEL .
methods SET_TITLE
importing
!IP_TITLE type ZEXCEL_SHEET_TITLE
raising
ZCX_EXCEL .
methods GET_TABLE
importing
IV_SKIPPED_ROWS type INT4 default 0
IV_SKIPPED_COLS type INT4 default 0
exporting
ET_TABLE type standard table
raising
ZCX_EXCEL.
methods SET_MERGE_STYLE
importing
!IP_COLUMN_START type simple optional
!IP_COLUMN_END type simple optional
!IP_ROW type ZEXCEL_CELL_ROW optional
!IP_ROW_TO type ZEXCEL_CELL_ROW optional
!IP_STYLE type ZEXCEL_CELL_STYLE optional .
methods SET_AREA_FORMULA
importing
!IP_COLUMN_START type simple
!IP_COLUMN_END type simple optional
!IP_ROW type ZEXCEL_CELL_ROW
!IP_ROW_TO type ZEXCEL_CELL_ROW optional
!IP_FORMULA type ZEXCEL_CELL_FORMULA
!IP_MERGE type ABAP_BOOL optional
raising
ZCX_EXCEL .
methods SET_AREA_STYLE
importing
!IP_COLUMN_START type simple
!IP_COLUMN_END type simple optional
!IP_ROW type ZEXCEL_CELL_ROW
!IP_ROW_TO type ZEXCEL_CELL_ROW optional
!IP_STYLE type ZEXCEL_CELL_STYLE
!IP_MERGE type ABAP_BOOL optional .
methods SET_AREA
importing
!IP_COLUMN_START type simple
!IP_COLUMN_END type simple optional
!IP_ROW type ZEXCEL_CELL_ROW
!IP_ROW_TO type ZEXCEL_CELL_ROW optional
!IP_VALUE type SIMPLE optional
!IP_FORMULA type ZEXCEL_CELL_FORMULA optional
!IP_STYLE type ZEXCEL_CELL_STYLE optional
!IP_HYPERLINK type ref to ZCL_EXCEL_HYPERLINK optional
!IP_DATA_TYPE type ZEXCEL_CELL_DATA_TYPE optional
!IP_ABAP_TYPE type ABAP_TYPEKIND optional
!IP_MERGE type ABAP_BOOL optional
raising
ZCX_EXCEL .
*"* protected components of class ZCL_EXCEL_WORKSHEET
*"* do not include other source files here!!!
*"* protected components of class ZCL_EXCEL_WORKSHEET
*"* do not include other source files here!!!
protected section.
private section.
types:
begin of MTY_S_FONT_METRIC,
CHAR type C length 1,
CHAR_WIDTH type TDCWIDTHS,
end of MTY_S_FONT_METRIC .
types:
MTY_TH_FONT_METRICS
type hashed table of MTY_S_FONT_METRIC
with unique key CHAR .
types:
begin of MTY_S_FONT_CACHE,
FONT_NAME type ZEXCEL_STYLE_FONT_NAME,
FONT_HEIGHT type TDFONTSIZE,
FLAG_BOLD type ABAP_BOOL,
FLAG_ITALIC type ABAP_BOOL,
TH_FONT_METRICS type MTY_TH_FONT_METRICS,
end of MTY_S_FONT_CACHE .
types:
MTY_TH_FONT_CACHE
type hashed table of MTY_S_FONT_CACHE
with unique key FONT_NAME FONT_HEIGHT FLAG_BOLD FLAG_ITALIC .
types:
* types:
* mty_ts_row_dimension TYPE SORTED TABLE OF zexcel_s_worksheet_rowdimensio WITH UNIQUE KEY row .
begin of MTY_MERGE,
ROW_FROM type I,
ROW_TO type I,
COL_FROM type I,
COL_TO type I,
end of MTY_MERGE .
types:
MTY_TS_MERGE type sorted table of MTY_MERGE with unique key TABLE_LINE .
*"* private components of class ZCL_EXCEL_WORKSHEET
*"* do not include other source files here!!!
data ACTIVE_CELL type ZEXCEL_S_CELL_DATA .
data CHARTS type ref to ZCL_EXCEL_DRAWINGS .
data COLUMNS type ref to ZCL_EXCEL_COLUMNS .
data ROW_DEFAULT type ref to ZCL_EXCEL_ROW .
data COLUMN_DEFAULT type ref to ZCL_EXCEL_COLUMN .
data STYLES_COND type ref to ZCL_EXCEL_STYLES_COND .
data DATA_VALIDATIONS type ref to ZCL_EXCEL_DATA_VALIDATIONS .
data DEFAULT_EXCEL_DATE_FORMAT type ZEXCEL_NUMBER_FORMAT .
data DEFAULT_EXCEL_TIME_FORMAT type ZEXCEL_NUMBER_FORMAT .
data COMMENTS type ref to ZCL_EXCEL_COMMENTS .
data DRAWINGS type ref to ZCL_EXCEL_DRAWINGS .
data FREEZE_PANE_CELL_COLUMN type ZEXCEL_CELL_COLUMN .
data FREEZE_PANE_CELL_ROW type ZEXCEL_CELL_ROW .
data GUID type UUID .
data HYPERLINKS type ref to CL_OBJECT_COLLECTION .
data LOWER_CELL type ZEXCEL_S_CELL_DATA .
data MO_PAGEBREAKS type ref to ZCL_EXCEL_WORKSHEET_PAGEBREAKS .
class-data MTH_FONT_CACHE type MTY_TH_FONT_CACHE .
data MT_MERGED_CELLS type MTY_TS_MERGE .
data MT_ROW_OUTLINES type MTY_TS_OUTLINES_ROW .
data PRINT_TITLE_COL_FROM type ZEXCEL_CELL_COLUMN_ALPHA .
data PRINT_TITLE_COL_TO type ZEXCEL_CELL_COLUMN_ALPHA .
data PRINT_TITLE_ROW_FROM type ZEXCEL_CELL_ROW .
data PRINT_TITLE_ROW_TO type ZEXCEL_CELL_ROW .
data RANGES type ref to ZCL_EXCEL_RANGES .
data ROWS type ref to ZCL_EXCEL_ROWS .
data TABLES type ref to CL_OBJECT_COLLECTION .
data TITLE type ZEXCEL_SHEET_TITLE value 'Worksheet'. "#EC NOTEXT . . . . . . . . . . . . . . . . . . . . . . . . . . . . " .
data UPPER_CELL type ZEXCEL_S_CELL_DATA .
methods CALCULATE_CELL_WIDTH
importing
!IP_COLUMN type SIMPLE
!IP_ROW type ZEXCEL_CELL_ROW
returning
value(EP_WIDTH) type FLOAT
raising
ZCX_EXCEL .
methods GENERATE_TITLE
returning
value(EP_TITLE) type ZEXCEL_SHEET_TITLE .
methods GET_VALUE_TYPE
importing
!IP_VALUE type SIMPLE
exporting
!EP_VALUE type SIMPLE
!EP_VALUE_TYPE type ABAP_TYPEKIND .
methods PRINT_TITLE_SET_RANGE .
methods UPDATE_DIMENSION_RANGE
raising
ZCX_EXCEL .
ENDCLASS.
CLASS ZCL_EXCEL_WORKSHEET IMPLEMENTATION.
METHOD add_comment.
comments->include( ip_comment ).
ENDMETHOD.
method ADD_DRAWING.
case IP_DRAWING->GET_TYPE( ).
when ZCL_EXCEL_DRAWING=>TYPE_IMAGE.
DRAWINGS->INCLUDE( IP_DRAWING ).
when ZCL_EXCEL_DRAWING=>TYPE_CHART.
CHARTS->INCLUDE( IP_DRAWING ).
endcase.
endmethod.
method ADD_NEW_COLUMN.
data: LV_COLUMN_ALPHA type ZEXCEL_CELL_COLUMN_ALPHA.
LV_COLUMN_ALPHA = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2ALPHA( IP_COLUMN ).
create object EO_COLUMN
exporting
IP_INDEX = LV_COLUMN_ALPHA
IP_EXCEL = ME->EXCEL
IP_WORKSHEET = ME.
COLUMNS->ADD( EO_COLUMN ).
endmethod.
method ADD_NEW_DATA_VALIDATION.
create object EO_DATA_VALIDATION.
DATA_VALIDATIONS->ADD( EO_DATA_VALIDATION ).
endmethod.
method ADD_NEW_RANGE.
* Create default blank range
create object EO_RANGE.
RANGES->ADD( EO_RANGE ).
endmethod.
method ADD_NEW_ROW.
create object EO_ROW
exporting
IP_INDEX = IP_ROW.
ROWS->ADD( EO_ROW ).
endmethod.
method ADD_NEW_STYLE_COND.
create object EO_STYLE_COND.
STYLES_COND->ADD( EO_STYLE_COND ).
endmethod.
method BIND_ALV.
data: LO_CONVERTER type ref to ZCL_EXCEL_CONVERTER.
create object LO_CONVERTER.
try.
LO_CONVERTER->CONVERT(
exporting
IO_ALV = IO_ALV
IT_TABLE = IT_TABLE
I_ROW_INT = I_TOP
I_COLUMN_INT = I_LEFT
I_TABLE = I_TABLE
I_STYLE_TABLE = TABLE_STYLE
IO_WORKSHEET = ME
changing
CO_EXCEL = EXCEL ).
catch ZCX_EXCEL .
endtry.
endmethod.
method BIND_ALV_OLE2.
*--------------------------------------------------------------------*
* Method description:
* Method use to export a CL_GUI_ALV_GRID object to xlsx/xls file
* with list header and characteristics of ALV field catalog such as:
* + Total, group's subtotal
* + Quantity fields, amount fields (dependent fields)
* + No_out, no_zero, ...
* Technique use in method:
* SAP Desktop Office Integration (DOI)
*--------------------------------------------------------------------*
* Data for session 0: DOI constructor
* ------------------------------------------
data: LO_CONTROL type ref to I_OI_CONTAINER_CONTROL.
data: LO_PROXY type ref to I_OI_DOCUMENT_PROXY.
data: LO_SPREADSHEET type ref to I_OI_SPREADSHEET.
data: LO_ERROR type ref to I_OI_ERROR.
data: LC_RETCODE type SOI_RET_STRING.
data: LI_HAS type I. "Proxy has spreadsheet interface?
data: L_IS_CLOSED type I.
* Data for session 1: Get LVC data from ALV object
* ------------------------------------------
data: L_HAS_ACTIVEX,
L_DOCTYPE_EXCEL_SHEET(11) type C.
* LVC
data: LT_FIELDCAT_LVC type LVC_T_FCAT.
data: WA_FIELDCAT_LVC type LVC_S_FCAT.
data: LT_SORT_LVC type LVC_T_SORT.
data: LT_FILTER_IDX_LVC type LVC_T_FIDX.
data: LT_GROUPLEVELS_LVC type LVC_T_GRPL.
* KKBLO
data: LT_FIELDCAT_KKBLO type KKBLO_T_FIELDCAT.
data: LT_SORT_KKBLO type KKBLO_T_SORTINFO.
data: LT_GROUPLEVELS_KKBLO type KKBLO_T_GROUPLEVELS.
data: LT_FILTER_IDX_KKBLO type KKBLO_T_SFINFO.
data: WA_LISTHEADER like line of IT_LISTHEADER.
* Subtotal
data: LT_COLLECT00 type ref to DATA.
data: LT_COLLECT01 type ref to DATA.
data: LT_COLLECT02 type ref to DATA.
data: LT_COLLECT03 type ref to DATA.
data: LT_COLLECT04 type ref to DATA.
data: LT_COLLECT05 type ref to DATA.
data: LT_COLLECT06 type ref to DATA.
data: LT_COLLECT07 type ref to DATA.
data: LT_COLLECT08 type ref to DATA.
data: LT_COLLECT09 type ref to DATA.
* data table name
data: L_TABNAME type KKBLO_TABNAME.
* local object
data: LO_GRID type ref to LCL_GUI_ALV_GRID.
* data table get from ALV
data: LT_ALV type ref to DATA.
* total / subtotal data
field-symbols: <F_COLLECT00> type standard table.
field-symbols: <F_COLLECT01> type standard table.
field-symbols: <F_COLLECT02> type standard table.
field-symbols: <F_COLLECT03> type standard table.
field-symbols: <F_COLLECT04> type standard table.
field-symbols: <F_COLLECT05> type standard table.
field-symbols: <F_COLLECT06> type standard table.
field-symbols: <F_COLLECT07> type standard table.
field-symbols: <F_COLLECT08> type standard table.
field-symbols: <F_COLLECT09> type standard table.
* table before append subtotal lines
field-symbols: <F_ALV_TAB> type standard table.
* data for session 2: sort, filter and calculate total/subtotal
* ------------------------------------------
* table to save index of subotal / total line in excel tanle
* this ideal to control index of subtotal / total line later
* for ex, when get subtotal / total line to format
types: begin of ST_SUBTOT_INDEXS,
INDEX type I,
end of ST_SUBTOT_INDEXS.
data: LT_SUBTOT_INDEXS type table of ST_SUBTOT_INDEXS.
data: WA_SUBTOT_INDEXS like line of LT_SUBTOT_INDEXS.
* data table after append subtotal
data: LT_EXCEL type ref to DATA.
data: L_TABIX type I.
data: L_SAVE_INDEX type I.
* dyn subtotal table name
data: L_COLLECT type STRING.
* subtotal range, to format subtotal (and total)
data: SUBRANGES type SOI_RANGE_LIST.
data: SUBRANGEITEM type SOI_RANGE_ITEM.
data: L_SUB_INDEX type I.
* table after append subtotal lines
field-symbols: <F_EXCEL_TAB> type standard table.
field-symbols: <F_EXCEL_LINE> type ANY.
* dyn subtotal tables
field-symbols: <F_COLLECT_TAB> type standard table.
field-symbols: <F_COLLECT_LINE> type ANY.
field-symbols: <F_FILTER_IDX_LINE> like line of LT_FILTER_IDX_KKBLO.
field-symbols: <F_FIELDCAT_LINE> like line of LT_FIELDCAT_KKBLO.
field-symbols: <F_GROUPLEVELS_LINE> like line of LT_GROUPLEVELS_KKBLO.
field-symbols: <F_LINE> type ANY.
* Data for session 3: map data to semantic table
* ------------------------------------------
types: begin of ST_COLUMN_INDEX,
FIELDNAME type KKBLO_FIELDNAME,
TABNAME type KKBLO_TABNAME,
COL like SY-INDEX,
end of ST_COLUMN_INDEX.
* columns index
data: LT_COLUMN_INDEX type table of ST_COLUMN_INDEX.
data: WA_COLUMN_INDEX like line of LT_COLUMN_INDEX.
* table of dependent field ( currency and quantity unit field)
data: LT_FIELDCAT_DEPF type KKBLO_T_FIELDCAT.
data: WA_FIELDCAT_DEPF type KKBLO_FIELDCAT.
* XXL interface:
* -XXL: contain exporting columns characteristic
data: LT_SEMA type table of GXXLT_S initial size 0.
data: WA_SEMA like line of LT_SEMA.
* -XXL interface: header
data: LT_HKEY type table of GXXLT_H initial size 0.
data: WA_HKEY like line of LT_HKEY.
* -XXL interface: header keys
data: LT_VKEY type table of GXXLT_V initial size 0.
data: WA_VKEY like line of LT_VKEY.
* Number of H Keys: number of key columns
data: L_N_HRZ_KEYS type I.
* Number of data columns in the list object: non-key columns no
data: L_N_ATT_COLS type I.
* Number of V Keys: number of header row
data: L_N_VRT_KEYS type I.
* curency to format amount
data: LT_TCURX type table of TCURX.
data: WA_TCURX like line of LT_TCURX.
data: L_DEF type FLAG. " currency / quantity flag
data: WA_T006 type T006. " decimal place of unit
data: L_NUM type I. " table columns number
data: L_TYP type C. " table type
data: WA type ref to DATA.
data: L_INT type I.
data: L_COUNTER type I.
field-symbols: <F_EXCEL_COLUMN> type ANY.
field-symbols: <F_FCAT_COLUMN> type ANY.
* Data for session 4: write to excel
* ------------------------------------------
data: SEMA_TYPE type C.
data L_ERROR type ref to C_OI_PROXY_ERROR.
data COUNT type I.
data DATAC type I.
data DATAREAL type I. " exporting column number
data VKEYCOUNT type I.
data ALL type I.
data MIT type I value 1. " index of recent row?
data LI_COL_POS type I value 1. " column position
data LI_COL_NUM type I. " table columns number
field-symbols: <LINE> type ANY.
field-symbols: <ITEM> type ANY.
data TD type SYDES_DESC.
data: TYP.
data: RANGES type SOI_RANGE_LIST.
data: RANGEITEM type SOI_RANGE_ITEM.
data: CONTENTS type SOI_GENERIC_TABLE.
data: CONTENTSITEM type SOI_GENERIC_ITEM.
data: SEMAITEM type GXXLT_S.
data: HKEYITEM type GXXLT_H.
data: VKEYITEM type GXXLT_V.
data: LI_COMMENTARY_ROWS type I. "row number of title lines + 1
data: LO_ERROR_W type ref to I_OI_ERROR.
data: L_RETCODE type SOI_RET_STRING.
data: NO_FLUSH type C value 'X'.
data: LI_HEAD_TOP type I. "header rows position
* Data for session 5: Save and clode document
* ------------------------------------------
data: LI_DOCUMENT_SIZE type I.
data: LS_PATH type RLGRAP-FILENAME.
* MACRO: Close_document
*-------------------------------------------
define CLOSE_DOCUMENT.
clear: L_IS_CLOSED.
if LO_PROXY is not initial.
* check proxy detroyed adi
call method LO_PROXY->IS_DESTROYED
importing
RET_VALUE = L_IS_CLOSED.
* if dun detroyed yet: close -> release proxy
if L_IS_CLOSED is initial.
call method LO_PROXY->CLOSE_DOCUMENT
* EXPORTING
* do_save = do_save
importing
ERROR = LO_ERROR
RETCODE = LC_RETCODE.
endif.
call method LO_PROXY->RELEASE_DOCUMENT
importing
ERROR = LO_ERROR
RETCODE = LC_RETCODE.
else.
LC_RETCODE = C_OI_ERRORS=>RET_DOCUMENT_NOT_OPEN.
endif.
* Detroy control container
if LO_CONTROL is not initial.
call method LO_CONTROL->DESTROY_CONTROL.
endif.
clear:
LO_SPREADSHEET,
LO_PROXY,
LO_CONTROL.
* free local
clear: L_IS_CLOSED.
end-of-definition.
* Macro to catch DOI error
*-------------------------------------------
define ERROR_DOI.
if LC_RETCODE ne C_OI_ERRORS=>RET_OK.
CLOSE_DOCUMENT.
call method LO_ERROR->RAISE_MESSAGE
exporting
TYPE = 'E'.
clear: LO_ERROR.
endif.
end-of-definition.
*--------------------------------------------------------------------*
* SESSION 0: DOI CONSTRUCTOR
*--------------------------------------------------------------------*
* check active windown
call function 'GUI_HAS_ACTIVEX'
importing
RETURN = L_HAS_ACTIVEX.
if L_HAS_ACTIVEX is initial.
raise MISS_GUIDE.
endif.
* Get Container Object of Screen
call method C_OI_CONTAINER_CONTROL_CREATOR=>GET_CONTAINER_CONTROL
importing
CONTROL = LO_CONTROL
RETCODE = LC_RETCODE.
ERROR_DOI.
* Initialize Container control
call method LO_CONTROL->INIT_CONTROL
exporting
PARENT = CL_GUI_CONTAINER=>DEFAULT_SCREEN
R3_APPLICATION_NAME = ''
INPLACE_ENABLED = 'X'
NO_FLUSH = 'X'
REGISTER_ON_CLOSE_EVENT = 'X'
REGISTER_ON_CUSTOM_EVENT = 'X'
importing
ERROR = LO_ERROR
RETCODE = LC_RETCODE.
ERROR_DOI.
* Get Proxy Document:
* check exist of document proxy, if exist -> close first
if not LO_PROXY is initial.
CLOSE_DOCUMENT.
endif.
if I_XLS is not initial.
* xls format, doctype = soi_doctype_excel97_sheet
L_DOCTYPE_EXCEL_SHEET = 'Excel.Sheet.8'.
else.
* xlsx format, doctype = soi_doctype_excel_sheet
L_DOCTYPE_EXCEL_SHEET = 'Excel.Sheet'.
endif.
call method LO_CONTROL->GET_DOCUMENT_PROXY
exporting
DOCUMENT_TYPE = L_DOCTYPE_EXCEL_SHEET
REGISTER_CONTAINER = 'X'
importing
DOCUMENT_PROXY = LO_PROXY
ERROR = LO_ERROR
RETCODE = LC_RETCODE.
ERROR_DOI.
if I_DOCUMENT_URL is initial.
* create new excel document
call method LO_PROXY->CREATE_DOCUMENT
exporting
CREATE_VIEW_DATA = 'X'
OPEN_INPLACE = 'X'
NO_FLUSH = 'X'
importing
ERROR = LO_ERROR
RETCODE = LC_RETCODE.
ERROR_DOI.
else.
* Read excel template for i_DOCUMENT_URL
* this excel template can be store in local or server
call method LO_PROXY->OPEN_DOCUMENT
exporting
DOCUMENT_URL = I_DOCUMENT_URL
OPEN_INPLACE = 'X'
NO_FLUSH = 'X'
importing
ERROR = LO_ERROR
RETCODE = LC_RETCODE.
ERROR_DOI.
endif.
* Check Spreadsheet Interface of Document Proxy
call method LO_PROXY->HAS_SPREADSHEET_INTERFACE
importing
IS_AVAILABLE = LI_HAS
ERROR = LO_ERROR
RETCODE = LC_RETCODE.
ERROR_DOI.
* create Spreadsheet object
check LI_HAS is not initial.
call method LO_PROXY->GET_SPREADSHEET_INTERFACE
importing
SHEET_INTERFACE = LO_SPREADSHEET
ERROR = LO_ERROR
RETCODE = LC_RETCODE.
ERROR_DOI.
*--------------------------------------------------------------------*
* SESSION 1: GET LVC DATA FROM ALV OBJECT
*--------------------------------------------------------------------*
* data table
create object LO_GRID
exporting
I_PARENT = CL_GUI_CONTAINER=>SCREEN0.
call method LO_GRID->GET_ALV_ATTRIBUTES
exporting
IO_GRID = IO_ALV
importing
ET_TABLE = LT_ALV.
assign LT_ALV->* to <F_ALV_TAB>.
* fieldcat
call method IO_ALV->GET_FRONTEND_FIELDCATALOG
importing
ET_FIELDCATALOG = LT_FIELDCAT_LVC.
* table name
loop at LT_FIELDCAT_LVC into WA_FIELDCAT_LVC
where not TABNAME is initial.
L_TABNAME = WA_FIELDCAT_LVC-TABNAME.
exit.
endloop.
if SY-SUBRC ne 0.
L_TABNAME = '1'.
endif.
clear: WA_FIELDCAT_LVC.
* sort table
call method IO_ALV->GET_SORT_CRITERIA
importing
ET_SORT = LT_SORT_LVC.
* filter index
call method IO_ALV->GET_FILTERED_ENTRIES
importing
ET_FILTERED_ENTRIES = LT_FILTER_IDX_LVC.
* group level + subtotal
call method IO_ALV->GET_SUBTOTALS
importing
EP_COLLECT00 = LT_COLLECT00
EP_COLLECT01 = LT_COLLECT01
EP_COLLECT02 = LT_COLLECT02
EP_COLLECT03 = LT_COLLECT03
EP_COLLECT04 = LT_COLLECT04
EP_COLLECT05 = LT_COLLECT05
EP_COLLECT06 = LT_COLLECT06
EP_COLLECT07 = LT_COLLECT07
EP_COLLECT08 = LT_COLLECT08
EP_COLLECT09 = LT_COLLECT09
ET_GROUPLEVELS = LT_GROUPLEVELS_LVC.
assign LT_COLLECT00->* to <F_COLLECT00>.
assign LT_COLLECT01->* to <F_COLLECT01>.
assign LT_COLLECT02->* to <F_COLLECT02>.
assign LT_COLLECT03->* to <F_COLLECT03>.
assign LT_COLLECT04->* to <F_COLLECT04>.
assign LT_COLLECT05->* to <F_COLLECT05>.
assign LT_COLLECT06->* to <F_COLLECT06>.
assign LT_COLLECT07->* to <F_COLLECT07>.
assign LT_COLLECT08->* to <F_COLLECT08>.
assign LT_COLLECT09->* to <F_COLLECT09>.
* transfer to KKBLO struct
call function 'LVC_TRANSFER_TO_KKBLO'
exporting
IT_FIELDCAT_LVC = LT_FIELDCAT_LVC
IT_SORT_LVC = LT_SORT_LVC
IT_FILTER_INDEX_LVC = LT_FILTER_IDX_LVC
IT_GROUPLEVELS_LVC = LT_GROUPLEVELS_LVC
importing
ET_FIELDCAT_KKBLO = LT_FIELDCAT_KKBLO
ET_SORT_KKBLO = LT_SORT_KKBLO
ET_FILTERED_ENTRIES_KKBLO = LT_FILTER_IDX_KKBLO
ET_GROUPLEVELS_KKBLO = LT_GROUPLEVELS_KKBLO
tables
IT_DATA = <F_ALV_TAB>
exceptions
IT_DATA_MISSING = 1
IT_FIELDCAT_LVC_MISSING = 2
others = 3.
if SY-SUBRC <> 0.
raise EX_TRANSFER_KKBLO_ERROR.
endif.
clear:
WA_FIELDCAT_LVC,
LT_FIELDCAT_LVC,
LT_SORT_LVC,
LT_FILTER_IDX_LVC,
LT_GROUPLEVELS_LVC.
clear:
LO_GRID.
*--------------------------------------------------------------------*
* SESSION 2: SORT, FILTER AND CALCULATE TOTAL / SUBTOTAL
*--------------------------------------------------------------------*
* append subtotal & total line
create data LT_EXCEL like <F_ALV_TAB>.
assign LT_EXCEL->* to <F_EXCEL_TAB>.
loop at <F_ALV_TAB> assigning <F_LINE>.
L_SAVE_INDEX = SY-TABIX.
* filter base on filter index table
read table LT_FILTER_IDX_KKBLO assigning <F_FILTER_IDX_LINE>
with key INDEX = L_SAVE_INDEX
binary search.
if SY-SUBRC ne 0.
append <F_LINE> to <F_EXCEL_TAB>.
endif.
* append subtotal lines
read table LT_GROUPLEVELS_KKBLO assigning <F_GROUPLEVELS_LINE>
with key INDEX_TO = L_SAVE_INDEX
binary search.
if SY-SUBRC = 0.
L_TABIX = SY-TABIX.
do.
if <F_GROUPLEVELS_LINE>-SUBTOT eq 'X' and
<F_GROUPLEVELS_LINE>-HIDE_LEVEL is initial and
<F_GROUPLEVELS_LINE>-CINDEX_FROM ne 0.
* dynamic append subtotal line to excel table base on grouplevel table
* ex <f_GROUPLEVELS_line>-level = 1
* then <f_collect_tab> = '<F_COLLECT01>'
L_COLLECT = <F_GROUPLEVELS_LINE>-LEVEL.
condense L_COLLECT.
concatenate '<F_COLLECT0'
L_COLLECT '>'
* '->*'
into L_COLLECT.
assign (L_COLLECT) to <F_COLLECT_TAB>.
* incase there're more than 1 total line of group, at the same level
* for example: subtotal of multi currency
loop at <F_COLLECT_TAB> assigning <F_COLLECT_LINE>.
if SY-TABIX between <F_GROUPLEVELS_LINE>-CINDEX_FROM
and <F_GROUPLEVELS_LINE>-CINDEX_TO.
append <F_COLLECT_LINE> to <F_EXCEL_TAB>.
* save subtotal lines index
WA_SUBTOT_INDEXS-INDEX = SY-TABIX.
append WA_SUBTOT_INDEXS to LT_SUBTOT_INDEXS.
* append sub total ranges table for format later
add 1 to L_SUB_INDEX.
SUBRANGEITEM-NAME = L_SUB_INDEX.
condense SUBRANGEITEM-NAME.
concatenate 'SUBTOT'
SUBRANGEITEM-NAME
into SUBRANGEITEM-NAME.
SUBRANGEITEM-ROWS = WA_SUBTOT_INDEXS-INDEX.
SUBRANGEITEM-COLUMNS = 1. " start col
append SUBRANGEITEM to SUBRANGES.
clear: SUBRANGEITEM.
endif.
endloop.
unassign: <F_COLLECT_TAB>.
unassign: <F_COLLECT_LINE>.
clear: L_COLLECT.
endif.
* check next subtotal level of group
unassign: <F_GROUPLEVELS_LINE>.
add 1 to L_TABIX.
read table LT_GROUPLEVELS_KKBLO assigning <F_GROUPLEVELS_LINE>
index L_TABIX.
if SY-SUBRC ne 0
or <F_GROUPLEVELS_LINE>-INDEX_TO ne L_SAVE_INDEX.
exit.
endif.
unassign:
<F_COLLECT_TAB>,
<F_COLLECT_LINE>.
enddo.
endif.
clear:
L_TABIX,
L_SAVE_INDEX.
unassign:
<F_FILTER_IDX_LINE>,
<F_GROUPLEVELS_LINE>.
endloop.
* free local data
unassign:
<F_LINE>,
<F_COLLECT_TAB>,
<F_COLLECT_LINE>,
<F_FIELDCAT_LINE>.
* append grand total line
if <F_COLLECT00> is assigned.
assign <F_COLLECT00> to <F_COLLECT_TAB>.
if <F_COLLECT_TAB> is not initial.
loop at <F_COLLECT_TAB> assigning <F_COLLECT_LINE>.
append <F_COLLECT_LINE> to <F_EXCEL_TAB>.
* save total line index
WA_SUBTOT_INDEXS-INDEX = SY-TABIX.
append WA_SUBTOT_INDEXS to LT_SUBTOT_INDEXS.
* append grand total range (to format)
add 1 to L_SUB_INDEX.
SUBRANGEITEM-NAME = L_SUB_INDEX.
condense SUBRANGEITEM-NAME.
concatenate 'TOTAL'
SUBRANGEITEM-NAME
into SUBRANGEITEM-NAME.
SUBRANGEITEM-ROWS = WA_SUBTOT_INDEXS-INDEX.
SUBRANGEITEM-COLUMNS = 1. " start col
append SUBRANGEITEM to SUBRANGES.
endloop.
endif.
endif.
clear:
SUBRANGEITEM,
LT_SORT_KKBLO,
<F_COLLECT00>,
<F_COLLECT01>,
<F_COLLECT02>,
<F_COLLECT03>,
<F_COLLECT04>,
<F_COLLECT05>,
<F_COLLECT06>,
<F_COLLECT07>,
<F_COLLECT08>,
<F_COLLECT09>.
unassign:
<F_COLLECT00>,
<F_COLLECT01>,
<F_COLLECT02>,
<F_COLLECT03>,
<F_COLLECT04>,
<F_COLLECT05>,
<F_COLLECT06>,
<F_COLLECT07>,
<F_COLLECT08>,
<F_COLLECT09>,
<F_COLLECT_TAB>,
<F_COLLECT_LINE>.
*--------------------------------------------------------------------*
* SESSION 3: MAP DATA TO SEMANTIC TABLE
*--------------------------------------------------------------------*
* get dependent field field: currency and quantity
create data WA like line of <F_EXCEL_TAB>.
assign WA->* to <F_EXCEL_LINE>.
describe field <F_EXCEL_LINE> type L_TYP components L_NUM.
do L_NUM times.
L_SAVE_INDEX = SY-INDEX.
assign component L_SAVE_INDEX of structure <F_EXCEL_LINE>
to <F_EXCEL_COLUMN>.
if SY-SUBRC ne 0.
message E059(0K) with 'FATAL ERROR' raising FATAL_ERROR.
endif.
loop at LT_FIELDCAT_KKBLO assigning <F_FIELDCAT_LINE>
where TABNAME = L_TABNAME.
assign component <F_FIELDCAT_LINE>-FIELDNAME
of structure <F_EXCEL_LINE> to <F_FCAT_COLUMN>.
describe distance between <F_EXCEL_COLUMN> and <F_FCAT_COLUMN>
into L_INT in byte mode.
* append column index
* this columns index is of table, not fieldcat
if L_INT = 0.
WA_COLUMN_INDEX-FIELDNAME = <F_FIELDCAT_LINE>-FIELDNAME.
WA_COLUMN_INDEX-TABNAME = <F_FIELDCAT_LINE>-TABNAME.
WA_COLUMN_INDEX-COL = L_SAVE_INDEX.
append WA_COLUMN_INDEX to LT_COLUMN_INDEX.
endif.
* append dependent fields (currency and quantity unit)
if <F_FIELDCAT_LINE>-CFIELDNAME is not initial.
clear WA_FIELDCAT_DEPF.
WA_FIELDCAT_DEPF-FIELDNAME = <F_FIELDCAT_LINE>-CFIELDNAME.
WA_FIELDCAT_DEPF-TABNAME = <F_FIELDCAT_LINE>-CTABNAME.
collect WA_FIELDCAT_DEPF into LT_FIELDCAT_DEPF.
endif.
if <F_FIELDCAT_LINE>-QFIELDNAME is not initial.
clear WA_FIELDCAT_DEPF.
WA_FIELDCAT_DEPF-FIELDNAME = <F_FIELDCAT_LINE>-QFIELDNAME.
WA_FIELDCAT_DEPF-TABNAME = <F_FIELDCAT_LINE>-QTABNAME.
collect WA_FIELDCAT_DEPF into LT_FIELDCAT_DEPF.
endif.
* rewrite field data type
if <F_FIELDCAT_LINE>-INTTYPE = 'X'
and <F_FIELDCAT_LINE>-DATATYPE(3) = 'INT'.
<F_FIELDCAT_LINE>-INTTYPE = 'I'.
endif.
endloop.
clear: L_SAVE_INDEX.
unassign: <F_FIELDCAT_LINE>.
enddo.
* build semantic tables
L_N_HRZ_KEYS = 1.
* Get keyfigures
loop at LT_FIELDCAT_KKBLO assigning <F_FIELDCAT_LINE>
where TABNAME = L_TABNAME
and TECH ne 'X'
and NO_OUT ne 'X'.
clear WA_SEMA.
clear WA_HKEY.
* Units belong to keyfigures -> display as str
read table LT_FIELDCAT_DEPF into WA_FIELDCAT_DEPF with key
FIELDNAME = <F_FIELDCAT_LINE>-FIELDNAME
TABNAME = <F_FIELDCAT_LINE>-TABNAME.
if SY-SUBRC = 0.
WA_SEMA-COL_TYP = 'STR'.
WA_SEMA-COL_OPS = 'DFT'.
* Keyfigures
else.
case <F_FIELDCAT_LINE>-DATATYPE.
when 'QUAN'.
WA_SEMA-COL_TYP = 'N03'.
if <F_FIELDCAT_LINE>-NO_SUM ne 'X'.
WA_SEMA-COL_OPS = 'ADD'.
else.
WA_SEMA-COL_OPS = 'NOP'. " no dependent field
endif.
when 'DATS'.
WA_SEMA-COL_TYP = 'DAT'.
WA_SEMA-COL_OPS = 'NOP'.
when 'CHAR' or 'UNIT' or 'CUKY'. " Added fieldformats UNIT and CUKY - dd. 26-10-2012 Wouter Heuvelmans
WA_SEMA-COL_TYP = 'STR'.
WA_SEMA-COL_OPS = 'DFT'. " dependent field
* incase numeric, ex '00120' -> display as '12'
when 'NUMC'.
WA_SEMA-COL_TYP = 'STR'.
WA_SEMA-COL_OPS = 'DFT'.
when others.
WA_SEMA-COL_TYP = 'NUM'.
if <F_FIELDCAT_LINE>-NO_SUM ne 'X'.
WA_SEMA-COL_OPS = 'ADD'.
else.
WA_SEMA-COL_OPS = 'NOP'.
endif.
endcase.
endif.
L_COUNTER = L_COUNTER + 1.
L_N_ATT_COLS = L_N_ATT_COLS + 1.
WA_SEMA-COL_NO = L_COUNTER.
read table LT_COLUMN_INDEX into WA_COLUMN_INDEX with key
FIELDNAME = <F_FIELDCAT_LINE>-FIELDNAME
TABNAME = <F_FIELDCAT_LINE>-TABNAME.
if SY-SUBRC = 0.
WA_SEMA-COL_SRC = WA_COLUMN_INDEX-COL.
else.
raise FATAL_ERROR.
endif.
* columns index of ref currency field in table
if not <F_FIELDCAT_LINE>-CFIELDNAME is initial.
read table LT_COLUMN_INDEX into WA_COLUMN_INDEX with key
FIELDNAME = <F_FIELDCAT_LINE>-CFIELDNAME
TABNAME = <F_FIELDCAT_LINE>-CTABNAME.
if SY-SUBRC = 0.
WA_SEMA-COL_CUR = WA_COLUMN_INDEX-COL.
endif.
* quantities fields
* treat as currency when display on excel
elseif not <F_FIELDCAT_LINE>-QFIELDNAME is initial.
read table LT_COLUMN_INDEX into WA_COLUMN_INDEX with key
FIELDNAME = <F_FIELDCAT_LINE>-QFIELDNAME
TABNAME = <F_FIELDCAT_LINE>-QTABNAME.
if SY-SUBRC = 0.
WA_SEMA-COL_CUR = WA_COLUMN_INDEX-COL.
endif.
endif.
* Treat of fixed currency in the fieldcatalog for column
data: L_NUM_HELP(2) type N.
if not <F_FIELDCAT_LINE>-CURRENCY is initial.
select * from TCURX into table LT_TCURX.
sort LT_TCURX.
read table LT_TCURX into WA_TCURX
with key CURRKEY = <F_FIELDCAT_LINE>-CURRENCY.
if SY-SUBRC = 0.
L_NUM_HELP = WA_TCURX-CURRDEC.
concatenate 'N' L_NUM_HELP into WA_SEMA-COL_TYP.
WA_SEMA-COL_CUR = SY-TABIX * ( -1 ).
endif.
endif.
WA_HKEY-COL_NO = L_N_ATT_COLS.
WA_HKEY-ROW_NO = L_N_HRZ_KEYS.
WA_HKEY-COL_NAME = <F_FIELDCAT_LINE>-REPTEXT.
append WA_HKEY to LT_HKEY.
append WA_SEMA to LT_SEMA.
endloop.
* free local data
clear:
LT_COLUMN_INDEX,
WA_COLUMN_INDEX,
LT_FIELDCAT_DEPF,
WA_FIELDCAT_DEPF,
LT_TCURX,
WA_TCURX,
L_NUM,
L_TYP,
WA,
L_INT,
L_COUNTER.
unassign:
<F_FIELDCAT_LINE>,
<F_EXCEL_LINE>,
<F_EXCEL_COLUMN>,
<F_FCAT_COLUMN>.
*--------------------------------------------------------------------*
* SESSION 4: WRITE TO EXCEL
*--------------------------------------------------------------------*
clear: WA_TCURX.
refresh: LT_TCURX.
* if spreadsheet dun have proxy yet
if LI_HAS is initial.
L_RETCODE = C_OI_ERRORS=>RET_INTERFACE_NOT_SUPPORTED.
call method C_OI_ERRORS=>CREATE_ERROR_FOR_RETCODE
exporting
RETCODE = L_RETCODE
NO_FLUSH = NO_FLUSH
importing
ERROR = LO_ERROR_W.
exit.
endif.
create object L_ERROR
exporting
OBJECT_NAME = 'OLE_DOCUMENT_PROXY'
METHOD_NAME = 'get_ranges_names'.
call method C_OI_ERRORS=>ADD_ERROR
exporting
ERROR = L_ERROR.
describe table LT_SEMA lines DATAREAL.
describe table <F_EXCEL_TAB> lines DATAC.
describe table LT_VKEY lines VKEYCOUNT.
if DATAC = 0.
raise INV_DATA_RANGE.
endif.
if VKEYCOUNT ne L_N_VRT_KEYS.
raise DIM_MISMATCH_VKEY.
endif.
ALL = L_N_VRT_KEYS + L_N_ATT_COLS.
if DATAREAL ne ALL.
raise DIM_MISMATCH_SEMA.
endif.
data: DECIMAL type C.
* get decimal separator format ('.', ',', ...) in Office config
call method LO_PROXY->GET_APPLICATION_PROPERTY
exporting
PROPERTY_NAME = 'INTERNATIONAL'
SUBPROPERTY_NAME = 'DECIMAL_SEPARATOR'
changing
RETVALUE = DECIMAL.
data: WA_USR type USR01.
select * from USR01 into WA_USR where BNAME = SY-UNAME.
endselect.
data: COMMA_ELIM(4) type C.
field-symbols <G> type ANY.
data SEARCH_ITEM(4) value ' #'.
concatenate ',' DECIMAL '.' DECIMAL into COMMA_ELIM.
data HELP type I. " table (with subtotal) line number
HELP = DATAC.
data: ROWMAX type I value 1. " header row number
data: COLUMNMAX type I value 0. " header columns number
loop at LT_HKEY into HKEYITEM.
if HKEYITEM-COL_NO > COLUMNMAX.
COLUMNMAX = HKEYITEM-COL_NO.
endif.
if HKEYITEM-ROW_NO > ROWMAX.
ROWMAX = HKEYITEM-ROW_NO.
endif.
endloop.
data: HKEYCOLUMNS type I. " header columns no
HKEYCOLUMNS = COLUMNMAX.
if HKEYCOLUMNS < L_N_ATT_COLS.
HKEYCOLUMNS = L_N_ATT_COLS.
endif.
COLUMNMAX = 0.
loop at LT_VKEY into VKEYITEM.
if VKEYITEM-COL_NO > COLUMNMAX.
COLUMNMAX = VKEYITEM-COL_NO.
endif.
endloop.
data OVERFLOW type I value 1.
data TESTNAME(10) type C.
data TEMP2 type I. " 1st item row position in excel
data REALMIT type I value 1.
data REALOVERFLOW type I value 1. " row index in content
call method LO_SPREADSHEET->SCREEN_UPDATE
exporting
UPDATING = ''.
call method LO_SPREADSHEET->LOAD_LIB.
data: STR(40) type C. " range names of columns range (w/o col header)
data: ROWS type I. " row postion of 1st item line in ecxel
* calculate row position of data table
describe table IT_LISTHEADER lines LI_COMMENTARY_ROWS.
* if grid had title, add 1 empy line between title and table
if LI_COMMENTARY_ROWS ne 0.
add 1 to LI_COMMENTARY_ROWS.
endif.
* add top position of block data
LI_COMMENTARY_ROWS = LI_COMMENTARY_ROWS + I_TOP - 1.
* write header (commentary rows)
data: LI_COMMENTARY_ROW_INDEX type I value 1.
data: LI_CONTENT_INDEX type I value 1.
data: LS_INDEX(10) type C.
data LS_COMMENTARY_RANGE(40) type C value 'TITLE'.
data: LI_FONT_BOLD type I.
data: LI_FONT_ITALIC type I.
data: LI_FONT_SIZE type I.
loop at IT_LISTHEADER into WA_LISTHEADER.
LI_COMMENTARY_ROW_INDEX = I_TOP + LI_CONTENT_INDEX - 1.
LS_INDEX = LI_CONTENT_INDEX.
condense LS_INDEX.
concatenate LS_COMMENTARY_RANGE(5) LS_INDEX
into LS_COMMENTARY_RANGE.
condense LS_COMMENTARY_RANGE.
* insert title range
call method LO_SPREADSHEET->INSERT_RANGE_DIM
exporting
NAME = LS_COMMENTARY_RANGE
TOP = LI_COMMENTARY_ROW_INDEX
LEFT = I_LEFT
ROWS = 1
COLUMNS = 1
NO_FLUSH = NO_FLUSH.
* format range
case WA_LISTHEADER-TYP.
when 'H'. "title
LI_FONT_SIZE = 16.
LI_FONT_BOLD = 1.
LI_FONT_ITALIC = -1.
when 'S'. "subtile
LI_FONT_SIZE = -1.
LI_FONT_BOLD = 1.
LI_FONT_ITALIC = -1.
when others. "'A' comment
LI_FONT_SIZE = -1.
LI_FONT_BOLD = -1.
LI_FONT_ITALIC = 1.
endcase.
call method LO_SPREADSHEET->SET_FONT
exporting
RANGENAME = LS_COMMENTARY_RANGE
FAMILY = ''
SIZE = LI_FONT_SIZE
BOLD = LI_FONT_BOLD
ITALIC = LI_FONT_ITALIC
ALIGN = 0
NO_FLUSH = NO_FLUSH.
* title: range content
RANGEITEM-NAME = LS_COMMENTARY_RANGE.
RANGEITEM-COLUMNS = 1.
RANGEITEM-ROWS = 1.
append RANGEITEM to RANGES.
CONTENTSITEM-ROW = LI_CONTENT_INDEX.
CONTENTSITEM-COLUMN = 1.
concatenate WA_LISTHEADER-KEY
WA_LISTHEADER-INFO
into CONTENTSITEM-VALUE
separated by SPACE.
condense CONTENTSITEM-VALUE.
append CONTENTSITEM to CONTENTS.
add 1 to LI_CONTENT_INDEX.
clear:
RANGEITEM,
CONTENTSITEM,
LS_INDEX.
endloop.
* set range data title
call method LO_SPREADSHEET->SET_RANGES_DATA
exporting
RANGES = RANGES
CONTENTS = CONTENTS
NO_FLUSH = NO_FLUSH.
refresh:
RANGES,
CONTENTS.
ROWS = ROWMAX + LI_COMMENTARY_ROWS + 1.
ALL = WA_USR-DATFM.
ALL = ALL + 3.
loop at LT_SEMA into SEMAITEM.
if SEMAITEM-COL_TYP = 'DAT' or SEMAITEM-COL_TYP = 'MON' or
SEMAITEM-COL_TYP = 'N00' or SEMAITEM-COL_TYP = 'N01' or
SEMAITEM-COL_TYP = 'N01' or SEMAITEM-COL_TYP = 'N02' or
SEMAITEM-COL_TYP = 'N03' or SEMAITEM-COL_TYP = 'PCT' or
SEMAITEM-COL_TYP = 'STR' or SEMAITEM-COL_TYP = 'NUM'.
clear STR.
STR = SEMAITEM-COL_NO.
condense STR.
concatenate 'DATA' STR into STR.
MIT = SEMAITEM-COL_NO.
LI_COL_POS = SEMAITEM-COL_NO + I_LEFT - 1.
* range from data1 to data(n), for each columns of table
call method LO_SPREADSHEET->INSERT_RANGE_DIM
exporting
NAME = STR
TOP = ROWS
LEFT = LI_COL_POS
ROWS = HELP
COLUMNS = 1
NO_FLUSH = NO_FLUSH.
data DEC type I value -1.
data TYPEINFO type SYDES_TYPEINFO.
loop at <F_EXCEL_TAB> assigning <LINE>.
assign component SEMAITEM-COL_NO of structure <LINE> to <ITEM>.
describe field <ITEM> into TD.
read table TD-TYPES index 1 into TYPEINFO.
if TYPEINFO-TYPE = 'P'.
DEC = TYPEINFO-DECIMALS.
elseif TYPEINFO-TYPE = 'I'.
DEC = 0.
endif.
describe field <LINE> type TYP components COUNT.
MIT = 1.
do COUNT times.
if MIT = SEMAITEM-COL_SRC.
assign component SY-INDEX of structure <LINE> to <ITEM>.
describe field <ITEM> into TD.
read table TD-TYPES index 1 into TYPEINFO.
if TYPEINFO-TYPE = 'P'.
DEC = TYPEINFO-DECIMALS.
endif.
exit.
endif.
MIT = MIT + 1.
enddo.
exit.
endloop.
* format for each columns of table (w/o columns headers)
if SEMAITEM-COL_TYP = 'DAT'.
if SEMAITEM-COL_NO > VKEYCOUNT.
call method LO_SPREADSHEET->SET_FORMAT
exporting
RANGENAME = STR
CURRENCY = ''
TYP = ALL
NO_FLUSH = NO_FLUSH.
else.
call method LO_SPREADSHEET->SET_FORMAT
exporting
RANGENAME = STR
CURRENCY = ''
TYP = 0
NO_FLUSH = NO_FLUSH.
endif.
elseif SEMAITEM-COL_TYP = 'STR'.
call method LO_SPREADSHEET->SET_FORMAT
exporting
RANGENAME = STR
CURRENCY = ''
TYP = 0
NO_FLUSH = NO_FLUSH.
elseif SEMAITEM-COL_TYP = 'MON'.
call method LO_SPREADSHEET->SET_FORMAT
exporting
RANGENAME = STR
CURRENCY = ''
TYP = 10
NO_FLUSH = NO_FLUSH.
elseif SEMAITEM-COL_TYP = 'N00'.
call method LO_SPREADSHEET->SET_FORMAT
exporting
RANGENAME = STR
CURRENCY = ''
TYP = 1
DECIMALS = 0
NO_FLUSH = NO_FLUSH.
elseif SEMAITEM-COL_TYP = 'N01'.
call method LO_SPREADSHEET->SET_FORMAT
exporting
RANGENAME = STR
CURRENCY = ''
TYP = 1
DECIMALS = 1
NO_FLUSH = NO_FLUSH.
elseif SEMAITEM-COL_TYP = 'N02'.
call method LO_SPREADSHEET->SET_FORMAT
exporting
RANGENAME = STR
CURRENCY = ''
TYP = 1
DECIMALS = 2
NO_FLUSH = NO_FLUSH.
elseif SEMAITEM-COL_TYP = 'N03'.
call method LO_SPREADSHEET->SET_FORMAT
exporting
RANGENAME = STR
CURRENCY = ''
TYP = 1
DECIMALS = 3
NO_FLUSH = NO_FLUSH.
elseif SEMAITEM-COL_TYP = 'N04'.
call method LO_SPREADSHEET->SET_FORMAT
exporting
RANGENAME = STR
CURRENCY = ''
TYP = 1
DECIMALS = 4
NO_FLUSH = NO_FLUSH.
elseif SEMAITEM-COL_TYP = 'NUM'.
if DEC eq -1.
call method LO_SPREADSHEET->SET_FORMAT
exporting
RANGENAME = STR
CURRENCY = ''
TYP = 1
DECIMALS = 2
NO_FLUSH = NO_FLUSH.
else.
call method LO_SPREADSHEET->SET_FORMAT
exporting
RANGENAME = STR
CURRENCY = ''
TYP = 1
DECIMALS = DEC
NO_FLUSH = NO_FLUSH.
endif.
elseif SEMAITEM-COL_TYP = 'PCT'.
call method LO_SPREADSHEET->SET_FORMAT
exporting
RANGENAME = STR
CURRENCY = ''
TYP = 3
DECIMALS = 0
NO_FLUSH = NO_FLUSH.
endif.
endif.
endloop.
* get item contents for set_range_data method
* get currency cell also
MIT = 1.
data: CURRCELLS type SOI_CELL_TABLE.
data: CURRITEM type SOI_CELL_ITEM.
CURRITEM-ROWS = 1.
CURRITEM-COLUMNS = 1.
CURRITEM-FRONT = -1.
CURRITEM-BACK = -1.
CURRITEM-FONT = ''.
CURRITEM-SIZE = -1.
CURRITEM-BOLD = -1.
CURRITEM-ITALIC = -1.
CURRITEM-ALIGN = -1.
CURRITEM-FRAMETYP = -1.
CURRITEM-FRAMECOLOR = -1.
CURRITEM-CURRENCY = ''.
CURRITEM-NUMBER = 1.
CURRITEM-INPUT = -1.
data: CONST type I.
* Change for Correction request
* Initial 10000 lines are missing in Excel Export
* if there are only 2 columns in exported List object.
if DATAREAL gt 2.
CONST = 20000 / DATAREAL.
else.
CONST = 20000 / ( DATAREAL + 2 ).
endif.
data: LINES type I.
data: INNERLINES type I.
data: COUNTER type I.
data: CURRITEM2 like CURRITEM.
data: CURRITEM3 like CURRITEM.
data: LENGTH type I.
data: FOUND.
* append content table (for method set_range_content)
loop at <F_EXCEL_TAB> assigning <LINE>.
* save line index to compare with lt_subtot_indexs,
* to discover line is a subtotal / totale line or not
* ex use to set 'dun display zero in subtotal / total line'
L_SAVE_INDEX = SY-TABIX.
do DATAREAL times.
read table LT_SEMA into SEMAITEM with key COL_NO = SY-INDEX.
if SEMAITEM-COL_SRC ne 0.
assign component SEMAITEM-COL_SRC
of structure <LINE> to <ITEM>.
else.
assign component SY-INDEX
of structure <LINE> to <ITEM>.
endif.
CONTENTSITEM-ROW = REALOVERFLOW.
if SY-SUBRC = 0.
move SEMAITEM-COL_OPS to SEARCH_ITEM(3).
search 'ADD#CNT#MIN#MAX#AVG#NOP#DFT#'
for SEARCH_ITEM.
if SY-SUBRC ne 0.
raise ERROR_IN_SEMA.
endif.
move SEMAITEM-COL_TYP to SEARCH_ITEM(3).
search 'NUM#N00#N01#N02#N03#N04#PCT#DAT#MON#STR#'
for SEARCH_ITEM.
if SY-SUBRC ne 0.
raise ERROR_IN_SEMA.
endif.
CONTENTSITEM-COLUMN = SY-INDEX.
if SEMAITEM-COL_TYP eq 'DAT' or SEMAITEM-COL_TYP eq 'MON'.
if SEMAITEM-COL_NO > VKEYCOUNT.
" Hinweis 512418
" EXCEL bezieht Datumsangaben
" auf den 31.12.1899, behandelt
" aber 1900 als ein Schaltjahr
" d.h. ab 1.3.1900 korrekt
" 1.3.1900 als Zahl = 61
data: GENESIS type D value '18991230'.
data: NUMBER_OF_DAYS type P.
* change for date in char format & sema_type = X
data: TEMP_DATE type D.
if not <ITEM> is initial and not <ITEM> co ' ' and not
<ITEM> co '0'.
* change for date in char format & sema_type = X starts
if SEMA_TYPE = 'X'.
describe field <ITEM> type TYP.
if TYP = 'C'.
TEMP_DATE = <ITEM>.
NUMBER_OF_DAYS = TEMP_DATE - GENESIS.
else.
NUMBER_OF_DAYS = <ITEM> - GENESIS.
endif.
else.
NUMBER_OF_DAYS = <ITEM> - GENESIS.
endif.
* change for date in char format & sema_type = X ends
if NUMBER_OF_DAYS < 61.
NUMBER_OF_DAYS = NUMBER_OF_DAYS - 1.
endif.
set country 'DE'.
write NUMBER_OF_DAYS to CONTENTSITEM-VALUE
no-grouping
left-justified.
set country SPACE.
translate CONTENTSITEM-VALUE using COMMA_ELIM.
else.
clear CONTENTSITEM-VALUE.
endif.
else.
move <ITEM> to CONTENTSITEM-VALUE.
endif.
elseif SEMAITEM-COL_TYP eq 'NUM' or
SEMAITEM-COL_TYP eq 'N00' or
SEMAITEM-COL_TYP eq 'N01' or
SEMAITEM-COL_TYP eq 'N02' or
SEMAITEM-COL_TYP eq 'N03' or
SEMAITEM-COL_TYP eq 'N04' or
SEMAITEM-COL_TYP eq 'PCT'.
set country 'DE'.
describe field <ITEM> type TYP.
if SEMAITEM-COL_CUR is initial.
if TYP ne 'F'.
write <ITEM> to CONTENTSITEM-VALUE no-grouping
no-sign decimals 14.
else.
write <ITEM> to CONTENTSITEM-VALUE no-grouping
no-sign.
endif.
else.
* Treat of fixed curreny for column >>Y9CK007319
if SEMAITEM-COL_CUR < 0.
SEMAITEM-COL_CUR = SEMAITEM-COL_CUR * ( -1 ).
select * from TCURX into table LT_TCURX.
sort LT_TCURX.
read table LT_TCURX into
WA_TCURX index SEMAITEM-COL_CUR.
if SY-SUBRC = 0.
if TYP ne 'F'.
write <ITEM> to CONTENTSITEM-VALUE no-grouping
currency WA_TCURX-CURRKEY no-sign decimals 14.
else.
write <ITEM> to CONTENTSITEM-VALUE no-grouping
currency WA_TCURX-CURRKEY no-sign.
endif.
endif.
else.
assign component SEMAITEM-COL_CUR
of structure <LINE> to <G>.
* mit = index of recent row
CURRITEM-TOP = ROWMAX + MIT + LI_COMMENTARY_ROWS.
LI_COL_POS = SY-INDEX + I_LEFT - 1.
CURRITEM-LEFT = LI_COL_POS.
* if filed is quantity field (qfieldname ne space)
* or amount field (cfieldname ne space), then format decimal place
* corresponding with config
clear: L_DEF.
read table LT_FIELDCAT_KKBLO assigning <F_FIELDCAT_LINE>
with key TABNAME = L_TABNAME
TECH = SPACE
NO_OUT = SPACE
COL_POS = SEMAITEM-COL_NO.
if SY-SUBRC = 0.
if <F_FIELDCAT_LINE>-CFIELDNAME is not initial.
L_DEF = 'C'.
else."if <f_fieldcat_line>-qfieldname is not initial.
L_DEF = 'Q'.
endif.
endif.
* if field is amount field
* exporting of amount field base on currency decimal table: TCURX
if L_DEF = 'C'. "field is amount field
select single * from TCURX into WA_TCURX
where CURRKEY = <G>.
* if amount ref to un-know currency -> default decimal = 2
if SY-SUBRC eq 0.
CURRITEM-DECIMALS = WA_TCURX-CURRDEC.
else.
CURRITEM-DECIMALS = 2.
endif.
append CURRITEM to CURRCELLS.
if TYP ne 'F'.
write <ITEM> to CONTENTSITEM-VALUE
currency <G>
no-sign no-grouping.
else.
write <ITEM> to CONTENTSITEM-VALUE
decimals 14 currency <G>
no-sign no-grouping.
endif.
* if field is quantity field
* exporting of quantity field base on quantity decimal table: T006
else."if l_def = 'Q'. " field is quantity field
clear: WA_T006.
select single * from T006 into WA_T006
where MSEHI = <G>.
* if quantity ref to un-know unit-> default decimal = 2
if SY-SUBRC eq 0.
CURRITEM-DECIMALS = WA_T006-DECAN.
else.
CURRITEM-DECIMALS = 2.
endif.
append CURRITEM to CURRCELLS.
write <ITEM> to CONTENTSITEM-VALUE
unit <G>
no-sign no-grouping.
condense CONTENTSITEM-VALUE.
endif.
endif. "Y9CK007319
endif.
condense CONTENTSITEM-VALUE.
* add function fieldcat-no zero display
loop at LT_FIELDCAT_KKBLO assigning <F_FIELDCAT_LINE>
where TABNAME = L_TABNAME
and TECH ne 'X'
and NO_OUT ne 'X'.
if <F_FIELDCAT_LINE>-COL_POS = SEMAITEM-COL_NO.
if <F_FIELDCAT_LINE>-NO_ZERO = 'X'.
if <ITEM> = '0'.
clear: CONTENTSITEM-VALUE.
endif.
* dun display zero in total/subtotal line too
else.
clear: WA_SUBTOT_INDEXS.
read table LT_SUBTOT_INDEXS into WA_SUBTOT_INDEXS
with key INDEX = L_SAVE_INDEX.
if SY-SUBRC = 0 and <ITEM> = '0'.
clear: CONTENTSITEM-VALUE.
endif.
endif.
endif.
endloop.
unassign: <F_FIELDCAT_LINE>.
if <ITEM> lt 0.
search CONTENTSITEM-VALUE for 'E'.
if SY-FDPOS eq 0.
* use prefix notation for signed numbers
translate CONTENTSITEM-VALUE using '- '.
condense CONTENTSITEM-VALUE no-gaps.
concatenate '-' CONTENTSITEM-VALUE
into CONTENTSITEM-VALUE.
else.
concatenate '-' CONTENTSITEM-VALUE
into CONTENTSITEM-VALUE.
endif.
endif.
set country SPACE.
* Hier wird nur die korrekte Kommaseparatierung gemacht, wenn die
* Zeichen einer
* Zahl enthalten sind. Das ist für Timestamps, die auch ":" enthalten.
* Für die
* darf keine Kommaseparierung stattfinden.
* Changing for correction request - Y6BK041073
if CONTENTSITEM-VALUE co '0123456789.,-+E '.
translate CONTENTSITEM-VALUE using COMMA_ELIM.
endif.
else.
clear CONTENTSITEM-VALUE.
* if type is not numeric -> dun display with zero
write <ITEM> to CONTENTSITEM-VALUE no-zero.
shift CONTENTSITEM-VALUE left deleting leading SPACE.
endif.
append CONTENTSITEM to CONTENTS.
endif.
enddo.
REALMIT = REALMIT + 1.
REALOVERFLOW = REALOVERFLOW + 1.
MIT = MIT + 1.
* overflow = current row index in content table
OVERFLOW = OVERFLOW + 1.
endloop.
unassign: <F_FIELDCAT_LINE>.
* set item range for set_range_data method
TESTNAME = MIT / CONST.
condense TESTNAME.
concatenate 'TEST' TESTNAME into TESTNAME.
REALOVERFLOW = REALOVERFLOW - 1.
REALMIT = REALMIT - 1.
HELP = REALOVERFLOW.
RANGEITEM-NAME = TESTNAME.
RANGEITEM-COLUMNS = DATAREAL.
RANGEITEM-ROWS = HELP.
append RANGEITEM to RANGES.
* insert item range dim
TEMP2 = ROWMAX + 1 + LI_COMMENTARY_ROWS + REALMIT - REALOVERFLOW.
* items data
call method LO_SPREADSHEET->INSERT_RANGE_DIM
exporting
NAME = TESTNAME
TOP = TEMP2
LEFT = I_LEFT
ROWS = HELP
COLUMNS = DATAREAL
NO_FLUSH = NO_FLUSH.
* get columns header contents for set_range_data method
* export columns header only if no columns header option = space
data: ROWCOUNT type I.
data: COLUMNCOUNT type I.
if I_COLUMNS_HEADER = 'X'.
* append columns header to contents: hkey
ROWCOUNT = 1.
do ROWMAX times.
COLUMNCOUNT = 1.
do HKEYCOLUMNS times.
loop at LT_HKEY into HKEYITEM where COL_NO = COLUMNCOUNT
and ROW_NO = ROWCOUNT.
endloop.
if SY-SUBRC = 0.
STR = HKEYITEM-COL_NAME.
CONTENTSITEM-VALUE = HKEYITEM-COL_NAME.
else.
CONTENTSITEM-VALUE = STR.
endif.
CONTENTSITEM-COLUMN = COLUMNCOUNT.
CONTENTSITEM-ROW = ROWCOUNT.
append CONTENTSITEM to CONTENTS.
COLUMNCOUNT = COLUMNCOUNT + 1.
enddo.
ROWCOUNT = ROWCOUNT + 1.
enddo.
* incase columns header in multiline
data: ROWMAXTEMP type I.
if ROWMAX > 1.
ROWMAXTEMP = ROWMAX - 1.
ROWCOUNT = 1.
do ROWMAXTEMP times.
COLUMNCOUNT = 1.
do COLUMNMAX times.
CONTENTSITEM-COLUMN = COLUMNCOUNT.
CONTENTSITEM-ROW = ROWCOUNT.
CONTENTSITEM-VALUE = ''.
append CONTENTSITEM to CONTENTS.
COLUMNCOUNT = COLUMNCOUNT + 1.
enddo.
ROWCOUNT = ROWCOUNT + 1.
enddo.
endif.
* append columns header to contents: vkey
COLUMNCOUNT = 1.
do COLUMNMAX times.
loop at LT_VKEY into VKEYITEM where COL_NO = COLUMNCOUNT.
endloop.
CONTENTSITEM-VALUE = VKEYITEM-COL_NAME.
CONTENTSITEM-ROW = ROWMAX.
CONTENTSITEM-COLUMN = COLUMNCOUNT.
append CONTENTSITEM to CONTENTS.
COLUMNCOUNT = COLUMNCOUNT + 1.
enddo.
*--------------------------------------------------------------------*
* set header range for method set_range_data
* insert header keys range dim
LI_HEAD_TOP = LI_COMMENTARY_ROWS + 1.
LI_COL_POS = I_LEFT.
* insert range headers
if HKEYCOLUMNS ne 0.
RANGEITEM-NAME = 'TESTHKEY'.
RANGEITEM-ROWS = ROWMAX.
RANGEITEM-COLUMNS = HKEYCOLUMNS.
append RANGEITEM to RANGES.
clear: RANGEITEM.
call method LO_SPREADSHEET->INSERT_RANGE_DIM
exporting
NAME = 'TESTHKEY'
TOP = LI_HEAD_TOP
LEFT = LI_COL_POS
ROWS = ROWMAX
COLUMNS = HKEYCOLUMNS
NO_FLUSH = NO_FLUSH.
endif.
endif.
* format for columns header + total + subtotal
* ------------------------------------------
HELP = ROWMAX + REALMIT. " table + header lines
data: LT_FORMAT type SOI_FORMAT_TABLE.
data: WA_FORMAT like line of LT_FORMAT.
data: WA_FORMAT_TEMP like line of LT_FORMAT.
field-symbols: <F_SOURCE> type ANY.
field-symbols: <F_DES> type ANY.
* columns header format
WA_FORMAT-FRONT = -1.
WA_FORMAT-BACK = 15. "grey
WA_FORMAT-FONT = SPACE.
WA_FORMAT-SIZE = -1.
WA_FORMAT-BOLD = 1.
WA_FORMAT-ALIGN = 0.
WA_FORMAT-FRAMETYP = -1.
WA_FORMAT-FRAMECOLOR = -1.
* get column header format from input record
* -> map input format
if I_COLUMNS_HEADER = 'X'.
WA_FORMAT-NAME = 'TESTHKEY'.
if I_FORMAT_COL_HEADER is not initial.
describe field I_FORMAT_COL_HEADER type L_TYP components
LI_COL_NUM.
do LI_COL_NUM times.
if SY-INDEX ne 1. " dun map range name
assign component SY-INDEX of structure I_FORMAT_COL_HEADER
to <F_SOURCE>.
if <F_SOURCE> is not initial.
assign component SY-INDEX of structure WA_FORMAT to <F_DES>.
<F_DES> = <F_SOURCE>.
unassign: <F_DES>.
endif.
unassign: <F_SOURCE>.
endif.
enddo.
clear: LI_COL_NUM.
endif.
append WA_FORMAT to LT_FORMAT.
endif.
* Zusammenfassen der Spalten mit gleicher Nachkommastellenzahl
* collect vertical cells (col) with the same number of decimal places
* to increase perfomance in currency cell format
describe table CURRCELLS lines LINES.
LINES = LINES - 1.
do LINES times.
describe table CURRCELLS lines INNERLINES.
INNERLINES = INNERLINES - 1.
sort CURRCELLS by LEFT TOP.
clear FOUND.
do INNERLINES times.
read table CURRCELLS index SY-INDEX into CURRITEM.
COUNTER = SY-INDEX + 1.
read table CURRCELLS index COUNTER into CURRITEM2.
if CURRITEM-LEFT eq CURRITEM2-LEFT.
LENGTH = CURRITEM-TOP + CURRITEM-ROWS.
if LENGTH eq CURRITEM2-TOP and CURRITEM-DECIMALS eq CURRITEM2-DECIMALS.
move CURRITEM to CURRITEM3.
CURRITEM3-ROWS = CURRITEM3-ROWS + CURRITEM2-ROWS.
CURRITEM-LEFT = -1.
modify CURRCELLS index SY-INDEX from CURRITEM.
CURRITEM2-LEFT = -1.
modify CURRCELLS index COUNTER from CURRITEM2.
append CURRITEM3 to CURRCELLS.
FOUND = 'X'.
endif.
endif.
enddo.
if FOUND is initial.
exit.
endif.
delete CURRCELLS where LEFT = -1.
enddo.
* Zusammenfassen der Zeilen mit gleicher Nachkommastellenzahl
* collect horizontal cells (row) with the same number of decimal places
* to increase perfomance in currency cell format
describe table CURRCELLS lines LINES.
LINES = LINES - 1.
do LINES times.
describe table CURRCELLS lines INNERLINES.
INNERLINES = INNERLINES - 1.
sort CURRCELLS by TOP LEFT.
clear FOUND.
do INNERLINES times.
read table CURRCELLS index SY-INDEX into CURRITEM.
COUNTER = SY-INDEX + 1.
read table CURRCELLS index COUNTER into CURRITEM2.
if CURRITEM-TOP eq CURRITEM2-TOP and CURRITEM-ROWS eq
CURRITEM2-ROWS.
LENGTH = CURRITEM-LEFT + CURRITEM-COLUMNS.
if LENGTH eq CURRITEM2-LEFT and CURRITEM-DECIMALS eq CURRITEM2-DECIMALS.
move CURRITEM to CURRITEM3.
CURRITEM3-COLUMNS = CURRITEM3-COLUMNS + CURRITEM2-COLUMNS.
CURRITEM-LEFT = -1.
modify CURRCELLS index SY-INDEX from CURRITEM.
CURRITEM2-LEFT = -1.
modify CURRCELLS index COUNTER from CURRITEM2.
append CURRITEM3 to CURRCELLS.
FOUND = 'X'.
endif.
endif.
enddo.
if FOUND is initial.
exit.
endif.
delete CURRCELLS where LEFT = -1.
enddo.
* Ende der Zusammenfassung
* item data: format for currency cell, corresponding with currency
call method LO_SPREADSHEET->CELL_FORMAT
exporting
CELLS = CURRCELLS
NO_FLUSH = NO_FLUSH.
* item data: write item table content
call method LO_SPREADSHEET->SET_RANGES_DATA
exporting
RANGES = RANGES
CONTENTS = CONTENTS
NO_FLUSH = NO_FLUSH.
* whole table range to format all table
if I_COLUMNS_HEADER = 'X'.
LI_HEAD_TOP = LI_COMMENTARY_ROWS + 1.
else.
LI_HEAD_TOP = LI_COMMENTARY_ROWS + 2.
HELP = HELP - 1.
endif.
call method LO_SPREADSHEET->INSERT_RANGE_DIM
exporting
NAME = 'WHOLE_TABLE'
TOP = LI_HEAD_TOP
LEFT = I_LEFT
ROWS = HELP
COLUMNS = DATAREAL
NO_FLUSH = NO_FLUSH.
* columns width auto fix
* this parameter = space in case use with exist template
if I_COLUMNS_AUTOFIT = 'X'.
call method LO_SPREADSHEET->FIT_WIDEST
exporting
NAME = 'WHOLE_TABLE'
NO_FLUSH = NO_FLUSH.
endif.
* frame
* The parameter has 8 bits
*0 Left margin
*1 Top marginT
*2 Bottom margin
*3 Right margin
*4 Horizontal line
*5 Vertical line
*6 Thinness
*7 Thickness
* here 127 = 1111111 6-5-4-3-2-1 mean Thin-ver-hor-right-bot-top-left
* ( final DOI method call, set no_flush = space
* equal to call method CL_GUI_CFW=>FLUSH )
call method LO_SPREADSHEET->SET_FRAME
exporting
RANGENAME = 'WHOLE_TABLE'
TYP = 127
COLOR = 1
NO_FLUSH = SPACE
importing
ERROR = LO_ERROR
RETCODE = LC_RETCODE.
ERROR_DOI.
* reformat subtotal / total line after format wholw table
loop at SUBRANGES into SUBRANGEITEM.
L_SUB_INDEX = SUBRANGEITEM-ROWS + LI_COMMENTARY_ROWS + ROWMAX.
call method LO_SPREADSHEET->INSERT_RANGE_DIM
exporting
NAME = SUBRANGEITEM-NAME
LEFT = I_LEFT
TOP = L_SUB_INDEX
ROWS = 1
COLUMNS = DATAREAL
NO_FLUSH = NO_FLUSH.
WA_FORMAT-NAME = SUBRANGEITEM-NAME.
* default format:
* - clolor: subtotal = light yellow, subtotal = yellow
* - frame: box
if SUBRANGEITEM-NAME(3) = 'SUB'.
WA_FORMAT-BACK = 36. "subtotal line
WA_FORMAT_TEMP = I_FORMAT_SUBTOTAL.
else.
WA_FORMAT-BACK = 27. "total line
WA_FORMAT_TEMP = I_FORMAT_TOTAL.
endif.
WA_FORMAT-FRAMETYP = 79.
WA_FORMAT-FRAMECOLOR = 1.
WA_FORMAT-NUMBER = -1.
WA_FORMAT-ALIGN = -1.
* get subtoal + total format from intput parameter
* overwrite default format
if WA_FORMAT_TEMP is not initial.
describe field WA_FORMAT_TEMP type L_TYP components LI_COL_NUM.
do LI_COL_NUM times.
if SY-INDEX ne 1. " dun map range name
assign component SY-INDEX of structure WA_FORMAT_TEMP
to <F_SOURCE>.
if <F_SOURCE> is not initial.
assign component SY-INDEX of structure WA_FORMAT to <F_DES>.
<F_DES> = <F_SOURCE>.
unassign: <F_DES>.
endif.
unassign: <F_SOURCE>.
endif.
enddo.
clear: LI_COL_NUM.
endif.
append WA_FORMAT to LT_FORMAT.
clear: WA_FORMAT-NAME.
clear: L_SUB_INDEX.
clear: WA_FORMAT_TEMP.
endloop.
if LT_FORMAT[] is not initial.
call method LO_SPREADSHEET->SET_RANGES_FORMAT
exporting
FORMATTABLE = LT_FORMAT
NO_FLUSH = NO_FLUSH.
refresh: LT_FORMAT.
endif.
*--------------------------------------------------------------------*
call method LO_SPREADSHEET->SCREEN_UPDATE
exporting
UPDATING = 'X'.
call method C_OI_ERRORS=>FLUSH_ERRORS.
LO_ERROR_W = L_ERROR.
LC_RETCODE = LO_ERROR_W->ERROR_CODE.
** catch no_flush -> led to dump ( optional )
* go_error = l_error.
* gc_retcode = go_error->error_code.
* error_doi.
clear:
LT_SEMA,
WA_SEMA,
LT_HKEY,
WA_HKEY,
LT_VKEY,
WA_VKEY,
L_N_HRZ_KEYS,
L_N_ATT_COLS,
L_N_VRT_KEYS,
COUNT,
DATAC,
DATAREAL,
VKEYCOUNT,
ALL,
MIT,
LI_COL_POS,
LI_COL_NUM,
RANGES,
RANGEITEM,
CONTENTS,
CONTENTSITEM,
SEMAITEM,
HKEYITEM,
VKEYITEM,
LI_COMMENTARY_ROWS,
L_RETCODE,
LI_HEAD_TOP,
<F_EXCEL_TAB>.
clear:
LO_ERROR_W.
unassign:
<LINE>,
<ITEM>,
<F_EXCEL_TAB>.
*--------------------------------------------------------------------*
* SESSION 5: SAVE AND CLOSE FILE
*--------------------------------------------------------------------*
* ex of save path: 'FILE://C:\temp\test.xlsx'
concatenate 'FILE://' I_SAVE_PATH
into LS_PATH.
call method LO_PROXY->SAVE_DOCUMENT_TO_URL
exporting
NO_FLUSH = 'X'
URL = LS_PATH
importing
ERROR = LO_ERROR
RETCODE = LC_RETCODE
changing
DOCUMENT_SIZE = LI_DOCUMENT_SIZE.
ERROR_DOI.
* if save successfully -> raise successful message
* message i499(sy) with 'Document is Exported to ' p_path.
message I499(SY) with 'Data has been exported successfully'.
clear:
LS_PATH,
LI_DOCUMENT_SIZE.
CLOSE_DOCUMENT.
endmethod.
method BIND_TABLE.
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmöcker, (wi p) 2012-12-01
* - ...
* aligning code
* message made to support multilinguality
*--------------------------------------------------------------------*
* issue #237 - Check if overlapping areas exist
* - Alessandro Iannacci 2012-12-01
* changes: - Added raise if overlaps are detected
*--------------------------------------------------------------------*
constants:
LC_TOP_LEFT_COLUMN type ZEXCEL_CELL_COLUMN_ALPHA value 'A',
LC_TOP_LEFT_ROW type ZEXCEL_CELL_ROW value 1.
data:
LV_ROW_INT type ZEXCEL_CELL_ROW,
LV_FIRST_ROW type ZEXCEL_CELL_ROW,
LV_LAST_ROW type ZEXCEL_CELL_ROW,
LV_COLUMN_INT type ZEXCEL_CELL_COLUMN,
LV_COLUMN_ALPHA type ZEXCEL_CELL_COLUMN_ALPHA,
LT_FIELD_CATALOG type ZEXCEL_T_FIELDCATALOG,
LV_ID type I,
LV_ROWS type I,
LV_FORMULA type STRING,
LS_SETTINGS type ZEXCEL_S_TABLE_SETTINGS,
LO_TABLE type ref to ZCL_EXCEL_TABLE,
LT_COLUMN_NAME_BUFFER type sorted table of STRING with unique key TABLE_LINE,
LV_VALUE type STRING,
LV_VALUE_LOWERCASE type STRING,
LV_SYINDEX type CHAR3,
LV_ERRORMESSAGE type STRING, "ins issue #237
LV_COLUMNS type I,
LT_COLUMNS type ZEXCEL_T_FIELDCATALOG,
LV_MAXCOL type I,
LV_MAXROW type I,
LO_ITERATOR type ref to CL_OBJECT_COLLECTION_ITERATOR,
LO_STYLE_COND type ref to ZCL_EXCEL_STYLE_COND,
LO_CURTABLE type ref to ZCL_EXCEL_TABLE.
field-symbols:
<LS_FIELD_CATALOG> type ZEXCEL_S_FIELDCATALOG,
<LS_FIELD_CATALOG_CUSTOM> type ZEXCEL_S_FIELDCATALOG,
<FS_TABLE_LINE> type ANY,
<FS_FLDVAL> type ANY.
LS_SETTINGS = IS_TABLE_SETTINGS.
if LS_SETTINGS-TOP_LEFT_COLUMN is initial.
LS_SETTINGS-TOP_LEFT_COLUMN = LC_TOP_LEFT_COLUMN.
endif.
if LS_SETTINGS-TABLE_STYLE is initial.
LS_SETTINGS-TABLE_STYLE = ZCL_EXCEL_TABLE=>BUILTINSTYLE_MEDIUM2.
endif.
if LS_SETTINGS-TOP_LEFT_ROW is initial.
LS_SETTINGS-TOP_LEFT_ROW = LC_TOP_LEFT_ROW.
endif.
if IT_FIELD_CATALOG is not supplied.
LT_FIELD_CATALOG = ZCL_EXCEL_COMMON=>GET_FIELDCATALOG( IP_TABLE = IP_TABLE ).
else.
LT_FIELD_CATALOG = IT_FIELD_CATALOG.
endif.
sort LT_FIELD_CATALOG by POSITION.
*--------------------------------------------------------------------*
* issue #237 Check if overlapping areas exist Start
*--------------------------------------------------------------------*
"Get the number of columns for the current table
LT_COLUMNS = LT_FIELD_CATALOG.
delete LT_COLUMNS where DYNPFLD ne ABAP_TRUE.
describe table LT_COLUMNS lines LV_COLUMNS.
"Calculate the top left row of the current table
LV_COLUMN_INT = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( LS_SETTINGS-TOP_LEFT_COLUMN ).
LV_ROW_INT = LS_SETTINGS-TOP_LEFT_ROW.
"Get number of row for the current table
describe table IP_TABLE lines LV_ROWS.
"Calculate the bottom right row for the current table
LV_MAXCOL = LV_COLUMN_INT + LV_COLUMNS - 1.
LV_MAXROW = LV_ROW_INT + LV_ROWS - 1.
LS_SETTINGS-BOTTOM_RIGHT_COLUMN = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2ALPHA( LV_MAXCOL ).
LS_SETTINGS-BOTTOM_RIGHT_ROW = LV_MAXROW.
LV_COLUMN_INT = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( LS_SETTINGS-TOP_LEFT_COLUMN ).
LO_ITERATOR = ME->TABLES->IF_OBJECT_COLLECTION~GET_ITERATOR( ).
while LO_ITERATOR->IF_OBJECT_COLLECTION_ITERATOR~HAS_NEXT( ) eq ABAP_TRUE.
LO_CURTABLE ?= LO_ITERATOR->IF_OBJECT_COLLECTION_ITERATOR~GET_NEXT( ).
if ( ( LS_SETTINGS-TOP_LEFT_ROW ge LO_CURTABLE->SETTINGS-TOP_LEFT_ROW and LS_SETTINGS-TOP_LEFT_ROW le LO_CURTABLE->SETTINGS-BOTTOM_RIGHT_ROW )
or
( LS_SETTINGS-BOTTOM_RIGHT_ROW ge LO_CURTABLE->SETTINGS-TOP_LEFT_ROW and LS_SETTINGS-BOTTOM_RIGHT_ROW le LO_CURTABLE->SETTINGS-BOTTOM_RIGHT_ROW )
)
and
( ( LV_COLUMN_INT ge ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( LO_CURTABLE->SETTINGS-TOP_LEFT_COLUMN ) and LV_COLUMN_INT le ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( LO_CURTABLE->SETTINGS-BOTTOM_RIGHT_COLUMN ) )
or
( LV_MAXCOL ge ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( LO_CURTABLE->SETTINGS-TOP_LEFT_COLUMN ) and LV_MAXCOL le ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( LO_CURTABLE->SETTINGS-BOTTOM_RIGHT_COLUMN ) )
).
LV_ERRORMESSAGE = 'Table overlaps with previously bound table and will not be added to worksheet.'(400).
zcx_excel=>raise_text( lv_errormessage ).
endif.
endwhile.
*--------------------------------------------------------------------*
* issue #237 Check if overlapping areas exist End
*--------------------------------------------------------------------*
create object LO_TABLE.
LO_TABLE->SETTINGS = LS_SETTINGS.
LO_TABLE->SET_DATA( IR_DATA = IP_TABLE ).
LV_ID = ME->EXCEL->GET_NEXT_TABLE_ID( ).
LO_TABLE->SET_ID( IV_ID = LV_ID ).
* lo_table->fieldcat = lt_field_catalog[].
ME->TABLES->ADD( LO_TABLE ).
* It is better to loop column by column (only visible column)
loop at LT_FIELD_CATALOG assigning <LS_FIELD_CATALOG> where DYNPFLD eq ABAP_TRUE.
LV_COLUMN_ALPHA = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2ALPHA( LV_COLUMN_INT ).
" Due restrinction of new table object we cannot have two column with the same name
" Check if a column with the same name exists, if exists add a counter
" If no medium description is provided we try to use small or long
* lv_value = <ls_field_catalog>-scrtext_m.
field-symbols: <SCRTXT1> type ANY,
<SCRTXT2> type ANY,
<SCRTXT3> type ANY.
case IV_DEFAULT_DESCR.
when 'M'.
assign <LS_FIELD_CATALOG>-SCRTEXT_M to <SCRTXT1>.
assign <LS_FIELD_CATALOG>-SCRTEXT_S to <SCRTXT2>.
assign <LS_FIELD_CATALOG>-SCRTEXT_L to <SCRTXT3>.
when 'S'.
assign <LS_FIELD_CATALOG>-SCRTEXT_S to <SCRTXT1>.
assign <LS_FIELD_CATALOG>-SCRTEXT_M to <SCRTXT2>.
assign <LS_FIELD_CATALOG>-SCRTEXT_L to <SCRTXT3>.
when 'L'.
assign <LS_FIELD_CATALOG>-SCRTEXT_L to <SCRTXT1>.
assign <LS_FIELD_CATALOG>-SCRTEXT_M to <SCRTXT2>.
assign <LS_FIELD_CATALOG>-SCRTEXT_S to <SCRTXT3>.
when others.
assign <LS_FIELD_CATALOG>-SCRTEXT_M to <SCRTXT1>.
assign <LS_FIELD_CATALOG>-SCRTEXT_S to <SCRTXT2>.
assign <LS_FIELD_CATALOG>-SCRTEXT_L to <SCRTXT3>.
endcase.
if <SCRTXT1> is not initial.
LV_VALUE = <SCRTXT1>.
<LS_FIELD_CATALOG>-SCRTEXT_L = LV_VALUE.
elseif <SCRTXT2> is not initial.
LV_VALUE = <SCRTXT2>.
<LS_FIELD_CATALOG>-SCRTEXT_L = LV_VALUE.
elseif <SCRTXT3> is not initial.
LV_VALUE = <SCRTXT3>.
<LS_FIELD_CATALOG>-SCRTEXT_L = LV_VALUE.
else.
LV_VALUE = 'Column'. " default value as Excel does
<LS_FIELD_CATALOG>-SCRTEXT_L = LV_VALUE.
endif.
while 1 = 1.
LV_VALUE_LOWERCASE = LV_VALUE.
translate LV_VALUE_LOWERCASE to lower case.
read table LT_COLUMN_NAME_BUFFER transporting no fields with key TABLE_LINE = LV_VALUE_LOWERCASE binary search.
if SY-SUBRC <> 0.
<LS_FIELD_CATALOG>-SCRTEXT_L = LV_VALUE.
insert LV_VALUE_LOWERCASE into table LT_COLUMN_NAME_BUFFER.
exit.
else.
LV_SYINDEX = SY-INDEX.
concatenate <LS_FIELD_CATALOG>-SCRTEXT_L LV_SYINDEX into LV_VALUE.
endif.
endwhile.
" First of all write column header
if <LS_FIELD_CATALOG>-STYLE_HEADER is not initial.
ME->SET_CELL( IP_COLUMN = LV_COLUMN_ALPHA
IP_ROW = LV_ROW_INT
IP_VALUE = LV_VALUE
IP_STYLE = <LS_FIELD_CATALOG>-STYLE_HEADER ).
else.
ME->SET_CELL( IP_COLUMN = LV_COLUMN_ALPHA
IP_ROW = LV_ROW_INT
IP_VALUE = LV_VALUE ).
endif.
add 1 to LV_ROW_INT.
loop at IP_TABLE assigning <FS_TABLE_LINE>.
assign component <LS_FIELD_CATALOG>-FIELDNAME of structure <FS_TABLE_LINE> to <FS_FLDVAL>.
" issue #290 Add formula support in table
if <LS_FIELD_CATALOG>-FORMULA eq ABAP_TRUE.
if <LS_FIELD_CATALOG>-STYLE is not initial.
if <LS_FIELD_CATALOG>-ABAP_TYPE is not initial.
ME->SET_CELL( IP_COLUMN = LV_COLUMN_ALPHA
IP_ROW = LV_ROW_INT
IP_FORMULA = <FS_FLDVAL>
IP_ABAP_TYPE = <LS_FIELD_CATALOG>-ABAP_TYPE
IP_STYLE = <LS_FIELD_CATALOG>-STYLE ).
else.
ME->SET_CELL( IP_COLUMN = LV_COLUMN_ALPHA
IP_ROW = LV_ROW_INT
IP_FORMULA = <FS_FLDVAL>
IP_STYLE = <LS_FIELD_CATALOG>-STYLE ).
endif.
elseif <LS_FIELD_CATALOG>-ABAP_TYPE is not initial.
ME->SET_CELL( IP_COLUMN = LV_COLUMN_ALPHA
IP_ROW = LV_ROW_INT
IP_FORMULA = <FS_FLDVAL>
IP_ABAP_TYPE = <LS_FIELD_CATALOG>-ABAP_TYPE ).
else.
ME->SET_CELL( IP_COLUMN = LV_COLUMN_ALPHA
IP_ROW = LV_ROW_INT
IP_FORMULA = <FS_FLDVAL> ).
endif.
else.
if <LS_FIELD_CATALOG>-STYLE is not initial.
if <LS_FIELD_CATALOG>-ABAP_TYPE is not initial.
ME->SET_CELL( IP_COLUMN = LV_COLUMN_ALPHA
IP_ROW = LV_ROW_INT
IP_VALUE = <FS_FLDVAL>
IP_ABAP_TYPE = <LS_FIELD_CATALOG>-ABAP_TYPE
IP_STYLE = <LS_FIELD_CATALOG>-STYLE ).
else.
ME->SET_CELL( IP_COLUMN = LV_COLUMN_ALPHA
IP_ROW = LV_ROW_INT
IP_VALUE = <FS_FLDVAL>
IP_STYLE = <LS_FIELD_CATALOG>-STYLE ).
endif.
else.
if <LS_FIELD_CATALOG>-ABAP_TYPE is not initial.
ME->SET_CELL( IP_COLUMN = LV_COLUMN_ALPHA
IP_ROW = LV_ROW_INT
IP_ABAP_TYPE = <LS_FIELD_CATALOG>-ABAP_TYPE
IP_VALUE = <FS_FLDVAL> ).
else.
ME->SET_CELL( IP_COLUMN = LV_COLUMN_ALPHA
IP_ROW = LV_ROW_INT
IP_VALUE = <FS_FLDVAL> ).
endif.
endif.
endif.
add 1 to LV_ROW_INT.
endloop.
if SY-SUBRC <> 0. "create empty row if table has no data
ME->SET_CELL( IP_COLUMN = LV_COLUMN_ALPHA
IP_ROW = LV_ROW_INT
IP_VALUE = SPACE ).
add 1 to LV_ROW_INT.
endif.
*--------------------------------------------------------------------*
" totals
*--------------------------------------------------------------------*
if <LS_FIELD_CATALOG>-TOTALS_FUNCTION is not initial.
LV_FORMULA = LO_TABLE->GET_TOTALS_FORMULA( IP_COLUMN = <LS_FIELD_CATALOG>-SCRTEXT_L IP_FUNCTION = <LS_FIELD_CATALOG>-TOTALS_FUNCTION ).
if <LS_FIELD_CATALOG>-STYLE_TOTAL is not initial.
ME->SET_CELL( IP_COLUMN = LV_COLUMN_ALPHA
IP_ROW = LV_ROW_INT
IP_FORMULA = LV_FORMULA
IP_STYLE = <LS_FIELD_CATALOG>-STYLE_TOTAL ).
else.
ME->SET_CELL( IP_COLUMN = LV_COLUMN_ALPHA
IP_ROW = LV_ROW_INT
IP_FORMULA = LV_FORMULA ).
endif.
endif.
LV_ROW_INT = LS_SETTINGS-TOP_LEFT_ROW.
add 1 to LV_COLUMN_INT.
*--------------------------------------------------------------------*
" conditional formatting
*--------------------------------------------------------------------*
if <LS_FIELD_CATALOG>-STYLE_COND is not initial.
LV_FIRST_ROW = LS_SETTINGS-TOP_LEFT_ROW + 1. " +1 to exclude header
LV_LAST_ROW = LS_SETTINGS-TOP_LEFT_ROW + LV_ROWS.
LO_STYLE_COND = ME->GET_STYLE_COND( <LS_FIELD_CATALOG>-STYLE_COND ).
LO_STYLE_COND->SET_RANGE( IP_START_COLUMN = LV_COLUMN_ALPHA
IP_START_ROW = LV_FIRST_ROW
IP_STOP_COLUMN = LV_COLUMN_ALPHA
IP_STOP_ROW = LV_LAST_ROW ).
endif.
endloop.
*--------------------------------------------------------------------*
" Set field catalog
*--------------------------------------------------------------------*
LO_TABLE->FIELDCAT = LT_FIELD_CATALOG[].
ES_TABLE_SETTINGS = LS_SETTINGS.
ES_TABLE_SETTINGS-BOTTOM_RIGHT_COLUMN = LV_COLUMN_ALPHA.
" >> Issue #291
if IP_TABLE is initial.
ES_TABLE_SETTINGS-BOTTOM_RIGHT_ROW = LS_SETTINGS-TOP_LEFT_ROW + 2. "Last rows
else.
ES_TABLE_SETTINGS-BOTTOM_RIGHT_ROW = LS_SETTINGS-TOP_LEFT_ROW + LV_ROWS + 1. "Last rows
endif.
" << Issue #291
endmethod.
method CALCULATE_CELL_WIDTH.
*--------------------------------------------------------------------*
* issue #293 - Roberto Bianco
* - Christian Assig 2014-03-14
*
* changes: - Calculate widths using SAPscript font metrics
* (transaction SE73)
* - Calculate the width of dates
* - Add additional width for auto filter buttons
* - Add cell padding to simulate Excel behavior
*--------------------------------------------------------------------*
constants:
LC_DEFAULT_FONT_NAME type ZEXCEL_STYLE_FONT_NAME value 'Calibri', "#EC NOTEXT
LC_DEFAULT_FONT_HEIGHT type TDFONTSIZE value '110',
LC_EXCEL_CELL_PADDING type FLOAT value '0.75'.
data: LD_CELL_VALUE type ZEXCEL_CELL_VALUE,
LD_CURRENT_CHARACTER type C length 1,
LD_STYLE_GUID type ZEXCEL_CELL_STYLE,
LS_STYLEMAPPING type ZEXCEL_S_STYLEMAPPING,
LO_TABLE_OBJECT type ref to OBJECT,
LO_TABLE type ref to ZCL_EXCEL_TABLE,
LD_TABLE_TOP_LEFT_COLUMN type ZEXCEL_CELL_COLUMN,
LD_TABLE_BOTTOM_RIGHT_COLUMN type ZEXCEL_CELL_COLUMN,
LD_FLAG_CONTAINS_AUTO_FILTER type ABAP_BOOL value ABAP_FALSE,
LD_FLAG_BOLD type ABAP_BOOL value ABAP_FALSE,
LD_FLAG_ITALIC type ABAP_BOOL value ABAP_FALSE,
LD_DATE type D,
LD_DATE_CHAR type C length 50,
LD_FONT_HEIGHT type TDFONTSIZE value LC_DEFAULT_FONT_HEIGHT,
LT_ITCFC type standard table of ITCFC,
LD_OFFSET type I,
LD_LENGTH type I,
LD_UCCP type I,
LS_FONT_METRIC type MTY_S_FONT_METRIC,
LD_WIDTH_FROM_FONT_METRICS type I,
LD_FONT_FAMILY type ITCFH-TDFAMILY,
LD_FONT_NAME type ZEXCEL_STYLE_FONT_NAME value LC_DEFAULT_FONT_NAME,
LT_FONT_FAMILIES like standard table of LD_FONT_FAMILY,
LS_FONT_CACHE type MTY_S_FONT_CACHE.
field-symbols: <LS_FONT_CACHE> type MTY_S_FONT_CACHE,
<LS_FONT_METRIC> type MTY_S_FONT_METRIC,
<LS_ITCFC> type ITCFC.
" Determine cell content and cell style
ME->GET_CELL( exporting IP_COLUMN = IP_COLUMN
IP_ROW = IP_ROW
importing EP_VALUE = LD_CELL_VALUE
EP_GUID = LD_STYLE_GUID ).
" ABAP2XLSX uses tables to define areas containing headers and
" auto-filters. Find out if the current cell is in the header
" of one of these tables.
loop at ME->TABLES->COLLECTION into LO_TABLE_OBJECT.
" Downcast: OBJECT -> ZCL_EXCEL_TABLE
LO_TABLE ?= LO_TABLE_OBJECT.
" Convert column letters to corresponding integer values
LD_TABLE_TOP_LEFT_COLUMN =
ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT(
LO_TABLE->SETTINGS-TOP_LEFT_COLUMN ).
LD_TABLE_BOTTOM_RIGHT_COLUMN =
ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT(
LO_TABLE->SETTINGS-BOTTOM_RIGHT_COLUMN ).
" Is the current cell part of the table header?
if IP_COLUMN between LD_TABLE_TOP_LEFT_COLUMN and
LD_TABLE_BOTTOM_RIGHT_COLUMN and
IP_ROW eq LO_TABLE->SETTINGS-TOP_LEFT_ROW.
" Current cell is part of the table header
" -> Assume that an auto filter is present and that the font is
" bold
LD_FLAG_CONTAINS_AUTO_FILTER = ABAP_TRUE.
LD_FLAG_BOLD = ABAP_TRUE.
endif.
endloop.
" If a style GUID is present, read style attributes
if LD_STYLE_GUID is not initial.
try.
" Read style attributes
LS_STYLEMAPPING = ME->EXCEL->GET_STYLE_TO_GUID( LD_STYLE_GUID ).
" If the current cell contains the default date format,
" convert the cell value to a date and calculate its length
if LS_STYLEMAPPING-COMPLETE_STYLE-NUMBER_FORMAT-FORMAT_CODE =
ZCL_EXCEL_STYLE_NUMBER_FORMAT=>C_FORMAT_DATE_STD.
" Convert excel date to ABAP date
LD_DATE =
ZCL_EXCEL_COMMON=>EXCEL_STRING_TO_DATE( LD_CELL_VALUE ).
" Format ABAP date using user's formatting settings
write LD_DATE to LD_DATE_CHAR.
" Remember the formatted date to calculate the cell size
LD_CELL_VALUE = LD_DATE_CHAR.
endif.
" Read the font size and convert it to the font height
" used by SAPscript (multiplication by 10)
if LS_STYLEMAPPING-COMPLETE_STYLEX-FONT-SIZE = ABAP_TRUE.
LD_FONT_HEIGHT = LS_STYLEMAPPING-COMPLETE_STYLE-FONT-SIZE * 10.
endif.
" If set, remember the font name
if LS_STYLEMAPPING-COMPLETE_STYLEX-FONT-NAME = ABAP_TRUE.
LD_FONT_NAME = LS_STYLEMAPPING-COMPLETE_STYLE-FONT-NAME.
endif.
" If set, remember whether font is bold and italic.
if LS_STYLEMAPPING-COMPLETE_STYLEX-FONT-BOLD = ABAP_TRUE.
LD_FLAG_BOLD = LS_STYLEMAPPING-COMPLETE_STYLE-FONT-BOLD.
endif.
if LS_STYLEMAPPING-COMPLETE_STYLEX-FONT-ITALIC = ABAP_TRUE.
LD_FLAG_ITALIC = LS_STYLEMAPPING-COMPLETE_STYLE-FONT-ITALIC.
endif.
catch ZCX_EXCEL. "#EC NO_HANDLER
" Style GUID is present, but style was not found
" Continue with default values
endtry.
endif.
" Check if the same font (font name and font attributes) was already
" used before
read table MTH_FONT_CACHE
with table key
FONT_NAME = LD_FONT_NAME
FONT_HEIGHT = LD_FONT_HEIGHT
FLAG_BOLD = LD_FLAG_BOLD
FLAG_ITALIC = LD_FLAG_ITALIC
assigning <LS_FONT_CACHE>.
if SY-SUBRC <> 0.
" Font is used for the first time
" Add the font to our local font cache
LS_FONT_CACHE-FONT_NAME = LD_FONT_NAME.
LS_FONT_CACHE-FONT_HEIGHT = LD_FONT_HEIGHT.
LS_FONT_CACHE-FLAG_BOLD = LD_FLAG_BOLD.
LS_FONT_CACHE-FLAG_ITALIC = LD_FLAG_ITALIC.
insert LS_FONT_CACHE into table MTH_FONT_CACHE
assigning <LS_FONT_CACHE>.
" Determine the SAPscript font family name from the Excel
" font name
select TDFAMILY
from TFO01
into table LT_FONT_FAMILIES
up to 1 rows
where TDTEXT = LD_FONT_NAME
order by primary key.
" Check if a matching font family was found
" Fonts can be uploaded from TTF files using transaction SE73
if LINES( LT_FONT_FAMILIES ) > 0.
read table LT_FONT_FAMILIES index 1 into LD_FONT_FAMILY.
" Load font metrics (returns a table with the size of each letter
" in the font)
call function 'LOAD_FONT'
exporting
FAMILY = LD_FONT_FAMILY
HEIGHT = LD_FONT_HEIGHT
PRINTER = 'SWIN'
BOLD = LD_FLAG_BOLD
ITALIC = LD_FLAG_ITALIC
tables
METRIC = LT_ITCFC
exceptions
FONT_FAMILY = 1
CODEPAGE = 2
DEVICE_TYPE = 3
others = 4.
if SY-SUBRC <> 0.
clear LT_ITCFC.
endif.
" For faster access, convert each character number to the actual
" character, and store the characters and their sizes in a hash
" table
loop at LT_ITCFC assigning <LS_ITCFC>.
LD_UCCP = <LS_ITCFC>-CPCHARNO.
LS_FONT_METRIC-CHAR =
CL_ABAP_CONV_IN_CE=>UCCPI( LD_UCCP ).
LS_FONT_METRIC-CHAR_WIDTH = <LS_ITCFC>-TDCWIDTHS.
insert LS_FONT_METRIC
into table <LS_FONT_CACHE>-TH_FONT_METRICS.
endloop.
endif.
endif.
" Calculate the cell width
" If available, use font metrics
if LINES( <LS_FONT_CACHE>-TH_FONT_METRICS ) = 0.
" Font metrics are not available
" -> Calculate the cell width using only the font size
LD_LENGTH = STRLEN( LD_CELL_VALUE ).
EP_WIDTH = LD_LENGTH * LD_FONT_HEIGHT / LC_DEFAULT_FONT_HEIGHT + LC_EXCEL_CELL_PADDING.
else.
" Font metrics are available
" Calculate the size of the text by adding the sizes of each
" letter
LD_LENGTH = STRLEN( LD_CELL_VALUE ).
do LD_LENGTH times.
" Subtract 1, because the first character is at offset 0
LD_OFFSET = SY-INDEX - 1.
" Read the current character from the cell value
LD_CURRENT_CHARACTER = LD_CELL_VALUE+LD_OFFSET(1).
" Look up the size of the current letter
read table <LS_FONT_CACHE>-TH_FONT_METRICS
with table key CHAR = LD_CURRENT_CHARACTER
assigning <LS_FONT_METRIC>.
if SY-SUBRC = 0.
" The size of the letter is known
" -> Add the actual size of the letter
add <LS_FONT_METRIC>-CHAR_WIDTH to LD_WIDTH_FROM_FONT_METRICS.
else.
" The size of the letter is unknown
" -> Add the font height as the default letter size
add LD_FONT_HEIGHT to LD_WIDTH_FROM_FONT_METRICS.
endif.
enddo.
" Add cell padding (Excel makes columns a bit wider than the space
" that is needed for the text itself) and convert unit
" (division by 100)
EP_WIDTH = LD_WIDTH_FROM_FONT_METRICS / 100 + LC_EXCEL_CELL_PADDING.
endif.
" If the current cell contains an auto filter, make it a bit wider.
" The size used by the auto filter button does not depend on the font
" size.
if LD_FLAG_CONTAINS_AUTO_FILTER = ABAP_TRUE.
add 2 to EP_WIDTH.
endif.
endmethod.
method CALCULATE_COLUMN_WIDTHS.
types:
begin of T_AUTO_SIZE,
COL_INDEX type INT4,
WIDTH type FLOAT,
end of T_AUTO_SIZE.
types: TT_AUTO_SIZE type table of T_AUTO_SIZE.
data: LO_COLUMN_ITERATOR type ref to CL_OBJECT_COLLECTION_ITERATOR,
LO_COLUMN type ref to ZCL_EXCEL_COLUMN.
data: AUTO_SIZE type FLAG.
data: AUTO_SIZES type TT_AUTO_SIZE.
data: COUNT type INT4.
data: HIGHEST_ROW type INT4.
data: WIDTH type FLOAT.
field-symbols: <AUTO_SIZE> like line of AUTO_SIZES.
LO_COLUMN_ITERATOR = ME->GET_COLUMNS_ITERATOR( ).
while LO_COLUMN_ITERATOR->HAS_NEXT( ) = ABAP_TRUE.
LO_COLUMN ?= LO_COLUMN_ITERATOR->GET_NEXT( ).
AUTO_SIZE = LO_COLUMN->GET_AUTO_SIZE( ).
if AUTO_SIZE = ABAP_TRUE.
append initial line to AUTO_SIZES assigning <AUTO_SIZE>.
<AUTO_SIZE>-COL_INDEX = LO_COLUMN->GET_COLUMN_INDEX( ).
<AUTO_SIZE>-WIDTH = -1.
endif.
endwhile.
" There is only something to do if there are some auto-size columns
if not AUTO_SIZES is initial.
HIGHEST_ROW = ME->GET_HIGHEST_ROW( ).
loop at AUTO_SIZES assigning <AUTO_SIZE>.
COUNT = 1.
while COUNT <= HIGHEST_ROW.
* Do not check merged cells
if IS_CELL_MERGED(
IP_COLUMN = <AUTO_SIZE>-COL_INDEX
IP_ROW = COUNT ) = ABAP_FALSE.
WIDTH = CALCULATE_CELL_WIDTH( IP_COLUMN = <AUTO_SIZE>-COL_INDEX " issue #155 - less restrictive typing for ip_column
IP_ROW = COUNT ).
if WIDTH > <AUTO_SIZE>-WIDTH.
<AUTO_SIZE>-WIDTH = WIDTH.
endif.
endif.
COUNT = COUNT + 1.
endwhile.
LO_COLUMN = ME->GET_COLUMN( <AUTO_SIZE>-COL_INDEX ). " issue #155 - less restrictive typing for ip_column
LO_COLUMN->SET_WIDTH( <AUTO_SIZE>-WIDTH ).
endloop.
endif.
endmethod.
method CHANGE_CELL_STYLE.
" issue # 139
data: STYLEMAPPING type ZEXCEL_S_STYLEMAPPING,
COMPLETE_STYLE type ZEXCEL_S_CSTYLE_COMPLETE,
COMPLETE_STYLEX type ZEXCEL_S_CSTYLEX_COMPLETE,
BORDERX type ZEXCEL_S_CSTYLEX_BORDER,
L_GUID type ZEXCEL_CELL_STYLE. "issue # 177
* We have a lot of parameters. Use some macros to make the coding more structured
define CLEAR_INITIAL_COLORXFIELDS.
if &1-RGB is initial.
clear &2-RGB.
endif.
if &1-INDEXED is initial.
clear &2-INDEXED.
endif.
if &1-THEME is initial.
clear &2-THEME.
endif.
if &1-TINT is initial.
clear &2-TINT.
endif.
end-of-definition.
define MOVE_SUPPLIED_BORDERS.
if IP_&1 is supplied. " only act if parameter was supplied
if IP_X&1 is supplied. "
BORDERX = IP_X&1. " use supplied x-parameter
else.
clear BORDERX with 'X'.
* clear in a way that would be expected to work easily
if IP_&1-BORDER_STYLE is initial.
clear BORDERX-BORDER_STYLE.
endif.
CLEAR_INITIAL_COLORXFIELDS IP_&1-BORDER_COLOR BORDERX-BORDER_COLOR.
endif.
move-corresponding IP_&1 to COMPLETE_STYLE-&2.
move-corresponding BORDERX to COMPLETE_STYLEX-&2.
endif.
end-of-definition.
* First get current stylsettings
try.
ME->GET_CELL( exporting IP_COLUMN = IP_COLUMN " Cell Column
IP_ROW = IP_ROW " Cell Row
importing EP_GUID = L_GUID )." Cell Value ). "issue # 177
STYLEMAPPING = ME->EXCEL->GET_STYLE_TO_GUID( L_GUID ). "issue # 177
COMPLETE_STYLE = STYLEMAPPING-COMPLETE_STYLE.
COMPLETE_STYLEX = STYLEMAPPING-COMPLETE_STYLEX.
catch ZCX_EXCEL.
* Error --> use submitted style
endtry.
* move_supplied_multistyles: complete.
if IP_COMPLETE is supplied.
if IP_XCOMPLETE is not supplied.
zcx_excel=>raise_text( 'Complete styleinfo has to be supplied with corresponding X-field' ).
endif.
move-corresponding IP_COMPLETE to COMPLETE_STYLE.
move-corresponding IP_XCOMPLETE to COMPLETE_STYLEX.
endif.
if IP_FONT is supplied.
data: FONTX like IP_XFONT.
if IP_XFONT is supplied.
FONTX = IP_XFONT.
else.
* Only supplied values should be used - exception: Flags bold and italic strikethrough underline
move 'X' to: FONTX-BOLD,
FONTX-ITALIC,
FONTX-STRIKETHROUGH,
FONTX-UNDERLINE_MODE.
clear FONTX-COLOR with 'X'.
CLEAR_INITIAL_COLORXFIELDS IP_FONT-COLOR FONTX-COLOR.
if IP_FONT-FAMILY is not initial.
FONTX-FAMILY = 'X'.
endif.
if IP_FONT-NAME is not initial.
FONTX-NAME = 'X'.
endif.
if IP_FONT-SCHEME is not initial.
FONTX-SCHEME = 'X'.
endif.
if IP_FONT-SIZE is not initial.
FONTX-SIZE = 'X'.
endif.
if IP_FONT-UNDERLINE_MODE is not initial.
FONTX-UNDERLINE_MODE = 'X'.
endif.
endif.
move-corresponding IP_FONT to COMPLETE_STYLE-FONT.
move-corresponding FONTX to COMPLETE_STYLEX-FONT.
* Correction for undeline mode
endif.
if IP_FILL is supplied.
data: FILLX like IP_XFILL.
if IP_XFILL is supplied.
FILLX = IP_XFILL.
else.
clear FILLX with 'X'.
if IP_FILL-FILLTYPE is initial.
clear FILLX-FILLTYPE.
endif.
CLEAR_INITIAL_COLORXFIELDS IP_FILL-FGCOLOR FILLX-FGCOLOR.
CLEAR_INITIAL_COLORXFIELDS IP_FILL-BGCOLOR FILLX-BGCOLOR.
endif.
move-corresponding IP_FILL to COMPLETE_STYLE-FILL.
move-corresponding FILLX to COMPLETE_STYLEX-FILL.
endif.
if IP_BORDERS is supplied.
data: BORDERSX like IP_XBORDERS.
if IP_XBORDERS is supplied.
BORDERSX = IP_XBORDERS.
else.
clear BORDERSX with 'X'.
if IP_BORDERS-ALLBORDERS-BORDER_STYLE is initial.
clear BORDERSX-ALLBORDERS-BORDER_STYLE.
endif.
if IP_BORDERS-DIAGONAL-BORDER_STYLE is initial.
clear BORDERSX-DIAGONAL-BORDER_STYLE.
endif.
if IP_BORDERS-DOWN-BORDER_STYLE is initial.
clear BORDERSX-DOWN-BORDER_STYLE.
endif.
if IP_BORDERS-LEFT-BORDER_STYLE is initial.
clear BORDERSX-LEFT-BORDER_STYLE.
endif.
if IP_BORDERS-RIGHT-BORDER_STYLE is initial.
clear BORDERSX-RIGHT-BORDER_STYLE.
endif.
if IP_BORDERS-TOP-BORDER_STYLE is initial.
clear BORDERSX-TOP-BORDER_STYLE.
endif.
CLEAR_INITIAL_COLORXFIELDS IP_BORDERS-ALLBORDERS-BORDER_COLOR BORDERSX-ALLBORDERS-BORDER_COLOR.
CLEAR_INITIAL_COLORXFIELDS IP_BORDERS-DIAGONAL-BORDER_COLOR BORDERSX-DIAGONAL-BORDER_COLOR.
CLEAR_INITIAL_COLORXFIELDS IP_BORDERS-DOWN-BORDER_COLOR BORDERSX-DOWN-BORDER_COLOR.
CLEAR_INITIAL_COLORXFIELDS IP_BORDERS-LEFT-BORDER_COLOR BORDERSX-LEFT-BORDER_COLOR.
CLEAR_INITIAL_COLORXFIELDS IP_BORDERS-RIGHT-BORDER_COLOR BORDERSX-RIGHT-BORDER_COLOR.
CLEAR_INITIAL_COLORXFIELDS IP_BORDERS-TOP-BORDER_COLOR BORDERSX-TOP-BORDER_COLOR.
endif.
move-corresponding IP_BORDERS to COMPLETE_STYLE-BORDERS.
move-corresponding BORDERSX to COMPLETE_STYLEX-BORDERS.
endif.
if IP_ALIGNMENT is supplied.
data: ALIGNMENTX like IP_XALIGNMENT.
if IP_XALIGNMENT is supplied.
ALIGNMENTX = IP_XALIGNMENT.
else.
clear ALIGNMENTX with 'X'.
if IP_ALIGNMENT-HORIZONTAL is initial.
clear ALIGNMENTX-HORIZONTAL.
endif.
if IP_ALIGNMENT-VERTICAL is initial.
clear ALIGNMENTX-VERTICAL.
endif.
endif.
move-corresponding IP_ALIGNMENT to COMPLETE_STYLE-ALIGNMENT.
move-corresponding ALIGNMENTX to COMPLETE_STYLEX-ALIGNMENT.
endif.
if IP_PROTECTION is supplied.
move-corresponding IP_PROTECTION to COMPLETE_STYLE-PROTECTION.
if IP_XPROTECTION is supplied.
move-corresponding IP_XPROTECTION to COMPLETE_STYLEX-PROTECTION.
else.
if IP_PROTECTION-HIDDEN is not initial.
COMPLETE_STYLEX-PROTECTION-HIDDEN = 'X'.
endif.
if IP_PROTECTION-LOCKED is not initial.
COMPLETE_STYLEX-PROTECTION-LOCKED = 'X'.
endif.
endif.
endif.
MOVE_SUPPLIED_BORDERS : BORDERS_ALLBORDERS BORDERS-ALLBORDERS,
BORDERS_DIAGONAL BORDERS-DIAGONAL ,
BORDERS_DOWN BORDERS-DOWN ,
BORDERS_LEFT BORDERS-LEFT ,
BORDERS_RIGHT BORDERS-RIGHT ,
BORDERS_TOP BORDERS-TOP .
define MOVE_SUPPLIED_SINGLESTYLES.
if IP_&1 is supplied.
COMPLETE_STYLE-&2 = IP_&1.
COMPLETE_STYLEX-&2 = 'X'.
endif.
end-of-definition.
MOVE_SUPPLIED_SINGLESTYLES: NUMBER_FORMAT_FORMAT_CODE NUMBER_FORMAT-FORMAT_CODE,
FONT_BOLD FONT-BOLD,
FONT_COLOR FONT-COLOR,
FONT_COLOR_RGB FONT-COLOR-RGB,
FONT_COLOR_INDEXED FONT-COLOR-INDEXED,
FONT_COLOR_THEME FONT-COLOR-THEME,
FONT_COLOR_TINT FONT-COLOR-TINT,
FONT_FAMILY FONT-FAMILY,
FONT_ITALIC FONT-ITALIC,
FONT_NAME FONT-NAME,
FONT_SCHEME FONT-SCHEME,
FONT_SIZE FONT-SIZE,
FONT_STRIKETHROUGH FONT-STRIKETHROUGH,
FONT_UNDERLINE FONT-UNDERLINE,
FONT_UNDERLINE_MODE FONT-UNDERLINE_MODE,
FILL_FILLTYPE FILL-FILLTYPE,
FILL_ROTATION FILL-ROTATION,
FILL_FGCOLOR FILL-FGCOLOR,
FILL_FGCOLOR_RGB FILL-FGCOLOR-RGB,
FILL_FGCOLOR_INDEXED FILL-FGCOLOR-INDEXED,
FILL_FGCOLOR_THEME FILL-FGCOLOR-THEME,
FILL_FGCOLOR_TINT FILL-FGCOLOR-TINT,
FILL_BGCOLOR FILL-BGCOLOR,
FILL_BGCOLOR_RGB FILL-BGCOLOR-RGB,
FILL_BGCOLOR_INDEXED FILL-BGCOLOR-INDEXED,
FILL_BGCOLOR_THEME FILL-BGCOLOR-THEME,
FILL_BGCOLOR_TINT FILL-BGCOLOR-TINT,
FILL_GRADTYPE_TYPE FILL-GRADTYPE-TYPE,
FILL_GRADTYPE_DEGREE FILL-GRADTYPE-DEGREE,
FILL_GRADTYPE_BOTTOM FILL-GRADTYPE-BOTTOM,
FILL_GRADTYPE_LEFT FILL-GRADTYPE-LEFT,
FILL_GRADTYPE_TOP FILL-GRADTYPE-TOP,
FILL_GRADTYPE_RIGHT FILL-GRADTYPE-RIGHT,
FILL_GRADTYPE_POSITION1 FILL-GRADTYPE-POSITION1,
FILL_GRADTYPE_POSITION2 FILL-GRADTYPE-POSITION2,
FILL_GRADTYPE_POSITION3 FILL-GRADTYPE-POSITION3,
BORDERS_DIAGONAL_MODE BORDERS-DIAGONAL_MODE,
ALIGNMENT_HORIZONTAL ALIGNMENT-HORIZONTAL,
ALIGNMENT_VERTICAL ALIGNMENT-VERTICAL,
ALIGNMENT_TEXTROTATION ALIGNMENT-TEXTROTATION,
ALIGNMENT_WRAPTEXT ALIGNMENT-WRAPTEXT,
ALIGNMENT_SHRINKTOFIT ALIGNMENT-SHRINKTOFIT,
ALIGNMENT_INDENT ALIGNMENT-INDENT,
PROTECTION_HIDDEN PROTECTION-HIDDEN,
PROTECTION_LOCKED PROTECTION-LOCKED,
BORDERS_ALLBORDERS_STYLE BORDERS-ALLBORDERS-BORDER_STYLE,
BORDERS_ALLBORDERS_COLOR BORDERS-ALLBORDERS-BORDER_COLOR,
BORDERS_ALLBO_COLOR_RGB BORDERS-ALLBORDERS-BORDER_COLOR-RGB,
BORDERS_ALLBO_COLOR_INDEXED BORDERS-ALLBORDERS-BORDER_COLOR-INDEXED,
BORDERS_ALLBO_COLOR_THEME BORDERS-ALLBORDERS-BORDER_COLOR-THEME,
BORDERS_ALLBO_COLOR_TINT BORDERS-ALLBORDERS-BORDER_COLOR-TINT,
BORDERS_DIAGONAL_STYLE BORDERS-DIAGONAL-BORDER_STYLE,
BORDERS_DIAGONAL_COLOR BORDERS-DIAGONAL-BORDER_COLOR,
BORDERS_DIAGONAL_COLOR_RGB BORDERS-DIAGONAL-BORDER_COLOR-RGB,
BORDERS_DIAGONAL_COLOR_INDE BORDERS-DIAGONAL-BORDER_COLOR-INDEXED,
BORDERS_DIAGONAL_COLOR_THEM BORDERS-DIAGONAL-BORDER_COLOR-THEME,
BORDERS_DIAGONAL_COLOR_TINT BORDERS-DIAGONAL-BORDER_COLOR-TINT,
BORDERS_DOWN_STYLE BORDERS-DOWN-BORDER_STYLE,
BORDERS_DOWN_COLOR BORDERS-DOWN-BORDER_COLOR,
BORDERS_DOWN_COLOR_RGB BORDERS-DOWN-BORDER_COLOR-RGB,
BORDERS_DOWN_COLOR_INDEXED BORDERS-DOWN-BORDER_COLOR-INDEXED,
BORDERS_DOWN_COLOR_THEME BORDERS-DOWN-BORDER_COLOR-THEME,
BORDERS_DOWN_COLOR_TINT BORDERS-DOWN-BORDER_COLOR-TINT,
BORDERS_LEFT_STYLE BORDERS-LEFT-BORDER_STYLE,
BORDERS_LEFT_COLOR BORDERS-LEFT-BORDER_COLOR,
BORDERS_LEFT_COLOR_RGB BORDERS-LEFT-BORDER_COLOR-RGB,
BORDERS_LEFT_COLOR_INDEXED BORDERS-LEFT-BORDER_COLOR-INDEXED,
BORDERS_LEFT_COLOR_THEME BORDERS-LEFT-BORDER_COLOR-THEME,
BORDERS_LEFT_COLOR_TINT BORDERS-LEFT-BORDER_COLOR-TINT,
BORDERS_RIGHT_STYLE BORDERS-RIGHT-BORDER_STYLE,
BORDERS_RIGHT_COLOR BORDERS-RIGHT-BORDER_COLOR,
BORDERS_RIGHT_COLOR_RGB BORDERS-RIGHT-BORDER_COLOR-RGB,
BORDERS_RIGHT_COLOR_INDEXED BORDERS-RIGHT-BORDER_COLOR-INDEXED,
BORDERS_RIGHT_COLOR_THEME BORDERS-RIGHT-BORDER_COLOR-THEME,
BORDERS_RIGHT_COLOR_TINT BORDERS-RIGHT-BORDER_COLOR-TINT,
BORDERS_TOP_STYLE BORDERS-TOP-BORDER_STYLE,
BORDERS_TOP_COLOR BORDERS-TOP-BORDER_COLOR,
BORDERS_TOP_COLOR_RGB BORDERS-TOP-BORDER_COLOR-RGB,
BORDERS_TOP_COLOR_INDEXED BORDERS-TOP-BORDER_COLOR-INDEXED,
BORDERS_TOP_COLOR_THEME BORDERS-TOP-BORDER_COLOR-THEME,
BORDERS_TOP_COLOR_TINT BORDERS-TOP-BORDER_COLOR-TINT.
* Now we have a completly filled styles.
* This can be used to get the guid
* Return guid if requested. Might be used if copy&paste of styles is requested
EP_GUID = ME->EXCEL->GET_STATIC_CELLSTYLE_GUID( IP_CSTYLE_COMPLETE = COMPLETE_STYLE
IP_CSTYLEX_COMPLETE = COMPLETE_STYLEX ).
ME->SET_CELL_STYLE( IP_COLUMN = IP_COLUMN
IP_ROW = IP_ROW
IP_STYLE = EP_GUID ).
endmethod.
method CONSTRUCTOR.
data: LV_TITLE type ZEXCEL_SHEET_TITLE.
ME->EXCEL = IP_EXCEL.
* CALL FUNCTION 'GUID_CREATE' " del issue #379 - function is outdated in newer releases
* IMPORTING
* ev_guid_16 = me->guid.
ME->GUID = ZCL_EXCEL_OBSOLETE_FUNC_WRAP=>GUID_CREATE( ). " ins issue #379 - replacement for outdated function call
if IP_TITLE is not initial.
LV_TITLE = IP_TITLE.
else.
* lv_title = me->guid. " del issue #154 - Names of worksheets
LV_TITLE = ME->GENERATE_TITLE( ). " ins issue #154 - Names of worksheets
endif.
ME->SET_TITLE( IP_TITLE = LV_TITLE ).
create object SHEET_SETUP.
create object STYLES_COND.
create object DATA_VALIDATIONS.
create object TABLES.
create object COLUMNS.
create object ROWS.
create object RANGES. " issue #163
create object MO_PAGEBREAKS.
create object DRAWINGS
exporting
IP_TYPE = ZCL_EXCEL_DRAWING=>TYPE_IMAGE.
create object CHARTS
exporting
IP_TYPE = ZCL_EXCEL_DRAWING=>TYPE_CHART.
ME->ZIF_EXCEL_SHEET_PROTECTION~INITIALIZE( ).
ME->ZIF_EXCEL_SHEET_PROPERTIES~INITIALIZE( ).
create object HYPERLINKS.
CREATE OBJECT comments. " (+) Issue #180
* initialize active cell coordinates
ACTIVE_CELL-CELL_ROW = 1.
ACTIVE_CELL-CELL_COLUMN = 1.
* inizialize dimension range
LOWER_CELL-CELL_ROW = 1.
LOWER_CELL-CELL_COLUMN = 1.
UPPER_CELL-CELL_ROW = 1.
UPPER_CELL-CELL_COLUMN = 1.
endmethod.
method DELETE_MERGE.
data: LV_COLUMN type I.
*--------------------------------------------------------------------*
* If cell information is passed delete merge including this cell,
* otherwise delete all merges
*--------------------------------------------------------------------*
if IP_CELL_COLUMN is initial
or IP_CELL_ROW is initial.
clear ME->MT_MERGED_CELLS.
else.
LV_COLUMN = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( IP_CELL_COLUMN ).
loop at ME->MT_MERGED_CELLS transporting no fields
where
( ROW_FROM <= IP_CELL_ROW and ROW_TO >= IP_CELL_ROW )
and
( COL_FROM <= LV_COLUMN and COL_TO >= LV_COLUMN ).
delete ME->MT_MERGED_CELLS.
exit.
endloop.
endif.
endmethod.
method DELETE_ROW_OUTLINE.
delete ME->MT_ROW_OUTLINES where ROW_FROM = IV_ROW_FROM
and ROW_TO = IV_ROW_TO.
if SY-SUBRC <> 0. " didn't find outline that was to be deleted
zcx_excel=>raise_text( 'Row outline to be deleted does not exist' ).
endif.
endmethod.
method FREEZE_PANES.
if IP_NUM_COLUMNS is not supplied and IP_NUM_ROWS is not supplied.
zcx_excel=>raise_text( 'Pleas provide number of rows and/or columns to freeze' ).
endif.
if IP_NUM_COLUMNS is supplied and IP_NUM_COLUMNS <= 0.
zcx_excel=>raise_text( 'Number of columns to freeze should be positive' ).
endif.
if IP_NUM_ROWS is supplied and IP_NUM_ROWS <= 0.
zcx_excel=>raise_text( 'Number of rows to freeze should be positive' ).
endif.
FREEZE_PANE_CELL_COLUMN = IP_NUM_COLUMNS + 1.
FREEZE_PANE_CELL_ROW = IP_NUM_ROWS + 1.
endmethod.
method GENERATE_TITLE.
data: LO_WORKSHEETS_ITERATOR type ref to CL_OBJECT_COLLECTION_ITERATOR,
LO_WORKSHEET type ref to ZCL_EXCEL_WORKSHEET.
data: T_TITLES type hashed table of ZEXCEL_SHEET_TITLE with unique key TABLE_LINE,
TITLE type ZEXCEL_SHEET_TITLE,
SHEETNUMBER type I.
* Get list of currently used titles
LO_WORKSHEETS_ITERATOR = ME->EXCEL->GET_WORKSHEETS_ITERATOR( ).
while LO_WORKSHEETS_ITERATOR->HAS_NEXT( ) = ABAP_TRUE.
LO_WORKSHEET ?= LO_WORKSHEETS_ITERATOR->GET_NEXT( ).
TITLE = LO_WORKSHEET->GET_TITLE( ).
insert TITLE into table T_TITLES.
add 1 to SHEETNUMBER.
endwhile.
* Now build sheetnumber. Increase counter until we hit a number that is not used so far
add 1 to SHEETNUMBER. " Start counting with next number
do.
TITLE = SHEETNUMBER.
shift TITLE left deleting leading SPACE.
concatenate 'Sheet'(001) TITLE into EP_TITLE.
insert EP_TITLE into table T_TITLES.
if SY-SUBRC = 0. " Title not used so far --> take it
exit.
endif.
add 1 to SHEETNUMBER.
enddo.
endmethod.
method GET_ACTIVE_CELL.
data: LV_ACTIVE_COLUMN type ZEXCEL_CELL_COLUMN_ALPHA,
LV_ACTIVE_ROW type STRING.
LV_ACTIVE_COLUMN = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2ALPHA( ACTIVE_CELL-CELL_COLUMN ).
LV_ACTIVE_ROW = ACTIVE_CELL-CELL_ROW.
shift LV_ACTIVE_ROW right deleting trailing SPACE.
shift LV_ACTIVE_ROW left deleting leading SPACE.
concatenate LV_ACTIVE_COLUMN LV_ACTIVE_ROW into EP_ACTIVE_CELL.
endmethod.
method GET_CELL.
data: LV_COLUMN type ZEXCEL_CELL_COLUMN,
LS_SHEET_CONTENT type ZEXCEL_S_CELL_DATA.
LV_COLUMN = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( IP_COLUMN ).
read table SHEET_CONTENT into LS_SHEET_CONTENT with table key CELL_ROW = IP_ROW
CELL_COLUMN = LV_COLUMN.
EP_RC = SY-SUBRC.
EP_VALUE = LS_SHEET_CONTENT-CELL_VALUE.
EP_GUID = LS_SHEET_CONTENT-CELL_STYLE. " issue 139 - added this to be used for columnwidth calculation
EP_FORMULA = LS_SHEET_CONTENT-CELL_FORMULA.
" Addition to solve issue #120, contribution by Stefan Schmöcker
data: STYLE_ITERATOR type ref to CL_OBJECT_COLLECTION_ITERATOR,
STYLE type ref to ZCL_EXCEL_STYLE.
if EP_STYLE is requested.
STYLE_ITERATOR = ME->EXCEL->GET_STYLES_ITERATOR( ).
while STYLE_ITERATOR->HAS_NEXT( ) = 'X'.
STYLE ?= STYLE_ITERATOR->GET_NEXT( ).
if STYLE->GET_GUID( ) = LS_SHEET_CONTENT-CELL_STYLE.
EP_STYLE = STYLE.
exit.
endif.
endwhile.
endif.
endmethod.
method GET_COLUMN.
data: LV_COLUMN type ZEXCEL_CELL_COLUMN.
LV_COLUMN = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( IP_COLUMN ).
EO_COLUMN = ME->COLUMNS->GET( IP_INDEX = LV_COLUMN ).
if EO_COLUMN is not bound.
EO_COLUMN = ME->ADD_NEW_COLUMN( IP_COLUMN ).
endif.
endmethod.
method GET_COLUMNS.
EO_COLUMNS = ME->COLUMNS.
endmethod.
method GET_COLUMNS_ITERATOR.
EO_ITERATOR = ME->COLUMNS->GET_ITERATOR( ).
endmethod.
METHOD get_comments.
DATA: lo_comment TYPE REF TO zcl_excel_comment,
lo_iterator TYPE REF TO cl_object_collection_iterator.
CREATE OBJECT r_comments.
lo_iterator = comments->get_iterator( ).
WHILE lo_iterator->has_next( ) = abap_true.
lo_comment ?= lo_iterator->get_next( ).
r_comments->include( lo_comment ).
ENDWHILE.
ENDMETHOD.
METHOD get_comments_iterator.
eo_iterator = comments->get_iterator( ).
ENDMETHOD.
method GET_DATA_VALIDATIONS_ITERATOR.
EO_ITERATOR = ME->DATA_VALIDATIONS->GET_ITERATOR( ).
endmethod.
method GET_DATA_VALIDATIONS_SIZE.
EP_SIZE = ME->DATA_VALIDATIONS->SIZE( ).
endmethod.
method GET_DEFAULT_COLUMN.
if ME->COLUMN_DEFAULT is not bound.
create object ME->COLUMN_DEFAULT
exporting
IP_INDEX = 'A' " ????
IP_WORKSHEET = ME
IP_EXCEL = ME->EXCEL.
endif.
EO_COLUMN = ME->COLUMN_DEFAULT.
endmethod.
method GET_DEFAULT_EXCEL_DATE_FORMAT.
constants: C_LANG_E type LANG value 'E'.
if DEFAULT_EXCEL_DATE_FORMAT is not initial.
EP_DEFAULT_EXCEL_DATE_FORMAT = DEFAULT_EXCEL_DATE_FORMAT.
return.
endif.
"try to get defaults
try.
CL_ABAP_DATFM=>GET_DATE_FORMAT_DES( exporting IM_LANGU = C_LANG_E
importing EX_DATEFORMAT = DEFAULT_EXCEL_DATE_FORMAT ).
catch CX_ABAP_DATFM_FORMAT_UNKNOWN.
endtry.
" and fallback to fixed format
if DEFAULT_EXCEL_DATE_FORMAT is initial.
DEFAULT_EXCEL_DATE_FORMAT = ZCL_EXCEL_STYLE_NUMBER_FORMAT=>C_FORMAT_DATE_DDMMYYYYDOT.
endif.
EP_DEFAULT_EXCEL_DATE_FORMAT = DEFAULT_EXCEL_DATE_FORMAT.
endmethod.
method GET_DEFAULT_EXCEL_TIME_FORMAT.
data: L_TIMEFM type XUTIMEFM.
if DEFAULT_EXCEL_TIME_FORMAT is not initial.
EP_DEFAULT_EXCEL_TIME_FORMAT = DEFAULT_EXCEL_TIME_FORMAT.
return.
endif.
* Let's get default
L_TIMEFM = CL_ABAP_TIMEFM=>GET_ENVIRONMENT_TIMEFM( ).
case L_TIMEFM.
when 0.
*0 24 Hour Format (Example: 12:05:10)
DEFAULT_EXCEL_TIME_FORMAT = ZCL_EXCEL_STYLE_NUMBER_FORMAT=>C_FORMAT_DATE_TIME6.
when 1.
*1 12 Hour Format (Example: 12:05:10 PM)
DEFAULT_EXCEL_TIME_FORMAT = ZCL_EXCEL_STYLE_NUMBER_FORMAT=>C_FORMAT_DATE_TIME2.
when 2.
*2 12 Hour Format (Example: 12:05:10 pm) for now all the same. no chnage upper lower
DEFAULT_EXCEL_TIME_FORMAT = ZCL_EXCEL_STYLE_NUMBER_FORMAT=>C_FORMAT_DATE_TIME2.
when 3.
*3 Hours from 0 to 11 (Example: 00:05:10 PM) for now all the same. no chnage upper lower
DEFAULT_EXCEL_TIME_FORMAT = ZCL_EXCEL_STYLE_NUMBER_FORMAT=>C_FORMAT_DATE_TIME2.
when 4.
*4 Hours from 0 to 11 (Example: 00:05:10 pm) for now all the same. no chnage upper lower
DEFAULT_EXCEL_TIME_FORMAT = ZCL_EXCEL_STYLE_NUMBER_FORMAT=>C_FORMAT_DATE_TIME2.
when others.
" and fallback to fixed format
DEFAULT_EXCEL_TIME_FORMAT = ZCL_EXCEL_STYLE_NUMBER_FORMAT=>C_FORMAT_DATE_TIME6.
endcase.
EP_DEFAULT_EXCEL_TIME_FORMAT = DEFAULT_EXCEL_TIME_FORMAT.
endmethod.
method GET_DEFAULT_ROW.
if ME->ROW_DEFAULT is not bound.
create object ME->ROW_DEFAULT.
endif.
EO_ROW = ME->ROW_DEFAULT.
endmethod.
method GET_DIMENSION_RANGE.
ME->UPDATE_DIMENSION_RANGE( ).
if UPPER_CELL eq LOWER_CELL. "only one cell
" Worksheet not filled
* IF upper_cell-cell_coords = '0'.
if UPPER_CELL-CELL_COORDS is initial.
EP_DIMENSION_RANGE = 'A1'.
else.
EP_DIMENSION_RANGE = UPPER_CELL-CELL_COORDS.
endif.
else.
concatenate UPPER_CELL-CELL_COORDS ':' LOWER_CELL-CELL_COORDS into EP_DIMENSION_RANGE.
endif.
endmethod.
method GET_DRAWINGS.
data: LO_DRAWING type ref to ZCL_EXCEL_DRAWING,
LO_ITERATOR type ref to CL_OBJECT_COLLECTION_ITERATOR.
case IP_TYPE.
when ZCL_EXCEL_DRAWING=>TYPE_IMAGE.
R_DRAWINGS = DRAWINGS.
when ZCL_EXCEL_DRAWING=>TYPE_CHART.
R_DRAWINGS = CHARTS.
when SPACE.
create object R_DRAWINGS
exporting
IP_TYPE = ''.
LO_ITERATOR = DRAWINGS->GET_ITERATOR( ).
while LO_ITERATOR->HAS_NEXT( ) = ABAP_TRUE.
LO_DRAWING ?= LO_ITERATOR->GET_NEXT( ).
R_DRAWINGS->INCLUDE( LO_DRAWING ).
endwhile.
LO_ITERATOR = CHARTS->GET_ITERATOR( ).
while LO_ITERATOR->HAS_NEXT( ) = ABAP_TRUE.
LO_DRAWING ?= LO_ITERATOR->GET_NEXT( ).
R_DRAWINGS->INCLUDE( LO_DRAWING ).
endwhile.
when others.
endcase.
endmethod.
method GET_DRAWINGS_ITERATOR.
case IP_TYPE.
when ZCL_EXCEL_DRAWING=>TYPE_IMAGE.
EO_ITERATOR = DRAWINGS->GET_ITERATOR( ).
when ZCL_EXCEL_DRAWING=>TYPE_CHART.
EO_ITERATOR = CHARTS->GET_ITERATOR( ).
endcase.
endmethod.
method GET_FREEZE_CELL.
EP_ROW = ME->FREEZE_PANE_CELL_ROW.
EP_COLUMN = ME->FREEZE_PANE_CELL_COLUMN.
endmethod.
method GET_GUID.
EP_GUID = ME->GUID.
endmethod.
method GET_HIGHEST_COLUMN.
ME->UPDATE_DIMENSION_RANGE( ).
R_HIGHEST_COLUMN = ME->LOWER_CELL-CELL_COLUMN.
endmethod.
method GET_HIGHEST_ROW.
ME->UPDATE_DIMENSION_RANGE( ).
R_HIGHEST_ROW = ME->LOWER_CELL-CELL_ROW.
endmethod.
method GET_HYPERLINKS_ITERATOR.
EO_ITERATOR = HYPERLINKS->GET_ITERATOR( ).
endmethod.
method GET_HYPERLINKS_SIZE.
EP_SIZE = HYPERLINKS->SIZE( ).
endmethod.
method GET_MERGE.
field-symbols: <LS_MERGED_CELL> like line of ME->MT_MERGED_CELLS.
data: LV_COL_FROM type STRING,
LV_COL_TO type STRING,
LV_ROW_FROM type STRING,
LV_ROW_TO type STRING,
LV_MERGE_RANGE type STRING.
loop at ME->MT_MERGED_CELLS assigning <LS_MERGED_CELL>.
LV_COL_FROM = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2ALPHA( <LS_MERGED_CELL>-COL_FROM ).
LV_COL_TO = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2ALPHA( <LS_MERGED_CELL>-COL_TO ).
LV_ROW_FROM = <LS_MERGED_CELL>-ROW_FROM.
LV_ROW_TO = <LS_MERGED_CELL>-ROW_TO .
concatenate LV_COL_FROM LV_ROW_FROM ':' LV_COL_TO LV_ROW_TO
into LV_MERGE_RANGE.
condense LV_MERGE_RANGE no-gaps.
append LV_MERGE_RANGE to MERGE_RANGE.
endloop.
endmethod.
method GET_PAGEBREAKS.
RO_PAGEBREAKS = MO_PAGEBREAKS.
endmethod.
method GET_RANGES_ITERATOR.
EO_ITERATOR = ME->RANGES->GET_ITERATOR( ).
endmethod.
method GET_ROW.
EO_ROW = ME->ROWS->GET( IP_INDEX = IP_ROW ).
if EO_ROW is not bound.
EO_ROW = ME->ADD_NEW_ROW( IP_ROW ).
endif.
endmethod.
method GET_ROWS.
EO_ROWS = ME->ROWS.
endmethod.
method GET_ROWS_ITERATOR.
EO_ITERATOR = ME->ROWS->GET_ITERATOR( ).
endmethod.
method GET_ROW_OUTLINES.
RT_ROW_OUTLINES = ME->MT_ROW_OUTLINES.
endmethod.
method GET_STYLE_COND.
data: LO_STYLE_ITERATOR type ref to CL_OBJECT_COLLECTION_ITERATOR,
LO_STYLE_COND type ref to ZCL_EXCEL_STYLE_COND.
LO_STYLE_ITERATOR = ME->GET_STYLE_COND_ITERATOR( ).
while LO_STYLE_ITERATOR->HAS_NEXT( ) = ABAP_TRUE.
LO_STYLE_COND ?= LO_STYLE_ITERATOR->GET_NEXT( ).
if LO_STYLE_COND->GET_GUID( ) = IP_GUID.
EO_STYLE_COND = LO_STYLE_COND.
exit.
endif.
endwhile.
endmethod.
method GET_STYLE_COND_ITERATOR.
EO_ITERATOR = STYLES_COND->GET_ITERATOR( ).
endmethod.
method GET_TABCOLOR.
EV_TABCOLOR = ME->TABCOLOR.
endmethod.
method GET_TABLE.
*--------------------------------------------------------------------*
* Comment D. Rauchenstein
* With this method, we get a fully functional Excel Upload, which solves
* a few issues of the other excel upload tools
* ZBCABA_ALSM_EXCEL_UPLOAD_EXT: Reads only up to 50 signs per Cell, Limit
* in row-Numbers. Other have Limitations of Lines, or you are not able
* to ignore filters or choosing the right tab.
*
* To get a fully functional XLSX Upload, you can use it e.g. with method
* CL_EXCEL_READER_2007->ZIF_EXCEL_READER~LOAD_FILE()
*--------------------------------------------------------------------*
field-symbols: <LS_LINE> type DATA.
field-symbols: <LV_VALUE> type DATA.
data LV_ACTUAL_ROW type INT4.
data LV_ACTUAL_COL type INT4.
data LV_ERRORMESSAGE type STRING.
data LV_MAX_COL type ZEXCEL_CELL_COLUMN.
data LV_MAX_ROW type INT4.
data LV_DELTA_COL type INT4.
data LV_VALUE type ZEXCEL_CELL_VALUE.
data LV_RC type SYSUBRC.
LV_MAX_COL = ME->GET_HIGHEST_COLUMN( ).
LV_MAX_ROW = ME->GET_HIGHEST_ROW( ).
*--------------------------------------------------------------------*
* The row counter begins with 1 and should be corrected with the skips
*--------------------------------------------------------------------*
LV_ACTUAL_ROW = IV_SKIPPED_ROWS + 1.
LV_ACTUAL_COL = IV_SKIPPED_COLS + 1.
try.
*--------------------------------------------------------------------*
* Check if we the basic features are possible with given "any table"
*--------------------------------------------------------------------*
append initial line to ET_TABLE assigning <LS_LINE>.
if SY-SUBRC <> 0 or <LS_LINE> is not assigned.
LV_ERRORMESSAGE = 'Error at inserting new Line to internal Table'(002).
zcx_excel=>raise_text( lv_errormessage ).
else.
LV_DELTA_COL = LV_MAX_COL - IV_SKIPPED_COLS.
assign component LV_DELTA_COL of structure <LS_LINE> to <LV_VALUE>.
if SY-SUBRC <> 0 or <LV_VALUE> is not assigned.
LV_ERRORMESSAGE = 'Internal table has less columns than excel'(003).
zcx_excel=>raise_text( lv_errormessage ).
else.
*--------------------------------------------------------------------*
*now we are ready for handle the table data
*--------------------------------------------------------------------*
refresh ET_TABLE.
*--------------------------------------------------------------------*
* Handle each Row until end on right side
*--------------------------------------------------------------------*
while LV_ACTUAL_ROW <= LV_MAX_ROW .
*--------------------------------------------------------------------*
* Handle each Column until end on bottom
* First step is to step back on first column
*--------------------------------------------------------------------*
LV_ACTUAL_COL = IV_SKIPPED_COLS + 1.
unassign <LS_LINE>.
append initial line to ET_TABLE assigning <LS_LINE>.
if SY-SUBRC <> 0 or <LS_LINE> is not assigned.
LV_ERRORMESSAGE = 'Error at inserting new Line to internal Table'(002).
zcx_excel=>raise_text( lv_errormessage ).
endif.
while LV_ACTUAL_COL <= LV_MAX_COL.
LV_DELTA_COL = LV_ACTUAL_COL - IV_SKIPPED_COLS.
assign component LV_DELTA_COL of structure <LS_LINE> to <LV_VALUE>.
if SY-SUBRC <> 0.
LV_ERRORMESSAGE = |{ 'Error at assigning field (Col:'(004) } { LV_ACTUAL_COL } { ' Row:'(005) } { LV_ACTUAL_ROW }|.
zcx_excel=>raise_text( lv_errormessage ).
endif.
ME->GET_CELL(
exporting
IP_COLUMN = LV_ACTUAL_COL " Cell Column
IP_ROW = LV_ACTUAL_ROW " Cell Row
importing
EP_VALUE = LV_VALUE " Cell Value
EP_RC = LV_RC " Return Value of ABAP Statements
).
if LV_RC <> 0
and LV_RC <> 4. "No found error means, zero/no value in cell
LV_ERRORMESSAGE = |{ 'Error at reading field value (Col:'(007) } { LV_ACTUAL_COL } { ' Row:'(005) } { LV_ACTUAL_ROW }|.
zcx_excel=>raise_text( lv_errormessage ).
endif.
<LV_VALUE> = LV_VALUE.
* CATCH zcx_excel. "
add 1 to LV_ACTUAL_COL.
endwhile.
add 1 to LV_ACTUAL_ROW.
endwhile.
endif.
endif.
catch CX_SY_ASSIGN_CAST_ILLEGAL_CAST.
LV_ERRORMESSAGE = |{ 'Error at assigning field (Col:'(004) } { LV_ACTUAL_COL } { ' Row:'(005) } { LV_ACTUAL_ROW }|.
zcx_excel=>raise_text( lv_errormessage ).
catch CX_SY_ASSIGN_CAST_UNKNOWN_TYPE.
LV_ERRORMESSAGE = |{ 'Error at assigning field (Col:'(004) } { LV_ACTUAL_COL } { ' Row:'(005) } { LV_ACTUAL_ROW }|.
zcx_excel=>raise_text( lv_errormessage ).
catch CX_SY_ASSIGN_OUT_OF_RANGE.
LV_ERRORMESSAGE = 'Internal table has less columns than excel'(003).
zcx_excel=>raise_text( lv_errormessage ).
catch CX_SY_CONVERSION_ERROR.
LV_ERRORMESSAGE = |{ 'Error at converting field value (Col:'(006) } { LV_ACTUAL_COL } { ' Row:'(005) } { LV_ACTUAL_ROW }|.
zcx_excel=>raise_text( lv_errormessage ).
endtry.
endmethod.
method GET_TABLES_ITERATOR.
EO_ITERATOR = TABLES->IF_OBJECT_COLLECTION~GET_ITERATOR( ).
endmethod.
method GET_TABLES_SIZE.
EP_SIZE = TABLES->IF_OBJECT_COLLECTION~SIZE( ).
endmethod.
method GET_TITLE.
data LV_VALUE type STRING.
if IP_ESCAPED eq ABAP_TRUE.
LV_VALUE = ME->TITLE.
EP_TITLE = ZCL_EXCEL_COMMON=>ESCAPE_STRING( LV_VALUE ).
else.
EP_TITLE = ME->TITLE.
endif.
endmethod.
method GET_VALUE_TYPE.
data: LO_ADDIT type ref to CL_ABAP_ELEMDESCR,
LS_DFIES type DFIES,
L_FUNCTION type FUNCNAME,
L_VALUE(50) type C.
EP_VALUE = IP_VALUE.
EP_VALUE_TYPE = CL_ABAP_TYPEDESCR=>TYPEKIND_STRING. " Thats our default if something goes wrong.
try.
LO_ADDIT ?= CL_ABAP_TYPEDESCR=>DESCRIBE_BY_DATA( IP_VALUE ).
catch CX_SY_MOVE_CAST_ERROR.
clear LO_ADDIT.
endtry.
if LO_ADDIT is bound.
LO_ADDIT->GET_DDIC_FIELD( receiving P_FLDDESCR = LS_DFIES
exceptions NOT_FOUND = 1
NO_DDIC_TYPE = 2
others = 3 ) .
if SY-SUBRC = 0.
EP_VALUE_TYPE = LS_DFIES-INTTYPE.
if LS_DFIES-CONVEXIT is not initial.
* We need to convert with output conversion function
concatenate 'CONVERSION_EXIT_' LS_DFIES-CONVEXIT '_OUTPUT' into L_FUNCTION.
select single FUNCNAME into L_FUNCTION
from TFDIR
where FUNCNAME = L_FUNCTION.
if SY-SUBRC = 0.
call function L_FUNCTION
exporting
INPUT = IP_VALUE
importing
* LONG_TEXT =
OUTPUT = L_VALUE
* SHORT_TEXT =
exceptions
others = 1.
if SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
else.
try.
EP_VALUE = L_VALUE.
catch CX_ROOT.
EP_VALUE = IP_VALUE.
endtry.
endif.
endif.
endif.
else.
EP_VALUE_TYPE = LO_ADDIT->GET_DATA_TYPE_KIND( IP_VALUE ).
endif.
endif.
endmethod.
method IS_CELL_MERGED.
data: LV_COLUMN type I.
field-symbols: <LS_MERGED_CELL> like line of ME->MT_MERGED_CELLS.
LV_COLUMN = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( IP_COLUMN ).
RP_IS_MERGED = ABAP_FALSE. " Assume not in merged area
loop at ME->MT_MERGED_CELLS assigning <LS_MERGED_CELL>.
if <LS_MERGED_CELL>-COL_FROM <= LV_COLUMN
and <LS_MERGED_CELL>-COL_TO >= LV_COLUMN
and <LS_MERGED_CELL>-ROW_FROM <= IP_ROW
and <LS_MERGED_CELL>-ROW_TO >= IP_ROW.
RP_IS_MERGED = ABAP_TRUE. " until we are proven different
return.
endif.
endloop.
endmethod.
method PRINT_TITLE_SET_RANGE.
*--------------------------------------------------------------------*
* issue#235 - repeat rows/columns
* - Stefan Schmoecker, 2012-12-02
*--------------------------------------------------------------------*
data: LO_RANGE_ITERATOR type ref to CL_OBJECT_COLLECTION_ITERATOR,
LO_RANGE type ref to ZCL_EXCEL_RANGE,
LV_REPEAT_RANGE_SHEETNAME type STRING,
LV_REPEAT_RANGE_COL type STRING,
LV_ROW_CHAR_FROM type CHAR10,
LV_ROW_CHAR_TO type CHAR10,
LV_REPEAT_RANGE_ROW type STRING,
LV_REPEAT_RANGE type STRING.
*--------------------------------------------------------------------*
* Get range that represents printarea
* if non-existant, create it
*--------------------------------------------------------------------*
LO_RANGE_ITERATOR = ME->GET_RANGES_ITERATOR( ).
while LO_RANGE_ITERATOR->HAS_NEXT( ) = ABAP_TRUE.
LO_RANGE ?= LO_RANGE_ITERATOR->GET_NEXT( ).
if LO_RANGE->NAME = ZIF_EXCEL_SHEET_PRINTSETTINGS=>GCV_PRINT_TITLE_NAME.
exit. " Found it
endif.
clear LO_RANGE.
endwhile.
if ME->PRINT_TITLE_COL_FROM is initial and
ME->PRINT_TITLE_ROW_FROM is initial.
*--------------------------------------------------------------------*
* No print titles are present,
*--------------------------------------------------------------------*
if LO_RANGE is bound.
ME->RANGES->REMOVE( LO_RANGE ).
endif.
else.
*--------------------------------------------------------------------*
* Print titles are present,
*--------------------------------------------------------------------*
if LO_RANGE is not bound.
LO_RANGE = ME->ADD_NEW_RANGE( ).
LO_RANGE->NAME = ZIF_EXCEL_SHEET_PRINTSETTINGS=>GCV_PRINT_TITLE_NAME.
endif.
LV_REPEAT_RANGE_SHEETNAME = ME->GET_TITLE( ).
LV_REPEAT_RANGE_SHEETNAME = ZCL_EXCEL_COMMON=>ESCAPE_STRING( LV_REPEAT_RANGE_SHEETNAME ).
*--------------------------------------------------------------------*
* Repeat-columns
*--------------------------------------------------------------------*
if ME->PRINT_TITLE_COL_FROM is not initial.
concatenate LV_REPEAT_RANGE_SHEETNAME
'!$' ME->PRINT_TITLE_COL_FROM
':$' ME->PRINT_TITLE_COL_TO
into LV_REPEAT_RANGE_COL.
endif.
*--------------------------------------------------------------------*
* Repeat-rows
*--------------------------------------------------------------------*
if ME->PRINT_TITLE_ROW_FROM is not initial.
LV_ROW_CHAR_FROM = ME->PRINT_TITLE_ROW_FROM.
LV_ROW_CHAR_TO = ME->PRINT_TITLE_ROW_TO.
concatenate '!$' LV_ROW_CHAR_FROM
':$' LV_ROW_CHAR_TO
into LV_REPEAT_RANGE_ROW.
condense LV_REPEAT_RANGE_ROW no-gaps.
concatenate LV_REPEAT_RANGE_SHEETNAME
LV_REPEAT_RANGE_ROW
into LV_REPEAT_RANGE_ROW.
endif.
*--------------------------------------------------------------------*
* Concatenate repeat-rows and columns
*--------------------------------------------------------------------*
if LV_REPEAT_RANGE_COL is initial.
LV_REPEAT_RANGE = LV_REPEAT_RANGE_ROW.
elseif LV_REPEAT_RANGE_ROW is initial.
LV_REPEAT_RANGE = LV_REPEAT_RANGE_COL.
else.
concatenate LV_REPEAT_RANGE_COL LV_REPEAT_RANGE_ROW
into LV_REPEAT_RANGE separated by ','.
endif.
LO_RANGE->SET_RANGE_VALUE( LV_REPEAT_RANGE ).
endif.
endmethod.
METHOD set_area.
DATA: lv_row TYPE zexcel_cell_row,
lv_row_end TYPE zexcel_cell_row,
lv_column_start TYPE zexcel_cell_column_alpha,
lv_column_end TYPE zexcel_cell_column_alpha,
lv_column_start_int TYPE zexcel_cell_column_alpha,
lv_column_end_int TYPE zexcel_cell_column_alpha.
MOVE: ip_row_to TO lv_row_end,
ip_row TO lv_row.
IF lv_row_end IS INITIAL OR ip_row_to IS NOT SUPPLIED.
lv_row_end = lv_row.
ENDIF.
MOVE: ip_column_start TO lv_column_start,
ip_column_end TO lv_column_end.
IF lv_column_end IS INITIAL OR ip_column_end IS NOT SUPPLIED.
lv_column_end = lv_column_start.
ENDIF.
lv_column_start_int = zcl_excel_common=>convert_column2int( lv_column_start ).
lv_column_end_int = zcl_excel_common=>convert_column2int( lv_column_end ).
IF lv_column_start_int > lv_column_end_int OR lv_row > lv_row_end.
RAISE EXCEPTION TYPE zcx_excel
EXPORTING
error = 'Wrong Merging Parameters'.
ENDIF.
IF ip_data_type IS SUPPLIED OR
ip_abap_type IS SUPPLIED.
me->set_cell( ip_column = lv_column_start
ip_row = lv_row
ip_value = ip_value
ip_formula = ip_formula
ip_style = ip_style
ip_hyperlink = ip_hyperlink
ip_data_type = ip_data_type
ip_abap_type = ip_abap_type ).
ELSE.
me->set_cell( ip_column = lv_column_start
ip_row = lv_row
ip_value = ip_value
ip_formula = ip_formula
ip_style = ip_style
ip_hyperlink = ip_hyperlink ).
ENDIF.
IF ip_style IS SUPPLIED.
me->set_area_style( ip_column_start = lv_column_start
ip_column_end = lv_column_end
ip_row = lv_row
ip_row_to = lv_row_end
ip_style = ip_style ).
ENDIF.
IF ip_merge IS SUPPLIED AND ip_merge = abap_true.
me->set_merge( ip_column_start = lv_column_start
ip_column_end = lv_column_end
ip_row = lv_row
ip_row_to = lv_row_end ).
ENDIF.
ENDMETHOD.
METHOD set_area_formula.
DATA: ld_row TYPE zexcel_cell_row,
ld_row_end TYPE zexcel_cell_row,
ld_column TYPE zexcel_cell_column_alpha,
ld_column_end TYPE zexcel_cell_column_alpha,
ld_column_int TYPE zexcel_cell_column_alpha,
ld_column_end_int TYPE zexcel_cell_column_alpha.
MOVE: ip_row_to TO ld_row_end,
ip_row TO ld_row.
IF ld_row_end IS INITIAL or ip_row_to is not supplied.
ld_row_end = ld_row.
ENDIF.
MOVE: ip_column_start TO ld_column,
ip_column_end TO ld_column_end.
if ld_column_end is initial or ip_column_end is not supplied.
ld_column_end = ld_column.
endif.
ld_column_int = zcl_excel_common=>convert_column2int( ld_column ).
ld_column_end_int = zcl_excel_common=>convert_column2int( ld_column_end ).
if ld_column_int > ld_column_end_int or ld_row > ld_row_end.
RAISE EXCEPTION TYPE zcx_excel
EXPORTING
error = 'Wrong Merging Parameters'.
endif.
me->set_cell_formula( ip_column = ld_column ip_row = ld_row
ip_formula = ip_formula ).
IF ip_merge IS SUPPLIED AND ip_merge = abap_true.
me->set_merge( ip_column_start = ld_column ip_row = ld_row
ip_column_end = ld_column_end ip_row_to = ld_row_end ).
ENDIF.
ENDMETHOD.
METHOD SET_AREA_STYLE.
DATA: ld_row_start TYPE zexcel_cell_row,
ld_row_end TYPE zexcel_cell_row,
ld_column_start_int TYPE zexcel_cell_column,
ld_column_end_int TYPE zexcel_cell_column,
ld_current_column TYPE zexcel_cell_column_alpha,
ld_current_row TYPE zexcel_cell_row.
MOVE: ip_row_to TO ld_row_end,
ip_row TO ld_row_start.
IF ld_row_end IS INITIAL or ip_row_to is not supplied.
ld_row_end = ld_row_start.
ENDIF.
ld_column_start_int = zcl_excel_common=>convert_column2int( ip_column_start ).
ld_column_end_int = zcl_excel_common=>convert_column2int( ip_column_end ).
IF ld_column_end_int IS INITIAL or ip_column_end is not supplied.
ld_column_end_int = ld_column_start_int.
ENDIF.
WHILE ld_column_start_int <= ld_column_end_int.
ld_current_column = zcl_excel_common=>convert_column2alpha( ld_column_start_int ).
ld_current_row = ld_row_start.
WHILE ld_current_row <= ld_row_end.
me->set_cell_style( ip_row = ld_current_row ip_column = ld_current_column
ip_style = ip_style ).
ADD 1 TO ld_current_row.
ENDWHILE.
ADD 1 TO ld_column_start_int.
ENDWHILE.
IF ip_merge IS SUPPLIED AND ip_merge = abap_true.
me->set_merge( ip_column_start = ip_column_start ip_row = ld_row_start
ip_column_end = ld_current_column ip_row_to = ld_row_end ).
ENDIF.
ENDMETHOD.
method SET_CELL.
data: LV_COLUMN type ZEXCEL_CELL_COLUMN,
LS_SHEET_CONTENT type ZEXCEL_S_CELL_DATA,
LV_ROW_ALPHA type STRING,
LV_COL_ALPHA type ZEXCEL_CELL_COLUMN_ALPHA,
LV_VALUE type ZEXCEL_CELL_VALUE,
LV_DATA_TYPE type ZEXCEL_CELL_DATA_TYPE,
LV_VALUE_TYPE type ABAP_TYPEKIND,
LV_STYLE_GUID type ZEXCEL_CELL_STYLE,
LO_ADDIT type ref to CL_ABAP_ELEMDESCR,
LO_VALUE type ref to DATA,
LO_VALUE_NEW type ref to DATA.
field-symbols: <FS_SHEET_CONTENT> type ZEXCEL_S_CELL_DATA,
<FS_NUMERIC> type NUMERIC,
<FS_DATE> type D,
<FS_TIME> type T,
<FS_VALUE> type SIMPLE.
if IP_VALUE is not supplied and IP_FORMULA is not supplied.
zcx_excel=>raise_text( 'Please provide the value or formula' ).
endif.
* Begin of change issue #152 - don't touch exisiting style if only value is passed
* lv_style_guid = ip_style.
LV_COLUMN = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( IP_COLUMN ).
read table SHEET_CONTENT assigning <FS_SHEET_CONTENT> with table key CELL_ROW = IP_ROW " Changed to access via table key , Stefan Schmöcker, 2013-08-03
CELL_COLUMN = LV_COLUMN.
if SY-SUBRC = 0.
if IP_STYLE is initial.
" If no style is provided as method-parameter and cell is found use cell's current style
LV_STYLE_GUID = <FS_SHEET_CONTENT>-CELL_STYLE.
else.
" Style provided as method-parameter --> use this
LV_STYLE_GUID = IP_STYLE.
endif.
else.
" No cell found --> use supplied style even if empty
LV_STYLE_GUID = IP_STYLE.
endif.
* End of change issue #152 - don't touch exisiting style if only value is passed
if IP_VALUE is supplied.
"if data type is passed just write the value. Otherwise map abap type to excel and perform conversion
"IP_DATA_TYPE is passed by excel reader so source types are preserved
*First we get reference into local var.
create data LO_VALUE like IP_VALUE.
assign LO_VALUE->* to <FS_VALUE>.
<FS_VALUE> = IP_VALUE.
if IP_DATA_TYPE is supplied.
if IP_ABAP_TYPE is not supplied.
GET_VALUE_TYPE( exporting IP_VALUE = IP_VALUE
importing EP_VALUE = <FS_VALUE> ) .
endif.
LV_VALUE = <FS_VALUE>.
LV_DATA_TYPE = IP_DATA_TYPE.
else.
if IP_ABAP_TYPE is supplied.
LV_VALUE_TYPE = IP_ABAP_TYPE.
else.
GET_VALUE_TYPE( exporting IP_VALUE = IP_VALUE
importing EP_VALUE = <FS_VALUE>
EP_VALUE_TYPE = LV_VALUE_TYPE ).
endif.
case LV_VALUE_TYPE.
when CL_ABAP_TYPEDESCR=>TYPEKIND_INT or CL_ABAP_TYPEDESCR=>TYPEKIND_INT1 or CL_ABAP_TYPEDESCR=>TYPEKIND_INT2.
LO_ADDIT = CL_ABAP_ELEMDESCR=>GET_I( ).
create data LO_VALUE_NEW type handle LO_ADDIT.
assign LO_VALUE_NEW->* to <FS_NUMERIC>.
if SY-SUBRC = 0.
<FS_NUMERIC> = <FS_VALUE>.
LV_VALUE = ZCL_EXCEL_COMMON=>NUMBER_TO_EXCEL_STRING( IP_VALUE = <FS_NUMERIC> ).
endif.
when CL_ABAP_TYPEDESCR=>TYPEKIND_FLOAT or CL_ABAP_TYPEDESCR=>TYPEKIND_PACKED.
LO_ADDIT = CL_ABAP_ELEMDESCR=>GET_F( ).
create data LO_VALUE_NEW type handle LO_ADDIT.
assign LO_VALUE_NEW->* to <FS_NUMERIC>.
if SY-SUBRC = 0.
<FS_NUMERIC> = <FS_VALUE>.
LV_VALUE = ZCL_EXCEL_COMMON=>NUMBER_TO_EXCEL_STRING( IP_VALUE = <FS_NUMERIC> ).
endif.
when CL_ABAP_TYPEDESCR=>TYPEKIND_CHAR or CL_ABAP_TYPEDESCR=>TYPEKIND_STRING or CL_ABAP_TYPEDESCR=>TYPEKIND_NUM or
CL_ABAP_TYPEDESCR=>TYPEKIND_HEX.
LV_VALUE = <FS_VALUE>.
LV_DATA_TYPE = 's'.
when CL_ABAP_TYPEDESCR=>TYPEKIND_DATE.
LO_ADDIT = CL_ABAP_ELEMDESCR=>GET_D( ).
create data LO_VALUE_NEW type handle LO_ADDIT.
assign LO_VALUE_NEW->* to <FS_DATE>.
if SY-SUBRC = 0.
<FS_DATE> = <FS_VALUE>.
LV_VALUE = ZCL_EXCEL_COMMON=>DATE_TO_EXCEL_STRING( IP_VALUE = <FS_DATE> ) .
endif.
* Begin of change issue #152 - don't touch exisiting style if only value is passed
* Moved to end of routine - apply date-format even if other styleinformation is passed
* IF ip_style IS NOT SUPPLIED. "get default date format in case parameter is initial
* lo_style = excel->add_new_style( ).
* lo_style->number_format->format_code = get_default_excel_date_format( ).
* lv_style_guid = lo_style->get_guid( ).
* ENDIF.
* End of change issue #152 - don't touch exisiting style if only value is passed
when CL_ABAP_TYPEDESCR=>TYPEKIND_TIME.
LO_ADDIT = CL_ABAP_ELEMDESCR=>GET_T( ).
create data LO_VALUE_NEW type handle LO_ADDIT.
assign LO_VALUE_NEW->* to <FS_TIME>.
if SY-SUBRC = 0.
<FS_TIME> = <FS_VALUE>.
LV_VALUE = ZCL_EXCEL_COMMON=>TIME_TO_EXCEL_STRING( IP_VALUE = <FS_TIME> ).
endif.
* Begin of change issue #152 - don't touch exisiting style if only value is passed
* Moved to end of routine - apply time-format even if other styleinformation is passed
* IF ip_style IS NOT SUPPLIED. "get default time format for user in case parameter is initial
* lo_style = excel->add_new_style( ).
* lo_style->number_format->format_code = zcl_excel_style_number_format=>c_format_date_time6.
* lv_style_guid = lo_style->get_guid( ).
* ENDIF.
* End of change issue #152 - don't touch exisiting style if only value is passed
when others.
zcx_excel=>raise_text( 'Invalid data type of input value' ).
endcase.
endif.
endif.
if IP_HYPERLINK is bound.
IP_HYPERLINK->SET_CELL_REFERENCE( IP_COLUMN = IP_COLUMN
IP_ROW = IP_ROW ).
ME->HYPERLINKS->ADD( IP_HYPERLINK ).
endif.
* Begin of change issue #152 - don't touch exisiting style if only value is passed
* Read table moved up, so that current style may be evaluated
* lv_column = zcl_excel_common=>convert_column2int( ip_column ).
* READ TABLE sheet_content ASSIGNING <fs_sheet_content> WITH KEY cell_row = ip_row
* cell_column = lv_column.
*
* IF sy-subrc EQ 0.
if <FS_SHEET_CONTENT> is assigned.
* End of change issue #152 - don't touch exisiting style if only value is passed
<FS_SHEET_CONTENT>-CELL_VALUE = LV_VALUE.
<FS_SHEET_CONTENT>-CELL_FORMULA = IP_FORMULA.
<FS_SHEET_CONTENT>-CELL_STYLE = LV_STYLE_GUID.
<FS_SHEET_CONTENT>-DATA_TYPE = LV_DATA_TYPE.
else.
LS_SHEET_CONTENT-CELL_ROW = IP_ROW.
LS_SHEET_CONTENT-CELL_COLUMN = LV_COLUMN.
LS_SHEET_CONTENT-CELL_VALUE = LV_VALUE.
LS_SHEET_CONTENT-CELL_FORMULA = IP_FORMULA.
LS_SHEET_CONTENT-CELL_STYLE = LV_STYLE_GUID.
LS_SHEET_CONTENT-DATA_TYPE = LV_DATA_TYPE.
LV_ROW_ALPHA = IP_ROW.
* SHIFT lv_row_alpha RIGHT DELETING TRAILING space."del #152 - replaced with condense - should be faster
* SHIFT lv_row_alpha LEFT DELETING LEADING space. "del #152 - replaced with condense - should be faster
condense LV_ROW_ALPHA no-gaps. "ins #152 - replaced 2 shifts - should be faster
LV_COL_ALPHA = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2ALPHA( IP_COLUMN ). " issue #155 - less restrictive typing for ip_column
concatenate LV_COL_ALPHA LV_ROW_ALPHA into LS_SHEET_CONTENT-CELL_COORDS. " issue #155 - less restrictive typing for ip_column
insert LS_SHEET_CONTENT into table SHEET_CONTENT assigning <FS_SHEET_CONTENT>. "ins #152 - Now <fs_sheet_content> always holds the data
* APPEND ls_sheet_content TO sheet_content.
* SORT sheet_content BY cell_row cell_column.
" me->update_dimension_range( ).
endif.
* Begin of change issue #152 - don't touch exisiting style if only value is passed
* For Date- or Timefields change the formatcode if nothing is set yet
* Enhancement option: Check if existing formatcode is a date/ or timeformat
* If not, use default
data: LO_FORMAT_CODE_DATETIME type ZEXCEL_NUMBER_FORMAT.
data: STYLEMAPPING type ZEXCEL_S_STYLEMAPPING.
case LV_VALUE_TYPE.
when CL_ABAP_TYPEDESCR=>TYPEKIND_DATE.
try.
STYLEMAPPING = ME->EXCEL->GET_STYLE_TO_GUID( <FS_SHEET_CONTENT>-CELL_STYLE ).
catch ZCX_EXCEL .
endtry.
if STYLEMAPPING-COMPLETE_STYLEX-NUMBER_FORMAT-FORMAT_CODE is initial or
STYLEMAPPING-COMPLETE_STYLE-NUMBER_FORMAT-FORMAT_CODE is initial.
LO_FORMAT_CODE_DATETIME = ZCL_EXCEL_STYLE_NUMBER_FORMAT=>C_FORMAT_DATE_STD.
else.
LO_FORMAT_CODE_DATETIME = STYLEMAPPING-COMPLETE_STYLE-NUMBER_FORMAT-FORMAT_CODE.
endif.
ME->CHANGE_CELL_STYLE( IP_COLUMN = IP_COLUMN
IP_ROW = IP_ROW
IP_NUMBER_FORMAT_FORMAT_CODE = LO_FORMAT_CODE_DATETIME ).
when CL_ABAP_TYPEDESCR=>TYPEKIND_TIME.
try.
STYLEMAPPING = ME->EXCEL->GET_STYLE_TO_GUID( <FS_SHEET_CONTENT>-CELL_STYLE ).
catch ZCX_EXCEL .
endtry.
if STYLEMAPPING-COMPLETE_STYLEX-NUMBER_FORMAT-FORMAT_CODE is initial or
STYLEMAPPING-COMPLETE_STYLE-NUMBER_FORMAT-FORMAT_CODE is initial.
LO_FORMAT_CODE_DATETIME = ZCL_EXCEL_STYLE_NUMBER_FORMAT=>C_FORMAT_DATE_TIME6.
else.
LO_FORMAT_CODE_DATETIME = STYLEMAPPING-COMPLETE_STYLE-NUMBER_FORMAT-FORMAT_CODE.
endif.
ME->CHANGE_CELL_STYLE( IP_COLUMN = IP_COLUMN
IP_ROW = IP_ROW
IP_NUMBER_FORMAT_FORMAT_CODE = LO_FORMAT_CODE_DATETIME ).
endcase.
* End of change issue #152 - don't touch exisiting style if only value is passed
* Fix issue #162
LV_VALUE = IP_VALUE.
if LV_VALUE cs CL_ABAP_CHAR_UTILITIES=>CR_LF.
ME->CHANGE_CELL_STYLE( IP_COLUMN = IP_COLUMN
IP_ROW = IP_ROW
IP_ALIGNMENT_WRAPTEXT = ABAP_TRUE ).
endif.
* End of Fix issue #162
endmethod.
method SET_CELL_FORMULA.
data:
LV_COLUMN type ZEXCEL_CELL_COLUMN,
LS_SHEET_CONTENT like line of ME->SHEET_CONTENT.
field-symbols:
<SHEET_CONTENT> like line of ME->SHEET_CONTENT.
*--------------------------------------------------------------------*
* Get cell to set formula into
*--------------------------------------------------------------------*
LV_COLUMN = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( IP_COLUMN ).
read table ME->SHEET_CONTENT assigning <SHEET_CONTENT> with table key CELL_ROW = IP_ROW
CELL_COLUMN = LV_COLUMN.
if SY-SUBRC <> 0. " Create new entry in sheet_content if necessary
check IP_FORMULA is initial. " no need to create new entry in sheet_content when no formula is passed
LS_SHEET_CONTENT-CELL_ROW = IP_ROW.
LS_SHEET_CONTENT-CELL_COLUMN = LV_COLUMN.
insert LS_SHEET_CONTENT into table ME->SHEET_CONTENT assigning <SHEET_CONTENT>.
endif.
*--------------------------------------------------------------------*
* Fieldsymbol now holds the relevant cell
*--------------------------------------------------------------------*
<SHEET_CONTENT>-CELL_FORMULA = IP_FORMULA.
endmethod.
method SET_CELL_STYLE.
data: LV_COLUMN type ZEXCEL_CELL_COLUMN,
LV_STYLE_GUID type ZEXCEL_CELL_STYLE.
field-symbols: <FS_SHEET_CONTENT> type ZEXCEL_S_CELL_DATA.
LV_STYLE_GUID = IP_STYLE.
LV_COLUMN = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( IP_COLUMN ).
read table SHEET_CONTENT assigning <FS_SHEET_CONTENT> with key CELL_ROW = IP_ROW
CELL_COLUMN = LV_COLUMN.
if SY-SUBRC eq 0.
<FS_SHEET_CONTENT>-CELL_STYLE = LV_STYLE_GUID.
else.
SET_CELL( IP_COLUMN = IP_COLUMN IP_ROW = IP_ROW IP_VALUE = '' IP_STYLE = IP_STYLE ).
endif.
endmethod.
method SET_COLUMN_WIDTH.
data: LO_COLUMN type ref to ZCL_EXCEL_COLUMN.
data: WIDTH type FLOAT.
LO_COLUMN = ME->GET_COLUMN( IP_COLUMN ).
* if a fix size is supplied use this
if IP_WIDTH_FIX is supplied.
try.
WIDTH = IP_WIDTH_FIX.
if WIDTH <= 0.
zcx_excel=>raise_text( 'Please supply a positive number as column-width' ).
endif.
LO_COLUMN->SET_WIDTH( WIDTH ).
exit.
catch CX_SY_CONVERSION_NO_NUMBER.
* Strange stuff passed --> raise error
zcx_excel=>raise_text( 'Unable to interpret supplied input as number' ).
endtry.
endif.
* If we get down to here, we have to use whatever is found in autosize.
LO_COLUMN->SET_AUTO_SIZE( IP_WIDTH_AUTOSIZE ).
endmethod.
method SET_DEFAULT_EXCEL_DATE_FORMAT.
if IP_DEFAULT_EXCEL_DATE_FORMAT is initial.
zcx_excel=>raise_text( 'Default date format cannot be blank' ).
endif.
DEFAULT_EXCEL_DATE_FORMAT = IP_DEFAULT_EXCEL_DATE_FORMAT.
endmethod.
method SET_MERGE.
data: LS_MERGE type MTY_MERGE,
LV_ERRORMESSAGE type STRING.
...
"just after variables definition
if ip_value is supplied or ip_formula is supplied.
" if there is a value or formula set the value to the top-left cell
"maybe it is necessary to support other paramters for set_cell
if ip_value is supplied.
me->set_cell( ip_row = ip_row ip_column = ip_column_start
ip_value = ip_value ).
endif.
if ip_formula is supplied.
me->set_cell( ip_row = ip_row ip_column = ip_column_start
ip_value = ip_formula ).
endif.
endif.
"call to set_merge_style to apply the style to all cells at the matrix
IF ip_style IS SUPPLIED.
me->set_merge_style( ip_row = ip_row ip_column_start = ip_column_start
ip_row_to = ip_row_to ip_column_end = ip_column_end
ip_style = ip_style ).
ENDIF.
...
*--------------------------------------------------------------------*
* Build new range area to insert into range table
*--------------------------------------------------------------------*
LS_MERGE-ROW_FROM = IP_ROW.
if IP_ROW is supplied and IP_ROW is not initial and IP_ROW_TO is not supplied.
LS_MERGE-ROW_TO = LS_MERGE-ROW_FROM.
else.
LS_MERGE-ROW_TO = IP_ROW_TO.
endif.
if LS_MERGE-ROW_FROM > LS_MERGE-ROW_TO.
LV_ERRORMESSAGE = 'Merge: First row larger then last row'(405).
zcx_excel=>raise_text( lv_errormessage ).
endif.
LS_MERGE-COL_FROM = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( IP_COLUMN_START ).
if IP_COLUMN_START is supplied and IP_COLUMN_START is not initial and IP_COLUMN_END is not supplied.
LS_MERGE-COL_TO = LS_MERGE-COL_FROM.
else.
LS_MERGE-COL_TO = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( IP_COLUMN_END ).
endif.
if LS_MERGE-COL_FROM > LS_MERGE-COL_TO.
LV_ERRORMESSAGE = 'Merge: First column larger then last column'(406).
zcx_excel=>raise_text( lv_errormessage ).
endif.
*--------------------------------------------------------------------*
* Check merge not overlapping with existing merges
*--------------------------------------------------------------------*
loop at ME->MT_MERGED_CELLS transporting no fields where not ( ROW_FROM > LS_MERGE-ROW_TO
or ROW_TO < LS_MERGE-ROW_FROM
or COL_FROM > LS_MERGE-COL_TO
or COL_TO < LS_MERGE-COL_FROM ).
LV_ERRORMESSAGE = 'Overlapping merges'(404).
zcx_excel=>raise_text( lv_errormessage ).
endloop.
*--------------------------------------------------------------------*
* Everything seems ok --> add to merge table
*--------------------------------------------------------------------*
insert LS_MERGE into table ME->MT_MERGED_CELLS.
endmethod.
METHOD set_merge_style.
DATA: ld_row_start TYPE zexcel_cell_row,
ld_row_end TYPE zexcel_cell_row,
ld_column_start TYPE zexcel_cell_column,
ld_column_end TYPE zexcel_cell_column,
ld_current_column TYPE zexcel_cell_column_alpha,
ld_current_row type zexcel_cell_row.
MOVE: ip_row_to TO ld_row_end,
ip_row TO ld_row_start.
IF ld_row_end IS INITIAL.
ld_row_end = ld_row_start.
ENDIF.
ld_column_start = zcl_excel_common=>convert_column2int( ip_column_start ).
ld_column_end = zcl_excel_common=>convert_column2int( ip_column_end ).
IF ld_column_end IS INITIAL.
ld_column_end = ld_column_start.
ENDIF.
"set the style cell by cell
WHILE ld_column_start <= ld_column_end.
ld_current_column = zcl_excel_common=>convert_column2alpha( ld_column_start ).
ld_current_row = ld_row_start.
WHILE ld_current_row <= ld_row_end.
me->set_cell_style( ip_row = ld_current_row ip_column = ld_current_column
ip_style = ip_style ).
add 1 to ld_current_row.
ENDWHILE.
ADD 1 TO ld_column_start.
ENDWHILE.
ENDMETHOD.
method SET_PRINT_GRIDLINES.
ME->PRINT_GRIDLINES = I_PRINT_GRIDLINES.
endmethod.
method SET_ROW_HEIGHT.
data: LO_ROW type ref to ZCL_EXCEL_ROW.
data: HEIGHT type FLOAT.
LO_ROW = ME->GET_ROW( IP_ROW ).
* if a fix size is supplied use this
try.
HEIGHT = IP_HEIGHT_FIX.
if HEIGHT <= 0.
zcx_excel=>raise_text( 'Please supply a positive number as row-height' ).
endif.
LO_ROW->SET_ROW_HEIGHT( HEIGHT ).
exit.
catch CX_SY_CONVERSION_NO_NUMBER.
* Strange stuff passed --> raise error
zcx_excel=>raise_text( 'Unable to interpret supplied input as number' ).
endtry.
endmethod.
method SET_ROW_OUTLINE.
data: LS_ROW_OUTLINE like line of ME->MT_ROW_OUTLINES.
field-symbols: <LS_ROW_OUTLINE> like line of ME->MT_ROW_OUTLINES.
read table ME->MT_ROW_OUTLINES assigning <LS_ROW_OUTLINE> with table key ROW_FROM = IV_ROW_FROM
ROW_TO = IV_ROW_TO.
if SY-SUBRC <> 0.
if IV_ROW_FROM <= 0.
zcx_excel=>raise_text( 'First row of outline must be a positive number' ).
endif.
if IV_ROW_TO < IV_ROW_FROM.
zcx_excel=>raise_text( 'Last row of outline may not be less than first line of outline' ).
endif.
LS_ROW_OUTLINE-ROW_FROM = IV_ROW_FROM.
LS_ROW_OUTLINE-ROW_TO = IV_ROW_TO.
insert LS_ROW_OUTLINE into table ME->MT_ROW_OUTLINES assigning <LS_ROW_OUTLINE>.
endif.
case IV_COLLAPSED.
when ABAP_TRUE
or ABAP_FALSE.
<LS_ROW_OUTLINE>-COLLAPSED = IV_COLLAPSED.
when others.
zcx_excel=>raise_text( 'Unknown collapse state' ).
endcase.
endmethod.
method SET_SHOW_GRIDLINES.
ME->SHOW_GRIDLINES = I_SHOW_GRIDLINES.
endmethod.
method SET_SHOW_ROWCOLHEADERS.
ME->SHOW_ROWCOLHEADERS = I_SHOW_ROWCOLHEADERS.
endmethod.
method SET_TABCOLOR.
ME->TABCOLOR = IV_TABCOLOR.
endmethod.
method SET_TABLE.
data: LO_TABDESCR type ref to CL_ABAP_STRUCTDESCR,
LR_DATA type ref to DATA,
LS_HEADER type X030L,
LT_DFIES type DDFIELDS,
LV_ROW_INT type ZEXCEL_CELL_ROW,
LV_COLUMN_INT type ZEXCEL_CELL_COLUMN,
LV_COLUMN_ALPHA type ZEXCEL_CELL_COLUMN_ALPHA,
LV_CELL_VALUE type ZEXCEL_CELL_VALUE.
field-symbols: <FS_TABLE_LINE> type ANY,
<FS_FLDVAL> type ANY,
<FS_DFIES> type DFIES.
LV_COLUMN_INT = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( IP_TOP_LEFT_COLUMN ).
LV_ROW_INT = IP_TOP_LEFT_ROW.
create data LR_DATA like line of IP_TABLE.
LO_TABDESCR ?= CL_ABAP_STRUCTDESCR=>DESCRIBE_BY_DATA_REF( LR_DATA ).
LS_HEADER = LO_TABDESCR->GET_DDIC_HEADER( ).
LT_DFIES = LO_TABDESCR->GET_DDIC_FIELD_LIST( ).
* It is better to loop column by column
loop at LT_DFIES assigning <FS_DFIES>.
LV_COLUMN_ALPHA = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2ALPHA( LV_COLUMN_INT ).
if IP_NO_HEADER = ABAP_FALSE.
" First of all write column header
LV_CELL_VALUE = <FS_DFIES>-SCRTEXT_M.
ME->SET_CELL( IP_COLUMN = LV_COLUMN_ALPHA
IP_ROW = LV_ROW_INT
IP_VALUE = LV_CELL_VALUE
IP_STYLE = IP_HDR_STYLE ).
if IP_TRANSPOSE = ABAP_TRUE.
add 1 to LV_COLUMN_INT.
else.
add 1 to LV_ROW_INT.
endif.
endif.
loop at IP_TABLE assigning <FS_TABLE_LINE>.
LV_COLUMN_ALPHA = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2ALPHA( LV_COLUMN_INT ).
assign component <FS_DFIES>-FIELDNAME of structure <FS_TABLE_LINE> to <FS_FLDVAL>.
move <FS_FLDVAL> to LV_CELL_VALUE.
ME->SET_CELL( IP_COLUMN = LV_COLUMN_ALPHA
IP_ROW = LV_ROW_INT
IP_VALUE = <FS_FLDVAL> "lv_cell_value
IP_STYLE = IP_BODY_STYLE ).
if IP_TRANSPOSE = ABAP_TRUE.
add 1 to LV_COLUMN_INT.
else.
add 1 to LV_ROW_INT.
endif.
endloop.
if IP_TRANSPOSE = ABAP_TRUE.
LV_COLUMN_INT = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( IP_TOP_LEFT_COLUMN ).
add 1 to LV_ROW_INT.
else.
LV_ROW_INT = IP_TOP_LEFT_ROW.
add 1 to LV_COLUMN_INT.
endif.
endloop.
endmethod.
method SET_TITLE.
*--------------------------------------------------------------------*
* ToDos:
* 2do §1 The current coding for replacing a named ranges name
* after renaming a sheet should be checked if it is
* really working if sheetname should be escaped
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (wip ) 2012-12-08
* - ...
* changes: aligning code
* message made to support multilinguality
*--------------------------------------------------------------------*
* issue#243 - ' is not allowed as first character in sheet title
* - Stefan Schmoecker, 2012-12-02
* changes: added additional check for ' as first character
*--------------------------------------------------------------------*
data: LO_WORKSHEETS_ITERATOR type ref to CL_OBJECT_COLLECTION_ITERATOR,
LO_WORKSHEET type ref to ZCL_EXCEL_WORKSHEET,
ERRORMESSAGE type STRING,
LV_RANGESHEETNAME_OLD type STRING,
LV_RANGESHEETNAME_NEW type STRING,
LO_RANGES_ITERATOR type ref to CL_OBJECT_COLLECTION_ITERATOR,
LO_RANGE type ref to ZCL_EXCEL_RANGE,
LV_RANGE_VALUE type ZEXCEL_RANGE_VALUE,
LV_ERRORMESSAGE type STRING. " Can't pass '...'(abc) to exception-class
*--------------------------------------------------------------------*
* Check whether title consists only of allowed characters
* Illegal characters are: / \ [ ] * ? : --> http://msdn.microsoft.com/en-us/library/ff837411.aspx
* Illegal characters not in documentation: ' as first character
*--------------------------------------------------------------------*
if IP_TITLE ca '/\[]*?:'.
LV_ERRORMESSAGE = 'Found illegal character in sheetname. List of forbidden characters: /\[]*?:'(402).
zcx_excel=>raise_text( lv_errormessage ).
endif.
if IP_TITLE is not initial and IP_TITLE(1) = `'`.
LV_ERRORMESSAGE = 'Sheetname may not start with &'(403). " & used instead of ' to allow fallbacklanguage
replace '&' in LV_ERRORMESSAGE with `'`.
zcx_excel=>raise_text( lv_errormessage ).
endif.
*--------------------------------------------------------------------*
* Check whether title is unique in workbook
*--------------------------------------------------------------------*
LO_WORKSHEETS_ITERATOR = ME->EXCEL->GET_WORKSHEETS_ITERATOR( ).
while LO_WORKSHEETS_ITERATOR->HAS_NEXT( ) = 'X'.
LO_WORKSHEET ?= LO_WORKSHEETS_ITERATOR->GET_NEXT( ).
check ME->GUID <> LO_WORKSHEET->GET_GUID( ). " Don't check against itself
if IP_TITLE = LO_WORKSHEET->GET_TITLE( ). " Not unique --> raise exception
ERRORMESSAGE = 'Duplicate sheetname &'.
replace '&' in ERRORMESSAGE with IP_TITLE.
zcx_excel=>raise_text( errormessage ).
endif.
endwhile.
*--------------------------------------------------------------------*
* Remember old sheetname and rename sheet to desired name
*--------------------------------------------------------------------*
concatenate ME->TITLE '!' into LV_RANGESHEETNAME_OLD.
ME->TITLE = IP_TITLE.
*--------------------------------------------------------------------*
* After changing this worksheet's title we have to adjust
* all ranges that are referring to this worksheet.
*--------------------------------------------------------------------*
* 2do §1 - Check if the following quickfix is solid
* I fear it isn't - but this implementation is better then
* nothing at all since it handles a supposed majority of cases
*--------------------------------------------------------------------*
concatenate ME->TITLE '!' into LV_RANGESHEETNAME_NEW.
LO_RANGES_ITERATOR = ME->EXCEL->GET_RANGES_ITERATOR( ).
while LO_RANGES_ITERATOR->HAS_NEXT( ) = 'X'.
LO_RANGE ?= LO_RANGES_ITERATOR->GET_NEXT( ).
LV_RANGE_VALUE = LO_RANGE->GET_VALUE( ).
replace all occurrences of LV_RANGESHEETNAME_OLD in LV_RANGE_VALUE with LV_RANGESHEETNAME_NEW.
if SY-SUBRC = 0.
LO_RANGE->SET_RANGE_VALUE( LV_RANGE_VALUE ).
endif.
endwhile.
endmethod.
method UPDATE_DIMENSION_RANGE.
data: LS_SHEET_CONTENT type ZEXCEL_S_CELL_DATA,
LV_ROW_ALPHA type STRING,
LV_COLUMN_ALPHA type ZEXCEL_CELL_COLUMN_ALPHA.
check SHEET_CONTENT is not initial.
UPPER_CELL-CELL_ROW = ZCL_EXCEL_COMMON=>C_EXCEL_SHEET_MAX_ROW.
UPPER_CELL-CELL_COLUMN = ZCL_EXCEL_COMMON=>C_EXCEL_SHEET_MAX_COL.
LOWER_CELL-CELL_ROW = ZCL_EXCEL_COMMON=>C_EXCEL_SHEET_MIN_ROW.
LOWER_CELL-CELL_COLUMN = ZCL_EXCEL_COMMON=>C_EXCEL_SHEET_MIN_COL.
loop at SHEET_CONTENT into LS_SHEET_CONTENT.
if UPPER_CELL-CELL_ROW > LS_SHEET_CONTENT-CELL_ROW.
UPPER_CELL-CELL_ROW = LS_SHEET_CONTENT-CELL_ROW.
endif.
if UPPER_CELL-CELL_COLUMN > LS_SHEET_CONTENT-CELL_COLUMN.
UPPER_CELL-CELL_COLUMN = LS_SHEET_CONTENT-CELL_COLUMN.
endif.
if LOWER_CELL-CELL_ROW < LS_SHEET_CONTENT-CELL_ROW.
LOWER_CELL-CELL_ROW = LS_SHEET_CONTENT-CELL_ROW.
endif.
if LOWER_CELL-CELL_COLUMN < LS_SHEET_CONTENT-CELL_COLUMN.
LOWER_CELL-CELL_COLUMN = LS_SHEET_CONTENT-CELL_COLUMN.
endif.
endloop.
LV_ROW_ALPHA = UPPER_CELL-CELL_ROW.
LV_COLUMN_ALPHA = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2ALPHA( UPPER_CELL-CELL_COLUMN ).
shift LV_ROW_ALPHA right deleting trailing SPACE.
shift LV_ROW_ALPHA left deleting leading SPACE.
concatenate LV_COLUMN_ALPHA LV_ROW_ALPHA into UPPER_CELL-CELL_COORDS.
LV_ROW_ALPHA = LOWER_CELL-CELL_ROW.
LV_COLUMN_ALPHA = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2ALPHA( LOWER_CELL-CELL_COLUMN ).
shift LV_ROW_ALPHA right deleting trailing SPACE.
shift LV_ROW_ALPHA left deleting leading SPACE.
concatenate LV_COLUMN_ALPHA LV_ROW_ALPHA into LOWER_CELL-CELL_COORDS.
endmethod.
method ZIF_EXCEL_SHEET_PRINTSETTINGS~CLEAR_PRINT_REPEAT_COLUMNS.
*--------------------------------------------------------------------*
* adjust internal representation
*--------------------------------------------------------------------*
clear: ME->PRINT_TITLE_COL_FROM,
ME->PRINT_TITLE_COL_TO .
*--------------------------------------------------------------------*
* adjust corresponding range
*--------------------------------------------------------------------*
ME->PRINT_TITLE_SET_RANGE( ).
endmethod.
method ZIF_EXCEL_SHEET_PRINTSETTINGS~CLEAR_PRINT_REPEAT_ROWS.
*--------------------------------------------------------------------*
* adjust internal representation
*--------------------------------------------------------------------*
clear: ME->PRINT_TITLE_ROW_FROM,
ME->PRINT_TITLE_ROW_TO .
*--------------------------------------------------------------------*
* adjust corresponding range
*--------------------------------------------------------------------*
ME->PRINT_TITLE_SET_RANGE( ).
endmethod.
method ZIF_EXCEL_SHEET_PRINTSETTINGS~GET_PRINT_REPEAT_COLUMNS.
EV_COLUMNS_FROM = ME->PRINT_TITLE_COL_FROM.
EV_COLUMNS_TO = ME->PRINT_TITLE_COL_TO.
endmethod.
method ZIF_EXCEL_SHEET_PRINTSETTINGS~GET_PRINT_REPEAT_ROWS.
EV_ROWS_FROM = ME->PRINT_TITLE_ROW_FROM.
EV_ROWS_TO = ME->PRINT_TITLE_ROW_TO.
endmethod.
method ZIF_EXCEL_SHEET_PRINTSETTINGS~SET_PRINT_REPEAT_COLUMNS.
*--------------------------------------------------------------------*
* issue#235 - repeat rows/columns
* - Stefan Schmöcker, 2012-12-02
*--------------------------------------------------------------------*
data: LV_COL_FROM_INT type I,
LV_COL_TO_INT type I,
LV_ERRORMESSAGE type STRING.
LV_COL_FROM_INT = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( IV_COLUMNS_FROM ).
LV_COL_TO_INT = ZCL_EXCEL_COMMON=>CONVERT_COLUMN2INT( IV_COLUMNS_TO ).
*--------------------------------------------------------------------*
* Check if valid range is supplied
*--------------------------------------------------------------------*
if LV_COL_FROM_INT < 1.
LV_ERRORMESSAGE = 'Invalid range supplied for print-title repeatable columns'(401).
zcx_excel=>raise_text( lv_errormessage ).
endif.
if LV_COL_FROM_INT > LV_COL_TO_INT.
LV_ERRORMESSAGE = 'Invalid range supplied for print-title repeatable columns'(401).
zcx_excel=>raise_text( lv_errormessage ).
endif.
*--------------------------------------------------------------------*
* adjust internal representation
*--------------------------------------------------------------------*
ME->PRINT_TITLE_COL_FROM = IV_COLUMNS_FROM.
ME->PRINT_TITLE_COL_TO = IV_COLUMNS_TO.
*--------------------------------------------------------------------*
* adjust corresponding range
*--------------------------------------------------------------------*
ME->PRINT_TITLE_SET_RANGE( ).
endmethod.
method ZIF_EXCEL_SHEET_PRINTSETTINGS~SET_PRINT_REPEAT_ROWS.
*--------------------------------------------------------------------*
* issue#235 - repeat rows/columns
* - Stefan Schmöcker, 2012-12-02
*--------------------------------------------------------------------*
data: LV_ERRORMESSAGE type STRING.
*--------------------------------------------------------------------*
* Check if valid range is supplied
*--------------------------------------------------------------------*
if IV_ROWS_FROM < 1.
LV_ERRORMESSAGE = 'Invalid range supplied for print-title repeatable rowumns'(401).
zcx_excel=>raise_text( lv_errormessage ).
endif.
if IV_ROWS_FROM > IV_ROWS_TO.
LV_ERRORMESSAGE = 'Invalid range supplied for print-title repeatable rowumns'(401).
zcx_excel=>raise_text( lv_errormessage ).
endif.
*--------------------------------------------------------------------*
* adjust internal representation
*--------------------------------------------------------------------*
ME->PRINT_TITLE_ROW_FROM = IV_ROWS_FROM.
ME->PRINT_TITLE_ROW_TO = IV_ROWS_TO.
*--------------------------------------------------------------------*
* adjust corresponding range
*--------------------------------------------------------------------*
ME->PRINT_TITLE_SET_RANGE( ).
endmethod.
method ZIF_EXCEL_SHEET_PROPERTIES~GET_STYLE.
if ZIF_EXCEL_SHEET_PROPERTIES~STYLE is not initial.
EP_STYLE = ZIF_EXCEL_SHEET_PROPERTIES~STYLE.
else.
EP_STYLE = ME->EXCEL->GET_DEFAULT_STYLE( ).
endif.
endmethod.
method ZIF_EXCEL_SHEET_PROPERTIES~INITIALIZE.
ZIF_EXCEL_SHEET_PROPERTIES~SHOW_ZEROS = ZIF_EXCEL_SHEET_PROPERTIES=>C_SHOWZERO.
ZIF_EXCEL_SHEET_PROPERTIES~SUMMARYBELOW = ZIF_EXCEL_SHEET_PROPERTIES=>C_BELOW_ON.
ZIF_EXCEL_SHEET_PROPERTIES~SUMMARYRIGHT = ZIF_EXCEL_SHEET_PROPERTIES=>C_RIGHT_ON.
* inizialize zoomscale values
ZIF_EXCEL_SHEET_PROPERTIES~ZOOMSCALE = 100.
ZIF_EXCEL_SHEET_PROPERTIES~ZOOMSCALE_NORMAL = 100.
ZIF_EXCEL_SHEET_PROPERTIES~ZOOMSCALE_PAGELAYOUTVIEW = 100 .
ZIF_EXCEL_SHEET_PROPERTIES~ZOOMSCALE_SHEETLAYOUTVIEW = 100 .
endmethod.
method ZIF_EXCEL_SHEET_PROPERTIES~SET_STYLE.
ZIF_EXCEL_SHEET_PROPERTIES~STYLE = IP_STYLE.
endmethod.
method ZIF_EXCEL_SHEET_PROTECTION~INITIALIZE.
ME->ZIF_EXCEL_SHEET_PROTECTION~PROTECTED = ZIF_EXCEL_SHEET_PROTECTION=>C_UNPROTECTED.
clear ME->ZIF_EXCEL_SHEET_PROTECTION~PASSWORD.
ME->ZIF_EXCEL_SHEET_PROTECTION~AUTO_FILTER = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
ME->ZIF_EXCEL_SHEET_PROTECTION~DELETE_COLUMNS = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
ME->ZIF_EXCEL_SHEET_PROTECTION~DELETE_ROWS = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
ME->ZIF_EXCEL_SHEET_PROTECTION~FORMAT_CELLS = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
ME->ZIF_EXCEL_SHEET_PROTECTION~FORMAT_COLUMNS = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
ME->ZIF_EXCEL_SHEET_PROTECTION~FORMAT_ROWS = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
ME->ZIF_EXCEL_SHEET_PROTECTION~INSERT_COLUMNS = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
ME->ZIF_EXCEL_SHEET_PROTECTION~INSERT_HYPERLINKS = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
ME->ZIF_EXCEL_SHEET_PROTECTION~INSERT_ROWS = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
ME->ZIF_EXCEL_SHEET_PROTECTION~OBJECTS = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
* me->zif_excel_sheet_protection~password = zif_excel_sheet_protection=>c_noactive. "issue #68
ME->ZIF_EXCEL_SHEET_PROTECTION~PIVOT_TABLES = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
ME->ZIF_EXCEL_SHEET_PROTECTION~PROTECTED = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
ME->ZIF_EXCEL_SHEET_PROTECTION~SCENARIOS = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
ME->ZIF_EXCEL_SHEET_PROTECTION~SELECT_LOCKED_CELLS = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
ME->ZIF_EXCEL_SHEET_PROTECTION~SELECT_UNLOCKED_CELLS = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
ME->ZIF_EXCEL_SHEET_PROTECTION~SHEET = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
ME->ZIF_EXCEL_SHEET_PROTECTION~SORT = ZIF_EXCEL_SHEET_PROTECTION=>C_NOACTIVE.
endmethod.
method ZIF_EXCEL_SHEET_VBA_PROJECT~SET_CODENAME.
ME->ZIF_EXCEL_SHEET_VBA_PROJECT~CODENAME = IP_CODENAME.
endmethod.
method ZIF_EXCEL_SHEET_VBA_PROJECT~SET_CODENAME_PR.
ME->ZIF_EXCEL_SHEET_VBA_PROJECT~CODENAME_PR = IP_CODENAME_PR.
endmethod.
ENDCLASS.
| [
4871,
1168,
5097,
62,
6369,
34,
3698,
62,
33249,
9693,
36,
2767,
6770,
198,
220,
1171,
198,
220,
2251,
1171,
764,
628,
220,
1171,
2665,
13,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1168,
5097,
62,
6369,
34,
3698,
62,
33249,
9693,
36,
2767,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
220,
220,
220,
2099,
12,
7742,
82,
9564,
2969,
764,
628,
220,
220,
220,
20314,
1168,
5064,
62,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
4805,
1268,
4694,
2767,
51,
20754,
764,
198,
220,
220,
220,
20314,
1168,
5064,
62,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
4805,
3185,
17395,
11015,
764,
198,
220,
220,
220,
20314,
1168,
5064,
62,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
4805,
2394,
24565,
764,
198,
220,
220,
220,
20314,
1168,
5064,
62,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
53,
4339,
62,
31190,
23680,
764,
628,
220,
220,
220,
3858,
25,
198,
220,
220,
220,
220,
220,
2221,
286,
220,
337,
9936,
62,
50,
62,
12425,
24027,
62,
49,
3913,
11,
198,
220,
220,
220,
220,
220,
220,
220,
371,
3913,
62,
10913,
2662,
220,
2099,
314,
11,
198,
220,
220,
220,
220,
220,
220,
220,
371,
3913,
62,
10468,
220,
220,
220,
2099,
314,
11,
198,
220,
220,
220,
220,
220,
220,
220,
7375,
3069,
44580,
1961,
2099,
9564,
2969,
62,
8202,
3535,
11,
198,
220,
220,
220,
220,
220,
886,
286,
337,
9936,
62,
50,
62,
12425,
24027,
62,
49,
3913,
764,
198,
220,
220,
220,
3858,
25,
198,
220,
220,
220,
220,
220,
337,
9936,
62,
4694,
62,
12425,
34509,
1546,
62,
49,
3913,
2099,
23243,
3084,
286,
337,
9936,
62,
50,
62,
12425,
24027,
62,
49,
3913,
351,
3748,
1994,
371,
3913,
62,
10913,
2662,
371,
3913,
62,
10468,
764,
628,
220,
220,
220,
38491,
327,
62,
40438,
10206,
62,
25154,
5883,
45,
2099,
1168,
6369,
34,
3698,
62,
40438,
10206,
1988,
362,
13,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
38491,
327,
62,
40438,
10206,
62,
45,
11651,
2099,
1168,
6369,
34,
3698,
62,
40438,
10206,
1988,
657,
13,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
38491,
327,
62,
40438,
10206,
62,
49,
3913,
2099,
1168,
6369,
34,
3698,
62,
40438,
10206,
1988,
352,
13,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
1366,
7788,
34,
3698,
2099,
1006,
284,
1168,
5097,
62,
6369,
34,
3698,
1100,
12,
8807,
764,
198,
220,
1366,
4810,
12394,
62,
10761,
2389,
34509,
1546,
2099,
1168,
6369,
34,
3698,
62,
4805,
12394,
62,
10761,
2389,
34509,
1546,
1100,
12,
8807,
1988,
9564,
2969,
62,
37,
23719,
13,
25113,
2943,
5626,
13918,
764,
366,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
198,
220,
220,
220,
1366,
48052,
2767,
62,
37815,
3525,
2099,
1168,
6369,
34,
3698,
62,
51,
62,
5222,
3069,
62,
26947,
764,
198,
220,
220,
220,
1366,
48052,
2767,
62,
28480,
8577,
2099,
1006,
284,
1168,
5097,
62,
6369,
34,
3698,
62,
9693,
36,
2767,
62,
28480,
8577,
764,
198,
220,
220,
1366,
37041,
62,
10761,
2389,
34509,
1546,
2099,
1168,
6369,
34,
3698,
62,
9693,
3913,
62,
10761,
2389,
34509,
1546,
1100,
12,
8807,
1988,
9564,
2969,
62,
5446,
8924,
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,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
198,
220,
220,
220,
1366,
37041,
62,
49,
3913,
25154,
37682,
4877,
2099,
1168,
6369,
34,
3698,
62,
9693,
3913,
62,
10761,
2389,
34509,
1546,
1100,
12,
8807,
1988,
9564,
2969,
62,
5446,
8924,
13,
25113,
2943,
5626,
13918,
764,
366,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
198,
220,
220,
220,
1366,
3563,
56,
28378,
2099,
1168,
6369,
34,
3698,
62,
51,
62,
9693,
36,
2767,
62,
2257,
56,
2538,
764,
198,
220,
220,
220,
1366,
21664,
2749,
3535,
1581,
2099,
1168,
6369,
34,
3698,
62,
50,
62,
5603,
2749,
3535,
1581,
1100,
12,
8807,
764,
628,
220,
5050,
27841,
62,
9858,
10979,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
4061,
62,
9858,
10979,
2099,
1006,
284,
1168,
5097,
62,
6369,
34,
3698,
62,
9858,
10979,
764,
198,
220,
220,
220,
5050,
27841,
62,
35,
20530,
2751,
198,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
5145
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
REPORT zaof_worklist_create.
PARAMETERS: p_des TYPE zaof_worklists-description OBLIGATORY,
p_set TYPE zaof_worklists-object_set OBLIGATORY,
p_chk TYPE zaof_worklists-check_variant OBLIGATORY.
START-OF-SELECTION.
PERFORM run.
FORM run.
DATA: ls_data TYPE zaof_worklists_data.
ls_data-description = p_des.
ls_data-object_set = p_set.
ls_data-check_variant = p_chk.
zcl_aof_worklist=>create( ls_data ).
WRITE: / 'Done'(001).
ENDFORM.
| [
2200,
15490,
1976,
64,
1659,
62,
1818,
4868,
62,
17953,
13,
198,
198,
27082,
2390,
2767,
4877,
25,
279,
62,
8906,
41876,
1976,
64,
1659,
62,
1818,
20713,
12,
11213,
440,
9148,
3528,
1404,
15513,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
62,
2617,
41876,
1976,
64,
1659,
62,
1818,
20713,
12,
15252,
62,
2617,
440,
9148,
3528,
1404,
15513,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
62,
354,
74,
41876,
1976,
64,
1659,
62,
1818,
20713,
12,
9122,
62,
25641,
415,
440,
9148,
3528,
1404,
15513,
13,
198,
198,
2257,
7227,
12,
19238,
12,
46506,
2849,
13,
198,
220,
19878,
21389,
1057,
13,
198,
198,
21389,
1057,
13,
628,
220,
42865,
25,
43979,
62,
7890,
41876,
1976,
64,
1659,
62,
1818,
20713,
62,
7890,
13,
628,
198,
220,
43979,
62,
7890,
12,
11213,
220,
220,
796,
279,
62,
8906,
13,
198,
220,
43979,
62,
7890,
12,
15252,
62,
2617,
220,
220,
220,
796,
279,
62,
2617,
13,
198,
220,
43979,
62,
7890,
12,
9122,
62,
25641,
415,
796,
279,
62,
354,
74,
13,
628,
220,
1976,
565,
62,
64,
1659,
62,
1818,
4868,
14804,
17953,
7,
43979,
62,
7890,
6739,
628,
220,
44423,
25,
1220,
705,
45677,
6,
7,
8298,
737,
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
] |
CLASS ltc_variable DEFINITION INHERITING FROM y_unit_test_base FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PROTECTED SECTION.
METHODS get_cut REDEFINITION.
METHODS get_expected_count REDEFINITION.
METHODS get_code_with_issue REDEFINITION.
METHODS get_code_without_issue REDEFINITION.
METHODS get_code_with_exemption REDEFINITION.
ENDCLASS.
CLASS ltc_variable IMPLEMENTATION.
METHOD get_cut.
result ?= NEW y_check_message_easy_to_find( ).
ENDMETHOD.
METHOD get_expected_count.
result = 4.
ENDMETHOD.
METHOD get_code_with_issue.
result = VALUE #(
( ' REPORT y_example. ' )
( ' START-OF-SELECTION. ' )
( | DATA(message_class) = '00'. | )
( | DATA(message_id) = '002'. | )
( | MESSAGE i002(message_class). | )
( | MESSAGE i002(message_class) WITH 'Enter a valid value'. | )
( | MESSAGE i002(message_class) WITH text-002. | )
( | MESSAGE i002(message_class) WITH sy-uname. | )
).
ENDMETHOD.
METHOD get_code_without_issue.
result = VALUE #(
( ' REPORT y_example. ' )
( ' START-OF-SELECTION. ' )
( | MESSAGE i002(00). | )
( | MESSAGE i002(00) WITH 'Enter a valid value'(002). | )
( | MESSAGE i002(00) WITH 'Enter a valid value'. | )
( | MESSAGE i002(00) WITH text-003. | )
( | MESSAGE i002(00) WITH sy-uname. | )
).
ENDMETHOD.
METHOD get_code_with_exemption.
result = VALUE #(
( ' REPORT y_example. ' )
( ' START-OF-SELECTION. ' )
( | DATA(message_class) = '00'. | )
( | DATA(message_id) = '002'. | )
( | MESSAGE i002(message_class). "#EC MSG_FIND | )
( | MESSAGE i002(message_class) WITH 'Enter a valid value'. "#EC MSG_FIND | )
( | MESSAGE i002(message_class) WITH text-002. "#EC MSG_FIND | )
( | MESSAGE i002(message_class) WITH sy-uname. "#EC MSG_FIND | )
).
ENDMETHOD.
ENDCLASS.
CLASS ltc_id_variable DEFINITION INHERITING FROM y_unit_test_base FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PROTECTED SECTION.
METHODS get_cut REDEFINITION.
METHODS get_code_with_issue REDEFINITION.
METHODS get_code_without_issue REDEFINITION.
METHODS get_code_with_exemption REDEFINITION.
ENDCLASS.
CLASS ltc_id_variable IMPLEMENTATION.
METHOD get_cut.
result ?= NEW y_check_message_easy_to_find( ).
ENDMETHOD.
METHOD get_code_with_issue.
result = VALUE #(
( ' REPORT y_example. ' )
( ' START-OF-SELECTION. ' )
( | DATA(message_class) = '00'. | )
( | DATA(message_id) = '002'. | )
( | MESSAGE ID message_class type 'I' NUMBER message_id. | )
).
ENDMETHOD.
METHOD get_code_without_issue.
result = VALUE #(
( ' REPORT y_example. ' )
( ' START-OF-SELECTION. ' )
( | MESSAGE ID 00 type 'I' NUMBER 002. | )
).
ENDMETHOD.
METHOD get_code_with_exemption.
result = VALUE #(
( ' REPORT y_example. ' )
( ' START-OF-SELECTION. ' )
( | DATA(message_class) = '00'. | )
( | DATA(message_id) = '002'. | )
( | MESSAGE ID message_class type 'I' NUMBER message_id. "#EC MSG_FIND | )
).
ENDMETHOD.
ENDCLASS.
CLASS ltc_hardcoded_id DEFINITION INHERITING FROM y_unit_test_base FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PROTECTED SECTION.
METHODS get_cut REDEFINITION.
METHODS get_code_with_issue REDEFINITION.
METHODS get_code_without_issue REDEFINITION.
METHODS get_code_with_exemption REDEFINITION.
ENDCLASS.
CLASS ltc_hardcoded_id IMPLEMENTATION.
METHOD get_cut.
result ?= NEW y_check_message_easy_to_find( ).
ENDMETHOD.
METHOD get_code_with_issue.
result = VALUE #(
( ' REPORT y_example. ' )
( ' START-OF-SELECTION. ' )
( | MESSAGE ID '00' type 'I' NUMBER '002'. | )
).
ENDMETHOD.
METHOD get_code_without_issue.
result = VALUE #(
( ' REPORT y_example. ' )
( ' START-OF-SELECTION. ' )
( | MESSAGE i002(00). | )
).
ENDMETHOD.
METHOD get_code_with_exemption.
result = VALUE #(
( ' REPORT y_example. ' )
( ' START-OF-SELECTION. ' )
( | MESSAGE ID '00' type 'I' NUMBER '002'. "#EC MSG_FIND | )
).
ENDMETHOD.
ENDCLASS.
CLASS ltc_variable_named_message DEFINITION INHERITING FROM ltc_hardcoded_id FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PROTECTED SECTION.
METHODS get_code_without_issue REDEFINITION.
ENDCLASS.
CLASS ltc_variable_named_message IMPLEMENTATION.
METHOD get_code_without_issue.
result = VALUE #(
( ' REPORT y_example. ' )
( ' START-OF-SELECTION. ' )
( | DATA message TYPE sy-msgid. | )
( | message = '00'. | )
).
ENDMETHOD.
ENDCLASS.
CLASS ltc_object_with_message_class DEFINITION INHERITING FROM ltc_hardcoded_id FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PROTECTED SECTION.
METHODS get_code_without_issue REDEFINITION.
ENDCLASS.
CLASS ltc_object_with_message_class IMPLEMENTATION.
METHOD get_code_without_issue.
result = VALUE #(
( ' REPORT y_example MESSAGE-ID 00. ' )
( ' START-OF-SELECTION. ' )
( ' MESSAGE i002. ' )
).
ENDMETHOD.
ENDCLASS.
CLASS ltc_sy_msgid DEFINITION INHERITING FROM ltc_hardcoded_id FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PROTECTED SECTION.
METHODS get_code_without_issue REDEFINITION.
ENDCLASS.
CLASS ltc_sy_msgid IMPLEMENTATION.
METHOD get_code_without_issue.
result = VALUE #(
( ' REPORT y_example. ' )
( ' START-OF-SELECTION. ' )
( | MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. | )
).
ENDMETHOD.
ENDCLASS.
CLASS ltc_try_catch DEFINITION INHERITING FROM ltc_hardcoded_id FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PROTECTED SECTION.
METHODS get_code_without_issue REDEFINITION.
ENDCLASS.
CLASS ltc_try_catch IMPLEMENTATION.
METHOD get_code_without_issue.
result = VALUE #(
( ' REPORT y_example. ' )
( ' START-OF-SELECTION. ' )
( | TRY. | )
( | DATA(name) = 'codepal'. | )
( | CATCH cx_sy_itab_line_not_found INTO DATA(line_not_found). | )
( | DATA(text) = line_not_found->get_text( ). | )
( | MESSAGE text TYPE 'W'. | )
( | ENDTRY. | )
).
ENDMETHOD.
ENDCLASS.
CLASS ltc_hardcoded_msg DEFINITION INHERITING FROM ltc_hardcoded_id FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PROTECTED SECTION.
METHODS get_code_without_issue REDEFINITION.
ENDCLASS.
CLASS ltc_hardcoded_msg IMPLEMENTATION.
METHOD get_code_without_issue.
result = VALUE #(
( ' REPORT y_example. ' )
( ' START-OF-SELECTION. ' )
( | MESSAGE 'File not found' TYPE 'i'. | )
).
ENDMETHOD.
ENDCLASS.
CLASS ltc_text_elements DEFINITION INHERITING FROM ltc_hardcoded_id FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PROTECTED SECTION.
METHODS get_code_without_issue REDEFINITION.
ENDCLASS.
CLASS ltc_text_elements IMPLEMENTATION.
METHOD get_code_without_issue.
result = VALUE #(
( ' REPORT y_example. ' )
( ' START-OF-SELECTION. ' )
( | MESSAGE TEXT-006 TYPE 'I' DISPLAY LIKE 'S'. | )
).
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
23047,
62,
45286,
5550,
20032,
17941,
3268,
16879,
2043,
2751,
16034,
331,
62,
20850,
62,
9288,
62,
8692,
7473,
43001,
2751,
45698,
42,
49277,
43638,
5805,
7597,
360,
4261,
6234,
6006,
9863,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
8968,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
40319,
62,
9127,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
8189,
62,
4480,
62,
21949,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
8189,
62,
19419,
62,
21949,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
8189,
62,
4480,
62,
1069,
11221,
23848,
36,
20032,
17941,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
23047,
62,
45286,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
651,
62,
8968,
13,
198,
220,
220,
220,
1255,
5633,
28,
12682,
331,
62,
9122,
62,
20500,
62,
38171,
62,
1462,
62,
19796,
7,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
40319,
62,
9127,
13,
198,
220,
220,
220,
1255,
796,
604,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
8189,
62,
4480,
62,
21949,
13,
198,
220,
220,
220,
1255,
796,
26173,
8924,
1303,
7,
198,
220,
220,
220,
220,
220,
357,
705,
39099,
331,
62,
20688,
13,
705,
1267,
198,
220,
220,
220,
220,
220,
357,
705,
33303,
12,
19238,
12,
46506,
2849,
13,
705,
1267,
198,
220,
220,
220,
220,
220,
357,
930,
220,
220,
42865,
7,
20500,
62,
4871,
8,
796,
705,
405,
4458,
930,
1267,
198,
220,
220,
220,
220,
220,
357,
930,
220,
220,
42865,
7,
20500,
62,
312,
8,
796,
705,
21601,
4458,
930,
1267,
628,
220,
220,
220,
220,
220,
357,
930,
220,
220,
337,
1546,
4090,
8264,
1312,
21601,
7,
20500,
62,
4871,
737,
930,
1267,
198,
220,
220,
220,
220,
220,
357,
930,
220,
220,
337,
1546,
4090,
8264,
1312,
21601,
7,
20500,
62,
4871,
8,
13315,
705,
17469,
257,
4938,
1988,
4458,
930,
1267,
198,
220,
220,
220,
220,
220,
357,
930,
220,
220,
337,
1546,
4090,
8264,
1312,
21601,
7,
20500,
62,
4871,
8,
13315,
2420,
12,
21601,
13,
930,
1267,
198,
220,
220,
220,
220,
220,
357,
930,
220,
220,
337,
1546,
4090,
8264,
1312,
21601,
7,
20500,
62,
4871,
8,
13315,
827,
12,
403,
480,
13,
930,
1267,
198,
220,
220,
220,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
8189,
62,
19419,
62,
21949,
13,
198,
220,
220,
220,
1255,
796,
26173,
8924,
1303,
7,
198,
220,
220,
220,
220,
220,
357,
705,
39099,
331,
62,
20688,
13,
705,
1267,
198,
220,
220,
220,
220,
220,
357,
705,
33303,
12,
19238,
12,
46506,
2849,
13,
705,
1267,
198,
220,
220,
220,
220,
220,
357,
930,
220,
220,
337,
1546,
4090,
8264,
1312,
21601,
7,
405,
737,
930,
1267,
198,
220,
220,
220,
220,
220,
357,
930,
220,
220,
337,
1546,
4090,
8264,
1312,
21601,
7,
405,
8,
13315,
705,
17469,
257,
4938,
1988,
6,
7,
21601,
737,
930,
1267,
198,
220,
220,
220,
220,
220,
357,
930,
220,
220,
337,
1546,
4090,
8264,
1312,
21601,
7,
405,
8,
13315,
705,
17469,
257,
4938,
1988,
4458,
930,
1267,
198,
220,
220,
220,
220,
220,
357,
930,
220,
220,
337,
1546,
4090,
8264,
1312,
21601,
7,
405,
8,
13315,
2420,
12,
11245,
13,
930,
1267,
198,
220,
220,
220,
220,
220,
357,
930,
220,
220,
337,
1546,
4090,
8264,
1312,
21601,
7,
405,
8,
13315,
827,
12,
403,
480,
13,
930,
1267,
198,
220,
220,
220,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
8189,
62,
4480,
62,
1069,
11221,
13,
198,
220,
220,
220,
1255,
796,
26173,
8924,
1303,
7,
198,
220,
220,
220,
220,
220,
357,
705,
39099,
331,
62,
20688,
13,
705,
1267,
198,
220,
220,
220,
220,
220,
357,
705,
33303,
12,
19238,
12,
46506,
2849,
13,
705,
1267,
198,
220,
220,
220,
220,
220,
357,
930,
220,
220,
42865,
7,
20500,
62,
4871,
8,
796,
705,
405,
4458,
930,
1267,
198,
220,
220,
220,
220,
220,
357,
930,
220,
220,
42865,
7,
20500,
62,
312,
8,
796,
705,
21601,
4458,
930,
1267,
628,
220,
220,
220,
220,
220,
357,
930,
220,
220,
337,
1546,
4090,
8264,
1312,
21601,
7,
20500,
62,
4871,
737,
25113,
2943,
49064,
62,
37,
12115,
930,
1267,
198,
220,
220,
220,
220,
220,
357,
930,
220,
220,
337,
1546,
4090,
8264,
1312,
21601,
7,
20500,
62,
4871,
8,
13315,
705,
17469,
257,
4938,
1988,
4458,
25113,
2943,
49064,
62,
37,
12115,
930,
1267,
198,
220,
220,
220,
220,
220,
357,
930,
220,
220,
337,
1546,
4090,
8264,
1312,
21601,
7,
20500,
62,
4871,
8,
13315,
2420,
12,
21601,
13,
25113,
2943,
49064,
62,
37,
12115,
930,
1267,
198,
220,
220,
220,
220,
220,
357,
930,
220,
220,
337,
1546,
4090,
8264,
1312,
21601,
7,
20500,
62,
4871,
8,
13315,
827,
12,
403,
480,
13,
25113,
2943,
49064,
62,
37,
12115,
930,
1267,
198,
220,
220,
220,
6739,
198,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
628,
198,
31631,
300,
23047,
62,
312,
62,
45286,
5550,
20032,
17941,
3268,
16879,
2043,
2751,
16034,
331,
62,
20850,
62,
9288,
62,
8692,
7473,
43001,
2751,
45698,
42,
49277,
43638,
5805,
7597,
360,
4261,
6234,
6006,
9863,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
8968,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
8189,
62,
4480,
62,
21949,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
8189,
62,
19419,
62,
21949,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
8189,
62,
4480,
62,
1069,
11221,
23848,
36,
20032,
17941,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
23047,
62,
312,
62,
45286,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
651,
62,
8968,
13,
198,
220,
220,
220,
1255,
5633,
28,
12682,
331,
62,
9122
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_object_enho DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
PROTECTED SECTION.
PRIVATE SECTION.
METHODS:
factory
IMPORTING
iv_tool TYPE enhtooltype
RETURNING
VALUE(ri_enho) TYPE REF TO zif_abapgit_object_enho
RAISING
zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_ENHO IMPLEMENTATION.
METHOD factory.
CASE iv_tool.
WHEN cl_enh_tool_badi_impl=>tooltype.
CREATE OBJECT ri_enho TYPE zcl_abapgit_object_enho_badi
EXPORTING
is_item = ms_item
io_files = mo_files.
WHEN cl_enh_tool_hook_impl=>tooltype.
CREATE OBJECT ri_enho TYPE zcl_abapgit_object_enho_hook
EXPORTING
is_item = ms_item
io_files = mo_files.
WHEN cl_enh_tool_class=>tooltype.
CREATE OBJECT ri_enho TYPE zcl_abapgit_object_enho_class
EXPORTING
is_item = ms_item
io_files = mo_files.
WHEN cl_enh_tool_intf=>tooltype.
CREATE OBJECT ri_enho TYPE zcl_abapgit_object_enho_intf
EXPORTING
is_item = ms_item
io_files = mo_files.
WHEN cl_wdr_cfg_enhancement=>tooltype.
CREATE OBJECT ri_enho TYPE zcl_abapgit_object_enho_wdyc
EXPORTING
is_item = ms_item
io_files = mo_files.
WHEN 'FUGRENH'.
CREATE OBJECT ri_enho TYPE zcl_abapgit_object_enho_fugr
EXPORTING
is_item = ms_item
io_files = mo_files.
WHEN 'WDYENH'.
CREATE OBJECT ri_enho TYPE zcl_abapgit_object_enho_wdyn
EXPORTING
is_item = ms_item
io_files = mo_files.
WHEN OTHERS.
zcx_abapgit_exception=>raise( |Unsupported ENHO type { iv_tool }| ).
ENDCASE.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
DATA: lv_enh_id TYPE enhname,
lt_log TYPE enh_log_it,
li_log_obj TYPE REF TO if_enh_log,
ls_enhlog TYPE enhlog,
lv_lines TYPE i,
lt_enhlog TYPE STANDARD TABLE OF enhlog WITH DEFAULT KEY,
li_enh_tool TYPE REF TO if_enh_tool.
lv_enh_id = ms_item-obj_name.
TRY.
li_enh_tool = cl_enh_factory=>get_enhancement(
enhancement_id = lv_enh_id
bypassing_buffer = abap_true ).
CATCH cx_enh_root.
rv_user = c_user_unknown.
RETURN.
ENDTRY.
lt_log = li_enh_tool->get_log( ).
LOOP AT lt_log INTO li_log_obj.
ls_enhlog = li_log_obj->get_enhlog( ).
APPEND ls_enhlog TO lt_enhlog.
ENDLOOP.
lv_lines = lines( lt_enhlog ).
READ TABLE lt_enhlog INTO ls_enhlog INDEX lv_lines.
IF sy-subrc = 0.
rv_user = ls_enhlog-loguser.
ELSE.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_enh_id TYPE enhname,
li_enh_object TYPE REF TO if_enh_object.
IF zif_abapgit_object~exists( ) = abap_false.
RETURN.
ENDIF.
lv_enh_id = ms_item-obj_name.
TRY.
li_enh_object = cl_enh_factory=>get_enhancement(
enhancement_id = lv_enh_id
lock = abap_true ).
li_enh_object->delete( ).
li_enh_object->save( run_dark = abap_true ).
li_enh_object->unlock( ).
CATCH cx_enh_root.
zcx_abapgit_exception=>raise( 'Error deleting ENHO' ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lv_tool TYPE enhtooltype,
li_enho TYPE REF TO zif_abapgit_object_enho.
IF zif_abapgit_object~exists( ) = abap_true.
zif_abapgit_object~delete( ).
ENDIF.
io_xml->read( EXPORTING iv_name = 'TOOL'
CHANGING cg_data = lv_tool ).
li_enho = factory( lv_tool ).
li_enho->deserialize( io_xml = io_xml
iv_package = iv_package ).
zcl_abapgit_objects_activation=>add_item( ms_item ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_enh_id TYPE enhname.
lv_enh_id = ms_item-obj_name.
TRY.
cl_enh_factory=>get_enhancement(
enhancement_id = lv_enh_id
bypassing_buffer = abap_true ).
rv_bool = abap_true.
CATCH cx_enh_root.
rv_bool = abap_false.
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
DATA: ls_meta TYPE zif_abapgit_definitions=>ty_metadata.
ls_meta = get_metadata( ).
IF ls_meta-late_deser = abap_true.
APPEND zif_abapgit_object=>gc_step_id-late TO rt_steps.
ELSEIF ls_meta-ddic = abap_true.
APPEND zif_abapgit_object=>gc_step_id-ddic TO rt_steps.
ELSE.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
DATA: lv_object TYPE seqg3-garg.
lv_object = |{ ms_item-obj_type }{ ms_item-obj_name }|.
OVERLAY lv_object WITH ' '.
lv_object = lv_object && '*'.
rv_is_locked = exists_a_lock_entry_for( iv_lock_object = 'E_ENHANCE'
iv_argument = lv_object ).
ENDMETHOD.
METHOD zif_abapgit_object~jump.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = ms_item-obj_name
object_type = 'ENHO'
in_new_window = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lv_enh_id TYPE enhname,
li_enho TYPE REF TO zif_abapgit_object_enho,
li_enh_tool TYPE REF TO if_enh_tool.
IF zif_abapgit_object~exists( ) = abap_false.
RETURN.
ENDIF.
lv_enh_id = ms_item-obj_name.
TRY.
li_enh_tool = cl_enh_factory=>get_enhancement(
enhancement_id = lv_enh_id
bypassing_buffer = abap_true ).
CATCH cx_enh_root.
zcx_abapgit_exception=>raise( 'Error from CL_ENH_FACTORY' ).
ENDTRY.
li_enho = factory( li_enh_tool->get_tool( ) ).
li_enho->serialize( io_xml = io_xml
ii_enh_tool = li_enh_tool ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
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,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
8860,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
25981,
220,
220,
220,
220,
220,
220,
220,
41876,
551,
4352,
970,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
380,
62,
268,
8873,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
1677,
32298,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
8860,
13,
628,
220,
220,
220,
42001,
21628,
62,
25981,
13,
198,
220,
220,
220,
220,
220,
42099,
537,
62,
16550,
62,
25981,
62,
65,
9189,
62,
23928,
14804,
25981,
4906,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
374,
72,
62,
268,
8873,
41876,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
62,
65,
9189,
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,
318,
62,
9186,
220,
796,
13845,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
16624,
796,
6941,
62,
16624,
13,
198,
220,
220,
220,
220,
220,
42099,
537,
62,
16550,
62,
25981,
62,
25480,
62,
23928,
14804,
25981,
4906,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
374,
72,
62,
268,
8873,
41876,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
62,
25480,
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,
318,
62,
9186,
220,
796,
13845,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
16624,
796,
6941,
62,
16624,
13,
198,
220,
220,
220,
220,
220,
42099,
537,
62,
16550,
62,
25981,
62,
4871,
14804,
25981,
4906,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
374,
72,
62,
268,
8873,
41876,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
62,
4871,
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,
318,
62,
9186,
220,
796,
13845,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
16624,
796,
6941,
62,
16624,
13,
198,
220,
220,
220,
220,
220,
42099,
537,
62,
16550,
62,
25981,
62,
600,
69,
14804,
25981,
4906,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
374,
72,
62,
268,
8873,
41876,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
62,
600,
69,
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,
318,
62,
9186,
220,
796,
13845,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
16624,
796,
6941,
62,
16624,
13,
198,
220,
220,
220,
220,
220,
42099,
537,
62,
86,
7109,
62,
37581,
62,
16550,
590,
434,
14804,
25981,
4906,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
374,
72,
62,
268,
8873,
41876,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
62,
86,
9892,
66,
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,
318,
62,
9186,
220,
796,
13845,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
16624,
796,
6941,
62,
16624,
13,
198,
220,
220,
220,
220,
220,
42099,
705,
37,
7340,
49,
1677,
39,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
374,
72,
62,
268,
8873,
41876,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
62,
69,
1018,
81,
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,
318,
62,
9186,
220,
796,
13845,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
16624,
796,
6941,
62,
16624,
13,
198,
220,
220,
220,
220,
220,
42099,
705,
22332,
56,
1677,
39,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
374,
72,
62,
268,
8873,
41876,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
268,
8873,
62,
16993,
2047,
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,
318,
62,
9186,
220,
796,
13845,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
16624,
796,
6941,
62,
16624,
13,
198,
220,
220,
220,
220,
220,
42099,
440,
4221,
4877,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
930,
3118,
15999,
12964,
32298,
2099,
1391,
21628
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
INTERFACE zif_uitb_c_alv_sorting
PUBLIC .
CONSTANTS none TYPE i VALUE 0.
CONSTANTS ascending TYPE i VALUE 1.
CONSTANTS descending TYPE i VALUE 2.
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
5013,
65,
62,
66,
62,
282,
85,
62,
82,
24707,
198,
220,
44731,
764,
198,
220,
7102,
2257,
1565,
4694,
4844,
220,
220,
220,
220,
220,
220,
41876,
1312,
26173,
8924,
657,
13,
198,
220,
7102,
2257,
1565,
4694,
41988,
220,
41876,
1312,
26173,
8924,
352,
13,
198,
220,
7102,
2257,
1565,
4694,
31491,
41876,
1312,
26173,
8924,
362,
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
] |
* regenerated at 25.04.2019 12:25:48
FUNCTION-POOL ZEWM_V_TWCR MESSAGE-ID SV.
* INCLUDE LZEWM_V_TWCRD... " Local class definition
INCLUDE LSVIMDAT . "general data decl.
INCLUDE LZEWM_V_TWCRT00 . "view rel. data dcl.
| [
9,
16935,
515,
379,
1679,
13,
3023,
13,
23344,
1105,
25,
1495,
25,
2780,
198,
42296,
4177,
2849,
12,
16402,
3535,
1168,
6217,
44,
62,
53,
62,
34551,
9419,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
337,
1546,
4090,
8264,
12,
2389,
20546,
13,
198,
198,
9,
3268,
5097,
52,
7206,
406,
57,
6217,
44,
62,
53,
62,
34551,
9419,
35,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
10714,
1398,
6770,
198,
220,
3268,
5097,
52,
7206,
30948,
53,
3955,
35,
1404,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
366,
24622,
1366,
2377,
13,
198,
220,
3268,
5097,
52,
7206,
406,
57,
6217,
44,
62,
53,
62,
34551,
9419,
51,
405,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
366,
1177,
823,
13,
1366,
288,
565,
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
] |
*&---------------------------------------------------------------------*
*& Report zfactory_demo
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zfactory_demo.
DATA result TYPE STANDARD TABLE OF sflight WITH NON-UNIQUE KEY carrid connid fldate.
SELECT * FROM sflight WHERE seatsmax >= 470 INTO TABLE @RESULT UP TO 30 ROWS.
" Display as SALV
DATA(output_object) = zcl_factory=>get_output_instance( i_type = zcl_factory=>output_as_salv ).
output_object->display_data( result ).
" Display as WRITE Output
output_object = zcl_factory=>get_output_instance( i_type = zcl_factory=>output_as_write ).
output_object->display_data( result ).
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
220,
1976,
69,
9548,
62,
9536,
78,
198,
9,
5,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
198,
9,
5,
198,
9,
5,
10097,
30934,
9,
198,
2200,
15490,
1976,
69,
9548,
62,
9536,
78,
13,
198,
198,
26947,
1255,
41876,
49053,
9795,
43679,
3963,
264,
22560,
13315,
44521,
12,
4944,
33866,
8924,
35374,
1097,
6058,
48260,
312,
277,
335,
378,
13,
198,
46506,
1635,
16034,
264,
22560,
33411,
8632,
9806,
18189,
38634,
39319,
43679,
2488,
19535,
16724,
15958,
5390,
1542,
371,
22845,
13,
198,
198,
1,
16531,
355,
42475,
53,
198,
26947,
7,
22915,
62,
15252,
8,
796,
1976,
565,
62,
69,
9548,
14804,
1136,
62,
22915,
62,
39098,
7,
1312,
62,
4906,
796,
1976,
565,
62,
69,
9548,
14804,
22915,
62,
292,
62,
21680,
85,
6739,
198,
22915,
62,
15252,
3784,
13812,
62,
7890,
7,
1255,
6739,
198,
198,
1,
16531,
355,
44423,
25235,
198,
22915,
62,
15252,
796,
1976,
565,
62,
69,
9548,
14804,
1136,
62,
22915,
62,
39098,
7,
1312,
62,
4906,
796,
1976,
565,
62,
69,
9548,
14804,
22915,
62,
292,
62,
13564,
6739,
198,
22915,
62,
15252,
3784,
13812,
62,
7890,
7,
1255,
6739,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
**********************************************************************
* UTIL
**********************************************************************
class lcl_nodes_helper definition final.
public section.
data mt_nodes type zif_ajson=>ty_nodes_tt.
methods add
importing
iv_str type string.
methods clear.
methods sorted
returning
value(rt_nodes) type zif_ajson=>ty_nodes_ts.
endclass.
class lcl_nodes_helper implementation.
method add.
field-symbols <n> like line of mt_nodes.
data lv_children type string.
data lv_index type string.
data lv_order type string.
append initial line to mt_nodes assigning <n>.
split iv_str at '|' into
<n>-path
<n>-name
<n>-type
<n>-value
lv_index
lv_children
lv_order.
condense <n>-path.
condense <n>-name.
condense <n>-type.
condense <n>-value.
<n>-index = lv_index.
<n>-children = lv_children.
<n>-order = lv_order.
endmethod.
method sorted.
rt_nodes = mt_nodes.
endmethod.
method clear.
clear mt_nodes.
endmethod.
endclass.
**********************************************************************
* PARSER
**********************************************************************
class ltcl_parser_test definition final
for testing
risk level harmless
duration short.
public section.
class-methods sample_json
importing
iv_separator type string optional
returning
value(rv_json) type string.
private section.
data mo_cut type ref to lcl_json_parser.
data mo_nodes type ref to lcl_nodes_helper.
methods setup.
methods parse for testing raising zcx_ajson_error.
methods parse_string for testing raising zcx_ajson_error.
methods parse_number for testing raising zcx_ajson_error.
methods parse_float for testing raising zcx_ajson_error.
methods parse_boolean for testing raising zcx_ajson_error.
methods parse_false for testing raising zcx_ajson_error.
methods parse_null for testing raising zcx_ajson_error.
methods parse_date for testing raising zcx_ajson_error.
methods parse_bare_values for testing raising zcx_ajson_error.
methods parse_error for testing raising zcx_ajson_error.
endclass.
class ltcl_parser_test implementation.
method setup.
create object mo_cut.
create object mo_nodes.
endmethod.
method parse_bare_values.
data lt_act type zif_ajson=>ty_nodes_tt.
mo_nodes->add( ' | |str |abc | |0' ).
lt_act = mo_cut->parse( '"abc"' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
mo_nodes->clear( ).
mo_nodes->add( ' | |num |-123 | |0' ).
lt_act = mo_cut->parse( '-123' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
mo_nodes->clear( ).
mo_nodes->add( ' | |bool |true | |0' ).
lt_act = mo_cut->parse( 'true' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
mo_nodes->clear( ).
mo_nodes->add( ' | |bool |false | |0' ).
lt_act = mo_cut->parse( 'false' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
mo_nodes->clear( ).
mo_nodes->add( ' | |null | | |0' ).
lt_act = mo_cut->parse( 'null' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
endmethod.
method parse_error.
data lt_act type zif_ajson=>ty_nodes_tt.
data lx_err type ref to zcx_ajson_error.
try.
lt_act = mo_cut->parse( 'abc' ).
cl_abap_unit_assert=>fail( 'Parsing of string w/o quotes must fail (spec)' ).
catch zcx_ajson_error into lx_err.
cl_abap_unit_assert=>assert_char_cp(
act = lx_err->get_text( )
exp = '*parsing error*' ).
cl_abap_unit_assert=>assert_char_cp(
act = lx_err->location
exp = 'Line 1, Offset 1' ).
endtry.
try.
lt_act = mo_cut->parse( '{' && cl_abap_char_utilities=>newline
&& '"ok": "abc",' && cl_abap_char_utilities=>newline
&& '"error"' && cl_abap_char_utilities=>newline
&& '}' ).
cl_abap_unit_assert=>fail( 'Parsing of invalid JSON must fail (spec)' ).
catch zcx_ajson_error into lx_err.
cl_abap_unit_assert=>assert_char_cp(
act = lx_err->get_text( )
exp = '*parsing error*' ).
cl_abap_unit_assert=>assert_char_cp(
act = lx_err->location
exp = 'Line 3, Offset 8' ).
endtry.
endmethod.
method parse_string.
mo_nodes->add( ' | |object | | |1' ).
mo_nodes->add( '/ |string |str |abc | |0' ).
data lt_act type zif_ajson=>ty_nodes_tt.
lt_act = mo_cut->parse( '{"string": "abc"}' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
endmethod.
method parse_number.
mo_nodes->add( ' | |object | | |1' ).
mo_nodes->add( '/ |number |num |123 | |0' ).
data lt_act type zif_ajson=>ty_nodes_tt.
lt_act = mo_cut->parse( '{"number": 123}' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
endmethod.
method parse_float.
mo_nodes->add( ' | |object | | |1' ).
mo_nodes->add( '/ |float |num |123.45 | |0' ).
data lt_act type zif_ajson=>ty_nodes_tt.
create object mo_cut.
lt_act = mo_cut->parse( '{"float": 123.45}' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
endmethod.
method parse_boolean.
mo_nodes->add( ' | |object | | |1' ).
mo_nodes->add( '/ |boolean |bool |true | |0' ).
data lt_act type zif_ajson=>ty_nodes_tt.
lt_act = mo_cut->parse( '{"boolean": true}' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
endmethod.
method parse_false.
mo_nodes->add( ' | |object | | |1' ).
mo_nodes->add( '/ |false |bool |false | |0' ).
data lt_act type zif_ajson=>ty_nodes_tt.
lt_act = mo_cut->parse( '{"false": false}' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
endmethod.
method parse_null.
mo_nodes->add( ' | |object | | |1' ).
mo_nodes->add( '/ |null |null | | |0' ).
data lt_act type zif_ajson=>ty_nodes_tt.
lt_act = mo_cut->parse( '{"null": null}' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
endmethod.
method parse_date.
mo_nodes->add( ' | |object | | |1' ).
mo_nodes->add( '/ |date |str |2020-03-15 | |0' ).
data lt_act type zif_ajson=>ty_nodes_tt.
lt_act = mo_cut->parse( '{"date": "2020-03-15"}' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = mo_nodes->mt_nodes ).
endmethod.
method sample_json.
rv_json =
'{\n' &&
' "string": "abc",\n' &&
' "number": 123,\n' &&
' "float": 123.45,\n' &&
' "boolean": true,\n' &&
' "false": false,\n' &&
' "null": null,\n' &&
' "date": "2020-03-15",\n' &&
' "issues": [\n' &&
' {\n' &&
' "message": "Indentation problem ...",\n' &&
' "key": "indentation",\n' &&
' "start": {\n' &&
' "row": 4,\n' &&
' "col": 3\n' &&
' },\n' &&
' "end": {\n' &&
' "row": 4,\n' &&
' "col": 26\n' &&
' },\n' &&
' "filename": "./zxxx.prog.abap"\n' &&
' },\n' &&
' {\n' &&
' "message": "Remove space before XXX",\n' &&
' "key": "space_before_dot",\n' &&
' "start": {\n' &&
' "row": 3,\n' &&
' "col": 21\n' &&
' },\n' &&
' "end": {\n' &&
' "row": 3,\n' &&
' "col": 22\n' &&
' },\n' &&
' "filename": "./zxxx.prog.abap"\n' &&
' }\n' &&
' ]\n' &&
'}'.
replace all occurrences of '\n' in rv_json with iv_separator.
endmethod.
method parse.
data lo_cut type ref to lcl_json_parser.
data lt_act type zif_ajson=>ty_nodes_tt.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lo_nodes->add( ' | |object | | |8' ).
lo_nodes->add( '/ |string |str |abc | |0' ).
lo_nodes->add( '/ |number |num |123 | |0' ).
lo_nodes->add( '/ |float |num |123.45 | |0' ).
lo_nodes->add( '/ |boolean |bool |true | |0' ).
lo_nodes->add( '/ |false |bool |false | |0' ).
lo_nodes->add( '/ |null |null | | |0' ).
lo_nodes->add( '/ |date |str |2020-03-15 | |0' ).
lo_nodes->add( '/ |issues |array | | |2' ).
lo_nodes->add( '/issues/ |1 |object | |1 |5' ).
lo_nodes->add( '/issues/1/ |message |str |Indentation problem ... | |0' ).
lo_nodes->add( '/issues/1/ |key |str |indentation | |0' ).
lo_nodes->add( '/issues/1/ |start |object | | |2' ).
lo_nodes->add( '/issues/1/start/ |row |num |4 | |0' ).
lo_nodes->add( '/issues/1/start/ |col |num |3 | |0' ).
lo_nodes->add( '/issues/1/ |end |object | | |2' ).
lo_nodes->add( '/issues/1/end/ |row |num |4 | |0' ).
lo_nodes->add( '/issues/1/end/ |col |num |26 | |0' ).
lo_nodes->add( '/issues/1/ |filename |str |./zxxx.prog.abap | |0' ).
lo_nodes->add( '/issues/ |2 |object | |2 |5' ).
lo_nodes->add( '/issues/2/ |message |str |Remove space before XXX | |0' ).
lo_nodes->add( '/issues/2/ |key |str |space_before_dot | |0' ).
lo_nodes->add( '/issues/2/ |start |object | | |2' ).
lo_nodes->add( '/issues/2/start/ |row |num |3 | |0' ).
lo_nodes->add( '/issues/2/start/ |col |num |21 | |0' ).
lo_nodes->add( '/issues/2/ |end |object | | |2' ).
lo_nodes->add( '/issues/2/end/ |row |num |3 | |0' ).
lo_nodes->add( '/issues/2/end/ |col |num |22 | |0' ).
lo_nodes->add( '/issues/2/ |filename |str |./zxxx.prog.abap | |0' ).
create object lo_cut.
lt_act = lo_cut->parse( sample_json( ) ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = lo_nodes->mt_nodes ).
lt_act = lo_cut->parse( sample_json( |{ cl_abap_char_utilities=>newline }| ) ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = lo_nodes->mt_nodes ).
lt_act = lo_cut->parse( sample_json( |{ cl_abap_char_utilities=>cr_lf }| ) ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = lo_nodes->mt_nodes ).
endmethod.
endclass.
**********************************************************************
* SERIALIZER
**********************************************************************
class ltcl_serializer_test definition final
for testing
risk level harmless
duration short.
public section.
class-methods sample_json
returning
value(rv_json) type string.
class-methods sample_nodes
returning
value(rt_nodes) type zif_ajson=>ty_nodes_ts.
private section.
methods stringify_condensed for testing raising zcx_ajson_error.
methods stringify_indented for testing raising zcx_ajson_error.
methods array_index for testing raising zcx_ajson_error.
methods item_order for testing raising zcx_ajson_error.
methods simple_indented for testing raising zcx_ajson_error.
methods empty_set for testing raising zcx_ajson_error.
methods escape for testing raising zcx_ajson_error.
methods empty for testing raising zcx_ajson_error.
endclass.
class ltcl_serializer_test implementation.
method sample_json.
rv_json =
'{\n' &&
' "boolean": true,\n' &&
' "date": "2020-03-15",\n' &&
' "false": false,\n' &&
' "float": 123.45,\n' &&
' "issues": [\n' &&
' {\n' &&
' "end": {\n' &&
' "col": 26,\n' &&
' "row": 4\n' &&
' },\n' &&
' "filename": "./zxxx.prog.abap",\n' &&
' "key": "indentation",\n' &&
' "message": "Indentation problem ...",\n' &&
' "start": {\n' &&
' "col": 3,\n' &&
' "row": 4\n' &&
' }\n' &&
' },\n' &&
' {\n' &&
' "end": {\n' &&
' "col": 22,\n' &&
' "row": 3\n' &&
' },\n' &&
' "filename": "./zxxx.prog.abap",\n' &&
' "key": "space_before_dot",\n' &&
' "message": "Remove space before XXX",\n' &&
' "start": {\n' &&
' "col": 21,\n' &&
' "row": 3\n' &&
' }\n' &&
' }\n' &&
' ],\n' &&
' "null": null,\n' &&
' "number": 123,\n' &&
' "string": "abc"\n' &&
'}'.
rv_json = replace(
val = rv_json
sub = '\n'
with = cl_abap_char_utilities=>newline
occ = 0 ).
endmethod.
method sample_nodes.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lo_nodes->add( ' | |object | | |8' ).
lo_nodes->add( '/ |string |str |abc | |0' ).
lo_nodes->add( '/ |number |num |123 | |0' ).
lo_nodes->add( '/ |float |num |123.45 | |0' ).
lo_nodes->add( '/ |boolean |bool |true | |0' ).
lo_nodes->add( '/ |false |bool |false | |0' ).
lo_nodes->add( '/ |null |null | | |0' ).
lo_nodes->add( '/ |date |str |2020-03-15 | |0' ).
lo_nodes->add( '/ |issues |array | | |2' ).
lo_nodes->add( '/issues/ |1 |object | |1 |5' ).
lo_nodes->add( '/issues/1/ |message |str |Indentation problem ... | |0' ).
lo_nodes->add( '/issues/1/ |key |str |indentation | |0' ).
lo_nodes->add( '/issues/1/ |start |object | | |2' ).
lo_nodes->add( '/issues/1/start/ |row |num |4 | |0' ).
lo_nodes->add( '/issues/1/start/ |col |num |3 | |0' ).
lo_nodes->add( '/issues/1/ |end |object | | |2' ).
lo_nodes->add( '/issues/1/end/ |row |num |4 | |0' ).
lo_nodes->add( '/issues/1/end/ |col |num |26 | |0' ).
lo_nodes->add( '/issues/1/ |filename |str |./zxxx.prog.abap | |0' ).
lo_nodes->add( '/issues/ |2 |object | |2 |5' ).
lo_nodes->add( '/issues/2/ |message |str |Remove space before XXX | |0' ).
lo_nodes->add( '/issues/2/ |key |str |space_before_dot | |0' ).
lo_nodes->add( '/issues/2/ |start |object | | |2' ).
lo_nodes->add( '/issues/2/start/ |row |num |3 | |0' ).
lo_nodes->add( '/issues/2/start/ |col |num |21 | |0' ).
lo_nodes->add( '/issues/2/ |end |object | | |2' ).
lo_nodes->add( '/issues/2/end/ |row |num |3 | |0' ).
lo_nodes->add( '/issues/2/end/ |col |num |22 | |0' ).
lo_nodes->add( '/issues/2/ |filename |str |./zxxx.prog.abap | |0' ).
rt_nodes = lo_nodes->sorted( ).
endmethod.
method stringify_condensed.
data lv_act type string.
data lv_exp type string.
lv_act = lcl_json_serializer=>stringify( sample_nodes( ) ).
lv_exp = sample_json( ).
lv_exp = replace(
val = lv_exp
sub = cl_abap_char_utilities=>newline
with = ''
occ = 0 ).
condense lv_exp.
lv_exp = replace(
val = lv_exp
sub = `: `
with = ':'
occ = 0 ).
lv_exp = replace(
val = lv_exp
sub = `{ `
with = '{'
occ = 0 ).
lv_exp = replace(
val = lv_exp
sub = `[ `
with = '['
occ = 0 ).
lv_exp = replace(
val = lv_exp
sub = ` }`
with = '}'
occ = 0 ).
lv_exp = replace(
val = lv_exp
sub = ` ]`
with = ']'
occ = 0 ).
lv_exp = replace(
val = lv_exp
sub = `, `
with = ','
occ = 0 ).
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
endmethod.
method stringify_indented.
data lv_act type string.
data lv_exp type string.
lv_act = lcl_json_serializer=>stringify(
it_json_tree = sample_nodes( )
iv_indent = 2 ).
lv_exp = sample_json( ).
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
endmethod.
method array_index.
data lv_act type string.
data lv_exp type string.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lo_nodes->add( ' | |array | | |3' ).
lo_nodes->add( '/ |1 |str |abc |2 |0' ).
lo_nodes->add( '/ |2 |num |123 |1 |0' ).
lo_nodes->add( '/ |3 |num |123.45 |3 |0' ).
lv_act = lcl_json_serializer=>stringify( lo_nodes->sorted( ) ).
lv_exp = '[123,"abc",123.45]'.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
endmethod.
method item_order.
data lv_act type string.
data lv_exp type string.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lo_nodes->add( ' | |object | | |3 |0' ).
lo_nodes->add( '/ |beta |str |b | |0 |3' ).
lo_nodes->add( '/ |zulu |str |z | |0 |1' ).
lo_nodes->add( '/ |alpha |str |a | |0 |2' ).
lv_act = lcl_json_serializer=>stringify( lo_nodes->sorted( ) ).
lv_exp = '{"alpha":"a","beta":"b","zulu":"z"}'. " NAME order ! (it is also a UT)
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
lv_act = lcl_json_serializer=>stringify(
it_json_tree = lo_nodes->sorted( )
iv_keep_item_order = abap_true ).
lv_exp = '{"zulu":"z","alpha":"a","beta":"b"}'.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
endmethod.
method simple_indented.
data lv_act type string.
data lv_exp type string.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lo_nodes->add( ' | |array | | |3' ).
lo_nodes->add( '/ |1 |object | |2 |2' ).
lo_nodes->add( '/1/ |a |num |1 | |0' ).
lo_nodes->add( '/1/ |b |num |2 | |0' ).
lo_nodes->add( '/ |2 |num |123 |1 |0' ).
lo_nodes->add( '/ |3 |num |123.45 |3 |0' ).
lv_act = lcl_json_serializer=>stringify(
it_json_tree = lo_nodes->sorted( )
iv_indent = 2 ).
lv_exp = '[\n' &&
' 123,\n' &&
' {\n' &&
' "a": 1,\n' &&
' "b": 2\n' &&
' },\n' &&
' 123.45\n' &&
']'.
lv_exp = replace(
val = lv_exp
sub = '\n'
with = cl_abap_char_utilities=>newline
occ = 0 ).
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
endmethod.
method empty_set.
data lv_act type string.
data lv_exp type string.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lo_nodes->add( ' | |array | | |0' ).
lv_act = lcl_json_serializer=>stringify(
it_json_tree = lo_nodes->sorted( )
iv_indent = 0 ).
lv_exp = '[]'.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
lv_act = lcl_json_serializer=>stringify(
it_json_tree = lo_nodes->sorted( )
iv_indent = 2 ).
lv_exp = '[]'.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
endmethod.
method escape.
data lv_act type string.
data lv_exp type string.
data lv_val type string.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lv_val = 'a' && '"' && '\' && cl_abap_char_utilities=>horizontal_tab && cl_abap_char_utilities=>cr_lf.
lo_nodes->add( | \| \|str \|{ lv_val }\| \|0| ).
lv_act = lcl_json_serializer=>stringify( lo_nodes->sorted( ) ).
lv_exp = '"a\"\\\t\r\n"'.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
endmethod.
method empty.
data lv_act type string.
data lv_exp type string.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lv_act = lcl_json_serializer=>stringify( lo_nodes->sorted( ) ).
lv_exp = ''.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
endmethod.
endclass.
**********************************************************************
* UTILS
**********************************************************************
class ltcl_utils_test definition final
for testing
risk level harmless
duration short.
private section.
methods normalize_path for testing.
methods split_path for testing.
methods validate_array_index for testing raising zcx_ajson_error.
endclass.
class zcl_ajson definition local friends ltcl_utils_test.
class ltcl_utils_test implementation.
method validate_array_index.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>validate_array_index( iv_path = 'x' iv_index = '123' )
exp = 123 ).
try.
lcl_utils=>validate_array_index( iv_path = 'x' iv_index = 'a' ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error.
endtry.
try.
lcl_utils=>validate_array_index( iv_path = 'x' iv_index = '0' ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error.
endtry.
endmethod.
method normalize_path.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>normalize_path( '' )
exp = '/' ).
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>normalize_path( '/' )
exp = '/' ).
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>normalize_path( 'abc' )
exp = '/abc/' ).
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>normalize_path( '/abc' )
exp = '/abc/' ).
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>normalize_path( 'abc/' )
exp = '/abc/' ).
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>normalize_path( '/abc/' )
exp = '/abc/' ).
endmethod.
method split_path.
data ls_exp type zif_ajson=>ty_path_name.
data lv_path type string.
lv_path = ''. " alias to root
ls_exp-path = ''.
ls_exp-name = ''.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>split_path( lv_path )
exp = ls_exp ).
lv_path = '/'.
ls_exp-path = ''.
ls_exp-name = ''.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>split_path( lv_path )
exp = ls_exp ).
lv_path = '/abc/'.
ls_exp-path = '/'.
ls_exp-name = 'abc'.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>split_path( lv_path )
exp = ls_exp ).
lv_path = 'abc'.
ls_exp-path = '/'.
ls_exp-name = 'abc'.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>split_path( lv_path )
exp = ls_exp ).
lv_path = '/abc'.
ls_exp-path = '/'.
ls_exp-name = 'abc'.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>split_path( lv_path )
exp = ls_exp ).
lv_path = 'abc/'.
ls_exp-path = '/'.
ls_exp-name = 'abc'.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>split_path( lv_path )
exp = ls_exp ).
lv_path = '/abc/xyz'.
ls_exp-path = '/abc/'.
ls_exp-name = 'xyz'.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>split_path( lv_path )
exp = ls_exp ).
lv_path = '/abc/xyz/'.
ls_exp-path = '/abc/'.
ls_exp-name = 'xyz'.
cl_abap_unit_assert=>assert_equals(
act = lcl_utils=>split_path( lv_path )
exp = ls_exp ).
endmethod.
endclass.
**********************************************************************
* READER
**********************************************************************
class ltcl_reader_test definition final
for testing
risk level harmless
duration short.
private section.
methods get_value for testing raising zcx_ajson_error.
methods get_node_type for testing raising zcx_ajson_error.
methods exists for testing raising zcx_ajson_error.
methods value_integer for testing raising zcx_ajson_error.
methods value_number for testing raising zcx_ajson_error.
methods value_boolean for testing raising zcx_ajson_error.
methods value_string for testing raising zcx_ajson_error.
methods members for testing raising zcx_ajson_error.
methods slice for testing raising zcx_ajson_error.
methods array_to_string_table for testing raising zcx_ajson_error.
methods get_date for testing raising zcx_ajson_error.
methods get_timestamp for testing raising zcx_ajson_error.
endclass.
class zcl_ajson definition local friends ltcl_reader_test.
class ltcl_reader_test implementation.
method slice.
data lo_cut type ref to zcl_ajson.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lo_nodes->add( ' | |array | | |2' ).
lo_nodes->add( '/ |1 |object | |1 |5' ).
lo_nodes->add( '/1/ |message |str |Indentation problem ... | |0' ).
lo_nodes->add( '/1/ |key |str |indentation | |0' ).
lo_nodes->add( '/1/ |start |object | | |2' ).
lo_nodes->add( '/1/start/ |row |num |4 | |0' ).
lo_nodes->add( '/1/start/ |col |num |3 | |0' ).
lo_nodes->add( '/1/ |end |object | | |2' ).
lo_nodes->add( '/1/end/ |row |num |4 | |0' ).
lo_nodes->add( '/1/end/ |col |num |26 | |0' ).
lo_nodes->add( '/1/ |filename |str |./zxxx.prog.abap | |0' ).
lo_nodes->add( '/ |2 |object | |2 |5' ).
lo_nodes->add( '/2/ |message |str |Remove space before XXX | |0' ).
lo_nodes->add( '/2/ |key |str |space_before_dot | |0' ).
lo_nodes->add( '/2/ |start |object | | |2' ).
lo_nodes->add( '/2/start/ |row |num |3 | |0' ).
lo_nodes->add( '/2/start/ |col |num |21 | |0' ).
lo_nodes->add( '/2/ |end |object | | |2' ).
lo_nodes->add( '/2/end/ |row |num |3 | |0' ).
lo_nodes->add( '/2/end/ |col |num |22 | |0' ).
lo_nodes->add( '/2/ |filename |str |./zxxx.prog.abap | |0' ).
lo_cut = zcl_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
lo_cut ?= lo_cut->zif_ajson~slice( '/issues' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
" **********************************************************************
create object lo_nodes.
lo_nodes->add( ' | |object | | |8' ).
lo_nodes->add( '/ |string |str |abc | |0' ).
lo_nodes->add( '/ |number |num |123 | |0' ).
lo_nodes->add( '/ |float |num |123.45 | |0' ).
lo_nodes->add( '/ |boolean |bool |true | |0' ).
lo_nodes->add( '/ |false |bool |false | |0' ).
lo_nodes->add( '/ |null |null | | |0' ).
lo_nodes->add( '/ |date |str |2020-03-15 | |0' ).
lo_nodes->add( '/ |issues |array | | |2' ).
lo_nodes->add( '/issues/ |1 |object | |1 |5' ).
lo_nodes->add( '/issues/1/ |message |str |Indentation problem ... | |0' ).
lo_nodes->add( '/issues/1/ |key |str |indentation | |0' ).
lo_nodes->add( '/issues/1/ |start |object | | |2' ).
lo_nodes->add( '/issues/1/start/ |row |num |4 | |0' ).
lo_nodes->add( '/issues/1/start/ |col |num |3 | |0' ).
lo_nodes->add( '/issues/1/ |end |object | | |2' ).
lo_nodes->add( '/issues/1/end/ |row |num |4 | |0' ).
lo_nodes->add( '/issues/1/end/ |col |num |26 | |0' ).
lo_nodes->add( '/issues/1/ |filename |str |./zxxx.prog.abap | |0' ).
lo_nodes->add( '/issues/ |2 |object | |2 |5' ).
lo_nodes->add( '/issues/2/ |message |str |Remove space before XXX | |0' ).
lo_nodes->add( '/issues/2/ |key |str |space_before_dot | |0' ).
lo_nodes->add( '/issues/2/ |start |object | | |2' ).
lo_nodes->add( '/issues/2/start/ |row |num |3 | |0' ).
lo_nodes->add( '/issues/2/start/ |col |num |21 | |0' ).
lo_nodes->add( '/issues/2/ |end |object | | |2' ).
lo_nodes->add( '/issues/2/end/ |row |num |3 | |0' ).
lo_nodes->add( '/issues/2/end/ |col |num |22 | |0' ).
lo_nodes->add( '/issues/2/ |filename |str |./zxxx.prog.abap | |0' ).
lo_cut = zcl_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
lo_cut ?= lo_cut->zif_ajson~slice( '/' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
" **********************************************************************
create object lo_nodes.
lo_nodes->add( ' | |object | | |2' ).
lo_nodes->add( '/ |row |num |3 | |0' ).
lo_nodes->add( '/ |col |num |21 | |0' ).
lo_cut = zcl_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
lo_cut ?= lo_cut->zif_ajson~slice( '/issues/2/start/' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
endmethod.
method get_value.
data lo_cut type ref to zif_ajson.
lo_cut ?= zcl_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get( '/string' )
exp = 'abc' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get( '/string/' )
exp = 'abc' ). " Hmmm ?
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get( '/boolean' )
exp = 'true' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get( '/issues/2/start/row' )
exp = '3' ).
endmethod.
method get_node_type.
data li_cut type ref to zif_ajson.
li_cut = zcl_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/' )
exp = 'object' ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/string' )
exp = 'str' ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/number' )
exp = 'num' ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/float' )
exp = 'num' ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/boolean' )
exp = 'bool' ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/false' )
exp = 'bool' ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/null' )
exp = 'null' ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/date' )
exp = 'str' ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->get_node_type( '/issues' )
exp = 'array' ).
endmethod.
method get_date.
data lo_cut type ref to zcl_ajson.
data lo_nodes type ref to lcl_nodes_helper.
data lv_exp type d.
create object lo_cut.
lv_exp = '20200728'.
create object lo_nodes.
lo_nodes->add( ' | |object | | |1' ).
lo_nodes->add( '/ |date1 |str |2020-07-28 | |0' ).
lo_cut->mt_json_tree = lo_nodes->mt_nodes.
cl_abap_unit_assert=>assert_equals(
act = lo_cut->zif_ajson~get_date( '/date1' )
exp = lv_exp ).
create object lo_nodes.
lo_nodes->add( ' | |object | | |1' ).
lo_nodes->add( '/ |date1 |str |2020-07-28T01:00:00Z | |0' ).
lo_cut->mt_json_tree = lo_nodes->mt_nodes.
cl_abap_unit_assert=>assert_equals(
act = lo_cut->zif_ajson~get_date( '/date1' )
exp = lv_exp ).
create object lo_nodes.
lo_nodes->add( ' | |object | | |1' ).
lo_nodes->add( '/ |date1 |str |20200728 | |0' ).
lo_cut->mt_json_tree = lo_nodes->mt_nodes.
cl_abap_unit_assert=>assert_equals(
act = lo_cut->zif_ajson~get_date( '/date1' )
exp = '' ).
endmethod.
method get_timestamp.
data lo_cut type ref to zcl_ajson.
data lo_nodes type ref to lcl_nodes_helper.
data lv_exp type timestamp value `20200728000000`.
create object lo_cut.
create object lo_nodes.
lo_nodes->add( ' | |object | | |1' ).
lo_nodes->add( '/ |timestamp|str |2020-07-28T00:00:00Z | |0' ).
lo_cut->mt_json_tree = lo_nodes->mt_nodes.
cl_abap_unit_assert=>assert_equals(
act = lo_cut->zif_ajson~get_timestamp( '/timestamp' )
exp = lv_exp ).
endmethod.
method exists.
data lo_cut type ref to zif_ajson.
lo_cut ?= zcl_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->exists( '/string' )
exp = abap_true ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->exists( '/string/' )
exp = abap_true ). " mmmm ?
cl_abap_unit_assert=>assert_equals(
act = lo_cut->exists( '/xxx' )
exp = abap_false ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->exists( '/issues/2/start/row' )
exp = abap_true ).
endmethod.
method value_integer.
data lo_cut type ref to zif_ajson.
lo_cut ?= zcl_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_integer( '/string' )
exp = 0 ). " Hmmmm ????
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_integer( '/number' )
exp = 123 ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_integer( '/float' )
exp = 123 ).
endmethod.
method value_number.
data lo_cut type ref to zif_ajson.
lo_cut ?= zcl_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_number( '/string' )
exp = 0 ). " Hmmmm ????
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_number( '/number' )
exp = +'123.0' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_number( '/float' )
exp = +'123.45' ).
endmethod.
method value_boolean.
data lo_cut type ref to zif_ajson.
lo_cut ?= zcl_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_boolean( '/string' )
exp = abap_true ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_boolean( '/number' )
exp = abap_true ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_boolean( '/xxx' )
exp = abap_false ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_boolean( '/boolean' )
exp = abap_true ).
endmethod.
method value_string.
data lo_cut type ref to zif_ajson.
lo_cut ?= zcl_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_string( '/string' )
exp = 'abc' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_string( '/number' )
exp = '123' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_string( '/xxx' )
exp = '' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->get_string( '/boolean' )
exp = 'true' ).
endmethod.
method members.
data lt_exp type string_table.
data lo_cut type ref to zif_ajson.
lo_cut ?= zcl_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
clear lt_exp.
append '1' to lt_exp.
append '2' to lt_exp.
cl_abap_unit_assert=>assert_equals(
act = lo_cut->members( '/issues' )
exp = lt_exp ).
clear lt_exp.
append 'col' to lt_exp.
append 'row' to lt_exp.
cl_abap_unit_assert=>assert_equals(
act = lo_cut->members( '/issues/1/start/' )
exp = lt_exp ).
endmethod.
method array_to_string_table.
data lo_cut type ref to zcl_ajson.
data lo_nodes type ref to lcl_nodes_helper.
data lt_act type string_table.
data lt_exp type string_table.
create object lo_nodes.
lo_nodes->add( ' | |array | | |6' ).
lo_nodes->add( '/ |1 |num |123 |1|0' ).
lo_nodes->add( '/ |2 |num |234 |2|0' ).
lo_nodes->add( '/ |3 |str |abc |3|0' ).
lo_nodes->add( '/ |4 |bool |true |4|0' ).
lo_nodes->add( '/ |5 |bool |false |5|0' ).
lo_nodes->add( '/ |6 |null |null |6|0' ).
append '123' to lt_exp.
append '234' to lt_exp.
append 'abc' to lt_exp.
append 'X' to lt_exp.
append '' to lt_exp.
append '' to lt_exp.
create object lo_cut.
lo_cut->mt_json_tree = lo_nodes->mt_nodes.
lt_act = lo_cut->zif_ajson~array_to_string_table( '/' ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = lt_exp ).
" negative
data lx type ref to zcx_ajson_error.
create object lo_nodes.
lo_nodes->add( ' | |object | | |1' ).
lo_nodes->add( '/ |a |str |abc | |0' ).
lo_cut->mt_json_tree = lo_nodes->mt_nodes.
try.
lo_cut->zif_ajson~array_to_string_table( '/x' ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Path not found: /x' ).
endtry.
try.
lo_cut->zif_ajson~array_to_string_table( '/' ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Array expected at: /' ).
endtry.
try.
lo_cut->zif_ajson~array_to_string_table( '/a' ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Array expected at: /a' ).
endtry.
create object lo_nodes.
lo_nodes->add( ' | |array | | |1' ).
lo_nodes->add( '/ |1 |object | |1|0' ).
lo_cut->mt_json_tree = lo_nodes->mt_nodes.
try.
lo_cut->zif_ajson~array_to_string_table( '/' ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Cannot convert [object] to string at [/1]' ).
endtry.
endmethod.
endclass.
**********************************************************************
* JSON TO ABAP
**********************************************************************
class ltcl_json_to_abap definition
for testing
risk level harmless
duration short
final.
private section.
types:
begin of ty_struc,
a type string,
b type i,
end of ty_struc,
tty_struc type standard table of ty_struc with default key,
tty_struc_sorted type sorted table of ty_struc with unique key a,
tty_struc_hashed type hashed table of ty_struc with unique key a,
begin of ty_complex,
str type string,
int type i,
float type f,
bool type abap_bool,
obj type ty_struc,
tab type tty_struc,
tab_plain type string_table,
tab_hashed type tty_struc_hashed,
oref type ref to object,
date1 type d,
date2 type d,
timestamp1 type timestamp,
timestamp2 type timestamp,
timestamp3 type timestamp,
end of ty_complex.
methods to_abap_struc
for testing
raising zcx_ajson_error.
methods to_abap_value
for testing
raising zcx_ajson_error.
methods to_abap_array
for testing
raising zcx_ajson_error.
methods to_abap_array_of_arrays
for testing
raising zcx_ajson_error.
methods to_abap_w_tab_of_struc
for testing
raising zcx_ajson_error.
methods to_abap_w_plain_tab
for testing
raising zcx_ajson_error.
methods to_abap_hashed_tab
for testing
raising zcx_ajson_error.
methods to_abap_sorted_tab
for testing
raising zcx_ajson_error.
methods to_abap_hashed_plain_tab
for testing
raising zcx_ajson_error.
methods to_abap_negative
for testing
raising zcx_ajson_error.
endclass.
class ltcl_json_to_abap implementation.
method to_abap_struc.
data lo_cut type ref to lcl_json_to_abap.
data ls_mock type ty_complex.
data ls_exp type ty_complex.
data lv_exp_date type d value '20200728'.
data lv_exp_timestamp type timestamp value '20200728000000'.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lo_nodes->add( ' | |object | | ' ).
lo_nodes->add( '/ |str |str |hello | ' ).
lo_nodes->add( '/ |int |num |5 | ' ).
lo_nodes->add( '/ |float |num |5.5 | ' ).
lo_nodes->add( '/ |bool |bool |true | ' ).
lo_nodes->add( '/ |obj |object | | ' ).
lo_nodes->add( '/obj/ |a |str |world | ' ).
lo_nodes->add( '/ |tab |array | | ' ).
lo_nodes->add( '/ |date1 |str |2020-07-28 | ' ).
lo_nodes->add( '/ |date2 |str |2020-07-28T00:00:00Z | ' ).
lo_nodes->add( '/ |timestamp1 |str |2020-07-28T00:00:00 | ' ).
lo_nodes->add( '/ |timestamp2 |str |2020-07-28T00:00:00Z | ' ).
lo_nodes->add( '/ |timestamp3 |str |2020-07-28T01:00:00+01:00 | ' ).
create object lo_cut.
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = ls_mock ).
ls_exp-str = 'hello'.
ls_exp-int = 5.
ls_exp-float = '5.5'.
ls_exp-bool = abap_true.
ls_exp-obj-a = 'world'.
ls_exp-date1 = lv_exp_date.
ls_exp-date2 = lv_exp_date.
ls_exp-timestamp1 = lv_exp_timestamp.
ls_exp-timestamp2 = lv_exp_timestamp.
ls_exp-timestamp3 = lv_exp_timestamp.
cl_abap_unit_assert=>assert_equals(
act = ls_mock
exp = ls_exp ).
endmethod.
method to_abap_value.
data lo_cut type ref to lcl_json_to_abap.
data lv_mock type string.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lo_nodes->add( ' | |str |hello | ' ).
create object lo_cut.
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = lv_mock ).
cl_abap_unit_assert=>assert_equals(
act = lv_mock
exp = 'hello' ).
endmethod.
method to_abap_array.
data lo_cut type ref to lcl_json_to_abap.
data lt_mock type string_table.
data lt_exp type string_table.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lo_nodes->add( ' | |array | | ' ).
lo_nodes->add( '/ |1 |str |One |1' ).
lo_nodes->add( '/ |2 |str |Two |2' ).
create object lo_cut.
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = lt_mock ).
append 'One' to lt_exp.
append 'Two' to lt_exp.
cl_abap_unit_assert=>assert_equals(
act = lt_mock
exp = lt_exp ).
endmethod.
method to_abap_array_of_arrays.
data lo_cut type ref to lcl_json_to_abap.
data lt_mock type table of string_table.
data lt_exp type table of string_table.
data lt_tmp type string_table.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lo_nodes->add( ' | |array | | ' ).
lo_nodes->add( '/ |1 |array | |1' ).
lo_nodes->add( '/ |2 |array | |2' ).
lo_nodes->add( '/1/ |1 |str |One |1' ).
lo_nodes->add( '/1/ |2 |str |Two |2' ).
lo_nodes->add( '/2/ |1 |str |Three |1' ).
lo_nodes->add( '/2/ |2 |str |Four |2' ).
create object lo_cut.
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = lt_mock ).
append 'One' to lt_tmp.
append 'Two' to lt_tmp.
append lt_tmp to lt_exp.
clear lt_tmp.
append 'Three' to lt_tmp.
append 'Four' to lt_tmp.
append lt_tmp to lt_exp.
cl_abap_unit_assert=>assert_equals(
act = lt_mock
exp = lt_exp ).
endmethod.
method to_abap_w_tab_of_struc.
data lo_cut type ref to lcl_json_to_abap.
data ls_mock type ty_complex.
data ls_exp type ty_complex.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lo_nodes->add( ' | |object | | ' ).
lo_nodes->add( '/ |tab |array | | ' ).
lo_nodes->add( '/tab/ |1 |object | |1' ).
lo_nodes->add( '/tab/1/|a |str |One | ' ).
lo_nodes->add( '/tab/ |2 |object | |2' ).
lo_nodes->add( '/tab/2/|a |str |Two | ' ).
create object lo_cut.
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = ls_mock ).
data ls_elem like line of ls_exp-tab.
ls_elem-a = 'One'.
append ls_elem to ls_exp-tab.
ls_elem-a = 'Two'.
append ls_elem to ls_exp-tab.
cl_abap_unit_assert=>assert_equals(
act = ls_mock
exp = ls_exp ).
endmethod.
method to_abap_w_plain_tab.
data lo_cut type ref to lcl_json_to_abap.
data ls_mock type ty_complex.
data ls_exp type ty_complex.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lo_nodes->add( ' | |object | | ' ).
lo_nodes->add( '/ |tab_plain |array | | ' ).
lo_nodes->add( '/tab_plain/ |1 |str |One |1' ).
lo_nodes->add( '/tab_plain/ |2 |str |Two |2' ).
create object lo_cut.
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = ls_mock ).
append 'One' to ls_exp-tab_plain.
append 'Two' to ls_exp-tab_plain.
cl_abap_unit_assert=>assert_equals(
act = ls_mock
exp = ls_exp ).
endmethod.
method to_abap_hashed_plain_tab.
data lo_cut type ref to lcl_json_to_abap.
data lt_mock type hashed table of string with unique key table_line.
data lt_exp type hashed table of string with unique key table_line.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lo_nodes->add( ' | |array | | ' ).
lo_nodes->add( '/ |1 |str |One |1' ).
lo_nodes->add( '/ |2 |str |Two |2' ).
create object lo_cut.
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = lt_mock ).
insert `One` into table lt_exp.
insert `Two` into table lt_exp.
cl_abap_unit_assert=>assert_equals(
act = lt_mock
exp = lt_exp ).
endmethod.
method to_abap_hashed_tab.
data lo_cut type ref to lcl_json_to_abap.
data lt_mock type tty_struc_hashed.
data lt_exp type tty_struc_hashed.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lo_nodes->add( ' | |array | | ' ).
lo_nodes->add( '/ |1 |object | |1' ).
lo_nodes->add( '/ |2 |object | |2' ).
lo_nodes->add( '/1/ |a |str |One | ' ).
lo_nodes->add( '/1/ |b |num |1 | ' ).
lo_nodes->add( '/2/ |a |str |Two | ' ).
lo_nodes->add( '/2/ |b |num |2 | ' ).
create object lo_cut.
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = lt_mock ).
data ls_elem like line of lt_exp.
ls_elem-a = 'One'.
ls_elem-b = 1.
insert ls_elem into table lt_exp.
ls_elem-a = 'Two'.
ls_elem-b = 2.
insert ls_elem into table lt_exp.
cl_abap_unit_assert=>assert_equals(
act = lt_mock
exp = lt_exp ).
endmethod.
method to_abap_sorted_tab.
data lo_cut type ref to lcl_json_to_abap.
data lt_mock type tty_struc_sorted.
data lt_exp type tty_struc_sorted.
data lo_nodes type ref to lcl_nodes_helper.
create object lo_nodes.
lo_nodes->add( ' | |array | | ' ).
lo_nodes->add( '/ |1 |object | |1' ).
lo_nodes->add( '/ |2 |object | |2' ).
lo_nodes->add( '/1/ |a |str |One | ' ).
lo_nodes->add( '/1/ |b |num |1 | ' ).
lo_nodes->add( '/2/ |a |str |Two | ' ).
lo_nodes->add( '/2/ |b |num |2 | ' ).
create object lo_cut.
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = lt_mock ).
data ls_elem like line of lt_exp.
ls_elem-a = 'One'.
ls_elem-b = 1.
insert ls_elem into table lt_exp.
ls_elem-a = 'Two'.
ls_elem-b = 2.
insert ls_elem into table lt_exp.
cl_abap_unit_assert=>assert_equals(
act = lt_mock
exp = lt_exp ).
endmethod.
method to_abap_negative.
data lo_cut type ref to lcl_json_to_abap.
data lx type ref to zcx_ajson_error.
data ls_mock type ty_complex.
create object lo_cut.
data lo_nodes type ref to lcl_nodes_helper.
try.
create object lo_nodes.
lo_nodes->add( ' | |object | ' ).
lo_nodes->add( '/ |str |object | ' ).
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = ls_mock ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Expected structure' ).
endtry.
try.
create object lo_nodes.
lo_nodes->add( ' | |object | ' ).
lo_nodes->add( '/ |str |array | ' ).
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = ls_mock ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Expected table' ).
endtry.
try.
create object lo_nodes.
lo_nodes->add( ' | |object | ' ).
lo_nodes->add( '/ |int |str |hello ' ).
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = ls_mock ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Source is not a number' ).
endtry.
try.
create object lo_nodes.
lo_nodes->add( ' | |object | ' ).
lo_nodes->add( '/ |date1 |str |baddate ' ).
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = ls_mock ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Unexpected date format' ).
endtry.
try.
create object lo_nodes.
lo_nodes->add( ' | |object | ' ).
lo_nodes->add( '/ |missing |str |123 ' ).
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = ls_mock ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Path not found' ).
endtry.
try.
data lt_str type string_table.
create object lo_nodes.
lo_nodes->add( ' | |array | | ' ).
lo_nodes->add( '/ |a |str |hello |1' ).
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = lt_str ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Need index to access tables' ).
endtry.
try.
data lr_obj type ref to object.
create object lo_nodes.
lo_nodes->add( ' | |str |hello | ' ).
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = lr_obj ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Cannot assign to ref' ).
endtry.
try.
data lr_data type ref to data.
create object lo_nodes.
lo_nodes->add( ' | |str |hello | ' ).
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = lr_data ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Cannot assign to ref' ).
endtry.
try.
data lt_hashed type hashed table of string with unique key table_line.
create object lo_nodes.
lo_nodes->add( ' | |array | | ' ).
lo_nodes->add( '/ |1 |str |One |1' ).
lo_nodes->add( '/ |2 |str |One |2' ).
lo_cut->to_abap(
exporting
it_nodes = lo_nodes->sorted( )
changing
c_container = lt_hashed ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Duplicate insertion' ).
endtry.
endmethod.
endclass.
**********************************************************************
* WRITER
**********************************************************************
class ltcl_writer_test definition final
for testing
risk level harmless
duration short.
private section.
methods set_ajson for testing raising zcx_ajson_error.
methods set_value for testing raising zcx_ajson_error.
methods ignore_empty for testing raising zcx_ajson_error.
methods set_obj for testing raising zcx_ajson_error.
methods set_tab for testing raising zcx_ajson_error.
methods set_tab_hashed for testing raising zcx_ajson_error.
methods prove_path_exists for testing raising zcx_ajson_error.
methods delete_subtree for testing raising zcx_ajson_error.
methods delete for testing raising zcx_ajson_error.
methods arrays for testing raising zcx_ajson_error.
methods arrays_negative for testing raising zcx_ajson_error.
methods root_assignment for testing raising zcx_ajson_error.
methods set_bool for testing raising zcx_ajson_error.
methods set_str for testing raising zcx_ajson_error.
methods set_int for testing raising zcx_ajson_error.
methods set_date for testing raising zcx_ajson_error.
methods set_timestamp for testing raising zcx_ajson_error.
methods read_only for testing raising zcx_ajson_error.
methods set_array_obj for testing raising zcx_ajson_error.
methods set_with_type for testing raising zcx_ajson_error.
methods set_with_type_slice
importing
io_json_in type ref to zcl_ajson
io_json_out type ref to zif_ajson
iv_path type string
raising
zcx_ajson_error.
endclass.
class zcl_ajson definition local friends ltcl_writer_test.
class ltcl_writer_test implementation.
method prove_path_exists.
data lo_cut type ref to zcl_ajson.
data lo_nodes_exp type ref to lcl_nodes_helper.
lo_cut = zcl_ajson=>create_empty( ).
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |object | ||1' ).
lo_nodes_exp->add( '/a/ |b |object | ||1' ).
lo_nodes_exp->add( '/a/b/ |c |object | ||1' ).
lo_nodes_exp->add( '/a/b/c/ |d |object | ||0' ).
lo_cut->prove_path_exists( '/a/b/c/d/' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |object | ||1' ).
lo_nodes_exp->add( '/a/ |b |object | ||1' ).
lo_nodes_exp->add( '/a/b/ |c |object | ||1' ).
lo_nodes_exp->add( '/a/b/c/ |d |object | ||1' ).
lo_nodes_exp->add( '/a/b/c/d |e |object | ||0' ).
lo_cut->prove_path_exists( '/a/b/c/d/e/' ).
endmethod.
method delete_subtree.
data lo_cut type ref to zcl_ajson.
data lo_nodes_exp type ref to lcl_nodes_helper.
lo_cut = zcl_ajson=>create_empty( ).
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |object | ||1' ).
lo_nodes_exp->add( '/a/ |b |object | ||1' ).
lo_nodes_exp->add( '/a/b/ |c |object | ||1' ).
lo_nodes_exp->add( '/a/b/c/ |d |object | ||0' ).
lo_cut->mt_json_tree = lo_nodes_exp->mt_nodes.
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |object | ||0' ).
lo_cut->delete_subtree(
iv_path = '/a/'
iv_name = 'b' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
endmethod.
method delete.
data lo_cut type ref to zcl_ajson.
data lo_nodes_exp type ref to lcl_nodes_helper.
lo_cut = zcl_ajson=>create_empty( ).
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |object | ||1' ).
lo_nodes_exp->add( '/a/ |b |object | ||1' ).
lo_nodes_exp->add( '/a/b/ |c |object | ||1' ).
lo_nodes_exp->add( '/a/b/c/ |d |object | ||0' ).
lo_cut->mt_json_tree = lo_nodes_exp->mt_nodes.
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |object | ||0' ).
lo_cut->zif_ajson~delete( iv_path = '/a/b' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |object | ||1' ).
lo_nodes_exp->add( '/a/ |b |object | ||1' ).
lo_nodes_exp->add( '/a/b/ |c |object | ||1' ).
lo_nodes_exp->add( '/a/b/c/ |d |object | ||0' ).
lo_cut->mt_json_tree = lo_nodes_exp->mt_nodes.
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |object | ||0' ).
lo_cut->zif_ajson~delete( iv_path = '/a/b/' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
endmethod.
method set_ajson.
data lo_nodes type ref to lcl_nodes_helper.
data lo_src type ref to zcl_ajson.
data lo_cut type ref to zcl_ajson.
data li_writer type ref to zif_ajson.
lo_src = zcl_ajson=>create_empty( ).
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
" Prepare source
create object lo_nodes.
lo_nodes->add( ' | |object | ||1' ).
lo_nodes->add( '/ |x |object | ||2' ).
lo_nodes->add( '/x/ |b |str |abc ||0' ).
lo_nodes->add( '/x/ |c |num |10 ||0' ).
lo_src->mt_json_tree = lo_nodes->mt_nodes.
" Test 1 - assign root
li_writer->set(
iv_path = ''
iv_val = lo_src ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
li_writer->set(
iv_path = '/'
iv_val = lo_src ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
" Test 2 - assign deep
create object lo_nodes.
lo_nodes->add( ' | |object | ||1' ).
lo_nodes->add( '/ |a |object | ||1' ).
lo_nodes->add( '/a/ |b |object | ||1' ).
lo_nodes->add( '/a/b/ |c |object | ||1' ).
lo_nodes->add( '/a/b/c/ |x |object | ||2' ).
lo_nodes->add( '/a/b/c/x/ |b |str |abc ||0' ).
lo_nodes->add( '/a/b/c/x/ |c |num |10 ||0' ).
li_writer->clear( ).
li_writer->set(
iv_path = '/a/b/c'
iv_val = lo_src ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
" Test 3 - assign rewrite
create object lo_nodes.
lo_nodes->add( ' | |object | ||1' ).
lo_nodes->add( '/ |a |object | ||1' ).
lo_nodes->add( '/a/ |b |object | ||1' ).
lo_nodes->add( '/a/b/ |x |object | ||2' ).
lo_nodes->add( '/a/b/x/ |b |str |abc ||0' ).
lo_nodes->add( '/a/b/x/ |c |num |10 ||0' ).
li_writer->set(
iv_path = '/a/b'
iv_val = lo_src ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
endmethod.
method set_value.
data lo_nodes type ref to lcl_nodes_helper.
data lo_cut type ref to zcl_ajson.
data li_writer type ref to zif_ajson.
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
" Prepare source
create object lo_nodes.
lo_nodes->add( ' | |object | ||1' ).
lo_nodes->add( '/ |x |object | ||2' ).
lo_nodes->add( '/x/ |b |str |abc ||0' ).
lo_nodes->add( '/x/ |c |num |10 ||0' ).
li_writer->set(
iv_path = '/x/b'
iv_val = 'abc' ).
li_writer->set(
iv_path = '/x/c'
iv_val = 10 ).
li_writer->set( " ignore empty
iv_path = '/x/d'
iv_val = 0 ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
endmethod.
method ignore_empty.
data lo_nodes type ref to lcl_nodes_helper.
data li_cut type ref to zif_ajson.
li_cut = zcl_ajson=>create_empty( ).
create object lo_nodes.
lo_nodes->add( ' | |object | ||1' ).
lo_nodes->add( '/ |a |num |1 ||0' ).
li_cut->set(
iv_path = '/a'
iv_val = 1 ).
li_cut->set( " ignore empty
iv_path = '/b'
iv_val = 0 ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
create object lo_nodes.
lo_nodes->add( ' | |object | ||2' ).
lo_nodes->add( '/ |a |num |1 ||0' ).
lo_nodes->add( '/ |b |num |0 ||0' ).
li_cut->set(
iv_ignore_empty = abap_false
iv_path = '/b'
iv_val = 0 ).
cl_abap_unit_assert=>assert_equals(
act = li_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
endmethod.
method set_obj.
data lo_nodes type ref to lcl_nodes_helper.
data lo_cut type ref to zcl_ajson.
data li_writer type ref to zif_ajson.
data:
begin of ls_struc,
b type string value 'abc',
c type i value 10,
end of ls_struc.
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
" Prepare source
create object lo_nodes.
lo_nodes->add( ' | |object | ||1' ).
lo_nodes->add( '/ |x |object | ||2' ).
lo_nodes->add( '/x/ |b |str |abc ||0' ).
lo_nodes->add( '/x/ |c |num |10 ||0' ).
li_writer->set(
iv_path = '/x'
iv_val = ls_struc ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
endmethod.
method set_tab.
data lo_nodes type ref to lcl_nodes_helper.
data lo_cut type ref to zcl_ajson.
data li_writer type ref to zif_ajson.
data lt_tab type string_table.
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
append 'hello' to lt_tab.
append 'world' to lt_tab.
" Prepare source
create object lo_nodes.
lo_nodes->add( ' | |object | | |1' ).
lo_nodes->add( '/ |x |array | | |2' ).
lo_nodes->add( '/x/ |1 |str |hello|1|0' ).
lo_nodes->add( '/x/ |2 |str |world|2|0' ).
li_writer->set(
iv_path = '/x'
iv_val = lt_tab ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
endmethod.
method set_tab_hashed.
data lo_nodes type ref to lcl_nodes_helper.
data lo_cut type ref to zcl_ajson.
data li_writer type ref to zif_ajson.
data lt_tab type hashed table of string with unique default key.
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
insert `hello` into table lt_tab.
insert `world` into table lt_tab.
" Prepare source
create object lo_nodes.
lo_nodes->add( ' | |object | | |1' ).
lo_nodes->add( '/ |x |array | | |2' ).
lo_nodes->add( '/x/ |1 |str |hello|1|0' ).
lo_nodes->add( '/x/ |2 |str |world|2|0' ).
li_writer->set(
iv_path = '/x'
iv_val = lt_tab ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes->sorted( ) ).
endmethod.
method arrays.
data lo_cut type ref to zcl_ajson.
data lo_nodes_exp type ref to lcl_nodes_helper.
data li_writer type ref to zif_ajson.
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
" touch
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | | |1' ).
lo_nodes_exp->add( '/ |a |array | | |0' ).
li_writer->touch_array( iv_path = '/a' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" add string
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | | |1' ).
lo_nodes_exp->add( '/ |a |array | | |1' ).
lo_nodes_exp->add( '/a/ |1 |str |hello|1|0' ).
li_writer->push(
iv_path = '/a'
iv_val = 'hello' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" add obj
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | | |1' ).
lo_nodes_exp->add( '/ |a |array | | |2' ).
lo_nodes_exp->add( '/a/ |1 |str |hello|1|0' ).
lo_nodes_exp->add( '/a/ |2 |object | |2|1' ).
lo_nodes_exp->add( '/a/2/ |x |str |world| |0' ).
data:
begin of ls_dummy,
x type string value 'world',
end of ls_dummy.
li_writer->push(
iv_path = '/a'
iv_val = ls_dummy ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" re-touch
li_writer->touch_array( iv_path = '/a' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" re-touch with clear
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | | |1' ).
lo_nodes_exp->add( '/ |a |array | | |0' ).
li_writer->touch_array(
iv_path = '/a'
iv_clear = abap_true ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" free-add array item (index must be updated)
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | | |1' ).
lo_nodes_exp->add( '/ |a |array | | |2' ).
lo_nodes_exp->add( '/a/ |1 |object | |1|1' ).
lo_nodes_exp->add( '/a/1/ |x |num |123 | |0' ).
lo_nodes_exp->add( '/a/ |2 |num |234 |2|0' ).
li_writer->set(
iv_path = '/a/1/x'
iv_val = 123 ).
li_writer->set(
iv_path = '/a/2'
iv_val = 234 ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
endmethod.
method arrays_negative.
data lo_cut type ref to zcl_ajson.
data li_writer type ref to zif_ajson.
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
li_writer->touch_array( iv_path = '/a' ).
li_writer->push(
iv_path = '/a'
iv_val = 123 ).
" touch another node
data lx type ref to zcx_ajson_error.
try.
li_writer->touch_array( iv_path = '/a/1' ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Path [/a/1] already used and is not array' ).
endtry.
" push to not array
try.
li_writer->push(
iv_path = '/a/1'
iv_val = 123 ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Path [/a/1] is not array' ).
endtry.
" push to not array
try.
li_writer->push(
iv_path = '/x'
iv_val = 123 ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Path [/x] does not exist' ).
endtry.
" set array item with non-numeric key
try.
li_writer->set(
iv_path = '/a/abc/x'
iv_val = 123 ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Cannot add non-numeric key [abc] to array [/a/]' ).
endtry.
try.
li_writer->set(
iv_path = '/a/abc'
iv_val = 123 ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Cannot add non-numeric key [abc] to array [/a/]' ).
endtry.
" set array item with zero key
try.
li_writer->set(
iv_path = '/a/0'
iv_val = 123 ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error into lx.
cl_abap_unit_assert=>assert_equals(
act = lx->message
exp = 'Cannot add zero key to array [/a/]' ).
endtry.
endmethod.
method root_assignment.
data lo_cut type ref to zcl_ajson.
data lo_nodes_exp type ref to lcl_nodes_helper.
data li_writer type ref to zif_ajson.
data:
begin of ls_dummy,
x type string value 'hello',
end of ls_dummy.
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
" object
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |x |str |hello||0' ).
li_writer->set(
iv_path = '/'
iv_val = ls_dummy ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" object empty path
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |x |str |hello||0' ).
li_writer->clear( ).
li_writer->set(
iv_path = ''
iv_val = ls_dummy ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" array
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |array | | |1' ).
lo_nodes_exp->add( '/ |1 |str |hello|1|0' ).
li_writer->clear( ).
li_writer->touch_array( iv_path = '' ).
li_writer->push(
iv_path = ''
iv_val = 'hello' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" value
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |str |hello||0' ).
li_writer->clear( ).
li_writer->set(
iv_path = ''
iv_val = 'hello' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
endmethod.
method set_bool.
data lo_cut type ref to zcl_ajson.
data lo_nodes_exp type ref to lcl_nodes_helper.
data li_writer type ref to zif_ajson.
data lt_tab type string_table.
" abap_bool
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||2' ).
lo_nodes_exp->add( '/ |a |bool |true ||0' ).
lo_nodes_exp->add( '/ |b |bool |false ||0' ).
li_writer->set_boolean(
iv_path = '/a'
iv_val = abap_true ).
li_writer->set_boolean(
iv_path = '/b'
iv_val = abap_false ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" int
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||2' ).
lo_nodes_exp->add( '/ |a |bool |true ||0' ).
lo_nodes_exp->add( '/ |b |bool |false ||0' ).
li_writer->set_boolean(
iv_path = '/a'
iv_val = 1 ).
li_writer->set_boolean(
iv_path = '/b'
iv_val = 0 ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
" tab
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||2' ).
lo_nodes_exp->add( '/ |a |bool |true ||0' ).
lo_nodes_exp->add( '/ |b |bool |false ||0' ).
append 'hello' to lt_tab.
li_writer->set_boolean(
iv_path = '/a'
iv_val = lt_tab ).
clear lt_tab.
li_writer->set_boolean(
iv_path = '/b'
iv_val = lt_tab ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
endmethod.
method set_str.
data lo_cut type ref to zcl_ajson.
data lo_nodes_exp type ref to lcl_nodes_helper.
data li_writer type ref to zif_ajson.
data lv_date type d.
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||3' ).
lo_nodes_exp->add( '/ |a |str |123 ||0' ).
lo_nodes_exp->add( '/ |b |str |X ||0' ).
lo_nodes_exp->add( '/ |c |str |20200705 ||0' ).
li_writer->set_string(
iv_path = '/a'
iv_val = '123' ).
li_writer->set_string(
iv_path = '/b'
iv_val = abap_true ).
lv_date = '20200705'.
li_writer->set_string(
iv_path = '/c'
iv_val = lv_date ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
endmethod.
method set_int.
data lo_cut type ref to zcl_ajson.
data lo_nodes_exp type ref to lcl_nodes_helper.
data li_writer type ref to zif_ajson.
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |num |123 ||0' ).
li_writer->set_integer(
iv_path = '/a'
iv_val = 123 ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
endmethod.
method set_date.
data lo_cut type ref to zcl_ajson.
data lo_nodes_exp type ref to lcl_nodes_helper.
data li_writer type ref to zif_ajson.
data lv_date type d.
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |str |2020-07-05 ||0' ).
lv_date = '20200705'.
li_writer->set_date(
iv_path = '/a'
iv_val = lv_date ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
endmethod.
method set_timestamp.
data lo_cut type ref to zcl_ajson.
data lo_nodes_exp type ref to lcl_nodes_helper.
data li_writer type ref to zif_ajson.
data lv_timestamp type timestamp.
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||1' ).
lo_nodes_exp->add( '/ |a |str |2021-05-05T12-00-00Z ||0' ).
lv_timestamp = '20210505120000'.
li_writer->set_timestamp(
iv_path = '/a'
iv_val = lv_timestamp ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
endmethod.
method read_only.
data lo_cut type ref to zcl_ajson.
data li_writer type ref to zif_ajson.
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
" Prepare source
li_writer->set(
iv_path = '/a'
iv_val = 'abc' ).
li_writer->touch_array( iv_path = '/b' ).
li_writer->push(
iv_path = '/b'
iv_val = 'abc' ).
lo_cut->freeze( ).
try.
li_writer->set(
iv_path = '/c'
iv_val = 'abc' ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error.
endtry.
try.
li_writer->touch_array( iv_path = '/d' ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error.
endtry.
try.
li_writer->push(
iv_path = '/b'
iv_val = 'xyz' ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error.
endtry.
try.
li_writer->delete( iv_path = '/a' ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error.
endtry.
try.
li_writer->clear( ).
cl_abap_unit_assert=>fail( ).
catch zcx_ajson_error.
endtry.
endmethod.
method set_array_obj.
data lo_cut type ref to zcl_ajson.
data lo_nodes_exp type ref to lcl_nodes_helper.
data li_writer type ref to zif_ajson.
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | | |1' ).
lo_nodes_exp->add( '/ |issues |array | | |2' ).
lo_nodes_exp->add( '/issues/ |1 |object | |1 |1' ).
lo_nodes_exp->add( '/issues/ |2 |object | |2 |1' ).
lo_nodes_exp->add( '/issues/1/ |end |object | | |2' ).
lo_nodes_exp->add( '/issues/1/end/ |col |num |26 | |0' ).
lo_nodes_exp->add( '/issues/1/end/ |row |num |4 | |0' ).
lo_nodes_exp->add( '/issues/2/ |end |object | | |2' ).
lo_nodes_exp->add( '/issues/2/end/ |col |num |22 | |0' ).
lo_nodes_exp->add( '/issues/2/end/ |row |num |3 | |0' ).
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
li_writer->touch_array( iv_path = '/issues' ).
li_writer->set(
iv_path = '/issues/1/end/col'
iv_val = 26 ).
li_writer->set(
iv_path = '/issues/1/end/row'
iv_val = 4 ).
li_writer->set(
iv_path = '/issues/2/end/col'
iv_val = 22 ).
li_writer->set(
iv_path = '/issues/2/end/row'
iv_val = 3 ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
endmethod.
method set_with_type.
data lo_sample type ref to zcl_ajson.
data lo_cut type ref to zcl_ajson.
data li_writer type ref to zif_ajson.
lo_sample = zcl_ajson=>parse( ltcl_parser_test=>sample_json( ) ).
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
set_with_type_slice( io_json_in = lo_sample
io_json_out = li_writer
iv_path = '/' ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->mt_json_tree
exp = lo_sample->mt_json_tree ).
endmethod.
method set_with_type_slice.
data lv_path type string.
field-symbols <node> type zif_ajson=>ty_node.
loop at io_json_in->mt_json_tree assigning <node> where path = iv_path.
lv_path = <node>-path && <node>-name && '/'.
case <node>-type.
when 'array'.
io_json_out->touch_array( lv_path ).
set_with_type_slice( io_json_in = io_json_in
io_json_out = io_json_out
iv_path = lv_path ).
when 'object'.
set_with_type_slice( io_json_in = io_json_in
io_json_out = io_json_out
iv_path = lv_path ).
when others.
io_json_out->set(
iv_path = lv_path
iv_val = <node>-value
iv_node_type = <node>-type ).
endcase.
endloop.
endmethod.
endclass.
**********************************************************************
* INTEGRATED
**********************************************************************
class ltcl_integrated definition
for testing
risk level harmless
duration short
final.
private section.
types:
begin of ty_loc,
row type i,
col type i,
end of ty_loc,
begin of ty_issue,
message type string,
key type string,
filename type string,
start type ty_loc,
end type ty_loc,
end of ty_issue,
tt_issues type standard table of ty_issue with default key,
begin of ty_target,
string type string,
number type i,
float type f,
boolean type abap_bool,
false type abap_bool,
null type string,
date type string, " ??? TODO
issues type tt_issues,
end of ty_target.
methods reader for testing raising zcx_ajson_error.
methods array_index for testing raising zcx_ajson_error.
methods array_simple for testing raising zcx_ajson_error.
methods stringify for testing raising zcx_ajson_error.
methods item_order_integrated for testing raising zcx_ajson_error.
methods chaining for testing raising zcx_ajson_error.
endclass.
class ltcl_integrated implementation.
method array_simple.
data lt_act type string_table.
data lt_exp type string_table.
data lv_exp type string.
data lv_src type string.
lv_src = '['.
do 10 times.
if sy-index <> 1.
lv_src = lv_src && `, `.
endif.
lv_src = lv_src && |"{ sy-index }"|.
lv_exp = |{ sy-index }|.
append lv_exp to lt_exp.
enddo.
lv_src = lv_src && ']'.
data li_reader type ref to zif_ajson.
li_reader = zcl_ajson=>parse( lv_src ).
li_reader->to_abap( importing ev_container = lt_act ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = lt_exp ).
endmethod.
method array_index.
data lt_act type table of ty_loc.
data lt_exp type table of ty_loc.
data ls_exp type ty_loc.
data lv_src type string.
lv_src = '['.
do 10 times.
if sy-index <> 1.
lv_src = lv_src && `, `.
endif.
lv_src = lv_src && |\{ "row": { sy-index } \}|.
ls_exp-row = sy-index.
append ls_exp to lt_exp.
enddo.
lv_src = lv_src && ']'.
data li_reader type ref to zif_ajson.
li_reader = zcl_ajson=>parse( lv_src ).
li_reader->to_abap( importing ev_container = lt_act ).
cl_abap_unit_assert=>assert_equals(
act = lt_act
exp = lt_exp ).
endmethod.
method reader.
data lv_source type string.
data li_reader type ref to zif_ajson.
lv_source = ltcl_parser_test=>sample_json( ).
li_reader = zcl_ajson=>parse( lv_source ).
cl_abap_unit_assert=>assert_equals(
act = li_reader->get( '/string' )
exp = 'abc' ).
data ls_act type ty_target.
data ls_exp type ty_target.
field-symbols <i> like line of ls_exp-issues.
ls_exp-string = 'abc'.
ls_exp-number = 123.
ls_exp-float = '123.45'.
ls_exp-boolean = abap_true.
ls_exp-false = abap_false.
ls_exp-date = '2020-03-15'.
append initial line to ls_exp-issues assigning <i>.
<i>-message = 'Indentation problem ...'.
<i>-key = 'indentation'.
<i>-filename = './zxxx.prog.abap'.
<i>-start-row = 4.
<i>-start-col = 3.
<i>-end-row = 4.
<i>-end-col = 26.
append initial line to ls_exp-issues assigning <i>.
<i>-message = 'Remove space before XXX'.
<i>-key = 'space_before_dot'.
<i>-filename = './zxxx.prog.abap'.
<i>-start-row = 3.
<i>-start-col = 21.
<i>-end-row = 3.
<i>-end-col = 22.
li_reader->to_abap( importing ev_container = ls_act ).
cl_abap_unit_assert=>assert_equals(
act = ls_act
exp = ls_exp ).
endmethod.
method stringify.
data lo_cut type ref to zcl_ajson.
data li_writer type ref to zif_ajson.
data lv_exp type string.
data: begin of ls_dummy, x type i, end of ls_dummy.
ls_dummy-x = 1.
lo_cut = zcl_ajson=>create_empty( ).
li_writer = lo_cut.
li_writer->set(
iv_path = '/a'
iv_val = 1 ).
li_writer->set(
iv_path = '/b'
iv_val = 'B' ).
li_writer->set(
iv_path = '/c'
iv_val = abap_true ).
li_writer->set_null( iv_path = '/d' ).
" simple test
lv_exp = '{"a":1,"b":"B","c":true,"d":null}'.
cl_abap_unit_assert=>assert_equals(
act = lo_cut->stringify( )
exp = lv_exp ).
li_writer->touch_array( iv_path = '/e' ).
li_writer->touch_array( iv_path = '/f' ).
li_writer->push(
iv_path = '/f'
iv_val = 5 ).
li_writer->push(
iv_path = '/f'
iv_val = ls_dummy ).
li_writer->set(
iv_path = '/g'
iv_val = ls_dummy ).
" complex test
lv_exp = '{"a":1,"b":"B","c":true,"d":null,"e":[],"f":[5,{"x":1}],"g":{"x":1}}'.
cl_abap_unit_assert=>assert_equals(
act = lo_cut->stringify( )
exp = lv_exp ).
" complex test indented
lv_exp =
'{\n' &&
' "a": 1,\n' &&
' "b": "B",\n' &&
' "c": true,\n' &&
' "d": null,\n' &&
' "e": [],\n' &&
' "f": [\n' &&
' 5,\n' &&
' {\n' &&
' "x": 1\n' &&
' }\n' &&
' ],\n' &&
' "g": {\n' &&
' "x": 1\n' &&
' }\n' &&
'}'.
lv_exp = replace(
val = lv_exp
sub = '\n'
with = cl_abap_char_utilities=>newline
occ = 0 ).
cl_abap_unit_assert=>assert_equals(
act = lo_cut->stringify( iv_indent = 2 )
exp = lv_exp ).
endmethod.
method item_order_integrated.
data:
begin of ls_dummy,
zulu type string,
alpha type string,
beta type string,
end of ls_dummy.
data lv_act type string.
data lv_exp type string.
data li_cut type ref to zif_ajson.
ls_dummy-alpha = 'a'.
ls_dummy-beta = 'b'.
ls_dummy-zulu = 'z'.
" NAME order
li_cut = zcl_ajson=>create_empty( ).
li_cut->set(
iv_path = '/'
iv_val = ls_dummy ).
lv_act = li_cut->stringify( ).
lv_exp = '{"alpha":"a","beta":"b","zulu":"z"}'.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
" STRUC order (keep)
li_cut = zcl_ajson=>create_empty( ).
li_cut->keep_item_order( ).
li_cut->set(
iv_path = '/'
iv_val = ls_dummy ).
lv_act = li_cut->stringify( ).
lv_exp = '{"zulu":"z","alpha":"a","beta":"b"}'.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp ).
endmethod.
method chaining.
data li_cut type ref to zif_ajson.
li_cut = zcl_ajson=>create_empty( ).
cl_abap_unit_assert=>assert_bound(
li_cut->set(
iv_path = '/a'
iv_val = 1 ) ).
cl_abap_unit_assert=>assert_bound( li_cut->delete( iv_path = '/a' ) ).
cl_abap_unit_assert=>assert_bound( li_cut->touch_array( iv_path = '/array' ) ).
cl_abap_unit_assert=>assert_bound(
li_cut->push(
iv_path = '/array'
iv_val = '1' ) ).
cl_abap_unit_assert=>assert_bound( li_cut->keep_item_order( ) ).
endmethod.
endclass.
**********************************************************************
* ABAP TO JSON
**********************************************************************
class ltcl_abap_to_json definition
for testing
risk level harmless
duration short
final.
private section.
types:
begin of ty_struc,
a type string,
b type i,
c type abap_bool,
d type xsdboolean,
end of ty_struc,
tt_struc type standard table of ty_struc with default key,
begin of ty_struc_complex.
include type ty_struc.
types:
el type string,
struc type ty_struc,
tab type tt_struc,
stab type string_table,
end of ty_struc_complex.
methods set_ajson for testing raising zcx_ajson_error.
methods set_value_number for testing raising zcx_ajson_error.
methods set_value_string for testing raising zcx_ajson_error.
methods set_value_true for testing raising zcx_ajson_error.
methods set_value_false for testing raising zcx_ajson_error.
methods set_value_xsdboolean for testing raising zcx_ajson_error.
methods set_null for testing raising zcx_ajson_error.
methods set_obj for testing raising zcx_ajson_error.
methods set_array for testing raising zcx_ajson_error.
methods set_complex_obj for testing raising zcx_ajson_error.
methods prefix for testing raising zcx_ajson_error.
endclass.
class zcl_ajson definition local friends ltcl_abap_to_json.
class ltcl_abap_to_json implementation.
method set_ajson.
data lo_nodes type ref to lcl_nodes_helper.
data lo_src type ref to zcl_ajson.
lo_src = zcl_ajson=>create_empty( ).
create object lo_nodes.
lo_nodes->add( ' | |object | ||1' ).
lo_nodes->add( '/ |a |object | ||1' ).
lo_nodes->add( '/a/ |b |object | ||1' ).
lo_nodes->add( '/a/b/ |c |object | ||0' ).
lo_src->mt_json_tree = lo_nodes->mt_nodes.
data lt_nodes type zif_ajson=>ty_nodes_tt.
lt_nodes = lcl_abap_to_json=>convert( iv_data = lo_src ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes->mt_nodes ).
endmethod.
method set_value_number.
data lo_nodes_exp type ref to lcl_nodes_helper.
data lt_nodes type zif_ajson=>ty_nodes_tt.
" number
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |num |1 ||' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = 1 ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
endmethod.
method set_value_string.
data lo_nodes_exp type ref to lcl_nodes_helper.
data lt_nodes type zif_ajson=>ty_nodes_tt.
" string
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |str |abc ||' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = 'abc' ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
endmethod.
method set_value_true.
data lo_nodes_exp type ref to lcl_nodes_helper.
data lt_nodes type zif_ajson=>ty_nodes_tt.
" true
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |bool |true ||' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = abap_true ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
endmethod.
method set_value_false.
data lo_nodes_exp type ref to lcl_nodes_helper.
data lt_nodes type zif_ajson=>ty_nodes_tt.
" false
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |bool |false ||' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = abap_false ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
endmethod.
method set_value_xsdboolean.
data lo_nodes_exp type ref to lcl_nodes_helper.
data lt_nodes type zif_ajson=>ty_nodes_tt.
data lv_xsdboolean type xsdboolean.
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |bool |true ||' ).
lv_xsdboolean = 'X'.
lt_nodes = lcl_abap_to_json=>convert( iv_data = lv_xsdboolean ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
endmethod.
method set_null.
data lo_nodes_exp type ref to lcl_nodes_helper.
data lt_nodes type zif_ajson=>ty_nodes_tt.
data lv_null_ref type ref to data.
" null
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |null |null ||' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = lv_null_ref ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
endmethod.
method prefix.
data lo_nodes_exp type ref to lcl_nodes_helper.
data lt_nodes type zif_ajson=>ty_nodes_tt.
data ls_prefix type zif_ajson=>ty_path_name.
ls_prefix-path = '/a/'.
ls_prefix-name = 'b'.
create object lo_nodes_exp.
lo_nodes_exp->add( '/a/ |b |num |1 ||' ).
lt_nodes = lcl_abap_to_json=>convert(
iv_data = 1
is_prefix = ls_prefix ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
endmethod.
method set_obj.
data lo_nodes_exp type ref to lcl_nodes_helper.
data ls_struc type ty_struc.
data lt_nodes type zif_ajson=>ty_nodes_tt.
ls_struc-a = 'abc'.
ls_struc-b = 10.
ls_struc-c = abap_true.
ls_struc-d = 'X'.
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||4' ).
lo_nodes_exp->add( '/ |a |str |abc ||0' ).
lo_nodes_exp->add( '/ |b |num |10 ||0' ).
lo_nodes_exp->add( '/ |c |bool |true ||0' ).
lo_nodes_exp->add( '/ |d |bool |true ||0' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = ls_struc ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
endmethod.
method set_complex_obj.
data lo_nodes_exp type ref to lcl_nodes_helper.
data ls_struc type ty_struc_complex.
data lt_nodes type zif_ajson=>ty_nodes_tt.
field-symbols <i> like line of ls_struc-tab.
ls_struc-a = 'abc'.
ls_struc-b = 10.
ls_struc-c = abap_true.
ls_struc-d = 'X'.
ls_struc-el = 'elem'.
ls_struc-struc-a = 'deep'.
ls_struc-struc-b = 123.
append 'hello' to ls_struc-stab.
append 'world' to ls_struc-stab.
append initial line to ls_struc-tab assigning <i>.
<i>-a = 'abc'.
append initial line to ls_struc-tab assigning <i>.
<i>-a = 'bcd'.
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | ||8' ).
lo_nodes_exp->add( '/ |a |str |abc ||0' ).
lo_nodes_exp->add( '/ |b |num |10 ||0' ).
lo_nodes_exp->add( '/ |c |bool |true ||0' ).
lo_nodes_exp->add( '/ |d |bool |true ||0' ).
lo_nodes_exp->add( '/ |el |str |elem ||0' ).
lo_nodes_exp->add( '/ |struc |object | ||4' ).
lo_nodes_exp->add( '/struc/|a |str |deep ||0' ).
lo_nodes_exp->add( '/struc/|b |num |123 ||0' ).
lo_nodes_exp->add( '/struc/|c |bool |false||0' ).
lo_nodes_exp->add( '/struc/|d |bool |false||0' ).
lo_nodes_exp->add( '/ |tab |array | | |2' ).
lo_nodes_exp->add( '/tab/ |1 |object | |1|4' ).
lo_nodes_exp->add( '/tab/1/|a |str |abc | |0' ).
lo_nodes_exp->add( '/tab/1/|b |num |0 | |0' ).
lo_nodes_exp->add( '/tab/1/|c |bool |false| |0' ).
lo_nodes_exp->add( '/tab/1/|d |bool |false| |0' ).
lo_nodes_exp->add( '/tab/ |2 |object | |2|4' ).
lo_nodes_exp->add( '/tab/2/|a |str |bcd | |0' ).
lo_nodes_exp->add( '/tab/2/|b |num |0 | |0' ).
lo_nodes_exp->add( '/tab/2/|c |bool |false| |0' ).
lo_nodes_exp->add( '/tab/2/|d |bool |false| |0' ).
lo_nodes_exp->add( '/ |stab |array | | |2' ).
lo_nodes_exp->add( '/stab/ |1 |str |hello|1|0' ).
lo_nodes_exp->add( '/stab/ |2 |str |world|2|0' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = ls_struc ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
endmethod.
method set_array.
data lo_nodes_exp type ref to lcl_nodes_helper.
data lt_nodes type zif_ajson=>ty_nodes_tt.
data lt_tab type table of ty_struc.
field-symbols <s> like line of lt_tab.
append initial line to lt_tab assigning <s>.
<s>-a = 'abc'.
<s>-b = 10.
append initial line to lt_tab assigning <s>.
<s>-a = 'bcd'.
<s>-b = 20.
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |array | | |2' ).
lo_nodes_exp->add( '/ |1 |object | |1|4' ).
lo_nodes_exp->add( '/1/ |a |str |abc | |0' ).
lo_nodes_exp->add( '/1/ |b |num |10 | |0' ).
lo_nodes_exp->add( '/1/ |c |bool |false| |0' ).
lo_nodes_exp->add( '/1/ |d |bool |false| |0' ).
lo_nodes_exp->add( '/ |2 |object | |2|4' ).
lo_nodes_exp->add( '/2/ |a |str |bcd | |0' ).
lo_nodes_exp->add( '/2/ |b |num |20 | |0' ).
lo_nodes_exp->add( '/2/ |c |bool |false| |0' ).
lo_nodes_exp->add( '/2/ |d |bool |false| |0' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = lt_tab ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
data lt_strtab type string_table.
append 'abc' to lt_strtab.
append 'bcd' to lt_strtab.
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |array | | |2' ).
lo_nodes_exp->add( '/ |1 |str |abc |1|0' ).
lo_nodes_exp->add( '/ |2 |str |bcd |2|0' ).
lt_nodes = lcl_abap_to_json=>convert( iv_data = lt_strtab ).
cl_abap_unit_assert=>assert_equals(
act = lt_nodes
exp = lo_nodes_exp->mt_nodes ).
endmethod.
endclass.
**********************************************************************
* FILTER TEST
**********************************************************************
class ltcl_filter_test definition final
for testing
duration short
risk level harmless.
public section.
interfaces zif_ajson_filter.
private section.
types:
begin of ty_visit_history,
path type string,
type type zif_ajson_filter=>ty_visit_type,
end of ty_visit_history.
data mt_visit_history type table of ty_visit_history.
methods simple_test for testing raising zcx_ajson_error.
methods array_test for testing raising zcx_ajson_error.
methods visit_types for testing raising zcx_ajson_error.
endclass.
class ltcl_filter_test implementation.
method zif_ajson_filter~keep_node.
data ls_visit_history like line of mt_visit_history.
if iv_visit > 0.
ls_visit_history-type = iv_visit.
ls_visit_history-path = is_node-path && is_node-name && '/'.
append ls_visit_history to mt_visit_history.
endif.
rv_keep = boolc( not is_node-name ca 'xX' and not is_node-value ca 'xX' ).
endmethod.
method simple_test.
data lo_json type ref to zcl_ajson.
data lo_json_filtered type ref to zcl_ajson.
data lo_nodes_exp type ref to lcl_nodes_helper.
lo_json = zcl_ajson=>create_empty( ).
lo_json->set(
iv_path = '/a'
iv_val = 1 ).
lo_json->set(
iv_path = '/b'
iv_val = 1 ).
lo_json->set(
iv_path = '/x'
iv_val = 1 ).
lo_json->set(
iv_path = '/c/x'
iv_val = 1 ).
lo_json->set(
iv_path = '/c/y'
iv_val = 1 ).
lo_json_filtered = zcl_ajson=>create_from(
ii_source_json = lo_json
ii_filter = me ).
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |object | | |3' ).
lo_nodes_exp->add( '/ |a |num |1 | |0' ).
lo_nodes_exp->add( '/ |b |num |1 | |0' ).
lo_nodes_exp->add( '/ |c |object | | |1' ).
lo_nodes_exp->add( '/c/ |y |num |1 | |0' ).
cl_abap_unit_assert=>assert_equals(
act = lo_json_filtered->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
endmethod.
method array_test.
data lo_json type ref to zcl_ajson.
data lo_json_filtered type ref to zcl_ajson.
data lo_nodes_exp type ref to lcl_nodes_helper.
lo_json = zcl_ajson=>create_empty( ).
lo_json->touch_array( '/' ).
lo_json->push(
iv_path = '/'
iv_val = 'a' ).
lo_json->push(
iv_path = '/'
iv_val = 'x' ).
lo_json->push(
iv_path = '/'
iv_val = 'b' ).
lo_json_filtered = zcl_ajson=>create_from(
ii_source_json = lo_json
ii_filter = me ).
create object lo_nodes_exp.
lo_nodes_exp->add( ' | |array | | |2' ).
lo_nodes_exp->add( '/ |1 |str |a |1|0' ).
lo_nodes_exp->add( '/ |2 |str |b |2|0' ).
cl_abap_unit_assert=>assert_equals(
act = lo_json_filtered->mt_json_tree
exp = lo_nodes_exp->sorted( ) ).
endmethod.
method visit_types.
data lo_json type ref to zcl_ajson.
data lo_json_filtered type ref to zcl_ajson.
data lt_visits_exp like mt_visit_history.
field-symbols <v> like line of lt_visits_exp.
data:
begin of ls_dummy,
d type i value 10,
e type i value 20,
end of ls_dummy.
clear mt_visit_history.
lo_json = zcl_ajson=>create_empty( ).
lo_json->touch_array( '/' ).
lo_json->push(
iv_path = '/'
iv_val = 'a' ).
lo_json->push(
iv_path = '/'
iv_val = 'b' ).
lo_json->push(
iv_path = '/'
iv_val = ls_dummy ).
lo_json_filtered = zcl_ajson=>create_from(
ii_source_json = lo_json
ii_filter = me ).
append initial line to lt_visits_exp assigning <v>.
<v>-path = '/'.
<v>-type = zif_ajson_filter=>visit_type-open.
append initial line to lt_visits_exp assigning <v>.
<v>-path = '/3/'.
<v>-type = zif_ajson_filter=>visit_type-open.
append initial line to lt_visits_exp assigning <v>.
<v>-path = '/3/'.
<v>-type = zif_ajson_filter=>visit_type-close.
append initial line to lt_visits_exp assigning <v>.
<v>-path = '/'.
<v>-type = zif_ajson_filter=>visit_type-close.
cl_abap_unit_assert=>assert_equals(
act = mt_visit_history
exp = lt_visits_exp ).
endmethod.
endclass.
| [
17174,
17174,
2466,
1174,
198,
9,
19255,
4146,
198,
17174,
17174,
2466,
1174,
198,
4871,
300,
565,
62,
77,
4147,
62,
2978,
525,
6770,
2457,
13,
198,
220,
1171,
2665,
13,
628,
220,
220,
220,
1366,
45079,
62,
77,
4147,
2099,
1976,
361,
62,
1228,
1559,
14804,
774,
62,
77,
4147,
62,
926,
13,
198,
220,
220,
220,
5050,
751,
198,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
2536,
2099,
4731,
13,
198,
220,
220,
220,
5050,
1598,
13,
198,
220,
220,
220,
5050,
23243,
198,
220,
220,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
7,
17034,
62,
77,
4147,
8,
2099,
1976,
361,
62,
1228,
1559,
14804,
774,
62,
77,
4147,
62,
912,
13,
198,
198,
437,
4871,
13,
198,
198,
4871,
300,
565,
62,
77,
4147,
62,
2978,
525,
7822,
13,
198,
220,
2446,
751,
13,
628,
220,
220,
220,
2214,
12,
1837,
2022,
10220,
1279,
77,
29,
588,
1627,
286,
45079,
62,
77,
4147,
13,
198,
220,
220,
220,
1366,
300,
85,
62,
17197,
2099,
4731,
13,
198,
220,
220,
220,
1366,
300,
85,
62,
9630,
2099,
4731,
13,
198,
220,
220,
220,
1366,
300,
85,
62,
2875,
2099,
4731,
13,
628,
220,
220,
220,
24443,
4238,
1627,
284,
45079,
62,
77,
4147,
38875,
1279,
77,
28401,
628,
220,
220,
220,
6626,
21628,
62,
2536,
379,
705,
91,
6,
656,
198,
220,
220,
220,
220,
220,
1279,
77,
29,
12,
6978,
198,
220,
220,
220,
220,
220,
1279,
77,
29,
12,
3672,
198,
220,
220,
220,
220,
220,
1279,
77,
29,
12,
4906,
198,
220,
220,
220,
220,
220,
1279,
77,
29,
12,
8367,
198,
220,
220,
220,
220,
220,
300,
85,
62,
9630,
198,
220,
220,
220,
220,
220,
300,
85,
62,
17197,
198,
220,
220,
220,
220,
220,
300,
85,
62,
2875,
13,
198,
220,
220,
220,
1779,
1072,
1279,
77,
29,
12,
6978,
13,
198,
220,
220,
220,
1779,
1072,
1279,
77,
29,
12,
3672,
13,
198,
220,
220,
220,
1779,
1072,
1279,
77,
29,
12,
4906,
13,
198,
220,
220,
220,
1779,
1072,
1279,
77,
29,
12,
8367,
13,
198,
220,
220,
220,
1279,
77,
29,
12,
9630,
796,
300,
85,
62,
9630,
13,
198,
220,
220,
220,
1279,
77,
29,
12,
17197,
796,
300,
85,
62,
17197,
13,
198,
220,
220,
220,
1279,
77,
29,
12,
2875,
796,
300,
85,
62,
2875,
13,
628,
220,
886,
24396,
13,
628,
220,
2446,
23243,
13,
198,
220,
220,
220,
374,
83,
62,
77,
4147,
796,
45079,
62,
77,
4147,
13,
198,
220,
886,
24396,
13,
628,
220,
2446,
1598,
13,
198,
220,
220,
220,
1598,
45079,
62,
77,
4147,
13,
198,
220,
886,
24396,
13,
198,
437,
4871,
13,
198,
198,
17174,
17174,
2466,
1174,
198,
9,
350,
27415,
1137,
198,
17174,
17174,
2466,
1174,
198,
198,
4871,
300,
83,
565,
62,
48610,
62,
9288,
6770,
2457,
198,
220,
329,
4856,
198,
220,
2526,
1241,
23585,
198,
220,
9478,
1790,
13,
628,
220,
1171,
2665,
13,
628,
220,
220,
220,
1398,
12,
24396,
82,
6291,
62,
17752,
198,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
25512,
1352,
2099,
4731,
11902,
198,
220,
220,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
7,
81,
85,
62,
17752,
8,
2099,
4731,
13,
628,
220,
2839,
2665,
13,
198,
220,
220,
220,
1366,
6941,
62,
8968,
2099,
1006,
284,
300,
565,
62,
17752,
62,
48610,
13,
198,
220,
220,
220,
1366,
6941,
62,
77,
4147,
2099,
1006,
284,
300,
565,
62,
77,
4147,
62,
2978,
525,
13,
628,
220,
220,
220,
5050,
9058,
13,
198,
220,
220,
220,
5050,
21136,
329,
4856,
8620,
1976,
66,
87,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
5050,
21136,
62,
8841,
329,
4856,
8620,
1976,
66,
87,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
5050,
21136,
62,
17618,
329,
4856,
8620,
1976,
66,
87,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
5050,
21136,
62,
22468,
329,
4856,
8620,
1976,
66,
87,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
5050,
21136,
62,
2127,
21052,
329,
4856,
8620,
1976,
66,
87,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
5050,
21136,
62,
9562,
329,
4856,
8620,
1976,
66,
87,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
5050,
21136,
62,
8423,
329,
4856,
8620,
1976,
66,
87,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
5050,
21136,
62,
4475,
329,
4856,
8620,
1976,
66,
87,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
5050,
21136,
62,
49382,
62,
27160,
329,
4856,
8620,
1976,
66,
87,
62,
1228,
1559,
62,
18224,
13,
198,
220,
220,
220,
5050,
21136,
62,
18224,
329,
4856,
8620,
1976,
66,
87,
62,
1228,
1559,
62,
18224,
13,
198,
198,
437,
4871,
13,
198,
198,
4871,
300,
83,
565,
62,
48610,
62,
9288,
7822,
13,
628,
220,
2446,
9058,
13,
198,
220,
220,
220,
2251,
2134,
6941,
62,
8968,
13,
198,
220,
220,
220,
2251,
2134,
6941,
62,
77,
4147,
13,
198,
220,
886,
24396,
13,
628,
220,
2446,
21136,
62,
49382,
62,
27160,
13,
628,
220,
220,
220,
1366,
300,
83,
62,
529,
2099,
1976,
361,
62,
1228,
1559,
14804,
774,
62,
77,
4147,
62,
926,
13,
628,
220,
220,
220,
6941,
62,
77,
4147,
3784,
2860,
7,
705,
930,
930,
2536,
930,
39305,
930,
930,
15,
6,
6739,
198,
220,
220,
220,
300,
83,
62,
529,
796,
6941,
62,
8968,
3784,
29572,
7,
705,
1,
39305,
30543,
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,
300,
83,
62,
529,
198,
220,
220,
220,
220,
220,
1033,
796,
6941,
62,
77,
4147,
3784,
16762,
62,
77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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
] |
FUNCTION zbt_search_bug.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" REFERENCE(SCREEN_ATTRIBUTES) TYPE ZBT_SCREEN_ATTRIBUTES
*" OPTIONAL
*" REFERENCE(RESULTS_ALV_CTRL) TYPE REF TO ZINF_RESULTS_ALV_CTRL
*" CHANGING
*" REFERENCE(BUG) TYPE ZBT_BUG_RANGE OPTIONAL
*" REFERENCE(BUGSTYPE) TYPE ZBT_BUGSTYPE_RANGE OPTIONAL
*" REFERENCE(BUGTYPE) TYPE ZBT_BUGTYPE_RANGE OPTIONAL
*" REFERENCE(COMPONENTE) TYPE ZBT_COMPONENTE_RANGE OPTIONAL
*" REFERENCE(DEADLINE) TYPE ZBT_DATS_RANGE OPTIONAL
*" REFERENCE(ESTADO) TYPE ZBT_ESTADO_RANGE OPTIONAL
*" REFERENCE(HORAS_ESTIMADAS) TYPE ZBT_HORAS_RANGE OPTIONAL
*" REFERENCE(HORAS_REALES) TYPE ZBT_HORAS_RANGE OPTIONAL
*" REFERENCE(PRODUCTO) TYPE ZBT_PRODUCTO_RANGE OPTIONAL
*" REFERENCE(RESUMEN) TYPE ZBT_TEXT_RANGE OPTIONAL
*" REFERENCE(CREADO) TYPE ZBT_TIMESTAMP_RANGE OPTIONAL
*" REFERENCE(REPORTER) TYPE ZBT_USER_RANGE OPTIONAL
*" REFERENCE(DEVELOPER) TYPE ZBT_USER_RANGE OPTIONAL
*" REFERENCE(ASSIGNED) TYPE ZBT_USER_RANGE OPTIONAL
*" REFERENCE(TESTER) TYPE ZBT_USER_RANGE OPTIONAL
*" REFERENCE(FINALIZADO) TYPE ZBT_TIMESTAMP_RANGE OPTIONAL
*" REFERENCE(AEDAT) TYPE ZBT_TIMESTAMP_RANGE OPTIONAL
*" REFERENCE(AENAM) TYPE ZBT_USER_RANGE OPTIONAL
*"----------------------------------------------------------------------
PERFORM init_global_data.
g_title = screen_attributes-title.
g_subscreen-repid = sy-repid.
g_subscreen-dynnr = '0002'.
go_results_handler = results_alv_ctrl.
s_bug[] = bug[].
s_comp[] = componente[].
s_dead[] = deadline[].
s_dev[] = developer[].
s_enddat[] = finalizado[].
s_erdat[] = creado[].
s_estado[] = estado[].
s_prod[] = producto[].
s_rep[] = reporter[].
s_stype[] = bugstype[].
s_type[] = bugtype[].
s_assig[] = assigned[].
s_test[] = tester[].
CALL SCREEN 0001 STARTING AT screen_attributes-top
screen_attributes-left
ENDING AT screen_attributes-bottom
screen_attributes-rigth.
bug[] = s_bug[].
componente[] = s_comp[].
deadline[] = s_dead[].
developer[] = s_dev[].
finalizado[] = s_enddat[].
creado[] = s_erdat[].
estado[] = s_estado[].
producto[] = s_prod[].
reporter[] = s_rep[].
bugstype[] = s_stype[].
bugtype[] = s_type[].
assigned[] = s_assig[].
tester[] = s_test[].
endfunction.
| [
42296,
4177,
2849,
1976,
18347,
62,
12947,
62,
25456,
13,
198,
9,
1,
10097,
23031,
198,
9,
1,
9,
1,
43,
482,
1000,
45606,
715,
301,
13485,
25,
198,
9,
1,
220,
30023,
9863,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
6173,
2200,
1677,
62,
1404,
5446,
9865,
3843,
1546,
8,
41876,
220,
1168,
19313,
62,
6173,
2200,
1677,
62,
1404,
5446,
9865,
3843,
1546,
198,
9,
1,
220,
220,
220,
220,
220,
220,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
46274,
62,
1847,
53,
62,
4177,
7836,
8,
41876,
4526,
37,
5390,
220,
1168,
1268,
37,
62,
46274,
62,
1847,
53,
62,
4177,
7836,
198,
9,
1,
220,
5870,
15567,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
12953,
8,
41876,
220,
1168,
19313,
62,
12953,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
12953,
2257,
56,
11401,
8,
41876,
220,
1168,
19313,
62,
12953,
2257,
56,
11401,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
12953,
25216,
8,
41876,
220,
1168,
19313,
62,
12953,
25216,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
9858,
47,
1340,
3525,
36,
8,
41876,
220,
1168,
19313,
62,
9858,
47,
1340,
3525,
36,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
7206,
2885,
24027,
8,
41876,
220,
1168,
19313,
62,
35,
33586,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
6465,
2885,
46,
8,
41876,
220,
1168,
19313,
62,
6465,
2885,
46,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
39,
1581,
1921,
62,
6465,
3955,
2885,
1921,
8,
41876,
220,
1168,
19313,
62,
39,
1581,
1921,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
39,
1581,
1921,
62,
2200,
1847,
1546,
8,
41876,
220,
1168,
19313,
62,
39,
1581,
1921,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
4805,
28644,
46,
8,
41876,
220,
1168,
19313,
62,
4805,
28644,
46,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
19535,
5883,
1677,
8,
41876,
220,
1168,
19313,
62,
32541,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
34,
15675,
46,
8,
41876,
220,
1168,
19313,
62,
51,
3955,
6465,
23518,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
35316,
1581,
5781,
8,
41876,
220,
1168,
19313,
62,
29904,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
7206,
18697,
31054,
8,
41876,
220,
1168,
19313,
62,
29904,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
10705,
16284,
1961,
8,
41876,
220,
1168,
19313,
62,
29904,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
51,
1546,
5781,
8,
41876,
220,
1168,
19313,
62,
29904,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
37,
17961,
14887,
2885,
46,
8,
41876,
220,
1168,
19313,
62,
51,
3955,
6465,
23518,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
32,
1961,
1404,
8,
41876,
220,
1168,
19313,
62,
51,
3955,
6465,
23518,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
32,
1677,
2390,
8,
41876,
220,
1168,
19313,
62,
29904,
62,
49,
27746,
39852,
2849,
1847,
198,
9,
1,
10097,
23031,
628,
220,
19878,
21389,
2315,
62,
20541,
62,
7890,
13,
628,
220,
308,
62,
7839,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
3159,
62,
1078,
7657,
12,
7839,
13,
198,
220,
308,
62,
7266,
9612,
12,
7856,
312,
796,
827,
12,
7856,
312,
13,
198,
220,
308,
62,
7266,
9612,
12,
67,
2047,
48624,
796,
705,
34215,
4458,
628,
220,
467,
62,
43420,
62,
30281,
796,
2482,
62,
282,
85,
62,
44755,
13,
628,
220,
264,
62,
25456,
21737,
220,
220,
220,
220,
796,
5434,
58,
4083,
198,
220,
264,
62,
5589,
21737,
220,
220,
220,
796,
7515,
68,
58,
4083,
198,
220,
264,
62,
25124,
21737,
220,
220,
220,
796,
12508,
58,
4083,
198,
220,
264,
62,
7959,
21737,
220,
220,
220,
220,
796,
8517,
58,
4083,
198,
220,
264,
62,
437,
19608,
21737,
220,
796,
2457,
528,
4533,
58,
4083,
198,
220,
264,
62,
263,
19608,
21737,
220,
220,
796,
269,
961,
78,
58,
4083,
198,
220,
264,
62,
395,
4533,
21737,
220,
796,
1556,
4533,
58,
4083,
198,
220,
264,
62,
1676,
67,
21737,
220,
220,
220,
796,
1720,
78,
58,
4083,
198,
220,
264,
62,
7856,
21737,
220,
220,
220,
220,
796,
9095,
58,
4083,
198,
220,
264,
62,
301,
2981,
21737,
220,
220,
796,
5434,
301,
2981,
58,
4083,
198,
220,
264,
62,
4906,
21737,
220,
220,
220,
796,
5434,
4906,
58,
4083,
198,
220,
264,
62,
562,
328,
21737,
220,
220,
796,
8686,
58,
4083,
198,
220,
264,
62,
9288,
21737,
220,
220,
220,
796,
256,
7834,
58,
4083,
628,
198,
220,
42815,
6374,
2200,
1677,
3571,
486,
33303,
2751,
5161,
3159,
62,
1078,
7657,
12,
4852,
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,
3159,
62,
1078,
7657,
12,
9464,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
2751,
5161,
220,
220,
3159,
62,
1078,
7657,
12,
22487,
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
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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STRACT.
PUBLIC SECTION.
METHODS:
constructor
IMPORTING
is_item TYPE zif_abapgit_definitions=>ty_item
iv_language TYPE spras.
CLASS-METHODS:
jump_adt
IMPORTING iv_obj_name TYPE zif_abapgit_definitions=>ty_item-obj_name
iv_obj_type TYPE zif_abapgit_definitions=>ty_item-obj_type
iv_sub_obj_name TYPE zif_abapgit_definitions=>ty_item-obj_name OPTIONAL
iv_sub_obj_type TYPE zif_abapgit_definitions=>ty_item-obj_type OPTIONAL
iv_line_number TYPE i OPTIONAL
RAISING zcx_abapgit_exception.
CONSTANTS: c_user_unknown TYPE xubname VALUE 'UNKNOWN'.
PROTECTED SECTION.
DATA ms_item TYPE zif_abapgit_definitions=>ty_item .
DATA mv_language TYPE spras .
METHODS check_timestamp
IMPORTING
!iv_timestamp TYPE timestamp
!iv_date TYPE d
!iv_time TYPE t
RETURNING
VALUE(rv_changed) TYPE abap_bool .
METHODS get_metadata
RETURNING
VALUE(rs_metadata) TYPE zif_abapgit_definitions=>ty_metadata .
METHODS corr_insert
IMPORTING
!iv_package TYPE devclass
!ig_object_class TYPE any OPTIONAL
RAISING
zcx_abapgit_exception .
METHODS tadir_insert
IMPORTING
!iv_package TYPE devclass
RAISING
zcx_abapgit_exception .
METHODS jump_se11
IMPORTING
!iv_radio TYPE string
!iv_field TYPE string
RAISING
zcx_abapgit_exception .
METHODS exists_a_lock_entry_for
IMPORTING
!iv_lock_object TYPE string
!iv_argument TYPE seqg3-garg OPTIONAL
RETURNING
VALUE(rv_exists_a_lock_entry) TYPE abap_bool
RAISING
zcx_abapgit_exception .
METHODS set_default_package
IMPORTING
!iv_package TYPE devclass .
METHODS serialize_longtexts
IMPORTING
!io_xml TYPE REF TO zcl_abapgit_xml_output
!iv_longtext_id TYPE dokil-id OPTIONAL
!it_dokil TYPE zif_abapgit_definitions=>tty_dokil OPTIONAL
RAISING
zcx_abapgit_exception .
METHODS deserialize_longtexts
IMPORTING
!io_xml TYPE REF TO zcl_abapgit_xml_input
RAISING
zcx_abapgit_exception .
METHODS delete_longtexts
IMPORTING
!iv_longtext_id TYPE dokil-id
RAISING
zcx_abapgit_exception .
METHODS is_active
RETURNING
VALUE(rv_active) TYPE abap_bool
RAISING
zcx_abapgit_exception .
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECTS_SUPER IMPLEMENTATION.
METHOD check_timestamp.
DATA: lv_ts TYPE timestamp.
IF sy-subrc = 0 AND iv_date IS NOT INITIAL AND iv_time IS NOT INITIAL.
cl_abap_tstmp=>systemtstmp_syst2utc(
EXPORTING syst_date = iv_date
syst_time = iv_time
IMPORTING utc_tstmp = lv_ts ).
IF lv_ts < iv_timestamp.
rv_changed = abap_false. " Unchanged
ELSE.
rv_changed = abap_true.
ENDIF.
ELSE. " Not found? => changed
rv_changed = abap_true.
ENDIF.
ENDMETHOD.
METHOD constructor.
ms_item = is_item.
ASSERT NOT ms_item IS INITIAL.
mv_language = iv_language.
ASSERT NOT mv_language IS INITIAL.
ENDMETHOD.
METHOD corr_insert.
DATA: lv_object TYPE string,
lv_object_class TYPE string.
IF ig_object_class IS NOT INITIAL.
lv_object_class = ig_object_class.
IF ig_object_class = 'DICT'.
CONCATENATE ms_item-obj_type ms_item-obj_name INTO lv_object.
ELSE.
lv_object = ms_item-obj_name.
ENDIF.
ELSE.
lv_object_class = ms_item-obj_type.
lv_object = ms_item-obj_name.
ENDIF.
CALL FUNCTION 'RS_CORR_INSERT'
EXPORTING
object = lv_object
object_class = lv_object_class
devclass = iv_package
master_language = mv_language
global_lock = abap_true
mode = 'I'
suppress_dialog = abap_true
EXCEPTIONS
cancelled = 1
permission_failure = 2
unknown_objectclass = 3
OTHERS = 4.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD delete_longtexts.
zcl_abapgit_factory=>get_longtexts( )->delete(
iv_longtext_id = iv_longtext_id
iv_object_name = ms_item-obj_name ).
ENDMETHOD.
METHOD deserialize_longtexts.
zcl_abapgit_factory=>get_longtexts( )->deserialize(
io_xml = io_xml
iv_master_language = mv_language ).
ENDMETHOD.
METHOD exists_a_lock_entry_for.
DATA: lt_lock_entries TYPE STANDARD TABLE OF seqg3.
CALL FUNCTION 'ENQUEUE_READ'
EXPORTING
guname = '*'
garg = iv_argument
TABLES
enq = lt_lock_entries
EXCEPTIONS
communication_failure = 1
system_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
READ TABLE lt_lock_entries TRANSPORTING NO FIELDS
WITH KEY gobj = iv_lock_object.
IF sy-subrc = 0.
rv_exists_a_lock_entry = abap_true.
ENDIF.
ENDMETHOD.
METHOD get_metadata.
DATA: lv_class TYPE string.
lv_class = cl_abap_classdescr=>describe_by_object_ref( me )->get_relative_name( ).
REPLACE FIRST OCCURRENCE OF 'ZCL_ABAPGIT' IN lv_class WITH 'LCL'.
rs_metadata-class = lv_class.
rs_metadata-version = 'v1.0.0' ##no_text.
ENDMETHOD.
METHOD is_active.
DATA: lt_messages TYPE STANDARD TABLE OF sprot_u WITH DEFAULT KEY,
lt_e071_tadirs TYPE STANDARD TABLE OF e071 WITH DEFAULT KEY,
ls_e071_tadir LIKE LINE OF lt_e071_tadirs.
ms_item-inactive = abap_false.
ls_e071_tadir-object = ms_item-obj_type.
ls_e071_tadir-obj_name = ms_item-obj_name.
INSERT ls_e071_tadir INTO TABLE lt_e071_tadirs.
CALL FUNCTION 'RS_INACTIVE_OBJECTS_WARNING'
EXPORTING
suppress_protocol = abap_false
with_program_includes = abap_false
suppress_dictionary_check = abap_false
TABLES
p_e071 = lt_e071_tadirs
p_xmsg = lt_messages.
IF lt_messages IS NOT INITIAL.
ms_item-inactive = abap_true.
ENDIF.
rv_active = boolc( ms_item-inactive = abap_false ).
ENDMETHOD.
METHOD jump_adt.
DATA: lv_adt_link TYPE string,
lx_error TYPE REF TO cx_root.
TRY.
lv_adt_link = zcl_abapgit_adt_link=>generate(
iv_obj_name = iv_obj_name
iv_obj_type = iv_obj_type
iv_sub_obj_name = iv_sub_obj_name
iv_line_number = iv_line_number ).
cl_gui_frontend_services=>execute(
EXPORTING document = lv_adt_link
EXCEPTIONS OTHERS = 1 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |ADT Jump Error - failed to open link { lv_adt_link }. Subrc={ sy-subrc }| ).
ENDIF.
CATCH cx_root INTO lx_error.
zcx_abapgit_exception=>raise( iv_text = 'ADT Jump Error' ix_previous = lx_error ).
ENDTRY.
ENDMETHOD.
METHOD jump_se11.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = ms_item-obj_name
object_type = ms_item-obj_type
devclass = ms_item-devclass
in_new_window = abap_true
EXCEPTIONS
not_executed = 1
invalid_object_type = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Jump to SE11 failed (subrc={ sy-subrc } ).| ).
ENDIF.
ENDMETHOD.
METHOD serialize_longtexts.
zcl_abapgit_factory=>get_longtexts( )->serialize(
iv_object_name = ms_item-obj_name
iv_longtext_id = iv_longtext_id
it_dokil = it_dokil
io_xml = io_xml ).
ENDMETHOD.
METHOD set_default_package.
" In certain cases we need to set the package package via ABAP memory
" because we can't supply it via the APIs.
"
" Set default package, see function module RS_CORR_INSERT FORM get_current_devclass.
"
" We use ABAP memory instead the SET parameter because it is
" more reliable. SET parameter doesn't work when multiple objects
" are deserialized which uses the ABAP memory mechanism.
" We don't need to reset the memory as it is done in above mentioned form routine.
EXPORT current_devclass FROM iv_package TO MEMORY ID 'EUK'.
ENDMETHOD.
METHOD tadir_insert.
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_test_modus = abap_false
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = ms_item-obj_type
wi_tadir_obj_name = ms_item-obj_name
wi_tadir_author = sy-uname
wi_tadir_devclass = iv_package
wi_tadir_masterlang = mv_language
iv_delflag = abap_false
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from TR_TADIR_INTERFACE (subrc={ sy-subrc } ).| ).
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
5550,
20032,
17941,
44731,
9564,
18601,
10659,
13,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
9186,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16129,
41876,
7500,
292,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
25,
198,
220,
220,
220,
220,
220,
4391,
62,
324,
83,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
26801,
62,
3672,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
26801,
62,
4906,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
12,
26801,
62,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
7266,
62,
26801,
62,
3672,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
12,
26801,
62,
3672,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
7266,
62,
26801,
62,
4906,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
12,
26801,
62,
4906,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
1370,
62,
17618,
220,
41876,
1312,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
269,
62,
7220,
62,
34680,
41876,
2124,
549,
3672,
26173,
8924,
705,
4944,
44706,
4458,
628,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
42865,
13845,
62,
9186,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
764,
198,
220,
220,
220,
42865,
285,
85,
62,
16129,
41876,
7500,
292,
764,
628,
220,
220,
220,
337,
36252,
50,
2198,
62,
16514,
27823,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
16514,
27823,
220,
220,
220,
220,
41876,
41033,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
4475,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
288,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
2435,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
256,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
40985,
8,
41876,
450,
499,
62,
30388,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
38993,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
38993,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
38993,
764,
198,
220,
220,
220,
337,
36252,
50,
1162,
81,
62,
28463,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26495,
220,
220,
220,
220,
220,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
328,
62,
15252,
62,
4871,
41876,
597,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
36264,
343,
62,
28463,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26495,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
4391,
62,
325,
1157,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
37004,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
3245,
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,
7160,
62,
64,
62,
5354,
62,
13000,
62,
1640,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
5354,
62,
15252,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
49140,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
33756,
70,
18,
12,
70,
853,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
1069,
1023,
62,
64,
62,
5354,
62,
13000,
8,
41876,
450,
499,
62,
30388,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
900,
62,
12286,
62,
26495,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26495,
41876,
1614,
4871,
764,
198,
220,
220,
220,
337,
36252,
50,
11389,
1096,
62,
6511,
5239,
82,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_abapgit_html_action_utils DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
CLASS-METHODS parse_post_form_data
IMPORTING
!it_post_data TYPE zif_abapgit_html_viewer=>ty_post_data
!iv_upper_cased TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(rt_fields) TYPE tihttpnvp .
CLASS-METHODS parse_fields
IMPORTING
!iv_string TYPE clike
!iv_upper_cased TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(rt_fields) TYPE tihttpnvp .
CLASS-METHODS parse_fields_upper_case_name
IMPORTING
!iv_string TYPE clike
RETURNING
VALUE(rt_fields) TYPE tihttpnvp .
CLASS-METHODS translate_postdata
IMPORTING
!it_postdata TYPE zif_abapgit_html_viewer=>ty_post_data
RETURNING
VALUE(rv_string) TYPE string .
CLASS-METHODS get_field
IMPORTING
!iv_name TYPE string
!it_field TYPE tihttpnvp
!iv_decode TYPE abap_bool DEFAULT abap_false
CHANGING
!cg_field TYPE any .
CLASS-METHODS jump_encode
IMPORTING
!iv_obj_type TYPE tadir-object
!iv_obj_name TYPE tadir-obj_name
RETURNING
VALUE(rv_string) TYPE string .
CLASS-METHODS dir_encode
IMPORTING
!iv_path TYPE string
RETURNING
VALUE(rv_string) TYPE string .
CLASS-METHODS file_encode
IMPORTING
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
!ig_file TYPE any
RETURNING
VALUE(rv_string) TYPE string .
CLASS-METHODS obj_encode
IMPORTING
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
!ig_object TYPE any
RETURNING
VALUE(rv_string) TYPE string .
CLASS-METHODS class_constructor.
CLASS-METHODS dbkey_encode
IMPORTING
!is_key TYPE zif_abapgit_persistence=>ty_content
RETURNING
VALUE(rv_string) TYPE string .
PROTECTED SECTION.
PRIVATE SECTION.
CLASS-DATA gv_non_breaking_space TYPE string.
CLASS-METHODS field_keys_to_upper
CHANGING
!ct_fields TYPE tihttpnvp .
CLASS-METHODS add_field
IMPORTING
!iv_name TYPE string
!ig_field TYPE any
CHANGING
!ct_field TYPE tihttpnvp .
CLASS-METHODS unescape
IMPORTING
!iv_string TYPE string
RETURNING
VALUE(rv_string) TYPE string .
ENDCLASS.
CLASS zcl_abapgit_html_action_utils IMPLEMENTATION.
METHOD class_constructor.
CONSTANTS lc_nbsp TYPE xstring VALUE 'C2A0'. "
gv_non_breaking_space = zcl_abapgit_convert=>xstring_to_string_utf8( lc_nbsp ).
ENDMETHOD.
METHOD add_field.
DATA ls_field LIKE LINE OF ct_field.
FIELD-SYMBOLS <lg_src> TYPE any.
ls_field-name = iv_name.
CASE cl_abap_typedescr=>describe_by_data( ig_field )->kind.
WHEN cl_abap_typedescr=>kind_elem.
ls_field-value = ig_field.
WHEN cl_abap_typedescr=>kind_struct.
ASSIGN COMPONENT iv_name OF STRUCTURE ig_field TO <lg_src>.
ASSERT <lg_src> IS ASSIGNED.
ls_field-value = <lg_src>.
WHEN OTHERS.
ASSERT 0 = 1.
ENDCASE.
APPEND ls_field TO ct_field.
ENDMETHOD.
METHOD dbkey_encode.
DATA: lt_fields TYPE tihttpnvp.
add_field( EXPORTING iv_name = 'TYPE'
ig_field = is_key-type CHANGING ct_field = lt_fields ).
add_field( EXPORTING iv_name = 'VALUE'
ig_field = is_key-value CHANGING ct_field = lt_fields ).
rv_string = cl_http_utility=>fields_to_string( lt_fields ).
ENDMETHOD.
METHOD dir_encode.
DATA: lt_fields TYPE tihttpnvp.
add_field( EXPORTING iv_name = 'PATH'
ig_field = iv_path CHANGING ct_field = lt_fields ).
rv_string = cl_http_utility=>fields_to_string( lt_fields ).
ENDMETHOD.
METHOD field_keys_to_upper.
FIELD-SYMBOLS <ls_field> LIKE LINE OF ct_fields.
LOOP AT ct_fields ASSIGNING <ls_field>.
<ls_field>-name = to_upper( <ls_field>-name ).
ENDLOOP.
ENDMETHOD.
METHOD file_encode.
DATA: lt_fields TYPE tihttpnvp.
add_field( EXPORTING iv_name = 'KEY'
ig_field = iv_key CHANGING ct_field = lt_fields ).
add_field( EXPORTING iv_name = 'PATH'
ig_field = ig_file CHANGING ct_field = lt_fields ).
add_field( EXPORTING iv_name = 'FILENAME'
ig_field = ig_file CHANGING ct_field = lt_fields ).
rv_string = cl_http_utility=>fields_to_string( lt_fields ).
ENDMETHOD.
METHOD get_field.
DATA: lv_value TYPE string.
FIELD-SYMBOLS: <ls_field> LIKE LINE OF it_field,
<lg_dest> TYPE any.
READ TABLE it_field ASSIGNING <ls_field> WITH KEY name = iv_name.
IF sy-subrc IS NOT INITIAL.
RETURN.
ENDIF.
lv_value = <ls_field>-value.
IF iv_decode = abap_true.
lv_value = cl_http_utility=>unescape_url( escaped = lv_value ).
ENDIF.
CASE cl_abap_typedescr=>describe_by_data( cg_field )->kind.
WHEN cl_abap_typedescr=>kind_elem.
cg_field = lv_value.
WHEN cl_abap_typedescr=>kind_struct.
ASSIGN COMPONENT iv_name OF STRUCTURE cg_field TO <lg_dest>.
ASSERT <lg_dest> IS ASSIGNED.
<lg_dest> = lv_value.
WHEN OTHERS.
ASSERT 0 = 1.
ENDCASE.
ENDMETHOD.
METHOD jump_encode.
DATA: lt_fields TYPE tihttpnvp.
add_field( EXPORTING iv_name = 'TYPE'
ig_field = iv_obj_type CHANGING ct_field = lt_fields ).
add_field( EXPORTING iv_name = 'NAME'
ig_field = iv_obj_name CHANGING ct_field = lt_fields ).
rv_string = cl_http_utility=>fields_to_string( lt_fields ).
ENDMETHOD.
METHOD obj_encode.
DATA: lt_fields TYPE tihttpnvp.
add_field( EXPORTING iv_name = 'KEY'
ig_field = iv_key CHANGING ct_field = lt_fields ).
add_field( EXPORTING iv_name = 'OBJ_TYPE'
ig_field = ig_object CHANGING ct_field = lt_fields ).
add_field( EXPORTING iv_name = 'OBJ_NAME'
ig_field = ig_object CHANGING ct_field = lt_fields ).
rv_string = cl_http_utility=>fields_to_string( lt_fields ).
ENDMETHOD.
METHOD parse_fields.
DATA:
lt_substrings TYPE string_table,
ls_field LIKE LINE OF rt_fields.
FIELD-SYMBOLS <lv_substring> LIKE LINE OF lt_substrings.
SPLIT iv_string AT '&' INTO TABLE lt_substrings.
LOOP AT lt_substrings ASSIGNING <lv_substring>.
CLEAR ls_field.
<lv_substring> = unescape( <lv_substring> ).
" On attempt to change unescaping -> run unit tests to check !
ls_field-name = substring_before(
val = <lv_substring>
sub = '=' ).
ls_field-value = substring_after(
val = <lv_substring>
sub = '=' ).
IF ls_field IS INITIAL. " Not a field with proper structure
CONTINUE.
ENDIF.
APPEND ls_field TO rt_fields.
ENDLOOP.
IF iv_upper_cased = abap_true.
field_keys_to_upper( CHANGING ct_fields = rt_fields ).
ENDIF.
ENDMETHOD.
METHOD parse_fields_upper_case_name.
rt_fields = parse_fields(
iv_string = iv_string
iv_upper_cased = abap_true ).
ENDMETHOD.
METHOD parse_post_form_data.
DATA lv_serialized_post_data TYPE string.
lv_serialized_post_data = translate_postdata( it_post_data ).
IF iv_upper_cased = abap_true.
rt_fields = parse_fields_upper_case_name( lv_serialized_post_data ).
ELSE.
rt_fields = parse_fields( lv_serialized_post_data ).
ENDIF.
ENDMETHOD.
METHOD translate_postdata.
DATA: lt_post_data TYPE zif_abapgit_html_viewer=>ty_post_data,
ls_last_line LIKE LINE OF it_postdata,
lv_last_line_index TYPE i.
IF it_postdata IS INITIAL.
RETURN. "Nothing to do
ENDIF.
lt_post_data = it_postdata.
"Save the last line for separate merge, because we don't need its trailing spaces
WHILE ls_last_line IS INITIAL.
lv_last_line_index = lines( lt_post_data ).
READ TABLE lt_post_data INTO ls_last_line INDEX lv_last_line_index.
"Avoid trailing null values (see isssue #4832)
"todo, keep until SAP GUI for Java is fixed (remove on 2022-12-31)
ls_last_line = replace( val = ls_last_line
sub = zcl_abapgit_git_utils=>get_null( )
with = space
occ = 0 ).
DELETE lt_post_data INDEX lv_last_line_index.
ENDWHILE.
CONCATENATE LINES OF lt_post_data INTO rv_string
IN CHARACTER MODE RESPECTING BLANKS.
CONCATENATE rv_string ls_last_line INTO rv_string
IN CHARACTER MODE.
ENDMETHOD.
METHOD unescape.
* do not use cl_http_utility as it does strange things with the encoding
rv_string = iv_string.
* todo, more to be added here
REPLACE ALL OCCURRENCES OF '%3F' IN rv_string WITH '?'.
REPLACE ALL OCCURRENCES OF '%3D' IN rv_string WITH '='.
REPLACE ALL OCCURRENCES OF gv_non_breaking_space IN rv_string WITH ` `.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
2673,
62,
26791,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
21136,
62,
7353,
62,
687,
62,
7890,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
7353,
62,
7890,
41876,
1976,
361,
62,
397,
499,
18300,
62,
6494,
62,
1177,
263,
14804,
774,
62,
7353,
62,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
45828,
62,
66,
839,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
25747,
8,
41876,
46668,
4023,
77,
36133,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
21136,
62,
25747,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
8841,
220,
220,
220,
220,
220,
220,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
45828,
62,
66,
839,
220,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
25747,
8,
41876,
46668,
4023,
77,
36133,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
21136,
62,
25747,
62,
45828,
62,
7442,
62,
3672,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
8841,
220,
220,
220,
220,
220,
220,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
25747,
8,
41876,
46668,
4023,
77,
36133,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
15772,
62,
7353,
7890,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
7353,
7890,
41876,
1976,
361,
62,
397,
499,
18300,
62,
6494,
62,
1177,
263,
14804,
774,
62,
7353,
62,
7890,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8841,
8,
41876,
4731,
764,
628,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
3245,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
3672,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
3245,
220,
41876,
46668,
4023,
77,
36133,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
12501,
1098,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
66,
70,
62,
3245,
220,
41876,
597,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
4391,
62,
268,
8189,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26801,
62,
4906,
220,
220,
220,
220,
41876,
36264,
343,
12,
15252,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26801,
62,
3672,
220,
220,
220,
220,
41876,
36264,
343,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8841,
8,
41876,
4731,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
26672,
62,
268,
8189,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
6978,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8841,
8,
41876,
4731,
764,
628,
220,
220,
220,
42715,
12,
49273,
50,
2393,
62,
268,
8189,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
328,
62,
7753,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
597,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8841,
8,
41876,
4731,
764,
198,
220,
220,
220,
42715,
12,
49273,
50,
26181,
62,
268,
8189,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
328,
62,
15252,
220,
220,
220,
220,
220,
220,
41876,
597,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8841,
8,
41876,
4731,
764,
628,
220,
220,
220,
42715,
12,
49273,
50,
1398,
62,
41571,
273,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
20613,
2539,
62,
268,
8189,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
11299,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8841,
8,
41876,
4731,
764,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42715,
12,
26947,
308,
85,
62,
13159,
62,
13395,
62,
13200,
41876,
4731,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
2214
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
*&---------------------------------------------------------------------*
*& Report ZDEMO_TECHED3
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zdemo_teched3.
*******************************
* Data Object declaration *
*******************************
DATA: lo_excel TYPE REF TO zcl_excel,
lo_excel_reader TYPE REF TO zif_excel_reader,
lo_worksheet TYPE REF TO zcl_excel_worksheet.
DATA: lv_full_path TYPE string,
lv_workdir TYPE string,
lv_file_separator TYPE c.
DATA: lt_files TYPE filetable,
ls_file TYPE file_table,
lv_rc TYPE i,
lv_value TYPE zexcel_cell_value.
CONSTANTS: gc_save_file_name TYPE string VALUE 'TechEd01.xlsx'.
INCLUDE zdemo_excel_outputopt_incl.
START-OF-SELECTION.
*******************************
* abap2xlsx read XLSX *
*******************************
CREATE OBJECT lo_excel_reader TYPE zcl_excel_reader_2007.
lo_excel = lo_excel_reader->load_file( lv_full_path ).
lo_excel->set_active_sheet_index( 1 ).
lo_worksheet = lo_excel->get_active_worksheet( ).
lo_worksheet->get_cell( EXPORTING ip_column = 'C'
ip_row = 10
IMPORTING ep_value = lv_value ).
WRITE: 'abap2xlsx total score is ', lv_value.
*** Create output
lcl_output=>output( lo_excel ).
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
220,
1168,
39429,
46,
62,
51,
25994,
1961,
18,
198,
9,
5,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
198,
9,
5,
198,
9,
5,
10097,
30934,
9,
198,
198,
2200,
15490,
220,
1976,
9536,
78,
62,
660,
1740,
18,
13,
198,
198,
8412,
46068,
8162,
198,
9,
220,
220,
6060,
9515,
14305,
220,
220,
1635,
198,
8412,
46068,
8162,
198,
198,
26947,
25,
2376,
62,
1069,
5276,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
11,
198,
220,
220,
220,
220,
220,
2376,
62,
1069,
5276,
62,
46862,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
1069,
5276,
62,
46862,
11,
198,
220,
220,
220,
220,
220,
2376,
62,
5225,
25473,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
5225,
25473,
13,
198,
198,
26947,
25,
300,
85,
62,
12853,
62,
6978,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
300,
85,
62,
1818,
15908,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
300,
85,
62,
7753,
62,
25512,
1352,
41876,
269,
13,
198,
198,
26947,
25,
300,
83,
62,
16624,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
2393,
11487,
11,
198,
220,
220,
220,
220,
220,
43979,
62,
7753,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
2393,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
300,
85,
62,
6015,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
300,
85,
62,
8367,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
1069,
5276,
62,
3846,
62,
8367,
13,
198,
198,
10943,
2257,
1565,
4694,
25,
308,
66,
62,
21928,
62,
7753,
62,
3672,
41876,
4731,
26173,
8924,
705,
17760,
7407,
486,
13,
87,
7278,
87,
4458,
198,
1268,
5097,
52,
7206,
1976,
9536,
78,
62,
1069,
5276,
62,
22915,
8738,
62,
259,
565,
13,
198,
198,
2257,
7227,
12,
19238,
12,
46506,
2849,
13,
198,
198,
8412,
46068,
8162,
198,
9,
220,
220,
220,
450,
499,
17,
87,
7278,
87,
1100,
1395,
6561,
55,
220,
220,
220,
1635,
198,
8412,
46068,
8162,
198,
220,
29244,
6158,
25334,
23680,
2376,
62,
1069,
5276,
62,
46862,
41876,
1976,
565,
62,
1069,
5276,
62,
46862,
62,
12726,
13,
198,
220,
2376,
62,
1069,
5276,
796,
2376,
62,
1069,
5276,
62,
46862,
3784,
2220,
62,
7753,
7,
300,
85,
62,
12853,
62,
6978,
6739,
628,
220,
2376,
62,
1069,
5276,
3784,
2617,
62,
5275,
62,
21760,
62,
9630,
7,
352,
6739,
198,
220,
2376,
62,
5225,
25473,
796,
2376,
62,
1069,
5276,
3784,
1136,
62,
5275,
62,
5225,
25473,
7,
6739,
628,
220,
2376,
62,
5225,
25473,
3784,
1136,
62,
3846,
7,
7788,
15490,
2751,
20966,
62,
28665,
796,
705,
34,
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,
20966,
62,
808,
220,
220,
220,
796,
838,
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,
30023,
9863,
2751,
2462,
62,
8367,
220,
796,
300,
85,
62,
8367,
6739,
628,
220,
44423,
25,
705,
397,
499,
17,
87,
7278,
87,
2472,
4776,
318,
46083,
300,
85,
62,
8367,
13,
198,
198,
8162,
13610,
5072,
198,
220,
300,
565,
62,
22915,
14804,
22915,
7,
2376,
62,
1069,
5276,
6739,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
*----------------------------------------------------------------------*
* 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_59.
METHODS:
setup,
export_import FOR TESTING,
test001_01 FOR TESTING,
test001_02 FOR TESTING,
test001_03 FOR TESTING,
test001_04 FOR TESTING,
test002_01 FOR TESTING,
test002_02 FOR TESTING,
test002_03 FOR TESTING,
test002_04 FOR TESTING,
test002_05 FOR TESTING,
test002_06 FOR TESTING,
test002_07 FOR TESTING,
test002_08 FOR TESTING,
test003_01 FOR TESTING,
test003_02 FOR TESTING,
test004_01 FOR TESTING,
test004_02 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 ).
zcl_aoc_unit_test=>set_object_type( 'CLAS' ).
ENDMETHOD.
METHOD export_import.
zcl_aoc_unit_test=>export_import( mo_check ).
ENDMETHOD.
METHOD test001_01.
_code 'IF foo = bar.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result-code ).
ENDMETHOD.
METHOD test001_02.
_code 'WRITE foobar.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result-code ).
ENDMETHOD.
METHOD test001_03.
_code 'IF moo boo.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals(
act = ms_result-code
exp = '001' ).
ENDMETHOD.
METHOD test001_04.
_code 'IF moo Z boo.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result-code ).
ENDMETHOD.
METHOD test002_01.
_code 'IF 2 = 3.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result-code ).
ENDMETHOD.
METHOD test002_02.
_code 'IF ( 2 = 3 ).'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals(
act = ms_result-code
exp = '002' ).
ENDMETHOD.
METHOD test002_03.
_code 'IF 2 = 3 AND ( a = b ).'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals(
act = ms_result-code
exp = '002' ).
ENDMETHOD.
METHOD test002_04.
_code 'IF ( 2 = 3 AND a = b ).'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals(
act = ms_result-code
exp = '002' ).
ENDMETHOD.
METHOD test002_05.
_code 'IF 2 = 3 AND foo = boo.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result-code ).
ENDMETHOD.
METHOD test002_06.
_code 'IF ( 2 = 3 ) AND a = b.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals(
act = ms_result-code
exp = '002' ).
ENDMETHOD.
METHOD test002_07.
_code 'IF foo = bar AND ( moo = boo OR baa = laa ).'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result-code ).
ENDMETHOD.
METHOD test002_08.
_code 'if moo = boo and foo = loo and ( mode z <mask> ).'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals(
act = ms_result-code
exp = '002' ).
ENDMETHOD.
METHOD test003_01.
_code 'IF foo = bar AND moo = boo OR baa = laa.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals(
act = ms_result-code
exp = '003' ).
ENDMETHOD.
METHOD test003_02.
_code 'IF ( foo = bar AND moo = boo ) OR baa = laa.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result-code ).
ENDMETHOD.
METHOD test004_01.
_code 'IF SY-DATUM + 1 > + SY-DATUM.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result-code ).
ENDMETHOD.
METHOD test004_02.
_code 'IF SY-DATUM + 1 > - SY-DATUM.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result-code ).
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,
360,
4261,
6234,
6006,
9863,
45698,
42,
49277,
43638,
5805,
7597,
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,
3270,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
220,
220,
10784,
62,
11748,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
486,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
2999,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
3070,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
8298,
62,
3023,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
21601,
62,
486,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
21601,
62,
2999,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
21601,
62,
3070,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
21601,
62,
3023,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
21601,
62,
2713,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
21601,
62,
3312,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
21601,
62,
2998,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
21601,
62,
2919,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
11245,
62,
486,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
11245,
62,
2999,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
22914,
62,
486,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
22914,
62,
2999,
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,
220,
220,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
2617,
62,
15252,
62,
4906,
7,
705,
5097,
1921,
6,
6739,
198,
220,
23578,
49273,
13,
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,
628,
220,
220,
220,
4808,
8189,
705,
5064,
22944,
796,
2318,
2637,
13,
198,
220,
220,
220,
13845,
62,
20274,
796,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
9122,
7,
45079,
62,
8189,
6739,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
36733,
7,
13845,
62,
20274,
12,
8189,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
8298,
62,
2999,
13,
628,
220,
220,
220,
4808,
8189,
705,
18564,
12709,
11511,
30973,
2637,
13,
198,
220,
220,
220,
13845,
62,
20274,
796,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
9122,
7,
45079,
62,
8189,
6739,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
36733,
7,
13845,
62,
20274,
12,
8189,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
8298,
62,
3070,
13,
628,
220,
220,
220,
4808,
8189,
705,
5064,
285,
2238,
22513,
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,
198,
220,
220,
220,
220,
220,
719,
796,
13845,
62,
20274,
12,
8189,
198,
220,
220,
220,
220,
220,
1033,
796,
705,
8298,
6,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
8298,
62,
3023,
13,
628,
220,
220,
220,
4808,
8189,
705,
5064,
285,
2238,
1168,
22513,
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,
12,
8189,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
21601,
62,
486,
13,
628,
220,
220,
220,
4808,
8189,
705,
5064,
362,
796,
513,
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,
12,
8189,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
21601,
62,
2999,
13,
628,
220,
220,
220,
4808,
8189,
705,
5064,
357,
362,
796,
513,
6739,
4458,
628,
220,
220,
220,
13845,
62,
20274,
796,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
9122,
7
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
*&---------------------------------------------------------------------*
*& Include LZFILE_UTILSD09
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Class lcl_screen_base
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
CLASS lcl_screen_base DEFINITION ABSTRACT INHERITING FROM lcl_splitter_base.
PUBLIC SECTION.
*** Hilfstyp zum initialisieren des Column-Trees
TYPES: BEGIN OF t_tree_hierarchy,
hierarchy_column_name TYPE tv_itmname,
hierarchy_header TYPE treemhhdr,
END OF t_tree_hierarchy.
TYPES: tt_nodekey TYPE TABLE OF tm_nodekey WITH EMPTY KEY.
TYPES: t_c_text TYPE TABLE OF char1024 WITH DEFAULT KEY.
PROTECTED SECTION.
DATA: mo_alv_tree TYPE REF TO cl_column_tree_model,
mo_text_edit TYPE REF TO cl_gui_textedit,
mo_toolbar TYPE REF TO cl_gui_toolbar.
**********************************************************************
DATA: mr_nodetab_int TYPE REF TO treemcnota,
mr_itemtab_int TYPE REF TO treemcitac.
METHODS:
**********************************************************************
register_events ABSTRACT RAISING zcx_tree_error,
register_events_toolb ABSTRACT,
get_hierarchy_hdr ABSTRACT RETURNING VALUE(rs_hdr) TYPE t_tree_hierarchy,
tree_add_colums ABSTRACT,
add_toolb_buttons ABSTRACT,
**********************************************************************
add_nodes RAISING zcx_tree_error,
add_items RAISING zcx_tree_error,
expand_nodes IMPORTING it_nodekey TYPE tt_nodekey RAISING zcx_tree_error,
expand_node IMPORTING iv_nodekey TYPE tm_nodekey RAISING zcx_tree_error,
node_set_style IMPORTING iv_node_key TYPE tm_nodekey iv_style TYPE i RAISING zcx_tree_error,
item_set_style IMPORTING iv_node_key TYPE tm_nodekey iv_item_name TYPE tv_itmname iv_style TYPE i RAISING zcx_tree_error,
set_registered_evts IMPORTING it_evt TYPE cntl_simple_events RAISING lcx_ctrl_error,
set_selected_nkey IMPORTING iv_nodekey TYPE tm_nodekey RAISING zcx_tree_error,
get_selected_nkey RETURNING VALUE(rv_nkey) TYPE tm_nodekey RAISING zcx_tree_error,
collapse_node IMPORTING iv_nodekey TYPE tm_nodekey RAISING zcx_tree_error,
**********************************************************************
set_read_only_mode IMPORTING iv_read_only TYPE abap_bool RAISING zcx_scrn_err,
set_word_wrap RAISING zcx_scrn_err,
set_text_as_table IMPORTING it_text TYPE t_c_text RAISING zcx_scrn_err,
set_text_as_stream IMPORTING it_text TYPE t_c_text RAISING zcx_scrn_err,
get_text_as_stream RETURNING VALUE(rt_text) TYPE t_c_text RAISING zcx_scrn_err,
**********************************************************************
init_alv_tree_col RAISING zcx_tree_error,
init_toolbar RAISING zcx_scrn_err,
init_text_edit RAISING zcx_scrn_err.
ENDCLASS.
CLASS lcl_screen_base IMPLEMENTATION.
METHOD init_alv_tree_col.
CREATE OBJECT mo_alv_tree
EXPORTING
node_selection_mode = cl_column_tree_model=>node_sel_mode_single " Knoten: Einfach- oder Mehrfachselektion
hierarchy_column_name = get_hierarchy_hdr( )-hierarchy_column_name " Name der Spalte im Hierarchie-Bereich
hierarchy_header = get_hierarchy_hdr( )-hierarchy_header
item_selection = abap_true " Selektierbarkeit einzelner Items
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
zcx_tree_error=>raise_from_sysubrc( iv_method = 'constructor' iv_sysubrc = sy-subrc ).
ENDIF.
**********************************************************************
me->tree_add_colums( ).
mo_alv_tree->create_tree_control( parent = mo_splitter_left->get_container( row = 2 column = 1 ) ).
*** Konkrete Events in der implementierenden Klasse
me->register_events( ).
ENDMETHOD.
METHOD init_text_edit.
CREATE OBJECT mo_text_edit
EXPORTING
parent = mo_splitter_control->get_container(
row = 1
column = 2
) " Parent-Container
EXCEPTIONS
error_cntl_create = 1 " Error while performing creation of TextEdit control!
error_cntl_init = 2 " Error while initializing TextEdit control!
error_cntl_link = 3 " Error while linking TextEdit control!
error_dp_create = 4 " Error while creating DataProvider control!
gui_type_not_supported = 5 " This type of GUI is not supported!
OTHERS = 6.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_scrn_err
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDMETHOD.
METHOD init_toolbar.
CREATE OBJECT mo_toolbar
EXPORTING
parent = mo_splitter_left->get_container( row = 1 column = 1 ) " Name des Containers
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_scrn_err
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
**********************************************************************
*** Toolbar-Drucktasten hinzufügen (abstrakt)
me->add_toolb_buttons( ).
*** abstrakter Handler zum registrieren der Events
me->register_events_toolb( ).
ENDMETHOD.
**********************************************************************
*** column-tree functions
METHOD add_nodes.
mo_alv_tree->add_nodes(
EXPORTING
node_table = mr_nodetab_int->* " Knoten-Tabelle
EXCEPTIONS
error_in_node_table = 1 " Knotentabelle fehlerhaft
OTHERS = 2
).
IF sy-subrc <> 0.
zcx_tree_error=>raise_from_sysubrc( iv_method = 'add_nodes' iv_sysubrc = sy-subrc ).
ENDIF.
ENDMETHOD.
METHOD add_items.
mo_alv_tree->add_items(
EXPORTING
item_table = mr_itemtab_int->* " Items
EXCEPTIONS
node_not_found = 1 " Knotenschlüssel existiert nicht
error_in_item_table = 2 " ITEM_TABLE enthält einen fehlerhaften Eintrag
OTHERS = 3
).
IF sy-subrc <> 0.
zcx_tree_error=>raise_from_sysubrc( iv_method = 'add_items' iv_sysubrc = sy-subrc ).
ENDIF.
ENDMETHOD.
METHOD expand_nodes.
mo_alv_tree->expand_nodes(
EXPORTING
node_key_table = CONV #( it_nodekey ) " Tabelle mit Knotenschlüsseln
EXCEPTIONS
error_in_node_key_table = 1 " unbekannter Knotenschlüssel in NODE_KEY_TABLE
OTHERS = 2
).
IF sy-subrc <> 0.
zcx_tree_error=>raise_from_sysubrc( iv_method = 'expand_nodes' iv_sysubrc = sy-subrc ).
ENDIF.
ENDMETHOD.
METHOD expand_node.
mo_alv_tree->expand_node(
EXPORTING
node_key = iv_nodekey " Schlüssel des Knotens
* expand_predecessors = " 'X': Vorgänger des Knotens expandieren
* expand_subtree = " 'X': alle Nachfahren expandieren
* level_count = " Anzahl zu expandierende Nachfolgeebenen
EXCEPTIONS
node_not_found = 1 " Knoten existiert nicht
OTHERS = 2
).
IF sy-subrc <> 0.
zcx_tree_error=>raise_from_sysubrc( iv_method = 'expand_node' iv_sysubrc = sy-subrc ).
ENDIF.
ENDMETHOD.
METHOD node_set_style.
mo_alv_tree->node_set_style(
EXPORTING
node_key = iv_node_key " Schlüssel des Knotens
style = iv_style " siehe Methodendokumentation
EXCEPTIONS
node_not_found = 1 " Knoten existiert nicht
OTHERS = 2
).
IF sy-subrc <> 0.
zcx_tree_error=>raise_from_sysubrc( iv_method = 'node_set_style' iv_sysubrc = sy-subrc ).
ENDIF.
ENDMETHOD.
METHOD item_set_style.
mo_alv_tree->item_set_style(
EXPORTING
node_key = iv_node_key " Schlüssel des Knotens
item_name = iv_item_name " Name des Items
style = iv_style " siehe Methodendokumentation
EXCEPTIONS
node_not_found = 1 " Knoten mit Schlüssel NODE_KEY nicht vorhanden
item_not_found = 2 " Item mit Namen ITEM_NAME nicht vorhanden
OTHERS = 3
).
IF sy-subrc <> 0.
zcx_tree_error=>raise_from_sysubrc( iv_method = 'item_set_style' iv_sysubrc = sy-subrc ).
ENDIF.
ENDMETHOD.
METHOD set_registered_evts.
mo_alv_tree->set_registered_events(
EXPORTING
events = it_evt " Eventtabelle
EXCEPTIONS
illegal_event_combination = 1 " ILLEGAL_EVENT_COMBINATION
unknown_event = 2 " "
OTHERS = 3
).
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE lcx_ctrl_error
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDMETHOD.
METHOD set_selected_nkey.
mo_alv_tree->set_selected_node(
EXPORTING
node_key = iv_nodekey " Schlüssel des Knotens
EXCEPTIONS
single_node_selection_only = 1 " nur bei Knoten-Einfachselektion erlaubt
node_not_found = 2 " Knoten mit Schlüssel NODE_KEY nicht gefunden
OTHERS = 3
).
IF sy-subrc <> 0.
zcx_tree_error=>raise_from_sysubrc( iv_method = 'set_selected_node' iv_sysubrc = sy-subrc ).
ENDIF.
ENDMETHOD.
METHOD get_selected_nkey.
mo_alv_tree->get_selected_node(
IMPORTING
node_key = rv_nkey " Schlüssel des selektierten Knotens
EXCEPTIONS
control_not_existing = 1 " Tree Control existiert nicht
control_dead = 2 " Tree Control wurde bereits zerstört
cntl_system_error = 3 " "
failed = 4 " Allgemeiner Fehler
single_node_selection_only = 5 " nur bei Knoten-Einfachselektion erlaubt
OTHERS = 6 ).
IF sy-subrc <> 0.
zcx_tree_error=>raise_from_sysubrc( iv_method = 'get_selected_node' iv_sysubrc = sy-subrc ).
ENDIF.
ENDMETHOD.
METHOD collapse_node.
mo_alv_tree->collapse_node(
EXPORTING
node_key = iv_nodekey " Schlüssel des Knotens
* collapse_subtree = " 'X': Nachfolger des Knotens schließen
EXCEPTIONS
node_not_found = 1 " Knoten existiert nicht
OTHERS = 2
).
IF sy-subrc <> 0.
zcx_tree_error=>raise_from_sysubrc( iv_method = 'collapse_node' iv_sysubrc = sy-subrc ).
ENDIF.
ENDMETHOD.
**********************************************************************
*** Text-Edit Functions
METHOD set_read_only_mode.
me->mo_text_edit->set_readonly_mode(
EXPORTING
readonly_mode = COND #( WHEN iv_read_only EQ abap_true THEN 1 ELSE 0 ) " readonly mode; eq 0: OFF ; ne 0: ON
EXCEPTIONS
error_cntl_call_method = 1 " Error while setting readonly mode!
invalid_parameter = 2 " INVALID_PARAMETER
OTHERS = 3
).
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_scrn_err
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDMETHOD.
METHOD set_word_wrap.
me->mo_text_edit->set_wordwrap_behavior(
EXPORTING
wordwrap_mode = 0 " 0: OFF; 1: wrap a window border; 2: wrap at fixed position
* wordwrap_position = 256 " position of wordwrap, only makes sense with wordwrap_mode=2
wordwrap_to_linebreak_mode = 1 "bool_initial " eq 1: change wordwrap to linebreak; 0: preserve wordwraps
EXCEPTIONS
error_cntl_call_method = 1 " Error while setting word wrap properties of control!
OTHERS = 2
).
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_scrn_err
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDMETHOD.
METHOD set_text_as_table.
me->mo_text_edit->set_text_as_r3table(
EXPORTING
table = it_text " table with text
EXCEPTIONS
error_dp = 1 " Error while sending R/3 table to TextEdit control!
error_dp_create = 2 " ERROR_DP_CREATE
OTHERS = 3
).
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_scrn_err
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDMETHOD.
METHOD set_text_as_stream.
me->mo_text_edit->set_text_as_stream(
EXPORTING
text = it_text " text as stream with carrige retruns and linefeeds
exceptions
error_dp = 1 " ERROR_DP
error_dp_create = 2 " ERROR_DP_CREATE
others = 3
).
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_scrn_err
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDMETHOD.
METHOD get_text_as_stream.
mo_text_edit->get_text_as_stream(
* EXPORTING
* only_when_modified = false " get text only when modified
IMPORTING
text = rt_text " text as R/3 table
* is_modified = " modify status of text
EXCEPTIONS
error_dp = 1 " Error while retrieving text table via DataProvider control!
error_cntl_call_method = 2 " Error while retrieving a property from TextEdit control
* error_dp_create = 3 " Error while creating DataProvider Control
* potential_data_loss = 4 " Potential data loss: use get_text_as_stream instead
OTHERS = 5
).
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_scrn_err
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
40348,
220,
220,
220,
220,
220,
220,
220,
220,
220,
406,
57,
25664,
62,
3843,
4146,
10305,
2931,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
5016,
300,
565,
62,
9612,
62,
8692,
198,
9,
5,
10097,
30934,
9,
198,
9,
5,
198,
9,
5,
10097,
30934,
9,
198,
31631,
300,
565,
62,
9612,
62,
8692,
5550,
20032,
17941,
9564,
18601,
10659,
3268,
16879,
2043,
2751,
16034,
300,
565,
62,
22018,
1967,
62,
8692,
13,
198,
220,
44731,
44513,
13,
198,
8162,
24410,
69,
301,
4464,
1976,
388,
4238,
271,
494,
918,
748,
29201,
12,
51,
6037,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
256,
62,
21048,
62,
71,
959,
9282,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18911,
62,
28665,
62,
3672,
41876,
31557,
62,
270,
76,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18911,
62,
25677,
220,
220,
220,
220,
220,
41876,
2054,
368,
12337,
7109,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
256,
62,
21048,
62,
71,
959,
9282,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
256,
83,
62,
17440,
2539,
41876,
43679,
3963,
256,
76,
62,
17440,
2539,
13315,
38144,
9936,
35374,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
256,
62,
66,
62,
5239,
41876,
43679,
3963,
1149,
35500,
13315,
5550,
38865,
35374,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
42865,
25,
6941,
62,
282,
85,
62,
21048,
220,
41876,
4526,
37,
5390,
537,
62,
28665,
62,
21048,
62,
19849,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6941,
62,
5239,
62,
19312,
41876,
4526,
37,
5390,
537,
62,
48317,
62,
5239,
19312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6941,
62,
25981,
5657,
220,
220,
41876,
4526,
37,
5390,
537,
62,
48317,
62,
25981,
5657,
13,
198,
17174,
17174,
2466,
1174,
198,
220,
220,
220,
42865,
25,
285,
81,
62,
77,
375,
316,
397,
62,
600,
41876,
4526,
37,
5390,
2054,
368,
66,
1662,
64,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
81,
62,
9186,
8658,
62,
600,
41876,
4526,
37,
5390,
2054,
368,
47992,
330,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
17174,
17174,
2466,
1174,
198,
220,
220,
220,
220,
220,
7881,
62,
31534,
9564,
18601,
10659,
17926,
1797,
2751,
1976,
66,
87,
62,
21048,
62,
18224,
11,
198,
220,
220,
220,
220,
220,
7881,
62,
31534,
62,
25981,
65,
9564,
18601,
10659,
11,
198,
220,
220,
220,
220,
220,
651,
62,
71,
959,
9282,
62,
71,
7109,
9564,
18601,
10659,
30826,
4261,
15871,
26173,
8924,
7,
3808,
62,
71,
7109,
8,
41876,
256,
62,
21048,
62,
71,
959,
9282,
11,
198,
220,
220,
220,
220,
220,
5509,
62,
2860,
62,
4033,
5700,
9564,
18601,
10659,
11,
198,
220,
220,
220,
220,
220,
751,
62,
25981,
65,
62,
4360,
27288,
9564,
18601,
10659,
11,
198,
17174,
17174,
2466,
1174,
198,
220,
220,
220,
220,
220,
751,
62,
77,
4147,
17926,
1797,
2751,
1976,
66,
87,
62,
21048,
62,
18224,
11,
198,
220,
220,
220,
220,
220,
751,
62,
23814,
17926,
1797,
2751,
1976,
66,
87,
62,
21048,
62,
18224,
11,
198,
220,
220,
220,
220,
220,
4292,
62,
77,
4147,
30023,
9863,
2751,
340,
62,
17440,
2539,
41876,
256,
83,
62,
17440,
2539,
17926,
1797,
2751,
1976,
66,
87,
62,
21048,
62,
18224,
11,
198,
220,
220,
220,
220,
220,
4292,
62,
17440,
30023,
9863,
2751,
21628,
62,
17440,
2539,
41876,
256,
76,
62,
17440,
2539,
17926,
1797,
2751,
1976,
66,
87,
62,
21048,
62,
18224,
11,
198,
220,
220,
220,
220,
220,
10139,
62,
2617,
62,
7635,
30023,
9863,
2751,
21628,
62,
17440,
62,
2539,
41876,
256,
76,
62,
17440,
2539,
21628,
62,
7635,
41876,
1312,
17926,
1797,
2751,
1976,
66,
87,
62,
21048,
62,
18224,
11,
198,
220,
220,
220,
220,
220,
2378,
62,
2617,
62,
7635,
30023,
9863,
2751,
21628,
62,
17440,
62,
2539,
41876,
256,
76,
62,
17440,
2539,
21628,
62,
9186,
62,
3672,
41876,
31557,
62,
270,
76,
3672,
21628,
62,
7635,
41876,
1312,
17926,
1797,
2751,
1976,
66,
87,
62,
21048,
62,
18224,
11,
198,
220,
220,
220,
220,
220,
900,
62,
33736,
62,
1990,
912,
30023,
9863,
2751,
340,
62,
1990,
83,
41876,
269,
429,
75,
62,
36439,
62,
31534,
17926,
1797,
2751,
300,
66,
87,
62,
44755,
62,
18224,
11,
198,
220,
220,
220,
220,
220,
900,
62,
34213,
62,
77,
2539,
30023,
9863,
2751,
21628,
62,
17440,
2539,
41876,
256,
76,
62,
17440,
2539,
17926,
1797,
2751,
1976,
66,
87,
62,
21048,
62,
18224,
11,
198,
220,
220,
220,
220,
220,
651,
62,
34213,
62,
77,
2539,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
77,
2539,
8,
41876,
256,
76,
62,
17440,
2539,
17926,
1797,
2751,
1976,
66,
87,
62,
21048,
62,
18224,
11,
198,
220,
220,
220,
220,
220,
9807,
62,
17440,
30023,
9863,
2751,
21628,
62,
17440,
2539,
41876,
256,
76,
62,
17440,
2539,
17926,
1797,
2751,
1976,
66,
87,
62,
21048,
62,
18224,
11,
198,
17174,
17174,
2466,
1174,
198,
220,
220,
220,
220,
220,
900,
62,
961,
62,
8807,
62,
14171,
30023,
9863,
2751,
21628,
62,
961,
62,
8807,
41876,
450,
499,
62,
30388,
17926,
1797,
2751,
1976,
66,
87,
62,
1416,
35906,
62,
8056,
11,
198,
220,
220,
220,
220,
220,
900,
62,
4775,
62,
37150,
17926,
1797,
2751,
1976,
66,
87,
62,
1416,
35906,
62,
8056,
11,
198,
220,
220,
220,
220,
220,
900,
62,
5239,
62,
292,
62,
11487,
30023,
9863,
2751,
340,
62,
5239,
41876,
256,
62,
66,
62,
5239,
17926,
1797,
2751,
1976,
66,
87,
62,
1416,
35906,
62,
8056,
11,
198,
220,
220,
220,
220,
220,
900,
62,
5239,
62,
292,
62,
5532,
30023,
9863,
2751,
340,
62,
5239,
41876,
256,
62,
66,
62,
5239,
17926,
1797,
2751,
1976,
66,
87,
62,
1416,
35906,
62,
8056,
11,
198,
220,
220,
220,
220,
220,
651,
62,
5239,
62,
292,
62,
5532,
30826
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
REPORT zalog_example_prog_rep_logger.
INITIALIZATION.
DATA(go_logger) = NEW zcl_alog_progress_rep_logger( ).
go_logger->set_total_entries( 10 ).
DO 10 TIMES.
go_logger->set_actual_entries( sy-index ).
go_logger->info( |Test message { sy-index }| ) ##NO_TEXT.
CALL FUNCTION 'RZL_SLEEP'
EXPORTING
seconds = 2
EXCEPTIONS
OTHERS = 0.
ENDDO.
| [
2200,
15490,
1976,
11794,
62,
20688,
62,
1676,
70,
62,
7856,
62,
6404,
1362,
13,
198,
198,
1268,
2043,
12576,
14887,
6234,
13,
198,
220,
42865,
7,
2188,
62,
6404,
1362,
8,
796,
12682,
1976,
565,
62,
11794,
62,
33723,
62,
7856,
62,
6404,
1362,
7,
6739,
628,
220,
467,
62,
6404,
1362,
3784,
2617,
62,
23350,
62,
298,
1678,
7,
838,
6739,
628,
220,
8410,
838,
31742,
1546,
13,
198,
220,
220,
220,
467,
62,
6404,
1362,
3784,
2617,
62,
50039,
62,
298,
1678,
7,
827,
12,
9630,
6739,
198,
220,
220,
220,
467,
62,
6404,
1362,
3784,
10951,
7,
930,
14402,
3275,
1391,
827,
12,
9630,
1782,
91,
1267,
22492,
15285,
62,
32541,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
49,
57,
43,
62,
50,
2538,
8905,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
4201,
796,
362,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
796,
657,
13,
198,
220,
23578,
18227,
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
] |
FUNCTION z_mr1m_readsoft_invoice .
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IV_RFCDEST) TYPE RFCDEST
*" REFERENCE(IV_PATH) TYPE DMS_PATH
*" REFERENCE(IV_SNDPRN) TYPE SNDPRN
*" REFERENCE(IV_MESTYP) TYPE EDI_MESTYP
*"----------------------------------------------------------------------
NEW lcl_idoc_inbound( )->process(
io_channel = NEW lcl_channel_ftp( )
iv_rfcdest = iv_rfcdest
iv_path = iv_path
iv_file_name = `[[:xdigit:]]{32}\.xml`
iv_delete = abap_false
is_edidc = VALUE edidc( mescod = 'MM' sndpor = 'READSOFT' sndprn = iv_sndprn mestyp = iv_mestyp idoctp = 'INVOIC02' cimtyp = 'ZINVOIC02' )
iv_xsltdesc = 'ZMR1M_READSOFT_INVOICE' ).
ENDFUNCTION.
| [
42296,
4177,
2849,
1976,
62,
43395,
16,
76,
62,
961,
4215,
62,
16340,
2942,
764,
198,
9,
1,
10097,
23031,
198,
9,
1,
9,
1,
14565,
26491,
25,
198,
9,
1,
220,
30023,
9863,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
3824,
62,
41150,
35,
6465,
8,
41876,
220,
30978,
35,
6465,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
3824,
62,
34219,
8,
41876,
220,
360,
5653,
62,
34219,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
3824,
62,
50,
8575,
4805,
45,
8,
41876,
220,
311,
8575,
4805,
45,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
3824,
62,
44,
6465,
48232,
8,
41876,
220,
8392,
40,
62,
44,
6465,
48232,
198,
9,
1,
10097,
23031,
628,
220,
12682,
300,
565,
62,
312,
420,
62,
259,
7784,
7,
1267,
3784,
14681,
7,
198,
220,
220,
220,
33245,
62,
17620,
220,
220,
796,
12682,
300,
565,
62,
17620,
62,
701,
79,
7,
1267,
198,
220,
220,
220,
21628,
62,
41871,
10210,
395,
220,
220,
796,
21628,
62,
41871,
10210,
395,
198,
220,
220,
220,
21628,
62,
6978,
220,
220,
220,
220,
220,
796,
21628,
62,
6978,
198,
220,
220,
220,
21628,
62,
7753,
62,
3672,
796,
4600,
30109,
25,
87,
27003,
25,
11907,
90,
2624,
92,
17405,
19875,
63,
198,
220,
220,
220,
21628,
62,
33678,
220,
220,
220,
796,
450,
499,
62,
9562,
198,
220,
220,
220,
318,
62,
276,
312,
66,
220,
220,
220,
220,
796,
26173,
8924,
1225,
312,
66,
7,
285,
3798,
375,
796,
705,
12038,
6,
264,
358,
1819,
796,
705,
15675,
15821,
9792,
6,
264,
358,
1050,
77,
796,
21628,
62,
82,
358,
1050,
77,
285,
395,
4464,
796,
21628,
62,
76,
395,
4464,
4686,
38441,
79,
796,
705,
1268,
29516,
2149,
2999,
6,
269,
320,
28004,
796,
705,
57,
1268,
29516,
2149,
2999,
6,
1267,
198,
220,
220,
220,
21628,
62,
34223,
2528,
20147,
220,
796,
705,
57,
13599,
16,
44,
62,
15675,
15821,
9792,
62,
1268,
29516,
8476,
6,
6739,
198,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_html PUBLIC.
CONSTANTS:
BEGIN OF c_action_type,
sapevent TYPE c VALUE 'E',
url TYPE c VALUE 'U',
onclick TYPE c VALUE 'C',
separator TYPE c VALUE 'S',
dummy TYPE c VALUE '_',
END OF c_action_type .
CONSTANTS:
BEGIN OF c_html_opt,
strong TYPE c VALUE 'E',
cancel TYPE c VALUE 'C',
crossout TYPE c VALUE 'X',
END OF c_html_opt .
METHODS add
IMPORTING
!ig_chunk TYPE any .
METHODS render
IMPORTING
!iv_no_indent_jscss TYPE abap_bool OPTIONAL
RETURNING
VALUE(rv_html) TYPE string .
METHODS is_empty
RETURNING
VALUE(rv_yes) TYPE abap_bool .
METHODS add_a
IMPORTING
!iv_txt TYPE string
!iv_act TYPE string
!iv_typ TYPE char1 DEFAULT c_action_type-sapevent
!iv_opt TYPE clike OPTIONAL
!iv_class TYPE string OPTIONAL
!iv_id TYPE string OPTIONAL
!iv_style TYPE string OPTIONAL.
CLASS-METHODS a
IMPORTING
!iv_txt TYPE string
!iv_act TYPE string
!iv_typ TYPE char1 DEFAULT zif_abapgit_html=>c_action_type-sapevent
!iv_opt TYPE clike OPTIONAL
!iv_class TYPE string OPTIONAL
!iv_id TYPE string OPTIONAL
!iv_style TYPE string OPTIONAL
RETURNING
VALUE(rv_str) TYPE string .
CLASS-METHODS icon
IMPORTING
!iv_name TYPE string
!iv_hint TYPE string OPTIONAL
!iv_class TYPE string OPTIONAL
RETURNING
VALUE(rv_str) TYPE string .
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
397,
499,
18300,
62,
6494,
44731,
13,
628,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
347,
43312,
3963,
269,
62,
2673,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
473,
431,
1151,
220,
41876,
269,
26173,
8924,
705,
36,
3256,
198,
220,
220,
220,
220,
220,
19016,
220,
220,
220,
220,
220,
220,
41876,
269,
26173,
8924,
705,
52,
3256,
198,
220,
220,
220,
220,
220,
319,
12976,
220,
220,
41876,
269,
26173,
8924,
705,
34,
3256,
198,
220,
220,
220,
220,
220,
2880,
1352,
41876,
269,
26173,
8924,
705,
50,
3256,
198,
220,
220,
220,
220,
220,
31548,
220,
220,
220,
220,
41876,
269,
26173,
8924,
705,
62,
3256,
198,
220,
220,
220,
23578,
3963,
269,
62,
2673,
62,
4906,
764,
198,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
347,
43312,
3963,
269,
62,
6494,
62,
8738,
11,
198,
220,
220,
220,
220,
220,
1913,
220,
220,
41876,
269,
26173,
8924,
705,
36,
3256,
198,
220,
220,
220,
220,
220,
14241,
220,
220,
41876,
269,
26173,
8924,
705,
34,
3256,
198,
220,
220,
220,
220,
220,
3272,
448,
41876,
269,
26173,
8924,
705,
55,
3256,
198,
220,
220,
220,
23578,
3963,
269,
62,
6494,
62,
8738,
764,
628,
220,
337,
36252,
50,
751,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
328,
62,
354,
2954,
41876,
597,
764,
198,
220,
337,
36252,
50,
8543,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
3919,
62,
521,
298,
62,
73,
1416,
824,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
6494,
8,
220,
220,
220,
220,
220,
41876,
4731,
764,
198,
220,
337,
36252,
50,
318,
62,
28920,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
8505,
8,
41876,
450,
499,
62,
30388,
764,
198,
220,
337,
36252,
50,
751,
62,
64,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
14116,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
529,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
28004,
220,
220,
41876,
1149,
16,
5550,
38865,
269,
62,
2673,
62,
4906,
12,
82,
1758,
1151,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
8738,
220,
220,
41876,
537,
522,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
4871,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
312,
220,
220,
220,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
7635,
41876,
4731,
39852,
2849,
1847,
13,
198,
220,
42715,
12,
49273,
50,
257,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
14116,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
529,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
28004,
220,
220,
220,
220,
220,
220,
41876,
1149,
16,
5550,
38865,
1976,
361,
62,
397,
499,
18300,
62,
6494,
14804,
66,
62,
2673,
62,
4906,
12,
82,
1758,
1151,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
8738,
220,
220,
220,
220,
220,
220,
41876,
537,
522,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
4871,
220,
220,
220,
220,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
312,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
7635,
220,
220,
220,
220,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
2536,
8,
41876,
4731,
764,
198,
220,
42715,
12,
49273,
50,
7196,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
3672,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
71,
600,
220,
220,
220,
220,
220,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
4871,
220,
220,
220,
220,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
2536,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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
] |
CLASS zcl_abapgit_object_sqsc DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_objects_super
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES:
zif_abapgit_object.
METHODS:
constructor
IMPORTING
is_item TYPE zif_abapgit_definitions=>ty_item
iv_language TYPE spras
RAISING
zcx_abapgit_exception.
PROTECTED SECTION.
PRIVATE SECTION.
" Downport original structures from
" - IF_DBPROC_PROXY_UI
" - IF_DBPROC_PROXY_BASIC_TYPES
TYPES:
ty_db_name TYPE c LENGTH 256,
ty_abap_name TYPE c LENGTH 30,
ty_param_direction TYPE c LENGTH 10,
ty_param_kind TYPE c LENGTH 10,
ty_ddic_name TYPE ddobjname,
BEGIN OF ty_db_simple_type_s,
name TYPE ty_db_name,
length TYPE i,
decs TYPE i,
END OF ty_db_simple_type_s,
BEGIN OF ty_abap_simple_type_s,
name TYPE ty_abap_name,
length TYPE i,
decs TYPE i,
END OF ty_abap_simple_type_s,
BEGIN OF ty_abap_simple_type_ui_s,
typ TYPE ty_abap_simple_type_s,
text TYPE string,
END OF ty_abap_simple_type_ui_s,
BEGIN OF ty_header_ui_s,
db_repository_package TYPE ty_db_name,
db_repository_proc_name TYPE ty_db_name,
db_catalog_schema TYPE ty_db_name,
db_catalog_proc_name TYPE ty_db_name,
read_only TYPE abap_bool,
interface_pool TYPE ty_abap_name,
END OF ty_header_ui_s,
BEGIN OF ty_param_ui_s,
position TYPE i,
db_name TYPE ty_db_name,
direction TYPE ty_param_direction,
kind TYPE ty_param_kind,
db_table_type_schema TYPE ty_db_name,
db_table_type_name TYPE ty_db_name,
db_table_type_is_ddic TYPE abap_bool,
transfer_table_schema TYPE ty_db_name,
transfer_table_name TYPE ty_db_name,
abap_name TYPE ty_abap_name,
abap_name_is_ro TYPE abap_bool,
ddic_table TYPE ty_ddic_name,
ddic_table_is_ro TYPE abap_bool,
END OF ty_param_ui_s,
ty_param_ui_t TYPE STANDARD TABLE OF ty_param_ui_s WITH KEY position,
ty_abap_simple_type_ui_t TYPE STANDARD TABLE OF ty_abap_simple_type_ui_s WITH DEFAULT KEY,
BEGIN OF ty_param_type_ui_s,
param_position TYPE i,
comp_index TYPE i,
db_comp_name TYPE ty_db_name,
abap_comp_name TYPE ty_abap_name,
abap_comp_name_is_ro TYPE abap_bool,
db_type TYPE ty_db_simple_type_s,
db_type_text TYPE string,
abap_type TYPE ty_abap_simple_type_ui_s,
abap_type_is_ro TYPE abap_bool,
abap_type_selection TYPE ty_abap_simple_type_ui_t,
ddic_type TYPE ty_ddic_name,
ddic_type_is_ro TYPE abap_bool,
END OF ty_param_type_ui_s ,
ty_param_type_ui_t TYPE STANDARD TABLE OF ty_param_type_ui_s WITH KEY param_position comp_index,
BEGIN OF ty_proxy,
description TYPE ddtext,
header TYPE ty_header_ui_s,
parameters TYPE ty_param_ui_t,
parameter_types TYPE ty_param_type_ui_t,
END OF ty_proxy.
DATA:
mo_proxy TYPE REF TO object.
METHODS:
delete_interface_if_it_exists
IMPORTING
iv_package TYPE devclass
iv_transport TYPE trkorr
iv_interface TYPE ty_abap_name
RAISING
zcx_abapgit_exception.
ENDCLASS.
CLASS zcl_abapgit_object_sqsc IMPLEMENTATION.
METHOD constructor.
FIELD-SYMBOLS: <lv_dbproxyname> TYPE ty_abap_name.
super->constructor( is_item = is_item
iv_language = iv_language ).
TRY.
CREATE OBJECT mo_proxy
TYPE ('CL_DDIC_WB_DBPROC_PROXY').
ASSIGN ('MO_PROXY->IF_DDIC_WB_DBPROC_PROXY~DBPROXYNAME')
TO <lv_dbproxyname>.
ASSERT sy-subrc = 0.
CATCH cx_root.
zcx_abapgit_exception=>raise( |SQSC not supported| ).
ENDTRY.
<lv_dbproxyname> = ms_item-obj_name.
ENDMETHOD.
METHOD delete_interface_if_it_exists.
DATA: ls_item TYPE zif_abapgit_definitions=>ty_item,
lo_interface TYPE REF TO zcl_abapgit_object_intf.
" The interface is managed by the proxy. If abapGit
" has created it before we have to delete it. Otherwise
" if_dbproc_proxy_ui~create will throw errors.
ls_item-obj_name = iv_interface.
ls_item-obj_type = 'INTF'.
IF zcl_abapgit_objects=>exists( ls_item ) = abap_true.
CREATE OBJECT lo_interface
EXPORTING
is_item = ls_item
iv_language = mv_language.
lo_interface->zif_abapgit_object~delete( iv_package = iv_package
iv_transport = iv_transport ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
rv_user = c_user_unknown.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lx_error TYPE REF TO cx_root.
TRY.
CALL METHOD mo_proxy->('IF_DBPROC_PROXY_UI~DELETE')
EXPORTING
if_transport_req = iv_transport.
CATCH cx_root INTO lx_error.
zcx_abapgit_exception=>raise_with_text( lx_error ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_proxy TYPE ty_proxy,
lx_error TYPE REF TO cx_root.
io_xml->read(
EXPORTING
iv_name = 'SQSC'
CHANGING
cg_data = ls_proxy ).
IF zif_abapgit_object~exists( ) = abap_false.
delete_interface_if_it_exists(
iv_package = iv_package
iv_transport = iv_transport
iv_interface = ls_proxy-header-interface_pool ).
CALL METHOD mo_proxy->('IF_DBPROC_PROXY_UI~CREATE')
EXPORTING
if_interface_pool = ls_proxy-header-interface_pool
if_transport_req = iv_transport
if_package = iv_package
if_langu = mv_language.
ENDIF.
TRY.
CALL METHOD mo_proxy->('IF_DBPROC_PROXY_UI~WRITE_TO_SOURCE')
EXPORTING
if_transport_req = iv_transport
is_header = ls_proxy-header
it_parameter = ls_proxy-parameters
it_parameter_type = ls_proxy-parameter_types.
CALL METHOD mo_proxy->('IF_DBPROC_PROXY_UI~WRITE_DESCR')
EXPORTING
if_langu = mv_language
if_descr = ls_proxy-description.
CALL METHOD mo_proxy->('IF_DBPROC_PROXY_UI~ACTIVATE').
tadir_insert( iv_package ).
CATCH cx_root INTO lx_error.
zcx_abapgit_exception=>raise_with_text( lx_error ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
CALL METHOD mo_proxy->('IF_DBPROC_PROXY_UI~EXISTS')
RECEIVING
ef_exists = rv_bool.
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-delete_tadir = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
" Covered by ZCL_ABAPGIT_ADT_LINK=>JUMP
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: ls_proxy TYPE ty_proxy,
lx_error TYPE REF TO cx_root.
TRY.
CALL METHOD mo_proxy->('IF_DBPROC_PROXY_UI~READ_FROM_SOURCE')
EXPORTING
if_version = 'A'
IMPORTING
es_header = ls_proxy-header
et_parameter = ls_proxy-parameters
et_parameter_type = ls_proxy-parameter_types.
CALL METHOD mo_proxy->('IF_DBPROC_PROXY_UI~READ_DESCR')
EXPORTING
if_langu = mv_language
if_version = 'A'
IMPORTING
ef_descr = ls_proxy-description.
CATCH cx_root INTO lx_error.
zcx_abapgit_exception=>raise_with_text( lx_error ).
ENDTRY.
io_xml->add( iv_name = 'SQSC'
ig_data = ls_proxy ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
31166,
1416,
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,
198,
220,
220,
220,
23255,
37,
2246,
1546,
25,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
9186,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16129,
41876,
7500,
292,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
366,
5588,
634,
2656,
8573,
422,
198,
220,
220,
220,
366,
220,
220,
532,
16876,
62,
11012,
4805,
4503,
62,
31190,
34278,
62,
10080,
198,
220,
220,
220,
366,
220,
220,
532,
16876,
62,
11012,
4805,
4503,
62,
31190,
34278,
62,
33,
1921,
2149,
62,
9936,
47,
1546,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
9945,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
406,
49494,
17759,
11,
198,
220,
220,
220,
220,
220,
1259,
62,
397,
499,
62,
3672,
220,
220,
220,
220,
220,
220,
41876,
269,
406,
49494,
1542,
11,
198,
220,
220,
220,
220,
220,
1259,
62,
17143,
62,
37295,
41876,
269,
406,
49494,
838,
11,
198,
220,
220,
220,
220,
220,
1259,
62,
17143,
62,
11031,
220,
220,
220,
220,
220,
41876,
269,
406,
49494,
838,
11,
198,
220,
220,
220,
220,
220,
1259,
62,
1860,
291,
62,
3672,
220,
220,
220,
220,
220,
220,
41876,
49427,
26801,
3672,
11,
628,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
9945,
62,
36439,
62,
4906,
62,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
41876,
1259,
62,
9945,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4129,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
875,
82,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
9945,
62,
36439,
62,
4906,
62,
82,
11,
628,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
397,
499,
62,
36439,
62,
4906,
62,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
41876,
1259,
62,
397,
499,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4129,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
875,
82,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
397,
499,
62,
36439,
62,
4906,
62,
82,
11,
628,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
397,
499,
62,
36439,
62,
4906,
62,
9019,
62,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2170,
220,
41876,
1259,
62,
397,
499,
62,
36439,
62,
4906,
62,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2420,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
397,
499,
62,
36439,
62,
4906,
62,
9019,
62,
82,
11,
628,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
25677,
62,
9019,
62,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20613,
62,
260,
1930,
37765,
62,
26495,
220,
220,
41876,
1259,
62,
9945,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20613,
62,
260,
1930,
37765,
62,
36942,
62,
3672,
41876,
1259,
62,
9945,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20613,
62,
9246,
11794,
62,
15952,
2611,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
9945,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20613,
62,
9246,
11794,
62,
36942,
62,
3672,
220,
220,
220,
41876,
1259,
62,
9945,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1100,
62,
8807,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
7071,
62,
7742,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
397,
499,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
220,
1259,
62,
25677,
62,
9019,
62,
82,
11,
628,
220,
220,
220,
220,
220,
347,
43312,
3963,
1259,
62,
17143,
62,
9019,
62,
82,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2292,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20613,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
9945,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4571,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
17143,
62,
37295,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1611,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1259,
62,
17143,
62,
11031,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20613,
62,
11487,
62,
4906,
62,
15952,
2611,
220,
41876,
1259,
62,
9945,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20613,
62,
11487,
62,
4906,
62,
3672,
220,
220,
220,
41876,
1259,
62,
9945,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20613,
62,
11487,
62,
4906,
62,
271,
62,
1860,
291,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4351,
62,
11487,
62,
15952,
2611,
41876,
1259,
62
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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_oo_class DEFINITION PUBLIC INHERITING FROM zcl_abapgit_oo_base.
PUBLIC SECTION.
METHODS:
zif_abapgit_oo_object_fnc~create REDEFINITION,
zif_abapgit_oo_object_fnc~generate_locals REDEFINITION,
zif_abapgit_oo_object_fnc~insert_text_pool REDEFINITION,
zif_abapgit_oo_object_fnc~create_sotr REDEFINITION,
zif_abapgit_oo_object_fnc~get_includes REDEFINITION,
zif_abapgit_oo_object_fnc~get_class_properties REDEFINITION,
zif_abapgit_oo_object_fnc~read_text_pool REDEFINITION,
zif_abapgit_oo_object_fnc~read_sotr REDEFINITION,
zif_abapgit_oo_object_fnc~delete REDEFINITION.
ENDCLASS.
CLASS zcl_abapgit_oo_class IMPLEMENTATION.
METHOD zif_abapgit_oo_object_fnc~create.
DATA: lt_vseoattrib TYPE seoo_attributes_r.
FIELD-SYMBOLS: <lv_clsname> TYPE seoclsname.
ASSIGN COMPONENT 'CLSNAME' OF STRUCTURE cg_properties TO <lv_clsname>.
ASSERT sy-subrc = 0.
lt_vseoattrib = convert_attrib_to_vseoattrib(
iv_clsname = <lv_clsname>
it_attributes = it_attributes ).
CALL FUNCTION 'SEO_CLASS_CREATE_COMPLETE'
EXPORTING
devclass = iv_package
overwrite = iv_overwrite
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~generate_locals.
CALL FUNCTION 'SEO_CLASS_GENERATE_LOCALS'
EXPORTING
clskey = is_key
force = iv_force
locals_def = it_local_definitions
locals_imp = it_local_implementations
locals_mac = it_local_macros
locals_testclasses = it_local_test_classes
EXCEPTIONS
not_existing = 1
model_only = 2
locals_not_generated = 3
locals_not_initialised = 4
OTHERS = 5.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from generate_locals' ).
ENDIF.
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~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~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~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~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.
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~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.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
2238,
62,
4871,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
2238,
62,
8692,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
17953,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
8612,
378,
62,
17946,
874,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
28463,
62,
5239,
62,
7742,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
17953,
62,
82,
313,
81,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
1136,
62,
42813,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
1136,
62,
4871,
62,
48310,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
961,
62,
5239,
62,
7742,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
961,
62,
82,
313,
81,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
33678,
23848,
36,
20032,
17941,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
2238,
62,
4871,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
17953,
13,
198,
220,
220,
220,
42865,
25,
300,
83,
62,
85,
325,
78,
1078,
822,
41876,
384,
2238,
62,
1078,
7657,
62,
81,
13,
198,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
6780,
62,
565,
82,
3672,
29,
41876,
384,
420,
7278,
3672,
13,
628,
220,
220,
220,
24994,
16284,
24301,
1340,
3525,
705,
5097,
15571,
10067,
6,
3963,
19269,
18415,
11335,
269,
70,
62,
48310,
5390,
1279,
6780,
62,
565,
82,
3672,
28401,
198,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
628,
220,
220,
220,
300,
83,
62,
85,
325,
78,
1078,
822,
796,
10385,
62,
1078,
822,
62,
1462,
62,
85,
325,
78,
1078,
822,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
565,
82,
3672,
220,
220,
220,
796,
1279,
6780,
62,
565,
82,
3672,
29,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
1078,
7657,
796,
340,
62,
1078,
7657,
6739,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
50,
4720,
62,
31631,
62,
43387,
6158,
62,
41335,
9328,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1614,
4871,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
26495,
198,
220,
220,
220,
220,
220,
220,
220,
49312,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
2502,
13564,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1398,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
269,
70,
62,
48310,
198,
220,
220,
220,
220,
220,
220,
220,
12608,
220,
220,
220,
220,
220,
796,
300,
83,
62,
85,
325,
78,
1078,
822,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
4683,
220,
220,
220,
220,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
318,
62,
39994,
220,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
20613,
62,
18224,
220,
220,
220,
220,
220,
220,
220,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
7515,
62,
18224,
796,
604,
198,
220,
220,
220,
220,
220,
220,
220,
645,
62,
15526,
220,
220,
220,
220,
220,
220,
796,
642,
198,
220,
220,
220,
220,
220,
220,
220,
584,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
718,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
767,
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,
30850,
62,
31631,
62,
43387,
6158,
62,
41335,
9328,
6,
6739,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
93,
8612,
378,
62,
17946,
874,
13,
198,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
50,
4720,
62,
31631,
62,
35353,
1137,
6158,
62,
29701,
23333,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
537,
82,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
318,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
2700,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
3174,
198,
220,
220,
220,
220,
220,
220,
220,
17205,
62,
4299,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
340,
62,
12001,
62,
4299,
50101,
198,
220,
220,
220,
220,
220,
220,
220,
17205,
62,
11011,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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:
BEGIN OF c_status,
ok TYPE sy-msgty VALUE 'S',
error TYPE sy-msgty VALUE 'E',
warning TYPE sy-msgty VALUE 'W',
END OF c_status.
CONSTANTS:
BEGIN OF c_log_level,
empty TYPE i VALUE 0,
info TYPE i VALUE 1,
warning TYPE i VALUE 2,
error TYPE i VALUE 3,
END OF c_log_level.
TYPES:
BEGIN OF ty_log_out,
type TYPE sy-msgty,
text TYPE string,
obj_type TYPE tadir-object,
obj_name TYPE tadir-obj_name,
exception TYPE REF TO cx_root,
END OF ty_log_out .
TYPES:
ty_log_outs TYPE STANDARD TABLE OF ty_log_out
WITH NON-UNIQUE DEFAULT KEY .
TYPES:
BEGIN OF ty_msg,
text TYPE string,
type TYPE sy-msgty,
level TYPE i,
END OF ty_msg .
TYPES:
ty_msgs TYPE STANDARD TABLE OF ty_msg
WITH NON-UNIQUE DEFAULT KEY .
TYPES:
BEGIN OF ty_item_status_out,
item TYPE zif_abapgit_definitions=>ty_item,
status TYPE sy-msgty,
messages TYPE ty_msgs,
END OF ty_item_status_out .
TYPES:
ty_item_status_outs TYPE SORTED TABLE OF ty_item_status_out
WITH UNIQUE KEY item-obj_type item-obj_name .
METHODS add
IMPORTING
!iv_msg TYPE csequence
!iv_type TYPE sy-msgty DEFAULT 'E'
!iv_rc TYPE sy-subrc OPTIONAL
!is_item TYPE zif_abapgit_definitions=>ty_item OPTIONAL
!ix_exc TYPE REF TO cx_root OPTIONAL .
METHODS add_error
IMPORTING
!iv_msg TYPE csequence
!is_item TYPE zif_abapgit_definitions=>ty_item OPTIONAL .
METHODS add_info
IMPORTING
!iv_msg TYPE csequence
!is_item TYPE zif_abapgit_definitions=>ty_item OPTIONAL .
METHODS add_warning
IMPORTING
!iv_msg TYPE csequence
!is_item TYPE zif_abapgit_definitions=>ty_item OPTIONAL .
METHODS add_success
IMPORTING
!iv_msg TYPE csequence
!is_item TYPE zif_abapgit_definitions=>ty_item OPTIONAL .
METHODS add_exception
IMPORTING
!ix_exc TYPE REF TO cx_root
!is_item TYPE zif_abapgit_definitions=>ty_item OPTIONAL .
METHODS clear .
METHODS count
RETURNING
VALUE(rv_count) TYPE i .
METHODS has_rc
IMPORTING
!iv_rc TYPE sy-subrc
RETURNING
VALUE(rv_yes) TYPE abap_bool .
METHODS get_messages
RETURNING
VALUE(rt_msg) TYPE ty_log_outs .
METHODS get_item_status
RETURNING
VALUE(rt_item_status) TYPE ty_item_status_outs .
METHODS get_status
RETURNING
VALUE(rv_status) TYPE sy-msgty .
METHODS get_log_level
RETURNING
VALUE(rv_level) TYPE i .
METHODS get_title
RETURNING
VALUE(rv_title) TYPE string .
METHODS set_title
IMPORTING
!iv_title TYPE csequence
RETURNING
VALUE(ri_log) TYPE REF TO zif_abapgit_log.
METHODS merge_with
IMPORTING
ii_log TYPE REF TO zif_abapgit_log
iv_min_level TYPE i DEFAULT 0
RETURNING
VALUE(ri_log) TYPE REF TO zif_abapgit_log.
METHODS clone
RETURNING
VALUE(ri_log) TYPE REF TO zif_abapgit_log.
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
397,
499,
18300,
62,
6404,
198,
220,
44731,
764,
628,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
347,
43312,
3963,
269,
62,
13376,
11,
198,
220,
220,
220,
220,
220,
12876,
220,
220,
220,
220,
220,
41876,
827,
12,
19662,
774,
26173,
8924,
705,
50,
3256,
198,
220,
220,
220,
220,
220,
4049,
220,
220,
41876,
827,
12,
19662,
774,
26173,
8924,
705,
36,
3256,
198,
220,
220,
220,
220,
220,
6509,
41876,
827,
12,
19662,
774,
26173,
8924,
705,
54,
3256,
198,
220,
220,
220,
23578,
3963,
269,
62,
13376,
13,
628,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
347,
43312,
3963,
269,
62,
6404,
62,
5715,
11,
198,
220,
220,
220,
220,
220,
6565,
220,
220,
41876,
1312,
26173,
8924,
657,
11,
198,
220,
220,
220,
220,
220,
7508,
220,
220,
220,
41876,
1312,
26173,
8924,
352,
11,
198,
220,
220,
220,
220,
220,
6509,
41876,
1312,
26173,
8924,
362,
11,
198,
220,
220,
220,
220,
220,
4049,
220,
220,
41876,
1312,
26173,
8924,
513,
11,
198,
220,
220,
220,
23578,
3963,
269,
62,
6404,
62,
5715,
13,
628,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
6404,
62,
448,
11,
198,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
41876,
827,
12,
19662,
774,
11,
198,
220,
220,
220,
220,
220,
2420,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
26181,
62,
4906,
220,
41876,
36264,
343,
12,
15252,
11,
198,
220,
220,
220,
220,
220,
26181,
62,
3672,
220,
41876,
36264,
343,
12,
26801,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
6631,
41876,
4526,
37,
5390,
43213,
62,
15763,
11,
198,
220,
220,
220,
23578,
3963,
1259,
62,
6404,
62,
448,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
1259,
62,
6404,
62,
5269,
41876,
49053,
9795,
43679,
3963,
1259,
62,
6404,
62,
448,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
19662,
11,
198,
220,
220,
220,
220,
220,
2420,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
2099,
41876,
827,
12,
19662,
774,
11,
198,
220,
220,
220,
220,
220,
1241,
41876,
1312,
11,
198,
220,
220,
220,
23578,
3963,
1259,
62,
19662,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
1259,
62,
907,
14542,
41876,
49053,
9795,
43679,
3963,
1259,
62,
19662,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
9186,
62,
13376,
62,
448,
11,
198,
220,
220,
220,
220,
220,
2378,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
11,
198,
220,
220,
220,
220,
220,
3722,
220,
220,
41876,
827,
12,
19662,
774,
11,
198,
220,
220,
220,
220,
220,
6218,
41876,
1259,
62,
907,
14542,
11,
198,
220,
220,
220,
23578,
3963,
1259,
62,
9186,
62,
13376,
62,
448,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
1259,
62,
9186,
62,
13376,
62,
5269,
41876,
311,
9863,
1961,
43679,
3963,
1259,
62,
9186,
62,
13376,
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,
220,
13315,
4725,
33866,
8924,
35374,
2378,
12,
26801,
62,
4906,
2378,
12,
26801,
62,
3672,
764,
628,
220,
337,
36252,
50,
751,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
19662,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
4906,
41876,
827,
12,
19662,
774,
5550,
38865,
705,
36,
6,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
6015,
220,
220,
41876,
827,
12,
7266,
6015,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
5145,
271,
62,
9186,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
5145,
844,
62,
41194,
220,
41876,
4526,
37,
5390,
43213,
62,
15763,
39852,
2849,
1847,
764,
198,
220,
337,
36252,
50,
751,
62,
18224,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
19662,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
5145,
271,
62,
9186,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
39852,
2849,
1847,
764,
198,
220,
337,
36252,
50,
751,
62,
10951,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
19662,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
5145,
271,
62,
9186,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
39852,
2849,
1847,
764,
198,
220,
337,
36252,
50,
751,
62,
43917,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
19662,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
5145,
271,
62,
9186,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
39852,
2849,
1847,
764,
198,
220,
337,
36252,
50,
751,
62,
13138,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
19662,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
5145,
271,
62,
9186,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
39852,
2849,
1847,
764,
198,
220,
337,
36252,
50,
751,
62,
1069,
4516,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
844,
62,
41194,
220,
41876,
4526,
37,
5390,
43213,
62,
15763,
198,
220,
220,
220,
220,
220,
5145,
271,
62,
9186,
41876,
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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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
] |
CLASS zcl_abapgit_object_clas DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_program.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
METHODS: constructor
IMPORTING
is_item TYPE zif_abapgit_definitions=>ty_item
iv_language TYPE spras.
PROTECTED SECTION.
DATA: mi_object_oriented_object_fct TYPE REF TO zif_abapgit_oo_object_fnc,
mv_skip_testclass TYPE abap_bool.
METHODS:
deserialize_abap
IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_input
iv_package TYPE devclass
RAISING zcx_abapgit_exception,
deserialize_docu
IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_input
RAISING zcx_abapgit_exception,
deserialize_tpool
IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_input
RAISING zcx_abapgit_exception,
deserialize_sotr
IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_input
iv_package TYPE devclass
RAISING zcx_abapgit_exception,
serialize_xml
IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_output
RAISING zcx_abapgit_exception.
PRIVATE SECTION.
METHODS:
is_class_locked
RETURNING VALUE(rv_is_class_locked) TYPE abap_bool
RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_CLAS IMPLEMENTATION.
METHOD constructor.
super->constructor( is_item = is_item
iv_language = iv_language ).
CREATE OBJECT mi_object_oriented_object_fct TYPE zcl_abapgit_oo_class.
ENDMETHOD.
METHOD deserialize_abap.
* same as in zcl_abapgit_object_clas, but without "mo_object_oriented_object_fct->add_to_activation_list"
DATA: ls_vseoclass TYPE vseoclass,
lt_source TYPE seop_source_string,
lt_local_definitions TYPE seop_source_string,
lt_local_implementations TYPE seop_source_string,
lt_local_macros TYPE seop_source_string,
lt_test_classes TYPE seop_source_string,
lt_descriptions TYPE zif_abapgit_definitions=>ty_seocompotx_tt,
ls_class_key TYPE seoclskey,
lt_attributes TYPE zif_abapgit_definitions=>ty_obj_attribute_tt.
lt_source = mo_files->read_abap( ).
lt_local_definitions = mo_files->read_abap( iv_extra = 'locals_def'
iv_error = abap_false ). "#EC NOTEXT
lt_local_implementations = mo_files->read_abap( iv_extra = 'locals_imp'
iv_error = abap_false ). "#EC NOTEXT
lt_local_macros = mo_files->read_abap( iv_extra = 'macros'
iv_error = abap_false ). "#EC NOTEXT
lt_test_classes = mo_files->read_abap( iv_extra = 'testclasses'
iv_error = abap_false ). "#EC NOTEXT
ls_class_key-clsname = ms_item-obj_name.
io_xml->read( EXPORTING iv_name = 'VSEOCLASS'
CHANGING cg_data = ls_vseoclass ).
io_xml->read( EXPORTING iv_name = 'ATTRIBUTES'
CHANGING cg_data = lt_attributes ).
mi_object_oriented_object_fct->create(
EXPORTING
iv_package = iv_package
it_attributes = lt_attributes
CHANGING
cg_properties = ls_vseoclass ).
mi_object_oriented_object_fct->generate_locals(
is_key = ls_class_key
iv_force = seox_true
it_local_definitions = lt_local_definitions
it_local_implementations = lt_local_implementations
it_local_macros = lt_local_macros
it_local_test_classes = lt_test_classes ).
mi_object_oriented_object_fct->deserialize_source(
is_key = ls_class_key
it_source = lt_source ).
io_xml->read( EXPORTING iv_name = 'DESCRIPTIONS'
CHANGING cg_data = lt_descriptions ).
mi_object_oriented_object_fct->update_descriptions(
is_key = ls_class_key
it_descriptions = lt_descriptions ).
ENDMETHOD.
METHOD deserialize_docu.
DATA: lt_lines TYPE tlinetab,
lv_object TYPE dokhl-object.
io_xml->read( EXPORTING iv_name = 'LINES'
CHANGING cg_data = lt_lines ).
IF lines( lt_lines ) = 0.
RETURN.
ENDIF.
lv_object = ms_item-obj_name.
mi_object_oriented_object_fct->create_documentation(
it_lines = lt_lines
iv_object_name = lv_object
iv_language = mv_language ).
ENDMETHOD.
METHOD deserialize_sotr.
"OTR stands for Online Text Repository
DATA: lt_sotr TYPE zif_abapgit_definitions=>ty_sotr_tt.
io_xml->read( EXPORTING iv_name = 'SOTR'
CHANGING cg_data = lt_sotr ).
IF lines( lt_sotr ) = 0.
RETURN.
ENDIF.
mi_object_oriented_object_fct->create_sotr(
iv_package = iv_package
it_sotr = lt_sotr ).
ENDMETHOD.
METHOD deserialize_tpool.
DATA: lv_clsname TYPE seoclsname,
lt_tpool_ext TYPE zif_abapgit_definitions=>ty_tpool_tt,
lt_tpool TYPE textpool_table.
io_xml->read( EXPORTING iv_name = 'TPOOL'
CHANGING cg_data = lt_tpool_ext ).
lt_tpool = read_tpool( lt_tpool_ext ).
IF lines( lt_tpool ) = 0.
RETURN.
ENDIF.
lv_clsname = ms_item-obj_name.
mi_object_oriented_object_fct->insert_text_pool(
iv_class_name = lv_clsname
it_text_pool = lt_tpool
iv_language = mv_language ).
ENDMETHOD.
METHOD is_class_locked.
DATA: lv_argument TYPE seqg3-garg.
lv_argument = ms_item-obj_name.
OVERLAY lv_argument WITH '=============================='.
lv_argument = lv_argument && '*'.
rv_is_class_locked = exists_a_lock_entry_for( iv_lock_object = 'ESEOCLASS'
iv_argument = lv_argument ).
ENDMETHOD.
METHOD serialize_xml.
DATA: ls_vseoclass TYPE vseoclass,
lt_tpool TYPE textpool_table,
lt_descriptions TYPE zif_abapgit_definitions=>ty_seocompotx_tt,
ls_clskey TYPE seoclskey,
lt_sotr TYPE zif_abapgit_definitions=>ty_sotr_tt,
lt_lines TYPE tlinetab,
lt_attributes TYPE zif_abapgit_definitions=>ty_obj_attribute_tt.
ls_clskey-clsname = ms_item-obj_name.
"If class was deserialized with a previous versions of abapGit and current language was different
"from master language at this time, this call would return SY-LANGU as master language. To fix
"these objects, set SY-LANGU to master language temporarily.
zcl_abapgit_language=>set_current_language( mv_language ).
TRY.
ls_vseoclass = mi_object_oriented_object_fct->get_class_properties( ls_clskey ).
CLEANUP.
zcl_abapgit_language=>restore_login_language( ).
ENDTRY.
zcl_abapgit_language=>restore_login_language( ).
CLEAR: ls_vseoclass-uuid,
ls_vseoclass-author,
ls_vseoclass-createdon,
ls_vseoclass-changedby,
ls_vseoclass-changedon,
ls_vseoclass-r3release,
ls_vseoclass-chgdanyby,
ls_vseoclass-chgdanyon,
ls_vseoclass-clsfinal,
ls_vseoclass-clsabstrct,
ls_vseoclass-exposure.
IF mv_skip_testclass = abap_true.
CLEAR ls_vseoclass-with_unit_tests.
ENDIF.
io_xml->add( iv_name = 'VSEOCLASS'
ig_data = ls_vseoclass ).
lt_tpool = mi_object_oriented_object_fct->read_text_pool(
iv_class_name = ls_clskey-clsname
iv_language = mv_language ).
io_xml->add( iv_name = 'TPOOL'
ig_data = add_tpool( lt_tpool ) ).
IF ls_vseoclass-category = seoc_category_exception.
lt_sotr = mi_object_oriented_object_fct->read_sotr( ms_item-obj_name ).
IF lines( lt_sotr ) > 0.
io_xml->add( iv_name = 'SOTR'
ig_data = lt_sotr ).
ENDIF.
ENDIF.
lt_lines = mi_object_oriented_object_fct->read_documentation(
iv_class_name = ls_clskey-clsname
iv_language = mv_language ).
IF lines( lt_lines ) > 0.
io_xml->add( iv_name = 'LINES'
ig_data = lt_lines ).
ENDIF.
lt_descriptions = mi_object_oriented_object_fct->read_descriptions( ls_clskey-clsname ).
IF lines( lt_descriptions ) > 0.
io_xml->add( iv_name = 'DESCRIPTIONS'
ig_data = lt_descriptions ).
ENDIF.
lt_attributes = mi_object_oriented_object_fct->read_attributes( ls_clskey-clsname ).
IF lines( lt_attributes ) > 0.
io_xml->add( iv_name = 'ATTRIBUTES'
ig_data = lt_attributes ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
TYPES: BEGIN OF ty_includes,
programm TYPE programm,
END OF ty_includes.
TYPES: BEGIN OF ty_reposrc,
unam TYPE reposrc-unam,
udat TYPE reposrc-udat,
utime TYPE reposrc-utime,
END OF ty_reposrc.
DATA: lt_reposrc TYPE STANDARD TABLE OF ty_reposrc,
ls_reposrc LIKE LINE OF lt_reposrc,
lt_includes TYPE STANDARD TABLE OF ty_includes.
lt_includes = mi_object_oriented_object_fct->get_includes( ms_item-obj_name ).
ASSERT lines( lt_includes ) > 0.
SELECT unam udat utime FROM reposrc
INTO TABLE lt_reposrc
FOR ALL ENTRIES IN lt_includes
WHERE progname = lt_includes-programm
AND r3state = 'A'.
IF sy-subrc <> 0.
rv_user = c_user_unknown.
ELSE.
SORT lt_reposrc BY udat DESCENDING utime DESCENDING.
READ TABLE lt_reposrc INDEX 1 INTO ls_reposrc.
ASSERT sy-subrc = 0.
rv_user = ls_reposrc-unam.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~compare_to_remote_version.
CREATE OBJECT ro_comparison_result TYPE zcl_abapgit_comparison_null.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: ls_clskey TYPE seoclskey.
ls_clskey-clsname = ms_item-obj_name.
mi_object_oriented_object_fct->delete( ls_clskey ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
deserialize_abap( io_xml = io_xml
iv_package = iv_package ).
deserialize_tpool( io_xml ).
deserialize_sotr( io_xml = io_xml
iv_package = iv_package ).
deserialize_docu( io_xml ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: ls_class_key TYPE seoclskey.
ls_class_key-clsname = ms_item-obj_name.
rv_bool = mi_object_oriented_object_fct->exists( ls_class_key ).
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
ENDMETHOD.
METHOD zif_abapgit_object~has_changed_since.
DATA: lt_includes TYPE seoincl_t.
FIELD-SYMBOLS <lv_incl> LIKE LINE OF lt_includes.
lt_includes = mi_object_oriented_object_fct->get_includes( ms_item-obj_name ).
LOOP AT lt_includes ASSIGNING <lv_incl>.
rv_changed = check_prog_changed_since(
iv_program = <lv_incl>
iv_timestamp = iv_timestamp
iv_skip_gui = abap_true ).
IF rv_changed = abap_true.
RETURN.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
DATA: lv_classpool TYPE program.
lv_classpool = cl_oo_classname_service=>get_classpool_name( |{ ms_item-obj_name }| ).
IF is_class_locked( ) = abap_true
OR is_text_locked( lv_classpool ) = abap_true.
rv_is_locked = abap_true.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = ms_item-obj_name
object_type = 'CLAS'
in_new_window = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lt_source TYPE seop_source_string,
ls_class_key TYPE seoclskey.
ls_class_key-clsname = ms_item-obj_name.
IF zif_abapgit_object~exists( ) = abap_false.
RETURN.
ENDIF.
CALL FUNCTION 'SEO_BUFFER_REFRESH'
EXPORTING
version = seoc_version_active
force = seox_true.
CALL FUNCTION 'SEO_BUFFER_REFRESH'
EXPORTING
version = seoc_version_inactive
force = seox_true.
lt_source = mi_object_oriented_object_fct->serialize_abap( ls_class_key ).
mo_files->add_abap( lt_source ).
lt_source = mi_object_oriented_object_fct->serialize_abap(
is_class_key = ls_class_key
iv_type = seop_ext_class_locals_def ).
IF lines( lt_source ) > 0.
mo_files->add_abap( iv_extra = 'locals_def'
it_abap = lt_source ). "#EC NOTEXT
ENDIF.
lt_source = mi_object_oriented_object_fct->serialize_abap(
is_class_key = ls_class_key
iv_type = seop_ext_class_locals_imp ).
IF lines( lt_source ) > 0.
mo_files->add_abap( iv_extra = 'locals_imp'
it_abap = lt_source ). "#EC NOTEXT
ENDIF.
lt_source = mi_object_oriented_object_fct->serialize_abap(
is_class_key = ls_class_key
iv_type = seop_ext_class_testclasses ).
mv_skip_testclass = mi_object_oriented_object_fct->get_skip_test_classes( ).
IF lines( lt_source ) > 0 AND mv_skip_testclass = abap_false.
mo_files->add_abap( iv_extra = 'testclasses'
it_abap = lt_source ). "#EC NOTEXT
ENDIF.
lt_source = mi_object_oriented_object_fct->serialize_abap(
is_class_key = ls_class_key
iv_type = seop_ext_class_macros ).
IF lines( lt_source ) > 0.
mo_files->add_abap( iv_extra = 'macros'
it_abap = lt_source ). "#EC NOTEXT
ENDIF.
serialize_xml( io_xml ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
565,
292,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
23065,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
318,
62,
9186,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16129,
41876,
7500,
292,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
42865,
25,
21504,
62,
15252,
62,
17107,
62,
15252,
62,
69,
310,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
2238,
62,
15252,
62,
69,
10782,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
85,
62,
48267,
62,
9288,
4871,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
748,
48499,
1096,
62,
397,
499,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
33245,
62,
19875,
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,
21628,
62,
26495,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
748,
48499,
1096,
62,
15390,
84,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
33245,
62,
19875,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
19875,
62,
15414,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
748,
48499,
1096,
62,
83,
7742,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
33245,
62,
19875,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
19875,
62,
15414,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
748,
48499,
1096,
62,
82,
313,
81,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
33245,
62,
19875,
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,
21628,
62,
26495,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
11389,
1096,
62,
19875,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
33245,
62,
19875,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
19875,
62,
22915,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
318,
62,
4871,
62,
24162,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
271,
62,
4871,
62,
24162,
8,
41876,
450,
499,
62,
30388,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
5097,
1921,
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,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
21504,
62,
15252,
62,
17107,
62,
15252,
62,
69,
310,
41876,
1976,
565,
62,
397,
499,
18300,
62,
2238,
62,
4871,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
748,
48499,
1096,
62,
397,
499,
13,
198,
9,
976,
355,
287,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
565,
292,
11,
475,
1231,
366,
5908,
62,
15252,
62,
17107,
62,
15252,
62,
69,
310,
3784,
2860,
62,
1462,
62,
48545,
62,
4868,
1,
628,
220,
220,
220,
42865,
25,
43979,
62,
85,
325,
420,
31172,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
410,
325,
420,
31172,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
10459,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
384,
404,
62,
10459,
62,
8841,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
12001,
62,
4299,
50101,
220,
220,
220,
220,
41876,
384,
404,
62,
10459,
62,
8841,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
12001,
62,
320,
26908,
602,
41876,
384,
404,
62,
10459,
62,
8841,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
12001,
62,
20285,
4951,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
384,
404,
62,
10459,
62,
8841,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
9288,
62,
37724,
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,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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
] |
**********************************************************************
* UTILS
**********************************************************************
CLASS lcl_utils DEFINITION FINAL.
PUBLIC SECTION.
CLASS-METHODS normalize_path
IMPORTING
iv_path TYPE string
RETURNING
VALUE(rv_path) TYPE string.
CLASS-METHODS split_path
IMPORTING
iv_path TYPE string
RETURNING
VALUE(rv_path_name) TYPE zif_abapgit_ajson=>ty_path_name.
CLASS-METHODS validate_array_index
IMPORTING
iv_path TYPE string
iv_index TYPE string
RETURNING
VALUE(rv_index) TYPE i
RAISING
zcx_abapgit_ajson_error.
ENDCLASS.
CLASS lcl_utils IMPLEMENTATION.
METHOD validate_array_index.
IF NOT iv_index CO '0123456789'.
zcx_abapgit_ajson_error=>raise( |Cannot add non-numeric key [{ iv_index }] to array [{ iv_path }]| ).
ENDIF.
rv_index = iv_index.
IF rv_index = 0.
zcx_abapgit_ajson_error=>raise( |Cannot add zero key to array [{ iv_path }]| ).
ENDIF.
ENDMETHOD.
METHOD normalize_path.
rv_path = iv_path.
IF strlen( rv_path ) = 0.
rv_path = '/'.
ENDIF.
IF rv_path+0(1) <> '/'.
rv_path = '/' && rv_path.
ENDIF.
IF substring( val = rv_path
off = strlen( rv_path ) - 1 ) <> '/'.
rv_path = rv_path && '/'.
ENDIF.
ENDMETHOD.
METHOD split_path.
DATA lv_offs TYPE i.
DATA lv_len TYPE i.
DATA lv_trim_slash TYPE i.
lv_len = strlen( iv_path ).
IF lv_len = 0 OR iv_path = '/'.
RETURN. " empty path is the alias for root item = '' + ''
ENDIF.
IF substring( val = iv_path
off = lv_len - 1 ) = '/'.
lv_trim_slash = 1. " ignore last '/'
ENDIF.
lv_offs = find( val = reverse( iv_path )
sub = '/'
off = lv_trim_slash ).
IF lv_offs = -1.
lv_offs = lv_len. " treat whole string as the 'name' part
ENDIF.
lv_offs = lv_len - lv_offs.
rv_path_name-path = normalize_path( substring( val = iv_path
len = lv_offs ) ).
rv_path_name-name = substring( val = iv_path
off = lv_offs
len = lv_len - lv_offs - lv_trim_slash ).
ENDMETHOD.
ENDCLASS.
**********************************************************************
* PARSER
**********************************************************************
CLASS lcl_json_parser DEFINITION FINAL.
PUBLIC SECTION.
METHODS parse
IMPORTING
iv_json TYPE string
RETURNING
VALUE(rt_json_tree) TYPE zif_abapgit_ajson=>ty_nodes_tt
RAISING
zcx_abapgit_ajson_error.
PRIVATE SECTION.
TYPES:
ty_stack_tt TYPE STANDARD TABLE OF REF TO zif_abapgit_ajson=>ty_node.
DATA mt_stack TYPE ty_stack_tt.
CLASS-METHODS join_path
IMPORTING
it_stack TYPE ty_stack_tt
RETURNING
VALUE(rv_path) TYPE string.
METHODS raise
IMPORTING
iv_error TYPE string
RAISING
zcx_abapgit_ajson_error.
METHODS _parse
IMPORTING
iv_json TYPE string
RETURNING
VALUE(rt_json_tree) TYPE zif_abapgit_ajson=>ty_nodes_tt
RAISING
zcx_abapgit_ajson_error cx_sxml_error.
ENDCLASS.
CLASS lcl_json_parser IMPLEMENTATION.
METHOD parse.
DATA lx_sxml TYPE REF TO cx_sxml_error.
TRY.
rt_json_tree = _parse( iv_json ).
CATCH cx_sxml_error INTO lx_sxml.
zcx_abapgit_ajson_error=>raise( `SXML: ` && lx_sxml->get_text( ) ).
ENDTRY.
ENDMETHOD.
METHOD _parse.
DATA lo_reader TYPE REF TO if_sxml_reader.
DATA lr_stack_top LIKE LINE OF mt_stack.
DATA lo_node TYPE REF TO if_sxml_node.
FIELD-SYMBOLS <item> LIKE LINE OF rt_json_tree.
CLEAR mt_stack.
IF iv_json IS INITIAL.
RETURN.
ENDIF.
lo_reader = cl_sxml_string_reader=>create( cl_abap_codepage=>convert_to( iv_json ) ).
" TODO: self protection, check non-empty, check starting from object ...
DO.
lo_node = lo_reader->read_next_node( ).
IF lo_node IS NOT BOUND.
EXIT.
ENDIF.
CASE lo_node->type.
WHEN if_sxml_node=>co_nt_element_open.
DATA lt_attributes TYPE if_sxml_attribute=>attributes.
DATA lo_attr LIKE LINE OF lt_attributes.
DATA lo_open TYPE REF TO if_sxml_open_element.
lo_open ?= lo_node.
APPEND INITIAL LINE TO rt_json_tree ASSIGNING <item>.
<item>-type = to_lower( lo_open->qname-name ).
READ TABLE mt_stack INDEX 1 INTO lr_stack_top.
IF sy-subrc = 0.
<item>-path = join_path( mt_stack ).
lr_stack_top->children = lr_stack_top->children + 1.
IF lr_stack_top->type = 'array'.
<item>-name = |{ lr_stack_top->children }|.
<item>-index = lr_stack_top->children.
ELSE.
lt_attributes = lo_open->get_attributes( ).
LOOP AT lt_attributes INTO lo_attr.
IF lo_attr->qname-name = 'name' AND lo_attr->value_type = if_sxml_value=>co_vt_text.
<item>-name = lo_attr->get_value( ).
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
GET REFERENCE OF <item> INTO lr_stack_top.
INSERT lr_stack_top INTO mt_stack INDEX 1.
WHEN if_sxml_node=>co_nt_element_close.
DATA lo_close TYPE REF TO if_sxml_close_element.
lo_close ?= lo_node.
READ TABLE mt_stack INDEX 1 INTO lr_stack_top.
DELETE mt_stack INDEX 1.
IF lo_close->qname-name <> lr_stack_top->type.
raise( 'Unexpected closing node type' ).
ENDIF.
WHEN if_sxml_node=>co_nt_value.
DATA lo_value TYPE REF TO if_sxml_value_node.
lo_value ?= lo_node.
<item>-value = lo_value->get_value( ).
WHEN OTHERS.
raise( 'Unexpected node type' ).
ENDCASE.
ENDDO.
IF lines( mt_stack ) > 0.
raise( 'Unexpected end of data' ).
ENDIF.
ENDMETHOD.
METHOD join_path.
FIELD-SYMBOLS <ref> LIKE LINE OF it_stack.
LOOP AT it_stack ASSIGNING <ref>.
rv_path = <ref>->name && '/' && rv_path.
ENDLOOP.
ENDMETHOD.
METHOD raise.
zcx_abapgit_ajson_error=>raise(
iv_location = join_path( mt_stack )
iv_msg = |JSON PARSER: { iv_error } @ { join_path( mt_stack ) }| ).
ENDMETHOD.
ENDCLASS.
**********************************************************************
* SERIALIZER
**********************************************************************
CLASS lcl_json_serializer DEFINITION FINAL CREATE PRIVATE.
PUBLIC SECTION.
CLASS-METHODS stringify
IMPORTING
it_json_tree TYPE zif_abapgit_ajson=>ty_nodes_ts
iv_indent TYPE i DEFAULT 0
iv_keep_item_order TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(rv_json_string) TYPE string
RAISING
zcx_abapgit_ajson_error.
CLASS-METHODS class_constructor.
PRIVATE SECTION.
CLASS-DATA gv_comma_with_lf TYPE string.
DATA mt_json_tree TYPE zif_abapgit_ajson=>ty_nodes_ts.
DATA mv_keep_item_order TYPE abap_bool.
DATA mt_buffer TYPE string_table.
DATA mv_indent_step TYPE i.
DATA mv_level TYPE i.
CLASS-METHODS escape
IMPORTING
iv_unescaped TYPE string
RETURNING
VALUE(rv_escaped) TYPE string.
METHODS _stringify
RETURNING
VALUE(rv_json_string) TYPE string
RAISING
zcx_abapgit_ajson_error.
METHODS stringify_node
IMPORTING
is_node TYPE zif_abapgit_ajson=>ty_node
RAISING
zcx_abapgit_ajson_error.
METHODS stringify_set
IMPORTING
iv_parent_path TYPE string
iv_array TYPE abap_bool
RAISING
zcx_abapgit_ajson_error.
ENDCLASS.
CLASS lcl_json_serializer IMPLEMENTATION.
METHOD class_constructor.
gv_comma_with_lf = ',' && cl_abap_char_utilities=>newline.
ENDMETHOD.
METHOD stringify.
DATA lo TYPE REF TO lcl_json_serializer.
CREATE OBJECT lo.
lo->mt_json_tree = it_json_tree.
lo->mv_indent_step = iv_indent.
lo->mv_keep_item_order = iv_keep_item_order.
rv_json_string = lo->_stringify( ).
ENDMETHOD.
METHOD _stringify.
FIELD-SYMBOLS <n> LIKE LINE OF mt_json_tree.
READ TABLE mt_json_tree ASSIGNING <n>
WITH KEY
path = ''
name = ''. " Root
IF sy-subrc <> 0.
RETURN.
ENDIF.
stringify_node( <n> ).
rv_json_string = concat_lines_of( table = mt_buffer ).
ENDMETHOD.
METHOD stringify_node.
DATA lv_item TYPE string.
DATA lv_indent_prefix TYPE string.
IF mv_indent_step > 0.
lv_indent_prefix = repeat( val = ` `
occ = mv_indent_step * mv_level ).
lv_item = lv_indent_prefix.
ENDIF.
IF is_node-name IS NOT INITIAL AND is_node-index IS INITIAL. " Not root, not array item
IF mv_indent_step > 0.
lv_item = lv_item && |"{ is_node-name }": |.
ELSE.
lv_item = |"{ is_node-name }":|.
ENDIF.
ENDIF.
CASE is_node-type.
WHEN zif_abapgit_ajson=>node_type-array.
lv_item = lv_item && '['.
WHEN zif_abapgit_ajson=>node_type-object.
lv_item = lv_item && '{'.
WHEN zif_abapgit_ajson=>node_type-string.
lv_item = lv_item && |"{ escape( is_node-value ) }"|.
WHEN zif_abapgit_ajson=>node_type-boolean OR zif_abapgit_ajson=>node_type-number.
lv_item = lv_item && is_node-value.
WHEN zif_abapgit_ajson=>node_type-null.
lv_item = lv_item && 'null'.
WHEN OTHERS.
zcx_abapgit_ajson_error=>raise(
iv_msg = |Unexpected type [{ is_node-type }]|
iv_location = is_node-path && is_node-name ).
ENDCASE.
IF mv_indent_step > 0
AND ( is_node-type = zif_abapgit_ajson=>node_type-array OR is_node-type = zif_abapgit_ajson=>node_type-object )
AND is_node-children > 0.
mv_level = mv_level + 1.
lv_item = lv_item && cl_abap_char_utilities=>newline.
ENDIF.
APPEND lv_item TO mt_buffer.
" finish complex item
IF is_node-type = zif_abapgit_ajson=>node_type-array OR is_node-type = zif_abapgit_ajson=>node_type-object.
DATA lv_children_path TYPE string.
DATA lv_tail TYPE string.
lv_children_path = is_node-path && is_node-name && '/'. " for root: path = '' and name = '', so result is '/'
CASE is_node-type.
WHEN zif_abapgit_ajson=>node_type-array.
IF is_node-children > 0.
stringify_set(
iv_parent_path = lv_children_path
iv_array = abap_true ).
ENDIF.
lv_tail = ']'.
WHEN zif_abapgit_ajson=>node_type-object.
IF is_node-children > 0.
stringify_set(
iv_parent_path = lv_children_path
iv_array = abap_false ).
ENDIF.
lv_tail = '}'.
ENDCASE.
IF mv_indent_step > 0 AND is_node-children > 0.
lv_tail = lv_indent_prefix && lv_tail.
mv_level = mv_level - 1.
ENDIF.
APPEND lv_tail TO mt_buffer.
ENDIF.
ENDMETHOD.
METHOD stringify_set.
DATA lv_tab_key TYPE string.
DATA lv_first_done TYPE abap_bool.
FIELD-SYMBOLS <n> LIKE LINE OF mt_json_tree.
IF iv_array = abap_true.
lv_tab_key = 'array_index'. " path + index
ELSEIF mv_keep_item_order = abap_true.
lv_tab_key = 'item_order'. " path + order
ELSE.
lv_tab_key = 'primary_key'. " path + name
ENDIF.
LOOP AT mt_json_tree ASSIGNING <n> USING KEY (lv_tab_key) WHERE path = iv_parent_path.
IF lv_first_done = abap_false.
lv_first_done = abap_true.
ELSEIF mv_indent_step > 0.
APPEND gv_comma_with_lf TO mt_buffer.
ELSE.
APPEND ',' TO mt_buffer.
ENDIF.
stringify_node( <n> ).
ENDLOOP.
IF mv_indent_step > 0 AND lv_first_done = abap_true. " only of items were in the list
APPEND cl_abap_char_utilities=>newline TO mt_buffer.
ENDIF.
ENDMETHOD.
METHOD escape.
rv_escaped = iv_unescaped.
IF rv_escaped CA |"\\\t\n\r|.
" TODO consider performance ...
" see also https://www.json.org/json-en.html
rv_escaped = replace(
val = rv_escaped
sub = '\'
with = '\\'
occ = 0 ).
rv_escaped = replace(
val = rv_escaped
sub = |\n|
with = '\n'
occ = 0 ).
rv_escaped = replace(
val = rv_escaped
sub = |\r|
with = '\r'
occ = 0 ).
rv_escaped = replace(
val = rv_escaped
sub = |\t|
with = '\t'
occ = 0 ).
rv_escaped = replace(
val = rv_escaped
sub = '"'
with = '\"'
occ = 0 ).
ENDIF.
ENDMETHOD.
ENDCLASS.
**********************************************************************
* JSON_TO_ABAP
**********************************************************************
CLASS lcl_json_to_abap DEFINITION FINAL.
PUBLIC SECTION.
METHODS find_loc
IMPORTING
iv_path TYPE string
iv_name TYPE string OPTIONAL " not mandatory
iv_append_tables TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(r_ref) TYPE REF TO data
RAISING
zcx_abapgit_ajson_error.
CLASS-METHODS bind
IMPORTING
!ii_custom_mapping TYPE REF TO zif_abapgit_ajson_mapping OPTIONAL
CHANGING
c_obj TYPE any
co_instance TYPE REF TO lcl_json_to_abap.
METHODS to_abap
IMPORTING
it_nodes TYPE zif_abapgit_ajson=>ty_nodes_ts
RAISING
zcx_abapgit_ajson_error.
METHODS to_timestamp
IMPORTING
is_path TYPE zif_abapgit_ajson=>ty_node
RETURNING
VALUE(rv_result) TYPE timestamp
RAISING
zcx_abapgit_ajson_error.
PRIVATE SECTION.
DATA mr_obj TYPE REF TO data.
DATA mi_custom_mapping TYPE REF TO zif_abapgit_ajson_mapping.
ENDCLASS.
CLASS lcl_json_to_abap IMPLEMENTATION.
METHOD bind.
CREATE OBJECT co_instance.
GET REFERENCE OF c_obj INTO co_instance->mr_obj.
co_instance->mi_custom_mapping = ii_custom_mapping.
ENDMETHOD.
METHOD to_abap.
DATA lr_ref TYPE REF TO data.
DATA lv_type TYPE c.
DATA lx TYPE REF TO cx_root.
FIELD-SYMBOLS <n> LIKE LINE OF it_nodes.
FIELD-SYMBOLS <value> TYPE any.
TRY.
LOOP AT it_nodes ASSIGNING <n> USING KEY array_index.
lr_ref = find_loc(
iv_append_tables = abap_true
iv_path = <n>-path
iv_name = <n>-name ).
ASSIGN lr_ref->* TO <value>.
ASSERT sy-subrc = 0.
DESCRIBE FIELD <value> TYPE lv_type.
CASE <n>-type.
WHEN zif_abapgit_ajson=>node_type-null.
" Do nothing
WHEN zif_abapgit_ajson=>node_type-boolean.
<value> = boolc( <n>-value = 'true' ).
WHEN zif_abapgit_ajson=>node_type-number.
<value> = <n>-value.
WHEN zif_abapgit_ajson=>node_type-string.
IF lv_type = 'D' AND <n>-value IS NOT INITIAL.
DATA lv_y TYPE c LENGTH 4.
DATA lv_m TYPE c LENGTH 2.
DATA lv_d TYPE c LENGTH 2.
FIND FIRST OCCURRENCE OF REGEX '^(\d{4})-(\d{2})-(\d{2})(T|$)'
IN <n>-value
SUBMATCHES lv_y lv_m lv_d.
IF sy-subrc <> 0.
zcx_abapgit_ajson_error=>raise(
iv_msg = 'Unexpected date format'
iv_location = <n>-path && <n>-name ).
ENDIF.
CONCATENATE lv_y lv_m lv_d INTO <value>.
ELSEIF lv_type = 'P' AND <n>-value IS NOT INITIAL.
<value> = to_timestamp( is_path = <n> ).
ELSE.
<value> = <n>-value.
ENDIF.
WHEN zif_abapgit_ajson=>node_type-object.
IF NOT lv_type CO 'uv'.
zcx_abapgit_ajson_error=>raise(
iv_msg = 'Expected structure'
iv_location = <n>-path && <n>-name ).
ENDIF.
WHEN zif_abapgit_ajson=>node_type-array.
IF NOT lv_type CO 'h'.
zcx_abapgit_ajson_error=>raise(
iv_msg = 'Expected table'
iv_location = <n>-path && <n>-name ).
ENDIF.
WHEN OTHERS.
zcx_abapgit_ajson_error=>raise(
iv_msg = |Unexpected JSON type [{ <n>-type }]|
iv_location = <n>-path && <n>-name ).
ENDCASE.
ENDLOOP.
CATCH cx_sy_conversion_no_number INTO lx.
zcx_abapgit_ajson_error=>raise(
iv_msg = |Source is not a number|
iv_location = <n>-path && <n>-name ).
ENDTRY.
ENDMETHOD.
METHOD find_loc.
DATA lt_path TYPE string_table.
DATA lv_trace TYPE string.
DATA lv_seg LIKE LINE OF lt_path.
DATA lv_type TYPE c.
DATA lv_size TYPE i.
DATA lv_index TYPE i.
FIELD-SYMBOLS <struc> TYPE any.
FIELD-SYMBOLS <table> TYPE STANDARD TABLE.
FIELD-SYMBOLS <value> TYPE any.
FIELD-SYMBOLS <seg> LIKE LINE OF lt_path.
SPLIT iv_path AT '/' INTO TABLE lt_path.
DELETE lt_path WHERE table_line IS INITIAL.
IF iv_name IS NOT INITIAL.
APPEND iv_name TO lt_path.
ENDIF.
r_ref = mr_obj.
LOOP AT lt_path ASSIGNING <seg>.
lv_trace = lv_trace && '/' && <seg>.
IF mi_custom_mapping IS BOUND.
lv_seg = mi_custom_mapping->to_abap( iv_path = iv_path
iv_name = <seg> ).
ELSE.
CLEAR lv_seg.
ENDIF.
IF lv_seg IS INITIAL.
lv_seg = to_upper( <seg> ).
ELSE.
lv_seg = to_upper( lv_seg ).
ENDIF.
ASSIGN r_ref->* TO <struc>.
ASSERT sy-subrc = 0.
DESCRIBE FIELD <struc> TYPE lv_type.
IF lv_type CA 'lr'. " data/obj ref
" TODO maybe in future
zcx_abapgit_ajson_error=>raise(
iv_msg = 'Cannot assign to ref'
iv_location = lv_trace ).
ELSEIF lv_type = 'h'. " table
IF NOT lv_seg CO '0123456789'.
zcx_abapgit_ajson_error=>raise(
iv_msg = 'Need index to access tables'
iv_location = lv_trace ).
ENDIF.
lv_index = lv_seg.
ASSIGN r_ref->* TO <table>.
ASSERT sy-subrc = 0.
lv_size = lines( <table> ).
IF iv_append_tables = abap_true AND lv_index = lv_size + 1.
APPEND INITIAL LINE TO <table>.
ENDIF.
READ TABLE <table> INDEX lv_index ASSIGNING <value>.
IF sy-subrc <> 0.
zcx_abapgit_ajson_error=>raise(
iv_msg = 'Index not found in table'
iv_location = lv_trace ).
ENDIF.
ELSEIF lv_type CA 'uv'. " structure
ASSIGN COMPONENT lv_seg OF STRUCTURE <struc> TO <value>.
IF sy-subrc <> 0.
zcx_abapgit_ajson_error=>raise(
iv_msg = 'Path not found'
iv_location = lv_trace ).
ENDIF.
ELSE.
zcx_abapgit_ajson_error=>raise(
iv_msg = 'Target is not deep'
iv_location = lv_trace ).
ENDIF.
GET REFERENCE OF <value> INTO r_ref.
ENDLOOP.
ENDMETHOD.
METHOD to_timestamp.
CONSTANTS lc_tzone_utc TYPE tznzone VALUE `UTC`.
CONSTANTS lc_regex_ts_with_hour TYPE string
VALUE `^(\d{4})-(\d{2})-(\d{2})(T)(\d{2}):(\d{2}):(\d{2})(\+)(\d{2}):(\d{2})`.
CONSTANTS lc_regex_ts_utc TYPE string
VALUE `^(\d{4})-(\d{2})-(\d{2})(T)(\d{2}):(\d{2}):(\d{2})(Z|$)`.
DATA:
BEGIN OF ls_timestamp,
year TYPE c LENGTH 4,
month TYPE c LENGTH 2,
day TYPE c LENGTH 2,
t TYPE c LENGTH 1,
hour TYPE c LENGTH 2,
minute TYPE c LENGTH 2,
second TYPE c LENGTH 2,
local_sign TYPE c LENGTH 1,
local_hour TYPE c LENGTH 2,
local_minute TYPE c LENGTH 2,
END OF ls_timestamp.
DATA lv_date TYPE d.
DATA lv_time TYPE t.
DATA lv_seconds_conv TYPE i.
DATA lv_timestamp TYPE timestamp.
FIND FIRST OCCURRENCE OF REGEX lc_regex_ts_with_hour
IN is_path-value SUBMATCHES ls_timestamp-year ls_timestamp-month ls_timestamp-day ls_timestamp-t
ls_timestamp-hour ls_timestamp-minute ls_timestamp-second
ls_timestamp-local_sign ls_timestamp-local_hour ls_timestamp-local_minute.
IF sy-subrc = 0.
lv_seconds_conv = ( ls_timestamp-local_hour * 3600 ) + ( ls_timestamp-local_minute * 60 ).
ELSE.
FIND FIRST OCCURRENCE OF REGEX lc_regex_ts_utc
IN is_path-value SUBMATCHES ls_timestamp-year ls_timestamp-month ls_timestamp-day ls_timestamp-t
ls_timestamp-hour ls_timestamp-minute ls_timestamp-second.
IF sy-subrc <> 0.
zcx_abapgit_ajson_error=>raise(
iv_msg = 'Unexpected timestamp format'
iv_location = is_path-path && is_path-name ).
ENDIF.
ENDIF.
CONCATENATE ls_timestamp-year ls_timestamp-month ls_timestamp-day INTO lv_date.
CONCATENATE ls_timestamp-hour ls_timestamp-minute ls_timestamp-second INTO lv_time.
CONVERT DATE lv_date TIME lv_time INTO TIME STAMP lv_timestamp TIME ZONE lc_tzone_utc.
TRY.
CASE ls_timestamp-local_sign.
WHEN '-'.
lv_timestamp = cl_abap_tstmp=>add( tstmp = lv_timestamp
secs = lv_seconds_conv ).
WHEN '+'.
lv_timestamp = cl_abap_tstmp=>subtractsecs( tstmp = lv_timestamp
secs = lv_seconds_conv ).
ENDCASE.
CATCH cx_parameter_invalid_range cx_parameter_invalid_type.
zcx_abapgit_ajson_error=>raise(
iv_msg = 'Unexpected error calculating timestamp'
iv_location = is_path-path && is_path-name ).
ENDTRY.
rv_result = lv_timestamp.
ENDMETHOD.
ENDCLASS.
**********************************************************************
* ABAP_TO_JSON
**********************************************************************
CLASS lcl_abap_to_json DEFINITION FINAL.
PUBLIC SECTION.
CLASS-METHODS convert
IMPORTING
iv_data TYPE any
is_prefix TYPE zif_abapgit_ajson=>ty_path_name OPTIONAL
iv_array_index TYPE i DEFAULT 0
ii_custom_mapping TYPE REF TO zif_abapgit_ajson_mapping OPTIONAL
iv_keep_item_order TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(rt_nodes) TYPE zif_abapgit_ajson=>ty_nodes_tt
RAISING
zcx_abapgit_ajson_error.
CLASS-METHODS insert_with_type
IMPORTING
iv_data TYPE any
iv_type TYPE string
is_prefix TYPE zif_abapgit_ajson=>ty_path_name OPTIONAL
iv_array_index TYPE i DEFAULT 0
ii_custom_mapping TYPE REF TO zif_abapgit_ajson_mapping OPTIONAL
iv_keep_item_order TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(rt_nodes) TYPE zif_abapgit_ajson=>ty_nodes_tt
RAISING
zcx_abapgit_ajson_error.
CLASS-METHODS class_constructor.
PRIVATE SECTION.
CLASS-DATA gv_ajson_absolute_type_name TYPE string.
DATA mi_custom_mapping TYPE REF TO zif_abapgit_ajson_mapping.
DATA mv_keep_item_order TYPE abap_bool.
METHODS convert_any
IMPORTING
iv_data TYPE any
io_type TYPE REF TO cl_abap_typedescr
is_prefix TYPE zif_abapgit_ajson=>ty_path_name
iv_index TYPE i DEFAULT 0
iv_item_order TYPE i DEFAULT 0
CHANGING
ct_nodes TYPE zif_abapgit_ajson=>ty_nodes_tt
RAISING
zcx_abapgit_ajson_error.
METHODS convert_ajson
IMPORTING
io_json TYPE REF TO zcl_abapgit_ajson
is_prefix TYPE zif_abapgit_ajson=>ty_path_name
iv_index TYPE i DEFAULT 0
CHANGING
ct_nodes TYPE zif_abapgit_ajson=>ty_nodes_tt.
METHODS convert_value
IMPORTING
iv_data TYPE any
io_type TYPE REF TO cl_abap_typedescr
is_prefix TYPE zif_abapgit_ajson=>ty_path_name
iv_index TYPE i DEFAULT 0
iv_item_order TYPE i DEFAULT 0
CHANGING
ct_nodes TYPE zif_abapgit_ajson=>ty_nodes_tt
RAISING
zcx_abapgit_ajson_error.
METHODS convert_ref
IMPORTING
iv_data TYPE any
is_prefix TYPE zif_abapgit_ajson=>ty_path_name
iv_index TYPE i DEFAULT 0
iv_item_order TYPE i DEFAULT 0
CHANGING
ct_nodes TYPE zif_abapgit_ajson=>ty_nodes_tt
RAISING
zcx_abapgit_ajson_error.
METHODS convert_struc
IMPORTING
iv_data TYPE any
io_type TYPE REF TO cl_abap_typedescr
is_prefix TYPE zif_abapgit_ajson=>ty_path_name
iv_index TYPE i DEFAULT 0
iv_item_order TYPE i DEFAULT 0
CHANGING
ct_nodes TYPE zif_abapgit_ajson=>ty_nodes_tt
cs_root TYPE zif_abapgit_ajson=>ty_node OPTIONAL
RAISING
zcx_abapgit_ajson_error.
METHODS convert_table
IMPORTING
iv_data TYPE any
io_type TYPE REF TO cl_abap_typedescr
is_prefix TYPE zif_abapgit_ajson=>ty_path_name
iv_index TYPE i DEFAULT 0
iv_item_order TYPE i DEFAULT 0
CHANGING
ct_nodes TYPE zif_abapgit_ajson=>ty_nodes_tt
RAISING
zcx_abapgit_ajson_error.
METHODS insert_value_with_type
IMPORTING
iv_data TYPE any
iv_type TYPE string
io_type TYPE REF TO cl_abap_typedescr
is_prefix TYPE zif_abapgit_ajson=>ty_path_name
iv_index TYPE i DEFAULT 0
iv_item_order TYPE i DEFAULT 0
CHANGING
ct_nodes TYPE zif_abapgit_ajson=>ty_nodes_tt
RAISING
zcx_abapgit_ajson_error.
ENDCLASS.
CLASS lcl_abap_to_json IMPLEMENTATION.
METHOD class_constructor.
DATA lo_dummy TYPE REF TO zcl_abapgit_ajson.
DATA lo_type TYPE REF TO cl_abap_refdescr.
lo_type ?= cl_abap_typedescr=>describe_by_data( lo_dummy ).
gv_ajson_absolute_type_name = lo_type->get_referenced_type( )->absolute_name.
ENDMETHOD.
METHOD convert.
DATA lo_type TYPE REF TO cl_abap_typedescr.
DATA lo_converter TYPE REF TO lcl_abap_to_json.
lo_type = cl_abap_typedescr=>describe_by_data( iv_data ).
CREATE OBJECT lo_converter.
lo_converter->mi_custom_mapping = ii_custom_mapping.
lo_converter->mv_keep_item_order = iv_keep_item_order.
lo_converter->convert_any(
EXPORTING
iv_data = iv_data
io_type = lo_type
is_prefix = is_prefix
iv_index = iv_array_index
CHANGING
ct_nodes = rt_nodes ).
ENDMETHOD.
METHOD convert_any.
CASE io_type->kind.
WHEN cl_abap_typedescr=>kind_elem.
convert_value(
EXPORTING
iv_data = iv_data
io_type = io_type
is_prefix = is_prefix
iv_index = iv_index
iv_item_order = iv_item_order
CHANGING
ct_nodes = ct_nodes ).
WHEN cl_abap_typedescr=>kind_struct.
convert_struc(
EXPORTING
iv_data = iv_data
io_type = io_type
is_prefix = is_prefix
iv_index = iv_index
iv_item_order = iv_item_order
CHANGING
ct_nodes = ct_nodes ).
WHEN cl_abap_typedescr=>kind_table.
convert_table(
EXPORTING
iv_data = iv_data
io_type = io_type
is_prefix = is_prefix
iv_index = iv_index
iv_item_order = iv_item_order
CHANGING
ct_nodes = ct_nodes ).
WHEN OTHERS.
IF io_type->type_kind = cl_abap_typedescr=>typekind_dref.
convert_ref(
EXPORTING
iv_data = iv_data
is_prefix = is_prefix
iv_index = iv_index
iv_item_order = iv_item_order
CHANGING
ct_nodes = ct_nodes ).
ELSEIF io_type->type_kind = cl_abap_typedescr=>typekind_oref
AND cl_abap_typedescr=>describe_by_object_ref( iv_data )->absolute_name = gv_ajson_absolute_type_name.
convert_ajson(
EXPORTING
io_json = iv_data
is_prefix = is_prefix
iv_index = iv_index
CHANGING
ct_nodes = ct_nodes ).
ELSE.
zcx_abapgit_ajson_error=>raise( |Unsupported type [{ io_type->type_kind
}] @{ is_prefix-path && is_prefix-name }| ).
ENDIF.
ENDCASE.
ENDMETHOD.
METHOD convert_ajson.
FIELD-SYMBOLS <n> LIKE LINE OF ct_nodes.
ct_nodes = io_json->mt_json_tree.
LOOP AT ct_nodes ASSIGNING <n>.
IF <n>-path IS INITIAL AND <n>-name IS INITIAL. " root node
<n>-path = is_prefix-path.
<n>-name = is_prefix-name.
<n>-index = iv_index.
ELSE.
<n>-path = is_prefix-path && is_prefix-name && <n>-path.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD convert_value.
FIELD-SYMBOLS <n> LIKE LINE OF ct_nodes.
APPEND INITIAL LINE TO ct_nodes ASSIGNING <n>.
<n>-path = is_prefix-path.
<n>-name = is_prefix-name.
<n>-index = iv_index.
<n>-order = iv_item_order.
IF mi_custom_mapping IS BOUND.
<n>-name = mi_custom_mapping->to_json( iv_path = is_prefix-path
iv_name = is_prefix-name ).
ENDIF.
IF <n>-name IS INITIAL.
<n>-name = is_prefix-name.
ENDIF.
IF io_type->absolute_name = '\TYPE-POOL=ABAP\TYPE=ABAP_BOOL' OR io_type->absolute_name = '\TYPE=XFELD'.
<n>-type = zif_abapgit_ajson=>node_type-boolean.
IF iv_data IS NOT INITIAL.
<n>-value = 'true'.
ELSE.
<n>-value = 'false'.
ENDIF.
ELSEIF io_type->type_kind CO 'CNgXyDT'. " Char like, date/time, xstring
<n>-type = zif_abapgit_ajson=>node_type-string.
<n>-value = |{ iv_data }|.
ELSEIF io_type->type_kind CO 'bsI8PaeF'. " Numeric
<n>-type = zif_abapgit_ajson=>node_type-number.
<n>-value = |{ iv_data }|.
ELSE.
zcx_abapgit_ajson_error=>raise( |Unexpected elemetary type [{
io_type->type_kind }] @{ is_prefix-path && is_prefix-name }| ).
ENDIF.
ENDMETHOD.
METHOD convert_ref.
FIELD-SYMBOLS <n> LIKE LINE OF ct_nodes.
APPEND INITIAL LINE TO ct_nodes ASSIGNING <n>.
<n>-path = is_prefix-path.
<n>-name = is_prefix-name.
<n>-index = iv_index.
<n>-order = iv_item_order.
IF mi_custom_mapping IS BOUND.
<n>-name = mi_custom_mapping->to_json( iv_path = is_prefix-path
iv_name = is_prefix-name ).
ENDIF.
IF <n>-name IS INITIAL.
<n>-name = is_prefix-name.
ENDIF.
IF iv_data IS INITIAL.
<n>-type = zif_abapgit_ajson=>node_type-null.
<n>-value = 'null'.
ELSE.
" TODO support data references
zcx_abapgit_ajson_error=>raise( |Unexpected reference @{ is_prefix-path && is_prefix-name }| ).
ENDIF.
ENDMETHOD.
METHOD convert_struc.
DATA lo_struc TYPE REF TO cl_abap_structdescr.
DATA lt_comps TYPE cl_abap_structdescr=>component_table.
DATA ls_next_prefix LIKE is_prefix.
DATA lv_item_order TYPE i.
FIELD-SYMBOLS <root> LIKE LINE OF ct_nodes.
FIELD-SYMBOLS <c> LIKE LINE OF lt_comps.
FIELD-SYMBOLS <val> TYPE any.
lo_struc ?= io_type.
lt_comps = lo_struc->get_components( ).
" get_components is potentially much slower than lo_struc->components
" but ! we still need it to identify booleans
" and rtti seems to cache type descriptions really well (https://github.com/sbcgua/benchmarks.git)
" the structures will be repeated in real life
IF cs_root IS SUPPLIED. " call for include structure
ASSIGN cs_root TO <root>.
ELSE. " First call
APPEND INITIAL LINE TO ct_nodes ASSIGNING <root>.
<root>-path = is_prefix-path.
<root>-name = is_prefix-name.
<root>-type = zif_abapgit_ajson=>node_type-object.
<root>-index = iv_index.
IF mi_custom_mapping IS BOUND.
<root>-name = mi_custom_mapping->to_json( iv_path = is_prefix-path
iv_name = is_prefix-name ).
ENDIF.
IF <root>-name IS INITIAL.
<root>-name = is_prefix-name.
ENDIF.
<root>-order = iv_item_order.
ENDIF.
ls_next_prefix-path = is_prefix-path && is_prefix-name && '/'.
LOOP AT lt_comps ASSIGNING <c>.
IF <c>-as_include = abap_true.
convert_struc(
EXPORTING
iv_data = iv_data
io_type = <c>-type
is_prefix = is_prefix
CHANGING
cs_root = <root>
ct_nodes = ct_nodes ).
ELSE.
<root>-children = <root>-children + 1.
ls_next_prefix-name = to_lower( <c>-name ).
ASSIGN COMPONENT <c>-name OF STRUCTURE iv_data TO <val>.
ASSERT sy-subrc = 0.
IF mv_keep_item_order = abap_true.
lv_item_order = <root>-children.
ENDIF.
convert_any(
EXPORTING
iv_data = <val>
io_type = <c>-type
is_prefix = ls_next_prefix
iv_item_order = lv_item_order
CHANGING
ct_nodes = ct_nodes ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD convert_table.
DATA lo_table TYPE REF TO cl_abap_tabledescr.
DATA lo_ltype TYPE REF TO cl_abap_typedescr.
DATA ls_next_prefix LIKE is_prefix.
FIELD-SYMBOLS <root> LIKE LINE OF ct_nodes.
FIELD-SYMBOLS <tab> TYPE ANY TABLE.
FIELD-SYMBOLS <val> TYPE any.
lo_table ?= io_type.
lo_ltype = lo_table->get_table_line_type( ).
APPEND INITIAL LINE TO ct_nodes ASSIGNING <root>.
<root>-path = is_prefix-path.
<root>-name = is_prefix-name.
<root>-type = zif_abapgit_ajson=>node_type-array.
<root>-index = iv_index.
<root>-order = iv_item_order.
IF mi_custom_mapping IS BOUND.
<root>-name = mi_custom_mapping->to_json( iv_path = is_prefix-path
iv_name = is_prefix-name ).
ENDIF.
IF <root>-name IS INITIAL.
<root>-name = is_prefix-name.
ENDIF.
ls_next_prefix-path = is_prefix-path && is_prefix-name && '/'.
ASSIGN iv_data TO <tab>.
LOOP AT <tab> ASSIGNING <val>.
ls_next_prefix-name = to_lower( |{ sy-tabix }| ).
convert_any(
EXPORTING
iv_data = <val>
io_type = lo_ltype
is_prefix = ls_next_prefix
iv_index = <root>-children + 1
CHANGING
ct_nodes = ct_nodes ).
<root>-children = <root>-children + 1.
ENDLOOP.
ENDMETHOD.
METHOD insert_with_type.
DATA lo_type TYPE REF TO cl_abap_typedescr.
DATA lo_converter TYPE REF TO lcl_abap_to_json.
lo_type = cl_abap_typedescr=>describe_by_data( iv_data ).
CREATE OBJECT lo_converter.
lo_converter->mi_custom_mapping = ii_custom_mapping.
lo_converter->mv_keep_item_order = iv_keep_item_order.
lo_converter->insert_value_with_type(
EXPORTING
iv_data = iv_data
iv_type = iv_type
io_type = lo_type
is_prefix = is_prefix
iv_index = iv_array_index
CHANGING
ct_nodes = rt_nodes ).
ENDMETHOD.
METHOD insert_value_with_type.
DATA lv_prefix TYPE string.
FIELD-SYMBOLS <n> LIKE LINE OF ct_nodes.
lv_prefix = is_prefix-path && is_prefix-name.
IF io_type->type_kind CO 'CNgXyDT'. " Char like, date/time, xstring
IF iv_type = zif_abapgit_ajson=>node_type-boolean AND iv_data <> 'true' AND iv_data <> 'false'.
zcx_abapgit_ajson_error=>raise( |Unexpected boolean value [{ iv_data }] @{ lv_prefix }| ).
ELSEIF iv_type = zif_abapgit_ajson=>node_type-null AND iv_data IS NOT INITIAL.
zcx_abapgit_ajson_error=>raise( |Unexpected null value [{ iv_data }] @{ lv_prefix }| ).
ELSEIF iv_type = zif_abapgit_ajson=>node_type-number AND iv_data CN '0123456789. E+-'.
zcx_abapgit_ajson_error=>raise( |Unexpected numeric value [{ iv_data }] @{ lv_prefix }| ).
ELSEIF iv_type <> zif_abapgit_ajson=>node_type-string AND iv_type <> zif_abapgit_ajson=>node_type-boolean
AND iv_type <> zif_abapgit_ajson=>node_type-null AND iv_type <> zif_abapgit_ajson=>node_type-number.
zcx_abapgit_ajson_error=>raise( |Unexpected type for value [{ iv_type },{ iv_data }] @{ lv_prefix }| ).
ENDIF.
ELSEIF io_type->type_kind CO 'bsI8PaeF'. " Numeric
IF iv_type <> zif_abapgit_ajson=>node_type-number.
zcx_abapgit_ajson_error=>raise( |Unexpected value for numeric [{ iv_data }] @{ lv_prefix }| ).
ENDIF.
ELSE.
zcx_abapgit_ajson_error=>raise( |Unexpected type [{ io_type->type_kind }] @{ lv_prefix }| ).
ENDIF.
APPEND INITIAL LINE TO ct_nodes ASSIGNING <n>.
<n>-path = is_prefix-path.
<n>-name = is_prefix-name.
<n>-index = iv_index.
<n>-value = iv_data.
<n>-type = iv_type.
<n>-order = iv_item_order.
IF mi_custom_mapping IS BOUND.
<n>-name = mi_custom_mapping->to_json( iv_path = is_prefix-path
iv_name = is_prefix-name ).
ENDIF.
IF <n>-name IS INITIAL.
<n>-name = is_prefix-name.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
17174,
17174,
2466,
1174,
198,
9,
19255,
45484,
198,
17174,
17174,
2466,
1174,
198,
198,
31631,
300,
565,
62,
26791,
5550,
20032,
17941,
25261,
13,
198,
220,
44731,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
3487,
1096,
62,
6978,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
6978,
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,
6978,
8,
41876,
4731,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
6626,
62,
6978,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
6978,
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,
6978,
62,
3672,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
1228,
1559,
14804,
774,
62,
6978,
62,
3672,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
26571,
62,
18747,
62,
9630,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
6978,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
9630,
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,
9630,
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,
1228,
1559,
62,
18224,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
300,
565,
62,
26791,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
26571,
62,
18747,
62,
9630,
13,
628,
220,
220,
220,
16876,
5626,
21628,
62,
9630,
7375,
705,
486,
1954,
2231,
3134,
4531,
4458,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1228,
1559,
62,
18224,
14804,
40225,
7,
930,
34,
34574,
751,
1729,
12,
77,
39223,
1994,
685,
90,
21628,
62,
9630,
1782,
60,
284,
7177,
685,
90,
21628,
62,
6978,
1782,
60,
91,
6739,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
374,
85,
62,
9630,
796,
21628,
62,
9630,
13,
198,
220,
220,
220,
16876,
374,
85,
62,
9630,
796,
657,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1228,
1559,
62,
18224,
14804,
40225,
7,
930,
34,
34574,
751,
6632,
1994,
284,
7177,
685,
90,
21628,
62,
6978,
1782,
60,
91,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
3487,
1096,
62,
6978,
13,
628,
220,
220,
220,
374,
85,
62,
6978,
796,
21628,
62,
6978,
13,
198,
220,
220,
220,
16876,
965,
11925,
7,
374,
85,
62,
6978,
1267,
796,
657,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
6978,
796,
31051,
4458,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
16876,
374,
85,
62,
6978,
10,
15,
7,
16,
8,
1279,
29,
31051,
4458,
198,
220,
220,
220,
220,
220,
374,
85,
62,
6978,
796,
31051,
6,
11405,
374,
85,
62,
6978,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
16876,
3293,
1806,
7,
1188,
796,
374,
85,
62,
6978,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
572,
796,
965,
11925,
7,
374,
85,
62,
6978,
1267,
532,
352,
1267,
1279,
29,
31051,
4458,
198,
220,
220,
220,
220,
220,
374,
85,
62,
6978,
796,
374,
85,
62,
6978,
11405,
31051,
4458,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
6626,
62,
6978,
13,
628,
220,
220,
220,
42865,
300,
85,
62,
8210,
41876,
1312,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
11925,
41876,
1312,
13,
198,
220,
220,
220,
42865,
300,
85,
62,
2213,
320,
62,
6649,
1077,
41876,
1312,
13,
628,
220,
220,
220,
300,
85,
62,
11925,
796,
965,
11925,
7,
21628,
62,
6978,
6739,
198,
220,
220,
220,
16876,
300,
85,
62,
11925,
796,
657,
6375,
21628,
62,
6978,
796,
31051,
4458,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
366,
6565,
3108,
318,
262,
16144,
329,
6808,
2378,
796,
10148,
1343,
10148,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
16876,
3293,
1806,
7,
1188,
796,
21628,
62,
6978,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
572,
796,
300,
85,
62,
11925,
532,
352,
1267,
796,
31051,
4458,
198,
220,
220,
220,
220,
220,
300,
85,
62,
2213,
320,
62,
6649,
1077,
796,
352,
13,
366,
8856,
938,
31051,
6,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
300,
85,
62,
8210,
796,
1064,
7,
1188,
796,
9575,
7,
21628,
62,
6978,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
850,
796,
31051,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
572,
796,
300,
85,
62,
2213,
320,
62,
6649,
1077,
6739,
198,
220,
220,
220,
16876,
300,
85,
62,
8210,
796,
532,
16,
13,
198,
220,
220,
220,
220,
220,
300,
85,
62,
8210,
220,
796,
300,
85,
62,
11925,
13,
366,
2190,
2187,
4731,
355,
262,
705,
3672,
6,
636,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
300,
85,
62,
8210,
796,
300,
85,
62,
11925,
532,
300,
85,
62,
8210,
13,
628,
220,
220,
220,
374,
85,
62,
6978,
62,
3672,
12,
6978,
796,
3487,
1096,
62,
6978,
7,
3293,
1806,
7,
1188,
796,
21628,
62,
6978,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
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,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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
] |
*"* use this source file for the definition and implementation of
*"* local helper classes, interface definitions and type
*"* declarations
CLASS zcl_xtt_xml_base DEFINITION LOAD.
| [
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,
1976,
565,
62,
742,
83,
62,
19875,
62,
8692,
5550,
20032,
17941,
17579,
2885,
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
] |
"! <h1>API for Deleting a Travel</h1>
"!
"! <p>
"! Function module to delete a single Travel instance.
"! It will also delete all related subnodes of Booking and Booking Supplement.
"! </p>
"!
"! @parameter iv_travel_id | ID of the Travel to be deleted
"! @parameter et_messages | Table of occurred messages
"!
FUNCTION /DMO/FLIGHT_TRAVEL_DELETE26.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IV_TRAVEL_ID) TYPE /DMO/TRAVEL_ID26
*" EXPORTING
*" REFERENCE(ET_MESSAGES) TYPE /DMO/IF_FLIGHT_LEGACY26=>TT_MESSAGE
*"----------------------------------------------------------------------
CLEAR et_messages.
/dmo/cl_flight_legacy26=>get_instance( )->delete_travel( EXPORTING iv_travel_id = iv_travel_id
IMPORTING et_messages = DATA(lt_messages) ).
/dmo/cl_flight_legacy26=>get_instance( )->convert_messages( EXPORTING it_messages = lt_messages
IMPORTING et_messages = et_messages ).
ENDFUNCTION.
| [
40484,
1279,
71,
16,
29,
17614,
329,
42226,
889,
257,
13524,
3556,
71,
16,
29,
198,
40484,
198,
40484,
1279,
79,
29,
198,
40484,
15553,
8265,
284,
12233,
257,
2060,
13524,
4554,
13,
198,
40484,
632,
481,
635,
12233,
477,
3519,
850,
77,
4147,
286,
4897,
278,
290,
4897,
278,
23150,
13,
198,
40484,
7359,
79,
29,
198,
40484,
198,
40484,
2488,
17143,
2357,
21628,
62,
35927,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
4522,
286,
262,
13524,
284,
307,
13140,
198,
40484,
2488,
17143,
2357,
2123,
62,
37348,
1095,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
8655,
286,
5091,
6218,
198,
40484,
198,
42296,
4177,
2849,
1220,
35,
11770,
14,
3697,
9947,
62,
51,
3861,
18697,
62,
7206,
2538,
9328,
2075,
13,
198,
9,
1,
10097,
23031,
198,
9,
1,
9,
1,
14565,
26491,
25,
198,
9,
1,
220,
30023,
9863,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
3824,
62,
51,
3861,
18697,
62,
2389,
8,
41876,
220,
1220,
35,
11770,
14,
51,
3861,
18697,
62,
2389,
2075,
198,
9,
1,
220,
7788,
15490,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
2767,
62,
44,
1546,
4090,
48075,
8,
41876,
220,
1220,
35,
11770,
14,
5064,
62,
3697,
9947,
62,
2538,
38,
43300,
2075,
14804,
15751,
62,
44,
1546,
4090,
8264,
198,
9,
1,
10097,
23031,
198,
220,
30301,
1503,
2123,
62,
37348,
1095,
13,
628,
220,
1220,
67,
5908,
14,
565,
62,
22560,
62,
1455,
1590,
2075,
14804,
1136,
62,
39098,
7,
1267,
3784,
33678,
62,
35927,
7,
7788,
15490,
2751,
21628,
62,
35927,
62,
312,
796,
21628,
62,
35927,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
2123,
62,
37348,
1095,
220,
796,
42865,
7,
2528,
62,
37348,
1095,
8,
6739,
628,
220,
1220,
67,
5908,
14,
565,
62,
22560,
62,
1455,
1590,
2075,
14804,
1136,
62,
39098,
7,
1267,
3784,
1102,
1851,
62,
37348,
1095,
7,
7788,
15490,
2751,
340,
62,
37348,
1095,
796,
300,
83,
62,
37348,
1095,
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,
30023,
9863,
2751,
2123,
62,
37348,
1095,
796,
2123,
62,
37348,
1095,
6739,
198,
1677,
8068,
4944,
4177,
2849,
13,
198
] | [
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
] |
*"* use this source file for your ABAP unit test classes
CLASS ltcl_abap_doc_reader DEFINITION FINAL FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
DATA test_obj TYPE REF TO zcl_aff_abap_doc_reader.
METHODS setup.
METHODS get_abap_doc_4_element_types FOR TESTING.
METHODS get_abap_doc_4_element_data FOR TESTING.
METHODS get_abap_doc_4_sub_elem_types FOR TESTING.
METHODS get_abap_doc_4_wrong_elem_name FOR TESTING.
METHODS get_abap_doc_4_elem_wo_adoc FOR TESTING.
ENDCLASS.
CLASS ltcl_abap_doc_reader IMPLEMENTATION.
METHOD setup.
DATA lt_clif_source TYPE string_table.
lt_clif_source = VALUE #(
( |class CL_EC_WITH_COMMENTED_TYPES definition| )
( | public| )
( | final| )
( | create public .| )
( || )
( | public section.| )
( || )
( | types:| )
( | "! abap doc comment begin of ty_pub_structure| )
( | begin " inline comment| )
( | of " inline comment| )
( | ty_pub_structure, " inline comment ty_pub_structure| )
( | "! ABAP Doc This is field A of the structure| )
( | field_a type i, " inline comment field_a| )
( | "! ABAP Doc This is field B of the structure| )
( | field_b type string,| )
( | end of ty_pub_structure .| )
( | types:| )
( | "! abap doc ty_tab_of_structure| )
( | ty_tab_of_pub_structure " inline comment ty_tab_of_structure (type table of )| )
( | " pure inline comment line 1| )
( | type " inline| )
( | table of ty_pub_structure with default key .| )
( | | )
( | data SUBRC type SY-SUBRC read-only .| )
( | protected section.| )
( | private section.| )
( | "! Just simple data| )
( | data abc type i.| )
( |ENDCLASS.| )
( || )
( || )
( |CLASS CL_EC_WITH_COMMENTED_TYPES IMPLEMENTATION.| )
( |ENDCLASS.| ) ).
test_obj = zcl_aff_abap_doc_reader=>create_instance( source = lt_clif_source ).
ENDMETHOD.
METHOD get_abap_doc_4_element_types.
TRY.
DATA(result) = test_obj->get_abap_doc_for_element( element_name = 'ty_pub_structure' ).
cl_abap_unit_assert=>assert_equals( exp = 'abap doc comment begin of ty_pub_structure'
act = result ).
CATCH cx_root ##NO_HANDLER ##CATCH_ALL.
ENDTRY.
ENDMETHOD.
METHOD get_abap_doc_4_element_data.
TRY.
DATA(result) = test_obj->get_abap_doc_for_element( element_name = 'ABC' ).
cl_abap_unit_assert=>assert_equals(
exp = 'Just simple data'
act = result ).
CATCH cx_root ##NO_HANDLER ##CATCH_ALL.
ENDTRY.
ENDMETHOD.
METHOD get_abap_doc_4_sub_elem_types.
TRY.
DATA(result) = test_obj->get_abap_doc_for_element( element_name = 'ty_pub_structure-field_a' ).
cl_abap_unit_assert=>assert_equals(
exp = 'ABAP Doc This is field A of the structure'
act = result ).
CATCH cx_root ##NO_HANDLER ##CATCH_ALL.
ENDTRY.
ENDMETHOD.
METHOD get_abap_doc_4_wrong_elem_name.
TRY.
test_obj->get_abap_doc_for_element( element_name = 'ty_nicht_vorhanden' ).
cl_abap_unit_assert=>fail( msg = 'Expected exception reporting wrong element name was not raised' ).
CATCH zcx_aff_tools.
RETURN.
CATCH cx_root ##CATCH_ALL.
cl_abap_unit_assert=>fail( msg = 'Unexpected exception type was raised' ).
ENDTRY.
ENDMETHOD.
METHOD get_abap_doc_4_elem_wo_adoc.
TRY.
test_obj->get_abap_doc_for_element( element_name = 'SUBRC' ).
cl_abap_unit_assert=>fail( msg = 'Expected exception reporting wrong element name was not raised' ).
CATCH zcx_aff_tools.
RETURN.
CATCH cx_root ##CATCH_ALL.
cl_abap_unit_assert=>fail( msg = 'Unexpected exception type was raised' ).
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
9,
1,
9,
779,
428,
2723,
2393,
329,
534,
9564,
2969,
4326,
1332,
6097,
198,
31631,
300,
83,
565,
62,
397,
499,
62,
15390,
62,
46862,
5550,
20032,
17941,
25261,
7473,
43001,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
220,
220,
220,
220,
220,
220,
45698,
42,
49277,
43638,
5805,
7597,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
1332,
62,
26801,
41876,
4526,
37,
5390,
1976,
565,
62,
2001,
62,
397,
499,
62,
15390,
62,
46862,
13,
628,
220,
220,
220,
337,
36252,
50,
9058,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
397,
499,
62,
15390,
62,
19,
62,
30854,
62,
19199,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
397,
499,
62,
15390,
62,
19,
62,
30854,
62,
7890,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
397,
499,
62,
15390,
62,
19,
62,
7266,
62,
68,
10671,
62,
19199,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
397,
499,
62,
15390,
62,
19,
62,
36460,
62,
68,
10671,
62,
3672,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
397,
499,
62,
15390,
62,
19,
62,
68,
10671,
62,
21638,
62,
324,
420,
7473,
43001,
2751,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
397,
499,
62,
15390,
62,
46862,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
42865,
300,
83,
62,
565,
361,
62,
10459,
41876,
4731,
62,
11487,
13,
628,
220,
220,
220,
300,
83,
62,
565,
361,
62,
10459,
796,
26173,
8924,
1303,
7,
198,
220,
220,
220,
357,
930,
4871,
7852,
62,
2943,
62,
54,
10554,
62,
9858,
10979,
1961,
62,
9936,
47,
1546,
6770,
91,
1267,
198,
220,
220,
220,
357,
930,
1171,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
2457,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
2251,
1171,
764,
91,
1267,
198,
220,
220,
220,
357,
8614,
1267,
198,
220,
220,
220,
357,
930,
1171,
2665,
13,
91,
1267,
198,
220,
220,
220,
357,
8614,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
3858,
25,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
220,
220,
366,
0,
450,
499,
2205,
2912,
2221,
286,
1259,
62,
12984,
62,
301,
5620,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
220,
220,
2221,
366,
26098,
2912,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
220,
220,
220,
286,
220,
366,
26098,
2912,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
220,
220,
220,
220,
1259,
62,
12984,
62,
301,
5620,
11,
366,
26098,
2912,
1259,
62,
12984,
62,
301,
5620,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
0,
9564,
2969,
14432,
770,
318,
2214,
317,
286,
262,
4645,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2214,
62,
64,
2099,
1312,
11,
366,
26098,
2912,
2214,
62,
64,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
0,
9564,
2969,
14432,
770,
318,
2214,
347,
286,
262,
4645,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2214,
62,
65,
2099,
4731,
11,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
220,
220,
886,
286,
1259,
62,
12984,
62,
301,
5620,
764,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
3858,
25,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
220,
220,
366,
0,
450,
499,
2205,
1259,
62,
8658,
62,
1659,
62,
301,
5620,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
220,
220,
1259,
62,
8658,
62,
1659,
62,
12984,
62,
301,
5620,
366,
26098,
2912,
1259,
62,
8658,
62,
1659,
62,
301,
5620,
357,
4906,
3084,
286,
1267,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
220,
366,
5899,
26098,
2912,
1627,
352,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
220,
220,
220,
2099,
220,
366,
26098,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
220,
220,
220,
220,
220,
3084,
286,
1259,
62,
12984,
62,
301,
5620,
351,
4277,
1994,
764,
91,
1267,
198,
220,
220,
220,
357,
930,
930,
1267,
198,
220,
220,
220,
357,
930,
220,
220,
220,
220,
1366,
28932,
7397,
2099,
19704,
12,
50,
10526,
7397,
1100,
12,
8807,
764,
91,
1267,
198,
220,
220,
220,
357,
930,
6861,
2665,
13,
91,
1267,
198,
220,
220,
220,
357,
930,
2839,
2665,
13,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
366,
0,
2329,
2829,
1366,
91,
1267,
198,
220,
220,
220,
357,
930,
220,
1366,
450,
66,
2099,
1312,
13,
91,
1267,
198,
220,
220,
220,
357,
930,
10619,
31631,
13,
91,
1267,
198,
220,
220,
220,
357,
8614,
1267,
198,
220,
220,
220,
357,
8614,
1267,
198,
220,
220,
220,
357,
930,
31631,
7852,
62,
2943,
62,
54,
10554,
62,
9858,
10979,
1961,
62,
9936,
47,
1546,
30023,
2538,
10979,
6234,
13,
91,
1267,
198,
220,
220,
220,
357,
930,
10619,
31631,
13,
91,
1267,
6739,
628,
220,
220,
220,
1332,
62,
26801,
796,
1976,
565,
62,
2001,
62,
397,
499,
62,
15390,
62,
46862,
14804,
17953,
62,
39098,
7,
2723,
796,
300,
83,
62,
565,
361,
62,
10459,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
397,
499,
62,
15390,
62,
19,
62,
30854,
62,
19199,
13,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
20274,
8,
796,
1332,
62,
26801,
3784,
1136,
62,
397,
499,
62,
15390,
62,
1640,
62,
30854,
7,
5002,
62,
3672,
796,
705,
774,
62,
12984,
62,
301,
5620,
6,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
1033
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
AT SELECTION-SCREEN.
DATA(lv_function) = sscrfields-ucomm.
AT SELECTION-SCREEN ON EXIT-COMMAND.
DATA(lv_function) = sscrfields-ucomm.
CLEAR sscrfields-ucomm.
AT SELECTION-SCREEN OUTPUT.
| [
198,
1404,
33493,
2849,
12,
6173,
2200,
1677,
13,
198,
220,
42865,
7,
6780,
62,
8818,
8,
796,
264,
1416,
81,
25747,
12,
84,
9503,
13,
198,
198,
1404,
33493,
2849,
12,
6173,
2200,
1677,
6177,
7788,
2043,
12,
9858,
44,
6981,
13,
198,
220,
42865,
7,
6780,
62,
8818,
8,
796,
264,
1416,
81,
25747,
12,
84,
9503,
13,
198,
220,
30301,
1503,
264,
1416,
81,
25747,
12,
84,
9503,
13,
198,
198,
1404,
33493,
2849,
12,
6173,
2200,
1677,
16289,
30076,
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
] |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.