content
stringlengths 4
1.04M
| input_ids
sequencelengths 2
1.02k
| attention_mask
sequencelengths 2
1.02k
|
---|---|---|
REPORT ztest_inline_global.
PERFORM test.
FORM test.
DATA li_test TYPE REF TO zif_test_inline.
li_test = NEW zcl_test_inline( ).
li_test->test_1( ).
ENDFORM.
| [
2200,
15490,
1976,
9288,
62,
45145,
62,
20541,
13,
198,
198,
18973,
21389,
1332,
13,
198,
198,
21389,
1332,
13,
628,
220,
42865,
7649,
62,
9288,
41876,
4526,
37,
5390,
1976,
361,
62,
9288,
62,
45145,
13,
198,
220,
7649,
62,
9288,
796,
12682,
1976,
565,
62,
9288,
62,
45145,
7,
6739,
198,
220,
7649,
62,
9288,
3784,
9288,
62,
16,
7,
6739,
198,
198,
1677,
8068,
1581,
44,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_object_clas_old 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_old IMPLEMENTATION.
METHOD constructor.
super->constructor(
is_item = is_item
iv_language = iv_language ).
mi_object_oriented_object_fct = zcl_abapgit_oo_factory=>make( ms_item-obj_type ).
ENDMETHOD.
METHOD deserialize_abap.
DATA: ls_vseoclass TYPE vseoclass,
lt_source TYPE seop_source_string,
lt_local_definitions TYPE seop_source_string,
lt_local_implementations TYPE seop_source_string,
lt_local_macros TYPE seop_source_string,
lt_test_classes TYPE seop_source_string,
lt_descriptions TYPE zif_abapgit_definitions=>ty_seocompotx_tt,
ls_class_key TYPE seoclskey.
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 ).
mi_object_oriented_object_fct->create(
EXPORTING
iv_package = iv_package
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 ).
mi_object_oriented_object_fct->add_to_activation_list( ms_item ).
ENDMETHOD.
METHOD deserialize_docu.
DATA: lt_lines TYPE tlinetab,
lv_object TYPE dokhl-object.
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 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.
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.
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.
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~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.
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 is_class_locked.
DATA: lv_clsname TYPE seoclsenq-clsname.
lv_clsname = ms_item-obj_name.
OVERLAY lv_clsname WITH '=============================='.
CALL FUNCTION 'ENQUEUE_ESEOCLASS'
EXPORTING
clsname = lv_clsname
EXCEPTIONS
foreign_lock = 1
system_failure = 2
OTHERS = 3.
rv_is_class_locked = boolc( sy-subrc <> 0 ).
CALL FUNCTION 'DEQUEUE_ESEOCLASS'
EXPORTING
clsname = lv_clsname.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
565,
292,
62,
727,
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,
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,
628,
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,
198,
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,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
565,
292,
62,
727,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
198,
220,
220,
220,
220,
220,
318,
62,
9186,
220,
220,
220,
220,
796,
318,
62,
9186,
198,
220,
220,
220,
220,
220,
21628,
62,
16129,
796,
21628,
62,
16129,
6739,
198,
220,
220,
220,
21504,
62,
15252,
62,
17107,
62,
15252,
62,
69,
310,
796,
1976,
565,
62,
397,
499,
18300,
62,
2238,
62,
69,
9548,
14804,
15883,
7,
13845,
62,
9186,
12,
26801,
62,
4906,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
748,
48499,
1096,
62,
397,
499,
13,
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,
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,
20147,
1968,
507,
220,
220,
220,
220,
220,
220,
220,
220,
220,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
AT SELECTION-SCREEN OUTPUT.
zcl_eui_screen=>top_pbo( ).
AT SELECTION-SCREEN.
" Only push button commands
IF sy-ucomm CP 'X0*'.
zcl_eui_screen=>top_pai( iv_ucomm = sy-ucomm ).
ENDIF.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
10097,
30934,
9,
198,
198,
1404,
33493,
2849,
12,
6173,
2200,
1677,
16289,
30076,
13,
198,
220,
1976,
565,
62,
68,
9019,
62,
9612,
14804,
4852,
62,
79,
2127,
7,
6739,
198,
198,
1404,
33493,
2849,
12,
6173,
2200,
1677,
13,
198,
220,
366,
5514,
4574,
4936,
9729,
198,
220,
16876,
827,
12,
84,
9503,
16932,
705,
55,
15,
9,
4458,
198,
220,
220,
220,
1976,
565,
62,
68,
9019,
62,
9612,
14804,
4852,
62,
49712,
7,
21628,
62,
84,
9503,
796,
827,
12,
84,
9503,
6739,
198,
220,
23578,
5064,
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
] |
*"* use this source file for your ABAP unit test classes
CLASS lcl_unittest DEFINITION FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS
FINAL.
PRIVATE SECTION.
DATA:
f_cut TYPE REF TO zcl_abak_params_definition,
t_param TYPE zabak_namevalue_t.
METHODS add
IMPORTING
i_name TYPE string
i_value TYPE string.
METHODS no_params FOR TESTING RAISING zcx_abak.
METHODS single_param FOR TESTING RAISING zcx_abak.
METHODS two_params FOR TESTING RAISING zcx_abak.
METHODS obligatory_missing FOR TESTING.
METHODS non_obligatory_missing FOR TESTING RAISING zcx_abak.
METHODS invalid_param FOR TESTING.
METHODS length_exceeded FOR TESTING.
METHODS length_not_exceeded FOR TESTING RAISING zcx_abak.
ENDCLASS. "lcl_Unittest
CLASS lcl_unittest IMPLEMENTATION.
METHOD add.
DATA: s_param LIKE LINE OF t_param.
s_param-name = i_name.
s_param-value = i_value.
INSERT s_param INTO TABLE t_param.
ENDMETHOD.
METHOD no_params.
CREATE OBJECT f_cut
EXPORTING
i_definition = space.
ENDMETHOD.
METHOD single_param.
CREATE OBJECT f_cut
EXPORTING
i_definition = '+PARAM1'.
add( i_name = 'PARAM1' i_value = '123' ).
f_cut->check_parameters( t_param ).
ENDMETHOD.
METHOD two_params.
CREATE OBJECT f_cut
EXPORTING
i_definition = 'PARAM1 PARAM2'.
add( i_name = 'PARAM1' i_value = '123' ).
add( i_name = 'PARAM2' i_value = '456' ).
f_cut->check_parameters( t_param ).
ENDMETHOD.
METHOD invalid_param.
TRY.
CREATE OBJECT f_cut
EXPORTING
i_definition = 'VALID'.
add( i_name = 'INVALID' i_value = '123' ).
f_cut->check_parameters( t_param ).
cl_abap_unit_assert=>fail( 'Should have failed with INVALID parameter ').
CATCH zcx_abak.
RETURN.
ENDTRY.
ENDMETHOD.
METHOD obligatory_missing.
TRY.
CREATE OBJECT f_cut
EXPORTING
i_definition = '+OBLIGATORY VALID'.
add( i_name = 'VALID' i_value = '123' ).
f_cut->check_parameters( t_param ).
cl_abap_unit_assert=>fail( 'Obligatory parameter should have been detected').
CATCH zcx_abak.
RETURN.
ENDTRY.
ENDMETHOD.
METHOD non_obligatory_missing.
CREATE OBJECT f_cut
EXPORTING
i_definition = 'NON_OBLIGATORY VALID'.
add( i_name = 'VALID' i_value = '123' ).
f_cut->check_parameters( t_param ).
ENDMETHOD.
METHOD length_exceeded.
TRY.
CREATE OBJECT f_cut
EXPORTING
i_definition = 'PARAM1 PARAM2 PARAM3(5)'.
add( i_name = 'PARAM3' i_value = '123456' ).
f_cut->check_parameters( t_param ).
cl_abap_unit_assert=>fail( 'Max length of 5 should have been detected').
CATCH zcx_abak.
RETURN.
ENDTRY.
ENDMETHOD.
METHOD length_not_exceeded.
CREATE OBJECT f_cut
EXPORTING
i_definition = 'PARAM1 PARAM2 PARAM3(5)'.
add( i_name = 'PARAM3' i_value = '12345' ).
f_cut->check_parameters( t_param ).
ENDMETHOD.
ENDCLASS. "lcl_Unittest
| [
9,
1,
9,
779,
428,
2723,
2393,
329,
534,
9564,
2969,
4326,
1332,
6097,
198,
31631,
300,
565,
62,
403,
715,
395,
5550,
20032,
17941,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
198,
220,
25261,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
277,
62,
8968,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
461,
62,
37266,
62,
46758,
11,
198,
220,
220,
220,
220,
220,
256,
62,
17143,
41876,
1976,
397,
461,
62,
3672,
8367,
62,
83,
13,
628,
220,
220,
220,
337,
36252,
50,
751,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
3672,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
8367,
41876,
4731,
13,
198,
220,
220,
220,
337,
36252,
50,
645,
62,
37266,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
461,
13,
198,
220,
220,
220,
337,
36252,
50,
2060,
62,
17143,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
461,
13,
198,
220,
220,
220,
337,
36252,
50,
734,
62,
37266,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
461,
13,
198,
220,
220,
220,
337,
36252,
50,
44609,
62,
45688,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
1729,
62,
672,
4604,
2870,
62,
45688,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
461,
13,
198,
220,
220,
220,
337,
36252,
50,
12515,
62,
17143,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
4129,
62,
1069,
2707,
276,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
4129,
62,
1662,
62,
1069,
2707,
276,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
461,
13,
198,
198,
10619,
31631,
13,
220,
220,
220,
220,
220,
220,
366,
75,
565,
62,
3118,
715,
395,
628,
198,
31631,
300,
565,
62,
403,
715,
395,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
751,
13,
198,
220,
220,
220,
42865,
25,
264,
62,
17143,
34178,
48920,
3963,
256,
62,
17143,
13,
198,
220,
220,
220,
264,
62,
17143,
12,
3672,
796,
1312,
62,
3672,
13,
198,
220,
220,
220,
264,
62,
17143,
12,
8367,
796,
1312,
62,
8367,
13,
198,
220,
220,
220,
29194,
17395,
264,
62,
17143,
39319,
43679,
256,
62,
17143,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
645,
62,
37266,
13,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
277,
62,
8968,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
46758,
796,
2272,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
2060,
62,
17143,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
277,
62,
8968,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
46758,
796,
705,
10,
27082,
2390,
16,
4458,
628,
220,
220,
220,
751,
7,
1312,
62,
3672,
220,
796,
705,
27082,
2390,
16,
6,
1312,
62,
8367,
796,
705,
10163,
6,
6739,
628,
220,
220,
220,
277,
62,
8968,
3784,
9122,
62,
17143,
7307,
7,
256,
62,
17143,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
734,
62,
37266,
13,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
277,
62,
8968,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
46758,
796,
705,
27082,
2390,
16,
29463,
2390,
17,
4458,
628,
220,
220,
220,
751,
7,
1312,
62,
3672,
220,
796,
705,
27082,
2390,
16,
6,
1312,
62,
8367,
796,
705,
10163,
6,
6739,
198,
220,
220,
220,
751,
7,
1312,
62,
3672,
220,
796,
705,
27082,
2390,
17,
6,
1312,
62,
8367,
796,
705,
29228,
6,
6739,
628,
220,
220,
220,
277,
62,
8968,
3784,
9122,
62,
17143,
7307,
7,
256,
62,
17143,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
12515,
62,
17143,
13,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
277,
62,
8968,
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,
46758,
796,
705,
23428,
2389,
4458,
628,
220,
220,
220,
220,
220,
220,
220,
751,
7,
1312,
62,
3672,
220,
796,
705,
1268,
23428,
2389,
6,
1312,
62,
8367,
796,
705,
10163,
6,
6739,
628,
220,
220,
220,
220,
220,
220,
220,
277,
62,
8968,
3784,
9122,
62,
17143,
7307,
7,
256,
62,
17143,
6739,
628,
220,
220,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
705,
19926,
423,
4054,
351,
3268,
23428,
2389,
11507,
705,
737,
198,
220,
220,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
397,
461,
13,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
44609,
62,
45688,
13,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
277,
62,
8968,
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,
46758,
796,
705,
10,
46,
9148,
3528,
1404,
15513,
26173,
2389,
4458,
628,
220,
220,
220,
220,
220,
220,
220,
751,
7,
1312,
62,
3672,
220,
796,
705,
23428,
2389,
6,
1312,
62,
8367,
796,
705,
10163,
6,
6739,
628,
220,
220,
220,
220,
220,
220,
220,
277,
62,
8968,
3784,
9122,
62,
17143,
7307,
7,
256,
62,
17143,
6739,
628,
220,
220,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
705,
46,
2436,
328,
2870,
11507,
815,
423,
587,
12326,
27691,
198,
220,
220,
220,
220,
220,
327,
11417,
1976,
66,
87,
62,
397,
461,
13,
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,
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
] |
CLASS zcl_abapgit_object_iamu DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES: BEGIN OF ty_internet_appl_comp_binary,
attributes TYPE w3mimeattr,
source TYPE w3mimetabtype,
length TYPE i,
END OF ty_internet_appl_comp_binary.
DATA: mo_mime_api TYPE REF TO if_w3_api_mime.
METHODS:
load_mime_api
RAISING
zcx_abapgit_exception,
read
RETURNING
VALUE(rs_internet_appl_comp_binary) TYPE ty_internet_appl_comp_binary
RAISING
zcx_abapgit_exception,
save
IMPORTING
is_internet_appl_comp_binary TYPE ty_internet_appl_comp_binary
RAISING
zcx_abapgit_exception,
release_lock
RAISING
zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_IAMU IMPLEMENTATION.
METHOD load_mime_api.
DATA: ls_mime_name TYPE iacikeym.
ls_mime_name = ms_item-obj_name.
cl_w3_api_mime=>if_w3_api_mime~load(
EXPORTING
p_mime_name = ls_mime_name
IMPORTING
p_mime = mo_mime_api
EXCEPTIONS
object_not_existing = 1
permission_failure = 2
data_corrupt = 3
error_occured = 4
OTHERS = 6 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from if_w3_api_mime~load' ).
ENDIF.
ENDMETHOD.
METHOD read.
load_mime_api( ).
mo_mime_api->get_attributes(
IMPORTING
p_attributes = rs_internet_appl_comp_binary-attributes
EXCEPTIONS
object_invalid = 1
mime_deleted = 2
error_occured = 3
OTHERS = 4 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from if_w3_api_mime~get_attributes| ).
ENDIF.
CLEAR: rs_internet_appl_comp_binary-attributes-chname,
rs_internet_appl_comp_binary-attributes-tdate,
rs_internet_appl_comp_binary-attributes-ttime,
rs_internet_appl_comp_binary-attributes-devclass.
mo_mime_api->get_source(
IMPORTING
p_source = rs_internet_appl_comp_binary-source
p_datalength = rs_internet_appl_comp_binary-length
EXCEPTIONS
object_invalid = 1
mime_deleted = 2
error_occured = 3
OTHERS = 4 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from if_w3_api_mime~get_source| ).
ENDIF.
ENDMETHOD.
METHOD release_lock.
" As a side effect this method removes also existing locks
mo_mime_api->if_w3_api_object~set_changeable(
EXPORTING
p_changeable = abap_false
EXCEPTIONS
action_cancelled = 1
object_locked_by_other_user = 2
permission_failure = 3
object_already_changeable = 4
object_already_unlocked = 5
object_just_created = 6
object_deleted = 7
object_modified = 8
object_not_existing = 9
object_invalid = 10
error_occured = 11
OTHERS = 12 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from if_w3_api_mime~set_changeable| ).
ENDIF.
ENDMETHOD.
METHOD save.
cl_w3_api_mime=>if_w3_api_mime~create_new(
EXPORTING
p_mime_data = is_internet_appl_comp_binary-attributes
p_mime_content = is_internet_appl_comp_binary-source
p_datalength = is_internet_appl_comp_binary-length
IMPORTING
p_mime = mo_mime_api
EXCEPTIONS
object_already_existing = 1
object_just_created = 2
not_authorized = 3
undefined_name = 4
author_not_existing = 5
action_cancelled = 6
error_occured = 7
OTHERS = 8 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from if_w3_api_mime~create_ne| ).
ENDIF.
mo_mime_api->if_w3_api_object~save(
EXCEPTIONS
object_invalid = 1
object_not_changeable = 2
action_cancelled = 3
permission_failure = 4
not_changed = 5
data_invalid = 6
error_occured = 7
OTHERS = 8 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from if_w3_api_mime~save| ).
ENDIF.
release_lock( ).
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
rv_user = c_user_unknown.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
load_mime_api( ).
mo_mime_api->if_w3_api_object~set_changeable(
EXPORTING
p_changeable = abap_true
EXCEPTIONS
action_cancelled = 1
object_locked_by_other_user = 2
permission_failure = 3
object_already_changeable = 4
object_already_unlocked = 5
object_just_created = 6
object_deleted = 7
object_modified = 8
object_not_existing = 9
object_invalid = 10
error_occured = 11
OTHERS = 12 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from if_w3_api_mime~set_changeable| ).
ENDIF.
mo_mime_api->if_w3_api_object~delete(
EXCEPTIONS
object_not_empty = 1
object_not_changeable = 2
object_invalid = 3
error_occured = 4
OTHERS = 5 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from if_w3_api_mime~delete| ).
ENDIF.
mo_mime_api->if_w3_api_object~save(
EXCEPTIONS
object_invalid = 1
object_not_changeable = 2
action_cancelled = 3
permission_failure = 4
not_changed = 5
data_invalid = 6
error_occured = 7
OTHERS = 8 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error from if_w3_api_mime~save| ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_internet_appl_comp_binary TYPE ty_internet_appl_comp_binary.
io_xml->read(
EXPORTING
iv_name = 'IAMU'
CHANGING
cg_data = ls_internet_appl_comp_binary ).
ls_internet_appl_comp_binary-attributes-devclass = iv_package.
save( ls_internet_appl_comp_binary ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: ls_mime_name TYPE iacikeym.
ls_mime_name = ms_item-obj_name.
cl_w3_api_mime=>s_check_exist(
EXPORTING
p_mime_name = ls_mime_name
IMPORTING
p_exists = rv_bool ).
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( ).
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: ls_internet_appl_comp_binary TYPE ty_internet_appl_comp_binary.
ls_internet_appl_comp_binary = read( ).
io_xml->add( iv_name = 'IAMU'
ig_data = ls_internet_appl_comp_binary ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
1789,
84,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
37675,
62,
1324,
75,
62,
5589,
62,
39491,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
12608,
41876,
266,
18,
76,
524,
35226,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2723,
220,
220,
220,
220,
41876,
266,
18,
76,
38813,
397,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4129,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
37675,
62,
1324,
75,
62,
5589,
62,
39491,
13,
628,
220,
220,
220,
42865,
25,
6941,
62,
76,
524,
62,
15042,
41876,
4526,
37,
5390,
611,
62,
86,
18,
62,
15042,
62,
76,
524,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
3440,
62,
76,
524,
62,
15042,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
628,
220,
220,
220,
220,
220,
1100,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
37675,
62,
1324,
75,
62,
5589,
62,
39491,
8,
41876,
1259,
62,
37675,
62,
1324,
75,
62,
5589,
62,
39491,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
628,
220,
220,
220,
220,
220,
3613,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
37675,
62,
1324,
75,
62,
5589,
62,
39491,
41876,
1259,
62,
37675,
62,
1324,
75,
62,
5589,
62,
39491,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
628,
220,
220,
220,
220,
220,
2650,
62,
5354,
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,
40,
2390,
52,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
3440,
62,
76,
524,
62,
15042,
13,
628,
220,
220,
220,
42865,
25,
43979,
62,
76,
524,
62,
3672,
41876,
1312,
330,
522,
4948,
13,
628,
220,
220,
220,
43979,
62,
76,
524,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
537,
62,
86,
18,
62,
15042,
62,
76,
524,
14804,
361,
62,
86,
18,
62,
15042,
62,
76,
524,
93,
2220,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
76,
524,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
796,
43979,
62,
76,
524,
62,
3672,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
76,
524,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
6941,
62,
76,
524,
62,
15042,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
1662,
62,
25687,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
7170,
62,
32165,
495,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
10215,
3622,
220,
220,
220,
220,
220,
220,
220,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
62,
13966,
1522,
220,
220,
220,
220,
220,
220,
796,
604,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
718,
6739,
628,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
18224,
422,
611,
62,
86,
18,
62,
15042,
62,
76,
524,
93,
2220,
6,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1100,
13,
628,
220,
220,
220,
3440,
62,
76,
524,
62,
15042,
7,
6739,
628,
220,
220,
220,
6941,
62,
76,
524,
62,
15042,
3784,
1136,
62,
1078,
7657,
7,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
1078,
7657,
220,
220,
796,
44608,
62,
37675,
62,
1324,
75,
62,
5589,
62,
39491,
12,
1078,
7657,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
259,
12102,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
285,
524,
62,
2934,
33342,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
4049,
62,
13966,
1522,
220,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
796,
604,
6739,
628,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
930,
12331
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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EL CRITICAL
DURATION SHORT.
PUBLIC SECTION.
CLASS-METHODS:
class_constructor.
METHODS:
test_entry FOR TESTING,
test_exception FOR TESTING,
test_save FOR TESTING.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF gty_test,
text TYPE zalog_s_logentry-text,
type TYPE REF TO zcl_alog_entry_type,
msgty TYPE symsgty,
END OF gty_test,
gty_test_tab TYPE STANDARD TABLE OF gty_test WITH DEFAULT KEY.
CONSTANTS:
gc_bal_obj TYPE balobj_d VALUE 'ZALOG_TEST',
gc_bal_subobj TYPE balsubobj VALUE 'SUB'.
CLASS-METHODS:
class_setup,
class_teardown,
get_bal_entries IMPORTING iv_handle TYPE balloghndl
RETURNING VALUE(rt_entries) TYPE bal_t_msgr.
METHODS:
setup,
teardown.
CLASS-DATA:
gs_bal_obj_entry TYPE balobj,
gs_bal_subobj_entry TYPE balsub.
DATA:
mo_logger TYPE REF TO zcl_alog_bal_logger.
ENDCLASS.
CLASS lcl_test IMPLEMENTATION.
METHOD class_constructor.
gs_bal_obj_entry = VALUE #( object = gc_bal_obj ).
gs_bal_subobj_entry = VALUE #( object = gs_bal_obj_entry-object
subobject = gc_bal_subobj ).
ENDMETHOD.
METHOD class_setup.
" This is the reason for RISK LEVEL CRITICAL
INSERT balobj FROM gs_bal_obj_entry.
* ASSERT sy-subrc = 0.
INSERT balsub FROM gs_bal_subobj_entry.
* ASSERT sy-subrc = 0.
COMMIT WORK AND WAIT.
ENDMETHOD.
METHOD class_teardown.
DELETE balobj FROM gs_bal_obj_entry.
ASSERT sy-subrc = 0.
DELETE balsub FROM gs_bal_subobj_entry.
ASSERT sy-subrc = 0.
COMMIT WORK AND WAIT.
ENDMETHOD.
METHOD setup.
mo_logger = NEW zcl_alog_bal_logger(
iv_object = gc_bal_obj
iv_subobject = gc_bal_subobj
).
ENDMETHOD.
METHOD teardown.
FREE mo_logger.
ENDMETHOD.
METHOD test_entry.
DATA: lt_test TYPE gty_test_tab.
DO 400 TIMES.
APPEND VALUE #( LET type = ztcl_alog_test_utl=>get_random_log_type( ) IN
text = ztcl_alog_test_utl=>get_random_log_text( )
type = type
msgty = type->mv_message_type
) TO lt_test.
ENDDO.
LOOP AT lt_test ASSIGNING FIELD-SYMBOL(<ls_test>).
mo_logger->entry( iv_text = <ls_test>-text io_type = <ls_test>-type ).
FREE <ls_test>-type.
ENDLOOP.
DATA(lt_read_messages) = get_bal_entries( mo_logger->get_log_handle( ) ).
cl_abap_unit_assert=>assert_equals(
exp = lt_test
act = CORRESPONDING gty_test_tab( lt_read_messages MAPPING text = msg_txt
msgty = msgty )
).
ENDMETHOD.
METHOD test_exception.
DATA(lx_ex) = NEW zcx_alog_already_attached( ).
mo_logger->exception( lx_ex ).
DATA(lt_entries) = get_bal_entries( mo_logger->get_log_handle( ) ).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lines( lt_entries ) ).
cl_abap_unit_assert=>assert_equals(
msg = 'Exception not logged properly'
exp = VALUE gty_test( text = lx_ex->get_text( )
msgty = zcl_alog_entry_type=>go_error->mv_message_type )
act = CORRESPONDING gty_test( lt_entries[ 1 ] MAPPING text = msg_txt
msgty = msgty )
).
ENDMETHOD.
METHOD test_save.
CONSTANTS: lc_text TYPE string VALUE `Test message that is saved`.
DATA(ls_test_entry) = VALUE gty_test( text = lc_text msgty = 'I' ).
mo_logger->info( ls_test_entry-text ).
mo_logger->save( ).
" Remove the saved log from memory to make sure it was persisted
CALL FUNCTION 'BAL_LOG_REFRESH'
EXPORTING
i_log_handle = mo_logger->get_log_handle( )
EXCEPTIONS
log_not_found = 1
OTHERS = 2 ##FM_SUBRC_OK.
cl_abap_unit_assert=>assert_subrc( msg = 'Log not found' ).
" Load log from database
CALL FUNCTION 'BAL_DB_LOAD'
EXPORTING
i_t_log_handle = VALUE bal_t_logh( ( mo_logger->get_log_handle( ) ) )
EXCEPTIONS
no_logs_specified = 1
log_not_found = 2
log_already_loaded = 3
OTHERS = 4 ##FM_SUBRC_OK.
cl_abap_unit_assert=>assert_subrc( msg = 'Loading log from db failed' ).
" Retrieve log from memory
DATA(lt_entries) = get_bal_entries( mo_logger->get_log_handle( ) ).
cl_abap_unit_assert=>assert_equals( exp = 1 act = lines( lt_entries ) ).
cl_abap_unit_assert=>assert_equals(
msg = 'Log entry not saved properly'
exp = ls_test_entry
act = CORRESPONDING gty_test( lt_entries[ 1 ] MAPPING text = msg_txt
msgty = msgty )
).
ENDMETHOD.
METHOD get_bal_entries.
CALL FUNCTION 'BAL_LOG_READ'
EXPORTING
i_log_handle = iv_handle
i_read_texts = abap_true
IMPORTING
et_msg = rt_entries
EXCEPTIONS
log_not_found = 1
OTHERS = 2 ##FM_SUBRC_OK.
cl_abap_unit_assert=>assert_subrc( msg = 'Log not found' ).
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
565,
62,
9288,
5550,
20032,
17941,
198,
220,
7473,
43001,
2751,
198,
220,
45698,
42,
49277,
8740,
2043,
20151,
198,
220,
360,
4261,
6234,
6006,
9863,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
25,
198,
220,
220,
220,
220,
220,
1398,
62,
41571,
273,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
1332,
62,
13000,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
62,
1069,
4516,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1332,
62,
21928,
7473,
43001,
2751,
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,
308,
774,
62,
9288,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2420,
220,
41876,
1976,
11794,
62,
82,
62,
6404,
13000,
12,
5239,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
11794,
62,
13000,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
31456,
774,
41876,
827,
19662,
774,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
308,
774,
62,
9288,
11,
198,
220,
220,
220,
220,
220,
308,
774,
62,
9288,
62,
8658,
41876,
49053,
9795,
43679,
3963,
308,
774,
62,
9288,
13315,
5550,
38865,
35374,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
308,
66,
62,
6893,
62,
26801,
220,
220,
220,
41876,
3652,
26801,
62,
67,
26173,
8924,
705,
57,
1847,
7730,
62,
51,
6465,
3256,
198,
220,
220,
220,
220,
220,
308,
66,
62,
6893,
62,
7266,
26801,
41876,
275,
874,
549,
26801,
26173,
8924,
705,
50,
10526,
4458,
198,
220,
220,
220,
42715,
12,
49273,
50,
25,
198,
220,
220,
220,
220,
220,
1398,
62,
40406,
11,
198,
220,
220,
220,
220,
220,
1398,
62,
660,
446,
593,
11,
198,
220,
220,
220,
220,
220,
651,
62,
6893,
62,
298,
1678,
30023,
9863,
2751,
21628,
62,
28144,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
2613,
46664,
358,
75,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
298,
1678,
8,
41876,
3652,
62,
83,
62,
907,
2164,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
220,
220,
573,
446,
593,
13,
198,
220,
220,
220,
42715,
12,
26947,
25,
198,
220,
220,
220,
220,
220,
308,
82,
62,
6893,
62,
26801,
62,
13000,
220,
220,
220,
41876,
3652,
26801,
11,
198,
220,
220,
220,
220,
220,
308,
82,
62,
6893,
62,
7266,
26801,
62,
13000,
41876,
275,
874,
549,
13,
198,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
6941,
62,
6404,
1362,
41876,
4526,
37,
5390,
1976,
565,
62,
11794,
62,
6893,
62,
6404,
1362,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
565,
62,
9288,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
1398,
62,
41571,
273,
13,
198,
220,
220,
220,
308,
82,
62,
6893,
62,
26801,
62,
13000,
796,
26173,
8924,
1303,
7,
2134,
796,
308,
66,
62,
6893,
62,
26801,
6739,
198,
220,
220,
220,
308,
82,
62,
6893,
62,
7266,
26801,
62,
13000,
796,
26173,
8924,
1303,
7,
2134,
220,
220,
220,
796,
308,
82,
62,
6893,
62,
26801,
62,
13000,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
850,
15252,
796,
308,
66,
62,
6893,
62,
7266,
26801,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1398,
62,
40406,
13,
198,
220,
220,
220,
366,
770,
318,
262,
1738,
329,
45698,
42,
49277,
8740,
2043,
20151,
628,
220,
220,
220,
29194,
17395,
3652,
26801,
16034,
308,
82,
62,
6893,
62,
26801,
62,
13000,
13,
198,
9,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
628,
220,
220,
220,
29194,
17395,
275,
874,
549,
16034,
308,
82,
62,
6893,
62,
7266,
26801,
62,
13000,
13,
198,
9,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
628,
220,
220,
220,
22240,
2043,
30936,
5357,
16400,
2043,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1398,
62,
660,
446,
593,
13,
198,
220,
220,
220,
5550,
2538,
9328,
3652,
26801,
16034,
308,
82,
62,
6893,
62,
26801,
62,
13000,
13,
198,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
628,
220,
220,
220,
5550,
2538,
9328,
275,
874,
549,
16034,
308,
82,
62,
6893,
62,
7266,
26801,
62,
13000,
13,
198,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
628,
220,
220,
220,
22240,
2043,
30936,
5357,
16400,
2043,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
6941,
62,
6404,
1362,
796,
12682,
1976,
565,
62,
11794,
62,
6893,
62,
6404,
1362,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
15252,
220,
220,
220,
796,
308,
66,
62,
6893,
62,
26801,
198,
220,
220,
220,
220,
220,
21628,
62,
7266,
15252,
796,
308,
66,
62,
6893,
62,
7266,
26801,
198,
220,
220,
220,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
573,
446,
593,
13,
198,
220,
220,
220,
17189,
6941,
62,
6404,
1362,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
62,
13000,
13,
198,
220,
220,
220,
42865,
25,
300,
83,
62,
9288,
41876,
308,
774,
62,
9288,
62,
8658,
13,
628,
220,
220,
220,
8410,
7337,
31742,
1546,
13,
198,
220,
220,
220,
220,
220,
43504,
10619,
26173,
8924,
1303,
7,
37994,
2099,
796,
1976,
83,
565,
62,
11794,
62,
9288,
62,
315,
75,
14804,
1136,
62,
25120,
62,
6404,
62,
4906,
7,
1267,
3268,
198,
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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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
] |
*&---------------------------------------------------------------------*
*& Local class definition - Business Object Readers
*&---------------------------------------------------------------------*
INTERFACE lif_app_types.
TYPES: ts_ekko TYPE /saptrx/mm_po_hdr,
tt_ekko TYPE STANDARD TABLE OF ts_ekko.
TYPES: ts_uekpo TYPE uekpo,
tt_uekpo TYPE STANDARD TABLE OF ts_uekpo.
TYPES: ts_ueket TYPE ueket,
tt_ueket TYPE STANDARD TABLE OF ts_ueket.
TYPES: ts_uekes TYPE uekes,
tt_uekes TYPE STANDARD TABLE OF ts_uekes.
TYPES: ts_likpvb TYPE likp,
tt_likpvb TYPE STANDARD TABLE OF ts_likpvb.
TYPES: ts_lipsvb TYPE lipsvb,
tt_lipsvb TYPE STANDARD TABLE OF ts_lipsvb.
TYPES: ts_vttkvb TYPE vttkvb,
tt_vttkvb TYPE STANDARD TABLE OF ts_vttkvb.
TYPES: ts_vttpvb TYPE vttpvb,
tt_vttpvb TYPE STANDARD TABLE OF ts_vttpvb.
TYPES: ts_vttsvb TYPE vttsvb,
tt_vttsvb TYPE STANDARD TABLE OF ts_vttsvb.
TYPES: ts_vtspvb TYPE vtspvb,
tt_vtspvb TYPE STANDARD TABLE OF ts_vtspvb.
TYPES: ts_mseg TYPE mseg,
tt_mseg TYPE STANDARD TABLE OF ts_mseg.
TYPES: tv_ship_type TYPE char2,
tv_trans_mode TYPE char2,
tv_departure_dt TYPE timestamp, "char15,
tv_departure_tz TYPE timezone,
tv_arrival_dt TYPE timestamp, "char15,
tv_arrival_tz TYPE timezone,
tv_deliv_cnt TYPE int4,
tv_trobj_res_id TYPE char12,
tv_trobj_res_val TYPE char20,
tv_resrc_cnt TYPE int4,
tv_resrc_tp_id TYPE char30,
tv_crdoc_ref_typ TYPE char3,
tv_crdoc_ref_val TYPE tndr_trkid,
tv_stopnum TYPE int4,
tv_stopid TYPE char255,
tv_stopcnt TYPE int4,
tv_loccat TYPE char1,
tv_loctype TYPE char20,
tv_locid TYPE char10,
tv_lstelz_txt TYPE char20,
tv_kunablaz_txt TYPE char25,
tv_lgortaz_txt TYPE char16,
tv_lgnumaz TYPE char3,
tv_toraz TYPE char3,
tv_lgtraz_txt TYPE char50,
tv_tsrfo TYPE num4,
tv_pln_evt_datetime TYPE timestamp, "char15,
tv_pln_evt_timezone TYPE char6.
TYPES: BEGIN OF ts_stops,
stopid TYPE tv_stopid,
stopcnt TYPE tv_stopcnt,
loccat TYPE tv_loccat,
loctype TYPE tv_loctype,
locid TYPE tv_locid,
lstelz_txt TYPE tv_lstelz_txt,
kunablaz_txt TYPE tv_kunablaz_txt,
lgortaz_txt TYPE tv_lgortaz_txt,
lgnumaz TYPE tv_lgnumaz,
toraz TYPE tv_toraz,
lgtraz_txt TYPE tv_lgtraz_txt,
tknum TYPE tknum,
tsnum TYPE tsnum,
tsrfo TYPE tsrfo,
pln_evt_datetime TYPE timestamp,
pln_evt_timezone TYPE timezone,
END OF ts_stops,
tt_stops TYPE STANDARD TABLE OF ts_stops
WITH EMPTY KEY.
TYPES: BEGIN OF ts_dlv_watch_stops,
vbeln TYPE vbeln_vl,
stopid TYPE tv_stopid,
loccat TYPE tv_loccat,
END OF ts_dlv_watch_stops,
tt_dlv_watch_stops TYPE STANDARD TABLE OF ts_dlv_watch_stops
WITH EMPTY KEY.
ENDINTERFACE.
INTERFACE lif_app_constants.
CONSTANTS: BEGIN OF cs_tabledef,
po_header_new TYPE /saptrx/strucdatadef VALUE 'PURCHASE_ORDER_HEADER_NEW',
po_header_old TYPE /saptrx/strucdatadef VALUE 'PURCHASE_ORDER_HEADER_OLD',
po_item_new TYPE /saptrx/strucdatadef VALUE 'PURCHASE_ITEM_NEW',
po_item_old TYPE /saptrx/strucdatadef VALUE 'PURCHASE_ITEM_OLD',
po_sched_new TYPE /saptrx/strucdatadef VALUE 'PO_SCHED_LINE_ITEM_NEW',
po_sched_old TYPE /saptrx/strucdatadef VALUE 'PO_SCHED_LINE_ITEM_OLD',
po_vend_conf_new TYPE /saptrx/strucdatadef VALUE 'VENDOR_CONFIRMATION_NEW',
po_vend_conf_old TYPE /saptrx/strucdatadef VALUE 'VENDOR_CONFIRMATION_OLD',
md_material_header TYPE /saptrx/strucdatadef VALUE 'MATERIAL_HEADER',
md_material_segment TYPE /saptrx/strucdatadef VALUE 'MATERIAL_SEGMENT',
md_update_control TYPE /saptrx/strucdatadef VALUE 'UPDATE_CONTROL',
dl_header_new TYPE /saptrx/strucdatadef VALUE 'DELIVERY_HEADER_NEW',
dl_header_old TYPE /saptrx/strucdatadef VALUE 'DELIVERY_HEADER_OLD',
dl_hdr_status_new TYPE /saptrx/strucdatadef VALUE 'DELIVERY_HDR_STATUS_NEW',
dl_hdr_status_old TYPE /saptrx/strucdatadef VALUE 'DELIVERY_HDR_STATUS_OLD',
dl_item_new TYPE /saptrx/strucdatadef VALUE 'DELIVERY_ITEM_NEW',
dl_item_old TYPE /saptrx/strucdatadef VALUE 'DELIVERY_ITEM_OLD',
dl_partners_new TYPE /saptrx/strucdatadef VALUE 'PARTNERS_NEW',
dl_partners_old TYPE /saptrx/strucdatadef VALUE 'PARTNERS_OLD',
dl_itm_status_new TYPE /saptrx/strucdatadef VALUE 'DELIVERY_ITEM_STATUS_NEW',
dl_itm_status_old TYPE /saptrx/strucdatadef VALUE 'DELIVERY_ITEM_STATUS_OLD',
dl_hu_item_new TYPE /saptrx/strucdatadef VALUE 'HU_ITEM_NEW',
dl_hu_item_old TYPE /saptrx/strucdatadef VALUE 'HU_ITEM_OLD',
sh_header_new TYPE /saptrx/strucdatadef VALUE 'SHIPMENT_HEADER_NEW',
sh_header_old TYPE /saptrx/strucdatadef VALUE 'SHIPMENT_HEADER_OLD',
sh_item_new TYPE /saptrx/strucdatadef VALUE 'SHIPMENT_ITEM_NEW',
sh_item_old TYPE /saptrx/strucdatadef VALUE 'SHIPMENT_ITEM_OLD',
sh_stage_new TYPE /saptrx/strucdatadef VALUE 'SHIPMENT_LEG_NEW',
sh_stage_old TYPE /saptrx/strucdatadef VALUE 'SHIPMENT_LEG_OLD',
sh_item_stage_new TYPE /saptrx/strucdatadef VALUE 'SHIPMENT_ITEM_LEG_NEW',
sh_item_stage_old TYPE /saptrx/strucdatadef VALUE 'SHIPMENT_ITEM_LEG_OLD',
sh_delivery_header TYPE /saptrx/strucdatadef VALUE 'DELIVERY_HEADER',
sh_delivery_item TYPE /saptrx/strucdatadef VALUE 'DELIVERY_ITEM',
END OF cs_tabledef.
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',
END OF cs_system_fields.
CONSTANTS: BEGIN OF cs_trxcod,
po_number TYPE /saptrx/trxcod VALUE 'PURCHASE_ORDER',
po_position TYPE /saptrx/trxcod VALUE 'PURCHASE_ORDER_ITEM',
dl_number TYPE /saptrx/trxcod VALUE 'INBOUND_DELIVERY',
dl_position TYPE /saptrx/trxcod VALUE 'INBOUND_DELIVERY_IT',
sh_number TYPE /saptrx/trxcod VALUE 'INBOUND_SHIPMENT',
sh_resource TYPE /saptrx/trxcod VALUE 'INBOUND_RESOURCE',
END OF cs_trxcod.
CONSTANTS: BEGIN OF cs_relevance,
bsart TYPE ekko-bsart VALUE 'NB',
ebtyp TYPE ekes-ebtyp VALUE 'AB',
lfart TYPE likp-lfart VALUE 'EL',
pstyv TYPE lips-pstyv VALUE 'ELN',
shtyp TYPE vttk-shtyp VALUE '0010',
END OF cs_relevance.
CONSTANTS: BEGIN OF cs_milestone,
po_confirmation TYPE /saptrx/appl_event_tag VALUE 'CONFIRMATION',
po_goods_receipt TYPE /saptrx/appl_event_tag VALUE 'GOODS_RECEIPT',
po_undeletion TYPE /saptrx/appl_event_tag VALUE 'UNDELETION',
po_deletion TYPE /saptrx/appl_event_tag VALUE 'DELETION',
dl_put_away TYPE /saptrx/appl_event_tag VALUE 'PUT_AWAY',
dl_packing TYPE /saptrx/appl_event_tag VALUE 'PACKING',
dl_goods_receipt TYPE /saptrx/appl_event_tag VALUE 'GOODS_RECEIPT',
dl_pod TYPE /saptrx/appl_event_tag VALUE 'SHP_POD',
sh_check_in TYPE /saptrx/appl_event_tag VALUE 'CHECK_IN',
sh_load_start TYPE /saptrx/appl_event_tag VALUE 'LOAD_BEGIN',
sh_load_end TYPE /saptrx/appl_event_tag VALUE 'LOAD_END',
sh_departure TYPE /saptrx/appl_event_tag VALUE 'DEPARTURE',
sh_arrival TYPE /saptrx/appl_event_tag VALUE 'ARRIV_DEST',
sh_pod TYPE /saptrx/appl_event_tag VALUE 'POD',
END OF cs_milestone.
CONSTANTS: BEGIN OF cs_event_param,
quantity TYPE /saptrx/paramname VALUE 'QUANTITY',
confirm_type TYPE /saptrx/paramname VALUE 'CONFIRM_TYPE',
reversal TYPE /saptrx/paramname VALUE 'REVERSAL_INDICATOR',
location_id TYPE /saptrx/paramname VALUE 'LOCATION_ID',
location_type TYPE /saptrx/paramname VALUE 'LOCATION_TYPE',
END OF cs_event_param.
CONSTANTS: BEGIN OF cs_bstae,
confirm TYPE ekpo-bstae VALUE '0001',
delivery TYPE ekpo-bstae VALUE '0004',
END OF cs_bstae.
CONSTANTS: BEGIN OF cs_loekz,
active TYPE ekpo-loekz VALUE '',
deleted TYPE ekpo-loekz VALUE 'L',
END OF cs_loekz.
CONSTANTS: BEGIN OF cs_delivery_stat,
not_relevant TYPE wbsta VALUE '',
not_processed TYPE wbsta VALUE 'A',
partially_proc TYPE wbsta VALUE 'B',
completely_proc TYPE wbsta VALUE 'C',
END OF cs_delivery_stat.
CONSTANTS: BEGIN OF cs_md_type,
goods_receipt TYPE mkpf-blart VALUE 'WE',
END OF cs_md_type.
CONSTANTS: BEGIN OF cs_parvw,
supplier TYPE parvw VALUE 'LF',
END OF cs_parvw.
CONSTANTS: BEGIN OF cs_adrtype,
organization TYPE ad_adrtype VALUE '1',
END OF cs_adrtype.
CONSTANTS: BEGIN OF cs_loccat,
departure TYPE lif_app_types=>tv_loccat VALUE 'S',
arrival TYPE lif_app_types=>tv_loccat VALUE 'D',
END OF cs_loccat.
CONSTANTS: BEGIN OF cs_vbtyp,
shipment TYPE vbtyp VALUE '8',
delivery TYPE vbtyp VALUE '7',
END OF cs_vbtyp.
CONSTANTS: BEGIN OF cs_start_evtcnt,
shipment TYPE i VALUE 1000000000,
delivery TYPE i VALUE 1100000000,
END OF cs_start_evtcnt.
CONSTANTS: cv_agent_id_type TYPE bu_id_type VALUE 'LBN001',
cv_agent_id_prefix TYPE c LENGTH 4 VALUE 'LBN#' .
ENDINTERFACE.
**********************************************************************
**********************************************************************
**********************************************************************
CLASS lcl_po_tools DEFINITION.
PUBLIC SECTION.
CLASS-METHODS get_tracking_id_po_item
IMPORTING
ir_ekpo TYPE REF TO data
RETURNING
VALUE(rv_track_id) TYPE /saptrx/trxid
RAISING
cx_udm_message.
CLASS-METHODS is_appropriate_po_type
IMPORTING
ir_ekko TYPE REF TO data
RETURNING
VALUE(rv_result) TYPE abap_bool
RAISING
cx_udm_message.
CLASS-METHODS is_appropriate_po_item
IMPORTING
ir_ekpo TYPE REF TO data
RETURNING
VALUE(rv_result) TYPE abap_bool
RAISING
cx_udm_message.
ENDCLASS.
CLASS lcl_po_tools IMPLEMENTATION.
METHOD get_tracking_id_po_item.
DATA: lv_ebeln TYPE ekpo-ebeln,
lv_ebelp TYPE ekpo-ebelp.
lv_ebeln = lcl_tools=>get_field_of_structure(
ir_struct_data = ir_ekpo
iv_field_name = 'EBELN' ).
lv_ebelp = lcl_tools=>get_field_of_structure(
ir_struct_data = ir_ekpo
iv_field_name = 'EBELP' ).
rv_track_id = |{ lv_ebeln }{ lv_ebelp }|.
ENDMETHOD.
METHOD is_appropriate_po_type.
DATA(lv_bsart) = lcl_tools=>get_field_of_structure(
ir_struct_data = ir_ekko
iv_field_name = 'BSART' ).
rv_result = boolc( lv_bsart = lif_app_constants=>cs_relevance-bsart ).
ENDMETHOD.
METHOD is_appropriate_po_item.
DATA(lv_wepos) = lcl_tools=>get_field_of_structure(
ir_struct_data = ir_ekpo
iv_field_name = 'WEPOS' ).
rv_result = boolc( lv_wepos = abap_true ).
ENDMETHOD.
ENDCLASS.
**********************************************************************
**********************************************************************
**********************************************************************
CLASS lcl_dl_tools DEFINITION.
PUBLIC SECTION.
CLASS-METHODS convert_quantity_into_pounits
IMPORTING
iv_quantity_uom TYPE any
ir_lips TYPE REF TO data
RETURNING
VALUE(rv_quantity_pou) TYPE f
RAISING
cx_udm_message.
CLASS-METHODS get_addres_info
IMPORTING
iv_addr_type TYPE ad_adrtype DEFAULT lif_app_constants=>cs_adrtype-organization
iv_addr_numb TYPE ad_addrnum
EXPORTING
ev_address TYPE clike
ev_email TYPE clike
ev_telephone TYPE clike
RAISING
cx_udm_message.
CLASS-METHODS get_door_description
IMPORTING
iv_lgnum TYPE lgnum
iv_lgtor TYPE lgtor
RETURNING
VALUE(rv_descr) TYPE /saptrx/paramval200
RAISING
cx_udm_message.
CLASS-METHODS get_delivery_date
IMPORTING
ir_data TYPE REF TO data
RETURNING
VALUE(rv_date) TYPE /saptrx/event_exp_datetime
RAISING
cx_udm_message.
CLASS-METHODS get_next_event_counter
RETURNING
VALUE(rv_evtcnt) TYPE /saptrx/evtcnt.
CLASS-METHODS get_plant_address_number
IMPORTING
iv_werks TYPE werks_d
RETURNING
VALUE(ev_adrnr) TYPE adrnr
RAISING
cx_udm_message.
CLASS-METHODS get_tracking_id_dl_item
IMPORTING
ir_lips TYPE REF TO data
RETURNING
VALUE(rv_track_id) TYPE /saptrx/trxid
RAISING
cx_udm_message.
CLASS-METHODS is_appropriate_dl_item
IMPORTING
ir_struct TYPE REF TO data
RETURNING
VALUE(rv_result) TYPE abap_bool
RAISING
cx_udm_message.
CLASS-METHODS is_appropriate_dl_type
IMPORTING
ir_struct TYPE REF TO data
RETURNING
VALUE(rv_result) TYPE abap_bool
RAISING
cx_udm_message.
PRIVATE SECTION.
CLASS-DATA: mv_evtcnt TYPE /saptrx/evtcnt VALUE lif_app_constants=>cs_start_evtcnt-delivery.
ENDCLASS.
CLASS lcl_dl_tools IMPLEMENTATION.
METHOD convert_quantity_into_pounits.
DATA(lv_matnr) = CONV matnr( lcl_tools=>get_field_of_structure(
ir_struct_data = ir_lips
iv_field_name = 'MATNR' ) ).
DATA(lv_vrkme) = CONV vrkme( lcl_tools=>get_field_of_structure(
ir_struct_data = ir_lips
iv_field_name = 'VRKME' ) ).
CALL FUNCTION 'MATERIAL_UNIT_CONVERSION'
EXPORTING
input = iv_quantity_uom
matnr = lv_matnr
meinh = lv_vrkme
IMPORTING
output = rv_quantity_pou
EXCEPTIONS
conversion_not_found = 1
input_invalid = 2
material_not_found = 3
meinh_not_found = 4
meins_missing = 5
no_meinh = 6
output_invalid = 7
overflow = 8
OTHERS = 9.
IF sy-subrc <> 0.
CLEAR: rv_quantity_pou.
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD get_addres_info.
DATA: lt_address TYPE szadr_printform_table,
ls_addr_comp TYPE szadr_addr1_complete.
IF ev_address IS REQUESTED.
CLEAR: ev_address.
CALL FUNCTION 'ADDRESS_INTO_PRINTFORM'
EXPORTING
address_type = iv_addr_type
address_number = iv_addr_numb
IMPORTING
address_printform_table = lt_address
EXCEPTIONS
address_blocked = 1
person_blocked = 2
contact_person_blocked = 3
addr_to_be_formated_is_blocked = 4
OTHERS = 5.
IF sy-subrc = 0.
LOOP AT lt_address ASSIGNING FIELD-SYMBOL(<ls_address>).
ev_address = COND #( WHEN ev_address IS INITIAL
THEN <ls_address>-address_line
ELSE |{ ev_address }${ <ls_address>-address_line }| ).
ENDLOOP.
ELSE.
lcl_tools=>throw_exception( ).
ENDIF.
ENDIF.
IF ev_email IS REQUESTED OR ev_telephone IS REQUESTED.
CLEAR: ev_email, ev_telephone.
CALL FUNCTION 'ADDR_GET_COMPLETE'
EXPORTING
addrnumber = iv_addr_numb
IMPORTING
addr1_complete = ls_addr_comp
EXCEPTIONS
parameter_error = 1
address_not_exist = 2
internal_error = 3
wrong_access_to_archive = 4
address_blocked = 5
OTHERS = 6.
IF sy-subrc = 0.
ev_email = VALUE #( ls_addr_comp-adsmtp_tab[ 1 ]-adsmtp-smtp_addr OPTIONAL ).
ev_telephone = VALUE #( ls_addr_comp-adtel_tab[ 1 ]-adtel-tel_number OPTIONAL ).
ELSE.
lcl_tools=>throw_exception( ).
ENDIF.
ENDIF.
ENDMETHOD.
METHOD get_door_description.
"concatenate T300T-LNUMT '/' T30BT-ltort using SY-LANGU and LIPSVB-LGNUM & LIPSVB-LGTOR
DATA: ls_t300t TYPE t300t,
lv_ltort TYPE t30bt-ltort.
CLEAR: rv_descr.
CALL FUNCTION 'T300T_SINGLE_READ'
EXPORTING
t300t_spras = sy-langu
t300t_lgnum = iv_lgnum
IMPORTING
wt300t = ls_t300t
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
SELECT SINGLE ltort
INTO lv_ltort
FROM t30bt
WHERE spras = sy-langu
AND lgnum = iv_lgnum
AND lgtor = iv_lgtor.
IF sy-subrc = 0.
rv_descr = |{ ls_t300t-lnumt }/{ lv_ltort }|.
ELSE.
MESSAGE e057(00) WITH iv_lgnum iv_lgtor '' 'T30BT'
INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ELSE.
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD get_delivery_date.
rv_date = lcl_tools=>get_local_timestamp(
iv_date = lcl_tools=>get_field_of_structure(
ir_struct_data = ir_data
iv_field_name = 'LFDAT' )
iv_time = lcl_tools=>get_field_of_structure(
ir_struct_data = ir_data
iv_field_name = 'LFUHR' ) ).
ENDMETHOD.
METHOD get_next_event_counter.
ADD 1 TO mv_evtcnt.
rv_evtcnt = mv_evtcnt.
ENDMETHOD.
METHOD get_plant_address_number.
DATA: ls_t001w TYPE T001w.
CALL FUNCTION 'WCB_T001W_SINGLE_READ'
EXPORTING
i_werks = iv_werks
IMPORTING
e_t001w = ls_t001w
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 0.
ev_adrnr = ls_t001w-adrnr.
ELSE.
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD get_tracking_id_dl_item.
DATA: lv_vbeln TYPE lips-vbeln,
lv_posnr TYPE lips-posnr.
lv_vbeln = lcl_tools=>get_field_of_structure(
ir_struct_data = ir_lips
iv_field_name = 'VBELN' ).
lv_posnr = lcl_tools=>get_field_of_structure(
ir_struct_data = ir_lips
iv_field_name = 'POSNR' ).
rv_track_id = |{ lv_vbeln }{ lv_posnr }|.
ENDMETHOD.
METHOD is_appropriate_dl_item.
DATA(lv_pstyv) = lcl_tools=>get_field_of_structure(
ir_struct_data = ir_struct
iv_field_name = 'PSTYV' ).
rv_result = boolc( lv_pstyv = lif_app_constants=>cs_relevance-pstyv ).
ENDMETHOD.
METHOD is_appropriate_dl_type.
DATA(lv_lfart) = lcl_tools=>get_field_of_structure(
ir_struct_data = ir_struct
iv_field_name = 'LFART' ).
rv_result = boolc( lv_lfart = lif_app_constants=>cs_relevance-lfart ).
ENDMETHOD.
ENDCLASS.
**********************************************************************
**********************************************************************
**********************************************************************
CLASS lcl_sh_tools DEFINITION.
PUBLIC SECTION.
CLASS-METHODS get_stops_from_shipment
IMPORTING
iv_tknum TYPE tknum
it_vtts TYPE vttsvb_tab OPTIONAL
it_vtsp TYPE vtspvb_tab OPTIONAL
it_vttp TYPE vttpvb_tab OPTIONAL
EXPORTING
et_stops TYPE lif_app_types=>tt_stops
et_dlv_watching_stops TYPE lif_app_types=>tt_dlv_watch_stops.
CLASS-METHODS get_carrier_reference_document
IMPORTING
is_vttk TYPE vttkvb
EXPORTING
ev_ref_typ TYPE lif_app_types=>tv_crdoc_ref_typ
ev_ref_val TYPE lif_app_types=>tv_crdoc_ref_val.
CLASS-METHODS is_appropriate_type
IMPORTING
ir_vttk TYPE REF TO data
RETURNING
VALUE(rv_result) TYPE abap_bool
RAISING
cx_udm_message.
CLASS-METHODS is_delivery_assigned
IMPORTING
ir_vttp TYPE REF TO data
RETURNING
VALUE(rv_result) TYPE abap_bool
RAISING
cx_udm_message.
CLASS-METHODS is_object_modified
IMPORTING
is_events TYPE trxas_evt_ctab_wa
RETURNING
VALUE(rv_result) TYPE abap_bool.
CLASS-METHODS get_next_event_counter
RETURNING
VALUE(rv_evtcnt) TYPE /saptrx/evtcnt.
PRIVATE SECTION.
CLASS-DATA: mv_evtcnt TYPE /saptrx/evtcnt VALUE lif_app_constants=>cs_start_evtcnt-shipment.
ENDCLASS.
CLASS lcl_sh_tools IMPLEMENTATION.
METHOD get_stops_from_shipment.
DATA:
ls_vttsvb TYPE vttsvb,
lt_vttsvb TYPE STANDARD TABLE OF vttsvb,
ls_vtsp TYPE vtsp,
lt_vtsp TYPE STANDARD TABLE OF vtsp,
ls_vtspvb TYPE vtspvb,
lt_vtspvb TYPE STANDARD TABLE OF vtspvb,
ls_vttpvb TYPE vttpvb,
lt_vttpvb TYPE STANDARD TABLE OF vttpvb,
ls_stop TYPE lif_app_types=>ts_stops,
ls_dlv_watching_stop TYPE lif_app_types=>ts_dlv_watch_stops,
* Count
lv_stopcnt TYPE int4,
lv_cnt TYPE char04,
* Source & Destination
lv_desloctype TYPE lif_app_types=>tv_loctype,
lv_deslocid TYPE lif_app_types=>tv_locid,
lv_srcloctype TYPE lif_app_types=>tv_loctype,
lv_srclocid TYPE lif_app_types=>tv_locid,
* Timezone
lv_tzone TYPE timezone,
* Door text
lv_ltort TYPE t30bt-ltort,
* Warehouse text
lv_lnumt TYPE t300t-lnumt,
* Warehouse text / door text
lv_lgtratxt TYPE char60.
DATA: lt_tknum_range TYPE STANDARD TABLE OF range_c10.
CALL FUNCTION 'GET_SYSTEM_TIMEZONE' ##FM_SUBRC_OK
IMPORTING
timezone = lv_tzone
EXCEPTIONS
customizing_missing = 1
OTHERS = 2.
* Read Stage Information
IF it_vtts IS SUPPLIED.
MOVE it_vtts TO lt_vttsvb.
ELSE.
lt_tknum_range = VALUE #( (
sign = 'I'
option = 'EQ'
low = iv_tknum
) ).
CALL FUNCTION 'ST_STAGES_READ'
EXPORTING
i_vtts_db_tab = 'VTTS'
i_vtsp_db_tab = 'VTSP'
TABLES
i_tknum_range = lt_tknum_range
c_xvttsvb = lt_vttsvb.
ENDIF.
SORT lt_vttsvb BY tsrfo.
* Fill source & destination
LOOP AT lt_vttsvb INTO ls_vttsvb WHERE tknum = iv_tknum
AND updkz <> 'D'.
IF ls_vttsvb-kunna IS NOT INITIAL.
lv_srcloctype = lif_ef_constants=>cs_loc_types-customer.
lv_srclocid = ls_vttsvb-kunna.
ELSEIF ls_vttsvb-vstel IS NOT INITIAL.
lv_srcloctype = lif_ef_constants=>cs_loc_types-shippingpoint.
lv_srclocid = ls_vttsvb-vstel.
ELSEIF ls_vttsvb-lifna IS NOT INITIAL.
lv_srcloctype = lif_ef_constants=>cs_loc_types-supplier.
lv_srclocid = ls_vttsvb-lifna.
ELSEIF ls_vttsvb-werka IS NOT INITIAL.
lv_srcloctype = lif_ef_constants=>cs_loc_types-plant.
lv_srclocid = ls_vttsvb-werka.
ELSEIF ls_vttsvb-knota IS NOT INITIAL.
lv_srcloctype = lif_ef_constants=>cs_loc_types-logisticlocation.
lv_srclocid = ls_vttsvb-knota.
ENDIF.
* if current stage line's source = last stage line's destination, no change on stop id & stop count
IF lv_srcloctype NE lv_desloctype OR lv_srclocid NE lv_deslocid.
lv_stopcnt = lv_stopcnt + 1.
ENDIF.
IF ls_vttsvb-kunnz IS NOT INITIAL.
lv_desloctype = lif_ef_constants=>cs_loc_types-customer.
lv_deslocid = ls_vttsvb-kunnz.
ELSEIF ls_vttsvb-vstez IS NOT INITIAL.
lv_desloctype = lif_ef_constants=>cs_loc_types-shippingpoint.
lv_deslocid = ls_vttsvb-vstez.
ELSEIF ls_vttsvb-lifnz IS NOT INITIAL.
lv_desloctype = lif_ef_constants=>cs_loc_types-supplier.
lv_deslocid = ls_vttsvb-lifnz.
ELSEIF ls_vttsvb-werkz IS NOT INITIAL.
lv_desloctype = lif_ef_constants=>cs_loc_types-plant.
lv_deslocid = ls_vttsvb-werkz.
ELSEIF ls_vttsvb-knotz IS NOT INITIAL.
lv_desloctype = lif_ef_constants=>cs_loc_types-logisticlocation.
lv_deslocid = ls_vttsvb-knotz.
ENDIF.
lv_cnt = lv_stopcnt.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lv_cnt
IMPORTING
output = lv_cnt.
CONCATENATE iv_tknum lv_cnt INTO ls_stop-stopid.
ls_stop-stopcnt = lv_stopcnt.
ls_stop-loccat = 'S'.
ls_stop-loctype = lv_srcloctype.
ls_stop-locid = lv_srclocid.
ls_stop-kunablaz_txt = ls_vttsvb-kunabla.
ls_stop-lgnumaz = ls_vttsvb-lgnuma.
ls_stop-toraz = ls_vttsvb-tora.
ls_stop-tknum = iv_tknum.
ls_stop-tsnum = ls_vttsvb-tsnum.
ls_stop-tsrfo = ls_vttsvb-tsrfo.
IF ls_vttsvb-dptbg IS INITIAL.
CLEAR ls_stop-pln_evt_datetime.
ELSE.
ls_stop-pln_evt_datetime = |0{ ls_vttsvb-dptbg }{ ls_vttsvb-uptbg }|.
ENDIF.
ls_stop-pln_evt_timezone = lv_tzone.
CLEAR ls_stop-lstelz_txt.
SELECT SINGLE vtext INTO ls_stop-lstelz_txt FROM tvlat
WHERE spras = sy-langu
AND vstel = ls_vttsvb-vstel
AND lstel = ls_vttsvb-lstel.
CLEAR ls_stop-lgortaz_txt.
SELECT SINGLE lgobe INTO ls_stop-lgortaz_txt FROM t001l
WHERE werks = ls_vttsvb-werka
AND lgort = ls_vttsvb-lgorta.
* Warehouse door text: concatenate T300T-LNUMT '/' T30BT-ltort with LGNUM and LGTOR
CLEAR lv_ltort.
SELECT SINGLE ltort INTO lv_ltort FROM t30bt WHERE spras = sy-langu
AND lgnum = ls_vttsvb-lgnuma
AND lgtor = ls_vttsvb-tora.
CLEAR lv_lnumt.
SELECT SINGLE lnumt INTO lv_lnumt FROM t300t WHERE spras = sy-langu
AND lgnum = ls_vttsvb-lgnuma.
CLEAR ls_stop-lgtraz_txt.
IF lv_ltort IS NOT INITIAL OR lv_lnumt IS NOT INITIAL.
CONCATENATE lv_lnumt lv_ltort INTO ls_stop-lgtraz_txt SEPARATED BY '/'.
ENDIF.
APPEND ls_stop TO et_stops.
lv_stopcnt = lv_stopcnt + 1.
lv_cnt = lv_stopcnt.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = lv_cnt
IMPORTING
output = lv_cnt.
CONCATENATE iv_tknum lv_cnt INTO ls_stop-stopid.
ls_stop-stopcnt = lv_stopcnt.
ls_stop-loccat = 'D'.
ls_stop-loctype = lv_desloctype.
ls_stop-locid = lv_deslocid.
ls_stop-kunablaz_txt = ls_vttsvb-kunablz.
ls_stop-lgnumaz = ls_vttsvb-lgnumz.
ls_stop-toraz = ls_vttsvb-torz.
ls_stop-tknum = iv_tknum.
ls_stop-tsnum = ls_vttsvb-tsnum.
ls_stop-tsrfo = ls_vttsvb-tsrfo.
IF ls_vttsvb-dpten IS INITIAL.
CLEAR ls_stop-pln_evt_datetime.
ELSE.
ls_stop-pln_evt_datetime = |0{ ls_vttsvb-dpten }{ ls_vttsvb-upten }|.
ENDIF.
ls_stop-pln_evt_timezone = lv_tzone.
CLEAR ls_stop-lstelz_txt.
SELECT SINGLE vtext INTO ls_stop-lstelz_txt FROM tvlat
WHERE spras = sy-langu
AND vstel = ls_vttsvb-vstez
AND lstel = ls_vttsvb-lstez.
CLEAR ls_stop-lgortaz_txt.
SELECT SINGLE lgobe INTO ls_stop-lgortaz_txt FROM t001l
WHERE werks = ls_vttsvb-werkz
AND lgort = ls_vttsvb-lgortz.
* Warehouse door text: concatenate T300T-LNUMT '/' T30BT-ltort with LGNUM and LGTOR
CLEAR lv_ltort.
SELECT SINGLE ltort INTO lv_ltort FROM t30bt WHERE spras = sy-langu
AND lgnum = ls_vttsvb-lgnumz
AND lgtor = ls_vttsvb-torz.
CLEAR lv_lnumt.
SELECT SINGLE lnumt INTO lv_lnumt FROM t300t WHERE spras = sy-langu
AND lgnum = ls_vttsvb-lgnumz.
CLEAR ls_stop-lgtraz_txt.
IF lv_ltort IS NOT INITIAL OR lv_lnumt IS NOT INITIAL.
CONCATENATE lv_lnumt lv_ltort INTO ls_stop-lgtraz_txt SEPARATED BY '/'.
ENDIF.
APPEND ls_stop TO et_stops.
ENDLOOP.
CHECK et_stops IS NOT INITIAL.
* Read Stage / Item relation Information
IF it_vtsp IS SUPPLIED.
MOVE it_vtsp TO lt_vtspvb.
ELSE.
lt_tknum_range = VALUE #( (
sign = 'I'
option = 'EQ'
low = iv_tknum
) ).
CALL FUNCTION 'ST_STAGES_READ'
EXPORTING
i_vtts_db_tab = 'VTTS'
i_vtsp_db_tab = 'VTSP'
TABLES
i_tknum_range = lt_tknum_range
c_xvtsp = lt_vtsp
c_xvtspvb = lt_vtspvb.
ENDIF.
CHECK lt_vtspvb IS NOT INITIAL.
* Read Item Information
IF it_vttp IS SUPPLIED.
MOVE it_vttp TO lt_vttpvb.
ELSE.
SELECT * INTO CORRESPONDING FIELDS OF TABLE lt_vttpvb
FROM vttp
WHERE tknum = iv_tknum.
ENDIF.
LOOP AT lt_vtspvb INTO ls_vtspvb WHERE tknum IS NOT INITIAL
AND tpnum IS NOT INITIAL
AND updkz <> 'D'.
CLEAR ls_dlv_watching_stop.
READ TABLE lt_vttpvb INTO ls_vttpvb WITH KEY tknum = ls_vtspvb-tknum
tpnum = ls_vtspvb-tpnum.
ls_dlv_watching_stop-vbeln = ls_vttpvb-vbeln.
LOOP AT et_stops INTO ls_stop WHERE tknum = ls_vtspvb-tknum
AND tsnum = ls_vtspvb-tsnum.
ls_dlv_watching_stop-stopid = ls_stop-stopid.
ls_dlv_watching_stop-loccat = ls_stop-loccat.
APPEND ls_dlv_watching_stop TO et_dlv_watching_stops.
ENDLOOP.
ENDLOOP.
SORT et_dlv_watching_stops BY vbeln stopid loccat.
ENDMETHOD.
METHOD get_carrier_reference_document.
IF is_vttk-vsart = '01' AND
is_vttk-tndr_trkid IS NOT INITIAL.
ev_ref_typ = 'BN'.
ev_ref_val = is_vttk-tndr_trkid.
ELSEIF is_vttk-vsart = '04' AND
is_vttk-tndr_trkid IS NOT INITIAL.
ev_ref_typ = 'T50'.
ev_ref_val = is_vttk-tndr_trkid.
ELSEIF ( is_vttk-vsart = '05' OR is_vttk-vsart = '15' ) AND
is_vttk-tndr_trkid IS NOT INITIAL.
ev_ref_typ = 'T55'.
ev_ref_val = is_vttk-tndr_trkid.
ELSE.
CLEAR: ev_ref_typ, ev_ref_val.
ENDIF.
ENDMETHOD.
METHOD is_appropriate_type.
DATA(lv_shtyp) = CONV shtyp( lcl_tools=>get_field_of_structure(
ir_struct_data = ir_vttk
iv_field_name = 'SHTYP' ) ).
rv_result = boolc( lv_shtyp = lif_app_constants=>cs_relevance-shtyp ).
ENDMETHOD.
METHOD is_delivery_assigned.
TYPES: tt_vttp TYPE STANDARD TABLE OF vttpvb.
FIELD-SYMBOLS: <lt_vttp> TYPE tt_vttp.
ASSIGN ir_vttp->* TO <lt_vttp>.
rv_result = boolc( <lt_vttp> IS ASSIGNED AND
<lt_vttp> IS NOT INITIAL ).
ENDMETHOD.
METHOD is_object_modified.
rv_result = boolc(
is_events-update_indicator = lif_ef_constants=>cs_change_mode-insert OR
is_events-update_indicator = lif_ef_constants=>cs_change_mode-update OR
is_events-update_indicator = lif_ef_constants=>cs_change_mode-undefined
).
ENDMETHOD.
METHOD get_next_event_counter.
ADD 1 TO mv_evtcnt.
rv_evtcnt = mv_evtcnt.
ENDMETHOD.
ENDCLASS.
**********************************************************************
**********************************************************************
**********************************************************************
CLASS lcl_sh_data_old DEFINITION.
PUBLIC SECTION.
METHODS constructor
IMPORTING
io_ef_parameters TYPE REF TO lif_ef_parameters
RAISING
cx_udm_message.
METHODS get_vttk
RETURNING
VALUE(rr_vttk) TYPE REF TO data.
METHODS get_vttp
RETURNING
VALUE(rr_vttp) TYPE REF TO data.
METHODS get_vtts
RETURNING
VALUE(rr_vtts) TYPE REF TO data.
METHODS get_vtsp
RETURNING
VALUE(rr_vtsp) TYPE REF TO data.
PRIVATE SECTION.
DATA: mo_ef_parameters TYPE REF TO lif_ef_parameters,
mt_vttk TYPE lif_app_types=>tt_vttkvb,
mt_vttp TYPE lif_app_types=>tt_vttpvb,
mt_vtts TYPE lif_app_types=>tt_vttsvb,
mt_vtsp TYPE lif_app_types=>tt_vtspvb.
METHODS init
RAISING
cx_udm_message.
METHODS init_vttk
RAISING
cx_udm_message.
METHODS init_vttp
RAISING
cx_udm_message.
METHODS init_vtts
RAISING
cx_udm_message.
METHODS init_vtsp
RAISING
cx_udm_message.
ENDCLASS.
CLASS lcl_sh_data_old IMPLEMENTATION.
METHOD constructor.
mo_ef_parameters = io_ef_parameters.
init( ).
ENDMETHOD.
METHOD get_vttk.
rr_vttk = REF #( mt_vttk ).
ENDMETHOD.
METHOD get_vttp.
rr_vttp = REF #( mt_vttp ).
ENDMETHOD.
METHOD get_vtts.
rr_vtts = REF #( mt_vtts ).
ENDMETHOD.
METHOD get_vtsp.
rr_vtsp = REF #( mt_vtsp ).
ENDMETHOD.
METHOD init.
init_vttk( ).
init_vttp( ).
init_vtts( ).
init_vtsp( ).
ENDMETHOD.
METHOD init_vttk.
FIELD-SYMBOLS: <lt_vttk_new> TYPE lif_app_types=>tt_vttkvb,
<lt_vttk_old> TYPE lif_app_types=>tt_vttkvb.
DATA(lr_vttk_new) = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-sh_header_new ).
DATA(lr_vttk_old) = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-sh_header_old ).
ASSIGN lr_vttk_new->* TO <lt_vttk_new>.
ASSIGN lr_vttk_old->* TO <lt_vttk_old>.
IF <lt_vttk_new> IS ASSIGNED AND
<lt_vttk_old> IS ASSIGNED.
mt_vttk = <lt_vttk_old>.
SORT mt_vttk BY tknum.
LOOP AT <lt_vttk_new> ASSIGNING FIELD-SYMBOL(<ls_vttk_new>)
WHERE updkz IS INITIAL.
READ TABLE mt_vttk
WITH KEY tknum = <ls_vttk_new>-tknum
TRANSPORTING NO FIELDS
BINARY SEARCH.
IF sy-subrc <> 0.
INSERT <ls_vttk_new> INTO mt_vttk INDEX sy-tabix.
ENDIF.
ENDLOOP.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'VTTK' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD init_vttp.
FIELD-SYMBOLS: <lt_vttp_new> TYPE lif_app_types=>tt_vttpvb,
<lt_vttp_old> TYPE lif_app_types=>tt_vttpvb.
DATA(lr_vttp_new) = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-sh_item_new ).
DATA(lr_vttp_old) = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-sh_item_old ).
ASSIGN lr_vttp_new->* TO <lt_vttp_new>.
ASSIGN lr_vttp_old->* TO <lt_vttp_old>.
IF <lt_vttp_new> IS ASSIGNED AND
<lt_vttp_old> IS ASSIGNED.
mt_vttp = <lt_vttp_old>.
SORT mt_vttp BY tknum tpnum.
LOOP AT <lt_vttp_new> ASSIGNING FIELD-SYMBOL(<ls_vttp_new>)
WHERE updkz IS INITIAL.
READ TABLE mt_vttp
WITH KEY tknum = <ls_vttp_new>-tknum
tpnum = <ls_vttp_new>-tpnum
TRANSPORTING NO FIELDS
BINARY SEARCH.
IF sy-subrc <> 0.
INSERT <ls_vttp_new> INTO mt_vttp INDEX sy-tabix.
ENDIF.
ENDLOOP.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'VTTP' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD init_vtts.
FIELD-SYMBOLS: <lt_vtts_new> TYPE lif_app_types=>tt_vttsvb,
<lt_vtts_old> TYPE lif_app_types=>tt_vttsvb.
DATA(lr_vtts_new) = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-sh_stage_new ).
DATA(lr_vtts_old) = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-sh_stage_old ).
ASSIGN lr_vtts_new->* TO <lt_vtts_new>.
ASSIGN lr_vtts_old->* TO <lt_vtts_old>.
IF <lt_vtts_new> IS ASSIGNED AND
<lt_vtts_old> IS ASSIGNED.
mt_vtts = <lt_vtts_old>.
SORT mt_vtts BY tknum tsnum.
LOOP AT <lt_vtts_new> ASSIGNING FIELD-SYMBOL(<ls_vtts_new>)
WHERE updkz IS INITIAL.
READ TABLE mt_vtts
WITH KEY tknum = <ls_vtts_new>-tknum
tsnum = <ls_vtts_new>-tsnum
TRANSPORTING NO FIELDS
BINARY SEARCH.
IF sy-subrc <> 0.
INSERT <ls_vtts_new> INTO mt_vtts INDEX sy-tabix.
ENDIF.
ENDLOOP.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'VTTS' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD init_vtsp.
FIELD-SYMBOLS: <lt_vtsp_new> TYPE lif_app_types=>tt_vtspvb,
<lt_vtsp_old> TYPE lif_app_types=>tt_vtspvb.
DATA(lr_vtsp_new) = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-sh_item_stage_new ).
DATA(lr_vtsp_old) = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-sh_item_stage_old ).
ASSIGN lr_vtsp_new->* TO <lt_vtsp_new>.
ASSIGN lr_vtsp_old->* TO <lt_vtsp_old>.
IF <lt_vtsp_new> IS ASSIGNED AND
<lt_vtsp_old> IS ASSIGNED.
mt_vtsp = <lt_vtsp_old>.
SORT mt_vtsp BY tknum tsnum tpnum.
LOOP AT <lt_vtsp_new> ASSIGNING FIELD-SYMBOL(<ls_vtsp_new>)
WHERE updkz IS INITIAL.
READ TABLE mt_vtsp
WITH KEY tknum = <ls_vtsp_new>-tknum
tsnum = <ls_vtsp_new>-tsnum
tpnum = <ls_vtsp_new>-tpnum
TRANSPORTING NO FIELDS
BINARY SEARCH.
IF sy-subrc <> 0.
INSERT <ls_vtsp_new> INTO mt_vtsp INDEX sy-tabix.
ENDIF.
ENDLOOP.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'VTSP' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
ENDCLASS.
**********************************************************************
**********************************************************************
**********************************************************************
CLASS lcl_bo_reader_po_header DEFINITION.
PUBLIC SECTION.
INTERFACES: lif_bo_reader.
METHODS constructor
IMPORTING
io_ef_parameters TYPE REF TO lif_ef_parameters.
PRIVATE SECTION.
TYPES: tv_item_num TYPE i,
tt_item_num TYPE STANDARD TABLE OF tv_item_num WITH EMPTY KEY.
TYPES: tv_ebelp TYPE char15,
tt_ebelp TYPE STANDARD TABLE OF tv_ebelp WITH EMPTY KEY.
TYPES: BEGIN OF ts_po_header,
ebeln TYPE ekko-ebeln,
lifnr TYPE ekko-lifnr,
lifnr_lt TYPE /saptrx/loc_id_type,
werks TYPE ekpo-werks,
werks_lt TYPE /saptrx/loc_id_type,
eindt TYPE eket-eindt,
netwr TYPE ekpo-netwr,
waers TYPE ekko-waers,
inco1 TYPE ekko-inco1,
incov TYPE ekko-incov,
inco2_l TYPE ekko-inco2_l,
item_num TYPE tt_item_num,
ebelp TYPE tt_ebelp,
END OF ts_po_header.
CONSTANTS: BEGIN OF cs_mapping,
ebeln TYPE /saptrx/paramname VALUE 'YN_PO_NUMBER',
lifnr TYPE /saptrx/paramname VALUE 'YN_PO_SUPPLIER_ID',
lifnr_lt TYPE /saptrx/paramname VALUE 'YN_PO_SUPPLIER_LOC_TYPE',
werks TYPE /saptrx/paramname VALUE 'YN_PO_RECEIVING_LOCATION',
werks_lt TYPE /saptrx/paramname VALUE 'YN_PO_RECEIVING_LOC_TYPE',
eindt TYPE /saptrx/paramname VALUE 'YN_PO_DELIVERY_DATE',
netwr TYPE /saptrx/paramname VALUE 'YN_PO_NET_VALUE',
waers TYPE /saptrx/paramname VALUE 'YN_PO_CURRENCY',
inco1 TYPE /saptrx/paramname VALUE 'YN_PO_INCOTERMS',
incov TYPE /saptrx/paramname VALUE 'YN_PO_INCOTERMS_VERSION',
inco2_l TYPE /saptrx/paramname VALUE 'YN_PO_INCOTERMS_LOCATION',
item_num TYPE /saptrx/paramname VALUE 'YN_PO_HDR_ITM_LINE_COUNT',
ebelp TYPE /saptrx/paramname VALUE 'YN_PO_HDR_ITM_NO',
END OF cs_mapping.
DATA: mo_ef_parameters TYPE REF TO lif_ef_parameters.
METHODS fill_header_from_ekko_struct
IMPORTING
ir_ekko TYPE REF TO data
CHANGING
cs_po_header TYPE ts_po_header
RAISING
cx_udm_message.
METHODS fill_header_from_ekko_table
IMPORTING
iv_ebeln TYPE ebeln
ir_ekko TYPE REF TO data
CHANGING
cs_po_header TYPE ts_po_header
RAISING
cx_udm_message.
METHODS fill_header_from_ekpo_table
IMPORTING
iv_ebeln TYPE ebeln
ir_ekpo TYPE REF TO data
CHANGING
cs_po_header TYPE ts_po_header
RAISING
cx_udm_message.
METHODS fill_header_from_eket_table
IMPORTING
iv_ebeln TYPE ebeln
ir_ekpo TYPE REF TO data
ir_eket TYPE REF TO data
CHANGING
cs_po_header TYPE ts_po_header
RAISING
cx_udm_message.
METHODS fill_header_location_types
CHANGING
cs_po_header TYPE ts_po_header
RAISING
cx_udm_message.
METHODS is_object_changed
IMPORTING
is_app_object TYPE trxas_appobj_ctab_wa
RETURNING
VALUE(rv_result) TYPE abap_bool
RAISING
cx_udm_message.
ENDCLASS.
CLASS lcl_bo_reader_po_header IMPLEMENTATION.
METHOD constructor.
mo_ef_parameters = io_ef_parameters.
ENDMETHOD.
METHOD lif_bo_reader~check_relevance.
" 1. Basic check of main table which shall be following
" the AOT configuration
" 2. Check that only 1 PO type is relevance for GTT,
" which could be the standard PO type: NB
" 3. If it’s CREATING PO, always flag TRUE
" 4. If it’s UPDATING PO, check whether there is any
" change for all the above fields or not, comparing
" their NEW / OLD value pairs
" 5. Don’t need to consider DELETING PO, which will be
" considered by standard logic of EM framework and
" extractors cannot impact this case
rv_result = lif_ef_constants=>cs_condition-false.
" is_app_object-maintabdef = lif_pof_constants=>cs_tabledef-po_header_new AND
IF lcl_po_tools=>is_appropriate_po_type( ir_ekko = is_app_object-maintabref ) = abap_true AND
is_object_changed( is_app_object = is_app_object ) = abap_true.
CASE is_app_object-update_indicator.
WHEN lif_ef_constants=>cs_change_mode-insert.
rv_result = lif_ef_constants=>cs_condition-true.
WHEN lif_ef_constants=>cs_change_mode-update OR
lif_ef_constants=>cs_change_mode-undefined.
rv_result = lcl_tools=>are_structures_different(
ir_data1 = lif_bo_reader~get_data(
is_app_object = is_app_object )
ir_data2 = lif_bo_reader~get_data_old(
is_app_object = is_app_object ) ).
ENDCASE.
ENDIF.
ENDMETHOD.
METHOD lif_bo_reader~get_data.
FIELD-SYMBOLS: <ls_header> TYPE ts_po_header.
rr_data = NEW ts_po_header( ).
ASSIGN rr_data->* TO <ls_header>.
fill_header_from_ekko_struct(
EXPORTING
ir_ekko = is_app_object-maintabref
CHANGING
cs_po_header = <ls_header> ).
fill_header_from_ekpo_table(
EXPORTING
iv_ebeln = <ls_header>-ebeln
ir_ekpo = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-po_item_new )
CHANGING
cs_po_header = <ls_header> ).
fill_header_from_eket_table(
EXPORTING
iv_ebeln = <ls_header>-ebeln
ir_ekpo = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-po_item_new )
ir_eket = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-po_sched_new )
CHANGING
cs_po_header = <ls_header> ).
fill_header_location_types(
CHANGING
cs_po_header = <ls_header> ).
ENDMETHOD.
METHOD lif_bo_reader~get_field_parameter.
CASE iv_parameter.
WHEN lif_ef_constants=>cs_parameter_id-key_field.
rv_result = boolc( iv_field_name = cs_mapping-item_num ).
WHEN OTHERS.
CLEAR: rv_result.
ENDCASE.
ENDMETHOD.
METHOD lif_bo_reader~get_mapping_structure.
rr_data = REF #( cs_mapping ).
ENDMETHOD.
METHOD lif_bo_reader~get_track_id_data.
MESSAGE e004(zpof_gtt) WITH 'LCL_BO_READER_PO_HEADER'
INTO DATA(lv_dummy).
lcl_tools=>throw_exception(
iv_textid = lif_ef_constants=>cs_errors-stop_processing ).
ENDMETHOD.
METHOD fill_header_from_eket_table.
DATA: lt_ebelp_rng TYPE RANGE OF ekpo-ebelp,
lv_eindt_max TYPE eket-eindt,
lv_eindt_set TYPE abap_bool VALUE abap_false.
FIELD-SYMBOLS: <lt_ekpo> TYPE lif_app_types=>tt_uekpo,
<ls_ekpo> TYPE lif_app_types=>ts_uekpo,
<lt_eket> TYPE lif_app_types=>tt_ueket,
<ls_eket> TYPE lif_app_types=>ts_ueket.
CLEAR: cs_po_header-eindt.
ASSIGN ir_ekpo->* TO <lt_ekpo>.
ASSIGN ir_eket->* TO <lt_eket>.
IF <lt_ekpo> IS ASSIGNED AND
<lt_eket> IS ASSIGNED.
CLEAR cs_po_header-eindt.
" Preparation of Active Items List
LOOP AT <lt_ekpo> ASSIGNING <ls_ekpo>
WHERE ebeln = iv_ebeln
AND loekz <> lif_app_constants=>cs_loekz-deleted.
lt_ebelp_rng = VALUE #( BASE lt_ebelp_rng
( low = <ls_ekpo>-ebelp
option = 'EQ'
sign = 'I' ) ).
ENDLOOP.
" Latest Delivery Date in schedule lines per item,
" keep empty in case of different date on item level
LOOP AT <lt_eket> ASSIGNING <ls_eket>
WHERE ebeln = iv_ebeln
AND ebelp IN lt_ebelp_rng
GROUP BY ( ebeln = <ls_eket>-ebeln
ebelp = <ls_eket>-ebelp )
ASCENDING
ASSIGNING FIELD-SYMBOL(<ls_eket_group>).
CLEAR: lv_eindt_max.
LOOP AT GROUP <ls_eket_group> ASSIGNING FIELD-SYMBOL(<ls_eket_items>).
lv_eindt_max = COND #( WHEN <ls_eket_items>-eindt > lv_eindt_max
THEN <ls_eket_items>-eindt
ELSE lv_eindt_max ).
ENDLOOP.
IF lv_eindt_set = abap_false.
cs_po_header-eindt = lv_eindt_max.
lv_eindt_set = abap_true.
ELSEIF cs_po_header-eindt <> lv_eindt_max.
CLEAR: cs_po_header-eindt.
EXIT.
ENDIF.
ENDLOOP.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'EKET' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD fill_header_location_types.
cs_po_header-lifnr_lt = lif_ef_constants=>cs_loc_types-supplier.
cs_po_header-werks_lt = lif_ef_constants=>cs_loc_types-plant.
ENDMETHOD.
METHOD fill_header_from_ekko_struct.
FIELD-SYMBOLS: <ls_ekko> TYPE any.
ASSIGN ir_ekko->* TO <ls_ekko>.
IF <ls_ekko> IS ASSIGNED.
MOVE-CORRESPONDING <ls_ekko> TO cs_po_header.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'EKKO' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD fill_header_from_ekko_table.
DATA: lv_dummy TYPE char100.
FIELD-SYMBOLS: <lt_ekko> TYPE ANY TABLE,
<ls_ekko> TYPE any,
<lv_ebeln> TYPE any.
CLEAR: cs_po_header-werks, cs_po_header-netwr.
ASSIGN ir_ekko->* TO <lt_ekko>.
IF <lt_ekko> IS ASSIGNED.
LOOP AT <lt_ekko> ASSIGNING <ls_ekko>.
ASSIGN COMPONENT 'EBELN' OF STRUCTURE <ls_ekko> TO <lv_ebeln>.
IF <lv_ebeln> IS ASSIGNED.
" is it a record I need?
IF <lv_ebeln> = iv_ebeln.
MOVE-CORRESPONDING <ls_ekko> TO cs_po_header.
EXIT.
ENDIF.
ELSE.
MESSAGE e001(zpof_gtt) WITH 'EBELN' 'EKKO' INTO lv_dummy.
lcl_tools=>throw_exception( ).
ENDIF.
ENDLOOP.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'EKKO' INTO lv_dummy.
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD fill_header_from_ekpo_table.
DATA: lv_item_num TYPE tv_item_num VALUE 0,
lv_fname TYPE char5,
lv_dummy TYPE char100.
FIELD-SYMBOLS: <lt_ekpo> TYPE ANY TABLE,
<ls_ekpo> TYPE any,
<lv_ebeln> TYPE any,
<lv_ebelp> TYPE any,
<lv_loekz> TYPE any,
<lv_werks> TYPE any,
<lv_netwr> TYPE any.
CLEAR: cs_po_header-werks,
cs_po_header-netwr,
cs_po_header-item_num[],
cs_po_header-ebelp[].
ASSIGN ir_ekpo->* TO <lt_ekpo>.
IF <lt_ekpo> IS ASSIGNED.
LOOP AT <lt_ekpo> ASSIGNING <ls_ekpo>.
ASSIGN COMPONENT 'EBELN' OF STRUCTURE <ls_ekpo> TO <lv_ebeln>.
ASSIGN COMPONENT 'EBELP' OF STRUCTURE <ls_ekpo> TO <lv_ebelp>.
ASSIGN COMPONENT 'LOEKZ' OF STRUCTURE <ls_ekpo> TO <lv_loekz>.
ASSIGN COMPONENT 'WERKS' OF STRUCTURE <ls_ekpo> TO <lv_werks>.
ASSIGN COMPONENT 'NETWR' OF STRUCTURE <ls_ekpo> TO <lv_netwr>.
IF <lv_ebeln> IS ASSIGNED AND
<lv_ebelp> IS ASSIGNED AND
<lv_loekz> IS ASSIGNED AND
<lv_werks> IS ASSIGNED AND
<lv_netwr> IS ASSIGNED.
IF <lv_ebeln> = iv_ebeln AND
lcl_po_tools=>is_appropriate_po_item( ir_ekpo = REF #( <ls_ekpo> ) ) = abap_true.
" Add PO Item number into result table
ADD 1 TO lv_item_num.
APPEND lv_item_num TO cs_po_header-item_num.
" Add composition (PO Number PO Item position) into result table
APPEND |{ <lv_ebeln> }{ <lv_ebelp> }| TO cs_po_header-ebelp.
" Is item not deleted (active or blocked)?
IF <lv_loekz> <> lif_app_constants=>cs_loekz-deleted.
" Plant ID, keep empty in case of different receiving plants on item level
cs_po_header-werks = COND #( WHEN sy-tabix = 1 OR
<lv_werks> = cs_po_header-werks
THEN <lv_werks> ).
" Sum of net values on item level
ADD <lv_netwr> TO cs_po_header-netwr.
ENDIF.
ENDIF.
ELSE.
lv_fname = COND #( WHEN <lv_ebeln> IS NOT ASSIGNED THEN 'EBELN'
WHEN <lv_ebelp> IS NOT ASSIGNED THEN 'EBELP'
WHEN <lv_loekz> IS NOT ASSIGNED THEN 'LOEKZ'
WHEN <lv_werks> IS NOT ASSIGNED THEN 'WERKS'
ELSE 'NETWR' ).
MESSAGE e001(zpof_gtt) WITH lv_fname 'EKPO' INTO lv_dummy.
lcl_tools=>throw_exception( ).
ENDIF.
ENDLOOP.
cs_po_header-netwr = lcl_tools=>convert_to_external_amount(
iv_currency = cs_po_header-waers
iv_internal = cs_po_header-netwr ).
ELSE.
MESSAGE e002(zpof_gtt) WITH 'EKPO' INTO lv_dummy.
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD lif_bo_reader~get_data_old.
FIELD-SYMBOLS: <ls_header> TYPE ts_po_header.
rr_data = NEW ts_po_header( ).
ASSIGN rr_data->* TO <ls_header>.
fill_header_from_ekko_table(
EXPORTING
iv_ebeln = CONV #( lcl_tools=>get_field_of_structure(
ir_struct_data = is_app_object-maintabref
iv_field_name = 'EBELN'
) )
ir_ekko = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-po_header_old )
CHANGING
cs_po_header = <ls_header> ).
fill_header_from_ekpo_table(
EXPORTING
iv_ebeln = <ls_header>-ebeln
ir_ekpo = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-po_item_old )
CHANGING
cs_po_header = <ls_header> ).
fill_header_from_eket_table(
EXPORTING
iv_ebeln = <ls_header>-ebeln
ir_ekpo = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-po_item_old )
ir_eket = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-po_sched_old )
CHANGING
cs_po_header = <ls_header> ).
fill_header_location_types(
CHANGING
cs_po_header = <ls_header> ).
ENDMETHOD.
METHOD is_object_changed.
rv_result = lcl_tools=>is_object_changed(
is_app_object = is_app_object
io_ef_parameters = mo_ef_parameters
it_check_tables = VALUE #( ( lif_app_constants=>cs_tabledef-po_item_new )
( lif_app_constants=>cs_tabledef-po_item_old )
( lif_app_constants=>cs_tabledef-po_sched_new )
( lif_app_constants=>cs_tabledef-po_sched_old ) )
iv_key_field = 'EBELN'
iv_upd_field = 'KZ' ).
ENDMETHOD.
ENDCLASS.
**********************************************************************
**********************************************************************
**********************************************************************
CLASS lcl_bo_reader_po_item DEFINITION.
PUBLIC SECTION.
INTERFACES: lif_bo_reader.
METHODS constructor
IMPORTING
io_ef_parameters TYPE REF TO lif_ef_parameters.
PRIVATE SECTION.
TYPES: tv_ebelp_txt TYPE char5, "char15
tv_deliv_num TYPE i,
tv_deliv_item TYPE char20,
tv_sched_num TYPE i.
TYPES: tt_deliv_num TYPE STANDARD TABLE OF tv_deliv_num
WITH EMPTY KEY,
tt_deliv_item TYPE STANDARD TABLE OF tv_deliv_item
WITH EMPTY KEY,
tt_sched_num TYPE STANDARD TABLE OF tv_sched_num
WITH EMPTY KEY,
tt_sched_eindt TYPE STANDARD TABLE OF eket-eindt
WITH EMPTY KEY,
tt_sched_menge TYPE STANDARD TABLE OF eket-menge
WITH EMPTY KEY,
tt_sched_meins TYPE STANDARD TABLE OF ekpo-meins
WITH EMPTY KEY.
TYPES: BEGIN OF ts_po_item,
ebeln TYPE ekpo-ebeln,
ebelp TYPE tv_ebelp_txt, "used char type to avoid leading zeros deletion
lifnr TYPE ekko-lifnr,
lifnr_lt TYPE /saptrx/loc_id_type,
werks TYPE ekpo-werks,
werks_lt TYPE /saptrx/loc_id_type,
eindt TYPE eket-eindt,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
txz01 TYPE ekpo-txz01,
ntgew TYPE ekpo-ntgew,
gewei TYPE ekpo-gewei,
brgew TYPE ekpo-brgew,
volum TYPE ekpo-volum,
voleh TYPE ekpo-voleh,
netwr TYPE ekpo-netwr,
waers TYPE ekko-waers,
inco1 TYPE ekpo-inco1,
incov TYPE ekko-incov,
inco2_l TYPE ekpo-inco2_l,
deliv_num TYPE tt_deliv_num,
deliv_item TYPE tt_deliv_item,
sched_num TYPE tt_sched_num,
sched_eindt TYPE tt_sched_eindt,
sched_menge TYPE tt_sched_menge,
sched_meins TYPE tt_sched_meins,
END OF ts_po_item.
CONSTANTS: BEGIN OF cs_mapping,
ebeln TYPE /saptrx/paramname VALUE 'YN_PO_NUMBER',
ebelp TYPE /saptrx/paramname VALUE 'YN_PO_ITEM',
lifnr TYPE /saptrx/paramname VALUE 'YN_PO_SUPPLIER_ID',
lifnr_lt TYPE /saptrx/paramname VALUE 'YN_PO_SUPPLIER_LOC_TYPE',
werks TYPE /saptrx/paramname VALUE 'YN_PO_RECEIVING_LOCATION',
werks_lt TYPE /saptrx/paramname VALUE 'YN_PO_RECEIVING_LOC_TYPE',
eindt TYPE /saptrx/paramname VALUE 'YN_PO_DELIVERY_DATE',
matnr TYPE /saptrx/paramname VALUE 'YN_PO_MATERIAL_ID',
menge TYPE /saptrx/paramname VALUE 'YN_PO_ORDER_QUANTITY',
meins TYPE /saptrx/paramname VALUE 'YN_PO_UNIT_OF_MEASURE',
txz01 TYPE /saptrx/paramname VALUE 'YN_PO_MATERIAL_DESCR',
ntgew TYPE /saptrx/paramname VALUE 'YN_PO_NET_WEIGHT',
gewei TYPE /saptrx/paramname VALUE 'YN_PO_WEIGHT_UOM',
brgew TYPE /saptrx/paramname VALUE 'YN_PO_GROSS_WEIGHT',
volum TYPE /saptrx/paramname VALUE 'YN_PO_VOLUME',
voleh TYPE /saptrx/paramname VALUE 'YN_PO_VOLUME_UOM',
netwr TYPE /saptrx/paramname VALUE 'YN_PO_NET_VALUE',
waers TYPE /saptrx/paramname VALUE 'YN_PO_CURRENCY',
inco1 TYPE /saptrx/paramname VALUE 'YN_PO_INCOTERMS',
incov TYPE /saptrx/paramname VALUE 'YN_PO_INCOTERMS_VERSION',
inco2_l TYPE /saptrx/paramname VALUE 'YN_PO_INCOTERMS_LOCATION',
deliv_num TYPE /saptrx/paramname VALUE 'YN_DL_HDR_ITM_LINE_COUNT',
deliv_item TYPE /saptrx/paramname VALUE 'YN_DL_HDR_ITM_NO',
sched_num TYPE /saptrx/paramname VALUE 'YN_PO_ITM_SCHED_LINE_COUNT',
sched_eindt TYPE /saptrx/paramname VALUE 'YN_PO_ITM_SCHED_DATE',
sched_menge TYPE /saptrx/paramname VALUE 'YN_PO_ITM_SCHED_QUANTITY',
sched_meins TYPE /saptrx/paramname VALUE 'YN_PO_ITM_SCHED_QUANT_UOM',
END OF cs_mapping.
DATA: mo_ef_parameters TYPE REF TO lif_ef_parameters.
METHODS fill_item_from_ekko_struct
IMPORTING
ir_ekko TYPE REF TO data
CHANGING
cs_po_item TYPE ts_po_item
RAISING
cx_udm_message.
METHODS fill_item_from_ekko_table
IMPORTING
ir_ekko TYPE REF TO data
iv_ebeln TYPE ebeln
CHANGING
cs_po_item TYPE ts_po_item
RAISING
cx_udm_message.
METHODS fill_item_from_ekpo_struct
IMPORTING
ir_ekpo TYPE REF TO data
CHANGING
cs_po_item TYPE ts_po_item
RAISING
cx_udm_message.
METHODS fill_item_from_eket_table
IMPORTING
ir_ekpo TYPE REF TO data
ir_eket TYPE REF TO data
CHANGING
cs_po_item TYPE ts_po_item
RAISING
cx_udm_message.
METHODS fill_item_location_types
CHANGING
cs_po_item TYPE ts_po_item
RAISING
cx_udm_message.
METHODS get_ekpo_record
IMPORTING
ir_ekpo TYPE REF TO data
iv_ebeln TYPE ebeln
iv_ebelp TYPE ebelp
RETURNING
VALUE(rv_ekpo) TYPE REF TO data
RAISING
cx_udm_message.
METHODS is_object_changed
IMPORTING
is_app_object TYPE trxas_appobj_ctab_wa
RETURNING
VALUE(rv_result) TYPE abap_bool
RAISING
cx_udm_message.
ENDCLASS.
CLASS lcl_bo_reader_po_item IMPLEMENTATION.
METHOD constructor.
mo_ef_parameters = io_ef_parameters.
ENDMETHOD.
METHOD fill_item_from_eket_table.
TYPES: tt_eket TYPE STANDARD TABLE OF ueket.
DATA: lv_sched_num TYPE tv_sched_num VALUE 0,
lv_sched_vrkme TYPE lips-vrkme.
FIELD-SYMBOLS: <lt_eket> TYPE tt_eket.
DATA(lv_ebeln) = CONV ebeln( lcl_tools=>get_field_of_structure(
ir_struct_data = ir_ekpo
iv_field_name = 'EBELN' ) ).
DATA(lv_ebelp) = CONV ebelp( lcl_tools=>get_field_of_structure(
ir_struct_data = ir_ekpo
iv_field_name = 'EBELP' ) ).
DATA(lv_meins) = CONV vrkme( lcl_tools=>get_field_of_structure(
ir_struct_data = ir_ekpo
iv_field_name = 'MEINS' ) ).
CLEAR: cs_po_item-eindt,
cs_po_item-sched_num[],
cs_po_item-sched_eindt[],
cs_po_item-sched_menge[],
cs_po_item-sched_meins[].
ASSIGN ir_eket->* TO <lt_eket>.
IF <lt_eket> IS ASSIGNED.
LOOP AT <lt_eket> ASSIGNING FIELD-SYMBOL(<ls_eket>)
WHERE ebeln = lv_ebeln
AND ebelp = lv_ebelp.
" Latest Delivery Date in schedule lines per item, keep empty in case of
" different date on item level
cs_po_item-eindt = COND #( WHEN <ls_eket>-eindt > cs_po_item-eindt
THEN <ls_eket>-eindt
ELSE cs_po_item-eindt ).
" add row to schedule line table
ADD 1 TO lv_sched_num.
APPEND lv_sched_num TO cs_po_item-sched_num.
APPEND <ls_eket>-eindt TO cs_po_item-sched_eindt.
APPEND <ls_eket>-menge TO cs_po_item-sched_menge.
APPEND lv_meins TO cs_po_item-sched_meins.
ENDLOOP.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'EKET' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD fill_item_from_ekko_struct.
DATA: lv_fname TYPE char5,
lv_dummy TYPE char100.
FIELD-SYMBOLS: <ls_ekko> TYPE any,
<lv_lifnr> TYPE ekko-lifnr,
<lv_waers> TYPE ekko-waers,
<lv_incov> TYPE ekko-incov.
ASSIGN ir_ekko->* TO <ls_ekko>.
IF <ls_ekko> IS ASSIGNED.
ASSIGN COMPONENT 'LIFNR' OF STRUCTURE <ls_ekko> TO <lv_lifnr>.
ASSIGN COMPONENT 'WAERS' OF STRUCTURE <ls_ekko> TO <lv_waers>.
ASSIGN COMPONENT 'INCOV' OF STRUCTURE <ls_ekko> TO <lv_incov>.
IF <lv_lifnr> IS ASSIGNED AND
<lv_waers> IS ASSIGNED AND
<lv_incov> IS ASSIGNED.
cs_po_item-lifnr = <lv_lifnr>.
cs_po_item-waers = <lv_waers>.
cs_po_item-incov = <lv_incov>.
ELSE.
lv_fname = COND #( WHEN <lv_lifnr> IS NOT ASSIGNED THEN 'LIFNR'
WHEN <lv_incov> IS NOT ASSIGNED THEN 'INCOV'
ELSE 'WAERS' ).
MESSAGE e001(zpof_gtt) WITH lv_fname 'EKKO' INTO lv_dummy.
lcl_tools=>throw_exception( ).
ENDIF.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'EKKO' INTO lv_dummy.
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD fill_item_from_ekko_table.
DATA: lv_fname TYPE char5,
lv_dummy TYPE char100.
FIELD-SYMBOLS: <lt_ekko> TYPE ANY TABLE,
<ls_ekko> TYPE any,
<lv_ebeln> TYPE ekko-ebeln,
<lv_lifnr> TYPE ekko-lifnr,
<lv_incov> TYPE ekko-incov,
<lv_waers> TYPE ekko-waers.
CLEAR: cs_po_item-lifnr, cs_po_item-waers.
ASSIGN ir_ekko->* TO <lt_ekko>.
IF <lt_ekko> IS ASSIGNED.
LOOP AT <lt_ekko> ASSIGNING <ls_ekko>.
ASSIGN COMPONENT 'EBELN' OF STRUCTURE <ls_ekko> TO <lv_ebeln>.
ASSIGN COMPONENT 'LIFNR' OF STRUCTURE <ls_ekko> TO <lv_lifnr>.
ASSIGN COMPONENT 'INCOV' OF STRUCTURE <ls_ekko> TO <lv_incov>.
ASSIGN COMPONENT 'WAERS' OF STRUCTURE <ls_ekko> TO <lv_waers>.
IF <lv_ebeln> IS ASSIGNED AND
<lv_lifnr> IS ASSIGNED AND
<lv_incov> IS ASSIGNED AND
<lv_waers> IS ASSIGNED.
IF <lv_ebeln> = iv_ebeln.
cs_po_item-lifnr = <lv_lifnr>.
cs_po_item-waers = <lv_waers>.
cs_po_item-incov = <lv_incov>.
ENDIF.
ELSE.
lv_fname = COND #( WHEN <lv_ebeln> IS NOT ASSIGNED THEN 'EBELN'
WHEN <lv_lifnr> IS NOT ASSIGNED THEN 'LIFNR'
WHEN <lv_incov> IS NOT ASSIGNED THEN 'INCOV'
ELSE 'WAERS' ).
MESSAGE e001(zpof_gtt) WITH lv_fname 'EKKO' INTO lv_dummy.
lcl_tools=>throw_exception( ).
ENDIF.
ENDLOOP.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'EKKO' INTO lv_dummy.
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD fill_item_from_ekpo_struct.
FIELD-SYMBOLS: <ls_ekpo> TYPE any.
ASSIGN ir_ekpo->* TO <ls_ekpo>.
IF <ls_ekpo> IS ASSIGNED.
MOVE-CORRESPONDING <ls_ekpo> TO cs_po_item.
cs_po_item-netwr = lcl_tools=>convert_to_external_amount(
iv_currency = cs_po_item-waers
iv_internal = cs_po_item-netwr ).
ELSE.
MESSAGE e002(zpof_gtt) WITH 'EKPO' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD fill_item_location_types.
cs_po_item-lifnr_lt = lif_ef_constants=>cs_loc_types-supplier.
cs_po_item-werks_lt = lif_ef_constants=>cs_loc_types-plant.
ENDMETHOD.
METHOD get_ekpo_record.
TYPES: tt_ekpo TYPE STANDARD TABLE OF uekpo.
DATA: lv_dummy TYPE char100.
FIELD-SYMBOLS: <lt_ekpo> TYPE tt_ekpo.
ASSIGN ir_ekpo->* TO <lt_ekpo>.
IF <lt_ekpo> IS ASSIGNED.
READ TABLE <lt_ekpo> ASSIGNING FIELD-SYMBOL(<ls_ekpo>)
WITH KEY ebeln = iv_ebeln
ebelp = iv_ebelp.
IF sy-subrc = 0.
rv_ekpo = REF #( <ls_ekpo> ).
ELSE.
MESSAGE e005(zpof_gtt) WITH 'EKPO' |{ iv_ebeln }{ iv_ebelp }|
INTO lv_dummy.
lcl_tools=>throw_exception( ).
ENDIF.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'EKPO' INTO lv_dummy.
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD lif_bo_reader~check_relevance.
" 1. Basic check of main table which shall be following
" the AOT configuration
" 2. Check that only 1 PO type is relevance for GTT,
" which could be the standard PO type: NB
" 3. If it’s CREATING PO, always flag TRUE
" 4. If it’s UPDATING PO, check whether there is any
" change for all the above fields or not, comparing
" their NEW / OLD value pairs
" 5. Don’t need to consider DELETING PO, which will be
" considered by standard logic of EM framework and
" extractors cannot impact this case
rv_result = lif_ef_constants=>cs_condition-false.
" is_app_object-maintabdef = lif_pof_constants=>cs_tabledef-po_item_new AND
IF lcl_po_tools=>is_appropriate_po_type( ir_ekko = is_app_object-mastertabref ) = abap_true AND
lcl_po_tools=>is_appropriate_po_item( ir_ekpo = is_app_object-maintabref ) = abap_true AND
is_object_changed( is_app_object = is_app_object ) = abap_true.
CASE is_app_object-update_indicator.
WHEN lif_ef_constants=>cs_change_mode-insert.
rv_result = lif_ef_constants=>cs_condition-true.
WHEN lif_ef_constants=>cs_change_mode-update OR
lif_ef_constants=>cs_change_mode-undefined.
rv_result = lcl_tools=>are_structures_different(
ir_data1 = lif_bo_reader~get_data(
is_app_object = is_app_object )
ir_data2 = lif_bo_reader~get_data_old(
is_app_object = is_app_object ) ).
ENDCASE.
ENDIF.
ENDMETHOD.
METHOD lif_bo_reader~get_data.
FIELD-SYMBOLS: <ls_item> TYPE ts_po_item.
rr_data = NEW ts_po_item( ).
ASSIGN rr_data->* TO <ls_item>.
fill_item_from_ekko_struct(
EXPORTING
ir_ekko = is_app_object-mastertabref
CHANGING
cs_po_item = <ls_item> ).
fill_item_from_ekpo_struct(
EXPORTING
ir_ekpo = is_app_object-maintabref
CHANGING
cs_po_item = <ls_item> ).
fill_item_from_eket_table(
EXPORTING
ir_ekpo = is_app_object-maintabref
ir_eket = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-po_sched_new )
CHANGING
cs_po_item = <ls_item> ).
fill_item_location_types(
CHANGING
cs_po_item = <ls_item> ).
ENDMETHOD.
METHOD lif_bo_reader~get_field_parameter.
CASE iv_parameter.
WHEN lif_ef_constants=>cs_parameter_id-key_field.
rv_result = boolc( iv_field_name = cs_mapping-deliv_num OR
iv_field_name = cs_mapping-sched_num ).
WHEN OTHERS.
CLEAR: rv_result.
ENDCASE.
ENDMETHOD.
METHOD lif_bo_reader~get_mapping_structure.
rr_data = REF #( cs_mapping ).
ENDMETHOD.
METHOD lif_bo_reader~get_track_id_data.
FIELD-SYMBOLS: <ls_ekpo> TYPE uekpo,
<lt_ekes> TYPE lif_app_types=>tt_uekes.
DATA(lv_tzone) = lcl_tools=>get_system_time_zone( ).
DATA(lr_ekes) = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-po_vend_conf_new ).
ASSIGN is_app_object-maintabref->* TO <ls_ekpo>.
CLEAR: et_track_id_data[].
IF <ls_ekpo> IS ASSIGNED.
et_track_id_data = VALUE #( (
appsys = mo_ef_parameters->get_appsys( )
appobjtype = is_app_object-appobjtype
appobjid = is_app_object-appobjid
trxcod = lif_app_constants=>cs_trxcod-po_position
trxid = |{ <ls_ekpo>-ebeln }{ <ls_ekpo>-ebelp }|
start_date = lcl_tools=>get_system_date_time( )
end_date = lif_ef_constants=>cv_max_end_date
timzon = lv_tzone
msrid = space
) ).
IF <ls_ekpo>-kz = lif_ef_constants=>cs_change_mode-insert.
et_track_id_data = VALUE #( BASE et_track_id_data (
appsys = mo_ef_parameters->get_appsys( )
appobjtype = is_app_object-appobjtype
appobjid = is_app_object-appobjid
trxcod = lif_app_constants=>cs_trxcod-po_number
trxid = |{ <ls_ekpo>-ebeln }|
start_date = lcl_tools=>get_system_date_time( )
end_date = lif_ef_constants=>cv_max_end_date
timzon = lv_tzone
msrid = space
) ).
ENDIF.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'EKPO' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD lif_bo_reader~get_data_old.
FIELD-SYMBOLS: <ls_item> TYPE ts_po_item.
DATA(lv_ebeln) = CONV ebeln( lcl_tools=>get_field_of_structure(
ir_struct_data = is_app_object-maintabref
iv_field_name = 'EBELN' ) ).
DATA(lv_ebelp) = CONV ebelp( lcl_tools=>get_field_of_structure(
ir_struct_data = is_app_object-maintabref
iv_field_name = 'EBELP' ) ).
DATA(lr_ekpo) = get_ekpo_record(
ir_ekpo = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-po_item_old )
iv_ebeln = lv_ebeln
iv_ebelp = lv_ebelp ).
rr_data = NEW ts_po_item( ).
ASSIGN rr_data->* TO <ls_item>.
fill_item_from_ekko_table(
EXPORTING
iv_ebeln = lv_ebeln
ir_ekko = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-po_header_old )
CHANGING
cs_po_item = <ls_item> ).
fill_item_from_ekpo_struct(
EXPORTING
ir_ekpo = lr_ekpo
CHANGING
cs_po_item = <ls_item> ).
fill_item_from_eket_table(
EXPORTING
ir_ekpo = lr_ekpo
ir_eket = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-po_sched_old )
CHANGING
cs_po_item = <ls_item> ).
fill_item_location_types(
CHANGING
cs_po_item = <ls_item> ).
ENDMETHOD.
METHOD is_object_changed.
rv_result = lcl_tools=>is_object_changed(
is_app_object = is_app_object
io_ef_parameters = mo_ef_parameters
it_check_tables = VALUE #( ( lif_app_constants=>cs_tabledef-po_sched_new )
( lif_app_constants=>cs_tabledef-po_sched_old ) )
iv_key_field = 'EBELN'
iv_upd_field = 'KZ' ).
ENDMETHOD.
ENDCLASS.
**********************************************************************
**********************************************************************
**********************************************************************
CLASS lcl_bo_reader_dl_header DEFINITION.
PUBLIC SECTION.
INTERFACES: lif_bo_reader.
METHODS constructor
IMPORTING
io_ef_parameters TYPE REF TO lif_ef_parameters.
PRIVATE SECTION.
TYPES: tv_item_num TYPE i,
tt_item_num TYPE STANDARD TABLE OF tv_item_num WITH EMPTY KEY.
TYPES: tv_item_posnr TYPE char20,
tt_item_posnr TYPE STANDARD TABLE OF tv_item_posnr WITH EMPTY KEY.
TYPES: BEGIN OF ts_dl_header,
vbeln TYPE likp-vbeln,
lifnr TYPE likp-lifnr,
lifnr_lt TYPE /saptrx/loc_id_type,
werks TYPE likp-werks,
werks_lt TYPE /saptrx/loc_id_type,
bldat TYPE likp-bldat,
lfdat TYPE likp-lfdat,
btgew TYPE likp-btgew,
ntgew TYPE likp-ntgew,
gewei TYPE likp-gewei,
volum TYPE likp-volum,
voleh TYPE likp-voleh,
lgnum TYPE likp-lgnum,
lgtor TYPE likp-lgtor,
lgnum_txt TYPE /saptrx/paramval200,
bolnr TYPE likp-bolnr,
proli TYPE likp-proli,
incov TYPE likp-incov,
inco1 TYPE likp-inco1,
inco2_l TYPE likp-inco2_l,
END OF ts_dl_header.
CONSTANTS: BEGIN OF cs_mapping,
" Header section
vbeln TYPE /saptrx/paramname VALUE 'YN_DL_DELEVERY',
lifnr TYPE /saptrx/paramname VALUE 'YN_DL_VENDOR_ID',
lifnr_lt TYPE /saptrx/paramname VALUE 'YN_DL_VENDOR_LOC_TYPE',
werks TYPE /saptrx/paramname VALUE 'YN_DL_RECEIVING_LOCATION',
werks_lt TYPE /saptrx/paramname VALUE 'YN_DL_RECEIVING_LOC_TYPE',
bldat TYPE /saptrx/paramname VALUE 'YN_DL_DOCUMENT_DATE',
lfdat TYPE /saptrx/paramname VALUE 'YN_DL_PLANNED_DLV_DATE',
btgew TYPE /saptrx/paramname VALUE 'YN_DL_TOTAL_WEIGHT',
ntgew TYPE /saptrx/paramname VALUE 'YN_DL_NET_WEIGHT',
gewei TYPE /saptrx/paramname VALUE 'YN_DL_WEIGHT_UNITS',
volum TYPE /saptrx/paramname VALUE 'YN_DL_VOLUME',
voleh TYPE /saptrx/paramname VALUE 'YN_DL_VOLUME_UNITS',
lgnum TYPE /saptrx/paramname VALUE 'YN_DL_WAREHOUSE',
lgnum_txt TYPE /saptrx/paramname VALUE 'YN_DL_WAREHOUSE_DESC',
lgtor TYPE /saptrx/paramname VALUE 'YN_DL_DOOR',
bolnr TYPE /saptrx/paramname VALUE 'YN_DL_BILL_OF_LADING',
proli TYPE /saptrx/paramname VALUE 'YN_DL_DANGEROUS_GOODS',
incov TYPE /saptrx/paramname VALUE 'YN_DL_INCOTERMS_VERSION',
inco1 TYPE /saptrx/paramname VALUE 'YN_DL_INCOTERMS',
inco2_l TYPE /saptrx/paramname VALUE 'YN_DL_INCOTERMS_LOCATION',
END OF cs_mapping.
DATA: mo_ef_parameters TYPE REF TO lif_ef_parameters.
METHODS fill_header_from_likp_struct
IMPORTING
ir_likp TYPE REF TO data
CHANGING
cs_dl_header TYPE ts_dl_header
RAISING
cx_udm_message.
METHODS fill_header_from_lips_table
IMPORTING
ir_lips_new TYPE REF TO data
ir_lips_old TYPE REF TO data OPTIONAL
iv_vbeln TYPE vbeln_vl
CHANGING
cs_dl_header TYPE ts_dl_header
RAISING
cx_udm_message.
METHODS fill_header_location_types
CHANGING
cs_dl_header TYPE ts_dl_header.
METHODS get_likp_struct_old
IMPORTING
is_app_object TYPE trxas_appobj_ctab_wa
iv_vbeln TYPE vbeln_vl
RETURNING
VALUE(rr_likp) TYPE REF TO data
RAISING
cx_udm_message.
METHODS is_object_changed
IMPORTING
is_app_object TYPE trxas_appobj_ctab_wa
RETURNING
VALUE(rv_result) TYPE abap_bool
RAISING
cx_udm_message.
ENDCLASS.
CLASS lcl_bo_reader_dl_header IMPLEMENTATION.
METHOD constructor.
mo_ef_parameters = io_ef_parameters.
ENDMETHOD.
METHOD fill_header_from_likp_struct.
FIELD-SYMBOLS: <ls_likp> TYPE likpvb.
ASSIGN ir_likp->* TO <ls_likp>.
IF <ls_likp> IS ASSIGNED.
MOVE-CORRESPONDING <ls_likp> TO cs_dl_header.
cs_dl_header-proli = boolc( cs_dl_header-proli IS NOT INITIAL ).
IF <ls_likp>-lgnum IS NOT INITIAL AND
<ls_likp>-lgtor IS NOT INITIAL.
TRY.
cs_dl_header-lgnum_txt = lcl_dl_tools=>get_door_description(
EXPORTING
iv_lgnum = <ls_likp>-lgnum
iv_lgtor = <ls_likp>-lgtor ).
CATCH cx_udm_message.
ENDTRY.
ENDIF.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'LIKP' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD fill_header_from_lips_table.
TYPES: tt_lips TYPE STANDARD TABLE OF lipsvb,
tt_posnr TYPE SORTED TABLE OF posnr_vl
WITH UNIQUE KEY table_line.
DATA: lt_posnr TYPE tt_posnr,
lv_dummy TYPE char100.
FIELD-SYMBOLS: <lt_lips> TYPE tt_lips,
<ls_lips> TYPE lipsvb.
ASSIGN ir_lips_new->* TO <lt_lips>.
" prepare positions list
IF <lt_lips> IS ASSIGNED.
" collect NEW records with appropriate item type
LOOP AT <lt_lips> ASSIGNING <ls_lips>
WHERE vbeln = iv_vbeln.
IF lcl_dl_tools=>is_appropriate_dl_item(
ir_struct = REF #( <ls_lips> ) ) = abap_true.
INSERT <ls_lips>-posnr INTO TABLE lt_posnr.
cs_dl_header-werks = COND #( WHEN cs_dl_header-werks IS INITIAL
THEN <ls_lips>-werks
ELSE cs_dl_header-werks ).
ENDIF.
ENDLOOP.
" process old table
IF ir_lips_old IS BOUND.
ASSIGN ir_lips_old->* TO <lt_lips>.
IF sy-subrc = 0.
LOOP AT <lt_lips> ASSIGNING <ls_lips>
WHERE vbeln = iv_vbeln.
" add deleted records
IF <ls_lips>-updkz = lif_ef_constants=>cs_change_mode-insert.
INSERT <ls_lips>-posnr INTO TABLE lt_posnr.
" remove inserted records
ELSEIF <ls_lips>-updkz = lif_ef_constants=>cs_change_mode-delete.
READ TABLE lt_posnr TRANSPORTING NO FIELDS
WITH KEY table_line = <ls_lips>-posnr.
IF sy-subrc = 0.
DELETE lt_posnr INDEX sy-tabix.
ENDIF.
ENDIF.
ENDLOOP.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'LIPS OLD' INTO lv_dummy.
lcl_tools=>throw_exception( ).
ENDIF.
ENDIF.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'LIPS NEW' INTO lv_dummy.
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD fill_header_location_types.
cs_dl_header-lifnr_lt = lif_ef_constants=>cs_loc_types-supplier.
IF cs_dl_header-werks IS NOT INITIAL.
cs_dl_header-werks_lt = lif_ef_constants=>cs_loc_types-plant.
ENDIF.
ENDMETHOD.
METHOD get_likp_struct_old.
" when header is unchanged, table 'DELIVERY_HEADER_OLD' is not populated
" so maintab record is used as data source for header data
TYPES: tt_likp TYPE STANDARD TABLE OF likpvb.
FIELD-SYMBOLS: <lt_likp> TYPE tt_likp,
<ls_likp> TYPE likpvb.
DATA(lr_likp) = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-dl_header_old ).
ASSIGN lr_likp->* TO <lt_likp>.
IF <lt_likp> IS ASSIGNED.
READ TABLE <lt_likp> ASSIGNING <ls_likp>
WITH KEY vbeln = iv_vbeln.
rr_likp = COND #( WHEN sy-subrc = 0
THEN REF #( <ls_likp> )
ELSE is_app_object-maintabref ).
ELSE.
MESSAGE e002(zpof_gtt) WITH 'LIKP' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD is_object_changed.
rv_result = lcl_tools=>is_object_changed(
is_app_object = is_app_object
io_ef_parameters = mo_ef_parameters
iv_key_field = 'VBELN'
iv_upd_field = 'UPDKZ' ).
ENDMETHOD.
METHOD lif_bo_reader~check_relevance.
rv_result = lif_ef_constants=>cs_condition-false.
IF lcl_dl_tools=>is_appropriate_dl_type( ir_struct = is_app_object-maintabref ) = abap_true AND
is_object_changed( is_app_object = is_app_object ) = abap_true.
CASE is_app_object-update_indicator.
WHEN lif_ef_constants=>cs_change_mode-insert.
rv_result = lif_ef_constants=>cs_condition-true.
WHEN lif_ef_constants=>cs_change_mode-update OR
lif_ef_constants=>cs_change_mode-undefined.
rv_result = lcl_tools=>are_structures_different(
ir_data1 = lif_bo_reader~get_data(
is_app_object = is_app_object )
ir_data2 = lif_bo_reader~get_data_old(
is_app_object = is_app_object ) ).
ENDCASE.
ENDIF.
ENDMETHOD.
METHOD lif_bo_reader~get_data.
FIELD-SYMBOLS: <ls_header> TYPE ts_dl_header.
rr_data = NEW ts_dl_header( ).
ASSIGN rr_data->* TO <ls_header>.
fill_header_from_likp_struct(
EXPORTING
ir_likp = is_app_object-maintabref
CHANGING
cs_dl_header = <ls_header> ).
fill_header_from_lips_table(
EXPORTING
ir_lips_new = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-dl_item_new )
ir_lips_old = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-dl_item_old )
iv_vbeln = <ls_header>-vbeln
CHANGING
cs_dl_header = <ls_header> ).
fill_header_location_types(
CHANGING
cs_dl_header = <ls_header> ).
ENDMETHOD.
METHOD lif_bo_reader~get_data_old.
FIELD-SYMBOLS: <ls_header> TYPE ts_dl_header.
DATA(lv_vbeln) = CONV vbeln_vl( lcl_tools=>get_field_of_structure(
ir_struct_data = is_app_object-maintabref
iv_field_name = 'VBELN' ) ).
rr_data = NEW ts_dl_header( ).
ASSIGN rr_data->* TO <ls_header>.
fill_header_from_likp_struct(
EXPORTING
ir_likp = get_likp_struct_old(
is_app_object = is_app_object
iv_vbeln = lv_vbeln )
CHANGING
cs_dl_header = <ls_header> ).
fill_header_from_lips_table(
EXPORTING
ir_lips_new = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-dl_item_new )
ir_lips_old = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-dl_item_old )
iv_vbeln = <ls_header>-vbeln
CHANGING
cs_dl_header = <ls_header> ).
fill_header_location_types(
CHANGING
cs_dl_header = <ls_header> ).
ENDMETHOD.
METHOD lif_bo_reader~get_field_parameter.
CLEAR: rv_result.
ENDMETHOD.
METHOD lif_bo_reader~get_mapping_structure.
rr_data = REF #( cs_mapping ).
ENDMETHOD.
METHOD lif_bo_reader~get_track_id_data.
"another tip is that: for tracking ID type 'SHIPMENT_ORDER' of delivery header,
"and for tracking ID type 'RESOURCE' of shipment header,
"DO NOT enable START DATE and END DATE
MESSAGE e004(zpof_gtt) WITH 'LCL_BO_READER_DL_HEADER'
INTO DATA(lv_dummy).
lcl_tools=>throw_exception(
iv_textid = lif_ef_constants=>cs_errors-stop_processing ).
ENDMETHOD.
ENDCLASS.
**********************************************************************
**********************************************************************
**********************************************************************
CLASS lcl_bo_reader_dl_item DEFINITION.
PUBLIC SECTION.
INTERFACES: lif_bo_reader.
METHODS constructor
IMPORTING
io_ef_parameters TYPE REF TO lif_ef_parameters.
PRIVATE SECTION.
TYPES: tv_posnr_txt TYPE char6,
tv_po_item TYPE char20.
TYPES: BEGIN OF ts_dl_item,
" Header section
vbeln TYPE lips-vbeln,
posnr TYPE tv_posnr_txt, "used char type to avoid leading zeros deletion
arktx TYPE lips-arktx,
matnr TYPE lips-matnr,
lfimg TYPE lips-lfimg,
vrkme TYPE lips-vrkme,
" Departure section
lifnr TYPE likp-lifnr,
lifnr_lt TYPE /saptrx/loc_id_type,
dep_addr TYPE /saptrx/paramval200,
dep_email TYPE /saptrx/paramval200,
dep_tel TYPE /saptrx/paramval200,
" Destination section
werks TYPE lips-werks,
werks_lt TYPE /saptrx/loc_id_type,
dest_addr TYPE /saptrx/paramval200,
lgnum TYPE lips-lgnum,
lgtor TYPE lips-lgtor,
lgnum_txt TYPE /saptrx/paramval200,
" Others
bldat TYPE likp-bldat,
lfdat TYPE likp-lfdat,
brgew TYPE lips-brgew,
ntgew TYPE lips-ntgew,
gewei TYPE likp-gewei,
volum TYPE lips-volum,
voleh TYPE lips-voleh,
bolnr TYPE likp-bolnr,
profl TYPE lips-profl,
incov TYPE likp-incov,
inco1 TYPE likp-inco1,
inco2_l TYPE likp-inco2_l,
po_item TYPE tv_po_item,
END OF ts_dl_item.
CONSTANTS: BEGIN OF cs_mapping,
" Header section
vbeln TYPE /saptrx/paramname VALUE 'YN_DL_DELEVERY',
posnr TYPE /saptrx/paramname VALUE 'YN_DL_DELEVERY_ITEM',
arktx TYPE /saptrx/paramname VALUE 'YN_DL_ITEM_DESCR',
matnr TYPE /saptrx/paramname VALUE 'YN_DL_MATERIAL_ID',
lfimg TYPE /saptrx/paramname VALUE 'YN_DL_ORDER_QUANT',
vrkme TYPE /saptrx/paramname VALUE 'YN_DL_ORDER_UNITS',
" Departure section
lifnr TYPE /saptrx/paramname VALUE 'YN_DL_VENDOR_ID',
lifnr_lt TYPE /saptrx/paramname VALUE 'YN_DL_VENDOR_LOC_TYPE',
dep_addr TYPE /saptrx/paramname VALUE 'YN_DL_DEPART_ADDRESS',
dep_email TYPE /saptrx/paramname VALUE 'YN_DL_DEPART_EMAIL',
dep_tel TYPE /saptrx/paramname VALUE 'YN_DL_DEPART_TEL',
" Destination section
werks TYPE /saptrx/paramname VALUE 'YN_DL_PLANT',
werks_lt TYPE /saptrx/paramname VALUE 'YN_DL_PLANT_LOC_TYPE',
dest_addr TYPE /saptrx/paramname VALUE 'YN_DL_DESTIN_ADDRESS',
lgnum TYPE /saptrx/paramname VALUE 'YN_DL_WAREHOUSE',
lgnum_txt TYPE /saptrx/paramname VALUE 'YN_DL_WAREHOUSE_DESC',
lgtor TYPE /saptrx/paramname VALUE 'YN_DL_DOOR',
" Others
bldat TYPE /saptrx/paramname VALUE 'YN_DL_DOCUMENT_DATE',
lfdat TYPE /saptrx/paramname VALUE 'YN_DL_PLANNED_DLV_DATE',
brgew TYPE /saptrx/paramname VALUE 'YN_DL_GROSS_WEIGHT',
ntgew TYPE /saptrx/paramname VALUE 'YN_DL_NET_WEIGHT',
gewei TYPE /saptrx/paramname VALUE 'YN_DL_WEIGHT_UNITS',
volum TYPE /saptrx/paramname VALUE 'YN_DL_VOLUME',
voleh TYPE /saptrx/paramname VALUE 'YN_DL_VOLUME_UNITS',
bolnr TYPE /saptrx/paramname VALUE 'YN_DL_BILL_OF_LADING',
profl TYPE /saptrx/paramname VALUE 'YN_DL_DANGEROUS_GOODS',
incov TYPE /saptrx/paramname VALUE 'YN_DL_INCOTERMS_VERSION',
inco1 TYPE /saptrx/paramname VALUE 'YN_DL_INCOTERMS',
inco2_l TYPE /saptrx/paramname VALUE 'YN_DL_INCOTERMS_LOCATION',
po_item TYPE /saptrx/paramname VALUE 'YN_DL_ASSOC_POITEM_NO',
END OF cs_mapping.
CONSTANTS: cv_posnr_empty TYPE posnr_vl VALUE '000000'.
DATA: mo_ef_parameters TYPE REF TO lif_ef_parameters.
METHODS fill_item_from_likp_struct
IMPORTING
ir_likp TYPE REF TO data
CHANGING
cs_dl_item TYPE ts_dl_item
RAISING
cx_udm_message.
METHODS fill_item_from_lips_struct
IMPORTING
ir_lips TYPE REF TO data
CHANGING
cs_dl_item TYPE ts_dl_item
RAISING
cx_udm_message.
METHODS fill_item_from_vbpa_table
IMPORTING
ir_vbpa TYPE REF TO data
iv_vbeln TYPE vbeln_vl
iv_posnr TYPE posnr_vl
CHANGING
cs_dl_item TYPE ts_dl_item
RAISING
cx_udm_message.
METHODS fill_item_location_types
CHANGING
cs_dl_item TYPE ts_dl_item.
METHODS get_likp_struct_old
IMPORTING
is_app_object TYPE trxas_appobj_ctab_wa
iv_vbeln TYPE vbeln_vl
RETURNING
VALUE(rr_likp) TYPE REF TO data
RAISING
cx_udm_message.
METHODS get_lips_struct_old
IMPORTING
is_app_object TYPE trxas_appobj_ctab_wa
iv_vbeln TYPE vbeln_vl
iv_posnr TYPE posnr_vl
RETURNING
VALUE(rr_lips) TYPE REF TO data
RAISING
cx_udm_message.
METHODS get_purchasing_order_item
IMPORTING
ir_lips TYPE REF TO data
RETURNING
VALUE(rv_po_item) TYPE tv_po_item
RAISING
cx_udm_message.
METHODS get_vbpa_table_old
IMPORTING
is_app_object TYPE trxas_appobj_ctab_wa
iv_vbeln TYPE vbeln_vl
iv_posnr TYPE posnr_vl
RETURNING
VALUE(rr_vbpa) TYPE REF TO data
RAISING
cx_udm_message.
METHODS is_object_changed
IMPORTING
is_app_object TYPE trxas_appobj_ctab_wa
RETURNING
VALUE(rv_result) TYPE abap_bool
RAISING
cx_udm_message.
ENDCLASS.
CLASS lcl_bo_reader_dl_item IMPLEMENTATION.
METHOD constructor.
mo_ef_parameters = io_ef_parameters.
ENDMETHOD.
METHOD fill_item_from_likp_struct.
FIELD-SYMBOLS: <ls_likp> TYPE likpvb.
ASSIGN ir_likp->* TO <ls_likp>.
IF <ls_likp> IS ASSIGNED.
MOVE-CORRESPONDING <ls_likp> TO cs_dl_item.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'LIKP' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD fill_item_from_lips_struct.
FIELD-SYMBOLS: <ls_lips> TYPE lipsvb.
DATA(lv_lgtor_old) = cs_dl_item-lgtor.
ASSIGN ir_lips->* TO <ls_lips>.
IF <ls_lips> IS ASSIGNED.
MOVE-CORRESPONDING <ls_lips> TO cs_dl_item.
cs_dl_item-profl = boolc( cs_dl_item-profl IS NOT INITIAL ).
cs_dl_item-lgtor = COND #( WHEN cs_dl_item-lgtor IS NOT INITIAL
THEN cs_dl_item-lgtor
ELSE lv_lgtor_old ).
TRY.
lcl_dl_tools=>get_addres_info(
EXPORTING
iv_addr_numb = lcl_dl_tools=>get_plant_address_number(
iv_werks = <ls_lips>-werks )
IMPORTING
ev_address = cs_dl_item-dest_addr ).
CATCH cx_udm_message.
ENDTRY.
IF cs_dl_item-lgnum IS NOT INITIAL AND
cs_dl_item-lgtor IS NOT INITIAL.
TRY.
cs_dl_item-lgnum_txt = lcl_dl_tools=>get_door_description(
EXPORTING
iv_lgnum = cs_dl_item-lgnum
iv_lgtor = cs_dl_item-lgtor ).
CATCH cx_udm_message.
ENDTRY.
ENDIF.
cs_dl_item-po_item = get_purchasing_order_item(
ir_lips = ir_lips ).
ELSE.
MESSAGE e002(zpof_gtt) WITH 'LIKP' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD fill_item_from_vbpa_table.
TYPES: tt_vbpa TYPE STANDARD TABLE OF vbpavb.
FIELD-SYMBOLS: <lt_vbpa> TYPE tt_vbpa,
<ls_vbpa> TYPE vbpavb,
<lv_addr_type> TYPE any.
ASSIGN ir_vbpa->* TO <lt_vbpa>.
IF <lt_vbpa> IS ASSIGNED.
READ TABLE <lt_vbpa> ASSIGNING <ls_vbpa>
WITH KEY vbeln = iv_vbeln
posnr = iv_posnr
parvw = lif_app_constants=>cs_parvw-supplier.
IF sy-subrc = 0.
ASSIGN COMPONENT 'ADDR_TYPE' OF STRUCTURE <ls_vbpa> TO <lv_addr_type>.
TRY.
lcl_dl_tools=>get_addres_info(
EXPORTING
iv_addr_type = COND #( WHEN <lv_addr_type> IS ASSIGNED AND
<lv_addr_type> IS NOT INITIAL
THEN <lv_addr_type>
ELSE lif_app_constants=>cs_adrtype-organization )
iv_addr_numb = <ls_vbpa>-adrnr
IMPORTING
ev_address = cs_dl_item-dep_addr
ev_email = cs_dl_item-dep_email
ev_telephone = cs_dl_item-dep_tel ).
CATCH cx_udm_message.
ENDTRY.
ENDIF.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'VBPA' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD fill_item_location_types.
cs_dl_item-lifnr_lt = lif_ef_constants=>cs_loc_types-supplier.
cs_dl_item-werks_lt = lif_ef_constants=>cs_loc_types-plant.
ENDMETHOD.
METHOD get_likp_struct_old.
" when header is unchanged, table 'DELIVERY_HEADER_OLD' is not populated
" so mastertab record is used as data source for header data
TYPES: tt_likp TYPE STANDARD TABLE OF likpvb.
FIELD-SYMBOLS: <lt_likp> TYPE tt_likp,
<ls_likp> TYPE likpvb.
DATA(lr_likp) = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-dl_header_old ).
ASSIGN lr_likp->* TO <lt_likp>.
IF <lt_likp> IS ASSIGNED.
READ TABLE <lt_likp> ASSIGNING <ls_likp>
WITH KEY vbeln = iv_vbeln.
rr_likp = COND #( WHEN sy-subrc = 0
THEN REF #( <ls_likp> )
ELSE is_app_object-mastertabref ).
ELSE.
MESSAGE e002(zpof_gtt) WITH 'LIKP' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD get_lips_struct_old.
" when item is unchanged, it is absent in table 'DELIVERY_ITEM_OLD'
" so maintab record is used as data source for item data
TYPES: tt_lips TYPE STANDARD TABLE OF lipsvb.
FIELD-SYMBOLS: <lt_lips> TYPE tt_lips,
<ls_lips> TYPE lipsvb.
DATA(lr_lips) = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-dl_item_old ).
ASSIGN lr_lips->* TO <lt_lips>.
IF <lt_lips> IS ASSIGNED.
READ TABLE <lt_lips> ASSIGNING <ls_lips>
WITH KEY vbeln = iv_vbeln
posnr = iv_posnr.
rr_lips = COND #( WHEN sy-subrc = 0
THEN REF #( <ls_lips> )
ELSE is_app_object-maintabref ).
ELSE.
MESSAGE e002(zpof_gtt) WITH 'LIPS' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD get_purchasing_order_item.
DATA(lv_ebeln) = CONV ebeln( lcl_tools=>get_field_of_structure(
ir_struct_data = ir_lips
iv_field_name = 'VGBEL' ) ).
DATA(lv_ebelp) = CONV ebelp( lcl_tools=>get_field_of_structure(
ir_struct_data = ir_lips
iv_field_name = 'VGPOS' ) ).
rv_po_item = |{ lv_ebeln }{ lv_ebelp }|.
ENDMETHOD.
METHOD get_vbpa_table_old.
" when partner data is unchanged, it is absent in table 'PARTNERS_OLD'
" so 'PARTNERS_NEW' is used as data source for partner data
TYPES: tt_vbpa TYPE STANDARD TABLE OF vbpavb.
FIELD-SYMBOLS: <lt_vbpa> TYPE tt_vbpa,
<ls_vbpa> TYPE vbpavb.
DATA(lr_vbpa) = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-dl_partners_old ).
ASSIGN lr_vbpa->* TO <lt_vbpa>.
IF <lt_vbpa> IS ASSIGNED.
READ TABLE <lt_vbpa> ASSIGNING <ls_vbpa>
WITH KEY vbeln = iv_vbeln
posnr = iv_posnr
parvw = lif_app_constants=>cs_parvw-supplier.
rr_vbpa = COND #( WHEN sy-subrc = 0
THEN lr_vbpa
ELSE mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-dl_partners_new ) ).
ELSE.
MESSAGE e002(zpof_gtt) WITH 'VBPA' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD is_object_changed.
rv_result = lcl_tools=>is_object_changed(
is_app_object = is_app_object
io_ef_parameters = mo_ef_parameters
it_check_tables = VALUE #( ( lif_app_constants=>cs_tabledef-dl_partners_new )
( lif_app_constants=>cs_tabledef-dl_partners_old ) )
iv_key_field = 'VBELN'
iv_upd_field = 'UPDKZ'
iv_chk_mastertab = abap_true ).
ENDMETHOD.
METHOD lif_bo_reader~check_relevance.
rv_result = lif_ef_constants=>cs_condition-false.
IF lcl_dl_tools=>is_appropriate_dl_type( ir_struct = is_app_object-mastertabref ) = abap_true AND
lcl_dl_tools=>is_appropriate_dl_item( ir_struct = is_app_object-maintabref ) = abap_true AND
is_object_changed( is_app_object = is_app_object ) = abap_true.
CASE is_app_object-update_indicator.
WHEN lif_ef_constants=>cs_change_mode-insert.
rv_result = lif_ef_constants=>cs_condition-true.
WHEN lif_ef_constants=>cs_change_mode-update OR
lif_ef_constants=>cs_change_mode-undefined.
rv_result = lcl_tools=>are_structures_different(
ir_data1 = lif_bo_reader~get_data(
is_app_object = is_app_object )
ir_data2 = lif_bo_reader~get_data_old(
is_app_object = is_app_object ) ).
ENDCASE.
ENDIF.
ENDMETHOD.
METHOD lif_bo_reader~get_data.
FIELD-SYMBOLS: <ls_item> TYPE ts_dl_item.
rr_data = NEW ts_dl_item( ).
ASSIGN rr_data->* TO <ls_item>.
fill_item_from_likp_struct(
EXPORTING
ir_likp = is_app_object-mastertabref
CHANGING
cs_dl_item = <ls_item> ).
fill_item_from_lips_struct(
EXPORTING
ir_lips = is_app_object-maintabref
CHANGING
cs_dl_item = <ls_item> ).
fill_item_from_vbpa_table(
EXPORTING
ir_vbpa = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-dl_partners_new )
iv_vbeln = <ls_item>-vbeln
iv_posnr = cv_posnr_empty
CHANGING
cs_dl_item = <ls_item> ).
fill_item_location_types(
CHANGING
cs_dl_item = <ls_item> ).
ENDMETHOD.
METHOD lif_bo_reader~get_data_old.
FIELD-SYMBOLS: <ls_item> TYPE ts_dl_item.
DATA(lv_vbeln) = CONV vbeln_vl( lcl_tools=>get_field_of_structure(
ir_struct_data = is_app_object-maintabref
iv_field_name = 'VBELN' ) ).
DATA(lv_posnr) = CONV posnr_vl( lcl_tools=>get_field_of_structure(
ir_struct_data = is_app_object-maintabref
iv_field_name = 'POSNR' ) ).
rr_data = NEW ts_dl_item( ).
ASSIGN rr_data->* TO <ls_item>.
fill_item_from_likp_struct(
EXPORTING
ir_likp = get_likp_struct_old(
is_app_object = is_app_object
iv_vbeln = lv_vbeln )
CHANGING
cs_dl_item = <ls_item> ).
fill_item_from_lips_struct(
EXPORTING
ir_lips = get_lips_struct_old(
is_app_object = is_app_object
iv_vbeln = lv_vbeln
iv_posnr = lv_posnr )
CHANGING
cs_dl_item = <ls_item> ).
fill_item_from_vbpa_table(
EXPORTING
ir_vbpa = get_vbpa_table_old(
is_app_object = is_app_object
iv_vbeln = lv_vbeln
iv_posnr = cv_posnr_empty )
iv_vbeln = lv_vbeln
iv_posnr = cv_posnr_empty
CHANGING
cs_dl_item = <ls_item> ).
fill_item_location_types(
CHANGING
cs_dl_item = <ls_item> ).
ENDMETHOD.
METHOD lif_bo_reader~get_field_parameter.
CLEAR: rv_result.
ENDMETHOD.
METHOD lif_bo_reader~get_mapping_structure.
rr_data = REF #( cs_mapping ).
ENDMETHOD.
METHOD lif_bo_reader~get_track_id_data.
"In ERP’s extractors, need to include 2 tracking IDs.
"The first one is for itself, one is for its header –
"please ensure same tracking ID type to be used in the
"Inbound Delivery Header process
DATA: lv_fname TYPE char5.
FIELD-SYMBOLS: <ls_lips> TYPE lipsvb.
" Actual Business Time zone
DATA(lv_tzone) = lcl_tools=>get_system_time_zone( ).
ASSIGN is_app_object-maintabref->* TO <ls_lips>.
IF <ls_lips> IS ASSIGNED.
et_track_id_data = VALUE #( (
appsys = mo_ef_parameters->get_appsys( )
appobjtype = is_app_object-appobjtype
appobjid = is_app_object-appobjid
trxcod = lif_app_constants=>cs_trxcod-dl_position
trxid = |{ <ls_lips>-vbeln }{ <ls_lips>-posnr }|
start_date = lcl_tools=>get_system_date_time( )
end_date = lif_ef_constants=>cv_max_end_date
timzon = lv_tzone
msrid = space
) ).
IF <ls_lips>-updkz = lif_ef_constants=>cs_change_mode-insert.
et_track_id_data = VALUE #( BASE et_track_id_data (
appsys = mo_ef_parameters->get_appsys( )
appobjtype = is_app_object-appobjtype
appobjid = is_app_object-appobjid
trxcod = lif_app_constants=>cs_trxcod-dl_number
trxid = |{ <ls_lips>-vbeln }|
start_date = lcl_tools=>get_system_date_time( )
end_date = lif_ef_constants=>cv_max_end_date
timzon = lv_tzone
msrid = space
) ).
ENDIF.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'LIPS' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
ENDCLASS.
**********************************************************************
**********************************************************************
**********************************************************************
CLASS lcl_bo_reader_sh_header DEFINITION.
PUBLIC SECTION.
INTERFACES: lif_bo_reader.
METHODS constructor
IMPORTING
io_ef_parameters TYPE REF TO lif_ef_parameters.
PRIVATE SECTION.
DATA: mo_ef_parameters TYPE REF TO lif_ef_parameters.
TYPES: tt_trobj_res_id TYPE STANDARD TABLE OF lif_app_types=>tv_trobj_res_id WITH EMPTY KEY,
tt_trobj_res_val TYPE STANDARD TABLE OF lif_app_types=>tv_trobj_res_val WITH EMPTY KEY,
tt_resrc_cnt TYPE STANDARD TABLE OF lif_app_types=>tv_resrc_cnt WITH EMPTY KEY,
tt_resrc_tp_id TYPE STANDARD TABLE OF lif_app_types=>tv_resrc_tp_id WITH EMPTY KEY,
tt_crdoc_ref_typ TYPE STANDARD TABLE OF lif_app_types=>tv_crdoc_ref_typ WITH EMPTY KEY,
tt_crdoc_ref_val TYPE STANDARD TABLE OF lif_app_types=>tv_crdoc_ref_val WITH EMPTY KEY.
TYPES: BEGIN OF ts_sh_header,
tknum TYPE vttkvb-tknum,
bu_id_num TYPE /saptrx/paramval200,
cont_dg TYPE vttkvb-cont_dg,
tndr_trkid TYPE vttkvb-tndr_trkid,
ship_type TYPE lif_app_types=>tv_ship_type,
trans_mode TYPE lif_app_types=>tv_trans_mode,
departure_dt TYPE lif_app_types=>tv_departure_dt,
departure_tz TYPE lif_app_types=>tv_departure_tz,
departure_locid TYPE lif_app_types=>tv_locid,
departure_loctype TYPE lif_app_types=>tv_loctype,
arrival_dt TYPE lif_app_types=>tv_arrival_dt,
arrival_tz TYPE lif_app_types=>tv_arrival_tz,
arrival_locid TYPE lif_app_types=>tv_locid,
arrival_loctype TYPE lif_app_types=>tv_loctype,
tdlnr TYPE vttkvb-tdlnr,
deliv_cnt TYPE STANDARD TABLE OF lif_app_types=>tv_deliv_cnt WITH EMPTY KEY,
deliv_no TYPE STANDARD TABLE OF vbeln WITH EMPTY KEY,
trobj_res_id TYPE tt_trobj_res_id,
trobj_res_val TYPE tt_trobj_res_val,
resrc_cnt TYPE tt_resrc_cnt,
resrc_tp_id TYPE tt_resrc_tp_id,
crdoc_ref_typ TYPE tt_crdoc_ref_typ,
crdoc_ref_val TYPE tt_crdoc_ref_val,
stops_num TYPE STANDARD TABLE OF lif_app_types=>tv_stopnum WITH EMPTY KEY,
stops_stopid TYPE STANDARD TABLE OF lif_app_types=>tv_stopid WITH EMPTY KEY,
stops_stopcnt TYPE STANDARD TABLE OF lif_app_types=>tv_stopcnt WITH EMPTY KEY,
stops_loccat TYPE STANDARD TABLE OF lif_app_types=>tv_loccat WITH EMPTY KEY,
stops_loctype TYPE STANDARD TABLE OF lif_app_types=>tv_loctype WITH EMPTY KEY,
stops_locid TYPE STANDARD TABLE OF lif_app_types=>tv_locid WITH EMPTY KEY,
stops_lstelz_txt TYPE STANDARD TABLE OF lif_app_types=>tv_lstelz_txt WITH EMPTY KEY,
stops_kunablaz_txt TYPE STANDARD TABLE OF lif_app_types=>tv_kunablaz_txt WITH EMPTY KEY,
stops_lgortaz_txt TYPE STANDARD TABLE OF lif_app_types=>tv_lgortaz_txt WITH EMPTY KEY,
stops_lgnumaz TYPE STANDARD TABLE OF lif_app_types=>tv_lgnumaz WITH EMPTY KEY,
stops_toraz TYPE STANDARD TABLE OF lif_app_types=>tv_toraz WITH EMPTY KEY,
stops_lgtraz_txt TYPE STANDARD TABLE OF lif_app_types=>tv_lgtraz_txt WITH EMPTY KEY,
stops_tsrfo TYPE STANDARD TABLE OF lif_app_types=>tv_tsrfo WITH EMPTY KEY,
stops_pln_evt_dt TYPE STANDARD TABLE OF lif_app_types=>tv_pln_evt_datetime WITH EMPTY KEY,
stops_pln_evt_tz TYPE STANDARD TABLE OF lif_app_types=>tv_pln_evt_timezone WITH EMPTY KEY,
stpid_stopid TYPE STANDARD TABLE OF lif_app_types=>tv_stopid WITH EMPTY KEY,
stpid_stopcnt TYPE STANDARD TABLE OF lif_app_types=>tv_stopcnt WITH EMPTY KEY,
stpid_loctype TYPE STANDARD TABLE OF lif_app_types=>tv_loctype WITH EMPTY KEY,
stpid_locid TYPE STANDARD TABLE OF lif_app_types=>tv_locid WITH EMPTY KEY,
END OF ts_sh_header.
CONSTANTS: BEGIN OF cs_mapping,
tknum TYPE /saptrx/paramname VALUE 'YN_SHP_NO',
bu_id_num TYPE /saptrx/paramname VALUE 'YN_SHP_SA_LBN_ID',
cont_dg TYPE /saptrx/paramname VALUE 'YN_SHP_CONTAIN_DGOODS',
tndr_trkid TYPE /saptrx/paramname VALUE 'YN_SHP_FA_TRACKING_ID',
ship_type TYPE /saptrx/paramname VALUE 'YN_SHP_SHIPPING_TYPE',
trans_mode TYPE /saptrx/paramname VALUE 'YN_SHP_TRANSPORTATION_MODE',
departure_dt TYPE /saptrx/paramname VALUE 'YN_SHP_PLN_DEP_BUS_DATETIME',
departure_tz TYPE /saptrx/paramname VALUE 'YN_SHP_PLN_DEP_BUS_TIMEZONE',
departure_locid TYPE /saptrx/paramname VALUE 'YN_SHP_PLN_DEP_LOC_ID',
departure_loctype TYPE /saptrx/paramname VALUE 'YN_SHP_PLN_DEP_LOC_TYPE',
arrival_dt TYPE /saptrx/paramname VALUE 'YN_SHP_PLN_AR_BUS_DATETIME',
arrival_tz TYPE /saptrx/paramname VALUE 'YN_SHP_PLN_AR_BUS_TIMEZONE',
arrival_locid TYPE /saptrx/paramname VALUE 'YN_SHP_PLN_AR_LOC_ID',
arrival_loctype TYPE /saptrx/paramname VALUE 'YN_SHP_PLN_AR_LOC_TYPE',
tdlnr TYPE /saptrx/paramname VALUE 'YN_SHP_SA_ERP_ID',
deliv_cnt TYPE /saptrx/paramname VALUE 'YN_SHP_HDR_DLV_LINE_COUNT',
deliv_no TYPE /saptrx/paramname VALUE 'YN_SHP_HDR_DLV_NO',
trobj_res_id TYPE /saptrx/paramname VALUE 'YN_SHP_TRACKED_RESOURCE_ID',
trobj_res_val TYPE /saptrx/paramname VALUE 'YN_SHP_TRACKED_RESOURCE_VALUE',
resrc_cnt TYPE /saptrx/paramname VALUE 'YN_SHP_RESOURCE_TP_LINE_COUNT',
resrc_tp_id TYPE /saptrx/paramname VALUE 'YN_SHP_RESOURCE_TP_ID',
crdoc_ref_typ TYPE /saptrx/paramname VALUE 'YN_SHP_CARRIER_REF_TYPE',
crdoc_ref_val TYPE /saptrx/paramname VALUE 'YN_SHP_CARRIER_REF_VALUE',
stops_num TYPE /saptrx/paramname VALUE 'YN_SHP_LINE_COUNT',
stops_stopid TYPE /saptrx/paramname VALUE 'YN_SHP_STOP_ID',
stops_stopcnt TYPE /saptrx/paramname VALUE 'YN_SHP_ORDINAL_NO',
stops_loccat TYPE /saptrx/paramname VALUE 'YN_SHP_LOC_CATEGORY',
stops_loctype TYPE /saptrx/paramname VALUE 'YN_SHP_LOC_TYPE',
stops_locid TYPE /saptrx/paramname VALUE 'YN_SHP_LOC_ID',
stops_lstelz_txt TYPE /saptrx/paramname VALUE 'YN_SHP_LOADING_POINT',
stops_kunablaz_txt TYPE /saptrx/paramname VALUE 'YN_SHP_UNLOADING_POINT',
stops_lgortaz_txt TYPE /saptrx/paramname VALUE 'YN_SHP_STORAGE_LOCATION',
stops_lgnumaz TYPE /saptrx/paramname VALUE 'YN_SHP_WAREHOUSE_NO',
stops_toraz TYPE /saptrx/paramname VALUE 'YN_SHP_GATE_NO',
stops_lgtraz_txt TYPE /saptrx/paramname VALUE 'YN_SHP_GATE_TEXT',
stops_tsrfo TYPE /saptrx/paramname VALUE 'YN_SHP_STAGE_SEQUENCE',
stops_pln_evt_dt TYPE /saptrx/paramname VALUE 'YN_SHP_STOP_PLAN_DATETIME',
stops_pln_evt_tz TYPE /saptrx/paramname VALUE 'YN_SHP_STOP_PLAN_TIMEZONE',
stpid_stopid TYPE /saptrx/paramname VALUE 'YN_SHP_VP_STOP_ID',
stpid_stopcnt TYPE /saptrx/paramname VALUE 'YN_SHP_VP_STOP_ORD_NO',
stpid_loctype TYPE /saptrx/paramname VALUE 'YN_SHP_VP_STOP_LOC_TYPE',
stpid_locid TYPE /saptrx/paramname VALUE 'YN_SHP_VP_STOP_LOC_ID',
END OF cs_mapping.
METHODS fill_header_from_vttk
IMPORTING
ir_vttk TYPE REF TO data
iv_vttp_cnt TYPE i
CHANGING
cs_header TYPE ts_sh_header
RAISING
cx_udm_message.
METHODS fill_header_from_vttp
IMPORTING
ir_vttk TYPE REF TO data
ir_vttp TYPE REF TO data
CHANGING
cs_header TYPE ts_sh_header
RAISING
cx_udm_message.
METHODS fill_header_from_vtts
IMPORTING
ir_vttk TYPE REF TO data
ir_vttp TYPE REF TO data
ir_vtts TYPE REF TO data
ir_vtsp TYPE REF TO data OPTIONAL
CHANGING
cs_header TYPE ts_sh_header
RAISING
cx_udm_message.
METHODS fill_tracked_object_tables
IMPORTING
is_vttk TYPE vttkvb
EXPORTING
et_res_id TYPE tt_trobj_res_id
et_res_val TYPE tt_trobj_res_val.
METHODS fill_resource_tables
IMPORTING
is_vttk TYPE vttkvb
EXPORTING
et_ref_cnt TYPE tt_resrc_cnt
et_tp_id TYPE tt_resrc_tp_id.
METHODS fill_carrier_ref_doc_tables
IMPORTING
is_vttk TYPE vttkvb
EXPORTING
et_ref_typ TYPE tt_crdoc_ref_typ
et_ref_val TYPE tt_crdoc_ref_val.
METHODS get_forwarding_agent_id_number
IMPORTING
iv_tdlnr TYPE tdlnr
RETURNING
VALUE(rv_id_num) TYPE /saptrx/paramval200.
METHODS get_resource_tracking_id
IMPORTING
is_vttk TYPE vttkvb
RETURNING
VALUE(rv_tracking_id) TYPE /saptrx/trxid.
METHODS get_shippment_header
IMPORTING
is_app_object TYPE trxas_appobj_ctab_wa
ir_vttk TYPE REF TO data
RETURNING
VALUE(rr_vttk) TYPE REF TO data
RAISING
cx_udm_message.
METHODS get_shippment_item_count
IMPORTING
ir_vttp TYPE REF TO data
RETURNING
VALUE(rv_count) TYPE i
RAISING
cx_udm_message.
METHODS get_shippment_type
IMPORTING
iv_vsart TYPE clike
iv_vttp_cnt TYPE i
RETURNING
VALUE(rv_ship_type) TYPE lif_app_types=>tv_ship_type.
METHODS get_transportation_mode
IMPORTING
iv_vsart TYPE clike
RETURNING
VALUE(rv_trans_mode) TYPE lif_app_types=>tv_trans_mode.
METHODS is_object_changed
IMPORTING
is_app_object TYPE trxas_appobj_ctab_wa
RETURNING
VALUE(rv_result) TYPE abap_bool
RAISING
cx_udm_message.
ENDCLASS.
CLASS lcl_bo_reader_sh_header IMPLEMENTATION.
METHOD constructor.
mo_ef_parameters = io_ef_parameters.
ENDMETHOD.
METHOD fill_carrier_ref_doc_tables.
lcl_sh_tools=>get_carrier_reference_document(
EXPORTING
is_vttk = is_vttk
IMPORTING
ev_ref_typ = DATA(lv_ref_typ)
ev_ref_val = DATA(lv_ref_val) ).
IF lv_ref_typ IS NOT INITIAL AND lv_ref_val IS NOT INITIAL.
et_ref_typ = VALUE #( ( lv_ref_typ ) ).
et_ref_val = VALUE #( ( lv_ref_val ) ).
ELSE.
CLEAR: et_ref_typ[], et_ref_val[].
ENDIF.
ENDMETHOD.
METHOD fill_header_from_vttk.
FIELD-SYMBOLS: <ls_vttk> TYPE vttkvb.
ASSIGN ir_vttk->* TO <ls_vttk>.
IF sy-subrc = 0.
cs_header-tknum = <ls_vttk>-tknum.
cs_header-bu_id_num = get_forwarding_agent_id_number(
iv_tdlnr = <ls_vttk>-tdlnr ).
cs_header-cont_dg = <ls_vttk>-cont_dg.
cs_header-tndr_trkid = <ls_vttk>-tndr_trkid.
cs_header-ship_type = get_shippment_type(
iv_vsart = <ls_vttk>-vsart
iv_vttp_cnt = iv_vttp_cnt ).
cs_header-trans_mode = get_transportation_mode(
iv_vsart = <ls_vttk>-vsart ) .
cs_header-tdlnr = <ls_vttk>-tdlnr.
fill_tracked_object_tables(
EXPORTING
is_vttk = <ls_vttk>
IMPORTING
et_res_id = cs_header-trobj_res_id
et_res_val = cs_header-trobj_res_val ).
fill_resource_tables(
EXPORTING
is_vttk = <ls_vttk>
IMPORTING
et_ref_cnt = cs_header-resrc_cnt
et_tp_id = cs_header-resrc_tp_id ).
fill_carrier_ref_doc_tables(
EXPORTING
is_vttk = <ls_vttk>
IMPORTING
et_ref_typ = cs_header-crdoc_ref_typ
et_ref_val = cs_header-crdoc_ref_val ).
ELSE.
MESSAGE e002(zpof_gtt) WITH 'VTTK' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD fill_header_from_vttp.
TYPES: tt_vttp TYPE STANDARD TABLE OF vttpvb.
DATA: lv_count TYPE i VALUE 0.
FIELD-SYMBOLS: <ls_vttk> TYPE vttkvb,
<lt_vttp> TYPE tt_vttp.
ASSIGN ir_vttk->* TO <ls_vttk>.
ASSIGN ir_vttp->* TO <lt_vttp>.
IF sy-subrc = 0.
LOOP AT <lt_vttp> ASSIGNING FIELD-SYMBOL(<ls_vttp>)
WHERE tknum = <ls_vttk>-tknum.
ADD 1 TO lv_count.
APPEND lv_count TO cs_header-deliv_cnt.
APPEND <ls_vttp>-vbeln TO cs_header-deliv_no.
ENDLOOP.
ELSEIF <ls_vttk> IS NOT ASSIGNED.
MESSAGE e002(zpof_gtt) WITH 'VTTK' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ELSE.
MESSAGE e002(zpof_gtt) WITH 'VTTP' INTO lv_dummy.
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD fill_header_from_vtts.
TYPES: BEGIN OF ts_stop_id,
stopid TYPE lif_app_types=>tv_stopid,
stopcnt TYPE lif_app_types=>tv_stopcnt,
loctype TYPE lif_app_types=>tv_loctype,
locid TYPE lif_app_types=>tv_locid,
END OF ts_stop_id.
DATA(lv_tknum) = CONV tknum( lcl_tools=>get_field_of_structure(
ir_struct_data = ir_vttk
iv_field_name = 'TKNUM' ) ).
DATA: lt_vtts TYPE vttsvb_tab,
lt_stops TYPE lif_app_types=>tt_stops,
lt_stop_ids TYPE STANDARD TABLE OF ts_stop_id,
lv_datetime TYPE lif_app_types=>tv_pln_evt_datetime,
lv_count TYPE i.
FIELD-SYMBOLS: <lt_vttp> TYPE vttpvb_tab,
<lt_vtts> TYPE vttsvb_tab,
<lt_vtsp> TYPE vtspvb_tab.
ASSIGN ir_vtts->* TO <lt_vtts>.
ASSIGN ir_vttp->* TO <lt_vttp>.
ASSIGN ir_vtsp->* TO <lt_vtsp>.
IF <lt_vtts> IS ASSIGNED AND
<lt_vtsp> IS ASSIGNED AND
<lt_vttp> IS ASSIGNED.
lt_vtts[] = <lt_vtts>[].
SORT lt_vtts BY tsrfo.
lcl_sh_tools=>get_stops_from_shipment(
EXPORTING
iv_tknum = lv_tknum
it_vtts = lt_vtts
it_vtsp = <lt_vtsp>
it_vttp = <lt_vttp>
IMPORTING
et_stops = lt_stops ).
CLEAR: lv_count.
LOOP AT lt_stops ASSIGNING FIELD-SYMBOL(<ls_stops>).
ADD 1 TO lv_count.
APPEND lv_count TO cs_header-stops_num.
APPEND <ls_stops>-stopid TO cs_header-stops_stopid.
APPEND <ls_stops>-stopcnt TO cs_header-stops_stopcnt.
APPEND <ls_stops>-loccat TO cs_header-stops_loccat.
APPEND <ls_stops>-loctype TO cs_header-stops_loctype.
APPEND <ls_stops>-locid TO cs_header-stops_locid.
APPEND <ls_stops>-lstelz_txt TO cs_header-stops_lstelz_txt.
APPEND <ls_stops>-kunablaz_txt TO cs_header-stops_kunablaz_txt.
APPEND <ls_stops>-lgortaz_txt TO cs_header-stops_lgortaz_txt.
APPEND <ls_stops>-lgnumaz TO cs_header-stops_lgnumaz.
APPEND <ls_stops>-toraz TO cs_header-stops_toraz.
APPEND <ls_stops>-lgtraz_txt TO cs_header-stops_lgtraz_txt.
APPEND <ls_stops>-tsrfo TO cs_header-stops_tsrfo.
APPEND <ls_stops>-pln_evt_timezone TO cs_header-stops_pln_evt_tz.
lv_datetime = lcl_tools=>get_valid_datetime(
iv_timestamp = <ls_stops>-pln_evt_datetime ).
APPEND lv_datetime TO cs_header-stops_pln_evt_dt.
ENDLOOP.
SORT lt_stops BY stopid.
MOVE-CORRESPONDING lt_stops TO lt_stop_ids.
DELETE ADJACENT DUPLICATES FROM lt_stop_ids.
LOOP AT lt_stop_ids ASSIGNING FIELD-SYMBOL(<ls_stop_ids>).
APPEND <ls_stop_ids>-stopid TO cs_header-stpid_stopid.
APPEND <ls_stop_ids>-stopcnt TO cs_header-stpid_stopcnt.
APPEND <ls_stop_ids>-loctype TO cs_header-stpid_loctype.
APPEND <ls_stop_ids>-locid TO cs_header-stpid_locid.
ENDLOOP.
READ TABLE lt_stops ASSIGNING <ls_stops> INDEX 1.
IF sy-subrc = 0.
cs_header-departure_dt = lcl_tools=>convert_datetime_to_utc(
iv_datetime = <ls_stops>-pln_evt_datetime
iv_timezone = <ls_stops>-pln_evt_timezone ).
cs_header-departure_tz = <ls_stops>-pln_evt_timezone.
cs_header-departure_locid = <ls_stops>-locid.
cs_header-departure_loctype = <ls_stops>-loctype.
ENDIF.
READ TABLE lt_stops ASSIGNING <ls_stops> INDEX lines( lt_stops ).
IF sy-subrc = 0.
cs_header-arrival_dt = lcl_tools=>convert_datetime_to_utc(
iv_datetime = <ls_stops>-pln_evt_datetime
iv_timezone = <ls_stops>-pln_evt_timezone ).
cs_header-arrival_tz = <ls_stops>-pln_evt_timezone.
cs_header-arrival_locid = <ls_stops>-locid.
cs_header-arrival_loctype = <ls_stops>-loctype.
ENDIF.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'VTTS' INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD fill_resource_tables.
DATA(lv_res_tid) = get_resource_tracking_id(
is_vttk = is_vttk ).
IF lv_res_tid IS NOT INITIAL.
et_ref_cnt = VALUE #( ( 1 ) ).
et_tp_id = VALUE #( ( CONV #( lv_res_tid ) ) ).
ENDIF.
ENDMETHOD.
METHOD fill_tracked_object_tables.
IF is_vttk-exti1 IS NOT INITIAL AND
( is_vttk-vsart = '01' OR
is_vttk-vsart = '05' OR
is_vttk-vsart = '15' ).
et_res_id = VALUE #( ( 'NA' ) ).
et_res_val = VALUE #( ( is_vttk-exti1 ) ).
ELSEIF is_vttk-vsart = '04' AND
is_vttk-signi IS NOT INITIAL.
et_res_id = VALUE #( ( 'CONTAINER_ID' ) ).
et_res_val = VALUE #( ( is_vttk-signi ) ).
ELSE.
CLEAR: et_res_id[], et_res_val[].
ENDIF.
ENDMETHOD.
METHOD get_forwarding_agent_id_number.
DATA: lv_forward_agt TYPE bu_partner,
lt_bpdetail TYPE STANDARD TABLE OF bapibus1006_id_details.
CALL METHOD cl_site_bp_assignment=>select_bp_via_cvi_link
EXPORTING
i_lifnr = iv_tdlnr
IMPORTING
e_bp = lv_forward_agt.
CALL FUNCTION 'BAPI_IDENTIFICATIONDETAILS_GET'
EXPORTING
businesspartner = lv_forward_agt
TABLES
identificationdetail = lt_bpdetail.
READ TABLE lt_bpdetail ASSIGNING FIELD-SYMBOL(<ls_bpdetail>)
WITH KEY identificationtype = lif_app_constants=>cv_agent_id_type
BINARY SEARCH.
rv_id_num = COND #( WHEN sy-subrc = 0
THEN lif_app_constants=>cv_agent_id_prefix &&
<ls_bpdetail>-identificationnumber ).
ENDMETHOD.
METHOD get_resource_tracking_id.
rv_tracking_id = COND #(
WHEN is_vttk-exti1 IS NOT INITIAL AND
( is_vttk-vsart = '01' OR
is_vttk-vsart = '05' OR
is_vttk-vsart = '15' )
THEN |{ is_vttk-tknum }{ is_vttk-exti1 }|
WHEN is_vttk-signi IS NOT INITIAL AND
is_vttk-vsart = '04'
THEN |{ is_vttk-tknum }{ is_vttk-signi }|
).
ENDMETHOD.
METHOD get_shippment_header.
TYPES: tt_vttk TYPE STANDARD TABLE OF vttkvb.
FIELD-SYMBOLS: <lt_vttk> TYPE tt_vttk.
DATA(lv_tknum) = lcl_tools=>get_field_of_structure(
ir_struct_data = is_app_object-maintabref
iv_field_name = 'TKNUM' ).
ASSIGN ir_vttk->* TO <lt_vttk>.
IF <lt_vttk> IS ASSIGNED.
READ TABLE <lt_vttk> ASSIGNING FIELD-SYMBOL(<ls_vttk>)
WITH KEY tknum = lv_tknum.
IF sy-subrc = 0.
rr_vttk = REF #( <ls_vttk> ).
ELSE.
MESSAGE e005(zpof_gtt) WITH 'VTTK OLD' lv_tknum
INTO DATA(lv_dummy).
lcl_tools=>throw_exception( ).
ENDIF.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'VTTK' INTO lv_dummy.
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
METHOD get_shippment_item_count.
FIELD-SYMBOLS: <lt_vttp> TYPE ANY TABLE.
ASSIGN ir_vttp->* TO <lt_vttp>.
rv_count = lines( <lt_vttp> ).
ENDMETHOD.
METHOD get_shippment_type.
rv_ship_type = COND #( WHEN iv_vttp_cnt <= 1
THEN SWITCH #( iv_vsart
WHEN '01' THEN '18'
WHEN '04' THEN '3' )
ELSE SWITCH #( iv_vsart
WHEN '01' THEN '17'
WHEN '04' THEN '2' ) ).
ENDMETHOD.
METHOD get_transportation_mode.
rv_trans_mode = SWITCH #( iv_vsart
WHEN '04' THEN '01' "Sea
WHEN '03' THEN '02' "Rail
WHEN '01' THEN '03' "Road
WHEN '05' THEN '04' "Air
WHEN '15' THEN '04' "Air
WHEN '02' THEN '05' "Mail
WHEN '' THEN '00' "Not specified
ELSE '09'). "Not applicable
ENDMETHOD.
METHOD is_object_changed.
rv_result = lcl_tools=>is_object_changed(
is_app_object = is_app_object
io_ef_parameters = mo_ef_parameters
it_check_tables = VALUE #( ( lif_app_constants=>cs_tabledef-sh_item_new )
( lif_app_constants=>cs_tabledef-sh_item_new )
( lif_app_constants=>cs_tabledef-sh_stage_new )
( lif_app_constants=>cs_tabledef-sh_stage_old )
( lif_app_constants=>cs_tabledef-sh_item_stage_new )
( lif_app_constants=>cs_tabledef-sh_item_stage_old ) )
iv_key_field = 'TKNUM'
iv_upd_field = 'UPDKZ' ).
ENDMETHOD.
METHOD lif_bo_reader~check_relevance.
DATA(lr_vttp) = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-sh_item_new ).
rv_result = lif_ef_constants=>cs_condition-false.
IF lcl_sh_tools=>is_appropriate_type( ir_vttk = is_app_object-maintabref ) = abap_true AND
lcl_sh_tools=>is_delivery_assigned( ir_vttp = lr_vttp ) = abap_true AND
is_object_changed( is_app_object = is_app_object ) = abap_true.
CASE is_app_object-update_indicator.
WHEN lif_ef_constants=>cs_change_mode-insert.
rv_result = lif_ef_constants=>cs_condition-true.
WHEN lif_ef_constants=>cs_change_mode-update OR
lif_ef_constants=>cs_change_mode-undefined.
rv_result = lcl_tools=>are_structures_different(
ir_data1 = lif_bo_reader~get_data(
is_app_object = is_app_object )
ir_data2 = lif_bo_reader~get_data_old(
is_app_object = is_app_object ) ).
ENDCASE.
ENDIF.
ENDMETHOD.
METHOD lif_bo_reader~get_data.
FIELD-SYMBOLS: <ls_header> TYPE ts_sh_header.
rr_data = NEW ts_sh_header( ).
ASSIGN rr_data->* TO <ls_header>.
DATA(lr_vttp) = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-sh_item_new ).
fill_header_from_vttk(
EXPORTING
ir_vttk = is_app_object-maintabref
iv_vttp_cnt = get_shippment_item_count( ir_vttp = lr_vttp )
CHANGING
cs_header = <ls_header> ).
fill_header_from_vttp(
EXPORTING
ir_vttk = is_app_object-maintabref
ir_vttp = lr_vttp
CHANGING
cs_header = <ls_header> ).
fill_header_from_vtts(
EXPORTING
ir_vttk = is_app_object-maintabref
ir_vttp = lr_vttp
ir_vtts = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-sh_stage_new )
ir_vtsp = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-sh_item_stage_new )
CHANGING
cs_header = <ls_header> ).
ENDMETHOD.
METHOD lif_bo_reader~get_data_old.
FIELD-SYMBOLS: <ls_header> TYPE ts_sh_header.
DATA(lo_sh_data) = NEW lcl_sh_data_old(
io_ef_parameters = mo_ef_parameters ).
DATA(lr_vttk) = get_shippment_header(
is_app_object = is_app_object
ir_vttk = lo_sh_data->get_vttk( ) ).
rr_data = NEW ts_sh_header( ).
ASSIGN rr_data->* TO <ls_header>.
fill_header_from_vttk(
EXPORTING
ir_vttk = lr_vttk
iv_vttp_cnt = get_shippment_item_count(
ir_vttp = lo_sh_data->get_vttp( ) )
CHANGING
cs_header = <ls_header> ).
fill_header_from_vttp(
EXPORTING
ir_vttk = lr_vttk
ir_vttp = lo_sh_data->get_vttp( )
CHANGING
cs_header = <ls_header> ).
fill_header_from_vtts(
EXPORTING
ir_vttk = lr_vttk
ir_vttp = lo_sh_data->get_vttp( )
ir_vtts = lo_sh_data->get_vtts( )
ir_vtsp = lo_sh_data->get_vtsp( )
CHANGING
cs_header = <ls_header> ).
ENDMETHOD.
METHOD lif_bo_reader~get_field_parameter.
CASE iv_parameter.
WHEN lif_ef_constants=>cs_parameter_id-key_field.
rv_result = boolc( iv_field_name = cs_mapping-deliv_cnt OR
iv_field_name = cs_mapping-trobj_res_val OR
iv_field_name = cs_mapping-resrc_cnt OR
iv_field_name = cs_mapping-crdoc_ref_val OR
iv_field_name = cs_mapping-stops_num OR
iv_field_name = cs_mapping-stpid_stopcnt ).
WHEN lif_ef_constants=>cs_parameter_id-no_empty_tag.
rv_result = boolc( iv_field_name = cs_mapping-departure_dt OR
iv_field_name = cs_mapping-departure_tz OR
iv_field_name = cs_mapping-departure_locid OR
iv_field_name = cs_mapping-departure_loctype OR
iv_field_name = cs_mapping-arrival_dt OR
iv_field_name = cs_mapping-arrival_tz OR
iv_field_name = cs_mapping-arrival_locid OR
iv_field_name = cs_mapping-arrival_loctype ).
WHEN OTHERS.
CLEAR: rv_result.
ENDCASE.
ENDMETHOD.
METHOD lif_bo_reader~get_mapping_structure.
rr_data = REF #( cs_mapping ).
ENDMETHOD.
METHOD lif_bo_reader~get_track_id_data.
"another tip is that: for tracking ID type 'SHIPMENT_ORDER' of delivery header,
"and for tracking ID type 'RESOURCE' of shipment header,
"DO NOT enable START DATE and END DATE
DATA: lv_dummy TYPE string.
FIELD-SYMBOLS: <ls_vttk> TYPE vttkvb,
<ls_vttk_old> TYPE vttkvb.
ASSIGN is_app_object-maintabref->* TO <ls_vttk>.
IF <ls_vttk> IS ASSIGNED.
" SHIPMENT Tracking ID
et_track_id_data = VALUE #( (
appsys = mo_ef_parameters->get_appsys( )
appobjtype = is_app_object-appobjtype
appobjid = is_app_object-appobjid
trxcod = lif_app_constants=>cs_trxcod-sh_number
trxid = |{ <ls_vttk>-tknum }|
start_date = lcl_tools=>get_system_date_time( )
end_date = lif_ef_constants=>cv_max_end_date
timzon = lcl_tools=>get_system_time_zone( )
) ).
DATA(lv_res_tid_new) = get_resource_tracking_id(
is_vttk = <ls_vttk> ).
" is shipment created?
IF <ls_vttk>-updkz = lif_ef_constants=>cs_change_mode-insert AND
lv_res_tid_new IS NOT INITIAL.
" add RESOURCE Tracking ID for the new Shipment
et_track_id_data = VALUE #( BASE et_track_id_data (
appsys = mo_ef_parameters->get_appsys( )
appobjtype = is_app_object-appobjtype
appobjid = is_app_object-appobjid
trxcod = lif_app_constants=>cs_trxcod-sh_resource
trxid = lv_res_tid_new
) ).
" is shipment updated?
ELSEIF <ls_vttk>-updkz = lif_ef_constants=>cs_change_mode-update.
DATA(lr_vttk_old) = get_shippment_header(
is_app_object = is_app_object
ir_vttk = mo_ef_parameters->get_appl_table(
iv_tabledef = lif_app_constants=>cs_tabledef-sh_header_old ) ).
ASSIGN lr_vttk_old->* TO <ls_vttk_old>.
IF <ls_vttk_old> IS ASSIGNED.
DATA(lv_res_tid_old) = get_resource_tracking_id(
is_vttk = <ls_vttk_old> ).
" is RESOURCE Tracking ID changed?
IF lv_res_tid_old <> lv_res_tid_new.
" add new RESOURCE Tracking ID
IF lv_res_tid_new IS NOT INITIAL.
et_track_id_data = VALUE #( BASE et_track_id_data (
appsys = mo_ef_parameters->get_appsys( )
appobjtype = is_app_object-appobjtype
appobjid = is_app_object-appobjid
trxcod = lif_app_constants=>cs_trxcod-sh_resource
trxid = lv_res_tid_new
) ).
ENDIF.
" delete old RESOURCE Tracking ID
IF lv_res_tid_old IS NOT INITIAL.
et_track_id_data = VALUE #( BASE et_track_id_data (
appsys = mo_ef_parameters->get_appsys( )
appobjtype = is_app_object-appobjtype
appobjid = is_app_object-appobjid
trxcod = lif_app_constants=>cs_trxcod-sh_resource
trxid = lv_res_tid_old
action = lif_ef_constants=>cs_change_mode-delete
) ).
ENDIF.
ENDIF.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'VTTK' INTO lv_dummy.
lcl_tools=>throw_exception( ).
ENDIF.
ENDIF.
ELSE.
MESSAGE e002(zpof_gtt) WITH 'VTTK' INTO lv_dummy.
lcl_tools=>throw_exception( ).
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
10714,
1398,
6770,
532,
7320,
9515,
41969,
198,
9,
5,
10097,
30934,
9,
198,
198,
41358,
49836,
3868,
62,
1324,
62,
19199,
13,
198,
220,
24412,
47,
1546,
25,
40379,
62,
988,
7204,
41876,
1220,
82,
2373,
40914,
14,
3020,
62,
7501,
62,
71,
7109,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
256,
83,
62,
988,
7204,
41876,
49053,
9795,
43679,
3963,
40379,
62,
988,
7204,
13,
628,
220,
24412,
47,
1546,
25,
40379,
62,
518,
74,
7501,
41876,
334,
988,
7501,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
256,
83,
62,
518,
74,
7501,
41876,
49053,
9795,
43679,
3963,
40379,
62,
518,
74,
7501,
13,
628,
220,
24412,
47,
1546,
25,
40379,
62,
518,
7126,
41876,
334,
988,
316,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
256,
83,
62,
518,
7126,
41876,
49053,
9795,
43679,
3963,
40379,
62,
518,
7126,
13,
628,
220,
24412,
47,
1546,
25,
40379,
62,
518,
5209,
41876,
334,
988,
274,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
256,
83,
62,
518,
5209,
41876,
49053,
9795,
43679,
3963,
40379,
62,
518,
5209,
13,
628,
220,
24412,
47,
1546,
25,
40379,
62,
46965,
79,
85,
65,
41876,
4300,
79,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
256,
83,
62,
46965,
79,
85,
65,
41876,
49053,
9795,
43679,
3963,
40379,
62,
46965,
79,
85,
65,
13,
628,
220,
24412,
47,
1546,
25,
40379,
62,
75,
2419,
85,
65,
41876,
11914,
85,
65,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
256,
83,
62,
75,
2419,
85,
65,
41876,
49053,
9795,
43679,
3963,
40379,
62,
75,
2419,
85,
65,
13,
628,
220,
24412,
47,
1546,
25,
40379,
62,
85,
926,
74,
85,
65,
41876,
410,
926,
74,
85,
65,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
256,
83,
62,
85,
926,
74,
85,
65,
41876,
49053,
9795,
43679,
3963,
40379,
62,
85,
926,
74,
85,
65,
13,
628,
220,
24412,
47,
1546,
25,
40379,
62,
85,
29281,
85,
65,
41876,
410,
29281,
85,
65,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
256,
83,
62,
85,
29281,
85,
65,
41876,
49053,
9795,
43679,
3963,
40379,
62,
85,
29281,
85,
65,
13,
628,
220,
24412,
47,
1546,
25,
40379,
62,
36540,
912,
85,
65,
41876,
410,
83,
912,
85,
65,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
256,
83,
62,
36540,
912,
85,
65,
41876,
49053,
9795,
43679,
3963,
40379,
62,
36540,
912,
85,
65,
13,
628,
220,
24412,
47,
1546,
25,
40379,
62,
85,
912,
79,
85,
65,
41876,
410,
912,
79,
85,
65,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
256,
83,
62,
85,
912,
79,
85,
65,
41876,
49053,
9795,
43679,
3963,
40379,
62,
85,
912,
79,
85,
65,
13,
628,
220,
24412,
47,
1546,
25,
40379,
62,
76,
325,
70,
41876,
285,
325,
70,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
256,
83,
62,
76,
325,
70,
41876,
49053,
9795,
43679,
3963,
40379,
62,
76,
325,
70,
13,
628,
220,
24412,
47,
1546,
25,
31557,
62,
6720,
62,
4906,
220,
220,
220,
220,
220,
220,
220,
41876,
1149,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
7645,
62,
14171,
220,
220,
220,
220,
220,
220,
41876,
1149,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
10378,
433,
495,
62,
28664,
220,
220,
220,
220,
41876,
41033,
11,
220,
366,
10641,
1314,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
10378,
433,
495,
62,
22877,
220,
220,
220,
220,
41876,
640,
11340,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
283,
43171,
62,
28664,
220,
220,
220,
220,
220,
220,
41876,
41033,
11,
220,
366,
10641,
1314,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
283,
43171,
62,
22877,
220,
220,
220,
220,
220,
220,
41876,
640,
11340,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
12381,
452,
62,
66,
429,
220,
220,
220,
220,
220,
220,
220,
41876,
493,
19,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
83,
22609,
73,
62,
411,
62,
312,
220,
220,
220,
220,
41876,
1149,
1065,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
83,
22609,
73,
62,
411,
62,
2100,
220,
220,
220,
41876,
1149,
1238,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
411,
6015,
62,
66,
429,
220,
220,
220,
220,
220,
220,
220,
41876,
493,
19,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
411,
6015,
62,
34788,
62,
312,
220,
220,
220,
220,
220,
41876,
1149,
1270,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
66,
4372,
420,
62,
5420,
62,
28004,
220,
220,
220,
41876,
1149,
18,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
66,
4372,
420,
62,
5420,
62,
2100,
220,
220,
220,
41876,
256,
358,
81,
62,
2213,
38439,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
11338,
22510,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
493,
19,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
11338,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1149,
13381,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
11338,
66,
429,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
493,
19,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
17946,
9246,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
5439,
310,
2981,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1149,
1238,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
31557,
62,
17946,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1149,
940,
11,
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,
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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
] |
CLASS zcl_aoc_check_65 DEFINITION
PUBLIC
INHERITING FROM zcl_aoc_super_root
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor .
METHODS get_message_text
REDEFINITION .
METHODS run
REDEFINITION .
PROTECTED SECTION.
DATA ms_settings TYPE sci_s_naming_conventions_setup .
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_AOC_CHECK_65 IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
version = '001'.
position = '065'.
has_documentation = abap_true.
has_attributes = abap_true.
attributes_ok = abap_true.
add_obj_type( 'SSFO' ).
ENDMETHOD.
METHOD get_message_text.
CLEAR p_text.
CASE p_code.
WHEN '001'.
p_text = '&1'. "#EC NOTEXT
WHEN OTHERS.
super->get_message_text( EXPORTING p_test = p_test
p_code = p_code
IMPORTING p_text = p_text ).
ENDCASE.
ENDMETHOD.
METHOD run.
* abapOpenChecks
* https://github.com/larshp/abapOpenChecks
* MIT License
CONSTANTS: lc_text_module TYPE tdsftype VALUE 'T'.
DATA: lv_name TYPE tdsfname,
lx_check TYPE REF TO cx_ssf_fb_check,
ls_error LIKE LINE OF lx_check->error_table,
lo_sf TYPE REF TO cl_ssf_fb_smart_form.
IF object_type <> 'SSFO'.
RETURN.
ENDIF.
CREATE OBJECT lo_sf.
lv_name = object_name.
lo_sf->load( lv_name ).
IF lo_sf->header-formtype = lc_text_module.
RETURN.
ENDIF.
TRY.
lo_sf->check( abap_true ).
CATCH cx_ssf_fb_check INTO lx_check.
LOOP AT lx_check->error_table INTO ls_error WHERE class = 'E'.
inform( p_sub_obj_type = object_type
p_sub_obj_name = object_name
p_test = myname
p_kind = mv_errty
p_code = '001'
p_param_1 = ls_error-msg ).
ENDLOOP.
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
64,
420,
62,
9122,
62,
2996,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
64,
420,
62,
16668,
62,
15763,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
23772,
764,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
20500,
62,
5239,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
220,
220,
337,
36252,
50,
1057,
198,
220,
220,
220,
220,
220,
220,
220,
23848,
36,
20032,
17941,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
42865,
13845,
62,
33692,
41876,
20681,
62,
82,
62,
77,
3723,
62,
1102,
16593,
62,
40406,
764,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
32,
4503,
62,
50084,
62,
2996,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
2208,
3784,
41571,
273,
7,
6739,
628,
220,
220,
220,
2196,
220,
220,
220,
220,
796,
705,
8298,
4458,
198,
220,
220,
220,
2292,
220,
220,
220,
796,
705,
15,
2996,
4458,
628,
220,
220,
220,
468,
62,
22897,
341,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
468,
62,
1078,
7657,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
12608,
62,
482,
220,
796,
450,
499,
62,
7942,
13,
628,
220,
220,
220,
751,
62,
26801,
62,
4906,
7,
705,
5432,
6080,
6,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
20500,
62,
5239,
13,
628,
220,
220,
220,
30301,
1503,
279,
62,
5239,
13,
628,
220,
220,
220,
42001,
279,
62,
8189,
13,
198,
220,
220,
220,
220,
220,
42099,
705,
8298,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
5239,
796,
705,
5,
16,
4458,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
220,
220,
42099,
440,
4221,
4877,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2208,
3784,
1136,
62,
20500,
62,
5239,
7,
7788,
15490,
2751,
279,
62,
9288,
796,
279,
62,
9288,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
62,
8189,
796,
279,
62,
8189,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
279,
62,
5239,
796,
279,
62,
5239,
6739,
198,
220,
220,
220,
23578,
34,
11159,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1057,
13,
198,
198,
9,
450,
499,
11505,
7376,
4657,
198,
9,
3740,
1378,
12567,
13,
785,
14,
75,
5406,
79,
14,
397,
499,
11505,
7376,
4657,
198,
9,
17168,
13789,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
300,
66,
62,
5239,
62,
21412,
41876,
256,
9310,
701,
2981,
26173,
8924,
705,
51,
4458,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
3672,
220,
41876,
256,
9310,
69,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
87,
62,
9122,
41876,
4526,
37,
5390,
43213,
62,
824,
69,
62,
21855,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
18224,
34178,
48920,
3963,
300,
87,
62,
9122,
3784,
18224,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
28202,
220,
220,
220,
41876,
4526,
37,
5390,
537,
62,
824,
69,
62,
21855,
62,
27004,
62,
687,
13,
628,
198,
220,
220,
220,
16876,
2134,
62,
4906,
1279,
29,
705,
5432,
6080,
4458,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
2376,
62,
28202,
13,
198,
220,
220,
220,
300,
85,
62,
3672,
796,
2134,
62,
3672,
13,
198,
220,
220,
220,
2376,
62,
28202,
3784,
2220,
7,
300,
85,
62,
3672,
6739,
628,
220,
220,
220,
16876,
2376,
62,
28202,
3784,
25677,
12,
687,
4906,
796,
300,
66,
62,
5239,
62,
21412,
13,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
28202,
3784,
9122,
7,
450,
499,
62,
7942,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
824,
69,
62,
21855,
62,
9122,
39319,
300,
87,
62,
9122,
13,
198,
220,
220,
220,
220,
220,
220,
220,
17579,
3185,
5161,
300,
87,
62,
9122,
3784,
18224,
62,
11487,
39319,
43979,
62,
18224,
33411,
1398,
796,
705,
36,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4175,
7,
279,
62,
7266,
62,
26801,
62,
4906,
796,
2134,
62,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
62,
7266,
62,
26801,
62,
3672,
796,
2134,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
62,
9288,
220,
220,
220,
220,
220,
220,
220,
220,
796,
616,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
62,
11031,
220,
220,
220,
220,
220,
220,
220,
220,
796,
285,
85,
62,
8056,
774,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
62,
8189,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
8298,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
62,
17143,
62,
16,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
INTERFACE if_ixml_document PUBLIC.
INTERFACES if_ixml_node.
METHODS:
set_encoding
IMPORTING
encoding TYPE REF TO object,
set_standalone
IMPORTING
standalone TYPE abap_bool,
set_namespace_prefix
IMPORTING
prefix TYPE string,
append_child
IMPORTING
new_child TYPE REF TO if_ixml_node,
get_first_child
RETURNING
VALUE(child) TYPE REF TO if_ixml_node,
create_attribute_ns
IMPORTING
name TYPE string
prefix TYPE string OPTIONAL
RETURNING
VALUE(element) TYPE REF TO if_ixml_element,
create_element_ns
IMPORTING
name TYPE string
prefix TYPE string OPTIONAL
RETURNING
VALUE(element) TYPE REF TO if_ixml_element,
create_element
IMPORTING
name TYPE string
RETURNING
VALUE(element) TYPE REF TO if_ixml_element,
create_iterator_filtered
IMPORTING input TYPE any
RETURNING VALUE(val) TYPE REF TO if_ixml_node_iterator,
create_filter_and
IMPORTING
filter1 TYPE any
filter2 TYPE any
RETURNING
VALUE(val) TYPE any,
create_iterator
RETURNING VALUE(rval) TYPE REF TO if_ixml_node_iterator,
create_filter_node_type
IMPORTING typ TYPE string
RETURNING VALUE(val) TYPE any,
create_simple_element_ns
IMPORTING
name TYPE string
parent TYPE string
prefix TYPE string OPTIONAL
RETURNING VALUE(val) TYPE REF TO if_ixml_element,
create_filter_attribute
IMPORTING name TYPE string
RETURNING VALUE(val) TYPE any,
create_simple_element
IMPORTING
name TYPE string
parent TYPE string
RETURNING VALUE(val) TYPE REF TO if_ixml_element,
find_from_name
IMPORTING
name TYPE string
namespace TYPE string OPTIONAL
RETURNING
VALUE(element) TYPE REF TO if_ixml_element,
find_from_name_ns
IMPORTING
depth TYPE i OPTIONAL
name TYPE string
RETURNING
VALUE(element) TYPE REF TO if_ixml_element,
find_from_path
IMPORTING
path TYPE string
RETURNING
VALUE(val) TYPE REF TO if_ixml_element,
get_elements_by_tag_name_ns
IMPORTING
name TYPE string
namespace TYPE string
RETURNING VALUE(val) TYPE any,
get_elements_by_tag_name
IMPORTING
depth TYPE i OPTIONAL
name TYPE string
namespace TYPE string
RETURNING VALUE(val) TYPE any,
get_root RETURNING VALUE(node) TYPE REF TO if_ixml_node,
get_root_element RETURNING VALUE(root) TYPE REF TO if_ixml_element.
ENDINTERFACE. | [
41358,
49836,
611,
62,
844,
4029,
62,
22897,
44731,
13,
198,
220,
23255,
37,
2246,
1546,
611,
62,
844,
4029,
62,
17440,
13,
628,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
900,
62,
12685,
7656,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21004,
41876,
4526,
37,
5390,
2134,
11,
198,
220,
220,
220,
900,
62,
1481,
17749,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
27669,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
900,
62,
14933,
10223,
62,
40290,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21231,
41876,
4731,
11,
198,
220,
220,
220,
24443,
62,
9410,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
649,
62,
9410,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
17440,
11,
198,
220,
220,
220,
651,
62,
11085,
62,
9410,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
9410,
8,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
17440,
11,
198,
220,
220,
220,
2251,
62,
42348,
62,
5907,
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,
21231,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
30854,
8,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
11,
198,
220,
220,
220,
2251,
62,
30854,
62,
5907,
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,
21231,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
30854,
8,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
11,
198,
220,
220,
220,
2251,
62,
30854,
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,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
30854,
8,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
11,
198,
220,
220,
220,
2251,
62,
48727,
62,
10379,
4400,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
5128,
41876,
597,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
2100,
8,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
17440,
62,
48727,
11,
198,
220,
220,
220,
2251,
62,
24455,
62,
392,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
8106,
16,
41876,
597,
198,
220,
220,
220,
220,
220,
220,
220,
8106,
17,
41876,
597,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
2100,
8,
41876,
597,
11,
198,
220,
220,
220,
2251,
62,
48727,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
2100,
8,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
17440,
62,
48727,
11,
198,
220,
220,
220,
2251,
62,
24455,
62,
17440,
62,
4906,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
2170,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
2100,
8,
41876,
597,
11,
198,
220,
220,
220,
2251,
62,
36439,
62,
30854,
62,
5907,
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,
2560,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
21231,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
2100,
8,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
11,
198,
220,
220,
220,
2251,
62,
24455,
62,
42348,
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,
597,
11,
198,
220,
220,
220,
2251,
62,
36439,
62,
30854,
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,
2560,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
2100,
8,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
11,
198,
220,
220,
220,
1064,
62,
6738,
62,
3672,
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,
25745,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
30854,
8,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
11,
198,
220,
220,
220,
1064,
62,
6738,
62,
3672,
62,
5907,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
6795,
41876,
1312,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
30854,
8,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
11,
198,
220,
220,
220,
1064,
62,
6738,
62,
6978,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
3108,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
2100,
8,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
11,
198,
220,
220,
220,
651,
62,
68,
3639,
62,
1525,
62,
12985,
62,
3672,
62,
5907
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS ltcl_abapgit_tadir_mock DEFINITION FOR TESTING.
PUBLIC SECTION.
INTERFACES: zif_abapgit_tadir.
ENDCLASS.
CLASS ltcl_no_dependency_injection DEFINITION FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT.
PRIVATE SECTION.
METHODS:
no_injection FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_simple_dependency_inject DEFINITION FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT.
PRIVATE SECTION.
METHODS:
setup,
simple_injection FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_abapgit_tadir_mock IMPLEMENTATION.
METHOD zif_abapgit_tadir~get_object_package.
ENDMETHOD.
METHOD zif_abapgit_tadir~read.
ENDMETHOD.
METHOD zif_abapgit_tadir~read_single.
ENDMETHOD.
ENDCLASS.
CLASS ltcl_no_dependency_injection IMPLEMENTATION.
METHOD no_injection.
DATA: lo_tadir TYPE REF TO zif_abapgit_tadir,
lo_class_descr TYPE REF TO cl_abap_classdescr.
lo_tadir = zcl_abapgit_factory=>get_tadir( ).
lo_class_descr ?= cl_abap_classdescr=>describe_by_object_ref( lo_tadir ).
cl_abap_unit_assert=>assert_equals(
exp = '\CLASS=ZCL_ABAPGIT_TADIR'
act = lo_class_descr->absolute_name ).
ENDMETHOD.
ENDCLASS.
CLASS ltcl_simple_dependency_inject IMPLEMENTATION.
METHOD setup.
DATA: lo_tadir_mock TYPE REF TO ltcl_abapgit_tadir_mock.
CREATE OBJECT lo_tadir_mock.
zcl_abapgit_injector=>set_tadir( lo_tadir_mock ).
ENDMETHOD.
METHOD simple_injection.
DATA: lo_tadir TYPE REF TO zif_abapgit_tadir,
lo_class_descr TYPE REF TO cl_abap_classdescr.
lo_tadir = zcl_abapgit_factory=>get_tadir( ).
lo_class_descr ?= cl_abap_classdescr=>describe_by_object_ref( lo_tadir ).
cl_abap_unit_assert=>assert_equals(
exp = '\CLASS-POOL=ZCL_ABAPGIT_INJECTOR\CLASS=LTCL_ABAPGIT_TADIR_MOCK'
act = lo_class_descr->absolute_name ).
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
83,
565,
62,
397,
499,
18300,
62,
83,
324,
343,
62,
76,
735,
5550,
20032,
17941,
7473,
43001,
2751,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
25,
1976,
361,
62,
397,
499,
18300,
62,
83,
324,
343,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
3919,
62,
45841,
1387,
62,
259,
29192,
5550,
20032,
17941,
7473,
43001,
2751,
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,
45698,
42,
49277,
43638,
5805,
7597,
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,
360,
4261,
6234,
6006,
9863,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
645,
62,
259,
29192,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
36439,
62,
45841,
1387,
62,
259,
752,
5550,
20032,
17941,
7473,
43001,
2751,
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,
45698,
42,
49277,
43638,
5805,
7597,
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,
360,
4261,
6234,
6006,
9863,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
220,
220,
2829,
62,
259,
29192,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
397,
499,
18300,
62,
83,
324,
343,
62,
76,
735,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
83,
324,
343,
93,
1136,
62,
15252,
62,
26495,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
83,
324,
343,
93,
961,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
83,
324,
343,
93,
961,
62,
29762,
13,
628,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
3919,
62,
45841,
1387,
62,
259,
29192,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
645,
62,
259,
29192,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
83,
324,
343,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
83,
324,
343,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
4871,
62,
20147,
81,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
4871,
20147,
81,
13,
628,
220,
220,
220,
2376,
62,
83,
324,
343,
796,
1976,
565,
62,
397,
499,
18300,
62,
69,
9548,
14804,
1136,
62,
83,
324,
343,
7,
6739,
628,
220,
220,
220,
2376,
62,
4871,
62,
20147,
81,
5633,
28,
537,
62,
397,
499,
62,
4871,
20147,
81,
14804,
20147,
4892,
62,
1525,
62,
15252,
62,
5420,
7,
2376,
62,
83,
324,
343,
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,
1033,
796,
705,
59,
31631,
28,
57,
5097,
62,
6242,
2969,
38,
2043,
62,
51,
2885,
4663,
6,
198,
220,
220,
220,
220,
220,
719,
796,
2376,
62,
4871,
62,
20147,
81,
3784,
48546,
62,
3672,
6739,
628,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
36439,
62,
45841,
1387,
62,
259,
752,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
9058,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
83,
324,
343,
62,
76,
735,
220,
41876,
4526,
37,
5390,
300,
83,
565,
62,
397,
499,
18300,
62,
83,
324,
343,
62,
76,
735,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
2376,
62,
83,
324,
343,
62,
76,
735,
13,
628,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
259,
752,
273,
14804,
2617,
62,
83,
324,
343,
7,
2376,
62,
83,
324,
343,
62,
76,
735,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
2829,
62,
259,
29192,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
83,
324,
343,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
83,
324,
343,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
4871,
62,
20147,
81,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
4871,
20147,
81,
13,
628,
220,
220,
220,
2376,
62,
83,
324,
343,
796,
1976,
565,
62,
397,
499,
18300,
62,
69,
9548,
14804,
1136,
62,
83,
324,
343,
7,
6739,
628,
220,
220,
220,
2376,
62,
4871,
62,
20147,
81,
5633,
28,
537,
62,
397,
499,
62,
4871,
20147,
81,
14804,
20147,
4892,
62,
1525,
62,
15252,
62,
5420,
7,
2376,
62,
83,
324,
343,
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,
1033,
796,
705,
59,
31631,
12,
16402,
3535,
28,
57,
5097,
62,
6242,
2969,
38,
2043,
62,
1268,
23680,
1581,
59,
31631,
28,
43,
4825,
43,
62,
6242,
2969,
38,
2043,
62,
51,
2885,
4663,
62,
44,
11290,
6,
198,
220,
220,
220,
220,
220,
719,
796,
2376,
62,
4871,
62,
20147,
81,
3784,
48546,
62,
3672,
6739,
628,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_objects_program DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super.
PUBLIC SECTION.
TYPES: BEGIN OF ty_progdir,
name TYPE progdir-name,
state TYPE progdir-state,
sqlx TYPE progdir-sqlx,
edtx TYPE progdir-edtx,
varcl TYPE progdir-varcl,
dbapl TYPE progdir-dbapl,
dbna TYPE progdir-dbna,
clas TYPE progdir-clas,
type TYPE progdir-type,
occurs TYPE progdir-occurs,
subc TYPE progdir-subc,
appl TYPE progdir-appl,
secu TYPE progdir-secu,
cnam TYPE progdir-cnam,
cdat TYPE progdir-cdat,
unam TYPE progdir-unam,
udat TYPE progdir-udat,
vern TYPE progdir-vern,
levl TYPE progdir-levl,
rstat TYPE progdir-rstat,
rmand TYPE progdir-rmand,
rload TYPE progdir-rload,
fixpt TYPE progdir-fixpt,
sset TYPE progdir-sset,
sdate TYPE progdir-sdate,
stime TYPE progdir-stime,
idate TYPE progdir-idate,
itime TYPE progdir-itime,
ldbname TYPE progdir-ldbname,
uccheck TYPE progdir-uccheck,
END OF ty_progdir.
METHODS serialize_program
IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_output OPTIONAL
is_item TYPE zif_abapgit_definitions=>ty_item
io_files TYPE REF TO zcl_abapgit_objects_files
iv_program TYPE programm OPTIONAL
iv_extra TYPE clike OPTIONAL
RAISING zcx_abapgit_exception.
METHODS read_progdir
IMPORTING iv_program TYPE programm
RETURNING VALUE(rs_progdir) TYPE ty_progdir.
METHODS deserialize_program
IMPORTING is_progdir TYPE ty_progdir
it_source TYPE abaptxt255_tab
it_tpool TYPE textpool_table
iv_package TYPE devclass
RAISING zcx_abapgit_exception.
PROTECTED SECTION.
TYPES: ty_spaces_tt TYPE STANDARD TABLE OF i WITH DEFAULT KEY.
TYPES: BEGIN OF ty_dynpro,
header TYPE rpy_dyhead,
containers TYPE dycatt_tab,
fields TYPE dyfatc_tab,
flow_logic TYPE swydyflow,
spaces TYPE ty_spaces_tt,
END OF ty_dynpro.
TYPES: ty_dynpro_tt TYPE STANDARD TABLE OF ty_dynpro WITH DEFAULT KEY.
TYPES: BEGIN OF ty_cua,
adm TYPE rsmpe_adm,
sta TYPE STANDARD TABLE OF rsmpe_stat WITH DEFAULT KEY,
fun TYPE STANDARD TABLE OF rsmpe_funt WITH DEFAULT KEY,
men TYPE STANDARD TABLE OF rsmpe_men WITH DEFAULT KEY,
mtx TYPE STANDARD TABLE OF rsmpe_mnlt WITH DEFAULT KEY,
act TYPE STANDARD TABLE OF rsmpe_act WITH DEFAULT KEY,
but TYPE STANDARD TABLE OF rsmpe_but WITH DEFAULT KEY,
pfk TYPE STANDARD TABLE OF rsmpe_pfk WITH DEFAULT KEY,
set TYPE STANDARD TABLE OF rsmpe_staf WITH DEFAULT KEY,
doc TYPE STANDARD TABLE OF rsmpe_atrt WITH DEFAULT KEY,
tit TYPE STANDARD TABLE OF rsmpe_titt WITH DEFAULT KEY,
biv TYPE STANDARD TABLE OF rsmpe_buts WITH DEFAULT KEY,
END OF ty_cua.
METHODS serialize_dynpros
IMPORTING iv_program_name TYPE programm
RETURNING VALUE(rt_dynpro) TYPE ty_dynpro_tt
RAISING zcx_abapgit_exception.
METHODS serialize_cua
IMPORTING iv_program_name TYPE programm
RETURNING VALUE(rs_cua) TYPE ty_cua
RAISING zcx_abapgit_exception.
METHODS deserialize_dynpros
IMPORTING it_dynpros TYPE ty_dynpro_tt
RAISING zcx_abapgit_exception.
METHODS deserialize_textpool
IMPORTING iv_program TYPE programm
it_tpool TYPE textpool_table
iv_language TYPE langu OPTIONAL
iv_is_include TYPE abap_bool DEFAULT abap_false
RAISING zcx_abapgit_exception.
METHODS deserialize_cua
IMPORTING iv_program_name TYPE programm
is_cua TYPE ty_cua
RAISING zcx_abapgit_exception.
METHODS check_prog_changed_since
IMPORTING iv_program TYPE programm
iv_timestamp TYPE timestamp
iv_skip_gui TYPE abap_bool DEFAULT abap_false
RETURNING VALUE(rv_changed) TYPE abap_bool.
METHODS is_any_dynpro_locked
IMPORTING iv_program TYPE programm
RETURNING VALUE(rv_is_any_dynpro_locked) TYPE abap_bool
RAISING zcx_abapgit_exception.
METHODS is_cua_locked
IMPORTING iv_program TYPE programm
RETURNING VALUE(rv_is_cua_locked) TYPE abap_bool
RAISING zcx_abapgit_exception.
METHODS is_text_locked
IMPORTING iv_program TYPE programm
RETURNING VALUE(rv_is_text_locked) TYPE abap_bool
RAISING zcx_abapgit_exception.
CLASS-METHODS:
add_tpool
IMPORTING it_tpool TYPE textpool_table
RETURNING VALUE(rt_tpool) TYPE zif_abapgit_definitions=>ty_tpool_tt,
read_tpool
IMPORTING it_tpool TYPE zif_abapgit_definitions=>ty_tpool_tt
RETURNING VALUE(rt_tpool) TYPE zif_abapgit_definitions=>ty_tpool_tt.
PRIVATE SECTION.
METHODS:
condense_flow
EXPORTING et_spaces TYPE ty_spaces_tt
CHANGING ct_flow TYPE swydyflow,
uncondense_flow
IMPORTING it_flow TYPE swydyflow
it_spaces TYPE ty_spaces_tt
RETURNING VALUE(rt_flow) TYPE swydyflow.
CLASS-METHODS auto_correct_cua_adm
IMPORTING
is_cua TYPE zcl_abapgit_objects_program=>ty_cua
CHANGING
cs_adm TYPE rsmpe_adm.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECTS_PROGRAM IMPLEMENTATION.
METHOD add_tpool.
FIELD-SYMBOLS: <ls_tpool_in> LIKE LINE OF it_tpool,
<ls_tpool_out> LIKE LINE OF rt_tpool.
LOOP AT it_tpool ASSIGNING <ls_tpool_in>.
APPEND INITIAL LINE TO rt_tpool ASSIGNING <ls_tpool_out>.
MOVE-CORRESPONDING <ls_tpool_in> TO <ls_tpool_out>.
IF <ls_tpool_out>-id = 'S'.
<ls_tpool_out>-split = <ls_tpool_out>-entry.
<ls_tpool_out>-entry = <ls_tpool_out>-entry+8.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD auto_correct_cua_adm.
" issue #1807 automatic correction of CUA interfaces saved incorrectly in the past (ADM was not saved in the XML)
FIELD-SYMBOLS:
<ls_pfk> TYPE rsmpe_pfk,
<ls_act> TYPE rsmpe_act,
<ls_men> TYPE rsmpe_men.
IF cs_adm IS NOT INITIAL.
RETURN.
ENDIF.
LOOP AT is_cua-act ASSIGNING <ls_act>.
IF <ls_act>-code+6(14) IS INITIAL AND <ls_act>-code(6) CO '0123456789'.
cs_adm-actcode = <ls_act>-code.
ENDIF.
ENDLOOP.
LOOP AT is_cua-men ASSIGNING <ls_men>.
IF <ls_men>-code+6(14) IS INITIAL AND <ls_men>-code(6) CO '0123456789'.
cs_adm-mencode = <ls_men>-code.
ENDIF.
ENDLOOP.
LOOP AT is_cua-pfk ASSIGNING <ls_pfk>.
IF <ls_pfk>-code+6(14) IS INITIAL AND <ls_pfk>-code(6) CO '0123456789'.
cs_adm-pfkcode = <ls_pfk>-code.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD check_prog_changed_since.
DATA: lv_date TYPE dats,
lv_time TYPE tims,
lt_screens TYPE STANDARD TABLE OF d020s,
lt_eudb TYPE STANDARD TABLE OF eudb.
FIELD-SYMBOLS: <ls_screen> LIKE LINE OF lt_screens,
<ls_eudb> LIKE LINE OF lt_eudb.
SELECT SINGLE udat utime FROM reposrc " Program
INTO (lv_date, lv_time)
WHERE progname = iv_program
AND r3state = 'A'.
rv_changed = check_timestamp(
iv_timestamp = iv_timestamp
iv_date = lv_date
iv_time = lv_time ).
IF rv_changed = abap_true.
RETURN.
ENDIF.
SELECT SINGLE udat utime FROM repotext " Program text pool
INTO (lv_date, lv_time)
WHERE progname = iv_program
AND r3state = 'A'.
IF sy-subrc = 0. " Text not found ? Assuming no changes, see #404
rv_changed = check_timestamp(
iv_timestamp = iv_timestamp
iv_date = lv_date
iv_time = lv_time ).
IF rv_changed = abap_true.
RETURN.
ENDIF.
ENDIF.
IF iv_skip_gui = abap_true.
RETURN.
ENDIF.
SELECT dgen tgen FROM d020s " Screens
INTO CORRESPONDING FIELDS OF TABLE lt_screens
WHERE prog = iv_program
ORDER BY PRIMARY KEY ##TOO_MANY_ITAB_FIELDS. "#EC CI_SUBRC
LOOP AT lt_screens ASSIGNING <ls_screen>.
rv_changed = check_timestamp(
iv_timestamp = iv_timestamp
iv_date = <ls_screen>-dgen
iv_time = <ls_screen>-tgen ).
IF rv_changed = abap_true.
RETURN.
ENDIF.
ENDLOOP.
SELECT vdatum vzeit FROM eudb " GUI
INTO CORRESPONDING FIELDS OF TABLE lt_eudb
WHERE relid = 'CU'
AND name = iv_program
AND srtf2 = 0
ORDER BY PRIMARY KEY ##TOO_MANY_ITAB_FIELDS. "#EC CI_SUBRC
LOOP AT lt_eudb ASSIGNING <ls_eudb>.
rv_changed = check_timestamp(
iv_timestamp = iv_timestamp
iv_date = <ls_eudb>-vdatum
iv_time = <ls_eudb>-vzeit ).
IF rv_changed = abap_true.
RETURN.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD condense_flow.
DATA: lv_spaces LIKE LINE OF et_spaces.
FIELD-SYMBOLS: <ls_flow> LIKE LINE OF ct_flow.
CLEAR et_spaces.
LOOP AT ct_flow ASSIGNING <ls_flow>.
lv_spaces = 0.
WHILE NOT <ls_flow>-line IS INITIAL AND <ls_flow>-line(1) = space.
lv_spaces = lv_spaces + 1.
<ls_flow>-line = <ls_flow>-line+1.
ENDWHILE.
APPEND lv_spaces TO et_spaces.
ENDLOOP.
ENDMETHOD.
METHOD deserialize_cua.
DATA: ls_tr_key TYPE trkey,
ls_adm TYPE rsmpe_adm.
IF lines( is_cua-sta ) = 0
AND lines( is_cua-fun ) = 0
AND lines( is_cua-men ) = 0
AND lines( is_cua-mtx ) = 0
AND lines( is_cua-act ) = 0
AND lines( is_cua-but ) = 0
AND lines( is_cua-pfk ) = 0
AND lines( is_cua-set ) = 0
AND lines( is_cua-doc ) = 0
AND lines( is_cua-tit ) = 0
AND lines( is_cua-biv ) = 0.
RETURN.
ENDIF.
SELECT SINGLE devclass INTO ls_tr_key-devclass
FROM tadir
WHERE pgmid = 'R3TR'
AND object = ms_item-obj_type
AND obj_name = ms_item-obj_name. "#EC CI_GENBUFF
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'not found in tadir' ).
ENDIF.
ls_tr_key-obj_type = ms_item-obj_type.
ls_tr_key-obj_name = ms_item-obj_name.
ls_tr_key-sub_type = 'CUAD'.
ls_tr_key-sub_name = iv_program_name.
ls_adm = is_cua-adm.
auto_correct_cua_adm( EXPORTING is_cua = is_cua CHANGING cs_adm = ls_adm ).
sy-tcode = 'SE41' ##write_ok. " evil hack, workaround to handle fixes in note 2159455
CALL FUNCTION 'RS_CUA_INTERNAL_WRITE'
EXPORTING
program = iv_program_name
language = mv_language
tr_key = ls_tr_key
adm = ls_adm
state = 'I'
TABLES
sta = is_cua-sta
fun = is_cua-fun
men = is_cua-men
mtx = is_cua-mtx
act = is_cua-act
but = is_cua-but
pfk = is_cua-pfk
set = is_cua-set
doc = is_cua-doc
tit = is_cua-tit
biv = is_cua-biv
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
* if moving code from SAPlink, see https://github.com/larshp/abapGit/issues/562
zcx_abapgit_exception=>raise( 'error from RS_CUA_INTERNAL_WRITE' ).
ENDIF.
zcl_abapgit_objects_activation=>add(
iv_type = 'CUAD'
iv_name = iv_program_name ).
ENDMETHOD.
METHOD deserialize_dynpros.
DATA: lv_name TYPE dwinactiv-obj_name,
ls_dynpro LIKE LINE OF it_dynpros.
* ls_dynpro is changed by the function module, a field-symbol will cause
* the program to dump since it_dynpros cannot be changed
LOOP AT it_dynpros INTO ls_dynpro.
ls_dynpro-flow_logic = uncondense_flow(
it_flow = ls_dynpro-flow_logic
it_spaces = ls_dynpro-spaces ).
CALL FUNCTION 'RPY_DYNPRO_INSERT'
EXPORTING
header = ls_dynpro-header
suppress_exist_checks = abap_true
TABLES
containers = ls_dynpro-containers
fields_to_containers = ls_dynpro-fields
flow_logic = ls_dynpro-flow_logic
EXCEPTIONS
cancelled = 1
already_exists = 2
program_not_exists = 3
not_executed = 4
missing_required_field = 5
illegal_field_value = 6
field_not_allowed = 7
not_generated = 8
illegal_field_position = 9
OTHERS = 10.
IF sy-subrc <> 2 AND sy-subrc <> 0.
zcx_abapgit_exception=>raise( |error from RPY_DYNPRO_INSERT: { sy-subrc }| ).
ENDIF.
* todo, RPY_DYNPRO_UPDATE?
CONCATENATE ls_dynpro-header-program ls_dynpro-header-screen
INTO lv_name RESPECTING BLANKS.
ASSERT NOT lv_name IS INITIAL.
zcl_abapgit_objects_activation=>add(
iv_type = 'DYNP'
iv_name = lv_name ).
ENDLOOP.
ENDMETHOD.
METHOD deserialize_program.
DATA: lv_exists TYPE abap_bool,
lv_progname TYPE reposrc-progname,
ls_tpool LIKE LINE OF it_tpool,
lv_title TYPE rglif-title,
ls_progdir_new TYPE progdir.
FIELD-SYMBOLS: <lg_any> TYPE any.
CALL FUNCTION 'RS_CORR_INSERT'
EXPORTING
object = is_progdir-name
object_class = 'ABAP'
devclass = iv_package
master_language = mv_language
mode = 'INSERT'
EXCEPTIONS
cancelled = 1
permission_failure = 2
unknown_objectclass = 3
OTHERS = 4.
IF sy-subrc = 1.
zcx_abapgit_exception=>raise( 'Cancelled' ).
ELSEIF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from RS_CORR_INSERT' ).
ENDIF.
READ TABLE it_tpool INTO ls_tpool WITH KEY id = 'R'.
IF sy-subrc = 0.
* there is a bug in RPY_PROGRAM_UPDATE, the header line of TTAB is not
* cleared, so the title length might be inherited from a different program.
ASSIGN ('(SAPLSIFP)TTAB') TO <lg_any>.
IF sy-subrc = 0.
CLEAR <lg_any>.
ENDIF.
lv_title = ls_tpool-entry.
ENDIF.
SELECT SINGLE progname FROM reposrc INTO lv_progname
WHERE progname = is_progdir-name
AND r3state = 'A'.
IF sy-subrc = 0.
lv_exists = abap_true.
ELSE.
lv_exists = abap_false.
ENDIF.
IF lv_exists = abap_true.
zcl_abapgit_language=>set_current_language( mv_language ).
CALL FUNCTION 'RPY_PROGRAM_UPDATE'
EXPORTING
program_name = is_progdir-name
title_string = lv_title
save_inactive = 'I'
TABLES
source_extended = it_source
EXCEPTIONS
cancelled = 1
permission_error = 2
not_found = 3
OTHERS = 4.
IF sy-subrc <> 0.
zcl_abapgit_language=>restore_login_language( ).
IF sy-msgid = 'EU' AND sy-msgno = '510'.
zcx_abapgit_exception=>raise( 'User is currently editing program' ).
ELSE.
zcx_abapgit_exception=>raise( 'PROG, error updating' ).
ENDIF.
ENDIF.
zcl_abapgit_language=>restore_login_language( ).
ELSEIF strlen( is_progdir-name ) > 30.
* function module RPY_PROGRAM_INSERT cannot handle function group includes
" special treatment for extensions
" if the program name exceeds 30 characters it is not a usual
" ABAP program but might be some extension, which requires the internal
" addition EXTENSION TYPE, see
" http://help.sap.com/abapdocu_751/en/abapinsert_report_internal.htm#!ABAP_ADDITION_1@1@
" This e.g. occurs in case of transportable Code Inspector variants (ending with ===VC)
INSERT REPORT is_progdir-name
FROM it_source
STATE 'I'
EXTENSION TYPE is_progdir-name+30.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from INSERT REPORT .. EXTENSION TYPE' ).
ENDIF.
ELSE.
INSERT REPORT is_progdir-name
FROM it_source
STATE 'I'
PROGRAM TYPE is_progdir-subc.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from INSERT REPORT' ).
ENDIF.
ENDIF.
IF NOT it_tpool[] IS INITIAL.
INSERT TEXTPOOL is_progdir-name
FROM it_tpool
LANGUAGE mv_language
STATE 'I'.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from INSERT TEXTPOOL' ).
ENDIF.
ENDIF.
CALL FUNCTION 'READ_PROGDIR'
EXPORTING
i_progname = is_progdir-name
i_state = 'I'
IMPORTING
e_progdir = ls_progdir_new
EXCEPTIONS
not_exists = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'not found in PROGDIR' ).
ENDIF.
* todo, package?
ls_progdir_new-ldbname = is_progdir-ldbname.
ls_progdir_new-dbna = is_progdir-dbna.
ls_progdir_new-dbapl = is_progdir-dbapl.
ls_progdir_new-rload = is_progdir-rload.
ls_progdir_new-fixpt = is_progdir-fixpt.
ls_progdir_new-varcl = is_progdir-varcl.
ls_progdir_new-appl = is_progdir-appl.
ls_progdir_new-rstat = is_progdir-rstat.
CALL FUNCTION 'UPDATE_PROGDIR'
EXPORTING
i_progdir = ls_progdir_new
i_progname = ls_progdir_new-name
i_state = ls_progdir_new-state
EXCEPTIONS
not_executed = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'PROG, error inserting' ).
ENDIF.
SELECT SINGLE * FROM progdir INTO ls_progdir_new
WHERE name = ls_progdir_new-name
AND state = ls_progdir_new-state.
IF sy-subrc = 0 AND is_progdir-varcl = space AND ls_progdir_new-varcl = abap_true.
* function module UPDATE_PROGDIR does not update VARCL
UPDATE progdir SET varcl = is_progdir-varcl
WHERE name = ls_progdir_new-name
AND state = ls_progdir_new-state. "#EC CI_SUBRC
ENDIF.
zcl_abapgit_objects_activation=>add(
iv_type = 'REPS'
iv_name = is_progdir-name ).
ENDMETHOD.
METHOD deserialize_textpool.
DATA lv_language TYPE langu.
DATA lv_state TYPE c.
DATA lv_delete TYPE abap_bool.
IF iv_language IS INITIAL.
lv_language = mv_language.
ELSE.
lv_language = iv_language.
ENDIF.
IF lv_language = mv_language.
lv_state = 'I'. "Textpool in master language needs to be activated
ELSE.
lv_state = 'A'. "Translations are always active
ENDIF.
IF it_tpool IS INITIAL.
IF iv_is_include = abap_false OR lv_state = 'A'.
DELETE TEXTPOOL iv_program "Remove initial description from textpool if
LANGUAGE iv_program "original program does not have a textpool
STATE lv_state.
lv_delete = abap_true.
ELSE.
INSERT TEXTPOOL iv_program "In case of includes: Deletion of textpool in
FROM it_tpool "master language cannot be activated because
LANGUAGE lv_language "this woul activate the deletion of the textpool
STATE lv_state. "of the mail program -> insert empty textpool
ENDIF.
ELSE.
IF lines( it_tpool ) = 1 AND lv_language = mv_language.
READ TABLE it_tpool WITH KEY id = 'R' TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
RETURN. "No action because description in master language is already there
ENDIF.
ENDIF.
INSERT TEXTPOOL iv_program
FROM it_tpool
LANGUAGE lv_language
STATE lv_state.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from INSERT TEXTPOOL' ).
ENDIF.
ENDIF.
IF lv_state = 'I'. "Textpool in master language needs to be activated
zcl_abapgit_objects_activation=>add(
iv_type = 'REPT'
iv_name = iv_program
iv_delete = lv_delete ).
ENDIF.
ENDMETHOD.
METHOD is_any_dynpro_locked.
DATA: lt_dynpros TYPE zcl_abapgit_objects_program=>ty_dynpro_tt,
lv_object TYPE seqg3-garg.
FIELD-SYMBOLS: <ls_dynpro> TYPE zcl_abapgit_objects_program=>ty_dynpro.
lt_dynpros = serialize_dynpros( iv_program ).
LOOP AT lt_dynpros ASSIGNING <ls_dynpro>.
lv_object = |{ <ls_dynpro>-header-screen }{ <ls_dynpro>-header-program }|.
IF exists_a_lock_entry_for( iv_lock_object = 'ESCRP'
iv_argument = lv_object ) = abap_true.
rv_is_any_dynpro_locked = abap_true.
EXIT.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD is_cua_locked.
DATA: lv_object TYPE eqegraarg.
lv_object = |CU{ iv_program }|.
OVERLAY lv_object WITH ' '.
lv_object = lv_object && '*'.
rv_is_cua_locked = exists_a_lock_entry_for( iv_lock_object = 'ESCUAPAINT'
iv_argument = lv_object ).
ENDMETHOD.
METHOD is_text_locked.
DATA: lv_object TYPE eqegraarg.
lv_object = |*{ iv_program }|.
rv_is_text_locked = exists_a_lock_entry_for( iv_lock_object = 'EABAPTEXTE'
iv_argument = lv_object ).
ENDMETHOD.
METHOD read_progdir.
DATA: ls_sapdir TYPE progdir.
CALL FUNCTION 'READ_PROGDIR'
EXPORTING
i_progname = iv_program
i_state = 'A'
IMPORTING
e_progdir = ls_sapdir.
MOVE-CORRESPONDING ls_sapdir TO rs_progdir.
CLEAR: rs_progdir-edtx,
rs_progdir-cnam,
rs_progdir-cdat,
rs_progdir-unam,
rs_progdir-udat,
rs_progdir-levl,
rs_progdir-vern,
rs_progdir-rmand,
rs_progdir-sdate,
rs_progdir-stime,
rs_progdir-idate,
rs_progdir-itime.
ENDMETHOD.
METHOD read_tpool.
FIELD-SYMBOLS: <ls_tpool_in> LIKE LINE OF it_tpool,
<ls_tpool_out> LIKE LINE OF rt_tpool.
LOOP AT it_tpool ASSIGNING <ls_tpool_in>.
APPEND INITIAL LINE TO rt_tpool ASSIGNING <ls_tpool_out>.
MOVE-CORRESPONDING <ls_tpool_in> TO <ls_tpool_out>.
IF <ls_tpool_out>-id = 'S'.
CONCATENATE <ls_tpool_in>-split <ls_tpool_in>-entry
INTO <ls_tpool_out>-entry
RESPECTING BLANKS.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD serialize_cua.
CALL FUNCTION 'RS_CUA_INTERNAL_FETCH'
EXPORTING
program = iv_program_name
language = mv_language
state = 'A'
IMPORTING
adm = rs_cua-adm
TABLES
sta = rs_cua-sta
fun = rs_cua-fun
men = rs_cua-men
mtx = rs_cua-mtx
act = rs_cua-act
but = rs_cua-but
pfk = rs_cua-pfk
set = rs_cua-set
doc = rs_cua-doc
tit = rs_cua-tit
biv = rs_cua-biv
EXCEPTIONS
not_found = 1
unknown_version = 2
OTHERS = 3.
IF sy-subrc > 1.
zcx_abapgit_exception=>raise( |error from RS_CUA_INTERNAL_FETCH, { sy-subrc }| ).
ENDIF.
ENDMETHOD.
METHOD serialize_dynpros.
CONSTANTS lc_rpyty_force_off TYPE char01 VALUE '/' ##NO_TEXT.
DATA: ls_header TYPE rpy_dyhead,
lt_containers TYPE dycatt_tab,
lt_fields_to_containers TYPE dyfatc_tab,
lt_flow_logic TYPE swydyflow,
lt_d020s TYPE TABLE OF d020s.
FIELD-SYMBOLS: <ls_d020s> LIKE LINE OF lt_d020s,
<lv_outputstyle> TYPE scrpostyle,
<ls_container> LIKE LINE OF lt_containers,
<ls_field> LIKE LINE OF lt_fields_to_containers,
<ls_dynpro> LIKE LINE OF rt_dynpro.
CALL FUNCTION 'RS_SCREEN_LIST'
EXPORTING
dynnr = ''
progname = iv_program_name
TABLES
dynpros = lt_d020s
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc = 2.
zcx_abapgit_exception=>raise( 'error from screen_list' ).
ENDIF.
SORT lt_d020s BY dnum ASCENDING.
* loop dynpros and skip generated selection screens
LOOP AT lt_d020s ASSIGNING <ls_d020s>
WHERE type <> 'S' AND type <> 'W' AND type <> 'J'
AND NOT dnum IS INITIAL.
CALL FUNCTION 'RPY_DYNPRO_READ'
EXPORTING
progname = iv_program_name
dynnr = <ls_d020s>-dnum
IMPORTING
header = ls_header
TABLES
containers = lt_containers
fields_to_containers = lt_fields_to_containers
flow_logic = lt_flow_logic
EXCEPTIONS
cancelled = 1
not_found = 2
permission_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error while reading dynpro: { sy-subrc }| ).
ENDIF.
LOOP AT lt_fields_to_containers ASSIGNING <ls_field>.
* output style is a NUMC field, the XML conversion will fail if it contains invalid value
* field does not exist in all versions
ASSIGN COMPONENT 'OUTPUTSTYLE' OF STRUCTURE <ls_field> TO <lv_outputstyle>.
IF sy-subrc = 0 AND <lv_outputstyle> = ' '.
CLEAR <lv_outputstyle>.
ENDIF.
* if the DDIC element has a PARAMETER_ID and the flag "from_dict" is active
* the import will enable the SET-/GET_PARAM flag. In this case force "off"
* IF <ls_field>-param_id IS NOT INITIAL
* AND <ls_field>-from_dict = abap_true.
* IF <ls_field>-set_param IS INITIAL.
* <ls_field>-set_param = lc_rpyty_force_off.
* ENDIF.
* IF <ls_field>-get_param IS INITIAL.
* <ls_field>-get_param = lc_rpyty_force_off.
* ENDIF.
* ENDIF.
ENDLOOP.
LOOP AT lt_containers ASSIGNING <ls_container>.
IF <ls_container>-c_resize_v = abap_false.
CLEAR <ls_container>-c_line_min.
ENDIF.
IF <ls_container>-c_resize_h = abap_false.
CLEAR <ls_container>-c_coln_min.
ENDIF.
ENDLOOP.
APPEND INITIAL LINE TO rt_dynpro ASSIGNING <ls_dynpro>.
<ls_dynpro>-header = ls_header.
<ls_dynpro>-containers = lt_containers.
<ls_dynpro>-fields = lt_fields_to_containers.
condense_flow( IMPORTING et_spaces = <ls_dynpro>-spaces
CHANGING ct_flow = lt_flow_logic ).
<ls_dynpro>-flow_logic = lt_flow_logic.
ENDLOOP.
ENDMETHOD.
METHOD serialize_program.
DATA: ls_progdir TYPE ty_progdir,
lv_program_name TYPE programm,
lt_dynpros TYPE ty_dynpro_tt,
ls_cua TYPE ty_cua,
lt_source TYPE TABLE OF abaptxt255,
lt_tpool TYPE textpool_table,
ls_tpool LIKE LINE OF lt_tpool,
lo_xml TYPE REF TO zcl_abapgit_xml_output.
IF iv_program IS INITIAL.
lv_program_name = is_item-obj_name.
ELSE.
lv_program_name = iv_program.
ENDIF.
zcl_abapgit_language=>set_current_language( mv_language ).
CALL FUNCTION 'RPY_PROGRAM_READ'
EXPORTING
program_name = lv_program_name
with_lowercase = abap_true
TABLES
source_extended = lt_source
textelements = lt_tpool
EXCEPTIONS
cancelled = 1
not_found = 2
permission_error = 3
OTHERS = 4.
IF sy-subrc = 2.
zcl_abapgit_language=>restore_login_language( ).
RETURN.
ELSEIF sy-subrc <> 0.
zcl_abapgit_language=>restore_login_language( ).
zcx_abapgit_exception=>raise( 'Error reading program' ).
ENDIF.
zcl_abapgit_language=>restore_login_language( ).
ls_progdir = read_progdir( lv_program_name ).
IF io_xml IS BOUND.
lo_xml = io_xml.
ELSE.
CREATE OBJECT lo_xml.
ENDIF.
lo_xml->add( iv_name = 'PROGDIR'
ig_data = ls_progdir ).
IF ls_progdir-subc = '1' OR ls_progdir-subc = 'M'.
lt_dynpros = serialize_dynpros( lv_program_name ).
lo_xml->add( iv_name = 'DYNPROS'
ig_data = lt_dynpros ).
ls_cua = serialize_cua( lv_program_name ).
IF NOT ls_cua IS INITIAL.
lo_xml->add( iv_name = 'CUA'
ig_data = ls_cua ).
ENDIF.
ENDIF.
READ TABLE lt_tpool WITH KEY id = 'R' INTO ls_tpool.
IF sy-subrc = 0 AND ls_tpool-key = '' AND ls_tpool-length = 0.
DELETE lt_tpool INDEX sy-tabix.
ENDIF.
lo_xml->add( iv_name = 'TPOOL'
ig_data = add_tpool( lt_tpool ) ).
IF NOT io_xml IS BOUND.
io_files->add_xml( iv_extra = iv_extra
io_xml = lo_xml ).
ENDIF.
io_files->add_abap( iv_extra = iv_extra
it_abap = lt_source ).
ENDMETHOD.
METHOD uncondense_flow.
DATA: lv_spaces LIKE LINE OF it_spaces.
FIELD-SYMBOLS: <ls_flow> LIKE LINE OF it_flow,
<ls_output> LIKE LINE OF rt_flow.
LOOP AT it_flow ASSIGNING <ls_flow>.
APPEND INITIAL LINE TO rt_flow ASSIGNING <ls_output>.
<ls_output>-line = <ls_flow>-line.
READ TABLE it_spaces INDEX sy-tabix INTO lv_spaces.
IF sy-subrc = 0.
SHIFT <ls_output>-line RIGHT BY lv_spaces PLACES IN CHARACTER MODE.
ENDIF.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
23065,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
1676,
70,
15908,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
41876,
1172,
15908,
12,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1181,
220,
220,
41876,
1172,
15908,
12,
5219,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
44161,
87,
220,
220,
220,
41876,
1172,
15908,
12,
25410,
87,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1225,
17602,
220,
220,
220,
41876,
1172,
15908,
12,
276,
17602,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1401,
565,
220,
220,
41876,
1172,
15908,
12,
7785,
565,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
288,
7012,
489,
220,
220,
41876,
1172,
15908,
12,
67,
7012,
489,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20613,
2616,
220,
220,
220,
41876,
1172,
15908,
12,
9945,
2616,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
537,
292,
220,
220,
220,
41876,
1172,
15908,
12,
565,
292,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
41876,
1172,
15908,
12,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8833,
220,
41876,
1172,
15908,
12,
13966,
1834,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
850,
66,
220,
220,
220,
41876,
1172,
15908,
12,
7266,
66,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3680,
220,
220,
220,
41876,
1172,
15908,
12,
1324,
75,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
792,
84,
220,
220,
220,
41876,
1172,
15908,
12,
2363,
84,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
7402,
220,
220,
220,
41876,
1172,
15908,
12,
66,
7402,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
19608,
220,
220,
220,
41876,
1172,
15908,
12,
10210,
265,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
555,
321,
220,
220,
220,
41876,
1172,
15908,
12,
403,
321,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
19608,
220,
220,
220,
41876,
1172,
15908,
12,
463,
265,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
933,
220,
220,
220,
41876,
1172,
15908,
12,
933,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
443,
19279,
220,
220,
220,
41876,
1172,
15908,
12,
2768,
75,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
14269,
220,
220,
41876,
1172,
15908,
12,
81,
14269,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
22249,
220,
220,
41876,
1172,
15908,
12,
81,
22249,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
2220,
220,
220,
41876,
1172,
15908,
12,
81,
2220,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4259,
457,
220,
220,
41876,
1172,
15908,
12,
13049,
457,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
2617,
220,
220,
220,
41876,
1172,
15908,
12,
824,
316,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
264,
4475,
220,
220,
41876,
1172,
15908,
12,
82,
4475,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
336,
524,
220,
220,
41876,
1172,
15908,
12,
301,
524,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4686,
378,
220,
220,
41876,
1172,
15908,
12,
20540,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
524,
220,
220,
41876,
1172,
15908,
12,
22552,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
9945,
3672,
41876,
1172,
15908,
12,
335,
65,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
334,
535,
258,
694,
41876,
1172,
15908,
12,
18863,
258,
694,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
1676,
70,
15908,
13,
628,
220,
220,
220,
337,
36252,
50,
11389,
1096,
62,
23065,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
33245,
62,
19875,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
19875,
62,
22915,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
9186,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
16624,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16624,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
23065,
41876,
1430,
76,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
26086,
220,
220,
41876,
537,
522,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
337,
36252,
50,
1100,
62,
1676,
70,
15908,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
23065,
220,
220,
220,
220,
220,
220,
220,
41876,
1430,
76,
198,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
REPORT zab_chapter12.
"Listing 12.1
DATA: my_date TYPE d VALUE '20190102',
year TYPE i,
month TYPE i,
day TYPE i.
year = substring( val = my_date off = 0 len = 4 ).
month = substring( val = my_date off = 4 len = 2 ).
day = substring( val = my_date off = 6 len = 2 ).
"Listing 12.2
my_date = my_date + 35.
"Listing 12.3
my_date = my_date + 35.
"Listing 12.4
DATA: start_date TYPE d.
start_date = '20190101'.
my_date = start_date + 70.
WRITE: 'Date in a regular year:', 25 my_date.
start_date = '20200101'.
my_date = start_date + 70.
WRITE: / 'Date in a leap year:', 25 my_date.
"Listing 12.5
CALL FUNCTION 'RP_CALC_DATE_IN_INTERNAL'
EXPORTING
date = my_date
days = 0
months = 1
years = 0
IMPORTING
calc_date = my_date.
"Listing 12.6
DATA: one_date TYPE d VALUE '20190801',
another_date TYPE d.
another_date = one_date + 1.
IF another_date > one_date.
WRITE: 'True'.
ELSE.
WRITE: 'False'.
ENDIF.
"Listing 12.7
DATA: my_integer TYPE i.
my_date = '20190230'.
my_integer = my_date.
IF my_integer = 0.
WRITE: / 'Date is invalid'.
ENDIF.
"Listing 12.8
PARAMETERS: p_date TYPE d OBLIGATORY.
DATA: simple_date TYPE d,
factory_date TYPE scal-facdate.
simple_date = p_date.
WRITE: / 'Date entered:', p_date.
CALL FUNCTION 'DATE_CONVERT_TO_FACTORYDATE'
EXPORTING
date = simple_date
factory_calendar_id = 'US'
IMPORTING
factorydate = factory_date
EXCEPTIONS
calendar_buffer_not_loadable = 1
correct_option_invalid = 2
date_after_range = 3
date_before_range = 4
date_invalid = 5
factory_calendar_not_found = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ADD 10 TO factory_date.
CALL FUNCTION 'FACTORYDATE_CONVERT_TO_DATE'
EXPORTING
factorydate = factory_date
factory_calendar_id = 'US'
IMPORTING
date = simple_date
EXCEPTIONS
calendar_buffer_not_loadable = 1
factorydate_after_range = 2
factorydate_before_range = 3
factorydate_invalid = 4
factory_calendar_id_missing = 5
factory_calendar_not_found = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
WRITE: / 'Result:', simple_date.
"Listing 12.9
DATA: my_datum TYPE datum VALUE '20190801'.
WRITE: 'Type DATUM:', my_datum.
"DATA: my_date TYPE d VALUE '20190801'.
WRITE: /'Type D:', my_date.
"Listing 12.10
DATA: today TYPE sy-datum,
today_local TYPE sy-datlo,
factory_day TYPE sy-fdayw.
today = sy-datum.
today_local = sy-datlo.
factory_day = sy-fdayw.
"Listing 12.11
"New Open SQL
SELECT *
FROM usr02
INTO TABLE @data(results)
WHERE gltgv <= @sy-datum
AND gltgb >= @sy-datum.
"old Open SQL
*DATA: results TYPE STANDARD TABLE OF USR02.
*SELECT *
*FROM UR02
*INTO TABLE results
*WHERE GLTGV <= sy-datum
*AND GLTGB >= sy-datum.
"Listing 12.12
DATA: one_time TYPE t,
another_time TYPE t.
one_time = sy-uzeit.
WRITE: / 'Current time:', one_time.
another_time = one_time + 5.
WRITE: / 'Current time + 5:', another_time.
IF one_time = another_time.
WRITE: / 'Time is the same'.
ELSE.
WRITE: / 'Time is different'.
ENDIF.
"Listing 12.13
DATA: my_timestamp TYPE timestamp,
my_timestampl TYPE timestampl.
GET TIME STAMP FIELD my_timestamp.
GET TIME STAMP FIELD my_timestampl.
GET TIME STAMP FIELD DATA(my_inline_timestamp).
"Listing 12.14
my_timestamp = '20190101000000'.
my_timestampl = '20190101000000.0000001'.
IF my_timestampl > my_timestamp.
WRITE: 'True'.
ENDIF.
"Listing 12.15
GET TIME STAMP FIELD DATA(my_utc).
CONVERT TIME STAMP my_utc TIME ZONE 'PST'
INTO DATE DATA(my_pst_date)
TIME DATA(my_pst_time)
DAYLIGHT SAVING TIME DATA(my_dst).
"Listing 12.16
*DATA: my_utc type timestamp,
*my_pst_date type d,
*my_pst_time type t,
*my_dst type abap_bool.
GET TIME STAMP FIELD my_utc.
CONVERT TIME STAMP my_utc TIME ZONE 'PST'
INTO DATE my_pst_date
TIME my_pst_time
DAYLIGHT SAVING TIME my_dst.
"Listing 12.17
CONVERT DATE my_pst_date
TIME my_pst_time
DAYLIGHT SAVING TIME my_dst
INTO TIME STAMP my_utc TIME ZONE 'PST'.
"Listing 12.18
DATA: unformatted TYPE timestampl
VALUE '20190101120000.0000000'.
DATA(my_string) = |{ unformatted TIMESTAMP = ISO }|.
"Listing 12.19
my_string = |{ unformatted TIMESTAMP = ISO
TIMEZONE = 'PST' }|.
"Listing 12.20
DATA: sys_time TYPE sy-uzeit,
sys_timezone TYPE sy-tzone,
loc_time TYPE sy-timlo,
loc_timezone TYPE sy-zonlo.
sys_time = sy-uzeit.
sys_timezone = sy-tzone.
loc_time = sy-timlo.
loc_timezone = sy-zonlo.
"Listing 12.21
DATA: my_quantity TYPE i VALUE 5.
CALL FUNCTION 'UNIT_CONVERSION_SIMPLE'
EXPORTING
input = my_quantity
unit_in = 'M'
unit_out = 'CM'
IMPORTING
output = my_quantity
EXCEPTIONS
conversion_not_found = 1
division_by_zero = 2
input_invalid = 3
output_invalid = 4
overflow = 5
type_invalid = 6
units_missing = 7
unit_in_not_found = 8
unit_out_not_found = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
WRITE: my_quantity.
"Listing 12.22
DATA: local_amount TYPE p DECIMALS 2.
CALL FUNCTION 'CONVERT_TO_LOCAL_CURRENCY'
EXPORTING
date = sy-datlo
foreign_amount = 100
foreign_currency = 'EUR'
local_currency = 'USD'
IMPORTING
local_amount = local_amount
EXCEPTIONS
no_rate_found = 1
overflow = 2
no_factors_found = 3
no_spread_found = 4
derived_2_times = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
"Listing 12.23 - 12.26
"See code example in class ZCL_AB_SHOPPING_CART_12
"Listing 12.27 - 12.39
"See code example in program ZAB_PRODUCT_MAINT_12
"Listing 12.31
"See code example in program ZAB_CART_MAINT_12
| [
2200,
15490,
1976,
397,
62,
43582,
1065,
13,
198,
198,
1,
8053,
278,
1105,
13,
16,
198,
26947,
25,
616,
62,
4475,
41876,
288,
26173,
8924,
705,
23344,
486,
2999,
3256,
198,
220,
220,
220,
220,
220,
614,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
1227,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
1110,
220,
220,
220,
220,
41876,
1312,
13,
198,
198,
1941,
796,
3293,
1806,
7,
1188,
796,
616,
62,
4475,
572,
796,
657,
18896,
796,
604,
6739,
198,
8424,
796,
3293,
1806,
7,
1188,
796,
616,
62,
4475,
572,
796,
604,
18896,
796,
362,
6739,
198,
820,
796,
3293,
1806,
7,
1188,
796,
616,
62,
4475,
572,
796,
718,
18896,
796,
362,
6739,
198,
198,
1,
8053,
278,
1105,
13,
17,
198,
1820,
62,
4475,
796,
616,
62,
4475,
1343,
3439,
13,
198,
198,
1,
8053,
278,
1105,
13,
18,
198,
1820,
62,
4475,
796,
616,
62,
4475,
1343,
3439,
13,
198,
198,
1,
8053,
278,
1105,
13,
19,
198,
26947,
25,
923,
62,
4475,
41876,
288,
13,
198,
198,
9688,
62,
4475,
796,
705,
23344,
486,
486,
4458,
198,
1820,
62,
4475,
796,
923,
62,
4475,
1343,
4317,
13,
198,
18564,
12709,
25,
705,
10430,
287,
257,
3218,
614,
25,
3256,
1679,
616,
62,
4475,
13,
198,
9688,
62,
4475,
796,
705,
1238,
2167,
8784,
4458,
198,
1820,
62,
4475,
796,
923,
62,
4475,
1343,
4317,
13,
198,
18564,
12709,
25,
1220,
705,
10430,
287,
257,
16470,
614,
25,
3256,
1679,
616,
62,
4475,
13,
198,
198,
1,
8053,
278,
1105,
13,
20,
198,
34,
7036,
29397,
4177,
2849,
705,
20031,
62,
34,
1847,
34,
62,
35,
6158,
62,
1268,
62,
1268,
31800,
1847,
6,
198,
220,
7788,
15490,
2751,
198,
220,
220,
220,
3128,
220,
220,
220,
220,
220,
796,
616,
62,
4475,
198,
220,
220,
220,
1528,
220,
220,
220,
220,
220,
796,
657,
198,
220,
220,
220,
1933,
220,
220,
220,
796,
352,
198,
220,
220,
220,
812,
220,
220,
220,
220,
796,
657,
198,
220,
30023,
9863,
2751,
198,
220,
220,
220,
42302,
62,
4475,
796,
616,
62,
4475,
13,
198,
198,
1,
8053,
278,
1105,
13,
21,
198,
26947,
25,
530,
62,
4475,
220,
220,
220,
220,
41876,
288,
26173,
8924,
705,
23344,
2919,
486,
3256,
198,
220,
220,
220,
220,
220,
1194,
62,
4475,
41876,
288,
13,
198,
29214,
62,
4475,
796,
530,
62,
4475,
1343,
352,
13,
198,
5064,
1194,
62,
4475,
1875,
530,
62,
4475,
13,
198,
220,
44423,
25,
705,
17821,
4458,
198,
3698,
5188,
13,
198,
220,
44423,
25,
705,
25101,
4458,
198,
10619,
5064,
13,
198,
198,
1,
8053,
278,
1105,
13,
22,
198,
26947,
25,
616,
62,
41433,
41876,
1312,
13,
198,
1820,
62,
4475,
796,
705,
23344,
2999,
1270,
4458,
198,
1820,
62,
41433,
796,
616,
62,
4475,
13,
198,
5064,
616,
62,
41433,
796,
657,
13,
198,
220,
44423,
25,
1220,
705,
10430,
318,
12515,
4458,
198,
10619,
5064,
13,
198,
198,
1,
8053,
278,
1105,
13,
23,
198,
27082,
2390,
2767,
4877,
25,
279,
62,
4475,
41876,
288,
440,
9148,
3528,
1404,
15513,
13,
198,
26947,
25,
2829,
62,
4475,
220,
41876,
288,
11,
198,
220,
220,
220,
220,
220,
8860,
62,
4475,
41876,
16578,
12,
38942,
4475,
13,
198,
36439,
62,
4475,
796,
279,
62,
4475,
13,
198,
18564,
12709,
25,
1220,
705,
10430,
5982,
25,
3256,
279,
62,
4475,
13,
198,
34,
7036,
29397,
4177,
2849,
705,
35,
6158,
62,
10943,
15858,
62,
10468,
62,
37,
10659,
15513,
35,
6158,
6,
198,
220,
7788,
15490,
2751,
198,
220,
220,
220,
3128,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
2829,
62,
4475,
198,
220,
220,
220,
8860,
62,
9948,
9239,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
2937,
6,
198,
220,
30023,
9863,
2751,
198,
220,
220,
220,
8860,
4475,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
8860,
62,
4475,
198,
220,
7788,
42006,
11053,
198,
220,
220,
220,
11845,
62,
22252,
62,
1662,
62,
2220,
540,
796,
352,
198,
220,
220,
220,
3376,
62,
18076,
62,
259,
12102,
220,
220,
220,
220,
220,
220,
796,
362,
198,
220,
220,
220,
3128,
62,
8499,
62,
9521,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
513,
198,
220,
220,
220,
3128,
62,
19052,
62,
9521,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
604,
198,
220,
220,
220,
3128,
62,
259,
12102,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
642,
198,
220,
220,
220,
8860,
62,
9948,
9239,
62,
1662,
62,
9275,
220,
220,
796,
718,
198,
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,
220,
220,
796,
767,
13,
198,
5064,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
337,
1546,
4090,
8264,
4522,
827,
12,
19662,
312,
41876,
827,
12,
19662,
774,
36871,
13246,
827,
12,
19662,
3919,
198,
220,
13315,
827,
12,
19662,
85,
16,
827,
12,
19662,
85,
17,
827,
12,
19662,
85,
18,
827,
12,
19662,
85,
19,
13,
198,
10619,
5064,
13,
198,
29266,
838,
5390,
8860,
62,
4475,
13,
198,
34,
7036,
29397,
4177,
2849,
705,
37,
10659,
15513,
35,
6158,
62,
10943,
15858,
62,
10468,
62,
35,
6158,
6,
198,
220,
7788,
15490,
2751,
198,
220,
220,
220,
8860,
4475,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
8860,
62,
4475,
198,
220,
220,
220,
8860,
62,
9948,
9239,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
2937,
6,
198,
220,
30023,
9863,
2751,
198,
220,
220,
220,
3128,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
2829,
62,
4475,
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,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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
] |
CLASS zcl_abapgit_gui_router DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS on_event
IMPORTING iv_action TYPE clike
iv_prev_page TYPE clike
iv_getdata TYPE clike OPTIONAL
it_postdata TYPE cnht_post_data_tab OPTIONAL
EXPORTING ei_page TYPE REF TO zif_abapgit_gui_page
ev_state TYPE i
RAISING zcx_abapgit_exception zcx_abapgit_cancel.
PRIVATE SECTION.
METHODS get_page_diff
IMPORTING iv_getdata TYPE clike
iv_prev_page TYPE clike
RETURNING VALUE(ri_page) TYPE REF TO zif_abapgit_gui_page
RAISING zcx_abapgit_exception.
METHODS get_page_branch_overview
IMPORTING iv_getdata TYPE clike
RETURNING VALUE(ri_page) TYPE REF TO zif_abapgit_gui_page
RAISING zcx_abapgit_exception.
METHODS get_page_stage
IMPORTING iv_getdata TYPE clike
RETURNING VALUE(ri_page) TYPE REF TO zif_abapgit_gui_page
RAISING zcx_abapgit_exception.
METHODS get_page_background
IMPORTING iv_key TYPE zif_abapgit_persistence=>ty_repo-key
RETURNING VALUE(ri_page) TYPE REF TO zif_abapgit_gui_page
RAISING zcx_abapgit_exception.
METHODS get_page_playground
RETURNING VALUE(ri_page) TYPE REF TO zif_abapgit_gui_page
RAISING zcx_abapgit_exception zcx_abapgit_cancel.
CLASS-METHODS jump_display_transport
IMPORTING iv_getdata TYPE clike.
ENDCLASS.
CLASS zcl_abapgit_gui_router IMPLEMENTATION.
METHOD get_page_background.
CREATE OBJECT ri_page TYPE zcl_abapgit_gui_page_bkg
EXPORTING
iv_key = iv_key.
ENDMETHOD.
METHOD get_page_branch_overview.
DATA: lo_repo TYPE REF TO zcl_abapgit_repo_online,
lo_page TYPE REF TO zcl_abapgit_gui_page_boverview,
lv_key TYPE zif_abapgit_persistence=>ty_repo-key.
lv_key = iv_getdata.
lo_repo ?= zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
CREATE OBJECT lo_page
EXPORTING
io_repo = lo_repo.
ri_page = lo_page.
ENDMETHOD.
METHOD get_page_diff.
DATA: ls_file TYPE zif_abapgit_definitions=>ty_file,
ls_object TYPE zif_abapgit_definitions=>ty_item,
lo_page TYPE REF TO zcl_abapgit_gui_page_diff,
lv_key TYPE zif_abapgit_persistence=>ty_repo-key.
zcl_abapgit_html_action_utils=>file_obj_decode(
EXPORTING
iv_string = iv_getdata
IMPORTING
ev_key = lv_key
eg_file = ls_file
eg_object = ls_object ).
CREATE OBJECT lo_page
EXPORTING
iv_key = lv_key
is_file = ls_file
is_object = ls_object.
ri_page = lo_page.
ENDMETHOD.
METHOD get_page_playground.
DATA: lv_class_name TYPE string,
lv_cancel TYPE abap_bool,
li_popups TYPE REF TO zif_abapgit_popups.
li_popups = zcl_abapgit_ui_factory=>get_popups( ).
li_popups->run_page_class_popup(
IMPORTING
ev_name = lv_class_name
ev_cancel = lv_cancel ).
IF lv_cancel = abap_true.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
ENDIF.
TRY.
CREATE OBJECT ri_page TYPE (lv_class_name).
CATCH cx_sy_create_object_error.
zcx_abapgit_exception=>raise( |Cannot create page class { lv_class_name }| ).
ENDTRY.
ENDMETHOD.
METHOD get_page_stage.
DATA: lo_repo TYPE REF TO zcl_abapgit_repo_online,
lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
lv_seed TYPE string,
lo_stage_page TYPE REF TO zcl_abapgit_gui_page_stage,
lo_code_inspector_page TYPE REF TO zcl_abapgit_gui_page_code_insp.
FIND FIRST OCCURRENCE OF '=' IN iv_getdata.
IF sy-subrc <> 0. " Not found ? -> just repo key in params
lv_key = iv_getdata.
ELSE.
zcl_abapgit_html_action_utils=>stage_decode(
EXPORTING iv_getdata = iv_getdata
IMPORTING ev_key = lv_key
ev_seed = lv_seed ).
ENDIF.
lo_repo ?= zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
IF lo_repo->get_local_settings( )-code_inspector_check_variant IS NOT INITIAL.
CREATE OBJECT lo_code_inspector_page
EXPORTING
io_repo = lo_repo.
ri_page = lo_code_inspector_page.
ELSE.
" force refresh on stage, to make sure the latest local and remote files are used
lo_repo->refresh( ).
CREATE OBJECT lo_stage_page
EXPORTING
io_repo = lo_repo
iv_seed = lv_seed.
ri_page = lo_stage_page.
ENDIF.
ENDMETHOD.
METHOD on_event.
DATA: lv_url TYPE string,
lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
ls_item TYPE zif_abapgit_definitions=>ty_item.
lv_key = iv_getdata. " TODO refactor
lv_url = iv_getdata. " TODO refactor
CASE iv_action.
" General PAGE routing
WHEN zif_abapgit_definitions=>c_action-go_main. " Go Main page
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_main.
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_explore. " Go Explore page
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_explore.
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_repo_overview. " Go Repository overview
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_repo_over.
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_db. " Go DB util page
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_db.
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_debuginfo.
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_debuginfo.
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_settings.
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_settings.
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_background_run. " Go background run page
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_bkg_run.
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_background. " Go Background page
ei_page = get_page_background( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_diff. " Go Diff page
ei_page = get_page_diff(
iv_getdata = iv_getdata
iv_prev_page = iv_prev_page ).
ev_state = zif_abapgit_definitions=>c_event_state-new_page_w_bookmark.
WHEN zif_abapgit_definitions=>c_action-go_stage. " Go Staging page
ei_page = get_page_stage( iv_getdata ).
IF iv_prev_page = 'PAGE_DIFF'.
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
ELSE.
ev_state = zif_abapgit_definitions=>c_event_state-new_page_w_bookmark.
ENDIF.
WHEN zif_abapgit_definitions=>c_action-go_branch_overview. " Go repo branch overview
ei_page = get_page_branch_overview( iv_getdata ).
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_playground. " Create playground page
ei_page = get_page_playground( ).
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_tutorial. " Go to tutorial
zcl_abapgit_persistence_user=>get_instance( )->set_repo_show( '' ). " Clear show_id
ev_state = zif_abapgit_definitions=>c_event_state-re_render. " Assume we are on main page
" SAP GUI actions
WHEN zif_abapgit_definitions=>c_action-jump. " Open object editor
zcl_abapgit_html_action_utils=>jump_decode(
EXPORTING iv_string = iv_getdata
IMPORTING ev_obj_type = ls_item-obj_type
ev_obj_name = ls_item-obj_name ).
zcl_abapgit_objects=>jump( ls_item ).
ev_state = zif_abapgit_definitions=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-jump_pkg. " Open SE80
zcl_abapgit_services_repo=>open_se80( |{ iv_getdata }| ).
ev_state = zif_abapgit_definitions=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-jump_transport.
jump_display_transport( iv_getdata ).
ev_state = zif_abapgit_definitions=>c_event_state-no_more_act.
" DB actions
WHEN zif_abapgit_definitions=>c_action-db_edit.
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_db_edit
EXPORTING
is_key = zcl_abapgit_html_action_utils=>dbkey_decode( iv_getdata ).
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
IF iv_prev_page = 'PAGE_DB_DIS'.
ev_state = zif_abapgit_definitions=>c_event_state-new_page_replacing.
ENDIF.
WHEN zif_abapgit_definitions=>c_action-db_display.
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_db_dis
EXPORTING
is_key = zcl_abapgit_html_action_utils=>dbkey_decode( iv_getdata ).
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
" ABAPGIT services actions
WHEN zif_abapgit_definitions=>c_action-abapgit_home. " Go abapGit homepage
zcl_abapgit_services_abapgit=>open_abapgit_homepage( ).
ev_state = zif_abapgit_definitions=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-abapgit_install. " Install abapGit
zcl_abapgit_services_abapgit=>install_abapgit( ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
" REPOSITORY services actions
WHEN zif_abapgit_definitions=>c_action-repo_newoffline. " New offline repo
zcl_abapgit_services_repo=>new_offline( ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_refresh. " Repo refresh
zcl_abapgit_services_repo=>refresh( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_syntax_check.
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_syntax
EXPORTING
io_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-repo_code_inspector.
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_code_insp
EXPORTING
io_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-repo_purge. " Repo remove & purge all objects
zcl_abapgit_services_repo=>purge( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_remove. " Repo remove
zcl_abapgit_services_repo=>remove( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_newonline.
zcl_abapgit_services_repo=>new_online( lv_url ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN 'install'. " 'install' is for explore page
zcl_abapgit_services_repo=>new_online( lv_url ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_refresh_checksums. " Rebuil local checksums
zcl_abapgit_services_repo=>refresh_local_checksums( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_toggle_fav. " Toggle repo as favorite
zcl_abapgit_services_repo=>toggle_favorite( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_transport_to_branch.
zcl_abapgit_services_repo=>transport_to_branch( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_settings.
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_repo_sett
EXPORTING
io_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
" ZIP services actions
WHEN zif_abapgit_definitions=>c_action-zip_import. " Import repo from ZIP
zcl_abapgit_zip=>import( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-zip_export. " Export repo as ZIP
zcl_abapgit_zip=>export( zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ) ).
ev_state = zif_abapgit_definitions=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-zip_package. " Export package as ZIP
zcl_abapgit_zip=>export_package( ).
ev_state = zif_abapgit_definitions=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-zip_transport. " Export transport as ZIP
zcl_abapgit_transport=>zip( ).
ev_state = zif_abapgit_definitions=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-zip_object. " Export object as ZIP
zcl_abapgit_zip=>export_object( ).
ev_state = zif_abapgit_definitions=>c_event_state-no_more_act.
" Remote ORIGIN manipulations
WHEN zif_abapgit_definitions=>c_action-repo_remote_attach. " Remote attach
zcl_abapgit_services_repo=>remote_attach( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_remote_detach. " Remote detach
zcl_abapgit_services_repo=>remote_detach( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_remote_change. " Remote change
zcl_abapgit_services_repo=>remote_change( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
" GIT actions
WHEN zif_abapgit_definitions=>c_action-git_pull. " GIT Pull
zcl_abapgit_services_git=>pull( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_reset. " GIT Reset
zcl_abapgit_services_git=>reset( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_branch_create. " GIT Create new branch
zcl_abapgit_services_git=>create_branch( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_branch_delete. " GIT Delete remote branch
zcl_abapgit_services_git=>delete_branch( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_branch_switch. " GIT Switch branch
zcl_abapgit_services_git=>switch_branch( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-go_tag_overview. " GIT Tag overview
zcl_abapgit_services_git=>tag_overview( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_tag_create. " GIT Tag create
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_tag
EXPORTING
io_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-git_tag_delete. " GIT Tag create
zcl_abapgit_services_git=>delete_tag( lv_key ).
zcl_abapgit_services_repo=>refresh( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_tag_switch. " GIT Switch Tag
zcl_abapgit_services_git=>switch_tag( lv_key ).
ev_state = zif_abapgit_definitions=>c_event_state-re_render.
"Others
WHEN OTHERS.
ev_state = zif_abapgit_definitions=>c_event_state-not_handled.
ENDCASE.
ENDMETHOD.
METHOD jump_display_transport.
DATA: lv_transport TYPE trkorr.
lv_transport = iv_getdata.
CALL FUNCTION 'TR_DISPLAY_REQUEST'
EXPORTING
i_trkorr = lv_transport.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
472,
353,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
319,
62,
15596,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
2673,
220,
220,
220,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
47050,
62,
7700,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
1136,
7890,
220,
220,
41876,
537,
522,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
7353,
7890,
220,
41876,
269,
77,
4352,
62,
7353,
62,
7890,
62,
8658,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
304,
72,
62,
7700,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
7700,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
819,
62,
5219,
220,
220,
220,
220,
41876,
1312,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
1976,
66,
87,
62,
397,
499,
18300,
62,
66,
21130,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
7700,
62,
26069,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
1136,
7890,
220,
220,
220,
220,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
47050,
62,
7700,
220,
220,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
380,
62,
7700,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
7700,
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,
7700,
62,
1671,
3702,
62,
2502,
1177,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
1136,
7890,
220,
220,
220,
220,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
380,
62,
7700,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
7700,
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,
7700,
62,
14247,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
1136,
7890,
220,
220,
220,
220,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
380,
62,
7700,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
7700,
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,
7700,
62,
25249,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
2539,
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,
30826,
4261,
15871,
26173,
8924,
7,
380,
62,
7700,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
7700,
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,
7700,
62,
1759,
2833,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
380,
62,
7700,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
7700,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
1976,
66,
87,
62,
397,
499,
18300,
62,
66,
21130,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
4391,
62,
13812,
62,
7645,
634,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
1136,
7890,
41876,
537,
522,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
472,
353,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
651,
62,
7700,
62,
25249,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
374,
72,
62,
7700,
41876,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
65,
10025,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
2539,
796,
21628,
62,
2539,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
7700,
62,
1671,
3702,
62,
2502,
1177,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
260,
7501,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
25119,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
7700,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
2127,
332,
1177,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
2539,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
2539,
13,
628,
198,
220,
220,
220,
300,
85,
62,
2539,
796,
21628,
62,
1136,
7890,
13,
628,
220,
220,
220,
2376,
62,
260,
7501,
5633,
28,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
27891,
85,
14804,
1136,
62,
39098,
7,
1267,
3784,
1136,
7,
300,
85,
62,
2539,
6739,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
2376,
62,
7700,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
260,
7501,
796,
2376,
62,
260,
7501,
13,
628,
220,
220,
220,
374,
72,
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,
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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
] |
"! I know the level where an element was added to the model.
"! I know whether it was found in upward or downward search.
CLASS z2mse_extr3_model_builder DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
TYPES: BEGIN OF found_element_type,
where TYPE c LENGTH 1,
level TYPE i,
"! Not zero in case an element is found in up and down search. If filled this is the level for downsearch
alternate_level TYPE i,
element_type TYPE string,
parent_name TYPE string,
name TYPE string,
specific TYPE abap_bool,
up_search_done TYPE abap_bool,
down_search_done TYPE abap_bool,
END OF found_element_type.
TYPES: found_elements_type TYPE STANDARD TABLE OF found_element_type.
METHODS search
IMPORTING
i_search_up TYPE i
i_search_down TYPE i.
"! I am called once to notify that the initial selection of elements is started.
"! All elements added to the model before my method search is called belong to the level 0
METHODS initial_selection_started.
"! Called whenever a new element ID was added to the model.
"! @parameters i_is_specific | set to true if the element is added due to a specific search. It is for instance to be false, if all components of a class are added.
METHODS new_element_id
IMPORTING
i_element_id TYPE i
i_is_specific TYPE abap_bool.
METHODS initialize
IMPORTING i_element_manager TYPE REF TO z2mse_extr3_element_manager
i_dynamic_read TYPE string OPTIONAL.
METHODS write_found_elements
IMPORTING
write TYPE abap_bool OPTIONAL
EXPORTING
fes TYPE found_elements_type.
METHODS usage_of_single_element.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES: BEGIN OF found_in_level_type,
element_id TYPE z2mse_extr3_element_manager=>element_id_type,
"! A flag to mark all elements that are part of the initial selection
found_in_initial_selection TYPE abap_bool,
"! Elements that where added when the main search is finished
found_in_post_selection TYPE abap_bool,
"! Marks that an initially selected element is analyzed for lower and higher levels as requested
initially_selected_analyzed TYPE abap_bool,
"! The level where an element is first found. Needed to stop searching as specified.
"! Also required to determine whether an upward or downward search will be done.
found_in_level_upsearch TYPE i,
found_in_level_downsearch TYPE i,
"! Used to analyze usages of a single element.
"! Marks an element that is specifically marked.
"! In case a specific search is done, only elements with this flag are used for an where used analysis
specific TYPE abap_bool,
END OF found_in_level_type.
TYPES found_in_levels_type TYPE HASHED TABLE OF found_in_level_type WITH UNIQUE KEY element_id.
DATA: found_in_levels TYPE found_in_levels_type,
is_initial_selection TYPE abap_bool,
is_up_search TYPE abap_bool,
"! Add newly found elements during upsearch in this level
level_for_found_in_upsearch TYPE i,
is_down_search TYPE abap_bool,
"! Add newly found elements during downsearch in this level
level_for_found_in_downsearch TYPE i,
is_post_selection TYPE abap_bool.
TYPES: BEGIN OF builder_type,
association_builder TYPE REF TO z2mse_extr3_association_build,
END OF builder_type.
DATA element_manager TYPE REF TO z2mse_extr3_element_manager.
"! Use for initial search
DATA association_builders_init TYPE STANDARD TABLE OF builder_type.
"! Use for final search
DATA association_builders_post TYPE STANDARD TABLE OF builder_type.
"! Use for search
DATA association_builders TYPE STANDARD TABLE OF builder_type.
DATA: tadir_builder TYPE REF TO z2mse_extr3_tadir_builder,
where_used_builder TYPE REF TO z2mse_extr3_where_used_builder.
"! A single element is analyzed of usage and using
DATA is_usage_of_single_element TYPE abap_bool.
METHODS _post_search.
METHODS _initial_search.
METHODS _search_up
IMPORTING
i_search_up TYPE i.
METHODS _search_down
IMPORTING
i_search_down TYPE i.
ENDCLASS.
CLASS z2mse_extr3_model_builder IMPLEMENTATION.
METHOD initialize.
element_manager = i_element_manager.
DATA association_builder_init TYPE builder_type.
CREATE OBJECT tadir_builder EXPORTING i_element_manager = i_element_manager.
association_builder_init-association_builder = tadir_builder.
INSERT association_builder_init INTO TABLE association_builders_init.
DATA association_builder_post TYPE builder_type.
CREATE OBJECT tadir_builder EXPORTING i_element_manager = i_element_manager.
association_builder_post-association_builder = tadir_builder.
INSERT association_builder_post INTO TABLE association_builders_post.
DATA association_builder TYPE builder_type.
CREATE OBJECT where_used_builder EXPORTING i_element_manager = i_element_manager.
where_used_builder->set_dynamic_read( i_dynamic_read = i_dynamic_read ).
association_builder-association_builder = where_used_builder.
INSERT association_builder INTO TABLE association_builders.
ENDMETHOD.
METHOD initial_selection_started.
is_initial_selection = abap_true.
ENDMETHOD.
METHOD new_element_id.
DATA: found_in_level TYPE found_in_level_type,
is_new_line TYPE abap_bool.
FIELD-SYMBOLS <found_in_level> TYPE found_in_level_type.
ASSERT i_element_id IS NOT INITIAL.
READ TABLE found_in_levels ASSIGNING <found_in_level> WITH TABLE KEY element_id = i_element_id.
IF sy-subrc <> 0.
is_new_line = abap_true.
ASSIGN found_in_level TO <found_in_level>.
<found_in_level>-element_id = i_element_id.
ENDIF.
IF is_initial_selection EQ abap_true.
<found_in_level>-found_in_initial_selection = abap_true.
IF i_is_specific EQ abap_true.
<found_in_level>-specific = abap_true.
ENDIF.
ELSEIF is_up_search EQ abap_true.
IF <found_in_level>-found_in_level_upsearch IS INITIAL.
<found_in_level>-found_in_level_upsearch = level_for_found_in_upsearch.
ENDIF.
IF i_is_specific EQ abap_true AND <found_in_level>-specific EQ abap_false.
<found_in_level>-found_in_level_upsearch = level_for_found_in_upsearch.
<found_in_level>-specific = abap_true.
ENDIF.
* IF <found_in_level>-found_in_level_upsearch EQ level_for_found_in_upsearch
* AND i_is_specific EQ abap_true.
*
* <found_in_level>-specific = abap_true.
*
* ENDIF.
ELSEIF is_down_search EQ abap_true.
IF <found_in_level>-found_in_level_downsearch IS INITIAL.
<found_in_level>-found_in_level_downsearch = level_for_found_in_downsearch.
ENDIF.
IF i_is_specific EQ abap_true AND <found_in_level>-specific EQ abap_false.
<found_in_level>-found_in_level_downsearch = level_for_found_in_downsearch.
<found_in_level>-specific = abap_true.
ENDIF.
* IF <found_in_level>-found_in_level_downsearch = level_for_found_in_downsearch
* AND i_is_specific EQ abap_true.
*
* <found_in_level>-specific = abap_true.
*
* ENDIF.
ELSEIF is_post_selection EQ abap_true.
<found_in_level>-found_in_post_selection = abap_true.
ELSE.
ASSERT 1 = 2.
ENDIF.
IF is_new_line EQ abap_true.
INSERT <found_in_level> INTO TABLE found_in_levels.
ASSERT sy-subrc EQ 0.
ENDIF.
ENDMETHOD.
METHOD search.
_initial_search( ).
_search_up( i_search_up ).
_search_down( i_search_down ).
_post_search( ).
ENDMETHOD.
METHOD usage_of_single_element.
is_usage_of_single_element = abap_true.
ENDMETHOD.
METHOD write_found_elements.
DATA fil TYPE found_in_level_type.
DATA: fe TYPE found_element_type.
LOOP AT found_in_levels INTO fil.
CLEAR fe.
fe-specific = fil-specific.
IF fil-found_in_initial_selection EQ abap_true.
fe-where = |I|.
ELSEIF fil-found_in_post_selection EQ abap_true.
fe-where = |P|.
ELSE.
fe-where = |S|.
ENDIF.
IF fil-found_in_level_upsearch <> 0
AND fil-found_in_level_downsearch <> 0.
fe-level = fil-found_in_level_upsearch.
fe-alternate_level = -1 * fil-found_in_level_downsearch.
ELSEIF fil-found_in_level_upsearch <> 0.
fe-level = fil-found_in_level_upsearch.
ELSEIF fil-found_in_level_downsearch <> 0.
fe-level = -1 * fil-found_in_level_downsearch.
ELSE.
fe-level = 0.
ENDIF.
DATA element TYPE REF TO z2mse_extr3_elements.
element = element_manager->get_element( i_element_id = fil-element_id ).
element->name( EXPORTING element_id = fil-element_id
IMPORTING element_type = fe-element_type
parent_name = fe-parent_name
name = fe-name ).
IF is_usage_of_single_element EQ abap_true
AND fe-specific EQ abap_false.
CONTINUE.
ENDIF.
INSERT fe INTO TABLE fes.
ENDLOOP.
IF is_usage_of_single_element EQ abap_true.
SORT fes BY level alternate_level element_type parent_name name.
ELSE.
SORT fes BY where level alternate_level element_type parent_name name.
ENDIF.
IF write EQ abap_true.
WRITE: / 'Legend:'.
WRITE: / 'W - "I" Found in initial search "P" Found in final search (packages that where not initially selected) "S" Found in regular search'.
WRITE: / 'L - Level where an element is found'.
WRITE: / 'AL - In case an element is found in down and up search, this is the level where it is found in down search'.
WRITE: /.
FORMAT COLOR COL_HEADING.
WRITE: /(1) 'W',
(3) 'L',
(3) 'AL',
(30) 'Type',
(30) 'Name of Parent',
(61) 'Name'.
FORMAT COLOR COL_BACKGROUND.
LOOP AT fes INTO fe.
NEW-LINE.
WRITE: /(1) fe-where,
(3) fe-level,
(3) fe-alternate_level,
(30) fe-element_type,
(30) fe-parent_name,
(61) fe-name. " Interface method and attributes can yield to very long names. So 2 times 30 plus 1 should be enough.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD _post_search.
DATA found_in_level TYPE z2mse_extr3_model_builder=>found_in_level_type.
DATA association_builder TYPE z2mse_extr3_model_builder=>builder_type.
" Post search
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING text = 'Final actions of search'.
is_post_selection = abap_true.
DATA all_elements TYPE found_in_levels_type.
all_elements = found_in_levels.
LOOP AT association_builders_post INTO association_builder.
LOOP AT all_elements INTO found_in_level.
* IF is_usage_of_single_element EQ abap_true
* AND found_in_level-specific EQ abap_false.
* CONTINUE. " Only a single element is analyzed, include only specific elements into where used analysis
* ENDIF.
association_builder-association_builder->search_up( element_id = found_in_level-element_id ).
ENDLOOP.
ENDLOOP.
is_post_selection = abap_false.
ENDMETHOD.
METHOD _initial_search.
" Initial search
DATA: found_in_level TYPE found_in_level_type,
first_initial_elements TYPE found_in_levels_type,
association_builder TYPE z2mse_extr3_model_builder=>builder_type.
" found_in_levels will be updated in this method, so add this elements to a new temporary table.
IF is_usage_of_single_element EQ abap_false.
FIELD-SYMBOLS: <fil> TYPE found_in_level_type.
LOOP AT found_in_levels ASSIGNING <fil> WHERE found_in_initial_selection EQ abap_true.
<fil>-initially_selected_analyzed = abap_true.
INSERT <fil> INTO TABLE first_initial_elements.
ENDLOOP.
LOOP AT association_builders_init INTO association_builder.
LOOP AT first_initial_elements INTO found_in_level.
association_builder-association_builder->search_down( element_id = found_in_level-element_id ).
ENDLOOP.
ENDLOOP.
ENDIF.
is_initial_selection = abap_false.
IF is_usage_of_single_element EQ abap_false.
" All initially selected elements are marked as specific so that they are correctly searched
FIELD-SYMBOLS: <fil2> TYPE found_in_level_type.
LOOP AT found_in_levels ASSIGNING <fil2>.
<fil2>-specific = abap_true.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD _search_up.
" Search up
is_up_search = abap_true.
DATA: level_to_search_up TYPE i,
something_to_be_done_up TYPE abap_bool.
IF i_search_up <> 0.
something_to_be_done_up = abap_true.
WHILE something_to_be_done_up EQ abap_true.
DATA temp TYPE string.
temp = |Search up for level { level_to_search_up }|. "To be 7.02 compatible
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING text = temp.
something_to_be_done_up = abap_false.
FIELD-SYMBOLS: <fil> TYPE found_in_level_type.
LOOP AT found_in_levels ASSIGNING <fil> WHERE found_in_level_upsearch = level_to_search_up.
IF <fil>-specific EQ abap_false.
CONTINUE. " Only a single element is analyzed, include only specific elements into where used analysis
ENDIF.
level_for_found_in_upsearch = <fil>-found_in_level_upsearch + 1.
DATA association_builder TYPE z2mse_extr3_model_builder=>builder_type.
LOOP AT association_builders INTO association_builder.
association_builder-association_builder->search_up( element_id = <fil>-element_id ).
ENDLOOP.
something_to_be_done_up = abap_true.
ENDLOOP.
ADD 1 TO level_to_search_up.
IF i_search_up >= 0 AND i_search_up <= level_to_search_up.
something_to_be_done_up = abap_false.
ENDIF.
ENDWHILE.
ENDIF.
" SAP_2_FAMIX_68 When more than a single level is searched up, the up search is not done for elements that where found in the search down
" Fullfilled because the search down starts here
is_up_search = abap_false.
ENDMETHOD.
METHOD _search_down.
" Search down
is_down_search = abap_true.
DATA: level_to_search_down TYPE i,
something_to_be_done_down TYPE abap_bool.
IF i_search_down <> 0.
something_to_be_done_down = abap_true.
WHILE something_to_be_done_down EQ abap_true.
DATA temp TYPE string.
temp = |Search down for level { level_to_search_down }|."To be 7.02 compatible
CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING text = temp.
something_to_be_done_down = abap_false.
FIELD-SYMBOLS: <fil> TYPE found_in_level_type.
LOOP AT found_in_levels ASSIGNING <fil> WHERE found_in_level_downsearch = level_to_search_down.
IF
* is_usage_of_single_element EQ abap_true
* AND
<fil>-specific EQ abap_false.
CONTINUE. " Only a single element is analyzed, include only specific elements into where used analysis
ENDIF.
IF level_to_search_down EQ 0.
IF <fil>-found_in_initial_selection EQ abap_false.
" SAP_2_FAMIX_69 When more than a single level is searched down, the down search is not done for elements that where found in the search up
CONTINUE. "Start searching down with the elements found in the initial selection. Ignore all that was found in upsearch
ELSE.
IF is_usage_of_single_element EQ abap_true AND (
<fil>-specific EQ abap_false OR
<fil>-found_in_level_upsearch > 0 ).
CONTINUE. " No downsearch for elements that are in initially selected classes but are not initially selected.
" They are not initially selected when found in level upsearch is greater than zero
ENDIF.
ENDIF.
ENDIF.
level_for_found_in_downsearch = <fil>-found_in_level_downsearch + 1.
DATA association_builder TYPE z2mse_extr3_model_builder=>builder_type.
LOOP AT association_builders INTO association_builder.
association_builder-association_builder->search_down( element_id = <fil>-element_id ).
ENDLOOP.
something_to_be_done_down = abap_true.
ENDLOOP.
ADD 1 TO level_to_search_down.
IF i_search_down >= 0 AND i_search_down <= level_to_search_down.
something_to_be_done_down = abap_false.
ENDIF.
ENDWHILE.
ENDIF.
is_down_search = abap_false.
ENDMETHOD.
ENDCLASS.
| [
40484,
314,
760,
262,
1241,
810,
281,
5002,
373,
2087,
284,
262,
2746,
13,
198,
40484,
314,
760,
1771,
340,
373,
1043,
287,
18644,
393,
20841,
2989,
13,
198,
31631,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
19849,
62,
38272,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1043,
62,
30854,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
810,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
406,
49494,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1241,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
0,
1892,
6632,
287,
1339,
281,
5002,
318,
1043,
287,
510,
290,
866,
2989,
13,
1002,
5901,
428,
318,
262,
1241,
329,
866,
12947,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13527,
62,
5715,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5002,
62,
4906,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2560,
62,
3672,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2176,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
510,
62,
12947,
62,
28060,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
866,
62,
12947,
62,
28060,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1043,
62,
30854,
62,
4906,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
1043,
62,
68,
3639,
62,
4906,
41876,
49053,
9795,
43679,
3963,
1043,
62,
30854,
62,
4906,
13,
198,
220,
220,
220,
337,
36252,
50,
2989,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
12947,
62,
929,
220,
220,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
12947,
62,
2902,
41876,
1312,
13,
198,
220,
220,
220,
366,
0,
314,
716,
1444,
1752,
284,
19361,
326,
262,
4238,
6356,
286,
4847,
318,
2067,
13,
198,
220,
220,
220,
366,
0,
1439,
4847,
2087,
284,
262,
2746,
878,
616,
2446,
2989,
318,
1444,
5594,
284,
262,
1241,
657,
198,
220,
220,
220,
337,
36252,
50,
4238,
62,
49283,
62,
46981,
13,
198,
220,
220,
220,
366,
0,
34099,
8797,
257,
649,
5002,
4522,
373,
2087,
284,
262,
2746,
13,
198,
220,
220,
220,
366,
0,
2488,
17143,
7307,
1312,
62,
271,
62,
11423,
930,
900,
284,
2081,
611,
262,
5002,
318,
2087,
2233,
284,
257,
2176,
2989,
13,
632,
318,
329,
4554,
284,
307,
3991,
11,
611,
477,
6805,
286,
257,
1398,
389,
2087,
13,
198,
220,
220,
220,
337,
36252,
50,
649,
62,
30854,
62,
312,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
30854,
62,
312,
220,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
271,
62,
11423,
41876,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
337,
36252,
50,
41216,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
1312,
62,
30854,
62,
37153,
41876,
4526,
37,
5390,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
30854,
62,
37153,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
67,
28995,
62,
961,
220,
220,
220,
41876,
4731,
39852,
2849,
1847,
13,
198,
220,
220,
220,
337,
36252,
50,
3551,
62,
9275,
62,
68,
3639,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
3551,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
277,
274,
220,
220,
41876,
1043,
62,
68,
3639,
62,
4906,
13,
198,
220,
220,
220,
337,
36252,
50,
8748,
62,
1659,
62,
29762,
62,
30854,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1043,
62,
259,
62,
5715,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5002,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
30854,
62,
37153,
14804,
30854,
62,
312,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
0,
317,
6056,
284,
1317,
477,
4847,
326,
389,
636,
286,
262,
4238,
6356,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1043,
62,
259,
62,
36733,
62,
49283,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
0,
26632,
326,
810,
2087,
618,
262,
1388,
2989,
318,
5201,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1043,
62,
259,
62,
7353,
62,
49283,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
0,
27366,
326,
281,
7317,
6163,
5002,
318,
15475,
329,
2793,
290,
2440,
2974,
355,
9167,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7317,
62,
34213,
62,
38200,
8863,
41876,
450,
499,
62,
30388,
11,
198,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
"! Static registry class to find {@link ZIF_ABAPGIT_2FA_AUTHENTICATOR} instances
CLASS zcl_abapgit_2fa_auth_registry DEFINITION
PUBLIC
FINAL
CREATE PRIVATE .
PUBLIC SECTION.
CLASS-METHODS:
class_constructor,
"! Retrieve an authenticator instance by url
"! @parameter iv_url | Url of the repository / service
"! @parameter ri_authenticator | Found authenticator instance
"! @raising zcx_abapgit_2fa_unsupported | No authenticator found that supports the service
get_authenticator_for_url IMPORTING iv_url TYPE string
RETURNING VALUE(ri_authenticator) TYPE REF TO zif_abapgit_2fa_authenticator
RAISING zcx_abapgit_2fa_unsupported,
"! Check if there is a two factor authenticator available for the url
"! @parameter iv_url | Url of the repository / service
"! @parameter rv_supported | 2FA is supported
is_url_supported IMPORTING iv_url TYPE string
RETURNING VALUE(rv_supported) TYPE abap_bool,
"! Offer to use two factor authentication if supported and required
"! <p>
"! This uses GUI functionality to display a popup to request the user to enter a two factor
"! token. Also an dummy authentication request might be used to find out if two factor
"! authentication is required for the account.
"! </p>
"! @parameter iv_url | Url of the repository / service
"! @parameter cv_username | Username
"! @parameter cv_password | Password, will be replaced by an access token if two factor
"! authentication succeeds
"! @raising zcx_abapgit_exception | Error in two factor authentication
use_2fa_if_required IMPORTING iv_url TYPE string
CHANGING cv_username TYPE string
cv_password TYPE string
RAISING zcx_abapgit_exception.
CLASS-DATA:
"! All authenticators managed by the registry
gt_registered_authenticators TYPE HASHED TABLE OF REF TO zif_abapgit_2fa_authenticator
WITH UNIQUE KEY table_line READ-ONLY.
PRIVATE SECTION.
CLASS-METHODS:
popup_token
RETURNING VALUE(rv_token) TYPE string
RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_2FA_AUTH_REGISTRY IMPLEMENTATION.
METHOD class_constructor.
DATA: lt_sub TYPE seo_relkeys,
ls_sub LIKE LINE OF lt_sub,
li_authenticator TYPE REF TO zif_abapgit_2fa_authenticator,
lo_class TYPE REF TO cl_oo_class.
TRY.
lo_class ?= cl_oo_class=>get_instance( 'ZCL_ABAPGIT_2FA_AUTH_BASE' ).
lt_sub = lo_class->get_subclasses( ).
SORT lt_sub BY clsname ASCENDING AS TEXT.
LOOP AT lt_sub INTO ls_sub.
CREATE OBJECT li_authenticator TYPE (ls_sub-clsname).
INSERT li_authenticator INTO TABLE gt_registered_authenticators.
ENDLOOP.
CATCH cx_class_not_existent.
* class in local report
CREATE OBJECT li_authenticator TYPE zcl_abapgit_2fa_github_auth.
INSERT li_authenticator INTO TABLE gt_registered_authenticators.
ENDTRY.
ENDMETHOD.
METHOD get_authenticator_for_url.
FIELD-SYMBOLS: <li_authenticator> LIKE LINE OF gt_registered_authenticators.
LOOP AT gt_registered_authenticators ASSIGNING <li_authenticator>.
IF <li_authenticator>->supports_url( iv_url ) = abap_true.
ri_authenticator = <li_authenticator>.
RETURN.
ENDIF.
ENDLOOP.
RAISE EXCEPTION TYPE zcx_abapgit_2fa_unsupported.
ENDMETHOD.
METHOD is_url_supported.
TRY.
get_authenticator_for_url( iv_url ).
rv_supported = abap_true.
CATCH zcx_abapgit_2fa_unsupported ##NO_HANDLER.
ENDTRY.
ENDMETHOD.
METHOD popup_token.
DATA: lv_returncode TYPE c,
lt_fields TYPE TABLE OF sval.
FIELD-SYMBOLS: <ls_field> LIKE LINE OF lt_fields.
APPEND INITIAL LINE TO lt_fields ASSIGNING <ls_field>.
<ls_field>-tabname = 'TADIR'.
<ls_field>-fieldname = 'OBJ_NAME'.
<ls_field>-fieldtext = 'Two factor auth. token'.
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
no_value_check = abap_true
popup_title = 'Two factor auth. token'
IMPORTING
returncode = lv_returncode
TABLES
fields = lt_fields
EXCEPTIONS
error_in_fields = 1
OTHERS = 2. "#EC NOTEXT
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error from POPUP_GET_VALUES' ).
ENDIF.
IF lv_returncode = 'A'.
zcx_abapgit_exception=>raise( 'Authentication cancelled' ).
ENDIF.
READ TABLE lt_fields INDEX 1 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
rv_token = <ls_field>-value.
ENDMETHOD.
METHOD use_2fa_if_required.
DATA: li_authenticator TYPE REF TO zif_abapgit_2fa_authenticator,
lv_2fa_token TYPE string,
lv_access_token TYPE string,
lx_ex TYPE REF TO cx_root.
IF is_url_supported( iv_url ) = abap_false.
RETURN.
ENDIF.
TRY.
li_authenticator = get_authenticator_for_url( iv_url ).
li_authenticator->begin( ).
" Is two factor authentication required for this account?
IF li_authenticator->is_2fa_required( iv_url = iv_url
iv_username = cv_username
iv_password = cv_password ) = abap_true.
lv_2fa_token = popup_token( ).
" Delete an old access token if it exists
li_authenticator->delete_access_tokens( iv_url = iv_url
iv_username = cv_username
iv_password = cv_password
iv_2fa_token = lv_2fa_token ).
" Get a new access token
lv_access_token = li_authenticator->authenticate( iv_url = iv_url
iv_username = cv_username
iv_password = cv_password
iv_2fa_token = lv_2fa_token ).
" Use the access token instead of the password
cv_password = lv_access_token.
ENDIF.
li_authenticator->end( ).
CATCH zcx_abapgit_2fa_error INTO lx_ex.
TRY.
li_authenticator->end( ).
CATCH zcx_abapgit_2fa_illegal_state ##NO_HANDLER.
ENDTRY.
zcx_abapgit_exception=>raise( |2FA error: { lx_ex->get_text( ) }| ).
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
40484,
36125,
20478,
1398,
284,
1064,
1391,
31,
8726,
1168,
5064,
62,
6242,
2969,
38,
2043,
62,
17,
7708,
62,
32,
24318,
3525,
2149,
25633,
92,
10245,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
17,
13331,
62,
18439,
62,
2301,
4592,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
4810,
3824,
6158,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
25,
198,
220,
220,
220,
220,
220,
1398,
62,
41571,
273,
11,
198,
220,
220,
220,
220,
220,
366,
0,
4990,
30227,
281,
16425,
1352,
4554,
416,
19016,
198,
220,
220,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
6371,
930,
8799,
75,
286,
262,
16099,
1220,
2139,
198,
220,
220,
220,
220,
220,
366,
0,
2488,
17143,
2357,
374,
72,
62,
41299,
26407,
930,
4062,
16425,
1352,
4554,
198,
220,
220,
220,
220,
220,
366,
0,
2488,
32741,
1976,
66,
87,
62,
397,
499,
18300,
62,
17,
13331,
62,
403,
15999,
930,
1400,
16425,
1352,
1043,
326,
6971,
262,
2139,
198,
220,
220,
220,
220,
220,
651,
62,
41299,
26407,
62,
1640,
62,
6371,
30023,
9863,
2751,
21628,
62,
6371,
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,
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,
380,
62,
41299,
26407,
8,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
17,
13331,
62,
41299,
26407,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
17,
13331,
62,
403,
15999,
11,
198,
220,
220,
220,
220,
220,
366,
0,
6822,
611,
612,
318,
257,
734,
5766,
16425,
1352,
1695,
329,
262,
19016,
198,
220,
220,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
6371,
930,
8799,
75,
286,
262,
16099,
1220,
2139,
198,
220,
220,
220,
220,
220,
366,
0,
2488,
17143,
2357,
374,
85,
62,
15999,
930,
362,
7708,
318,
4855,
198,
220,
220,
220,
220,
220,
318,
62,
6371,
62,
15999,
30023,
9863,
2751,
21628,
62,
6371,
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,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
15999,
8,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
366,
0,
33085,
284,
779,
734,
5766,
18239,
611,
4855,
290,
2672,
198,
220,
220,
220,
220,
220,
366,
0,
1279,
79,
29,
198,
220,
220,
220,
220,
220,
366,
0,
770,
3544,
25757,
11244,
284,
3359,
257,
46207,
284,
2581,
262,
2836,
284,
3802,
257,
734,
5766,
198,
220,
220,
220,
220,
220,
366,
0,
11241,
13,
4418,
281,
31548,
18239,
2581,
1244,
307,
973,
284,
1064,
503,
611,
734,
5766,
198,
220,
220,
220,
220,
220,
366,
0,
18239,
318,
2672,
329,
262,
1848,
13,
198,
220,
220,
220,
220,
220,
366,
0,
7359,
79,
29,
198,
220,
220,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
6371,
930,
8799,
75,
286,
262,
16099,
1220,
2139,
198,
220,
220,
220,
220,
220,
366,
0,
2488,
17143,
2357,
269,
85,
62,
29460,
930,
50069,
198,
220,
220,
220,
220,
220,
366,
0,
2488,
17143,
2357,
269,
85,
62,
28712,
930,
30275,
11,
481,
307,
6928,
416,
281,
1895,
11241,
611,
734,
5766,
198,
220,
220,
220,
220,
220,
366,
0,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
18239,
31137,
198,
220,
220,
220,
220,
220,
366,
0,
2488,
32741,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
930,
13047,
287,
734,
5766,
18239,
198,
220,
220,
220,
220,
220,
779,
62,
17,
13331,
62,
361,
62,
35827,
30023,
9863,
2751,
21628,
62,
6371,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
220,
269,
85,
62,
29460,
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,
269,
85,
62,
28712,
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,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
220,
220,
220,
42715,
12,
26947,
25,
198,
220,
220,
220,
220,
220,
366,
0,
1439,
16425,
2024,
5257,
416,
262,
20478,
198,
220,
220,
220,
220,
220,
308,
83,
62,
33736,
62,
41299,
44549,
41876,
367,
11211,
1961,
43679,
3963,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
17,
13331,
62,
41299,
26407,
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,
13315,
4725,
33866,
8924,
35374,
3084,
62,
1370,
20832,
12,
1340,
11319,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
25,
198,
220,
220,
220,
220,
220,
46207,
62,
30001,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
30001,
8,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
198,
10619,
31631,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS lcl_db_reader IMPLEMENTATION.
METHOD lif_db_reader~is_fm_rfc_enabled.
SELECT SINGLE fmode FROM tfdir
WHERE funcname = @function
AND fmode EQ 'R'
INTO @DATA(mode).
result = xsdbool( sy-subrc EQ 0 ).
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
565,
62,
9945,
62,
46862,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
3868,
62,
9945,
62,
46862,
93,
271,
62,
38353,
62,
81,
16072,
62,
25616,
13,
198,
220,
220,
220,
33493,
311,
2751,
2538,
277,
14171,
16034,
48700,
15908,
198,
220,
220,
220,
220,
220,
33411,
25439,
3672,
796,
2488,
8818,
198,
220,
220,
220,
220,
220,
220,
220,
5357,
277,
14171,
36529,
705,
49,
6,
198,
220,
220,
220,
220,
220,
39319,
2488,
26947,
7,
14171,
737,
198,
220,
220,
220,
1255,
796,
2124,
82,
9945,
970,
7,
827,
12,
7266,
6015,
36529,
657,
6739,
198,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_gui_page_main DEFINITION
PUBLIC
FINAL
CREATE PUBLIC INHERITING FROM zcl_abapgit_gui_page.
PUBLIC SECTION.
INTERFACES: zif_abapgit_gui_hotkeys.
METHODS:
constructor
RAISING zcx_abapgit_exception,
zif_abapgit_gui_event_handler~on_event REDEFINITION.
PROTECTED SECTION.
METHODS:
render_content REDEFINITION.
PRIVATE SECTION.
CONSTANTS:
BEGIN OF c_actions,
show TYPE string VALUE 'show' ##NO_TEXT,
overview TYPE string VALUE 'overview',
select TYPE string VALUE 'select',
apply_filter TYPE string VALUE 'apply_filter',
abapgit_home TYPE string VALUE 'abapgit_home',
END OF c_actions.
DATA: mo_repo_overview TYPE REF TO zcl_abapgit_gui_page_repo_over,
mv_repo_key TYPE zif_abapgit_persistence=>ty_value.
METHODS build_main_menu
RETURNING VALUE(ro_menu) TYPE REF TO zcl_abapgit_html_toolbar.
ENDCLASS.
CLASS zcl_abapgit_gui_page_main IMPLEMENTATION.
METHOD build_main_menu.
CREATE OBJECT ro_menu EXPORTING iv_id = 'toolbar-main'.
ro_menu->add(
iv_txt = zcl_abapgit_gui_buttons=>new_online( )
iv_act = zif_abapgit_definitions=>c_action-repo_newonline
)->add(
iv_txt = zcl_abapgit_gui_buttons=>new_offline( )
iv_act = zif_abapgit_definitions=>c_action-repo_newoffline
)->add(
iv_txt = zcl_abapgit_gui_buttons=>settings( )
iv_act = zif_abapgit_definitions=>c_action-go_settings
)->add(
iv_txt = zcl_abapgit_gui_buttons=>advanced( )
iv_title = 'Utilities'
io_sub = zcl_abapgit_gui_chunk_lib=>advanced_submenu( )
)->add(
iv_txt = zcl_abapgit_gui_buttons=>help( )
iv_title = 'Help'
io_sub = zcl_abapgit_gui_chunk_lib=>help_submenu( ) ).
ENDMETHOD.
METHOD constructor.
super->constructor( ).
ms_control-page_menu = build_main_menu( ).
ms_control-page_title = 'Repository List'.
ENDMETHOD.
METHOD render_content.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
gui_services( )->get_hotkeys_ctl( )->register_hotkeys( me ).
IF mo_repo_overview IS INITIAL.
CREATE OBJECT mo_repo_overview.
ENDIF.
ri_html->add( mo_repo_overview->zif_abapgit_gui_renderable~render( ) ).
register_deferred_script( zcl_abapgit_gui_chunk_lib=>render_repo_palette( c_actions-select ) ).
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
DATA: lv_key TYPE zif_abapgit_persistence=>ty_value.
DATA: lo_repo TYPE REF TO zcl_abapgit_repo.
lv_key = ii_event->query( )->get( 'KEY' ).
CASE ii_event->mv_action.
WHEN c_actions-abapgit_home.
CLEAR mv_repo_key.
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN c_actions-select.
zcl_abapgit_persistence_user=>get_instance( )->set_repo_show( lv_key ).
TRY.
zcl_abapgit_repo_srv=>get_instance( )->get( lv_key )->refresh( ).
CATCH zcx_abapgit_exception ##NO_HANDLER.
ENDTRY.
mv_repo_key = lv_key.
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_repo_view
EXPORTING
iv_key = lv_key.
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-change_order_by.
mo_repo_overview->set_order_by( ii_event->query( )->get( 'ORDERBY' ) ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-direction.
mo_repo_overview->set_order_direction(
boolc( ii_event->query( )->get( 'DIRECTION' ) = 'DESCENDING' ) ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN c_actions-apply_filter.
mo_repo_overview->set_filter( ii_event->mt_postdata ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-go_patch.
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_patch
EXPORTING
iv_key = lv_key.
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-repo_settings.
CREATE OBJECT rs_handled-page TYPE zcl_abapgit_gui_page_repo_sett
EXPORTING
io_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN OTHERS.
rs_handled = super->zif_abapgit_gui_event_handler~on_event( ii_event ).
ENDCASE.
ENDMETHOD.
METHOD zif_abapgit_gui_hotkeys~get_hotkey_actions.
DATA: ls_hotkey_action LIKE LINE OF rt_hotkey_actions.
ls_hotkey_action-ui_component = 'Main'.
ls_hotkey_action-description = |abapGit settings|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_settings.
ls_hotkey_action-hotkey = |x|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-description = |New online repository|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-repo_newonline.
ls_hotkey_action-hotkey = |n|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ls_hotkey_action-description = |New offline repository|.
ls_hotkey_action-action = zif_abapgit_definitions=>c_action-repo_newoffline.
ls_hotkey_action-hotkey = |o|.
INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
12417,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
25,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
8940,
13083,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
15596,
62,
30281,
93,
261,
62,
15596,
23848,
36,
20032,
17941,
13,
628,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
8543,
62,
11299,
23848,
36,
20032,
17941,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
269,
62,
4658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
905,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
12860,
6,
22492,
15285,
62,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
16700,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
2502,
1177,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
2922,
220,
220,
220,
220,
220,
220,
41876,
4731,
26173,
8924,
705,
19738,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
4174,
62,
24455,
41876,
4731,
26173,
8924,
705,
39014,
62,
24455,
3256,
198,
220,
220,
220,
220,
220,
220,
220,
450,
499,
18300,
62,
11195,
41876,
4731,
26173,
8924,
705,
397,
499,
18300,
62,
11195,
3256,
198,
220,
220,
220,
220,
220,
23578,
3963,
269,
62,
4658,
13,
628,
220,
220,
220,
42865,
25,
6941,
62,
260,
7501,
62,
2502,
1177,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
260,
7501,
62,
2502,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
85,
62,
260,
7501,
62,
2539,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
8367,
13,
628,
220,
220,
220,
337,
36252,
50,
1382,
62,
12417,
62,
26272,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
305,
62,
26272,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6494,
62,
25981,
5657,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
7700,
62,
12417,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1382,
62,
12417,
62,
26272,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
686,
62,
26272,
7788,
15490,
2751,
21628,
62,
312,
796,
705,
25981,
5657,
12,
12417,
4458,
628,
220,
220,
220,
686,
62,
26272,
3784,
2860,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
14116,
796,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
4360,
27288,
14804,
3605,
62,
25119,
7,
1267,
198,
220,
220,
220,
220,
220,
21628,
62,
529,
796,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
66,
62,
2673,
12,
260,
7501,
62,
3605,
25119,
198,
220,
220,
220,
1267,
3784,
2860,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
14116,
796,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
4360,
27288,
14804,
3605,
62,
2364,
1370,
7,
1267,
198,
220,
220,
220,
220,
220,
21628,
62,
529,
796,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
66,
62,
2673,
12,
260,
7501,
62,
3605,
2364,
1370,
198,
220,
220,
220,
1267,
3784,
2860,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
14116,
796,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
4360,
27288,
14804,
33692,
7,
1267,
198,
220,
220,
220,
220,
220,
21628,
62,
529,
796,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
66,
62,
2673,
12,
2188,
62,
33692,
198,
220,
220,
220,
1267,
3784,
2860,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
14116,
796,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
4360,
27288,
14804,
32225,
2903,
7,
1267,
198,
220,
220,
220,
220,
220,
21628,
62,
7839,
796,
705,
18274,
2410,
6,
198,
220,
220,
220,
220,
220,
33245,
62,
7266,
796,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
354,
2954,
62,
8019,
14804,
32225,
2903,
62,
7266,
26272,
7,
1267,
198,
220,
220,
220,
1267,
3784,
2860,
7,
198,
220,
220,
220,
220,
220,
21628,
62,
14116,
796,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
4360,
27288,
14804,
16794,
7,
1267,
198,
220,
220,
220,
220,
220,
21628,
62,
7839,
796,
705,
22087,
6,
198,
220,
220,
220,
220,
220,
33245,
62,
7266,
796,
1976,
565,
62,
397,
499,
18300,
62,
48317,
62,
354,
2954,
62,
8019,
14804,
16794,
62,
7266,
26272,
7,
1267,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
6739,
198,
220,
220,
220,
13845,
62,
13716,
12,
7700,
62,
26272,
220,
796,
1382,
62,
12417,
62,
26272,
7,
6739,
198,
220,
220,
220,
13845,
62,
13716,
12,
7700,
62,
7839,
796,
705,
6207,
13264,
7343,
4458,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
8543,
62,
11299,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
374,
72,
62,
6494,
41876,
1976,
565,
62,
397,
499,
18300,
62,
6494,
13,
198,
220,
220,
220,
11774,
62,
30416,
7,
1267,
3784,
1136,
62,
8940,
13083,
62,
34168,
7,
1267,
3784,
30238,
62,
8940,
13083,
7,
502,
6739,
628,
220,
220,
220,
16876,
6941,
62,
260,
7501,
62,
2502,
1177,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
29244,
6158,
25334,
23680,
6941,
62,
260,
7501,
62,
2502,
1177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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
] |
CLASS cl_shm_area DEFINITION PUBLIC.
PUBLIC SECTION.
CONSTANTS affect_all_servers TYPE c LENGTH 1 VALUE 'A'.
ENDCLASS.
CLASS cl_shm_area IMPLEMENTATION.
ENDCLASS. | [
31631,
537,
62,
1477,
76,
62,
20337,
5550,
20032,
17941,
44731,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
2689,
62,
439,
62,
2655,
690,
41876,
269,
406,
49494,
352,
26173,
8924,
705,
32,
4458,
198,
198,
10619,
31631,
13,
198,
198,
31631,
537,
62,
1477,
76,
62,
20337,
30023,
2538,
10979,
6234,
13,
198,
198,
10619,
31631,
13
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*---------------------------------------------------------------------*
* view related FORM routines
*---------------------------------------------------------------------*
*...processing: ZDOP_MV_EMPLOYEE................................*
FORM GET_DATA_ZDOP_MV_EMPLOYEE.
PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
REFRESH TOTAL.
CLEAR TOTAL.
SELECT * FROM ZDOP_EMPLOYEE WHERE
(VIM_WHERETAB) .
CLEAR ZDOP_MV_EMPLOYEE .
ZDOP_MV_EMPLOYEE-MANDT =
ZDOP_EMPLOYEE-MANDT .
ZDOP_MV_EMPLOYEE-EMPID =
ZDOP_EMPLOYEE-EMPID .
ZDOP_MV_EMPLOYEE-EMPNAME =
ZDOP_EMPLOYEE-EMPNAME .
ZDOP_MV_EMPLOYEE-BIRTHDATE =
ZDOP_EMPLOYEE-BIRTHDATE .
ZDOP_MV_EMPLOYEE-ADDRESS =
ZDOP_EMPLOYEE-ADDRESS .
<VIM_TOTAL_STRUC> = ZDOP_MV_EMPLOYEE.
APPEND TOTAL.
ENDSELECT.
SORT TOTAL BY <VIM_XTOTAL_KEY>.
<STATUS>-ALR_SORTED = 'R'.
*.check dynamic selectoptions (not in DDIC)...........................*
IF X_HEADER-SELECTION NE SPACE.
PERFORM CHECK_DYNAMIC_SELECT_OPTIONS.
ELSEIF X_HEADER-DELMDTFLAG NE SPACE.
PERFORM BUILD_MAINKEY_TAB.
ENDIF.
REFRESH EXTRACT.
ENDFORM.
*---------------------------------------------------------------------*
FORM DB_UPD_ZDOP_MV_EMPLOYEE .
*.process data base updates/inserts/deletes.........................*
LOOP AT TOTAL.
CHECK <ACTION> NE ORIGINAL.
MOVE <VIM_TOTAL_STRUC> TO ZDOP_MV_EMPLOYEE.
IF <ACTION> = UPDATE_GELOESCHT.
<ACTION> = GELOESCHT.
ENDIF.
CASE <ACTION>.
WHEN NEUER_GELOESCHT.
IF STATUS_ZDOP_MV_EMPLOYEE-ST_DELETE EQ GELOESCHT.
READ TABLE EXTRACT WITH KEY <VIM_XTOTAL_KEY>.
IF SY-SUBRC EQ 0.
DELETE EXTRACT INDEX SY-TABIX.
ENDIF.
ENDIF.
DELETE TOTAL.
IF X_HEADER-DELMDTFLAG NE SPACE.
PERFORM DELETE_FROM_MAINKEY_TAB.
ENDIF.
WHEN GELOESCHT.
SELECT SINGLE FOR UPDATE * FROM ZDOP_EMPLOYEE WHERE
EMPID = ZDOP_MV_EMPLOYEE-EMPID AND
EMPNAME = ZDOP_MV_EMPLOYEE-EMPNAME AND
BIRTHDATE = ZDOP_MV_EMPLOYEE-BIRTHDATE .
IF SY-SUBRC = 0.
DELETE ZDOP_EMPLOYEE .
ENDIF.
IF STATUS-DELETE EQ GELOESCHT.
READ TABLE EXTRACT WITH KEY <VIM_XTOTAL_KEY> BINARY SEARCH.
DELETE EXTRACT INDEX SY-TABIX.
ENDIF.
DELETE TOTAL.
IF X_HEADER-DELMDTFLAG NE SPACE.
PERFORM DELETE_FROM_MAINKEY_TAB.
ENDIF.
WHEN OTHERS.
SELECT SINGLE FOR UPDATE * FROM ZDOP_EMPLOYEE WHERE
EMPID = ZDOP_MV_EMPLOYEE-EMPID AND
EMPNAME = ZDOP_MV_EMPLOYEE-EMPNAME AND
BIRTHDATE = ZDOP_MV_EMPLOYEE-BIRTHDATE .
IF SY-SUBRC <> 0. "insert preprocessing: init WA
CLEAR ZDOP_EMPLOYEE.
ENDIF.
ZDOP_EMPLOYEE-MANDT =
ZDOP_MV_EMPLOYEE-MANDT .
ZDOP_EMPLOYEE-EMPID =
ZDOP_MV_EMPLOYEE-EMPID .
ZDOP_EMPLOYEE-EMPNAME =
ZDOP_MV_EMPLOYEE-EMPNAME .
ZDOP_EMPLOYEE-BIRTHDATE =
ZDOP_MV_EMPLOYEE-BIRTHDATE .
ZDOP_EMPLOYEE-ADDRESS =
ZDOP_MV_EMPLOYEE-ADDRESS .
IF SY-SUBRC = 0.
UPDATE ZDOP_EMPLOYEE .
ELSE.
INSERT ZDOP_EMPLOYEE .
ENDIF.
READ TABLE EXTRACT WITH KEY <VIM_XTOTAL_KEY>.
IF SY-SUBRC EQ 0.
<XACT> = ORIGINAL.
MODIFY EXTRACT INDEX SY-TABIX.
ENDIF.
<ACTION> = ORIGINAL.
MODIFY TOTAL.
ENDCASE.
ENDLOOP.
CLEAR: STATUS_ZDOP_MV_EMPLOYEE-UPD_FLAG,
STATUS_ZDOP_MV_EMPLOYEE-UPD_CHECKD.
MESSAGE S018(SV).
ENDFORM.
*---------------------------------------------------------------------*
FORM READ_SINGLE_ZDOP_MV_EMPLOYEE.
SELECT SINGLE * FROM ZDOP_EMPLOYEE WHERE
EMPID = ZDOP_MV_EMPLOYEE-EMPID AND
EMPNAME = ZDOP_MV_EMPLOYEE-EMPNAME AND
BIRTHDATE = ZDOP_MV_EMPLOYEE-BIRTHDATE .
ZDOP_MV_EMPLOYEE-MANDT =
ZDOP_EMPLOYEE-MANDT .
ZDOP_MV_EMPLOYEE-EMPID =
ZDOP_EMPLOYEE-EMPID .
ZDOP_MV_EMPLOYEE-EMPNAME =
ZDOP_EMPLOYEE-EMPNAME .
ZDOP_MV_EMPLOYEE-BIRTHDATE =
ZDOP_EMPLOYEE-BIRTHDATE .
ZDOP_MV_EMPLOYEE-ADDRESS =
ZDOP_EMPLOYEE-ADDRESS .
ENDFORM.
*---------------------------------------------------------------------*
FORM CORR_MAINT_ZDOP_MV_EMPLOYEE USING VALUE(CM_ACTION) RC.
DATA: RETCODE LIKE SY-SUBRC, COUNT TYPE I, TRSP_KEYLEN TYPE SYFLENG.
FIELD-SYMBOLS: <TAB_KEY_X> TYPE X.
CLEAR RC.
MOVE ZDOP_MV_EMPLOYEE-EMPID TO
ZDOP_EMPLOYEE-EMPID .
MOVE ZDOP_MV_EMPLOYEE-EMPNAME TO
ZDOP_EMPLOYEE-EMPNAME .
MOVE ZDOP_MV_EMPLOYEE-BIRTHDATE TO
ZDOP_EMPLOYEE-BIRTHDATE .
MOVE ZDOP_MV_EMPLOYEE-MANDT TO
ZDOP_EMPLOYEE-MANDT .
CORR_KEYTAB = E071K.
CORR_KEYTAB-OBJNAME = 'ZDOP_EMPLOYEE'.
IF NOT <vim_corr_keyx> IS ASSIGNED.
ASSIGN CORR_KEYTAB-TABKEY TO <vim_corr_keyx> CASTING.
ENDIF.
ASSIGN ZDOP_EMPLOYEE TO <TAB_KEY_X> CASTING.
PERFORM VIM_GET_TRSPKEYLEN
USING 'ZDOP_EMPLOYEE'
CHANGING TRSP_KEYLEN.
<VIM_CORR_KEYX>(TRSP_KEYLEN) = <TAB_KEY_X>(TRSP_KEYLEN).
PERFORM UPDATE_CORR_KEYTAB USING CM_ACTION RETCODE.
ADD: RETCODE TO RC, 1 TO COUNT.
IF RC LT COUNT AND CM_ACTION NE PRUEFEN.
CLEAR RC.
ENDIF.
ENDFORM.
*---------------------------------------------------------------------*
| [
9,
10097,
30934,
9,
198,
9,
220,
220,
220,
1570,
3519,
49144,
31878,
198,
9,
10097,
30934,
9,
198,
9,
986,
36948,
25,
1168,
35,
3185,
62,
44,
53,
62,
3620,
6489,
21414,
6500,
8864,
9,
198,
21389,
17151,
62,
26947,
62,
57,
35,
3185,
62,
44,
53,
62,
3620,
6489,
21414,
6500,
13,
198,
220,
19878,
21389,
569,
3955,
62,
37,
8267,
62,
12418,
1137,
2767,
6242,
13,
198,
24620,
961,
1366,
422,
6831,
8864,
44274,
9,
198,
220,
4526,
10913,
44011,
36247,
13,
198,
220,
30301,
1503,
220,
220,
36247,
13,
198,
220,
33493,
1635,
16034,
1168,
35,
3185,
62,
3620,
6489,
21414,
6500,
33411,
198,
7,
53,
3955,
62,
12418,
1137,
2767,
6242,
8,
764,
198,
220,
220,
220,
30301,
1503,
1168,
35,
3185,
62,
44,
53,
62,
3620,
6489,
21414,
6500,
764,
198,
57,
35,
3185,
62,
44,
53,
62,
3620,
6489,
21414,
6500,
12,
44,
6981,
51,
796,
198,
57,
35,
3185,
62,
3620,
6489,
21414,
6500,
12,
44,
6981,
51,
764,
198,
57,
35,
3185,
62,
44,
53,
62,
3620,
6489,
21414,
6500,
12,
39494,
2389,
796,
198,
57,
35,
3185,
62,
3620,
6489,
21414,
6500,
12,
39494,
2389,
764,
198,
57,
35,
3185,
62,
44,
53,
62,
3620,
6489,
21414,
6500,
12,
3620,
13137,
10067,
796,
198,
57,
35,
3185,
62,
3620,
6489,
21414,
6500,
12,
3620,
13137,
10067,
764,
198,
57,
35,
3185,
62,
44,
53,
62,
3620,
6489,
21414,
6500,
12,
3483,
49,
4221,
35,
6158,
796,
198,
57,
35,
3185,
62,
3620,
6489,
21414,
6500,
12,
3483,
49,
4221,
35,
6158,
764,
198,
57,
35,
3185,
62,
44,
53,
62,
3620,
6489,
21414,
6500,
12,
2885,
7707,
7597,
796,
198,
57,
35,
3185,
62,
3620,
6489,
21414,
6500,
12,
2885,
7707,
7597,
764,
198,
27,
53,
3955,
62,
51,
27510,
62,
18601,
9598,
29,
796,
1168,
35,
3185,
62,
44,
53,
62,
3620,
6489,
21414,
6500,
13,
198,
220,
220,
220,
43504,
10619,
36247,
13,
198,
220,
23578,
46506,
13,
198,
220,
311,
9863,
36247,
11050,
1279,
53,
3955,
62,
25010,
27510,
62,
20373,
28401,
198,
220,
1279,
35744,
2937,
29,
12,
1847,
49,
62,
50,
9863,
1961,
796,
705,
49,
4458,
198,
24620,
9122,
8925,
2922,
25811,
357,
1662,
287,
20084,
2149,
8,
27754,
986,
9,
198,
220,
16876,
1395,
62,
37682,
1137,
12,
46506,
2849,
10635,
37253,
13,
198,
220,
220,
220,
19878,
21389,
5870,
25171,
62,
35,
40760,
2390,
2149,
62,
46506,
62,
3185,
51,
11053,
13,
198,
220,
17852,
5188,
5064,
1395,
62,
37682,
1137,
12,
35,
3698,
12740,
51,
38948,
10635,
37253,
13,
198,
220,
220,
220,
19878,
21389,
20571,
26761,
62,
5673,
1268,
20373,
62,
5603,
33,
13,
198,
220,
23578,
5064,
13,
198,
220,
4526,
10913,
44011,
7788,
5446,
10659,
13,
198,
1677,
8068,
1581,
44,
13,
198,
9,
10097,
30934,
9,
198,
21389,
20137,
62,
52,
5760,
62,
57,
35,
3185,
62,
44,
53,
62,
3620,
6489,
21414,
6500,
764,
198,
24620,
14681,
1366,
2779,
5992,
14,
28463,
82,
14,
2934,
40676,
4181,
34617,
9,
198,
21982,
3185,
5161,
36247,
13,
198,
220,
5870,
25171,
1279,
44710,
29,
10635,
43901,
17961,
13,
198,
11770,
6089,
1279,
53,
3955,
62,
51,
27510,
62,
18601,
9598,
29,
5390,
1168,
35,
3185,
62,
44,
53,
62,
3620,
6489,
21414,
6500,
13,
198,
220,
16876,
1279,
44710,
29,
796,
35717,
62,
38,
3698,
46,
1546,
3398,
51,
13,
198,
220,
220,
220,
1279,
44710,
29,
796,
402,
3698,
46,
1546,
3398,
51,
13,
198,
220,
23578,
5064,
13,
198,
220,
42001,
1279,
44710,
28401,
198,
220,
220,
42099,
10635,
52,
1137,
62,
38,
3698,
46,
1546,
3398,
51,
13,
198,
5064,
15486,
2937,
62,
57,
35,
3185,
62,
44,
53,
62,
3620,
6489,
21414,
6500,
12,
2257,
62,
7206,
2538,
9328,
36529,
402,
3698,
46,
1546,
3398,
51,
13,
198,
220,
220,
220,
220,
20832,
43679,
7788,
5446,
10659,
13315,
35374,
1279,
53,
3955,
62,
25010,
27510,
62,
20373,
28401,
198,
220,
220,
220,
220,
16876,
19704,
12,
50,
10526,
7397,
36529,
657,
13,
198,
220,
220,
220,
220,
220,
220,
5550,
2538,
9328,
7788,
5446,
10659,
24413,
6369,
19704,
12,
5603,
3483,
55,
13,
198,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
5550,
2538,
9328,
36247,
13,
198,
220,
220,
220,
16876,
1395,
62,
37682,
1137,
12,
35,
3698,
12740,
51,
38948,
10635,
37253,
13,
198,
220,
220,
220,
220,
220,
19878,
21389,
5550,
2538,
9328,
62,
10913,
2662,
62,
5673,
1268,
20373,
62,
5603,
33,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
42099,
402,
3698,
46,
1546,
3398,
51,
13,
198,
220,
33493,
311,
2751,
2538,
7473,
35717,
1635,
16034,
1168,
35,
3185,
62,
3620,
6489,
21414,
6500,
33411,
198,
220,
38144,
2389,
796,
1168,
35,
3185,
62,
44,
53,
62,
3620,
6489,
21414,
6500,
12,
39494,
2389,
5357,
198,
220,
38144,
20608,
796,
1168,
35,
3185,
62,
44,
53,
62,
3620,
6489,
21414,
6500,
12,
3620,
13137,
10067,
5357,
198,
220,
347,
4663,
4221,
35,
6158,
796,
1168,
35,
3185,
62,
44,
53,
62,
3620,
6489,
21414,
6500,
12,
3483,
49,
4221,
35,
6158,
764,
198,
220,
220,
220,
16876,
19704,
12,
50,
10526,
7397,
796,
657,
13,
198,
220,
220,
220,
5550,
2538,
9328,
1168,
35,
3185,
62,
3620,
6489,
21414,
6500,
764,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
16876,
15486,
2937,
12,
7206,
2538,
9328,
36529,
402,
3698,
46,
1546,
3398,
51,
13,
198,
220,
220,
220,
220,
220,
20832,
43679,
7788,
5446,
10659,
13315,
35374,
1279,
53,
3955,
62,
25010,
27510,
62,
20373,
29,
347,
1268,
13153,
7946,
31315,
13,
198,
220,
220,
220,
220,
220,
5550,
2538,
9328,
7788,
5446,
10659,
24413,
6369,
19704,
12,
5603,
3483,
55,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
5550,
2538,
9328,
36247,
13,
198,
220,
220,
220,
16876,
1395,
62,
37682,
1137,
12,
35,
3698,
12740,
51,
38948,
10635,
37253,
13,
198,
220,
220,
220,
220,
220,
19878,
21389,
5550,
2538,
9328,
62,
10913,
2662,
62,
5673,
1268,
20373,
62,
5603,
33,
13,
198,
220,
220,
220,
23578,
5064,
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,
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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_prag DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES: BEGIN OF ty_pragma,
pragma TYPE c LENGTH 40,
extension TYPE c LENGTH 1,
signature TYPE c LENGTH 10,
description TYPE c LENGTH 255,
END OF ty_pragma.
METHODS:
_raise_pragma_not_exists
RAISING
zcx_abapgit_exception,
_raise_pragma_exists
RAISING
zcx_abapgit_exception,
_raise_pragma_enqueue
RAISING
zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_PRAG IMPLEMENTATION.
METHOD zif_abapgit_object~changed_by.
rv_user = c_user_unknown.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lo_pragma TYPE REF TO cl_abap_pragma.
TRY.
lo_pragma = cl_abap_pragma=>get_ref( ms_item-obj_name ).
lo_pragma->delete( ).
CATCH cx_abap_pragma_not_exists.
_raise_pragma_not_exists( ).
CATCH cx_abap_pragma_enqueue.
_raise_pragma_enqueue( ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_pragma TYPE ty_pragma,
lo_pragma TYPE REF TO cl_abap_pragma.
TRY.
io_xml->read(
EXPORTING
iv_name = 'PRAG'
CHANGING
cg_data = ls_pragma ).
lo_pragma = cl_abap_pragma=>create( p_pragma = ms_item-obj_name
p_package = iv_package ).
lo_pragma->set_info( p_description = ls_pragma-description
p_signature = ls_pragma-signature
p_extension = ls_pragma-extension ).
lo_pragma->save( ).
CATCH cx_abap_pragma_not_exists.
_raise_pragma_not_exists( ).
CATCH cx_abap_pragma_exists.
_raise_pragma_exists( ).
CATCH cx_abap_pragma_enqueue.
_raise_pragma_enqueue( ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
TRY.
cl_abap_pragma=>get_ref( ms_item-obj_name ).
CATCH cx_abap_pragma_not_exists.
rv_bool = abap_false.
RETURN.
ENDTRY.
rv_bool = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
DATA: ls_meta TYPE zif_abapgit_definitions=>ty_metadata.
ls_meta = get_metadata( ).
IF ls_meta-late_deser = abap_true.
APPEND zif_abapgit_object=>gc_step_id-late TO rt_steps.
ELSEIF ls_meta-ddic = abap_true.
APPEND zif_abapgit_object=>gc_step_id-ddic TO rt_steps.
ELSE.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-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.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = ms_item-obj_name
object_type = ms_item-obj_type
EXCEPTIONS
not_executed = 1
invalid_object_type = 2
OTHERS = 3.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lo_pragma TYPE REF TO cl_abap_pragma,
ls_pragma TYPE zcl_abapgit_object_prag=>ty_pragma.
TRY.
lo_pragma = cl_abap_pragma=>get_ref( ms_item-obj_name ).
ls_pragma-pragma = lo_pragma->pragma.
ls_pragma-extension = lo_pragma->extension.
ls_pragma-signature = lo_pragma->signature.
ls_pragma-description = lo_pragma->description.
io_xml->add( iv_name = 'PRAG'
ig_data = ls_pragma ).
CATCH cx_abap_pragma_not_exists.
_raise_pragma_not_exists( ).
ENDTRY.
ENDMETHOD.
METHOD _raise_pragma_enqueue.
zcx_abapgit_exception=>raise( |Pragma { ms_item-obj_name } enqueue error| ).
ENDMETHOD.
METHOD _raise_pragma_exists.
zcx_abapgit_exception=>raise( |Pragma { ms_item-obj_name } exists| ).
ENDMETHOD.
METHOD _raise_pragma_not_exists.
zcx_abapgit_exception=>raise( |Pragma { ms_item-obj_name } doesn't exist| ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
1050,
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,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
1050,
363,
2611,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23864,
2611,
220,
220,
220,
220,
220,
41876,
269,
406,
49494,
2319,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7552,
220,
220,
41876,
269,
406,
49494,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9877,
220,
220,
41876,
269,
406,
49494,
838,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6764,
41876,
269,
406,
49494,
14280,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
1050,
363,
2611,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
4808,
40225,
62,
1050,
363,
2611,
62,
1662,
62,
1069,
1023,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
628,
220,
220,
220,
220,
220,
4808,
40225,
62,
1050,
363,
2611,
62,
1069,
1023,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
628,
220,
220,
220,
220,
220,
4808,
40225,
62,
1050,
363,
2611,
62,
268,
36560,
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,
47,
33202,
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,
42865,
25,
2376,
62,
1050,
363,
2611,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
1050,
363,
2611,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
1050,
363,
2611,
796,
537,
62,
397,
499,
62,
1050,
363,
2611,
14804,
1136,
62,
5420,
7,
13845,
62,
9186,
12,
26801,
62,
3672,
6739,
628,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
1050,
363,
2611,
3784,
33678,
7,
6739,
628,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
397,
499,
62,
1050,
363,
2611,
62,
1662,
62,
1069,
1023,
13,
198,
220,
220,
220,
220,
220,
220,
220,
4808,
40225,
62,
1050,
363,
2611,
62,
1662,
62,
1069,
1023,
7,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
397,
499,
62,
1050,
363,
2611,
62,
268,
36560,
13,
198,
220,
220,
220,
220,
220,
220,
220,
4808,
40225,
62,
1050,
363,
2611,
62,
268,
36560,
7,
6739,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
8906,
48499,
1096,
13,
628,
220,
220,
220,
42865,
25,
43979,
62,
1050,
363,
2611,
41876,
1259,
62,
1050,
363,
2611,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
1050,
363,
2611,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
1050,
363,
2611,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
19875,
3784,
961,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
3672,
796,
705,
47,
33202,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
70,
62,
7890,
796,
43979,
62,
1050,
363,
2611,
6739,
628,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
1050,
363,
2611,
796,
537,
62,
397,
499,
62,
1050,
363,
2611,
14804,
17953,
7,
279,
62,
1050,
363,
2611,
220,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
279,
62,
26495,
796,
21628,
62,
26495,
6739,
628,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
1050,
363,
2611,
3784,
2617,
62,
10951,
7,
279,
62,
11213,
796,
43979,
62,
1050,
363,
2611,
12,
11213,
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,
279,
62,
12683,
1300,
220,
220,
796,
43979,
62,
1050,
363,
2611,
12,
12683,
1300,
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,
279,
62,
2302,
3004,
220,
220,
796,
43979,
62,
1050,
363,
2611,
12,
2302,
3004,
6739,
628,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
1050,
363,
2611,
3784,
21928,
7,
6739,
628,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
397,
499,
62,
1050,
363,
2611,
62,
1662,
62,
1069,
1023,
13,
198,
220,
220,
220,
220,
220,
220,
220,
4808,
40225,
62,
1050,
363,
2611,
62,
1662,
62,
1069
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_abapgit_object~mo_files .
PROTECTED SECTION.
TYPES: BEGIN OF ty_segment_definition,
segmentheader TYPE edisegmhd,
segmentdefinition TYPE edisegmdef,
segmentstructures TYPE STANDARD TABLE OF edisegstru WITH DEFAULT KEY,
END OF ty_segment_definition.
TYPES: ty_segment_definitions TYPE STANDARD TABLE OF ty_segment_definition WITH DEFAULT KEY.
TYPES: BEGIN OF ty_tabl_extras,
tddat TYPE tddat,
END OF ty_tabl_extras.
"! get additional data like table authorization group
"! @parameter iv_tabname | name of the table
METHODS read_extras IMPORTING iv_tabname TYPE ddobjname
RETURNING VALUE(rs_tabl_extras) TYPE ty_tabl_extras.
"! Update additional data
"! @parameter iv_tabname | name of the table
"! @parameter is_tabl_extras | additional table data
METHODS update_extras IMPORTING iv_tabname TYPE ddobjname
is_tabl_extras TYPE ty_tabl_extras.
"! Delete additional data
"! @parameter iv_tabname | name of the table
METHODS delete_extras IMPORTING iv_tabname TYPE ddobjname.
"! Serialize IDoc Segment type/definition if exits
"! @parameter io_xml | XML writer
"! @raising zcx_abapgit_exception | Exceptions
METHODS serialize_idoc_segment IMPORTING io_xml TYPE REF TO zif_abapgit_xml_output
RAISING zcx_abapgit_exception.
"! Deserialize IDoc Segment type/definition if exits
"! @parameter io_xml | XML writer
"! @parameter iv_package | Target package
"! @parameter rv_deserialized | It's a segment and was desserialized
"! @raising zcx_abapgit_exception | Exceptions
METHODS deserialize_idoc_segment IMPORTING io_xml TYPE REF TO zif_abapgit_xml_input
iv_package TYPE devclass
RETURNING VALUE(rv_deserialized) TYPE abap_bool
RAISING zcx_abapgit_exception.
"! Delete the IDoc Segment type if exists
"! @parameter rv_deleted | It's a segment and was deleted
"! @raising zcx_abapgit_exception | Exceptions
METHODS delete_idoc_segment RETURNING VALUE(rv_deleted) TYPE abap_bool
RAISING zcx_abapgit_exception.
PRIVATE SECTION.
TYPES:
ty_dd03p_tt TYPE STANDARD TABLE OF dd03p .
TYPES:
BEGIN OF ty_dd02_text,
ddlanguage TYPE dd02t-ddlanguage,
ddtext TYPE dd02t-ddtext,
END OF ty_dd02_text .
TYPES:
ty_dd02_texts TYPE STANDARD TABLE OF ty_dd02_text .
CONSTANTS c_longtext_id_tabl TYPE dokil-id VALUE 'TB' ##NO_TEXT.
CONSTANTS:
BEGIN OF c_s_dataname,
segment_definition TYPE string VALUE 'SEGMENT_DEFINITION',
tabl_extras TYPE string VALUE 'TABL_EXTRAS',
END OF c_s_dataname .
METHODS deserialize_indexes
IMPORTING
!io_xml TYPE REF TO zif_abapgit_xml_input
RAISING
zcx_abapgit_exception .
METHODS clear_dd03p_fields
CHANGING
!ct_dd03p TYPE ty_dd03p_tt .
"! Check if structure is an IDoc segment
"! @parameter rv_is_idoc_segment | It's an IDoc segment or not
METHODS is_idoc_segment
RETURNING
VALUE(rv_is_idoc_segment) TYPE abap_bool .
METHODS clear_dd03p_fields_common
CHANGING
!cs_dd03p TYPE dd03p .
METHODS clear_dd03p_fields_dataelement
CHANGING
!cs_dd03p TYPE dd03p .
METHODS serialize_texts
IMPORTING
!io_xml TYPE REF TO zif_abapgit_xml_output
RAISING
zcx_abapgit_exception .
METHODS deserialize_texts
IMPORTING
!io_xml TYPE REF TO zif_abapgit_xml_input
!is_dd02v TYPE dd02v
RAISING
zcx_abapgit_exception .
METHODS is_db_table_category
IMPORTING
!iv_tabclass TYPE dd02l-tabclass
RETURNING
VALUE(rv_is_db_table_type) TYPE dd02l-tabclass .
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_TABL IMPLEMENTATION.
METHOD clear_dd03p_fields.
CONSTANTS lc_comptype_dataelement TYPE comptype VALUE 'E'.
DATA: lv_masklen TYPE c LENGTH 4.
FIELD-SYMBOLS: <ls_dd03p> TYPE dd03p.
* remove nested structures
DELETE ct_dd03p WHERE depth <> '00'.
* remove fields from .INCLUDEs
DELETE ct_dd03p WHERE adminfield <> '0'.
LOOP AT ct_dd03p ASSIGNING <ls_dd03p> WHERE NOT rollname IS INITIAL.
clear_dd03p_fields_common( CHANGING cs_dd03p = <ls_dd03p> ).
lv_masklen = <ls_dd03p>-masklen.
IF lv_masklen = '' OR NOT lv_masklen CO '0123456789'.
* make sure the field contains valid data, or the XML will dump
CLEAR <ls_dd03p>-masklen.
ENDIF.
IF <ls_dd03p>-comptype = lc_comptype_dataelement.
clear_dd03p_fields_dataelement( CHANGING cs_dd03p = <ls_dd03p> ).
ENDIF.
IF <ls_dd03p>-shlporigin = 'D'.
* search help from domain
CLEAR: <ls_dd03p>-shlpfield,
<ls_dd03p>-shlpname.
ENDIF.
* XML output assumes correct field content
IF <ls_dd03p>-routputlen = ' '.
CLEAR <ls_dd03p>-routputlen.
ENDIF.
ENDLOOP.
" Clear position to avoid issues with include structures that contain different number of fields
LOOP AT ct_dd03p ASSIGNING <ls_dd03p>.
CLEAR: <ls_dd03p>-position, <ls_dd03p>-tabname, <ls_dd03p>-ddlanguage.
ENDLOOP.
ENDMETHOD.
METHOD clear_dd03p_fields_common.
CLEAR: cs_dd03p-ddlanguage,
cs_dd03p-dtelmaster,
cs_dd03p-logflag,
cs_dd03p-ddtext,
cs_dd03p-reservedte,
cs_dd03p-reptext,
cs_dd03p-scrtext_s,
cs_dd03p-scrtext_m,
cs_dd03p-scrtext_l.
ENDMETHOD.
METHOD clear_dd03p_fields_dataelement.
* type specified via data element
CLEAR: cs_dd03p-domname,
cs_dd03p-inttype,
cs_dd03p-intlen,
cs_dd03p-mask,
cs_dd03p-memoryid,
cs_dd03p-headlen,
cs_dd03p-scrlen1,
cs_dd03p-scrlen2,
cs_dd03p-scrlen3,
cs_dd03p-datatype,
cs_dd03p-leng,
cs_dd03p-outputlen,
cs_dd03p-deffdname,
cs_dd03p-convexit,
cs_dd03p-entitytab,
cs_dd03p-dommaster,
cs_dd03p-domname3l,
cs_dd03p-decimals,
cs_dd03p-lowercase,
cs_dd03p-signflag.
ENDMETHOD.
METHOD delete_extras.
DELETE FROM tddat WHERE tabname = iv_tabname.
ENDMETHOD.
METHOD delete_idoc_segment.
DATA lv_segment_type TYPE edilsegtyp.
DATA lv_result LIKE sy-subrc.
IF is_idoc_segment( ) = abap_false.
rv_deleted = abap_false.
RETURN. "previous XML version or no IDoc segment
ENDIF.
rv_deleted = abap_true.
lv_segment_type = ms_item-obj_name.
CALL FUNCTION 'SEGMENT_DELETE'
EXPORTING
segmenttyp = lv_segment_type
IMPORTING
result = lv_result
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0 OR lv_result <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD deserialize_idoc_segment.
DATA lv_result LIKE sy-subrc.
DATA lt_segment_definitions TYPE ty_segment_definitions.
DATA lv_package TYPE devclass.
DATA lv_uname TYPE sy-uname.
FIELD-SYMBOLS <ls_segment_definition> TYPE ty_segment_definition.
rv_deserialized = abap_false.
TRY.
io_xml->read( EXPORTING iv_name = c_s_dataname-segment_definition
CHANGING cg_data = lt_segment_definitions ).
CATCH zcx_abapgit_exception.
RETURN. "previous XML version or no IDoc segment
ENDTRY.
IF lines( lt_segment_definitions ) = 0.
RETURN. "no IDoc segment
ENDIF.
rv_deserialized = abap_true.
lv_package = iv_package.
LOOP AT lt_segment_definitions ASSIGNING <ls_segment_definition>.
<ls_segment_definition>-segmentheader-presp =
<ls_segment_definition>-segmentheader-pwork = cl_abap_syst=>get_user_name( ).
CALL FUNCTION 'SEGMENT_READ'
EXPORTING
segmenttyp = <ls_segment_definition>-segmentheader-segtyp
IMPORTING
result = lv_result
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0 OR lv_result <> 0.
CALL FUNCTION 'SEGMENT_CREATE'
IMPORTING
segmentdefinition = <ls_segment_definition>-segmentdefinition
TABLES
segmentstructure = <ls_segment_definition>-segmentstructures
CHANGING
segmentheader = <ls_segment_definition>-segmentheader
devclass = lv_package
EXCEPTIONS
OTHERS = 1.
ELSE.
CALL FUNCTION 'SEGMENT_MODIFY'
CHANGING
segmentheader = <ls_segment_definition>-segmentheader
devclass = lv_package
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0.
CALL FUNCTION 'SEGMENTDEFINITION_MODIFY'
TABLES
segmentstructure = <ls_segment_definition>-segmentstructures
CHANGING
segmentdefinition = <ls_segment_definition>-segmentdefinition
EXCEPTIONS
OTHERS = 1.
ENDIF.
ENDIF.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDLOOP.
lv_uname = cl_abap_syst=>get_user_name( ).
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_test_modus = abap_false
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = ms_item-obj_type
wi_tadir_obj_name = ms_item-obj_name
wi_tadir_author = lv_uname
wi_tadir_devclass = iv_package
wi_tadir_masterlang = mv_language
iv_set_edtflag = abap_true
iv_delflag = abap_false
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD deserialize_indexes.
DATA:
lv_tname TYPE trobj_name,
lt_dd12v TYPE dd12vtab,
ls_dd12v LIKE LINE OF lt_dd12v,
lt_dd17v TYPE dd17vtab,
ls_dd17v LIKE LINE OF lt_dd17v,
lt_secondary LIKE lt_dd17v.
io_xml->read( EXPORTING iv_name = 'DD12V'
CHANGING cg_data = lt_dd12v ).
io_xml->read( EXPORTING iv_name = 'DD17V'
CHANGING cg_data = lt_dd17v ).
LOOP AT lt_dd12v INTO ls_dd12v.
* todo, call corr_insert?
CLEAR lt_secondary.
LOOP AT lt_dd17v INTO ls_dd17v
WHERE sqltab = ls_dd12v-sqltab AND indexname = ls_dd12v-indexname.
APPEND ls_dd17v TO lt_secondary.
ENDLOOP.
CALL FUNCTION 'DDIF_INDX_PUT'
EXPORTING
name = ls_dd12v-sqltab
id = ls_dd12v-indexname
dd12v_wa = ls_dd12v
TABLES
dd17v_tab = lt_secondary
EXCEPTIONS
indx_not_found = 1
name_inconsistent = 2
indx_inconsistent = 3
put_failure = 4
put_refused = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
CALL FUNCTION 'DD_DD_TO_E071'
EXPORTING
type = 'INDX'
name = ls_dd12v-sqltab
id = ls_dd12v-indexname
IMPORTING
obj_name = lv_tname.
zcl_abapgit_objects_activation=>add( iv_type = 'INDX'
iv_name = lv_tname ).
ENDLOOP.
ENDMETHOD.
METHOD deserialize_texts.
DATA: lv_name TYPE ddobjname,
ls_dd02v_tmp TYPE dd02v,
lt_i18n_langs TYPE TABLE OF langu,
lt_dd02_texts TYPE ty_dd02_texts.
FIELD-SYMBOLS: <lv_lang> LIKE LINE OF lt_i18n_langs,
<ls_dd02_text> LIKE LINE OF lt_dd02_texts.
lv_name = ms_item-obj_name.
io_xml->read( EXPORTING iv_name = 'I18N_LANGS'
CHANGING cg_data = lt_i18n_langs ).
io_xml->read( EXPORTING iv_name = 'DD02_TEXTS'
CHANGING cg_data = lt_dd02_texts ).
SORT lt_i18n_langs.
SORT lt_dd02_texts BY ddlanguage. " Optimization
LOOP AT lt_i18n_langs ASSIGNING <lv_lang>.
" Table description
ls_dd02v_tmp = is_dd02v.
READ TABLE lt_dd02_texts ASSIGNING <ls_dd02_text> WITH KEY ddlanguage = <lv_lang>.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |DD02_TEXTS cannot find lang { <lv_lang> } in XML| ).
ENDIF.
MOVE-CORRESPONDING <ls_dd02_text> TO ls_dd02v_tmp.
CALL FUNCTION 'DDIF_TABL_PUT'
EXPORTING
name = lv_name
dd02v_wa = ls_dd02v_tmp
EXCEPTIONS
tabl_not_found = 1
name_inconsistent = 2
tabl_inconsistent = 3
put_failure = 4
put_refused = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD is_db_table_category.
" values from domain TABCLASS
rv_is_db_table_type = boolc( iv_tabclass = 'TRANSP'
OR iv_tabclass = 'CLUSTER'
OR iv_tabclass = 'POOL' ).
ENDMETHOD.
METHOD is_idoc_segment.
DATA lv_segment_type TYPE edilsegtyp.
lv_segment_type = ms_item-obj_name.
SELECT SINGLE segtyp
FROM edisegment
INTO lv_segment_type
WHERE segtyp = lv_segment_type.
rv_is_idoc_segment = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD read_extras.
SELECT SINGLE * FROM tddat INTO rs_tabl_extras-tddat WHERE tabname = iv_tabname.
ENDMETHOD.
METHOD serialize_idoc_segment.
DATA lv_segment_type TYPE edilsegtyp.
DATA lv_result LIKE sy-subrc.
DATA lv_devclass TYPE devclass.
DATA lt_segmentdefinitions TYPE STANDARD TABLE OF edisegmdef.
DATA ls_segment_definition TYPE ty_segment_definition.
DATA lt_segment_definitions TYPE ty_segment_definitions.
FIELD-SYMBOLS: <ls_segemtndefinition> TYPE edisegmdef.
IF is_idoc_segment( ) = abap_false.
RETURN.
ENDIF.
lv_segment_type = ms_item-obj_name.
CALL FUNCTION 'SEGMENT_READ'
EXPORTING
segmenttyp = lv_segment_type
IMPORTING
result = lv_result
TABLES
segmentdefinition = lt_segmentdefinitions
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0 OR lv_result <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
LOOP AT lt_segmentdefinitions ASSIGNING <ls_segemtndefinition>.
CLEAR ls_segment_definition.
CALL FUNCTION 'SEGMENTDEFINITION_READ'
EXPORTING
segmenttyp = <ls_segemtndefinition>-segtyp
IMPORTING
result = lv_result
devclass = lv_devclass
segmentheader = ls_segment_definition-segmentheader
segmentdefinition = ls_segment_definition-segmentdefinition
TABLES
segmentstructure = ls_segment_definition-segmentstructures
CHANGING
version = <ls_segemtndefinition>-version
EXCEPTIONS
no_authority = 1
segment_not_existing = 2
OTHERS = 3.
IF sy-subrc <> 0 OR lv_result <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
zcl_abapgit_object_idoc=>clear_idoc_segement_fields(
CHANGING cg_structure = ls_segment_definition-segmentdefinition ).
zcl_abapgit_object_idoc=>clear_idoc_segement_fields(
CHANGING cg_structure = ls_segment_definition-segmentheader ).
APPEND ls_segment_definition TO lt_segment_definitions.
ENDLOOP.
io_xml->add( iv_name = c_s_dataname-segment_definition
ig_data = lt_segment_definitions ).
ENDMETHOD.
METHOD serialize_texts.
DATA: lv_name TYPE ddobjname,
lv_index TYPE i,
ls_dd02v TYPE dd02v,
lt_dd02_texts TYPE ty_dd02_texts,
lt_i18n_langs TYPE TABLE OF langu.
FIELD-SYMBOLS: <lv_lang> LIKE LINE OF lt_i18n_langs,
<ls_dd02_text> LIKE LINE OF lt_dd02_texts.
IF io_xml->i18n_params( )-main_language_only = abap_true.
RETURN.
ENDIF.
lv_name = ms_item-obj_name.
" Collect additional languages, skip main lang - it was serialized already
SELECT DISTINCT ddlanguage AS langu INTO TABLE lt_i18n_langs
FROM dd02v
WHERE tabname = lv_name
AND ddlanguage <> mv_language. "#EC CI_SUBRC
LOOP AT lt_i18n_langs ASSIGNING <lv_lang>.
lv_index = sy-tabix.
CALL FUNCTION 'DDIF_TABL_GET'
EXPORTING
name = lv_name
langu = <lv_lang>
IMPORTING
dd02v_wa = ls_dd02v
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc <> 0 OR ls_dd02v-ddlanguage IS INITIAL.
DELETE lt_i18n_langs INDEX lv_index. " Don't save this lang
CONTINUE.
ENDIF.
APPEND INITIAL LINE TO lt_dd02_texts ASSIGNING <ls_dd02_text>.
MOVE-CORRESPONDING ls_dd02v TO <ls_dd02_text>.
ENDLOOP.
SORT lt_i18n_langs ASCENDING.
SORT lt_dd02_texts BY ddlanguage ASCENDING.
IF lines( lt_i18n_langs ) > 0.
io_xml->add( iv_name = 'I18N_LANGS'
ig_data = lt_i18n_langs ).
io_xml->add( iv_name = 'DD02_TEXTS'
ig_data = lt_dd02_texts ).
ENDIF.
ENDMETHOD.
METHOD update_extras.
IF is_tabl_extras-tddat IS INITIAL.
delete_extras( iv_tabname ).
ELSE.
MODIFY tddat FROM is_tabl_extras-tddat.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
TYPES: BEGIN OF ty_data,
as4user TYPE dd02l-as4user,
as4date TYPE dd02l-as4date,
as4time TYPE dd02l-as4time,
END OF ty_data.
DATA: lt_data TYPE STANDARD TABLE OF ty_data WITH DEFAULT KEY,
ls_data LIKE LINE OF lt_data.
SELECT as4user as4date as4time
FROM dd02l INTO TABLE lt_data
WHERE tabname = ms_item-obj_name
AND as4local = 'A'
AND as4vers = '0000'.
SELECT as4user as4date as4time
APPENDING TABLE lt_data
FROM dd09l
WHERE tabname = ms_item-obj_name
AND as4local = 'A'
AND as4vers = '0000'.
SELECT as4user as4date as4time
APPENDING TABLE lt_data
FROM dd12l
WHERE sqltab = ms_item-obj_name
AND as4local = 'A'
AND as4vers = '0000'.
SORT lt_data BY as4date DESCENDING as4time DESCENDING.
READ TABLE lt_data INDEX 1 INTO ls_data.
IF sy-subrc = 0.
rv_user = ls_data-as4user.
ELSE.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_objname TYPE rsedd0-ddobjname,
lv_no_ask TYPE abap_bool,
lv_subrc TYPE sy-subrc,
BEGIN OF ls_dd02l,
tabname TYPE dd02l-tabname,
tabclass TYPE dd02l-tabclass,
sqltab TYPE dd02l-sqltab,
END OF ls_dd02l.
IF zif_abapgit_object~exists( ) = abap_false.
" Proxies e.g. delete on its own, nothing todo here then.
RETURN.
ENDIF.
lv_objname = ms_item-obj_name.
IF delete_idoc_segment( ) = abap_false.
lv_no_ask = abap_true.
SELECT SINGLE tabname tabclass sqltab FROM dd02l
INTO CORRESPONDING FIELDS OF ls_dd02l
WHERE tabname = ms_item-obj_name
AND as4local = 'A'
AND as4vers = '0000'.
IF sy-subrc = 0 AND is_db_table_category( ls_dd02l-tabclass ) = abap_true.
CALL FUNCTION 'DD_EXISTS_DATA'
EXPORTING
reftab = ls_dd02l-sqltab
tabclass = ls_dd02l-tabclass
tabname = ls_dd02l-tabname
IMPORTING
subrc = lv_subrc
EXCEPTIONS
missing_reftab = 1
sql_error = 2
buffer_overflow = 3
unknown_error = 4
OTHERS = 5.
IF sy-subrc = 0 AND lv_subrc = 0.
lv_no_ask = abap_false.
ENDIF.
ENDIF.
delete_ddic( iv_objtype = 'T'
iv_no_ask = lv_no_ask ).
delete_longtexts( c_longtext_id_tabl ).
delete_extras( lv_objname ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lv_name TYPE ddobjname,
ls_dd02v TYPE dd02v,
ls_dd09l TYPE dd09l,
lt_dd03p TYPE TABLE OF dd03p,
lt_dd05m TYPE TABLE OF dd05m,
lt_dd08v TYPE TABLE OF dd08v,
lt_dd35v TYPE TABLE OF dd35v,
lt_dd36m TYPE dd36mttyp,
lv_refs TYPE abap_bool,
ls_extras TYPE ty_tabl_extras.
FIELD-SYMBOLS: <ls_dd03p> TYPE dd03p,
<ls_dd05m> TYPE dd05m,
<ls_dd08v> TYPE dd08v,
<ls_dd35v> TYPE dd35v,
<ls_dd36m> TYPE dd36m,
<lg_roworcolst> TYPE any.
lv_name = ms_item-obj_name. " type conversion
IF deserialize_idoc_segment( io_xml = io_xml
iv_package = iv_package ) = abap_false.
io_xml->read( EXPORTING iv_name = 'DD02V'
CHANGING cg_data = ls_dd02v ).
io_xml->read( EXPORTING iv_name = 'DD09L'
CHANGING cg_data = ls_dd09l ).
io_xml->read( EXPORTING iv_name = 'DD03P_TABLE'
CHANGING cg_data = lt_dd03p ).
ASSIGN COMPONENT 'ROWORCOLST' OF STRUCTURE ls_dd09l TO <lg_roworcolst>.
IF sy-subrc = 0 AND <lg_roworcolst> IS INITIAL.
<lg_roworcolst> = 'C'. "Reverse fix from serialize
ENDIF.
" DDIC Step: Replace REF TO class/interface with generic reference to avoid cyclic dependency
LOOP AT lt_dd03p ASSIGNING <ls_dd03p> WHERE datatype = 'REF'.
IF iv_step = zif_abapgit_object=>gc_step_id-ddic.
<ls_dd03p>-rollname = 'OBJECT'.
ELSE.
lv_refs = abap_true.
ENDIF.
ENDLOOP.
" Number fields sequentially and fill table name
LOOP AT lt_dd03p ASSIGNING <ls_dd03p>.
<ls_dd03p>-position = sy-tabix.
<ls_dd03p>-tabname = lv_name.
<ls_dd03p>-ddlanguage = mv_language.
ENDLOOP.
io_xml->read( EXPORTING iv_name = 'DD05M_TABLE'
CHANGING cg_data = lt_dd05m ).
io_xml->read( EXPORTING iv_name = 'DD08V_TABLE'
CHANGING cg_data = lt_dd08v ).
io_xml->read( EXPORTING iv_name = 'DD35V_TALE'
CHANGING cg_data = lt_dd35v ).
io_xml->read( EXPORTING iv_name = 'DD36M'
CHANGING cg_data = lt_dd36m ).
LOOP AT lt_dd05m ASSIGNING <ls_dd05m>.
<ls_dd05m>-tabname = lv_name.
ENDLOOP.
LOOP AT lt_dd08v ASSIGNING <ls_dd08v>.
<ls_dd08v>-tabname = lv_name.
<ls_dd08v>-ddlanguage = mv_language.
ENDLOOP.
LOOP AT lt_dd35v ASSIGNING <ls_dd35v>.
<ls_dd35v>-tabname = lv_name.
ENDLOOP.
LOOP AT lt_dd36m ASSIGNING <ls_dd36m>.
<ls_dd36m>-tabname = lv_name.
ENDLOOP.
" DDIC Step: Remove references to search helps and foreign keys
IF iv_step = zif_abapgit_object=>gc_step_id-ddic.
CLEAR: lt_dd08v, lt_dd35v, lt_dd36m.
ENDIF.
IF iv_step = zif_abapgit_object=>gc_step_id-late AND lv_refs = abap_false
AND lines( lt_dd35v ) = 0 AND lines( lt_dd08v ) = 0.
RETURN. " already active
ENDIF.
corr_insert( iv_package = iv_package
ig_object_class = 'DICT' ).
CALL FUNCTION 'DDIF_TABL_PUT'
EXPORTING
name = lv_name
dd02v_wa = ls_dd02v
dd09l_wa = ls_dd09l
TABLES
dd03p_tab = lt_dd03p
dd05m_tab = lt_dd05m
dd08v_tab = lt_dd08v
dd35v_tab = lt_dd35v
dd36m_tab = lt_dd36m
EXCEPTIONS
tabl_not_found = 1
name_inconsistent = 2
tabl_inconsistent = 3
put_failure = 4
put_refused = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
zcl_abapgit_objects_activation=>add_item( ms_item ).
deserialize_indexes( io_xml ).
deserialize_texts( io_xml = io_xml
is_dd02v = ls_dd02v ).
deserialize_longtexts( io_xml ).
io_xml->read( EXPORTING iv_name = c_s_dataname-tabl_extras
CHANGING cg_data = ls_extras ).
update_extras( iv_tabname = lv_name
is_tabl_extras = ls_extras ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_tabname TYPE dd02l-tabname.
lv_tabname = ms_item-obj_name.
" Check nametab because it's fast
CALL FUNCTION 'DD_GET_NAMETAB_HEADER'
EXPORTING
tabname = lv_tabname
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
" Check for new, inactive, or modified versions that might not be in nametab
SELECT SINGLE tabname FROM dd02l INTO lv_tabname
WHERE tabname = lv_tabname.
ENDIF.
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
DATA: li_local_version_output TYPE REF TO zif_abapgit_xml_output,
li_local_version_input TYPE REF TO zif_abapgit_xml_input.
CREATE OBJECT li_local_version_output TYPE zcl_abapgit_xml_output.
zif_abapgit_object~serialize( li_local_version_output ).
CREATE OBJECT li_local_version_input
TYPE zcl_abapgit_xml_input
EXPORTING
iv_xml = li_local_version_output->render( ).
CREATE OBJECT ri_comparator TYPE zcl_abapgit_object_tabl_compar
EXPORTING
ii_local = li_local_version_input.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-ddic TO rt_steps.
APPEND zif_abapgit_object=>gc_step_id-late TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-ddic = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = exists_a_lock_entry_for( iv_lock_object = 'ESDICT'
iv_argument = |{ ms_item-obj_type }{ ms_item-obj_name }| ).
ENDMETHOD.
METHOD zif_abapgit_object~jump.
jump_se11( ).
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lv_name TYPE ddobjname,
ls_dd02v TYPE dd02v,
ls_dd09l TYPE dd09l,
lt_dd03p TYPE ty_dd03p_tt,
lt_dd05m TYPE TABLE OF dd05m,
lt_dd08v TYPE TABLE OF dd08v,
lt_dd12v TYPE dd12vtab,
lt_dd17v TYPE dd17vtab,
lt_dd35v TYPE TABLE OF dd35v,
lv_index LIKE sy-index,
lt_dd36m TYPE dd36mttyp,
ls_extras TYPE ty_tabl_extras.
FIELD-SYMBOLS: <ls_dd12v> LIKE LINE OF lt_dd12v,
<ls_dd05m> LIKE LINE OF lt_dd05m,
<ls_dd08v> LIKE LINE OF lt_dd08v,
<ls_dd35v> LIKE LINE OF lt_dd35v,
<ls_dd36m> LIKE LINE OF lt_dd36m,
<lg_roworcolst> TYPE any.
lv_name = ms_item-obj_name.
CALL FUNCTION 'DDIF_TABL_GET'
EXPORTING
name = lv_name
langu = mv_language
IMPORTING
dd02v_wa = ls_dd02v
dd09l_wa = ls_dd09l
TABLES
dd03p_tab = lt_dd03p
dd05m_tab = lt_dd05m
dd08v_tab = lt_dd08v
dd12v_tab = lt_dd12v
dd17v_tab = lt_dd17v
dd35v_tab = lt_dd35v
dd36m_tab = lt_dd36m
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from DDIF_TABL_GET' ).
ENDIF.
IF ls_dd02v IS INITIAL.
zcx_abapgit_exception=>raise( |No active version found for { ms_item-obj_type } { ms_item-obj_name }| ).
ENDIF.
CLEAR: ls_dd02v-as4user,
ls_dd02v-as4date,
ls_dd02v-as4time.
* reset numeric field, so XML does not crash
IF ls_dd02v-prozpuff = ''.
CLEAR ls_dd02v-prozpuff.
ENDIF.
IF ls_dd02v-datmin = ''.
CLEAR ls_dd02v-datmin.
ENDIF.
IF ls_dd02v-datmax = ''.
CLEAR ls_dd02v-datmax.
ENDIF.
IF ls_dd02v-datavg = ''.
CLEAR ls_dd02v-datavg.
ENDIF.
CLEAR: ls_dd09l-as4user,
ls_dd09l-as4date,
ls_dd09l-as4time.
ASSIGN COMPONENT 'ROWORCOLST' OF STRUCTURE ls_dd09l TO <lg_roworcolst>.
IF sy-subrc = 0 AND <lg_roworcolst> = 'C'.
CLEAR <lg_roworcolst>. "To avoid diff errors. This field doesn't exists in all releases
ENDIF.
LOOP AT lt_dd12v ASSIGNING <ls_dd12v>.
CLEAR: <ls_dd12v>-as4user,
<ls_dd12v>-as4date,
<ls_dd12v>-as4time,
<ls_dd12v>-dbindex.
ENDLOOP.
clear_dd03p_fields( CHANGING ct_dd03p = lt_dd03p ).
* remove foreign keys inherited from .INCLUDEs
DELETE lt_dd08v WHERE noinherit = 'N'.
LOOP AT lt_dd05m ASSIGNING <ls_dd05m>.
CLEAR <ls_dd05m>-tabname.
lv_index = sy-tabix.
READ TABLE lt_dd08v WITH KEY fieldname = <ls_dd05m>-fieldname TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
DELETE lt_dd05m INDEX lv_index.
ENDIF.
ENDLOOP.
LOOP AT lt_dd08v ASSIGNING <ls_dd08v>.
CLEAR: <ls_dd08v>-tabname, <ls_dd08v>-ddlanguage.
ENDLOOP.
LOOP AT lt_dd35v ASSIGNING <ls_dd35v>.
CLEAR <ls_dd35v>-tabname.
ENDLOOP.
* remove inherited search helps
DELETE lt_dd35v WHERE shlpinher = abap_true.
LOOP AT lt_dd36m ASSIGNING <ls_dd36m>.
CLEAR <ls_dd36m>-tabname.
lv_index = sy-tabix.
READ TABLE lt_dd35v WITH KEY fieldname = <ls_dd36m>-fieldname TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
DELETE lt_dd36m INDEX lv_index.
ENDIF.
ENDLOOP.
io_xml->add( iv_name = 'DD02V'
ig_data = ls_dd02v ).
IF NOT ls_dd09l IS INITIAL.
io_xml->add( iv_name = 'DD09L'
ig_data = ls_dd09l ).
ENDIF.
io_xml->add( iv_name = 'DD03P_TABLE'
ig_data = lt_dd03p ).
io_xml->add( iv_name = 'DD05M_TABLE'
ig_data = lt_dd05m ).
io_xml->add( iv_name = 'DD08V_TABLE'
ig_data = lt_dd08v ).
io_xml->add( iv_name = 'DD12V'
ig_data = lt_dd12v ).
io_xml->add( iv_name = 'DD17V'
ig_data = lt_dd17v ).
io_xml->add( iv_name = 'DD35V_TALE'
ig_data = lt_dd35v ).
io_xml->add( iv_name = 'DD36M'
ig_data = lt_dd36m ).
serialize_texts( io_xml ).
serialize_longtexts( ii_xml = io_xml
iv_longtext_id = c_longtext_id_tabl ).
serialize_idoc_segment( io_xml ).
ls_extras = read_extras( lv_name ).
io_xml->add( iv_name = c_s_dataname-tabl_extras
ig_data = ls_extras ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
8658,
75,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
764,
628,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
198,
220,
220,
220,
220,
220,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
325,
5154,
62,
46758,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10618,
25677,
220,
220,
220,
220,
41876,
1225,
786,
39870,
31298,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10618,
46758,
41876,
1225,
786,
39870,
4299,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10618,
7249,
942,
41876,
49053,
9795,
43679,
3963,
1225,
786,
70,
19554,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
325,
5154,
62,
46758,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
1259,
62,
325,
5154,
62,
4299,
50101,
41876,
49053,
9795,
43679,
3963,
1259,
62,
325,
5154,
62,
46758,
13315,
5550,
38865,
35374,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
8658,
75,
62,
2302,
8847,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
1860,
265,
41876,
256,
1860,
265,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
8658,
75,
62,
2302,
8847,
13,
628,
220,
220,
220,
366,
0,
651,
3224,
1366,
588,
3084,
19601,
1448,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
8658,
3672,
930,
1438,
286,
262,
3084,
198,
220,
220,
220,
337,
36252,
50,
1100,
62,
2302,
8847,
30023,
9863,
2751,
21628,
62,
8658,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
49427,
26801,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
3808,
62,
8658,
75,
62,
2302,
8847,
8,
41876,
1259,
62,
8658,
75,
62,
2302,
8847,
13,
628,
220,
220,
220,
366,
0,
10133,
3224,
1366,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
8658,
3672,
930,
1438,
286,
262,
3084,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
318,
62,
8658,
75,
62,
2302,
8847,
930,
3224,
3084,
1366,
198,
220,
220,
220,
337,
36252,
50,
4296,
62,
2302,
8847,
30023,
9863,
2751,
21628,
62,
8658,
3672,
220,
220,
220,
220,
41876,
49427,
26801,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
8658,
75,
62,
2302,
8847,
41876,
1259,
62,
8658,
75,
62,
2302,
8847,
13,
628,
220,
220,
220,
366,
0,
23520,
3224,
1366,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
8658,
3672,
930,
1438,
286,
262,
3084,
198,
220,
220,
220,
337,
36252,
50,
12233,
62,
2302,
8847,
30023,
9863,
2751,
21628,
62,
8658,
3672,
41876,
49427,
26801,
3672,
13,
628,
220,
220,
220,
366,
0,
23283,
1096,
4522,
420,
1001,
5154,
2099,
14,
46758,
611,
30151,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
33245,
62,
19875,
930,
23735,
6260,
198,
220,
220,
220,
366,
0,
2488,
32741,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
930,
1475,
11755,
198,
220,
220,
220,
337,
36252,
50,
11389,
1096,
62,
312,
420,
62,
325,
5154,
30023,
9863,
2751,
33245,
62,
19875,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
19875,
62,
22915,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
366,
0,
2935,
48499,
1096,
4522,
420,
1001,
5154,
2099,
14,
46758,
611,
30151,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
33245,
62,
19875,
930,
23735,
6260,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
21628,
62,
26495,
930,
12744,
5301,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
374,
85,
62,
8906,
48499,
1143,
930,
632,
338,
257,
10618,
290,
373,
288,
408,
48499,
1143,
198,
220,
220,
220,
366,
0,
2488,
32741,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
930,
1475,
11755,
198,
220,
220,
220,
337,
36252,
50,
748,
48499,
1096,
62,
312,
420,
62,
325,
5154,
30023,
9863,
2751,
33245,
62,
19875,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
19875,
62,
15414,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
26495,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
8906,
48499,
1143,
8,
41876,
450,
499,
62,
30388,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
CONSTANTS transobjecttype_class TYPE char1 VALUE 'C' ##NO_TEXT.
METHODS has_authorization
IMPORTING
!iv_class TYPE tobc-oclss
!iv_activity TYPE activ_auth
RAISING
zcx_abapgit_exception .
METHODS is_used
IMPORTING
!iv_auth_object_class TYPE tobc-oclss
RAISING
zcx_abapgit_exception .
PRIVATE SECTION.
METHODS delete_class
IMPORTING
!iv_auth_object_class TYPE tobc-oclss .
METHODS put_delete_to_transport
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_SUSC IMPLEMENTATION.
METHOD delete_class.
DELETE FROM tobc WHERE oclss = iv_auth_object_class.
DELETE FROM tobct WHERE oclss = iv_auth_object_class.
ENDMETHOD.
METHOD has_authorization.
AUTHORITY-CHECK OBJECT 'S_DEVELOP'
ID 'DEVCLASS' DUMMY
ID 'OBJTYPE' FIELD 'SUSC'
ID 'OBJNAME' FIELD iv_class
ID 'P_GROUP' DUMMY
ID 'ACTVT' FIELD iv_activity.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( iv_msgid = '01'
iv_msgno = '467' ).
ENDIF.
ENDMETHOD.
METHOD is_used.
DATA: lv_used_auth_object_class TYPE tobc-oclss.
SELECT SINGLE oclss
FROM tobj
INTO lv_used_auth_object_class
WHERE oclss = iv_auth_object_class ##WARN_OK.
IF sy-subrc = 0.
zcx_abapgit_exception=>raise_t100( iv_msgid = '01'
iv_msgno = '212'
iv_msgv1 = |{ iv_auth_object_class }| ).
ENDIF.
ENDMETHOD.
METHOD put_delete_to_transport.
DATA: lv_tr_object_name TYPE e071-obj_name,
lv_tr_return TYPE char1,
ls_package_info TYPE tdevc,
lv_tadir_object TYPE tadir-object,
lv_tadir_obj_name TYPE tadir-obj_name.
lv_tr_object_name = ms_item-obj_name.
CALL FUNCTION 'SUSR_COMMEDITCHECK'
EXPORTING
objectname = lv_tr_object_name
transobjecttype = zcl_abapgit_object_susc=>transobjecttype_class
IMPORTING
return_from_korr = lv_tr_return.
IF lv_tr_return <> 'M'.
zcx_abapgit_exception=>raise( |error in SUSC delete at SUSR_COMMEDITCHECK| ).
ENDIF.
CALL FUNCTION 'TR_DEVCLASS_GET'
EXPORTING
iv_devclass = ms_item-devclass
IMPORTING
es_tdevc = ls_package_info
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0 AND ls_package_info-korrflag IS INITIAL.
lv_tadir_object = ms_item-obj_type.
lv_tadir_obj_name = lv_tr_object_name.
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_delete_tadir_entry = abap_true
wi_test_modus = space
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = lv_tadir_object
wi_tadir_obj_name = lv_tadir_obj_name
EXCEPTIONS
OTHERS = 0.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
rv_user = c_user_unknown. " todo
ENDMETHOD.
METHOD zif_abapgit_object~delete.
CONSTANTS lc_activity_delete_06 TYPE activ_auth VALUE '06'.
DATA: lv_auth_object_class TYPE tobc-oclss.
lv_auth_object_class = ms_item-obj_name.
TRY.
me->zif_abapgit_object~exists( ).
CATCH zcx_abapgit_exception.
RETURN.
ENDTRY.
has_authorization( iv_class = lv_auth_object_class
iv_activity = lc_activity_delete_06 ).
is_used( lv_auth_object_class ).
delete_class( lv_auth_object_class ).
put_delete_to_transport( ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
* see function group SUSA
DATA: ls_tobc TYPE tobc,
lv_objectname TYPE e071-obj_name,
ls_tobct TYPE tobct.
io_xml->read( EXPORTING iv_name = 'TOBC'
CHANGING cg_data = ls_tobc ).
io_xml->read( EXPORTING iv_name = 'TOBCT'
CHANGING cg_data = ls_tobct ).
tadir_insert( iv_package ).
lv_objectname = ms_item-obj_name.
CALL FUNCTION 'SUSR_COMMEDITCHECK'
EXPORTING
objectname = lv_objectname
transobjecttype = zcl_abapgit_object_susc=>transobjecttype_class.
INSERT tobc FROM ls_tobc. "#EC CI_SUBRC
* ignore sy-subrc as all fields are key fields
MODIFY tobct FROM ls_tobct. "#EC CI_SUBRC
ASSERT sy-subrc = 0.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_oclss TYPE tobc-oclss.
SELECT SINGLE oclss FROM tobc INTO lv_oclss
WHERE oclss = 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( ).
rs_metadata-delete_tadir = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
DATA: lv_objclass TYPE tobc-oclss.
lv_objclass = ms_item-obj_name.
CALL FUNCTION 'SUSR_SHOW_OBJECT_CLASS'
EXPORTING
objclass = lv_objclass.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: ls_tobc TYPE tobc,
ls_tobct TYPE tobct.
SELECT SINGLE * FROM tobc INTO ls_tobc
WHERE oclss = ms_item-obj_name.
IF sy-subrc <> 0.
RETURN.
ENDIF.
SELECT SINGLE * FROM tobct INTO ls_tobct
WHERE oclss = ms_item-obj_name
AND langu = mv_language.
io_xml->add( iv_name = 'TOBC'
ig_data = ls_tobc ).
io_xml->add( iv_name = 'TOBCT'
ig_data = ls_tobct ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
82,
16241,
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,
628,
220,
220,
220,
7102,
2257,
1565,
4694,
1007,
15252,
4906,
62,
4871,
41876,
1149,
16,
26173,
8924,
705,
34,
6,
22492,
15285,
62,
32541,
13,
628,
220,
220,
220,
337,
36252,
50,
468,
62,
9800,
1634,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
4871,
220,
220,
220,
41876,
10773,
66,
12,
38679,
824,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
21797,
41876,
1753,
62,
18439,
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,
318,
62,
1484,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
18439,
62,
15252,
62,
4871,
41876,
10773,
66,
12,
38679,
824,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
12233,
62,
4871,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
18439,
62,
15252,
62,
4871,
41876,
10773,
66,
12,
38679,
824,
764,
198,
220,
220,
220,
337,
36252,
50,
1234,
62,
33678,
62,
1462,
62,
7645,
634,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
50,
2937,
34,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
12233,
62,
4871,
13,
628,
220,
220,
220,
5550,
2538,
9328,
16034,
10773,
66,
220,
33411,
267,
565,
824,
796,
21628,
62,
18439,
62,
15252,
62,
4871,
13,
198,
220,
220,
220,
5550,
2538,
9328,
16034,
10773,
310,
33411,
267,
565,
824,
796,
21628,
62,
18439,
62,
15252,
62,
4871,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
468,
62,
9800,
1634,
13,
628,
220,
220,
220,
44746,
9050,
12,
50084,
25334,
23680,
705,
50,
62,
7206,
18697,
3185,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4522,
705,
39345,
31631,
6,
360,
5883,
26708,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4522,
705,
9864,
41,
25216,
6,
18930,
24639,
705,
50,
2937,
34,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4522,
705,
9864,
41,
20608,
6,
18930,
24639,
21628,
62,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4522,
705,
47,
62,
46846,
6,
360,
5883,
26708,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4522,
705,
2246,
6849,
51,
6,
220,
220,
18930,
24639,
21628,
62,
21797,
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,
62,
83,
3064,
7,
21628,
62,
19662,
312,
796,
705,
486,
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,
21628,
62,
19662,
3919,
796,
705,
24669,
6,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
318,
62,
1484,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
1484,
62,
18439,
62,
15252,
62,
4871,
41876,
10773,
66,
12,
38679,
824,
13,
628,
220,
220,
220,
33493,
311,
2751,
2538,
267,
565,
824,
198,
220,
220,
220,
220,
220,
16034,
10773,
73,
198,
220,
220,
220,
220,
220,
39319,
300,
85,
62,
1484,
62,
18439,
62,
15252,
62,
4871,
198,
220,
220,
220,
220,
220,
33411,
267,
565,
824,
796,
21628,
62,
18439,
62,
15252,
62,
4871,
22492,
37771,
62,
11380,
13,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
62,
83,
3064,
7,
21628,
62,
19662,
312,
796,
705,
486,
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,
21628,
62,
19662,
3919,
796,
705,
21777,
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,
21628,
62,
19662,
85,
16,
796,
930,
90,
21628,
62,
18439,
62,
15252,
62,
4871,
1782,
91,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1234,
62,
33678,
62,
1462,
62,
7645,
634,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
2213,
62,
15252,
62,
3672,
41876,
304,
2998,
16,
12,
26801,
62,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
2213,
62,
7783,
220,
220,
220,
220,
220,
41876,
1149,
16,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
26495,
62,
10951,
220,
220,
41876,
256,
7959
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
"! <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/TRAVEL23 related to the importing Travel ID
"! @parameter et_booking | Table of Bookings like /DMO/BOOKING23 related to the importing Travel ID
"! @parameter et_booking_supplement | Table of Booking Supplements like /DMO/BOOK_SUP_23 related to the importing Travel ID
"! @parameter et_messages | Table of occurred messages
"!
FUNCTION /DMO/FLIGHT_TRAVEL_READ23.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IV_TRAVEL_ID) TYPE /DMO/TRAVEL_ID23
*" REFERENCE(IV_INCLUDE_BUFFER) TYPE ABAP_BOOLEAN DEFAULT
*" ABAP_TRUE
*" EXPORTING
*" REFERENCE(ES_TRAVEL) TYPE /DMO/TRAVEL23
*" REFERENCE(ET_BOOKING) TYPE /DMO/IF_FLIGHT_LEGACY23=>TT_BOOKING
*" REFERENCE(ET_BOOKING_SUPPLEMENT) TYPE
*" /DMO/IF_FLIGHT_LEGACY23=>TT_BOOKING_SUPPLEMENT
*" REFERENCE(ET_MESSAGES) TYPE /DMO/IF_FLIGHT_LEGACY23=>TT_MESSAGE
*"----------------------------------------------------------------------
CLEAR es_travel.
CLEAR et_booking.
CLEAR et_booking_supplement.
CLEAR et_messages.
/dmo/cl_flight_legacy23=>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_legacy23=>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,
1954,
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,
1954,
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,
1954,
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,
1954,
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,
1954,
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,
1954,
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,
1954,
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,
1954,
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,
1954,
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,
1954,
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,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*----------------------------------------------------------------------*
* CLASS ZCL_AES_MODE_CBC DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS zcl_aes_mode_cbc DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_aes_mode .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_AES_MODE_CBC IMPLEMENTATION.
METHOD zif_aes_mode~decrypt_raw16_table.
DATA: converter_block TYPE xstring,
origin_plain_block TYPE xstring,
working_plain_block TYPE xstring,
working_cipher_block TYPE xstring.
FIELD-SYMBOLS: <raw16> TYPE zif_aes_mode=>ty_raw16.
CLEAR et_data.
converter_block = i_initialization_vector.
LOOP AT it_data INTO working_cipher_block.
working_plain_block = origin_plain_block BIT-XOR converter_block.
io_rijndael->decrypt_xstring(
EXPORTING
i_data = working_cipher_block
i_key = i_key
IMPORTING
e_data = working_plain_block ).
origin_plain_block = working_plain_block BIT-XOR converter_block.
APPEND INITIAL LINE TO et_data ASSIGNING <raw16>.
<raw16> = origin_plain_block.
converter_block = working_cipher_block.
ENDLOOP.
ENDMETHOD. "zif_aes_mode~decrypt_raw16_table
METHOD zif_aes_mode~encrypt_raw16_table.
DATA: converter_block TYPE xstring,
origin_plain_block TYPE xstring,
working_plain_block TYPE xstring,
working_cipher_block TYPE xstring.
FIELD-SYMBOLS: <raw16> TYPE zif_aes_mode=>ty_raw16.
CLEAR et_data.
converter_block = i_initialization_vector.
LOOP AT it_data INTO origin_plain_block.
working_plain_block = origin_plain_block BIT-XOR converter_block.
io_rijndael->encrypt_xstring(
EXPORTING
i_data = working_plain_block
i_key = i_key
IMPORTING
e_data = working_cipher_block ).
APPEND INITIAL LINE TO et_data ASSIGNING <raw16>.
<raw16> = working_cipher_block.
converter_block = working_cipher_block.
ENDLOOP.
ENDMETHOD. "zif_aes_mode~encrypt_raw16_table
ENDCLASS.
| [
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
1168,
5097,
62,
32,
1546,
62,
49058,
62,
29208,
5550,
20032,
17941,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
31631,
1976,
565,
62,
64,
274,
62,
14171,
62,
66,
15630,
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,
64,
274,
62,
14171,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
32,
1546,
62,
49058,
62,
29208,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
64,
274,
62,
14171,
93,
12501,
6012,
62,
1831,
1433,
62,
11487,
13,
198,
220,
220,
220,
42865,
25,
38394,
62,
9967,
220,
220,
220,
220,
220,
41876,
2124,
8841,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8159,
62,
25638,
62,
9967,
220,
220,
41876,
2124,
8841,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1762,
62,
25638,
62,
9967,
220,
41876,
2124,
8841,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1762,
62,
66,
10803,
62,
9967,
41876,
2124,
8841,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
220,
1279,
1831,
1433,
29,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
64,
274,
62,
14171,
14804,
774,
62,
1831,
1433,
13,
628,
198,
220,
220,
220,
30301,
1503,
2123,
62,
7890,
13,
628,
220,
220,
220,
38394,
62,
9967,
796,
1312,
62,
36733,
1634,
62,
31364,
13,
628,
220,
220,
220,
17579,
3185,
5161,
340,
62,
7890,
39319,
1762,
62,
66,
10803,
62,
9967,
13,
198,
220,
220,
220,
220,
220,
1762,
62,
25638,
62,
9967,
796,
8159,
62,
25638,
62,
9967,
36992,
12,
55,
1581,
38394,
62,
9967,
13,
628,
220,
220,
220,
220,
220,
33245,
62,
380,
73,
358,
3010,
3784,
12501,
6012,
62,
87,
8841,
7,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
7890,
220,
796,
1762,
62,
66,
10803,
62,
9967,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
2539,
220,
220,
796,
1312,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
304,
62,
7890,
220,
796,
1762,
62,
25638,
62,
9967,
6739,
628,
220,
220,
220,
220,
220,
8159,
62,
25638,
62,
9967,
796,
1762,
62,
25638,
62,
9967,
36992,
12,
55,
1581,
38394,
62,
9967,
13,
628,
220,
220,
220,
220,
220,
43504,
10619,
3268,
2043,
12576,
48920,
5390,
2123,
62,
7890,
24994,
3528,
15871,
1279,
1831,
1433,
28401,
198,
220,
220,
220,
220,
220,
1279,
1831,
1433,
29,
796,
8159,
62,
25638,
62,
9967,
13,
628,
220,
220,
220,
220,
220,
38394,
62,
9967,
796,
1762,
62,
66,
10803,
62,
9967,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
89,
361,
62,
64,
274,
62,
14171,
93,
12501,
6012,
62,
1831,
1433,
62,
11487,
628,
198,
220,
337,
36252,
1976,
361,
62,
64,
274,
62,
14171,
93,
12685,
6012,
62,
1831,
1433,
62,
11487,
13,
198,
220,
220,
220,
42865,
25,
38394,
62,
9967,
220,
220,
220,
220,
220,
41876,
2124,
8841,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8159,
62,
25638,
62,
9967,
220,
220,
41876,
2124,
8841,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1762,
62,
25638,
62,
9967,
220,
41876,
2124,
8841,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1762,
62,
66,
10803,
62,
9967,
41876,
2124,
8841,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
220,
1279,
1831,
1433,
29,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
64,
274,
62,
14171,
14804,
774,
62,
1831,
1433,
13,
628,
198,
220,
220,
220,
30301,
1503,
2123,
62,
7890,
13,
628,
220,
220,
220,
38394,
62,
9967,
796,
1312,
62,
36733,
1634,
62,
31364,
13,
628,
220,
220,
220,
17579,
3185,
5161,
340,
62,
7890,
39319,
8159,
62,
25638,
62,
9967,
13,
198,
220,
220,
220,
220,
220,
1762,
62,
25638,
62,
9967,
796,
8159,
62,
25638,
62,
9967,
36992,
12,
55,
1581,
38394,
62,
9967,
13,
628,
220,
220,
220,
220,
220,
33245,
62,
380,
73,
358,
3010,
3784,
12685,
6012,
62,
87,
8841,
7,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
7890,
220,
796,
1762,
62,
25638,
62,
9967,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
2539,
220,
220,
796,
1312,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
304,
62,
7890,
220,
796,
1762,
62,
66,
10803,
62,
9967,
6739,
628,
220,
220,
220,
220,
220,
43504,
10619,
3268,
2043,
12576,
48920,
5390,
2123,
62,
7890,
24994,
3528,
15871,
1279,
1831,
1433,
28401,
198,
220,
220,
220,
220,
220,
1279,
1831,
1433,
29,
796,
1762,
62,
66,
10803,
62,
9967,
13,
628,
220,
220,
220,
220,
220,
38394,
62,
9967,
796,
1762,
62,
66,
10803,
62,
9967,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
89,
361,
62,
64,
274,
62,
14171,
93,
12685,
6012,
62,
1831,
1433,
62,
11487,
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,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_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(ro_log) TYPE REF TO zcl_abapgit_log.
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,
END OF c_sortkey.
DATA: mo_repo TYPE REF TO zcl_abapgit_repo,
mo_log TYPE REF TO zcl_abapgit_log.
METHODS build_repo_items_offline
RETURNING VALUE(rt_repo_items) TYPE zif_abapgit_definitions=>tt_repo_items
RAISING zcx_abapgit_exception.
METHODS build_repo_items_online
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. "build_folders
METHOD build_repo_items_offline.
DATA: lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt.
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.
<ls_repo_item>-sortkey = c_sortkey-default. " Default sort key
ENDLOOP.
ENDMETHOD. "build_repo_items_offline
METHOD build_repo_items_online.
DATA: lo_repo_online TYPE REF TO zcl_abapgit_repo_online,
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.
lo_repo_online ?= mo_repo.
lt_status = lo_repo_online->status( mo_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>-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_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. "build_repo_items_online
METHOD constructor.
mo_repo = io_repo.
CREATE OBJECT mo_log.
ENDMETHOD. "constructor
METHOD filter_changes.
DELETE ct_repo_items WHERE changes = 0.
ENDMETHOD. "filter_changes
METHOD get_log.
ro_log = mo_log.
ENDMETHOD. "get_log
METHOD list.
mo_log->clear( ).
IF mo_repo->is_offline( ) = abap_true.
rt_repo_items = build_repo_items_offline( ).
ELSE.
rt_repo_items = build_repo_items_online( ).
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 AND mo_repo->is_offline( ) = abap_false.
" There are never changes for offline repositories
filter_changes( CHANGING ct_repo_items = rt_repo_items ).
ENDIF.
SORT rt_repo_items BY
sortkey ASCENDING
obj_type ASCENDING
obj_name ASCENDING.
ENDMETHOD. "list
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,
305,
62,
6404,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6404,
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,
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,
6941,
62,
6404,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
6404,
13,
628,
220,
220,
220,
337,
36252,
50,
1382,
62,
260,
7501,
62,
23814,
62,
2364,
1370,
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,
25119,
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,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
62,
11299,
62,
4868,
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,
29,
12,
6978,
1279,
29,
21628,
62,
22019,
62,
15908,
13,
366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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
] |
"! Contains:
"! <ul>
"! <li>Common style</li>
"! <li>Common javascript</li>
"! <li>Methods for basic html elements</li>
"! </ul>
class zcl_markdown_html definition public.
public section.
interfaces: zif_zmd_document.
aliases: ______________________________ for zif_zmd_document~______________________________,
heading for zif_zmd_document~heading,
text for zif_zmd_document~text,
blockquote for zif_zmd_document~blockquote,
list for zif_zmd_document~list,
numbered_list for zif_zmd_document~numbered_list,
code_block for zif_zmd_document~code_block,
table for zif_zmd_document~table,
render for zif_zmd_document~render,
document for zif_zmd_document~content.
types: html_string type string,
html_document type string.
class-data: common_style type string,
common_js type string.
class-methods: class_constructor,
html importing val type any optional
returning value(html) type html_document,
"! Common javascript is placed at the end of the body tag
body importing val type any optional
returning value(html) type html_string,
li importing val type any optional
omit_empty type abap_bool default abap_false
returning value(html) type html_string,
th importing val type any optional
returning value(html) type html_string,
tr importing val type any optional
returning value(html) type html_string,
td importing val type any optional
omit_empty type abap_bool default abap_false
returning value(html) type html_string,
b importing val type any
returning value(html) type html_string,
i importing val type any
returning value(html) type html_string,
ul importing val type any
returning value(html) type html_string,
ol importing val type any
returning value(html) type html_string,
h1 importing val type any
returning value(html) type html_string,
h2 importing val type any
returning value(html) type html_string,
h3 importing val type any
returning value(html) type html_string,
a importing href type any
val type any
returning value(html) type html_string,
table_header importing content type string
returning value(html) type html_string.
class-methods br returning value(html) type html_string.
protected section.
private section.
endclass.
class zcl_markdown_html implementation.
method class_constructor.
common_style =
|<link href="https://unpkg.com/fundamental-styles@latest/dist/fundamental-styles.css" rel="stylesheet">| &&
|<style>| &&
`tr:nth-child(odd){ background: "#eeeeee" }` && |\r\n| &&
|@font-face \{\r\n| &
|font-family: "72";\r\n| &
|src: url("~@sap-theming/theming-base-content/content/Base/baseLib/sap_base_fiori/fonts/72-Regular-full.woff")\r\n| &
| format("woff");\r\n| &
| font-weight: normal;\r\n| &
| font-style: normal;\r\n| &
|\}| &&
|@font-face \{\r\n| &
| font-family: "SAP-icons";\r\n| &
| src: url("~@sap-theming/theming-base-content/content/Base/baseLib/sap_fiori_3/fonts/SAP-icons.woff")\r\n| &
| format("woff");\r\n| &
| font-weight: normal;\r\n| &
| font-style: normal;\r\n| &
|\}\r\n| &
|\r\n| &
|html \{\r\n| &
| font-size: 16px;\r\n| &
|\}| &&
|</style>|.
common_js = |<script>| && |</script>|.
endmethod.
method body.
html = |<body class="fd-page fd-page--home fd-page--list">{ val }{ common_js }</body>|.
endmethod.
method html.
html =
|<html>| &&
|<head>| &&
|<meta charset='utf-8'>| &&
|{ common_style }| &&
|</head>| &&
val &&
|</html>|.
endmethod.
method li.
html = cond #(
when omit_empty = abap_true and val = `` then ``
else |<li>{ val }</li>| ).
endmethod.
method table.
if lines is initial or lines( lines ) = 1.
text( '[Empty table]' ).
return.
endif.
data(header) = lines[ 1 ].
split header at delimiter into table data(columns).
data(header_str) = table_header( reduce string( init res = ``
for <x> in columns
next res = res && th( <x> ) ) ).
data: items type string.
loop at lines assigning field-symbol(<line>) from 2.
split <line> at delimiter into table columns.
data(row) = tr( reduce string( init res = ``
for <x> in columns
next res = res && td( val = <x> ) ) ).
items = items && row.
endloop.
document = document && |<table class="fd-table">| &&
|{ header_str } | &&
| <tbody class="fd-table__body">{ items }</tbody>| &&
|</table>|.
self = me.
endmethod.
method td.
html = cond #(
when omit_empty = abap_true and val = `` then ``
else |<td>{ val }</td>| ).
endmethod.
method th.
html = |<th class="fd-table__cell">{ val }</th>|.
endmethod.
method tr.
html = |<tr class="fd-table__row fd-table__row--focusable">{ val }</tr>|.
endmethod.
method b.
html = |<b>{ val }</b>|.
endmethod.
method i.
html = |<i>{ val }</i>|.
endmethod.
method ul.
html = |<ul>{ val }</ul>|.
endmethod.
method ol.
html = |<ol>{ val }</ol>|.
endmethod.
method h1.
html = |<h1 class="fd-title fd-title--h1">{ val }</h1>|.
endmethod.
method h2.
html = |<h2 class="fd-title fd-title--h2">{ val }</h2>|.
endmethod.
method h3.
html = |<h3 fd-title fd-title--h3">{ val }</h3>|.
endmethod.
method a.
html = |<a href="{ href }" class="fd-link">{ val }</a>|.
endmethod.
method br.
html = |<br/>\r\n|.
endmethod.
method zif_zmd_document~blockquote.
document = document && |<blockquote>{ val }</blockquote>|.
self = me.
endmethod.
method zif_zmd_document~code_block.
document = document && |<pre>{ val }</pre>|.
self = me.
endmethod.
method zif_zmd_document~heading.
document = document && |<h{ level } class="fd-title fd-title--h{ level }">{ val }</h{ level }>|.
self = me.
endmethod.
method zif_zmd_document~list.
ol( reduce string( init res = ``
for <i> in items
next res = res && li( val = <i> ) ) ).
self = me.
endmethod.
method zif_zmd_document~numbered_list.
ul( reduce string( init res = ``
for <i> in items
next res = res && li( val = <i> ) ) ).
self = me.
endmethod.
method zif_zmd_document~text.
case style.
when zif_zmd_document=>style-bold_italic.
when zif_zmd_document=>style-italic_bold.
document = document && |<p><b><i>{ val }</i></b></p>|.
when zif_zmd_document=>style-bold.
document = document && |<p><b>{ val }</b></p>|.
when zif_zmd_document=>style-italic.
document = document && |<p><i>{ val }</i></p>|.
when zif_zmd_document=>style-inline_code.
document = document && |<i>{ val }</i>|. " todo
when zif_zmd_document=>style-none.
document = document && |<p>{ val }</p>|.
endcase.
self = me.
endmethod.
method zif_zmd_document~______________________________.
document = document && `<hr/>`.
self = me.
endmethod.
method zif_zmd_document~render.
result = html( body( document ) ).
endmethod.
method table_header.
html = |<thead class="fd-table__header">\r\n| &
| <tr class="fd-table__row">| &&
content &&
| </tr>\r\n| &
|</thead>|.
endmethod.
method zif_zmd_document~raw.
document = document && val.
self = me.
endmethod.
endclass.
| [
40484,
49850,
25,
198,
40484,
1279,
377,
29,
198,
40484,
220,
1279,
4528,
29,
17227,
3918,
3556,
4528,
29,
198,
40484,
220,
1279,
4528,
29,
17227,
44575,
3556,
4528,
29,
198,
40484,
220,
1279,
4528,
29,
46202,
329,
4096,
27711,
4847,
3556,
4528,
29,
198,
40484,
7359,
377,
29,
198,
4871,
1976,
565,
62,
4102,
2902,
62,
6494,
6770,
1171,
13,
628,
220,
1171,
2665,
13,
628,
198,
220,
220,
220,
20314,
25,
1976,
361,
62,
89,
9132,
62,
22897,
13,
198,
220,
220,
220,
47217,
25,
220,
32941,
25947,
329,
1976,
361,
62,
89,
9132,
62,
22897,
93,
32941,
25947,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9087,
329,
1976,
361,
62,
89,
9132,
62,
22897,
93,
33878,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2420,
329,
1976,
361,
62,
89,
9132,
62,
22897,
93,
5239,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2512,
22708,
329,
1976,
361,
62,
89,
9132,
62,
22897,
93,
9967,
22708,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1351,
329,
1976,
361,
62,
89,
9132,
62,
22897,
93,
4868,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25840,
62,
4868,
329,
1976,
361,
62,
89,
9132,
62,
22897,
93,
35565,
62,
4868,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2438,
62,
9967,
329,
1976,
361,
62,
89,
9132,
62,
22897,
93,
8189,
62,
9967,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3084,
329,
1976,
361,
62,
89,
9132,
62,
22897,
93,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8543,
329,
1976,
361,
62,
89,
9132,
62,
22897,
93,
13287,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3188,
329,
1976,
361,
62,
89,
9132,
62,
22897,
93,
11299,
13,
628,
220,
220,
220,
3858,
25,
27711,
62,
8841,
220,
220,
2099,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
27711,
62,
22897,
2099,
4731,
13,
628,
220,
220,
220,
1398,
12,
7890,
25,
2219,
62,
7635,
2099,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2219,
62,
8457,
220,
220,
220,
2099,
4731,
13,
628,
220,
220,
220,
1398,
12,
24396,
82,
25,
1398,
62,
41571,
273,
11,
198,
220,
220,
220,
220,
220,
27711,
33332,
1188,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
597,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8024,
1988,
7,
6494,
8,
2099,
27711,
62,
22897,
11,
628,
220,
220,
220,
220,
220,
366,
0,
8070,
44575,
318,
4624,
379,
262,
886,
286,
262,
1767,
7621,
198,
220,
220,
220,
220,
220,
1767,
33332,
1188,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
597,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
8024,
1988,
7,
6494,
8,
2099,
27711,
62,
8841,
11,
628,
220,
220,
220,
220,
220,
7649,
33332,
1188,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
597,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42848,
62,
28920,
220,
2099,
450,
499,
62,
30388,
4277,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
220,
220,
220,
8024,
1988,
7,
6494,
8,
2099,
27711,
62,
8841,
11,
628,
220,
220,
220,
220,
220,
294,
33332,
1188,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
597,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
220,
8024,
1988,
7,
6494,
8,
2099,
27711,
62,
8841,
11,
628,
220,
220,
220,
220,
220,
491,
33332,
1188,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
597,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
220,
8024,
1988,
7,
6494,
8,
2099,
27711,
62,
8841,
11,
628,
220,
220,
220,
220,
220,
41560,
33332,
1188,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
597,
11902,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42848,
62,
28920,
220,
2099,
450,
499,
62,
30388,
4277,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
220,
220,
220,
8024,
1988,
7,
6494,
8,
2099,
27711,
62,
8841,
11,
628,
220,
220,
220,
220,
220,
275,
33332,
1188,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
597,
198,
220,
220,
220,
220,
220,
220,
220,
8024,
1988,
7,
6494,
8,
2099,
27711,
62,
8841,
11,
628,
220,
220,
220,
220,
220,
1312,
33332,
1188,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
597,
198,
220,
220,
220,
220,
220,
220,
220,
8024,
1988,
7,
6494,
8,
2099,
27711,
62,
8841,
11,
628,
220,
220,
220,
220,
220,
14856,
33332,
1188,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
597,
198,
220,
220,
220,
220,
220,
220,
220,
220,
8024,
1988,
7,
6494,
8,
2099,
27711,
62,
8841,
11,
628,
220,
220,
220,
220,
220,
25776,
33332,
1188,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
597,
198,
220,
220,
220,
220,
220,
220,
220,
220,
8024,
1988,
7,
6494,
8,
2099,
27711,
62,
8841,
11,
628,
220,
220,
220,
220,
220,
289,
16,
33332,
1188,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
597,
198,
220,
220,
220,
220,
220,
220,
220,
220,
8024,
1988,
7,
6494,
8,
2099,
27711,
62,
8841,
11,
628,
220,
220,
220,
220,
220,
289,
17,
33332,
1188,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
597,
198,
220,
220,
220,
220,
220,
220,
220,
220,
8024,
1988,
7,
6494,
8,
2099,
27711,
62,
8841,
11,
628,
220,
220,
220,
220,
220,
289,
18,
33332,
1188,
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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
] |
"! Tests Thread functionality. Coverage is not correct as on_end/handle_if_success/handle_if_error methods
"! are executed as callback from the FM. The AUNIT framework doesn't detect that these methods were called
"! during the test execution.
class ltc_thread definition final for testing
duration short
risk level harmless
inheriting from zcl_assert.
public section.
interfaces zif_thread_callback.
private section.
data:
o_cut type ref to zcl_thread,
o_runnable type ref to zcl_runnable_dummy,
v_collected type i,
v_last_collected type char32,
v_last_failed type char32.
methods:
setup,
it_has_name for testing,
it_raises_not_a_runnable for testing,
it_aruns_runnables_returns_res for testing,
it_raises_still_running for testing,
it_limits_threads for testing,
it_allows_for_callbacks for testing,
it_callsback_with_error for testing,
it_returns_error for testing,
it_joins_started_thread for testing,
it_joins_all_threads for testing,
it_times_out_join for testing.
endclass.
class ltc_thread implementation.
method setup.
clear:
v_collected,
v_last_collected,
v_last_failed.
o_runnable = new zcl_runnable_dummy( ).
o_cut = new zcl_thread( o_runnable ).
endmethod.
method it_has_name.
"given name
o_cut = new zcl_thread(
iv_taskname = 'MyTestThread'
io_runnable = o_runnable
io_callback = me ).
assert_equals(
exp = 'MyTestThread'
act = o_cut->get_taskname( )
msg = 'Should have stored task name'
).
o_cut->start( ).
o_cut->join( ).
assert_equals(
exp = 'MyTestThread'
act = v_last_collected
msg = 'Should inform task name on callbacks'
).
"no name given, unique id is generated
o_cut = new zcl_thread( o_runnable ).
assert_not_initial( o_cut->get_taskname( ) ).
endmethod.
method it_raises_not_a_runnable.
try.
o_cut = new zcl_thread( value #( ) ).
catch zcx_not_a_runnable into data(lo_failure).
##NO_HANDLER
endtry.
assert_bound( lo_failure ).
endmethod.
method it_aruns_runnables_returns_res.
"runs runnable and return results
"ZCL_RUNNABLE_DUMMY is also implementing zif_runnable_result
o_cut->start( ).
assert_true( o_cut->is_running( ) ).
o_cut->join( ).
assert_false( o_cut->is_running( ) ).
data(lo_result) = cast zcl_runnable_dummy( o_cut->get_result( ) ).
assert_true( lo_result->was_run_called( ) ).
endmethod.
method it_allows_for_callbacks.
"test class is implementing the zif_thread_callback interface
"counting each time a thread finishes
do 10 times.
o_cut = new zcl_thread(
io_runnable = o_runnable
io_callback = me ).
o_cut->start( ).
enddo.
zcl_thread=>join_all( ).
assert_equals(
exp = 10
act = v_collected
msg = 'Join should wait for all to complete'
).
endmethod.
method it_callsback_with_error.
"the test class is implementing the callback interface
o_runnable->raise_on_run( ).
o_cut = new zcl_thread(
io_runnable = o_runnable
io_callback = me
iv_taskname = 'MyTest' ).
o_cut->start( ).
o_cut->join( ).
assert_equals(
exp = 'MyTest'
act = v_last_failed
msg = 'Error should provide task name'
).
endmethod.
method it_returns_error.
o_runnable->raise_on_run( ).
o_cut = new zcl_thread(
io_runnable = o_runnable
iv_taskname = 'MyTest' ).
o_cut->start( ).
o_cut->join( ).
assert_bound(
act = o_cut->get_error( )
msg = 'Should return error.'
).
endmethod.
method it_raises_still_running.
try.
o_cut = new zcl_thread( o_runnable ).
o_cut->start( ).
o_cut->get_result( ).
catch zcx_still_running into data(lo_failure).
##NO_HANDLER
endtry.
assert_bound( lo_failure ).
endmethod.
method it_limits_threads.
"should not raise any run time error, as it will wait
"for workers to be available
"tested for max mp dia = 25
do 50 times.
o_cut = new zcl_thread( new zcl_runnable_dummy( '0.1' ) ).
o_cut->start( ).
enddo.
endmethod.
method it_joins_started_thread.
"join allows for joining back threads to the main execution
"here we are setting the runnable to wait for a second
"the join call will wait for the thread to finish
o_cut = new zcl_thread( new zcl_runnable_dummy( '1' ) ).
o_cut->start( ).
assert_true( o_cut->is_running( ) ).
o_cut->join( ).
assert_false( o_cut->is_running( ) ).
endmethod.
method it_joins_all_threads.
"Join all allows for the wait of all executed threads
do 10 times.
o_cut = new zcl_thread(
io_runnable = o_runnable
io_callback = me ).
o_cut->start( ).
enddo.
zcl_thread=>join_all( ).
assert_equals(
exp = 10
act = v_collected
msg = 'Join should wait for all to complete'
).
endmethod.
method it_times_out_join.
"to avoid flaky test, still flaky depending on system usage
data lo_failure type ref to cx_root.
do 5 times.
"should raise
try.
clear lo_failure.
o_runnable = new zcl_runnable_dummy( '0.2' ).
o_cut = new zcl_thread( o_runnable ).
o_cut->start( ).
o_cut->join( '0.1' ).
catch zcx_wait_timeout into lo_failure.
assert_bound( lo_failure ).
endtry.
assert_bound( lo_failure ).
"should not raise
clear lo_failure.
o_runnable = new zcl_runnable_dummy( '0.1' ).
o_cut = new zcl_thread( o_runnable ).
o_cut->start( ).
o_cut->join( '0.2' ).
"as proof of completion
o_cut->get_result( ).
enddo.
endmethod.
method zif_thread_callback~on_result.
v_collected = v_collected + 1.
v_last_collected = iv_taskname.
assert_bound( io_result ).
endmethod.
method zif_thread_callback~on_error.
v_last_failed = iv_taskname.
assert_bound( io_error ).
endmethod.
endclass.
| [
40484,
30307,
14122,
11244,
13,
33998,
318,
407,
3376,
355,
319,
62,
437,
14,
28144,
62,
361,
62,
13138,
14,
28144,
62,
361,
62,
18224,
5050,
198,
40484,
389,
10945,
355,
23838,
422,
262,
18695,
13,
383,
317,
4944,
2043,
9355,
1595,
470,
4886,
326,
777,
5050,
547,
1444,
198,
40484,
1141,
262,
1332,
9706,
13,
198,
4871,
300,
23047,
62,
16663,
6770,
2457,
329,
4856,
198,
220,
9478,
1790,
198,
220,
2526,
1241,
23585,
198,
220,
10639,
1780,
422,
1976,
565,
62,
30493,
13,
628,
220,
1171,
2665,
13,
198,
220,
220,
220,
20314,
1976,
361,
62,
16663,
62,
47423,
13,
198,
220,
2839,
2665,
13,
198,
220,
220,
220,
1366,
25,
198,
220,
220,
220,
220,
220,
267,
62,
8968,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
1006,
284,
1976,
565,
62,
16663,
11,
198,
220,
220,
220,
220,
220,
267,
62,
5143,
77,
540,
220,
220,
220,
220,
220,
220,
2099,
1006,
284,
1976,
565,
62,
5143,
77,
540,
62,
67,
13513,
11,
198,
220,
220,
220,
220,
220,
410,
62,
4033,
12609,
220,
220,
220,
220,
220,
2099,
1312,
11,
198,
220,
220,
220,
220,
220,
410,
62,
12957,
62,
4033,
12609,
2099,
1149,
2624,
11,
198,
220,
220,
220,
220,
220,
410,
62,
12957,
62,
47904,
220,
220,
220,
2099,
1149,
2624,
13,
198,
220,
220,
220,
5050,
25,
198,
220,
220,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
220,
220,
340,
62,
10134,
62,
3672,
329,
4856,
11,
198,
220,
220,
220,
220,
220,
340,
62,
430,
2696,
62,
1662,
62,
64,
62,
5143,
77,
540,
329,
4856,
11,
198,
220,
220,
220,
220,
220,
340,
62,
283,
13271,
62,
5143,
77,
2977,
62,
7783,
82,
62,
411,
329,
4856,
11,
198,
220,
220,
220,
220,
220,
340,
62,
430,
2696,
62,
24219,
62,
20270,
329,
4856,
11,
198,
220,
220,
220,
220,
220,
340,
62,
49196,
62,
16663,
82,
329,
4856,
11,
198,
220,
220,
220,
220,
220,
340,
62,
47205,
62,
1640,
62,
13345,
10146,
329,
4856,
11,
198,
220,
220,
220,
220,
220,
340,
62,
66,
5691,
1891,
62,
4480,
62,
18224,
329,
4856,
11,
198,
220,
220,
220,
220,
220,
340,
62,
7783,
82,
62,
18224,
329,
4856,
11,
198,
220,
220,
220,
220,
220,
340,
62,
7639,
1040,
62,
46981,
62,
16663,
329,
4856,
11,
198,
220,
220,
220,
220,
220,
340,
62,
7639,
1040,
62,
439,
62,
16663,
82,
329,
4856,
11,
198,
220,
220,
220,
220,
220,
340,
62,
22355,
62,
448,
62,
22179,
329,
4856,
13,
198,
437,
4871,
13,
628,
198,
4871,
300,
23047,
62,
16663,
7822,
13,
628,
198,
220,
2446,
9058,
13,
198,
220,
220,
220,
1598,
25,
198,
220,
220,
220,
220,
220,
410,
62,
4033,
12609,
11,
198,
220,
220,
220,
220,
220,
410,
62,
12957,
62,
4033,
12609,
11,
198,
220,
220,
220,
220,
220,
410,
62,
12957,
62,
47904,
13,
628,
220,
220,
220,
267,
62,
5143,
77,
540,
796,
649,
1976,
565,
62,
5143,
77,
540,
62,
67,
13513,
7,
220,
6739,
198,
220,
220,
220,
267,
62,
8968,
796,
649,
1976,
565,
62,
16663,
7,
267,
62,
5143,
77,
540,
6739,
198,
220,
886,
24396,
13,
628,
220,
2446,
340,
62,
10134,
62,
3672,
13,
628,
220,
220,
220,
366,
35569,
1438,
198,
220,
220,
220,
267,
62,
8968,
796,
649,
1976,
565,
62,
16663,
7,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
35943,
3672,
796,
705,
3666,
14402,
16818,
6,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
5143,
77,
540,
796,
267,
62,
5143,
77,
540,
198,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
47423,
796,
502,
6739,
628,
220,
220,
220,
6818,
62,
4853,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
705,
3666,
14402,
16818,
6,
198,
220,
220,
220,
220,
220,
220,
220,
719,
796,
267,
62,
8968,
3784,
1136,
62,
35943,
3672,
7,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
31456,
796,
705,
19926,
423,
8574,
4876,
1438,
6,
198,
220,
220,
220,
6739,
628,
220,
220,
220,
267,
62,
8968,
3784,
9688,
7,
220,
6739,
198,
220,
220,
220,
267,
62,
8968,
3784,
22179,
7,
220,
6739,
628,
220,
220,
220,
6818,
62,
4853,
874,
7,
198,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
705,
3666,
14402,
16818,
6,
198,
220,
220,
220,
220,
220,
220,
220,
719,
796,
410,
62,
12957,
62,
4033,
12609,
198,
220,
220,
220,
220,
220,
220,
220,
31456,
796,
705,
19926,
4175,
4876,
1438,
319,
869,
10146,
6,
198,
220,
220,
220,
6739,
628,
220,
220,
220,
366,
3919,
1438,
1813,
11,
220,
3748,
4686,
318,
7560,
198,
220,
220,
220,
267,
62,
8968,
796,
649,
1976,
565,
62,
16663,
7,
267,
62,
5143,
77,
540,
6739,
198,
220,
220,
220,
6818,
62,
1662,
62,
36733,
7,
267,
62,
8968,
3784,
1136,
62,
35943,
3672,
7,
220,
1267,
6739,
628,
220,
886,
24396,
13,
628,
220,
2446,
340,
62,
430,
2696,
62,
1662,
62,
64,
62,
5143,
77,
540,
13,
628,
220,
220,
220,
1949,
13,
198,
220,
220,
220,
220,
220,
220,
220,
267,
62,
8968,
796,
649,
1976,
565,
62,
16663,
7,
1988,
1303,
7,
1267,
6739,
198,
220,
220,
220,
220,
220,
4929,
1976,
66,
87,
62,
1662,
62,
64,
62,
5143,
77,
540,
656,
1366,
7,
5439,
62,
32165,
495,
737,
198,
220,
220,
220,
220,
220,
220,
220,
22492,
15285,
62,
39,
6981,
39878,
198,
220,
220,
220,
886,
28311,
13,
628,
220,
220,
220,
6818,
62,
7784,
7,
2376,
62,
32165,
495,
6739,
628,
220,
886,
24396,
13,
628,
220,
2446,
340,
62,
283,
13271,
62,
5143,
77,
2977,
62,
7783,
82,
62,
411,
13,
198,
220,
220,
220,
366,
48381,
1057,
77,
540,
290,
1441,
2482,
198,
220,
220,
220,
366,
57,
5097,
62,
49,
4944,
4535,
19146,
62,
35,
5883,
26708,
318,
635,
15427,
1976,
361,
62,
5143,
77,
540,
62,
20274,
198,
220,
220,
220,
267,
62,
8968,
3784,
9688,
7,
220,
6739,
198,
220,
220,
220,
6818,
62,
7942,
7,
267,
62,
8968,
3784,
271,
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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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
] |
"! API for Setting a Travel to <em>booked</em>.
"!
"! @parameter iv_travel_id | Travel ID
"! @parameter et_messages | Table of occurred messages
"!
FUNCTION /DMO/FLIGHT_TRAVEL_SET_BOOK_15.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IV_TRAVEL_ID) TYPE /DMO/TRAVEL15-TRAVEL_ID
*" EXPORTING
*" REFERENCE(ET_MESSAGES) TYPE /DMO/IF_FLIGHT_LEGACY15=>TT_MESSAGE
*"----------------------------------------------------------------------
CLEAR et_messages.
/dmo/cl_flight_legacy15=>get_instance( )->set_status_to_booked( EXPORTING iv_travel_id = iv_travel_id
IMPORTING et_messages = DATA(lt_messages) ).
/dmo/cl_flight_legacy15=>get_instance( )->convert_messages( EXPORTING it_messages = lt_messages
IMPORTING et_messages = et_messages ).
ENDFUNCTION.
| [
40484,
7824,
329,
25700,
257,
13524,
284,
1279,
368,
29,
2070,
276,
3556,
368,
28401,
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,
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,
28480,
62,
39453,
62,
1314,
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,
1314,
12,
51,
3861,
18697,
62,
2389,
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,
1314,
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,
1314,
14804,
1136,
62,
39098,
7,
1267,
3784,
2617,
62,
13376,
62,
1462,
62,
2070,
276,
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,
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,
1314,
14804,
1136,
62,
39098,
7,
1267,
3784,
1102,
1851,
62,
37348,
1095,
7,
7788,
15490,
2751,
340,
62,
37348,
1095,
220,
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,
220,
796,
2123,
62,
37348,
1095,
6739,
198,
1677,
8068,
4944,
4177,
2849,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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_data_generator.
CLASS-METHODS:
create
IMPORTING out TYPE REF TO if_oo_adt_classrun_out OPTIONAL.
ENDINTERFACE.
CLASS lcl_agency_data_generator DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES: lif_data_generator.
TYPES: tt_agency TYPE STANDARD TABLE OF /dmo/agency29 WITH KEY agency_id.
CLASS-METHODS: get_data
RETURNING VALUE(rt_data) TYPE tt_agency.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS lcl_agency_data_generator IMPLEMENTATION.
METHOD lif_data_generator~create.
IF out IS BOUND. out->write( '--> Delete Content.' ). ENDIF.
DELETE FROM /dmo/agency29. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Build Content.' ). ENDIF.
DATA(lt_data) = get_data( ).
IF out IS BOUND. out->write( '--> Insert Content.' ). ENDIF.
INSERT /dmo/agency29 FROM TABLE @lt_data.
IF out IS BOUND. out->write( '--> Done.' ). ENDIF.
ENDMETHOD.
METHOD get_data.
rt_data = VALUE tt_agency(
( agency_id = '070001'
name = 'Sunshine Travel'
street = '134 West Street '
postal_code = '54323 '
city = 'Rochester '
country_code = 'US '
phone_number = '+1 901-632-5620 '
web_address = 'http://www.sunshine-travel.sap '
email_address = '[email protected] '
)
( agency_id = '070002'
name = 'Fly High'
street = 'Berliner Allee 11 '
postal_code = '40880 '
city = 'Duesseldorf '
country_code = 'DE '
phone_number = '+49 2102 69555 '
web_address = 'http://www.flyhigh.sap '
email_address = '[email protected] '
)
( agency_id = '070003'
name = 'Happy Hopping'
street = 'Calvinstr. 36 '
postal_code = '13467 '
city = 'Berlin '
country_code = 'DE '
phone_number = '+49 30-8853-0 '
web_address = 'http://www.haphop.sap '
email_address = '[email protected] '
)
( agency_id = '070004'
name = 'Pink Panther'
street = 'Auf der Schanz 54 '
postal_code = '65936 '
city = 'Frankfurt '
country_code = 'DE '
phone_number = '+49 69-467653-0 '
web_address = 'http://www.pinkpanther.sap'
email_address = '[email protected] '
)
( agency_id = '070005'
name = 'Your Choice'
street = 'Gustav-Jung-Str. 425 '
postal_code = '90455'
city = 'Nuernberg'
country_code = 'DE'
phone_number = '+49 9256-4548-0'
web_address = 'http://www.yc.sap'
email_address = '[email protected]'
)
( agency_id = '070006'
name = 'Bella Italia'
street = 'Via Marconi 123'
postal_code = '00139'
city = 'Roma'
country_code = 'IT'
phone_number = '+39 6 893546721'
web_address = 'http://www.tours.it/Adventure/'
email_address = '[email protected]/Adventure/'
)
( agency_id = '070007'
name = 'Hot Socks Travel'
street = '224 Balnagask Rd '
postal_code = '8053 '
city = 'Sydney'
country_code = 'AU '
phone_number = '+61 2 2004 5000 '
web_address = 'http://www.hst.co.au'
email_address = '[email protected]'
)
( agency_id = '070008'
name = 'Burns Nuclear'
street = '14 Science Park Drive'
postal_code = '118228'
city = 'Singapore'
country_code = 'SG'
phone_number = '+65 777-5566'
web_address = 'http://www.burns-burns-burns.sg'
email_address = '[email protected]'
)
( agency_id = '070009'
name = 'Honauer Reisen GmbH'
street = 'Baumgarten 8'
postal_code = '4212'
city = 'Neumarkt'
country_code = 'AT'
phone_number = '+43 7941 8903'
web_address = 'http://www.honauer.at'
email_address = '[email protected]'
)
( agency_id = '070010'
name = 'Travel from Walldorf'
street = 'Altonaer Str. 24 '
postal_code = '10557 '
city = 'Berlin '
country_code = 'DE '
phone_number = '+49 30-622860 '
web_address = 'http://www.travel-from-walldorf'
email_address = 'info@travel-from-walldorf'
)
( agency_id = '070011'
name = 'Voyager Enterprises'
street = 'Gustavslundsvaegen 151'
postal_code = '70563 '
city = 'Stockholm '
country_code = 'SE '
phone_number = '+46 8/ 587 70000'
web_address = 'http://www.starfleet.ufp'
email_address = '[email protected]'
)
( agency_id = '070012'
name = 'Ben McCloskey Ltd.'
street = '74 Court Oak Rd'
postal_code = 'B17 9TN'
city = 'Birmingham'
country_code = 'GB'
phone_number = '+44 121 365-2251 '
web_address = 'http://www.ben-mcCloskey.co.uk'
email_address = '[email protected]'
)
( agency_id = '070013'
name = 'Pillepalle Trips'
street = 'Gorki Park 4 '
postal_code = '8008 '
city = 'Zuerich '
country_code = 'CH '
phone_number = '+41 1 345-5321 '
web_address = 'http://www.pi-pa-tri.sap'
email_address = '[email protected]'
)
( agency_id = '070014'
name = 'Kangeroos'
street = 'Lancaster drive 435 '
postal_code = '20001 '
city = 'London '
country_code = 'GB '
phone_number = '+44 171-2937638 '
web_address = 'http://www.hopp.sap '
email_address = '[email protected] '
)
( agency_id = '070015'
name = 'Bavarian Castle'
street = 'Pilnizerstr. 241 '
postal_code = '01069 '
city = 'Dresden '
country_code = 'DE '
phone_number = '+49 98-32832732 '
web_address = 'http://www.neu.schwanstein.sap '
email_address = '[email protected] '
)
( agency_id = '070016'
name = 'Ali''s Bazar'
street = '45, Mac Arthur Boulevard '
postal_code = '19113 '
city = 'Boston '
country_code = 'US '
phone_number = '+1 508-692-5200 '
web_address = 'http://www.ali.sap '
email_address = '[email protected] '
)
( agency_id = '070017'
name = 'Super Agency'
street = '50 Cranworth St'
postal_code = 'G12 8AG'
city = 'Glasgow'
country_code = 'GB'
phone_number = '+44 141 711-5643'
web_address = 'http://www.super.sap'
email_address = '[email protected]'
)
( agency_id = '070018'
name = 'Wang Chong'
street = 'Gagarine Park '
postal_code = '150021 '
city = 'Moscow '
country_code = 'RU '
phone_number = '+7 3287-213321 '
web_address = 'http://www.wang.chong.sap'
email_address = '[email protected]'
)
( agency_id = '070019'
name = 'Around the World'
street = 'An der Breiten Wiese 122 '
postal_code = '30625 '
city = 'Hannover '
country_code = 'DE '
phone_number = '+49 511-347589-0 '
web_address = 'http://www.atw.sap'
email_address = '[email protected]'
)
( agency_id = '070020'
name = 'No Return'
street = 'Wahnheider Str. 57 '
postal_code = '51105 '
city = 'Koeln '
country_code = 'DE '
phone_number = '+49 221-5689-100 '
web_address = 'http://www.bye-bye.sap '
email_address = '[email protected] '
)
( agency_id = '070021'
name = 'Special Agency Peru'
street = 'Triberger Str. 42 '
postal_code = '70569 '
city = 'Stuttgart '
country_code = 'DE '
phone_number = '+49 711-7100 '
web_address = 'http://www.sap.com '
email_address = '[email protected] '
)
( agency_id = '070022'
name = 'Caribian Dreams'
street = 'Deichstrasse 45 '
postal_code = '26721 '
city = 'Emden '
country_code = 'DE '
phone_number = '+49 2670-8560-0 '
web_address = 'http://www.cuba-libre.sap '
email_address = '[email protected] '
)
( agency_id = '070023'
name = 'Asia By Plane'
street = '6-9 Iidabashi 7-chome'
postal_code = '102-0072'
city = 'Tokyo '
country_code = 'JP'
phone_number = '+81 3-3239-3501 '
web_address = 'http://www.asia-by-plane.co.jp'
email_address = '[email protected]'
)
( agency_id = '070024'
name = 'Everywhere'
street = 'Regensburger Platz 23 '
postal_code = '81679 '
city = 'Muenchen '
country_code = 'DE '
phone_number = '+49 89-2499239 '
web_address = 'http://www.everywhere.sap'
email_address = '[email protected]'
)
( agency_id = '070025'
name = 'Happy Holiday'
street = 'Rastenburger Str. 12'
postal_code = '28779 '
city = 'Bremen '
country_code = 'DE '
phone_number = '+49 3266-288817 '
web_address = 'http://www.haphol.sap'
email_address = '[email protected]'
)
( agency_id = '070026'
name = 'No Name'
street = 'Schwalbenweg 43 '
postal_code = '52078 '
city = 'Aachen '
country_code = 'DE '
phone_number = '+49 241-77729 '
web_address = 'http://www.nn.sap'
email_address = '[email protected]'
)
( agency_id = '070027'
name = 'Fly Low'
street = 'Chemnitzer Str. 42 '
postal_code = '01187 '
city = 'Dresden '
country_code = 'DE '
phone_number = '+49 351-5423-00 '
web_address = 'http://www.fly-low.sap'
email_address = '[email protected]'
)
( agency_id = '070028'
name = 'Aussie Travel'
street = 'Queens Road '
postal_code = 'M8 7RYP '
city = 'Manchester '
country_code = 'GB '
phone_number = '+44 161 2052000 '
web_address = 'http://www.down-under.sap'
email_address = '[email protected]'
)
( agency_id = '070029'
name = 'Up ''n'' Away'
street = 'Nackenbergerstr. 92 '
postal_code = '30625 '
city = 'Hannover '
country_code = 'DE '
phone_number = '+49 511 403266-0 '
web_address = 'http://www.una.sap '
email_address = '[email protected] '
)
( agency_id = '070030'
name = 'Trans World Travel'
street = '100 Industrial Drive '
postal_code = '60804 '
city = 'Chicago '
country_code = 'US '
phone_number = '+1 708-454-8723 '
web_address = 'http://www.twt.sap '
email_address = '[email protected] '
)
( agency_id = '070031'
name = 'Bright Side of Life'
street = '340 State Street '
postal_code = '30432 '
city = 'San Francisco '
country_code = 'US '
phone_number = '+1 415-454-9877 '
web_address = 'http://www.ruebennase.sap '
email_address = '[email protected] '
)
( agency_id = '070032'
name = 'Sunny, Sunny, Sunny'
street = '1300 State Street '
postal_code = '19003 '
city = 'Philadelphia '
country_code = 'US '
phone_number = '+1 215-090-7659 '
web_address = 'http://www.s3.sap '
email_address = '[email protected] '
)
( agency_id = '070033'
name = 'Fly & Smile'
street = 'Zeppelinstr. 17 '
postal_code = '60318 '
city = 'Frankfurt '
country_code = 'DE '
phone_number = '+49 69-99-0 '
web_address = 'http://www.fly-and-smile.sap '
email_address = '[email protected] '
)
( agency_id = '070034'
name = 'Supercheap'
street = '1400, Washington Circle '
postal_code = '30439 '
city = 'Los Angeles '
country_code = 'US '
phone_number = '+1 251-369-2510 '
web_address = 'http://www.supercheap.sap '
email_address = '[email protected] '
)
( agency_id = '070035'
name = 'Hitchhiker'
street = '21 Rue de Moselle '
postal_code = '92132 '
city = 'Issy-les-Moulineaux '
country_code = 'FR '
phone_number = '+33 1-405-555-888 '
web_address = 'http://www.42.sap '
email_address = '[email protected] '
)
( agency_id = '070036'
name = 'Fly Now, Pay Later'
street = '100 Madison '
postal_code = '11012 '
city = 'New York '
country_code = 'US '
phone_number = '+1 512 343-8543 '
web_address = 'http://www.fn-pl.sap '
email_address = '[email protected] '
)
( agency_id = '070037'
name = 'Real Weird Vacation'
street = '949 5th Street '
postal_code = 'V6T 1Z4'
city = 'Vancouver'
country_code = 'CA '
phone_number = '+1 604 827-8024'
web_address = 'http://www.reweva.sap '
email_address = '[email protected] '
)
( agency_id = '070038'
name = 'Cap Travels Ltd.'
street = '10 Mandela St'
postal_code = '2128'
city = 'Johannesburg'
country_code = 'ZA'
phone_number = '+27 11 886-8981'
web_address = 'http://www.cap-travels.co.za'
email_address = '[email protected]'
)
( agency_id = '070039'
name = 'Rainy, Stormy, Cloudy'
street = 'Lindenstr. 462 '
postal_code = '70563 '
city = 'Stuttgart '
country_code = 'DE '
phone_number = '+49 711-7992-00 '
web_address = 'http://www.windy.sap/rsc/ '
email_address = '[email protected]/rsc/ '
)
( agency_id = '070040'
name = 'Women only'
street = 'Kirchstr. 53 '
postal_code = '55124 '
city = 'Mainz '
country_code = 'DE '
phone_number = '+49 6131-543-00 '
web_address = 'http://www.women-only.sap '
email_address = '[email protected] '
)
( agency_id = '070041'
name = 'Maxitrip'
street = 'Flugfeld 17'
postal_code = '65128'
city = 'Wiesbaden'
country_code = 'DE'
phone_number = '+49 611-55 66 77'
web_address = 'http://www.maxitrip.sap'
email_address = '[email protected]'
)
( agency_id = '070042'
name = 'The Ultimate Answer'
street = 'Manchester Rd 20 '
postal_code = 'AB1 1SA '
city = 'Avon '
country_code = 'GB '
phone_number = '+44 934-66799 '
web_address = 'http://www.thulan.sap '
email_address = '[email protected] '
)
( agency_id = '070043'
name = 'Intertravel'
street = 'Michigan Ave '
postal_code = '60154 '
city = 'Chicago '
country_code = 'US '
phone_number = '+1 788 798-6555 '
web_address = 'http://www.intertravel.sap '
email_address = '[email protected] '
)
( agency_id = '070044'
name = 'Ultimate Goal'
street = '300 Peach tree street Sou'
postal_code = '01069 '
city = 'Atlanta '
country_code = 'US '
phone_number = '+1 874-654-6686'
web_address = 'http://www.ultimate-goal.sap '
email_address = '[email protected] '
)
( agency_id = '070045'
name = 'Submit and Return'
street = '20890 East Central Ave '
postal_code = '30987 '
city = 'Palo Alto '
country_code = 'US '
phone_number = '+1 652 645-5236 '
web_address = 'http://www.sar.sap '
email_address = '[email protected] '
)
( agency_id = '070046'
name = 'Hendrik''s'
street = '1200 Industrial Drive '
postal_code = '60153 '
city = 'Chicago '
country_code = 'US '
phone_number = '+1 08-924-9884 '
web_address = 'http://www.essen.sap/150596 '
email_address = '[email protected]/150596 '
)
( agency_id = '070047'
name = 'All British Air Planes'
street = '224 Tomato Lane '
postal_code = '08965 '
city = 'Vineland '
country_code = 'US '
phone_number = '+44 609-896-Moore '
web_address = 'http://www.abap.sap '
email_address = '[email protected] '
)
( agency_id = '070048'
name = 'Rocky Horror Tours'
street = '789 Santa Monica Blvd. '
postal_code = '08934 '
city = 'Santa Monica '
country_code = 'US '
phone_number = '+1 64351-6455-654 '
web_address = 'http://www.frank.furter.sap '
email_address = '[email protected] '
)
( agency_id = '070049'
name = 'Miles and More'
street = '777 Arlington Blvd. '
postal_code = '46515 '
city = 'Elkhart '
country_code = 'US '
phone_number = '+1 646 867-6888 '
web_address = 'http://www.mam.sap'
email_address = '[email protected]'
)
( agency_id = '070050'
name = 'Not Only By Bike'
street = 'Saalburgstr. 765 '
postal_code = '60385 '
city = 'Frankfurt '
country_code = 'DE '
phone_number = '+49 69 465789-0'
web_address = 'http://www.nobb.sap'
email_address = '[email protected]'
)
).
ENDMETHOD.
ENDCLASS.
CLASS lcl_airport_data_generator DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES: lif_data_generator.
TYPES: tt_airport TYPE STANDARD TABLE OF /dmo/airport29 WITH KEY airport_id.
CLASS-METHODS: get_data
RETURNING VALUE(rt_data) TYPE lcl_airport_data_generator=>tt_airport.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS lcl_airport_data_generator IMPLEMENTATION.
METHOD lif_data_generator~create.
IF out IS BOUND. out->write( '--> Delete Content.' ). ENDIF.
DELETE FROM /dmo/airport29. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Build Content.' ). ENDIF.
DATA(lt_data) = get_data( ).
IF out IS BOUND. out->write( '--> Insert Content.' ). ENDIF.
INSERT /dmo/airport29 FROM TABLE @lt_data.
IF out IS BOUND. out->write( '--> Done.' ). ENDIF.
ENDMETHOD.
METHOD get_data.
rt_data = VALUE tt_airport(
" Europe
( airport_id = 'FRA' name = 'Frankfurt Airport' city = 'Frankfurt/Main' country = 'DE' )
( airport_id = 'HAM' name = 'Hamburg Airport' city = 'Hamburg' country = 'DE' )
( airport_id = 'MUC' name = 'Munich Airport' city = 'Munich' country = 'DE' )
( airport_id = 'SXF' name = 'Berlin Schönefeld Airport' city = 'Berlin' country = 'DE' )
( airport_id = 'THF' name = 'Berlin Tempelhof Airport' city = 'Berlin' country = 'DE' )
( airport_id = 'TXL' name = 'Berlin Tegel Airport' city = 'Berlin' country = 'DE' )
( airport_id = 'CDG' name = 'Charles de Gaulle Airport' city = 'Paris' country = 'FR' )
( airport_id = 'ORY' name = 'Orly Airport' city = 'Paris' country = 'FR' )
( airport_id = 'VIE' name = 'Vienna International Airport' city = 'Vienna' country = 'AT' )
( airport_id = 'ZRH' name = 'Zürich Airport' city = 'Zurich' country = 'CH' )
( airport_id = 'RTM' name = 'Rotterdam The Hague Airport' city = 'Rotterdam' country = 'NL' )
( airport_id = 'FCO' name = 'Leonardo da Vinci–Fiumicino Airport' city = 'Rome' country = 'IT' )
( airport_id = 'VCE' name = 'Venice Marco Polo Airport' city = 'Venice' country = 'IT' )
( airport_id = 'LCY' name = 'London City Airport' city = 'London' country = 'UK' )
( airport_id = 'LGW' name = 'Gatwick Airport' city = 'London' country = 'UK' )
( airport_id = 'LHR' name = 'Heathrow Airport' city = 'London' country = 'UK' )
( airport_id = 'MAD' name = 'Adolfo Suárez Madrid–Barajas Airport' city = 'Madrid' country = 'ES' )
( airport_id = 'VKO' name = 'Vnukovo International Airport' city = 'Moscow' country = 'RU' )
( airport_id = 'SVO' name = 'Sheremetyevo International Airport' city = 'Moscow' country = 'RU' )
" America
( airport_id = 'JFK' name = 'John F. Kennedy International Airport' city = 'New York City, New York' country = 'US' )
( airport_id = 'BNA' name = 'Nashville International Airport' city = 'Nashville, Tennessee' country = 'US' )
( airport_id = 'BOS' name = 'Logan International Airport' city = 'Boston, Massachusetts' country = 'US' )
( airport_id = 'ELP' name = 'El Paso International Airport' city = 'El Paso, Texas' country = 'US' )
( airport_id = 'DEN' name = 'Denver International Airport' city = 'Denver, Colorado' country = 'US' )
( airport_id = 'HOU' name = 'William P. Hobby Airport' city = 'Houston, Texas' country = 'US' )
( airport_id = 'LAS' name = 'McCarran International Airport' city = 'Las Vegas, Nevada' country = 'US' )
( airport_id = 'LAX' name = 'Los Angeles International Airport' city = 'Los Angeles, California' country = 'US' )
( airport_id = 'MCI' name = 'Kansas City International Airport' city = 'Kansas City, Missouri' country = 'US' )
( airport_id = 'MIA' name = 'Miami International Airport' city = 'Miami, Florida' country = 'US' )
( airport_id = 'SFO' name = 'San Francisco International Airport' city = 'San Francisco, California' country = 'US' )
( airport_id = 'EWR' name = 'Newark Liberty International Airport' city = 'Newark, New Jersey' country = 'US' )
( airport_id = 'YOW' name = 'Ottawa Macdonald–Cartier Int. Airport' city = 'Ottawa, Ontario' country = 'CA' )
( airport_id = 'ACA' name = 'General Juan N. Álvarez Int. Airport' city = 'Acapulco, Guerrero' country = 'MX' )
( airport_id = 'GIG' name = 'Rio de Janeiro–Galeão Int. Airport' city = 'Rio de Janeiro' country = 'BR' )
( airport_id = 'HAV' name = 'José Martí International Airport' city = 'Havana' country = 'CU' )
" Australia
( airport_id = 'ASP' name = 'Alice Springs Airport' city = 'Alice Springs, Northern Territory' country = 'AU' )
" Africa
( airport_id = 'ACE' name = 'Lanzarote Airport' city = 'Lanzarote, Canary Islands' country = 'ES' )
( airport_id = 'HRE' name = 'Harare International Airport' city = 'Harare' country = 'ZW' )
( airport_id = 'GCJ' name = 'Grand Central Airport' city = 'Johannesburg' country = 'SA' )
" Asia
( airport_id = 'NRT' name = 'Narita International Airport' city = 'Tokyo, Honshu' country = 'JP' )
( airport_id = 'ITM' name = 'Osaka International Airport' city = 'Osaka, Honshu' country = 'JP' )
( airport_id = 'KIX' name = 'Kansai International Airport' city = 'Osaka, Honshu' country = 'JP' )
( airport_id = 'HIJ' name = 'Hiroshima Airport' city = 'Hiroshima, Honshu' country = 'JP' )
( airport_id = 'SIN' name = 'Singapore Changi Airport' city = 'Singapore' country = 'SG' )
( airport_id = 'KUL' name = 'Kuala Lumpur International Airport' city = 'Kuala Lumpur' country = 'MY' )
( airport_id = 'HKG' name = 'Hong Kong International Airport' city = 'Hongkong' country = 'CN' )
( airport_id = 'BKK' name = 'Suvarnabhumi Airport' city = 'Bangkok' country = 'TH' )
).
ENDMETHOD.
ENDCLASS.
CLASS lcl_carrier_data_generator DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES: lif_data_generator.
TYPES: tt_carrier TYPE STANDARD TABLE OF /dmo/carrier29 WITH KEY carrier_id.
CLASS-METHODS: get_data
RETURNING
VALUE(rt_data) TYPE tt_carrier.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS lcl_carrier_data_generator IMPLEMENTATION.
METHOD lif_data_generator~create.
IF out IS BOUND. out->write( '--> Delete Content.' ). ENDIF.
DELETE FROM /dmo/carrier29. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Build Content.' ). ENDIF.
DATA(lt_data) = get_data( ).
IF out IS BOUND. out->write( '--> Insert Content.' ). ENDIF.
INSERT /dmo/carrier29 FROM TABLE @lt_data.
IF out IS BOUND. out->write( '--> Done.' ). ENDIF.
ENDMETHOD.
METHOD get_data.
rt_data = VALUE tt_carrier(
( carrier_id = 'AA' name = 'American Airlines Inc.' currency_code = 'USD' )
( carrier_id = 'AC' name = 'Air Canada' currency_code = 'CAD' )
( carrier_id = 'AF' name = 'Air France' currency_code = 'EUR' )
( carrier_id = 'AZ' name = 'Alitalia Societa Aerea Italiana S.p.A.' currency_code = 'EUR' )
( carrier_id = 'BA' name = 'British Airways p.l.c.' currency_code = 'GBP' )
( carrier_id = 'FJ' name = 'Air Pacific Limited t/a Fiji Airway' currency_code = 'USD' )
( carrier_id = 'CO' name = 'Cobaltair Ltd. dba Cobalt' currency_code = 'USD' )
( carrier_id = 'DL' name = 'Delta Air Lines, Inc.' currency_code = 'USD' )
( carrier_id = 'LH' name = 'Deutsche Lufthansa AG' currency_code = 'EUR' )
( carrier_id = 'NG' name = 'AL-Naser Wings' currency_code = 'EUR' )
( carrier_id = 'JL' name = 'Japan Airlines Co., Ltd.' currency_code = 'JPY' )
( carrier_id = 'QF' name = 'Qantas Airways Ltd.' currency_code = 'AUD' )
( carrier_id = 'SA' name = 'South African Airways' currency_code = 'ZAR' )
( carrier_id = 'SQ' name = 'Singapore Airlines Limited' currency_code = 'SGD' )
( carrier_id = 'SR' name = 'Sundair GmbH' currency_code = 'CHF' )
( carrier_id = 'UA' name = 'United Airlines, Inc.' currency_code = 'USD' )
).
ENDMETHOD.
ENDCLASS.
CLASS lcl_connection_data_generator DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES: lif_data_generator.
TYPES: tt_connection TYPE STANDARD TABLE OF /dmo/connecti_29 WITH KEY carrier_id connection_id.
TYPES:
"! Structure for additional information for generation. <br/>
"! <em>weekday</em> '1' means Monday, '7' is Sunday
BEGIN OF ty_connection_additional_info.
INCLUDE TYPE /dmo/connecti_29.
TYPES: weekday TYPE i,
END OF ty_connection_additional_info.
TYPES: tt_connection_additional_info TYPE STANDARD TABLE OF ty_connection_additional_info WITH KEY connection_id.
CLASS-METHODS: get_data "provide data public
RETURNING VALUE(rt_data) TYPE tt_connection_additional_info.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS lcl_connection_data_generator IMPLEMENTATION.
METHOD lif_data_generator~create.
IF out IS BOUND. out->write( '--> Delete Content.' ). ENDIF.
DELETE FROM /dmo/connecti_29. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Build Content.' ). ENDIF.
DATA(lt_data) = get_data( ).
DATA(lt_data_db) = CORRESPONDING tt_connection( lt_data ).
IF out IS BOUND. out->write( '--> Insert Content.' ). ENDIF.
INSERT /dmo/connecti_29 FROM TABLE @lt_data.
IF out IS BOUND. out->write( '--> Done.' ). ENDIF.
ENDMETHOD.
METHOD get_data.
rt_data = VALUE tt_connection_additional_info(
( carrier_id = 'SQ' connection_id = '0001' airport_from_id = 'SFO' airport_to_id = 'SIN' departure_time = '011500' arrival_time = '115000' distance = 13523 distance_unit = 'KM' weekday = 3 ) "1-7
( carrier_id = 'SQ' connection_id = '0002' airport_from_id = 'SIN' airport_to_id = 'SFO' departure_time = '063000' arrival_time = '091500' distance = 13523 distance_unit = 'KM' weekday = 4 ) "1-7
( carrier_id = 'SQ' connection_id = '0011' airport_from_id = 'NRT' airport_to_id = 'SIN' departure_time = '145500' arrival_time = '205000' distance = 5363 distance_unit = 'KM' weekday = 4 ) "1-7
( carrier_id = 'SQ' connection_id = '0012' airport_from_id = 'SIN' airport_to_id = 'NRT' departure_time = '095300' arrival_time = '175400' distance = 5363 distance_unit = 'KM' weekday = 6 ) "1-7
( carrier_id = 'UA' connection_id = '0058' airport_from_id = 'SFO' airport_to_id = 'FRA' departure_time = '134500' arrival_time = '095500' distance = 9608 distance_unit = 'KM' weekday = 1 ) "1-7
( carrier_id = 'UA' connection_id = '0059' airport_from_id = 'FRA' airport_to_id = 'SFO' departure_time = '135500' arrival_time = '163000' distance = 9608 distance_unit = 'KM' weekday = 2 ) "1-7
( carrier_id = 'UA' connection_id = '1537' airport_from_id = 'EWR' airport_to_id = 'MIA' departure_time = '215600' arrival_time = '004700' distance = 1752 distance_unit = 'KM' weekday = 5 ) "1-7
( carrier_id = 'AA' connection_id = '0322' airport_from_id = 'MIA' airport_to_id = 'EWR' departure_time = '201700' arrival_time = '231900' distance = 1752 distance_unit = 'KM' weekday = 7 ) "1-7
( carrier_id = 'AA' connection_id = '0017' airport_from_id = 'MIA' airport_to_id = 'HAV' departure_time = '071900' arrival_time = '080300' distance = 520 distance_unit = 'KM' weekday = 3 ) "1-7
( carrier_id = 'AA' connection_id = '2678' airport_from_id = 'HAV' airport_to_id = 'MIA' departure_time = '061500' arrival_time = '103000' distance = 520 distance_unit = 'KM' weekday = 6 ) "1-7
( carrier_id = 'AA' connection_id = '0015' airport_from_id = 'JFK' airport_to_id = 'SFO' departure_time = '071300' arrival_time = '100400' distance = 4156 distance_unit = 'KM' weekday = 5 ) "1-7
( carrier_id = 'AA' connection_id = '0018' airport_from_id = 'SFO' airport_to_id = 'JFK' departure_time = '064000' arrival_time = '150600' distance = 4156 distance_unit = 'KM' weekday = 4 ) "1-7
( carrier_id = 'LH' connection_id = '0400' airport_from_id = 'FRA' airport_to_id = 'JFK' departure_time = '101000' arrival_time = '113400' distance = 6162 distance_unit = 'KM' weekday = 6 ) "1-7
( carrier_id = 'LH' connection_id = '0401' airport_from_id = 'JFK' airport_to_id = 'FRA' departure_time = '183000' arrival_time = '074500' distance = 6162 distance_unit = 'KM' weekday = 5 ) "1-7
( carrier_id = 'LH' connection_id = '0402' airport_from_id = 'FRA' airport_to_id = 'EWR' departure_time = '133000' arrival_time = '153500' distance = 6217 distance_unit = 'KM' weekday = 1 ) "1-7
( carrier_id = 'LH' connection_id = '0403' airport_from_id = 'EWR' airport_to_id = 'FRA' departure_time = '180900' arrival_time = '073000' distance = 6217 distance_unit = 'KM' weekday = 1 ) "1-7
( carrier_id = 'JL' connection_id = '0407' airport_from_id = 'NRT' airport_to_id = 'FRA' departure_time = '132300' arrival_time = '155600' distance = 9379 distance_unit = 'KM' weekday = 5 ) "1-7
( carrier_id = 'JL' connection_id = '0408' airport_from_id = 'FRA' airport_to_id = 'NRT' departure_time = '202500' arrival_time = '154000' distance = 9379 distance_unit = 'KM' weekday = 6 ) "1-7
( carrier_id = 'AZ' connection_id = '0788' airport_from_id = 'VCE' airport_to_id = 'NRT' departure_time = '132500' arrival_time = '101300' distance = 9595 distance_unit = 'KM' weekday = 6 )
( carrier_id = 'AZ' connection_id = '0789' airport_from_id = 'NRT' airport_to_id = 'VCE' departure_time = '142600' arrival_time = '213100' distance = 9595 distance_unit = 'KM' weekday = 5 )
).
ENDMETHOD.
ENDCLASS.
CLASS lcl_flight_data_generator DEFINITION DEFERRED.
CLASS /dmo/cl_flight_data_generat_29 DEFINITION LOCAL FRIENDS lcl_flight_data_generator.
CLASS lcl_flight_data_generator DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES: lif_data_generator.
TYPES: tt_flights TYPE STANDARD TABLE OF /dmo/flight29
WITH KEY carrier_id connection_id flight_date
WITH NON-UNIQUE SORTED KEY key_sorted_seats COMPONENTS seats_occupied
WITH NON-UNIQUE SORTED KEY key_sorted_date COMPONENTS connection_id flight_date.
CLASS-METHODS: get_data
RETURNING VALUE(rt_data) TYPE tt_flights.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES: BEGIN OF ty_plane_type,
id TYPE /dmo/plane_type_id29,
seats_max TYPE /dmo/plane_seats_max29,
long_distance TYPE abap_bool,
index TYPE int1,
END OF ty_plane_type,
BEGIN OF ty_flight_info,
id TYPE /dmo/plane_type_id29,
long_distance TYPE abap_bool,
seats_max TYPE /dmo/plane_seats_max29,
seats_occupied TYPE /dmo/plane_seats_occupied29,
price TYPE /dmo/flight_price29,
END OF ty_flight_info,
BEGIN OF ty_connection_recurrency,
id TYPE /dmo/connection_id29,
recurrency TYPE STANDARD TABLE OF /dmo/flight_date29 WITH EMPTY KEY,
END OF ty_connection_recurrency.
TYPES: tt_plane_type TYPE STANDARD TABLE OF ty_plane_type WITH KEY id,
tt_connection_recurrency TYPE STANDARD TABLE OF ty_connection_recurrency WITH KEY id.
CONSTANTS: cv_random_offset TYPE i VALUE 25,
cv_random_percent TYPE i VALUE 70.
CLASS-DATA: gt_connections TYPE lcl_connection_data_generator=>tt_connection,
gt_carrier TYPE lcl_carrier_data_generator=>tt_carrier,
gt_plane_types TYPE tt_plane_type,
go_random_int_distance_long TYPE REF TO cl_abap_random_int,
go_random_int_distance_short TYPE REF TO cl_abap_random_int,
gv_plane_distance_long TYPE i,
gv_plane_distance_short TYPE i,
gt_connection_recurrency TYPE lcl_flight_data_generator=>tt_connection_recurrency,
gt_flights TYPE lcl_flight_data_generator=>tt_flights,
go_random_seats TYPE REF TO cl_abap_random_int.
CLASS-METHODS: build_dependent_content,
get_flight_info
IMPORTING
iv_connection_id TYPE /dmo/connection_id29
RETURNING
VALUE(rs_plane_info) TYPE ty_flight_info,
build_plane_types
RETURNING
VALUE(rt_data) TYPE lcl_flight_data_generator=>tt_plane_type,
build_connection_recurrency
RETURNING
VALUE(rt_data) TYPE lcl_flight_data_generator=>tt_connection_recurrency,
calc_next_monday
IMPORTING
iv_date TYPE d
RETURNING
VALUE(rv_date) TYPE d.
ENDCLASS.
CLASS lcl_flight_data_generator IMPLEMENTATION.
METHOD lif_data_generator~create.
IF out IS BOUND. out->write( '--> Delete Content.' ). ENDIF.
DELETE FROM /dmo/flight29. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Build Dependent Content.' ). ENDIF.
build_dependent_content( ).
IF out IS BOUND. out->write( '--> Build Content.' ). ENDIF.
get_data( ).
IF out IS BOUND. out->write( '--> Insert Content.' ). ENDIF.
INSERT /dmo/flight29 FROM TABLE @gt_flights.
IF out IS BOUND. out->write( '--> Done.' ). ENDIF.
ENDMETHOD.
METHOD get_data.
DATA: lt_flights TYPE tt_flights,
ls_flight TYPE lcl_flight_data_generator=>ty_flight_info.
IF gt_flights IS NOT INITIAL.
rt_data = gt_flights.
EXIT.
ENDIF.
LOOP AT gt_connections INTO DATA(ls_connection).
LOOP AT gt_connection_recurrency[ id = ls_connection-connection_id ]-recurrency INTO DATA(lv_flight_date).
ls_flight = get_flight_info( ls_connection-connection_id ).
APPEND VALUE /dmo/flight29(
carrier_id = ls_connection-carrier_id
connection_id = ls_connection-connection_id
flight_date = lv_flight_date
price = ls_flight-price
currency_code = VALUE /dmo/flight29-currency_code(
gt_carrier[ carrier_id = ls_connection-carrier_id ]-currency_code
DEFAULT 'EUR' )
plane_type_id = ls_flight-id
seats_max = ls_flight-seats_max
seats_occupied = ls_flight-seats_occupied
) TO gt_flights.
ENDLOOP.
rt_data = gt_flights.
ENDLOOP.
ENDMETHOD.
METHOD build_dependent_content.
gt_connections = CORRESPONDING #( lcl_connection_data_generator=>get_data( ) ).
gt_carrier = lcl_carrier_data_generator=>get_data( ).
gt_plane_types = build_plane_types( ).
go_random_seats = cl_abap_random_int=>create(
min = cv_random_percent - cv_random_offset
max = cv_random_percent + cv_random_offset
).
gt_connection_recurrency = build_connection_recurrency( ).
ENDMETHOD.
METHOD get_flight_info.
DATA: lv_count TYPE i,
lo_random TYPE REF TO cl_abap_random_int.
DATA(lt_connections) = lcl_connection_data_generator=>get_data( ).
DATA(lv_is_long_distance) = COND abap_bool( WHEN lt_connections[ connection_id = iv_connection_id ]-distance > 3000
THEN abap_true
ELSE abap_false ).
IF lv_is_long_distance = abap_true.
IF gv_plane_distance_long IS INITIAL.
SELECT COUNT(*) FROM @gt_plane_types AS planes WHERE long_distance = @lv_is_long_distance INTO @gv_plane_distance_long.
ENDIF.
lv_count = gv_plane_distance_long.
IF go_random_int_distance_long IS NOT BOUND.
go_random_int_distance_long = cl_abap_random_int=>create( seed = 1337 min = 1 max = gv_plane_distance_long ).
ENDIF.
lo_random = go_random_int_distance_long.
ELSE.
IF gv_plane_distance_short IS INITIAL.
SELECT COUNT(*) FROM @gt_plane_types AS planes WHERE long_distance = @lv_is_long_distance INTO @gv_plane_distance_short.
ENDIF.
lv_count = gv_plane_distance_short.
IF go_random_int_distance_short IS NOT BOUND.
go_random_int_distance_short = cl_abap_random_int=>create( seed = 1337 min = 1 max = gv_plane_distance_short ).
ENDIF.
lo_random = go_random_int_distance_short.
ENDIF.
DATA(ls_plane_type) = gt_plane_types[
long_distance = lv_is_long_distance
index = lo_random->get_next( )
].
DATA(lv_seats_occupied_percent) = go_random_seats->get_next( ).
rs_plane_info = VALUE ty_flight_info(
id = ls_plane_type-id
long_distance = ls_plane_type-long_distance
seats_max = ls_plane_type-seats_max
seats_occupied = ls_plane_type-seats_max * lv_seats_occupied_percent DIV 100
price = /dmo/cl_flight_data_generat_29=>calculate_flight_price(
iv_seats_occupied_percent = lv_seats_occupied_percent
iv_flight_distance = lt_connections[ connection_id = iv_connection_id ]-distance
)
).
ENDMETHOD.
METHOD build_plane_types.
rt_data = VALUE tt_plane_type(
( id = 'A320-200' seats_max = 130 long_distance = ' ' index = 1 )
( id = 'A321-200' seats_max = 150 long_distance = ' ' index = 2 )
( id = '737-800' seats_max = 140 long_distance = ' ' index = 3 )
( id = 'A319-100' seats_max = 120 long_distance = ' ' index = 4 )
( id = '747-400' seats_max = 385 long_distance = 'X' index = 1 )
( id = '767-200' seats_max = 260 long_distance = 'X' index = 2 )
( id = 'A340-600' seats_max = 330 long_distance = 'X' index = 3 )
( id = 'A380-800' seats_max = 475 long_distance = 'X' index = 4 )
).
ENDMETHOD.
METHOD build_connection_recurrency.
CONSTANTS:
cv_days_between_test TYPE i VALUE 300,
cv_days_between_8weeks TYPE i VALUE 56,
cv_days_between_4weeks TYPE i VALUE 28,
cv_days_between_2weeks TYPE i VALUE 14,
cv_days_between_1weeks TYPE i VALUE 7.
DATA:
flight_date_max TYPE d,
flight_date_min TYPE d.
DATA(lv_days_between) = cv_days_between_test.
GET TIME STAMP FIELD DATA(current_timestamp).
DATA(tmp) = CONV string( current_timestamp ).
DATA lv_datum TYPE d.
lv_datum = tmp(8).
" flight_date_max is a Monday 8 months in the future
flight_date_max = calc_next_monday( CONV /dmo/flight_date29( lv_datum + 217 ) ).
" flight_date_min is a Monday 5 months in the past
flight_date_min = calc_next_monday( CONV /dmo/flight_date29( lv_datum - 148 ) ).
LOOP AT lcl_connection_data_generator=>get_data( ) INTO DATA(ls_connection).
APPEND VALUE ty_connection_recurrency(
id = ls_connection-connection_id
recurrency = VALUE ty_connection_recurrency-recurrency(
FOR flightdate = flight_date_max + ls_connection-weekday - 1
THEN flightdate - lv_days_between
UNTIL flightdate < flight_date_min + ls_connection-weekday - 1
( CONV /dmo/flight_date29( flightdate ) )
)
) TO rt_data.
ENDLOOP.
ENDMETHOD.
METHOD calc_next_monday.
* 01.01.1900 was a Saturday.
DATA(lv_weekday) = iv_date MOD 7.
* Therefore 0 is a Saturday, 1 for Sunday, etc.. and will be mapped to 1 for Monday, 2 for Tuesday, etc..
IF lv_weekday > 1.
lv_weekday = lv_weekday - 1.
ELSE.
lv_weekday = lv_weekday + 6.
ENDIF.
rv_date = iv_date - lv_weekday + 8.
ENDMETHOD.
ENDCLASS.
CLASS lcl_customer_data_generator DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES: lif_data_generator.
TYPES: BEGIN OF ty_last_name,
last_name TYPE /dmo/last_name29,
END OF ty_last_name.
TYPES: tt_customer TYPE STANDARD TABLE OF /dmo/customer29 WITH KEY customer_id,
tt_last_name TYPE STANDARD TABLE OF ty_last_name WITH KEY last_name.
CLASS-METHODS: get_data
RETURNING VALUE(rt_data) TYPE tt_customer,
build_last_names
RETURNING
VALUE(rt_data) TYPE tt_last_name.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
" Names
BEGIN OF ty_first_name,
first_name TYPE /dmo/first_name29,
gender TYPE c LENGTH 1,
END OF ty_first_name,
BEGIN OF ty_name,
first_name TYPE /dmo/first_name29,
last_name TYPE /dmo/last_name29,
title TYPE /dmo/title29,
END OF ty_name,
" Addresses
BEGIN OF ty_city,
country TYPE land1,
postal_code TYPE /dmo/postal_code29,
city TYPE /dmo/city29,
END OF ty_city,
tt_street_per_country TYPE STANDARD TABLE OF /dmo/street29 WITH EMPTY KEY,
BEGIN OF ty_street,
country TYPE land1,
streets TYPE tt_street_per_country,
END OF ty_street,
BEGIN OF ty_address,
country TYPE land1,
postal_code TYPE /dmo/postal_code29,
city TYPE /dmo/city29,
street TYPE /dmo/street29,
phone_number TYPE /dmo/phone_number29,
email_address TYPE /dmo/email_address29,
END OF ty_address.
TYPES:
" Names
tt_first_name TYPE STANDARD TABLE OF ty_first_name WITH KEY first_name,
tt_name TYPE STANDARD TABLE OF ty_name WITH KEY first_name last_name,
" Addresses
tt_city TYPE STANDARD TABLE OF ty_city WITH KEY country city,
tt_street TYPE STANDARD TABLE OF ty_street WITH KEY country,
tt_address TYPE STANDARD TABLE OF ty_address WITH KEY country city street.
CONSTANTS cv_email_host TYPE string VALUE `flight.example` ##NO_TEXT.
CONSTANTS cv_phone_number_seperator TYPE string VALUE `-` ##NO_TEXT.
CONSTANTS cv_phone_number_min TYPE int8 VALUE 1234567890.
CONSTANTS cv_phone_number_max TYPE int8 VALUE 9999999999.
CLASS-DATA gt_data TYPE lcl_customer_data_generator=>tt_customer.
CLASS-METHODS:
" Names
generate_names
RETURNING
VALUE(rt_data) TYPE tt_name,
build_first_names
RETURNING
VALUE(rt_data) TYPE tt_first_name,
" Adresses
generate_addresses
RETURNING
VALUE(rt_data) TYPE tt_address,
build_city
RETURNING
VALUE(rt_data) TYPE tt_city,
build_street
RETURNING
VALUE(rt_data) TYPE tt_street.
ENDCLASS.
CLASS lcl_customer_data_generator IMPLEMENTATION.
METHOD lif_data_generator~create.
IF out IS BOUND. out->write( '--> Delete Content.' ). ENDIF.
DELETE FROM /dmo/customer29. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Build Content.' ). ENDIF.
DATA(lt_data) = get_data( ).
IF out IS BOUND. out->write( '--> Insert Content.' ). ENDIF.
INSERT /dmo/customer29 FROM TABLE @lt_data.
IF out IS BOUND. out->write( '--> Done.' ). ENDIF.
ENDMETHOD.
METHOD build_first_names.
rt_data = VALUE tt_first_name(
( first_name = 'Simon' gender = 'M')
( first_name = 'Harish' gender = 'M')
( first_name = 'Volker' gender = 'M')
( first_name = 'Jasmin' gender = 'F')
( first_name = 'Felix' gender = 'M')
( first_name = 'Kristina' gender = 'F')
( first_name = 'Thilo' gender = 'M')
( first_name = 'Andrej' gender = 'M')
( first_name = 'Anna' gender = 'F')
( first_name = 'Johannes' gender = 'M')
( first_name = 'Johann' gender = 'M')
( first_name = 'Christoph' gender = 'M')
( first_name = 'Andreas' gender = 'M')
( first_name = 'Stephen' gender = 'M')
( first_name = 'Mathilde' gender = 'F')
( first_name = 'August' gender = 'M')
( first_name = 'Illya' gender = 'M')
( first_name = 'Georg' gender = 'M')
( first_name = 'Gisela' gender = 'F')
( first_name = 'Christa' gender = 'F')
( first_name = 'Holm' gender = 'M')
( first_name = 'Irmtraut' gender = 'F')
( first_name = 'Ludwig' gender = 'M')
( first_name = 'Laura' gender = 'F')
( first_name = 'Kurt' gender = 'M')
( first_name = 'Guenther' gender = 'M')
( first_name = 'Horst' gender = 'M')
( first_name = 'Matthias' gender = 'M')
( first_name = 'Amelie' gender = 'F')
( first_name = 'Walter' gender = 'M')
( first_name = 'Sophie' gender = 'F')
( first_name = 'Claire' gender = 'F')
( first_name = 'Chantal' gender = 'F')
( first_name = 'Jean' gender = 'M')
( first_name = 'Cindy' gender = 'F')
( first_name = 'Pierre' gender = 'M')
( first_name = 'Irene' gender = 'F')
( first_name = 'Adam' gender = 'M')
( first_name = 'Fabio' gender = 'M')
( first_name = 'Lothar' gender = 'M')
( first_name = 'Annemarie' gender = 'F')
( first_name = 'Ida' gender = 'F')
( first_name = 'Roland' gender = 'M')
( first_name = 'Achim' gender = 'M')
( first_name = 'Allen' gender = 'M')
( first_name = 'Lee' gender = 'M')
( first_name = 'Guillermo' gender = 'M')
( first_name = 'Florian' gender = 'M')
( first_name = 'Ulla' gender = 'F')
( first_name = 'Juan' gender = 'M')
( first_name = 'Marta' gender = 'F')
( first_name = 'Salvador' gender = 'M')
( first_name = 'Christine' gender = 'F')
( first_name = 'Dominik' gender = 'M')
( first_name = 'Astrid' gender = 'F')
( first_name = 'Ruth' gender = 'F')
( first_name = 'Theresia' gender = 'F')
( first_name = 'Thomas' gender = 'M')
( first_name = 'Friedrich' gender = 'M')
( first_name = 'Anneliese' gender = 'F')
( first_name = 'Peter' gender = 'M')
( first_name = 'Anne-Marie' gender = 'F')
( first_name = 'James' gender = 'M')
( first_name = 'Jean-Luc' gender = 'M')
( first_name = 'Benjamin' gender = 'M')
( first_name = 'Hendrik' gender = 'M')
( first_name = 'Uli' gender = 'F')
( first_name = 'Siegfried' gender = 'M')
( first_name = 'Max' gender = 'M')
).
ENDMETHOD.
METHOD build_last_names.
rt_data = VALUE tt_last_name(
( last_name = 'Buchholm')
( last_name = 'Vrsic')
( last_name = 'Jeremias')
( last_name = 'Gutenberg')
( last_name = 'Fischmann')
( last_name = 'Columbo')
( last_name = 'Neubasler')
( last_name = 'Martin')
( last_name = 'Detemple')
( last_name = 'Barth')
( last_name = 'Benz')
( last_name = 'Hansmann')
( last_name = 'Koslowski')
( last_name = 'Wohl')
( last_name = 'Koller')
( last_name = 'Hoffen')
( last_name = 'Dumbach')
( last_name = 'Goelke')
( last_name = 'Waldmann')
( last_name = 'Mechler')
( last_name = 'Buehler')
( last_name = 'Heller')
( last_name = 'Simonen')
( last_name = 'Henry')
( last_name = 'Marshall')
( last_name = 'Legrand')
( last_name = 'Jacqmain')
( last_name = 'D´Oultrement')
( last_name = 'Hunter')
( last_name = 'Delon')
( last_name = 'Kreiss')
( last_name = 'Trensch')
( last_name = 'Cesari')
( last_name = 'Matthaeus')
( last_name = 'Babilon')
( last_name = 'Zimmermann')
( last_name = 'Kramer')
( last_name = 'Illner')
( last_name = 'Pratt')
( last_name = 'Gahl')
( last_name = 'Benjamin')
( last_name = 'Miguel')
( last_name = 'Weiss')
( last_name = 'Sessler')
( last_name = 'Montero')
( last_name = 'Domenech')
( last_name = 'Moyano')
( last_name = 'Sommer')
( last_name = 'Schneider')
( last_name = 'Eichbaum')
( last_name = 'Gueldenpfennig')
( last_name = 'Sudhoff')
( last_name = 'Lautenbach')
( last_name = 'Ryan')
( last_name = 'Prinz')
( last_name = 'Deichgraeber')
( last_name = 'Pan')
( last_name = 'Lindwurm')
( last_name = 'Kirk')
( last_name = 'Picard')
( last_name = 'Sisko')
( last_name = 'Madeira')
( last_name = 'Meier')
( last_name = 'Rahn')
( last_name = 'Leisert')
( last_name = 'Müller')
( last_name = 'Mustermann')
( last_name = 'Becker')
( last_name = 'Fischer')
).
ENDMETHOD.
METHOD get_data.
IF gt_data IS NOT INITIAL.
rt_data = gt_data.
EXIT.
ENDIF.
DATA(lt_names) = generate_names( ).
DATA(lt_addresses) = generate_addresses( ).
DATA(lo_random_phone_number) = cl_abap_random_int8=>create( min = cv_phone_number_min
max = cv_phone_number_max ).
DATA(lo_random_city) = cl_abap_random_int=>create( min = 1 max = lines( lt_addresses ) ).
DATA(lo_random_street_number) = cl_abap_random_int=>create( min = 1 max = 100 ).
gt_data = VALUE tt_customer(
FOR i = 1 THEN i + 1 WHILE i <= lines( lt_names ) LET j = lo_random_city->get_next( ) IN
(
customer_id = i
first_name = lt_names[ i ]-first_name
last_name = lt_names[ i ]-last_name
title = lt_names[ i ]-title
street = lt_addresses[ j ]-street && ` ` && lo_random_street_number->get_next( )
postal_code = lt_addresses[ j ]-postal_code
city = lt_addresses[ j ]-city
country_code = lt_addresses[ j ]-country
phone_number = '+' && COND string(
WHEN lt_addresses[ j ]-country = 'AT' THEN '43'
WHEN lt_addresses[ j ]-country = 'BE' THEN '32'
WHEN lt_addresses[ j ]-country = 'CH' THEN '41'
WHEN lt_addresses[ j ]-country = 'DE' THEN '49'
WHEN lt_addresses[ j ]-country = 'ES' THEN '34'
WHEN lt_addresses[ j ]-country = 'FR' THEN '33'
WHEN lt_addresses[ j ]-country = 'IT' THEN '39'
WHEN lt_addresses[ j ]-country = 'SI' THEN '386'
WHEN lt_addresses[ j ]-country = 'US' THEN '1'
ELSE '89'
)
&& cv_phone_number_seperator
&& |{ replace( val = lo_random_phone_number->get_next( ) off = 3 len = 1 with = cv_phone_number_seperator ) }|
email_address = to_lower( lt_names[ i ]-first_name && `.` && lt_names[ i ]-last_name && `@` && cv_email_host && `.` && lt_addresses[ j ]-country )
)
).
rt_data = gt_data.
ENDMETHOD.
METHOD generate_names.
DATA: lo_random_counter TYPE REF TO cl_abap_random_int,
lo_random_first_name TYPE REF TO cl_abap_random_int,
lo_random_title TYPE REF TO cl_abap_random_int,
ls_first_name TYPE lcl_customer_data_generator=>ty_first_name.
DATA(lt_first_names) = build_first_names( ).
lo_random_counter = cl_abap_random_int=>create( min = 5 max = 15 ).
lo_random_first_name = cl_abap_random_int=>create( min = 1 max = lines( lt_first_names ) ).
LOOP AT build_last_names( ) INTO DATA(ls_last_name).
DO lo_random_counter->get_next( ) TIMES.
ls_first_name = lt_first_names[ lo_random_first_name->get_next( ) ].
APPEND VALUE ty_name(
first_name = ls_first_name-first_name
last_name = ls_last_name-last_name
title = COND /dmo/title29( WHEN ls_first_name-gender = 'M' THEN 'Mr.'
WHEN ls_first_name-gender = 'F' THEN 'Mrs.'
ELSE 'Martian' )
) TO rt_data.
ENDDO.
ENDLOOP.
ENDMETHOD.
METHOD build_city.
rt_data = VALUE tt_city(
( country = 'DE' postal_code = '23496' city = 'Dielheim')
( country = 'SI' postal_code = '1000' city = 'Ljubljana')
( country = 'DE' postal_code = '86343' city = 'Koenigsbrunn')
( country = 'DE' postal_code = '55128' city = 'Mainz')
( country = 'DE' postal_code = '11111' city = 'Berlin')
( country = 'US' postal_code = '17844' city = 'Washington')
( country = 'AT' postal_code = '4020' city = 'Linz')
( country = 'DE' postal_code = '68723' city = 'Schwetzingen')
( country = 'DE' postal_code = '68789' city = 'St. Leon-Rot')
( country = 'DE' postal_code = '66464' city = 'Homburg')
( country = 'DE' postal_code = '69231' city = 'Rauenberg')
( country = 'DE' postal_code = '69190' city = 'Walldorf')
( country = 'DE' postal_code = '58332' city = 'Schwelm')
( country = 'DE' postal_code = '64342' city = 'Seeheim-Jugenheim')
( country = 'DE' postal_code = '69121' city = 'Heidelberg')
( country = 'DE' postal_code = '63150' city = 'Heusenstamm')
( country = 'DE' postal_code = '64283' city = 'Darmstadt')
( country = 'DE' postal_code = '69207' city = 'Kurt')
( country = 'DE' postal_code = '79104' city = 'Freiburg')
( country = 'DE' postal_code = '79312' city = 'Emmendingen')
( country = 'DE' postal_code = '68753' city = 'Amelie')
( country = 'DE' postal_code = '68163' city = 'Mannheim')
( country = 'DE' postal_code = '67105' city = 'Schifferstadt')
( country = 'DE' postal_code = '68163' city = 'Mannheim-Lindenhof')
( country = 'FR' postal_code = '78140' city = 'Vélizy')
( country = 'CH' postal_code = '1211' city = 'Genève')
( country = 'BE' postal_code = 'B - 1030' city = 'Bruxelles')
( country = 'US' postal_code = '76018' city = 'Arlington')
( country = 'FR' postal_code = '06130' city = 'Grasse')
( country = 'DE' postal_code = '27299' city = 'Langwedel')
( country = 'DE' postal_code = '69483' city = 'Wald-Michelbach')
( country = 'IT' postal_code = '00195' city = 'Roma')
( country = 'DE' postal_code = '81375' city = 'Muenchen')
( country = 'DE' postal_code = '67663' city = 'Kaiserslautern')
( country = 'DE' postal_code = '66386' city = 'St. Ingbert')
( country = 'DE' postal_code = '79761' city = 'Waldshut')
( country = 'DE' postal_code = '76137' city = 'Karlsruhe')
( country = 'US' postal_code = '07666' city = 'Teaneck')
( country = 'US' postal_code = '17758' city = 'N. Massapequa')
( country = 'US' postal_code = '09765' city = 'Boulder')
( country = 'ES' postal_code = '28020' city = 'Madrid')
( country = 'DE' postal_code = '69180' city = 'Wiesloch')
( country = 'ES' postal_code = '08014' city = 'Barcelona')
( country = 'ES' postal_code = '41006' city = 'Sevilla')
( country = 'DE' postal_code = '75305' city = 'Neuenburg')
( country = 'DE' postal_code = '41466' city = 'Neuss')
( country = 'DE' postal_code = '71116' city = 'Gaertringen')
( country = 'US' postal_code = '60657' city = 'Chicago')
( country = 'DE' postal_code = '63263' city = 'Neu-Isenburg')
( country = 'DE' postal_code = '23056' city = 'Buxtehude')
( country = 'DE' postal_code = '16233' city = 'Potsdam')
( country = 'DE' postal_code = '90419' city = 'Nuernberg')
( country = 'US' postal_code = '22334' city = 'San Francisco')
( country = 'FR' postal_code = '75839' city = 'Paris')
( country = 'US' postal_code = '63728' city = 'New Orleans')
( country = 'DE' postal_code = '75757' city = 'Elsenz')
( country = 'DE' postal_code = '70111' city = 'Reutlingen')
( country = 'DE' postal_code = '15344' city = 'Strausberg')
).
ENDMETHOD.
METHOD generate_addresses.
TYPES: BEGIN OF ty_random_street,
country TYPE land1,
random TYPE REF TO cl_abap_random_int,
END OF ty_random_street,
tt_random_street TYPE STANDARD TABLE OF ty_random_street WITH KEY country.
DATA: lo_random_counter TYPE REF TO cl_abap_random_int,
lo_random_city TYPE REF TO cl_abap_random_int,
lt_random_street TYPE tt_random_street,
lo_phone_number TYPE REF TO cl_abap_random_int.
DATA(lt_street) = build_street( ).
lo_random_counter = cl_abap_random_int=>create( min = 5 max = 15 ).
lo_phone_number = cl_abap_random_int=>create( min = 1 max = 100 ).
LOOP AT lt_street INTO DATA(ls_street).
APPEND VALUE ty_random_street(
country = ls_street-country
random = cl_abap_random_int=>create( min = 1 max = lines( ls_street-streets ) )
) TO lt_random_street.
ENDLOOP.
LOOP AT build_city( ) INTO DATA(ls_city).
DO lo_random_counter->get_next( ) TIMES.
APPEND VALUE ty_address(
country = ls_city-country
postal_code = ls_city-postal_code
city = ls_city-city
street = |{ lt_street[
country = ls_city-country
]-streets[
lt_random_street[ country = ls_city-country ]-random->get_next( )
] }|
) TO rt_data.
ENDDO.
ENDLOOP.
ENDMETHOD.
METHOD build_street.
rt_data = VALUE tt_street(
( country = 'AT' streets = VALUE tt_street_per_country( ( 'Hasnerstrasse' ) ) )
( country = 'BE' streets = VALUE tt_street_per_country( ( 'rue Voltaire' ) ) )
( country = 'CH' streets = VALUE tt_street_per_country( ( 'rue de Moillebeau' ) ) )
( country = 'DE' streets = VALUE tt_street_per_country( ( 'Akazienweg' )
( 'Albert-Schweitzer-Str.' )
( 'Alte Reichsstr.' )
( 'Am Deich' )
( 'Arionweg' )
( 'Arndtstrasse' )
( 'Auf dem Huegel' )
( 'Ausfallstr.' )
( 'Ausserhalb' )
( 'Carl-Metz Strasse' )
( 'Caspar-David-Friedrich-Str.' )
( 'Dudweilerstr.' )
( 'Elzstrasse' )
( 'Emil-Heckel-Str.' )
( 'Erlengrund' )
( 'Franz-Marc-Str.' )
( 'Friedensallee' )
( 'Froschstr.' )
( 'Gartenstr.' )
( 'Gemeindestr.' )
( 'Goeckinghofstr.' )
( 'Gruenlingweg' )
( 'Hauptstr.' )
( 'Heidelberger Str.' )
( 'Im Warmet' )
( 'Jacobistrasse' )
( 'Karl-Marx-Allee' )
( 'Karl-Schwaner-Str.' )
( 'Leichhof' )
( 'Lerchenstr.' )
( 'Marktplatz' )
( 'Max-Planck-Str.' )
( 'Meerfeldstr.' )
( 'Melissenstr.' )
( 'Muehltalstr.' )
( 'Mutterstadter Str.' )
( 'N7,' )
( 'Rankestr.' )
( 'Raupelsweg' )
( 'Schillerstr.' )
( 'Stauboernchenstrasse' )
( 'Stiftsbogen' )
( 'Waldmann' )
( 'Wilhelminentr.' )
( 'Zwischergasse' ) ) )
( country = 'ES' streets = VALUE tt_street_per_country( ( 'Camelias' )
( 'Fuenlabrada' )
( 'Piedad' )
( 'Pza. Pablo Ruiz Picasso' ) ) )
( country = 'FR' streets = VALUE tt_street_per_country( ( 'Rue Balzac' )
( 'route de Pégomas' )
( 'rue Nieuport' ) ) )
( country = 'IT' streets = VALUE tt_street_per_country( ( 'Via Giulio Cesare' ) ) )
( country = 'SI' streets = VALUE tt_street_per_country( ( 'Poklukarjeva' ) ) )
( country = 'US' streets = VALUE tt_street_per_country( ( '17th St.' )
( 'Federal Avenue' )
( 'Golden Gate Drive' )
( 'Lake Shore Drive' )
( 'Oak Street' )
( 'Sagamore St.' )
( 'Voodoo Avenue' )
( 'Windstone Drive' ) ) )
).
ENDMETHOD.
ENDCLASS.
CLASS lcl_supplement_data_generator DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES: lif_data_generator.
TYPES: tt_supplement TYPE STANDARD TABLE OF /dmo/suppleme_29 WITH KEY supplement_id,
tt_supplement_text TYPE STANDARD TABLE OF /dmo/suppl_te_29 WITH KEY supplement_id.
" Merged types
TYPES BEGIN OF ty_supplement_complete.
INCLUDE TYPE /dmo/suppleme_29.
TYPES language_code TYPE spras.
TYPES description TYPE /dmo/description29.
TYPES END OF ty_supplement_complete.
TYPES tt_supplement_complete TYPE STANDARD TABLE OF ty_supplement_complete WITH KEY supplement_id.
CLASS-METHODS: get_data
RETURNING VALUE(rt_data) TYPE tt_supplement_complete.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS lcl_supplement_data_generator IMPLEMENTATION.
METHOD lif_data_generator~create.
IF out IS BOUND. out->write( '--> Delete Content.' ). ENDIF.
DELETE FROM /dmo/suppleme_29. "#EC CI_NOWHERE
DELETE FROM /dmo/suppl_te_29. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Build Content.' ). ENDIF.
DATA(lt_data) = get_data( ).
IF out IS BOUND. out->write( '--> Insert Content.' ). ENDIF.
INSERT /dmo/suppleme_29 FROM TABLE @( CORRESPONDING tt_supplement( lt_data ) ).
INSERT /dmo/suppl_te_29 FROM TABLE @( CORRESPONDING tt_supplement_text( lt_data ) ).
IF out IS BOUND. out->write( '--> Done.' ). ENDIF.
ENDMETHOD.
METHOD get_data.
" BV = beverage
" ML = meal
" LU = luggage
" EX = extra
rt_data = VALUE tt_supplement_complete(
( supplement_id = 'BV-0001' price = '2.30' currency_code = 'EUR' language_code = 'E' description = 'Hot Chocolate' )
( supplement_id = 'BV-0002' price = '7.50' currency_code = 'EUR' language_code = 'E' description = 'Alcohol free Champagne' )
( supplement_id = 'BV-0003' price = '3.50' currency_code = 'EUR' language_code = 'E' description = 'Cola' )
( supplement_id = 'BV-0004' price = '3.50' currency_code = 'EUR' language_code = 'E' description = 'Orange Limonade' )
( supplement_id = 'BV-0005' price = '3.50' currency_code = 'EUR' language_code = 'E' description = 'Apple Juice' )
( supplement_id = 'BV-0006' price = '3.50' currency_code = 'EUR' language_code = 'E' description = 'Pear Juice' )
( supplement_id = 'BV-0007' price = '3.50' currency_code = 'EUR' language_code = 'E' description = 'Mango Juice' )
( supplement_id = 'BV-0008' price = '3.50' currency_code = 'EUR' language_code = 'E' description = 'Lemon Limonade' )
( supplement_id = 'BV-0009' price = '4.50' currency_code = 'EUR' language_code = 'E' description = 'Tomato Juice' )
( supplement_id = 'ML-0001' price = '3.00' currency_code = 'EUR' language_code = 'E' description = 'Black Forest Cake' )
( supplement_id = 'ML-0002' price = '2.00' currency_code = 'EUR' language_code = 'E' description = 'Chocolate Cake' )
( supplement_id = 'ML-0003' price = '1.50' currency_code = 'EUR' language_code = 'E' description = 'Apple Pie' )
( supplement_id = 'ML-0004' price = '1.50' currency_code = 'EUR' language_code = 'E' description = 'Pear Pie' )
( supplement_id = 'ML-0005' price = '8.00' currency_code = 'EUR' language_code = 'E' description = 'Nice Salad')
( supplement_id = 'ML-0006' price = '9.00' currency_code = 'EUR' language_code = 'E' description = 'Paris Salad')
( supplement_id = 'ML-0007' price = '12.00' currency_code = 'EUR' language_code = 'E' description = 'Hamburg Salad with Eggs' )
( supplement_id = 'ML-0008' price = '25.00' currency_code = 'EUR' language_code = 'E' description = 'Quail with French Salad and Black Forest Cake')
( supplement_id = 'ML-0009' price = '13.00' currency_code = 'EUR' language_code = 'E' description = 'Duck on Lettuce' )
( supplement_id = 'ML-0010' price = '5.00' currency_code = 'EUR' language_code = 'E' description = 'Carpaccio')
( supplement_id = 'ML-0011' price = '7.00' currency_code = 'EUR' language_code = 'E' description = 'Seasonal Salad')
( supplement_id = 'ML-0012' price = '16.00' currency_code = 'EUR' language_code = 'E' description = 'Hamburg Salad with Fresh Shrimps')
( supplement_id = 'ML-0013' price = '17.00' currency_code = 'EUR' language_code = 'E' description = 'Quail')
( supplement_id = 'ML-0014' price = '14.00' currency_code = 'EUR' language_code = 'E' description = 'Wiener Schnitzel')
( supplement_id = 'ML-0015' price = '13.00' currency_code = 'EUR' language_code = 'E' description = 'Pork Schnitzel')
( supplement_id = 'ML-0016' price = '14.00' currency_code = 'EUR' language_code = 'E' description = 'Schnitzel with Pepper Sauce')
( supplement_id = 'ML-0017' price = '11.00' currency_code = 'EUR' language_code = 'E' description = 'Chicken and French Fries')
( supplement_id = 'ML-0018' price = '12.00' currency_code = 'EUR' language_code = 'E' description = 'Turkey Steak')
( supplement_id = 'ML-0019' price = '15.00' currency_code = 'EUR' language_code = 'E' description = 'Bavarian Duck')
( supplement_id = 'ML-0020' price = '14.00' currency_code = 'EUR' language_code = 'E' description = 'Knuckle of Pork')
( supplement_id = 'ML-0021' price = '22.00' currency_code = 'EUR' language_code = 'E' description = 'Fillet of Beef')
( supplement_id = 'ML-0022' price = '21.00' currency_code = 'EUR' language_code = 'E' description = 'Trout Au Bleu')
( supplement_id = 'ML-0023' price = '20.00' currency_code = 'EUR' language_code = 'E' description = 'Trout Meuniere')
( supplement_id = 'ML-0024' price = '17.00' currency_code = 'EUR' language_code = 'E' description = 'Monkfish')
( supplement_id = 'ML-0025' price = '12.00' currency_code = 'EUR' language_code = 'E' description = 'Sole')
( supplement_id = 'ML-0026' price = '6.00' currency_code = 'EUR' language_code = 'E' description = 'Mini Fried Sole')
( supplement_id = 'ML-0027' price = '14.00' currency_code = 'EUR' language_code = 'E' description = 'Salmon in a Bearnaise Sauce')
( supplement_id = 'ML-0028' price = '15.00' currency_code = 'EUR' language_code = 'E' description = 'Salmon Lasagne')
( supplement_id = 'ML-0029' price = '3.00' currency_code = 'EUR' language_code = 'E' description = 'Chocolate Ice Cream')
( supplement_id = 'ML-0030' price = '2.50' currency_code = 'EUR' language_code = 'E' description = 'Vanilla Ice Cream')
( supplement_id = 'ML-0031' price = '4.50' currency_code = 'EUR' language_code = 'E' description = 'Vanilla Ice Cream with Hot Cherries')
( supplement_id = 'ML-0032' price = '4.50' currency_code = 'EUR' language_code = 'E' description = 'Vanilla Ice Cream with Hot Raspberries')
( supplement_id = 'ML-0033' price = '4.00' currency_code = 'EUR' language_code = 'E' description = 'Apple Strudel')
( supplement_id = 'ML-0034' price = '4.00' currency_code = 'EUR' language_code = 'E' description = 'Raspberry Sorbet')
( supplement_id = 'ML-0035' price = '4.00' currency_code = 'EUR' language_code = 'E' description = 'Strawberry Sorbet')
( supplement_id = 'LU-0001' price = '40.00' currency_code = 'EUR' language_code = 'E' description = 'Extra baggage 5 kgs')
( supplement_id = 'LU-0002' price = '15.00' currency_code = 'EUR' language_code = 'E' description = 'Luggage transfer from airport to hotel')
( supplement_id = 'LU-0003' price = '75.00' currency_code = 'EUR' language_code = 'E' description = 'Luggage pickup from home and return ' )
( supplement_id = 'LU-0004' price = '80.00' currency_code = 'EUR' language_code = 'E' description = 'Bulky goods like sports equipment' )
) .
ENDMETHOD.
ENDCLASS.
CLASS lcl_travel_data_generator DEFINITION DEFERRED.
CLASS /dmo/cl_flight_data_generat_29 DEFINITION LOCAL FRIENDS lcl_travel_data_generator.
CLASS lcl_travel_data_generator DEFINITION CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES: lif_data_generator.
TYPES: tt_travel TYPE STANDARD TABLE OF /dmo/travel29 WITH KEY travel_id,
tt_bookings TYPE STANDARD TABLE OF /dmo/booking29 WITH KEY travel_id booking_id,
tt_booking_supplements TYPE STANDARD TABLE OF /dmo/book_sup_29 WITH KEY travel_id booking_id booking_supplement_id.
" Build nested tables
TYPES BEGIN OF ty_booking_complete.
INCLUDE TYPE /dmo/booking29.
TYPES booking_supplements TYPE tt_booking_supplements.
TYPES END OF ty_booking_complete.
TYPES tt_booking_complete TYPE STANDARD TABLE OF ty_booking_complete WITH KEY travel_id booking_id.
TYPES BEGIN OF ty_travel_complete.
INCLUDE TYPE /dmo/travel29.
TYPES bookings TYPE tt_booking_complete.
TYPES END OF ty_travel_complete.
"! <em>Travel</em> structure <br/>
"! <em>Bookings</em> table <br/>
"! --> <em>Booking</em> structure <br/>
"! --> <em>Booking Supplement</em> table <br/>
"! -----> <em>Booking Supplement</em> structure
TYPES tt_travel_complete TYPE STANDARD TABLE OF ty_travel_complete WITH KEY travel_id.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES: BEGIN OF ty_countryname,
country TYPE i_countrytext-country,
countryname TYPE i_countrytext-countryname,
END OF ty_countryname.
CONSTANTS: cv_travel_group_amount_max TYPE i VALUE 3,
cv_trip_length_center TYPE i VALUE 3,
cv_trip_length_offset TYPE i VALUE 2,
cv_booking_date_min TYPE i VALUE 0,
cv_booking_date_max TYPE i VALUE 20,
cv_travel_create_dat_befor_min TYPE i VALUE 0,
cv_travel_create_dat_befor_max TYPE i VALUE 40,
cv_travel_change_date_min TYPE i VALUE 0,
cv_travel_change_date_max TYPE i VALUE 10,
cv_booking_supplement_amount TYPE i VALUE 5,
cv_booking_days_before TYPE i VALUE 15.
CLASS-DATA:
go_random_seats TYPE REF TO cl_abap_random_int,
gt_flights_seats_decrease TYPE lcl_flight_data_generator=>tt_flights,
go_ran_travel_group_amount TYPE REF TO cl_abap_random_int,
go_ran_trip_length TYPE REF TO cl_abap_random_int,
go_ran_customer TYPE REF TO cl_abap_random_int,
gt_agency TYPE lcl_agency_data_generator=>tt_agency,
gt_customer TYPE lcl_customer_data_generator=>tt_customer,
gt_flights_final TYPE lcl_flight_data_generator=>tt_flights,
go_ran_booking_date TYPE REF TO cl_abap_random_int,
go_ran_agency TYPE REF TO cl_abap_random_int,
gt_connections TYPE lcl_connection_data_generator=>tt_connection_additional_info,
go_ran_booking_supplement_id TYPE REF TO cl_abap_random_int,
go_ran_booking_supplement_amnt TYPE REF TO cl_abap_random_int,
gt_supplements TYPE lcl_supplement_data_generator=>tt_supplement_complete,
go_ran_travel_description TYPE REF TO cl_abap_random_int,
go_ran_travel_create_dat_befor TYPE REF TO cl_abap_random_int,
go_ran_travel_change_date TYPE REF TO cl_abap_random_int,
go_ran_hour TYPE REF TO cl_abap_random_int,
go_ran_min_sec TYPE REF TO cl_abap_random_int,
gt_airports TYPE lcl_airport_data_generator=>tt_airport,
gt_countryname TYPE STANDARD TABLE OF ty_countryname WITH KEY country,
go_ran_status_description TYPE REF TO cl_abap_random_int,
gt_last_names TYPE lcl_customer_data_generator=>tt_last_name,
go_ran_last_name TYPE REF TO cl_abap_random_int,
go_ran_customer_travel TYPE REF TO cl_abap_random_int,
mv_datum TYPE d.
CLASS-METHODS:
get_data
RETURNING
VALUE(rt_data) TYPE tt_travel_complete,
build_booking
IMPORTING
iv_travel_id TYPE /dmo/booking29-travel_id
RETURNING
VALUE(rt_bookings) TYPE tt_booking_complete,
build_dependend_content,
find_next_fitting_flight
IMPORTING
iv_seats_required TYPE i
is_flight_previous TYPE /dmo/flight29 OPTIONAL
RETURNING
VALUE(rs_flight) TYPE /dmo/flight29,
generate_booking_supplements
IMPORTING
iv_travel_id TYPE /dmo/booking29-travel_id
iv_booking_id TYPE /dmo/booking29-booking_id
RETURNING
VALUE(rt_data) TYPE tt_booking_supplements,
generate_description
IMPORTING
it_bookings TYPE lcl_travel_data_generator=>tt_booking_complete
RETURNING
VALUE(rv_description) TYPE /dmo/travel29-description,
generate_random_time
RETURNING
VALUE(r_result) TYPE i,
calculate_booking_fee
IMPORTING
it_bookings TYPE lcl_travel_data_generator=>tt_booking_complete
RETURNING
VALUE(rv_booking_fee) TYPE /dmo/travel29-booking_fee,
generate_travel_customer_id
IMPORTING
it_bookings TYPE lcl_travel_data_generator=>tt_booking_complete
RETURNING
VALUE(rv_customer_id) TYPE /dmo/travel29-customer_id,
set_today,
calc_days_before_book_or_today
IMPORTING
iv_booking_date TYPE lcl_travel_data_generator=>ty_booking_complete-booking_date
RETURNING
VALUE(rv_travel_create_date_dats) TYPE d
RAISING
cx_parameter_invalid_range
cx_parameter_invalid_type .
ENDCLASS.
CLASS lcl_travel_data_generator IMPLEMENTATION.
METHOD lif_data_generator~create.
DATA: lt_travels TYPE tt_travel,
lt_bookings TYPE tt_bookings,
lt_booking_supplements TYPE tt_booking_supplements.
IF out IS BOUND. out->write( '--> Delete Travel Content.' ). ENDIF.
DELETE FROM /dmo/travel29. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Delete Booking Content.' ). ENDIF.
DELETE FROM /dmo/booking29. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Delete Booking Supplement Content.' ). ENDIF.
DELETE FROM /dmo/book_sup_29. "#EC CI_NOWHERE
IF out IS BOUND. out->write( '--> Build Content.' ). ENDIF.
DATA(lt_data) = get_data( ).
IF out IS BOUND. out->write( '--> Convert Content to Table Format' ). ENDIF.
LOOP AT lt_data INTO DATA(ls_travel).
APPEND CORRESPONDING /dmo/travel29( ls_travel ) TO lt_travels.
LOOP AT ls_travel-bookings INTO DATA(ls_booking).
APPEND CORRESPONDING /dmo/booking29( ls_booking ) TO lt_bookings.
APPEND LINES OF ls_booking-booking_supplements TO lt_booking_supplements.
ENDLOOP.
ENDLOOP.
IF out IS BOUND. out->write( '--> Insert Travel Content' ). ENDIF.
INSERT /dmo/travel29 FROM TABLE @lt_travels.
IF out IS BOUND. out->write( '--> Insert Booking Content' ). ENDIF.
INSERT /dmo/booking29 FROM TABLE @lt_bookings.
IF out IS BOUND. out->write( '--> Insert Booking Supplement Content' ). ENDIF.
INSERT /dmo/book_sup_29 FROM TABLE @lt_booking_supplements.
IF out IS BOUND. out->write( '--> Done.' ). ENDIF.
ENDMETHOD.
METHOD get_data.
DATA: lv_travel_id TYPE /dmo/booking29-travel_id.
build_dependend_content( ).
set_today( ).
lv_travel_id = 1.
DATA(lt_bookings) = build_booking( lv_travel_id ).
WHILE lt_bookings IS NOT INITIAL.
DATA(lv_travel_create_date_dats) = calc_days_before_book_or_today( lt_bookings[ 1 ]-booking_date ).
DATA(lv_booking_fee) = calculate_booking_fee( lt_bookings ).
DATA(lastchanged_date) = lv_travel_create_date_dats.
lastchanged_date = lastchanged_date + go_ran_travel_change_date->get_next( ).
DATA(lastchangedat_stamp) = CONV timestampl( ( CONV string( lastchanged_date ) * 1000000 ) ).
lastchangedat_stamp = lastchangedat_stamp + generate_random_time( ).
APPEND VALUE ty_travel_complete(
travel_id = lv_travel_id
agency_id = gt_agency[ go_ran_agency->get_next( ) ]-agency_id
customer_id = generate_travel_customer_id( lt_bookings )
begin_date = lt_bookings[ 1 ]-flight_date
end_date = lt_bookings[ lines( lt_bookings ) ]-flight_date
booking_fee = lv_booking_fee
total_price = lv_booking_fee + REDUCE /dmo/travel29-total_price( INIT sum = 0
FOR booking IN lt_bookings
NEXT
sum = sum
+ booking-flight_price
+ REDUCE /dmo/flight_price29( INIT sum_supplement = 0
FOR booking_supplement IN booking-booking_supplements
NEXT sum_supplement = sum_supplement + booking_supplement-price )
)
currency_code = lt_bookings[ 1 ]-currency_code
description = generate_description( lt_bookings )
status = SWITCH /dmo/travel29-status( go_ran_status_description->get_next( )
WHEN 1 OR 2 THEN /dmo/if_flight_legacy29=>travel_status-new
WHEN 3 THEN /dmo/if_flight_legacy29=>travel_status-booked
WHEN 4 THEN /dmo/if_flight_legacy29=>travel_status-planned )
createdby = gt_last_names[ go_ran_last_name->get_next( ) ]-last_name
createdat = CONV timestampl( CONV string( lv_travel_create_date_dats ) * 1000000 + generate_random_time( ) )
lastchangedby = gt_last_names[ go_ran_last_name->get_next( ) ]-last_name
lastchangedat = lastchangedat_stamp
bookings = lt_bookings
) TO rt_data.
lv_travel_id = lv_travel_id + 1.
lt_bookings = build_booking( lv_travel_id ).
ENDWHILE.
ENDMETHOD.
METHOD calc_days_before_book_or_today.
cl_abap_tstmp=>td_add(
EXPORTING
date = COND d( WHEN mv_datum > iv_booking_date
THEN iv_booking_date
ELSE mv_datum )
time = CONV t( 0 )
secs = -86400 * cv_booking_days_before
IMPORTING
res_date = rv_travel_create_date_dats ).
ENDMETHOD.
METHOD set_today.
GET TIME STAMP FIELD DATA(current_timestamp).
DATA(tmp) = CONV string( current_timestamp ).
mv_datum = tmp(8).
mv_datum = mv_datum - 1.
ENDMETHOD.
METHOD generate_random_time.
r_result = go_ran_hour->get_next( ) * 10000 + go_ran_min_sec->get_next( ) * 100 + go_ran_min_sec->get_next( ).
ENDMETHOD.
METHOD build_dependend_content.
go_ran_hour = cl_abap_random_int=>create( min = 0 max = 23 ).
go_ran_min_sec = cl_abap_random_int=>create( min = 0 max = 59 ).
gt_agency = lcl_agency_data_generator=>get_data( ).
go_ran_agency = cl_abap_random_int=>create( min = 1 max = lines( gt_agency ) ).
gt_customer = lcl_customer_data_generator=>get_data( ).
go_ran_customer = cl_abap_random_int=>create( min = 1 max = lines( gt_customer ) ).
gt_last_names = lcl_customer_data_generator=>build_last_names( ).
go_ran_last_name = cl_abap_random_int=>create( min = 1 max = lines( gt_last_names ) ).
go_ran_customer_travel = cl_abap_random_int=>create( min = 1 max = 4 ).
gt_connections = lcl_connection_data_generator=>get_data( ).
gt_airports = lcl_airport_data_generator=>get_data( ).
SELECT FROM i_countrytext FIELDS country, countryname WHERE language = 'E' INTO TABLE @gt_countryname.
gt_flights_final = lcl_flight_data_generator=>get_data( ).
SORT gt_flights_final BY flight_date ASCENDING.
gt_flights_seats_decrease = lcl_flight_data_generator=>get_data( ).
SORT gt_flights_seats_decrease BY flight_date ASCENDING.
go_ran_travel_group_amount = cl_abap_random_int=>create( min = 1 max = cv_travel_group_amount_max ).
go_ran_trip_length = cl_abap_random_int=>create( min = cv_trip_length_center - cv_trip_length_offset max = cv_trip_length_center + cv_trip_length_offset ).
go_ran_booking_date = cl_abap_random_int=>create( min = cv_booking_date_min max = cv_booking_date_max ).
go_ran_travel_create_dat_befor = cl_abap_random_int=>create( min = cv_booking_date_min max = cv_booking_date_max ).
go_ran_travel_change_date = cl_abap_random_int=>create( min = cv_booking_date_min max = cv_booking_date_max ).
gt_supplements = lcl_supplement_data_generator=>get_data( ).
go_ran_booking_supplement_id = cl_abap_random_int=>create( min = 1 max = lines( lcl_supplement_data_generator=>get_data( ) ) ).
go_ran_booking_supplement_amnt = cl_abap_random_int=>create( min = 0 max = cv_booking_supplement_amount ).
go_ran_status_description = cl_abap_random_int=>create( min = 1 max = 4 ).
go_ran_travel_description = cl_abap_random_int=>create( min = 0 max = 9 ).
ENDMETHOD.
METHOD build_booking.
TYPES: tt_customer_id TYPE TABLE OF /dmo/customer29-customer_id WITH EMPTY KEY.
DATA: lv_booking_id TYPE /dmo/booking29-booking_id,
lt_customer_id TYPE tt_customer_id,
lv_customer_amount TYPE i.
DATA(lv_trip_length) = go_ran_trip_length->get_next( ).
lt_customer_id = VALUE tt_customer_id(
FOR i = 1 THEN i + 1 WHILE i <= go_ran_travel_group_amount->get_next( )
LET j = go_ran_customer->get_next( ) IN
( gt_customer[ j ]-customer_id )
).
lt_customer_id = CORRESPONDING tt_customer_id( lt_customer_id DISCARDING DUPLICATES ).
lv_customer_amount = lines( lt_customer_id ).
lv_booking_id = 0.
DATA(ls_flight) = find_next_fitting_flight( iv_seats_required = lv_customer_amount ).
CHECK ls_flight IS NOT INITIAL.
DO lv_trip_length TIMES.
READ TABLE gt_flights_seats_decrease
WITH KEY key_sorted_date
COMPONENTS
carrier_id = ls_flight-carrier_id
connection_id = ls_flight-connection_id
flight_date = ls_flight-flight_date
ASSIGNING FIELD-SYMBOL(<flight>).
DATA(lv_booking_date) = CONV /dmo/booking29-booking_date( <flight>-flight_date - go_ran_booking_date->get_next( ) ).
DATA(lv_price) = /dmo/cl_flight_data_generat_29=>calculate_flight_price(
iv_flight_distance = gt_connections[ carrier_id = <flight>-carrier_id connection_id = <flight>-connection_id ]-distance
iv_seats_occupied_percent = ( gt_flights_final[ KEY primary_key ##PRIMKEY[KEY_SORTED_DATE]
carrier_id = <flight>-carrier_id
connection_id = <flight>-connection_id
flight_date = <flight>-flight_date
]-seats_occupied
- <flight>-seats_occupied
) * 100 DIV <flight>-seats_max
).
<flight>-seats_occupied = <flight>-seats_occupied - lv_customer_amount.
APPEND LINES OF VALUE tt_booking_complete(
FOR i = 1 THEN i + 1 WHILE i <= lines( lt_customer_id )
(
travel_id = iv_travel_id
booking_id = lv_booking_id + i
booking_date = lv_booking_date
customer_id = lt_customer_id[ i ]
carrier_id = <flight>-carrier_id
connection_id = <flight>-connection_id
flight_date = <flight>-flight_date
flight_price = lv_price
currency_code = <flight>-currency_code
booking_supplements = generate_booking_supplements( iv_travel_id = iv_travel_id iv_booking_id = CONV /dmo/booking29-booking_id( lv_booking_id + i ) )
)
) TO rt_bookings.
lv_booking_id = lv_booking_id + lines( lt_customer_id ).
ls_flight = find_next_fitting_flight(
iv_seats_required = lv_customer_amount
is_flight_previous = <flight>
).
IF ls_flight IS INITIAL.
EXIT.
ENDIF.
ENDDO.
ENDMETHOD.
METHOD find_next_fitting_flight.
DATA(lt_flights_filtered) = FILTER lcl_flight_data_generator=>tt_flights(
gt_flights_seats_decrease
USING KEY key_sorted_seats
WHERE seats_occupied >= iv_seats_required
).
CHECK lt_flights_filtered IS NOT INITIAL.
IF is_flight_previous IS SUPPLIED.
DATA(lv_connection_id_new) = VALUE /dmo/connecti_29-connection_id( gt_connections[
airport_from_id = gt_connections[
connection_id = is_flight_previous-connection_id
]-airport_to_id
]-connection_id
OPTIONAL ).
CHECK lv_connection_id_new IS NOT INITIAL.
DATA(lt_flights_filtered2) = FILTER lcl_flight_data_generator=>tt_flights(
lt_flights_filtered
USING KEY key_sorted_date
WHERE connection_id = lv_connection_id_new
AND flight_date >= is_flight_previous-flight_date
).
CHECK lt_flights_filtered2 IS NOT INITIAL.
rs_flight = lt_flights_filtered2[ 1 ].
ELSE.
rs_flight = lt_flights_filtered[ 1 ].
ENDIF.
ENDMETHOD.
METHOD generate_booking_supplements.
rt_data = VALUE tt_booking_supplements(
FOR i = 1
THEN i + 1
WHILE i <= go_ran_booking_supplement_amnt->get_next( )
LET j = go_ran_booking_supplement_id->get_next( ) IN
( travel_id = iv_travel_id
booking_id = iv_booking_id
booking_supplement_id = i
supplement_id = gt_supplements[ j ]-supplement_id
price = gt_supplements[ j ]-price
currency_code = gt_supplements[ j ]-currency_code )
).
ENDMETHOD.
METHOD generate_description.
TYPES: tt_customers TYPE SORTED TABLE OF /dmo/customer29 WITH UNIQUE KEY customer_id.
rv_description = SWITCH /dmo/travel29-description(
go_ran_travel_description->get_next( )
WHEN 1 THEN `Business Trip for ` &&
REDUCE /dmo/travel29-description(
LET travelers = CORRESPONDING tt_customers( it_bookings DISCARDING DUPLICATES MAPPING customer_id = customer_id ) IN
INIT s = `` i = 1
FOR traveler IN travelers
NEXT s = s && gt_customer[ customer_id = traveler-customer_id ]-first_name
&& COND /dmo/travel29-description( WHEN i < lines( it_bookings ) THEN `, ` )
i = i + 1 )
WHEN 2 THEN `Vacation for ` &&
REDUCE /dmo/travel29-description(
LET travelers2 = CORRESPONDING tt_customers( it_bookings DISCARDING DUPLICATES MAPPING customer_id = customer_id ) IN
INIT s = `` i = 1
FOR traveler IN travelers2
NEXT s = s && gt_customer[ customer_id = traveler-customer_id ]-first_name
&& COND /dmo/travel29-description( WHEN i < lines( it_bookings ) THEN `, ` )
i = i + 1 )
WHEN 3 THEN `Business Trip to ` &&
gt_countryname[
country = gt_airports[
airport_id = gt_connections[
carrier_id = it_bookings[ 1 ]-carrier_id connection_id = it_bookings[ 1 ]-connection_id
]-airport_to_id
]-country
]-countryname
WHEN 4 THEN `Vacation to ` &&
gt_countryname[
country = gt_airports[
airport_id = gt_connections[
carrier_id = it_bookings[ 1 ]-carrier_id connection_id = it_bookings[ 1 ]-connection_id
]-airport_to_id
]-country
]-countryname
WHEN 5 THEN `Sightseeing in ` && gt_airports[
airport_id = gt_connections[
carrier_id = it_bookings[ 1 ]-carrier_id connection_id = it_bookings[ 1 ]-connection_id
]-airport_to_id
]-city
WHEN 6 THEN `Visiting ` && gt_customer[ go_ran_customer->get_next( ) ]-first_name
WHEN 7 THEN `Business Trip`
ELSE `Vacation`
).
ENDMETHOD.
METHOD calculate_booking_fee.
rv_booking_fee = 10 * lines( it_bookings ).
ENDMETHOD.
METHOD generate_travel_customer_id.
rv_customer_id = COND /dmo/travel29-customer_id(
WHEN go_ran_customer_travel->get_next( ) = 1
THEN gt_customer[ go_ran_customer->get_next( ) ]-customer_id
ELSE it_bookings[ 1 ]-customer_id
).
ENDMETHOD.
ENDCLASS.
| [
41358,
49836,
3868,
62,
7890,
62,
8612,
1352,
13,
198,
220,
42715,
12,
49273,
50,
25,
198,
220,
220,
220,
2251,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
503,
41876,
4526,
37,
5390,
611,
62,
2238,
62,
324,
83,
62,
4871,
5143,
62,
448,
39852,
2849,
1847,
13,
198,
10619,
41358,
49836,
13,
198,
198,
31631,
300,
565,
62,
40955,
62,
7890,
62,
8612,
1352,
5550,
20032,
17941,
29244,
6158,
4810,
3824,
6158,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
25,
3868,
62,
7890,
62,
8612,
1352,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
256,
83,
62,
40955,
41876,
49053,
9795,
43679,
3963,
1220,
67,
5908,
14,
40955,
1959,
13315,
35374,
4086,
62,
312,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
25,
651,
62,
7890,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
7890,
8,
41876,
256,
83,
62,
40955,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
565,
62,
40955,
62,
7890,
62,
8612,
1352,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
3868,
62,
7890,
62,
8612,
1352,
93,
17953,
13,
198,
220,
220,
220,
16876,
503,
3180,
347,
15919,
13,
220,
503,
3784,
13564,
7,
705,
46904,
23520,
14041,
2637,
6739,
220,
23578,
5064,
13,
198,
220,
220,
220,
5550,
2538,
9328,
16034,
1220,
67,
5908,
14,
40955,
1959,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25113,
2943,
14514,
62,
45669,
39,
9338,
628,
220,
220,
220,
16876,
503,
3180,
347,
15919,
13,
220,
503,
3784,
13564,
7,
705,
46904,
10934,
14041,
2637,
6739,
23578,
5064,
13,
198,
220,
220,
220,
42865,
7,
2528,
62,
7890,
8,
796,
651,
62,
7890,
7,
6739,
628,
220,
220,
220,
16876,
503,
3180,
347,
15919,
13,
220,
503,
3784,
13564,
7,
705,
46904,
35835,
14041,
2637,
6739,
23578,
5064,
13,
198,
220,
220,
220,
29194,
17395,
1220,
67,
5908,
14,
40955,
1959,
16034,
43679,
2488,
2528,
62,
7890,
13,
628,
220,
220,
220,
16876,
503,
3180,
347,
15919,
13,
220,
503,
3784,
13564,
7,
705,
46904,
24429,
2637,
6739,
23578,
5064,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
7890,
13,
198,
220,
220,
220,
374,
83,
62,
7890,
796,
26173,
8924,
256,
83,
62,
40955,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
4086,
62,
312,
796,
705,
2998,
18005,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
796,
705,
16012,
19489,
13524,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4675,
220,
220,
220,
796,
705,
19880,
2688,
3530,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30793,
62,
8189,
220,
796,
705,
20,
3559,
1954,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1748,
220,
220,
220,
220,
220,
796,
705,
49,
420,
19593,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1499,
62,
8189,
220,
220,
796,
705,
2937,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3072,
62,
17618,
796,
705,
10,
16,
860,
486,
12,
21,
2624,
12,
3980,
1238,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3992,
62,
21975,
220,
220,
220,
220,
220,
220,
796,
705,
4023,
1378,
2503,
13,
19155,
19489,
12,
35927,
13,
82,
499,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3053,
62,
21975,
796,
705,
10951,
31,
19155,
19489,
12,
35927,
13,
82,
499,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
4086,
62,
312,
796,
705,
2998,
34215,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
796,
705,
33771,
3334,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4675,
220,
220,
220,
796,
705,
24814,
24683,
978,
7197,
1367,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
30793,
62,
8189,
220,
796,
705,
26200,
1795,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1748,
220,
220,
220,
220,
220,
796,
705,
35,
947,
325,
335,
24263,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1499,
62,
8189,
220,
220,
796,
705,
7206,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3072,
62,
17618,
796,
705,
10,
2920,
362,
15377,
8644,
31046,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3992,
62,
21975,
220,
220,
220,
220,
220,
220,
796,
705,
4023,
1378,
2503,
13,
12254,
8929,
13,
82,
499,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
198,
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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
] |
*"* use this source file for your ABAP unit test classes
CLASS lcl_test_double_cust_dao DEFINITION FINAL FOR TESTING.
PUBLIC SECTION.
INTERFACES /usi/if_bal_cd_data_containers.
METHODS clear_mock_data.
METHODS insert_mock_data_line
IMPORTING
i_log_object TYPE balobj_d OPTIONAL
i_sub_object TYPE balsubobj OPTIONAL
i_classname TYPE /usi/bal_data_cont_classname
i_min_log_level TYPE REF TO /usi/cl_bal_enum_log_level.
PRIVATE SECTION.
ALIASES: ty_records FOR /usi/if_bal_cd_data_containers~ty_records,
ty_record FOR /usi/if_bal_cd_data_containers~ty_record.
DATA mock_data TYPE /usi/if_bal_cd_data_containers=>ty_records.
ENDCLASS.
CLASS lcl_test_double_cust_dao IMPLEMENTATION.
METHOD insert_mock_data_line.
DATA mock_data_line TYPE ty_record.
mock_data_line-log_object = i_log_object.
mock_data_line-sub_object = i_sub_object.
mock_data_line-classname = i_classname.
mock_data_line-min_log_level = i_min_log_level->value.
INSERT mock_data_line INTO TABLE mock_data.
ENDMETHOD.
METHOD clear_mock_data.
CLEAR mock_data.
ENDMETHOD.
METHOD /usi/if_bal_cd_data_containers~get_records.
DATA mock_data_line_dref TYPE REF TO ty_record.
LOOP AT mock_data
REFERENCE INTO mock_data_line_dref
WHERE log_object IN i_log_object_range
AND sub_object IN i_sub_object_range.
INSERT mock_data_line_dref->* INTO TABLE r_result.
ENDLOOP.
IF r_result IS INITIAL.
RAISE EXCEPTION TYPE /usi/cx_bal_not_found
EXPORTING
textid = /usi/cx_bal_not_found=>no_db_entries_found.
ENDIF.
ENDMETHOD.
ENDCLASS.
*--------------------------------------------------------------------*
* Unit test
*--------------------------------------------------------------------*
CLASS lcl_unit_tests DEFINITION FINAL FOR TESTING.
"#AU Risk_Level Harmless
"#AU Duration Short
PRIVATE SECTION.
TYPES:
BEGIN OF ty_request,
log_object TYPE balobj_d,
sub_object TYPE balsubobj,
log_level TYPE REF TO /usi/cl_bal_enum_log_level,
END OF ty_request.
DATA: test_double_cust_dao TYPE REF TO lcl_test_double_cust_dao,
cut TYPE REF TO /usi/if_bal_ce_data_containers.
METHODS setup.
METHODS test_return_empty_on_no_cust FOR TESTING.
METHODS test_ignore_invalid_classes FOR TESTING.
METHODS test_filter_by_log_level FOR TESTING.
METHODS test_most_specific_rule_wins FOR TESTING.
METHODS test_generic_sub_object FOR TESTING.
METHODS test_generic_log_object FOR TESTING.
METHODS assert_expected_result
IMPORTING
i_request TYPE ty_request
i_expected_result TYPE /usi/bal_data_cont_classnames.
METHODS reset_cut.
ENDCLASS.
CLASS lcl_unit_tests IMPLEMENTATION.
METHOD setup.
CREATE OBJECT test_double_cust_dao.
reset_cut( ).
ENDMETHOD.
METHOD reset_cut.
DATA exception TYPE REF TO /usi/cx_bal_root.
TRY.
CREATE OBJECT cut TYPE /usi/cl_bal_ce_data_containers
EXPORTING
i_customizing_dao = test_double_cust_dao.
CATCH /usi/cx_bal_root INTO exception.
/usi/cl_bal_aunit_exception=>abort_on_unexpected_exception( exception ).
ENDTRY.
ENDMETHOD.
METHOD test_return_empty_on_no_cust.
DATA: request TYPE ty_request,
empty_result TYPE /usi/bal_data_cont_classnames.
" given
test_double_cust_dao->clear_mock_data( ).
" when
request-log_object = 'DUMMY'.
request-sub_object = 'VALUE'.
request-log_level = /usi/cl_bal_enum_log_level=>everything.
" then
assert_expected_result(
i_request = request
i_expected_result = empty_result
).
ENDMETHOD.
METHOD test_ignore_invalid_classes.
DATA: log_level TYPE REF TO /usi/cl_bal_enum_log_level,
request TYPE ty_request,
empty_result TYPE /usi/bal_data_cont_classnames.
log_level = /usi/cl_bal_enum_log_level=>very_important.
" given
test_double_cust_dao->insert_mock_data_line(
i_classname = '/USI/IF_BAL_MSG_CDAT'
i_min_log_level = log_level
).
test_double_cust_dao->insert_mock_data_line(
i_classname = 'CL_GUI_ALV_GRID'
i_min_log_level = log_level
).
test_double_cust_dao->insert_mock_data_line(
i_classname = 'SFLIGHT'
i_min_log_level = log_level
).
" when
request-log_object = 'DUMMY'.
request-sub_object = 'VALUE'.
request-log_level = log_level.
" then
assert_expected_result(
i_request = request
i_expected_result = empty_result
).
ENDMETHOD.
METHOD test_filter_by_log_level.
DATA: data_container_classname TYPE /usi/bal_data_cont_classname,
expected_result TYPE /usi/bal_data_cont_classnames,
log_level TYPE REF TO /usi/cl_bal_enum_log_level,
request TYPE ty_request.
" Given
test_double_cust_dao->insert_mock_data_line(
i_log_object = space
i_sub_object = space
i_classname = '/USI/CL_BAL_DC_SRC_POS_CALLER'
i_min_log_level = /usi/cl_bal_enum_log_level=>very_important
).
test_double_cust_dao->insert_mock_data_line(
i_log_object = space
i_sub_object = space
i_classname = '/USI/CL_BAL_DC_SRC_POS_CX'
i_min_log_level = /usi/cl_bal_enum_log_level=>everything
).
" When
request-log_object = 'DUMMY'.
request-sub_object = 'VALUE'.
request-log_level = /usi/cl_bal_enum_log_level=>important.
" Then
CLEAR expected_result.
data_container_classname = '/USI/CL_BAL_DC_SRC_POS_CALLER'.
INSERT data_container_classname INTO TABLE expected_result.
assert_expected_result(
i_request = request
i_expected_result = expected_result
).
ENDMETHOD.
METHOD test_most_specific_rule_wins.
DATA: data_container_classname TYPE /usi/bal_data_cont_classname,
expected_result TYPE /usi/bal_data_cont_classnames,
request TYPE ty_request.
" Given
test_double_cust_dao->insert_mock_data_line(
i_log_object = space
i_sub_object = space
i_classname = '/USI/CL_BAL_DC_SRC_POS_CALLER'
i_min_log_level = /usi/cl_bal_enum_log_level=>very_important
).
test_double_cust_dao->insert_mock_data_line(
i_log_object = 'OBJECT'
i_sub_object = space
i_classname = '/USI/CL_BAL_DC_SRC_POS_CALLER'
i_min_log_level = /usi/cl_bal_enum_log_level=>important
).
test_double_cust_dao->insert_mock_data_line(
i_log_object = 'OBJECT'
i_sub_object = 'SUB_OBJECT'
i_classname = '/USI/CL_BAL_DC_SRC_POS_CALLER'
i_min_log_level = /usi/cl_bal_enum_log_level=>medium
).
" When
request-log_object = 'OBJECT'.
request-sub_object = 'SUB_OBJECT'.
request-log_level = /usi/cl_bal_enum_log_level=>important.
" Then
CLEAR expected_result.
assert_expected_result(
i_request = request
i_expected_result = expected_result
).
" When
request-log_object = 'OBJECT'.
request-sub_object = 'SUB_OBJECT'.
request-log_level = /usi/cl_bal_enum_log_level=>medium.
" Then
CLEAR expected_result.
data_container_classname = '/USI/CL_BAL_DC_SRC_POS_CALLER'.
INSERT data_container_classname INTO TABLE expected_result.
assert_expected_result(
i_request = request
i_expected_result = expected_result
).
ENDMETHOD.
METHOD test_generic_sub_object.
DATA: data_container_classname TYPE /usi/bal_data_cont_classname,
expected_result TYPE /usi/bal_data_cont_classnames,
request TYPE ty_request.
" Given
test_double_cust_dao->insert_mock_data_line(
i_log_object = 'CUST_OBJECT'
i_sub_object = space
i_classname = '/USI/CL_BAL_DC_SRC_POS_CX'
i_min_log_level = /usi/cl_bal_enum_log_level=>important
).
test_double_cust_dao->insert_mock_data_line(
i_log_object = 'CUST_OBJECT'
i_sub_object = 'CUST_SUB_OBJECT'
i_classname = '/USI/CL_BAL_DC_SRC_POS_CALLER'
i_min_log_level = /usi/cl_bal_enum_log_level=>medium
).
" When
request-log_object = 'CUST_OBJECT'.
request-sub_object = 'UNKNOWN_SUB_OBJECT'.
request-log_level = /usi/cl_bal_enum_log_level=>everything.
" Then
CLEAR expected_result.
data_container_classname = '/USI/CL_BAL_DC_SRC_POS_CX'.
INSERT data_container_classname INTO TABLE expected_result.
assert_expected_result(
i_request = request
i_expected_result = expected_result
).
ENDMETHOD.
METHOD test_generic_log_object.
DATA: data_container_classname TYPE /usi/bal_data_cont_classname,
expected_result TYPE /usi/bal_data_cont_classnames,
request TYPE ty_request.
" Given
test_double_cust_dao->insert_mock_data_line(
i_log_object = space
i_sub_object = 'CUST_SUB_OBJECT'
i_classname = '/USI/CL_BAL_DC_SRC_POS_CX'
i_min_log_level = /usi/cl_bal_enum_log_level=>important
).
test_double_cust_dao->insert_mock_data_line(
i_log_object = 'CUST_OBJECT'
i_sub_object = 'CUST_SUB_OBJECT'
i_classname = '/USI/CL_BAL_DC_SRC_POS_CALLER'
i_min_log_level = /usi/cl_bal_enum_log_level=>medium
).
" When
request-log_object = 'UNKNOWN_OBJECT'.
request-sub_object = 'CUST_SUB_OBJECT'.
request-log_level = /usi/cl_bal_enum_log_level=>everything.
" Then
CLEAR expected_result.
data_container_classname = '/USI/CL_BAL_DC_SRC_POS_CX'.
INSERT data_container_classname INTO TABLE expected_result.
assert_expected_result(
i_request = request
i_expected_result = expected_result
).
ENDMETHOD.
METHOD assert_expected_result.
DATA actual_result TYPE /usi/bal_data_cont_classnames.
actual_result = cut->get_relevant_plugin_classnames(
i_log_object = i_request-log_object
i_sub_object = i_request-sub_object
i_log_level = i_request-log_level
).
cl_aunit_assert=>assert_equals(
act = actual_result
exp = i_expected_result
).
ENDMETHOD.
ENDCLASS.
| [
9,
1,
9,
779,
428,
2723,
2393,
329,
534,
9564,
2969,
4326,
1332,
6097,
198,
31631,
300,
565,
62,
9288,
62,
23352,
62,
66,
436,
62,
67,
5488,
5550,
20032,
17941,
25261,
7473,
43001,
2751,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1220,
385,
72,
14,
361,
62,
6893,
62,
10210,
62,
7890,
62,
3642,
50221,
13,
628,
220,
220,
220,
337,
36252,
50,
1598,
62,
76,
735,
62,
7890,
13,
628,
220,
220,
220,
337,
36252,
50,
7550,
62,
76,
735,
62,
7890,
62,
1370,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
6404,
62,
15252,
220,
220,
220,
41876,
3652,
26801,
62,
67,
220,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
7266,
62,
15252,
220,
220,
220,
41876,
275,
874,
549,
26801,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
4871,
3672,
220,
220,
220,
220,
41876,
1220,
385,
72,
14,
6893,
62,
7890,
62,
3642,
62,
4871,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
1084,
62,
6404,
62,
5715,
41876,
4526,
37,
5390,
1220,
385,
72,
14,
565,
62,
6893,
62,
44709,
62,
6404,
62,
5715,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
8355,
43429,
1546,
25,
1259,
62,
8344,
3669,
7473,
1220,
385,
72,
14,
361,
62,
6893,
62,
10210,
62,
7890,
62,
3642,
50221,
93,
774,
62,
8344,
3669,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1259,
62,
22105,
220,
7473,
1220,
385,
72,
14,
361,
62,
6893,
62,
10210,
62,
7890,
62,
3642,
50221,
93,
774,
62,
22105,
13,
628,
220,
220,
220,
42865,
15290,
62,
7890,
41876,
1220,
385,
72,
14,
361,
62,
6893,
62,
10210,
62,
7890,
62,
3642,
50221,
14804,
774,
62,
8344,
3669,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
565,
62,
9288,
62,
23352,
62,
66,
436,
62,
67,
5488,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
7550,
62,
76,
735,
62,
7890,
62,
1370,
13,
198,
220,
220,
220,
42865,
15290,
62,
7890,
62,
1370,
41876,
1259,
62,
22105,
13,
198,
220,
220,
220,
15290,
62,
7890,
62,
1370,
12,
6404,
62,
15252,
220,
220,
220,
220,
796,
1312,
62,
6404,
62,
15252,
13,
198,
220,
220,
220,
15290,
62,
7890,
62,
1370,
12,
7266,
62,
15252,
220,
220,
220,
220,
796,
1312,
62,
7266,
62,
15252,
13,
198,
220,
220,
220,
15290,
62,
7890,
62,
1370,
12,
4871,
3672,
220,
220,
220,
220,
220,
796,
1312,
62,
4871,
3672,
13,
198,
220,
220,
220,
15290,
62,
7890,
62,
1370,
12,
1084,
62,
6404,
62,
5715,
220,
796,
1312,
62,
1084,
62,
6404,
62,
5715,
3784,
8367,
13,
198,
220,
220,
220,
29194,
17395,
15290,
62,
7890,
62,
1370,
39319,
43679,
15290,
62,
7890,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1598,
62,
76,
735,
62,
7890,
13,
198,
220,
220,
220,
30301,
1503,
15290,
62,
7890,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1220,
385,
72,
14,
361,
62,
6893,
62,
10210,
62,
7890,
62,
3642,
50221,
93,
1136,
62,
8344,
3669,
13,
198,
220,
220,
220,
42865,
15290,
62,
7890,
62,
1370,
62,
67,
5420,
41876,
4526,
37,
5390,
1259,
62,
22105,
13,
198,
220,
220,
220,
17579,
3185,
5161,
15290,
62,
7890,
198,
220,
220,
220,
220,
220,
4526,
24302,
18310,
39319,
15290,
62,
7890,
62,
1370,
62,
67,
5420,
198,
220,
220,
220,
220,
220,
33411,
2604,
62,
15252,
220,
220,
220,
3268,
1312,
62,
6404,
62,
15252,
62,
9521,
198,
220,
220,
220,
220,
220,
220,
220,
5357,
850,
62,
15252,
220,
220,
220,
3268,
1312,
62,
7266,
62,
15252,
62,
9521,
13,
198,
220,
220,
220,
220,
220,
29194,
17395,
15290,
62,
7890,
62,
1370,
62,
67,
5420,
3784,
9,
39319,
43679,
374,
62,
20274,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
16876,
374,
62,
20274,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
17926,
24352,
7788,
42006,
2849,
41876,
1220,
385,
72,
14,
66,
87,
62,
6893,
62,
1662,
62,
9275,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2420,
312,
796,
1220,
385,
72,
14,
66,
87,
62,
6893,
62,
1662,
62,
9275,
14804,
3919,
62,
9945,
62,
298,
1678,
62,
9275,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198,
198,
9,
10097,
650,
9,
198,
9,
11801,
1332,
198,
9,
10097,
650,
9,
198,
31631,
300,
565,
62,
20850,
62,
41989,
5550,
20032,
17941,
25261,
7473,
43001,
2751,
13,
198,
220,
25113,
26830,
19602,
62,
4971,
17925,
1203,
198,
220,
25113,
26830,
22920,
220,
220,
10073,
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,
25927,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2604,
62,
15252,
41876,
3652,
26801,
62,
67,
11,
198,
220,
220,
220,
220,
220,
220,
220,
850,
62,
15252,
41876,
275,
874,
549,
26801,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2604,
62,
5715,
220,
41876,
4526,
37,
5390,
1220,
385,
72,
14,
565,
62,
6893,
62,
44709,
62,
6404,
62,
5715,
11,
198,
220,
220,
220,
220,
220,
23578,
220,
220,
3963,
1259,
62,
25927,
13,
628,
220,
220,
220,
42865,
25,
1332,
62,
23352,
62,
66,
436,
62,
67,
5488,
41876,
4526,
37,
5390,
300,
565,
62,
9288,
62,
23352,
62,
66,
436,
62,
67,
5488,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2005,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1220,
385,
72,
14,
361,
62,
6893,
62,
344,
62,
7890,
62,
3642,
50221,
13,
628,
220,
220,
220,
337,
36252,
50,
9058,
13,
628,
220,
220,
220,
337,
36252,
50,
1332,
62,
7783,
62,
28920,
62,
261,
62,
3919
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
class zcx_error definition
public
inheriting from cx_static_check
final
create public .
public section.
protected section.
private section.
endclass.
class zcx_error implementation.
endclass.
| [
4871,
1976,
66,
87,
62,
18224,
6770,
198,
220,
1171,
198,
220,
10639,
1780,
422,
43213,
62,
12708,
62,
9122,
198,
220,
2457,
198,
220,
2251,
1171,
764,
628,
220,
1171,
2665,
13,
198,
220,
6861,
2665,
13,
198,
220,
2839,
2665,
13,
198,
437,
4871,
13,
628,
198,
198,
4871,
1976,
66,
87,
62,
18224,
7822,
13,
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
] |
CLASS zcl_dbbr_package_list DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_uitb_list.
PROTECTED SECTION.
PRIVATE SECTION.
DATA mt_packages TYPE zdbbr_package_t.
ENDCLASS.
CLASS zcl_dbbr_package_list IMPLEMENTATION.
METHOD zif_uitb_list~add.
TRY.
mt_packages = VALUE #( BASE mt_packages ( CAST #( ir_element ) ) ).
CATCH cx_sy_move_cast_error.
" TODO: raise specific exception that passed object cannot be added to list.
ENDTRY.
ENDMETHOD.
METHOD zif_uitb_list~clear.
CLEAR mt_packages.
ENDMETHOD.
METHOD zif_uitb_list~size.
rv_size = lines( mt_packages ).
ENDMETHOD.
METHOD zif_uitb_list~get_iterator.
rr_iterator = zcl_uitb_list_iterator=>create( ir_list = me ).
ENDMETHOD.
METHOD zif_uitb_list~get_element.
TRY.
rr_element = mt_packages[ iv_index ].
CATCH cx_sy_itab_line_not_found.
RAISE EXCEPTION TYPE zcx_uitb_element_not_found
EXPORTING
textid = zcx_uitb_element_not_found=>index_access
index = iv_index.
ENDTRY.
ENDMETHOD.
METHOD zif_uitb_list~remove.
" not possible
ENDMETHOD.
METHOD zif_uitb_list~remove_at.
" not possible
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
9945,
1671,
62,
26495,
62,
4868,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
5013,
65,
62,
4868,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
45079,
62,
43789,
41876,
1976,
9945,
1671,
62,
26495,
62,
83,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
9945,
1671,
62,
26495,
62,
4868,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
1976,
361,
62,
5013,
65,
62,
4868,
93,
2860,
13,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
45079,
62,
43789,
796,
26173,
8924,
1303,
7,
49688,
45079,
62,
43789,
357,
327,
11262,
1303,
7,
4173,
62,
30854,
1267,
1267,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
1837,
62,
21084,
62,
2701,
62,
18224,
13,
198,
220,
220,
220,
220,
220,
220,
220,
366,
16926,
46,
25,
5298,
2176,
6631,
326,
3804,
2134,
2314,
307,
2087,
284,
1351,
13,
198,
220,
220,
220,
23578,
40405,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1976,
361,
62,
5013,
65,
62,
4868,
93,
20063,
13,
198,
220,
220,
220,
30301,
1503,
45079,
62,
43789,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1976,
361,
62,
5013,
65,
62,
4868,
93,
7857,
13,
198,
220,
220,
220,
374,
85,
62,
7857,
796,
3951,
7,
45079,
62,
43789,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1976,
361,
62,
5013,
65,
62,
4868,
93,
1136,
62,
48727,
13,
198,
220,
220,
220,
374,
81,
62,
48727,
796,
1976,
565,
62,
5013,
65,
62,
4868,
62,
48727,
14804,
17953,
7,
4173,
62,
4868,
796,
502,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1976,
361,
62,
5013,
65,
62,
4868,
93,
1136,
62,
30854,
13,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
374,
81,
62,
30854,
796,
45079,
62,
43789,
58,
21628,
62,
9630,
20740,
198,
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,
17926,
24352,
7788,
42006,
2849,
41876,
1976,
66,
87,
62,
5013,
65,
62,
30854,
62,
1662,
62,
9275,
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,
2420,
312,
796,
1976,
66,
87,
62,
5013,
65,
62,
30854,
62,
1662,
62,
9275,
14804,
9630,
62,
15526,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6376,
220,
796,
21628,
62,
9630,
13,
198,
220,
220,
220,
23578,
40405,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1976,
361,
62,
5013,
65,
62,
4868,
93,
28956,
13,
198,
220,
220,
220,
366,
407,
1744,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1976,
361,
62,
5013,
65,
62,
4868,
93,
28956,
62,
265,
13,
198,
220,
220,
220,
366,
407,
1744,
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
] |
**
** Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
**
** This file is part of ewm-cloud-robotics
** (see https://github.com/SAP/ewm-cloud-robotics).
**
** This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file (https://github.com/SAP/ewm-cloud-robotics/blob/master/LICENSE)
**
function zsend_second_conf_error .
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IV_LGNUM) TYPE /SCWM/LGNUM
*" REFERENCE(IV_RSRC) TYPE /SCWM/DE_RSRC
*" REFERENCE(IV_WHO) TYPE /SCWM/DE_WHO
*" REFERENCE(IV_TANUM) TYPE /SCWM/TANUM
*" EXPORTING
*" REFERENCE(ES_WHO) TYPE /SCWM/WHO
*" EXCEPTIONS
*" ROBOT_NOT_FOUND
*" WHO_NOT_FOUND
*" WHO_LOCKED
*" NO_ERROR_QUEUE
*" QUEUE_NOT_CHANGED
*" INTERNAL_ERROR
*"----------------------------------------------------------------------
data: lv_robot_type type zewm_de_robot_type,
ls_who type /scwm/who,
ls_rsrc type /scwm/rsrc.
* Get robot master data
call function '/SCWM/RSRC_READ_SINGLE'
exporting
iv_lgnum = iv_lgnum
iv_rsrc = iv_rsrc
importing
es_rsrc = ls_rsrc
exceptions
wrong_input = 1
not_found = 2
others = 3.
if sy-subrc <> 0.
raise robot_not_found.
else.
* Check if resource is a robot
select single robot_type from zewm_trsrc_typ into @lv_robot_type
where lgnum = @iv_lgnum and
rsrc_type = @ls_rsrc-rsrc_type.
if sy-subrc <> 0.
raise robot_not_found.
endif.
endif.
* Enqueue resource assignment to warehouse order
call function 'ENQUEUE_EZEWM_ASSIGNROBO'
exporting
mode_/scwm/rsrc = 'X'
mandt = sy-mandt
lgnum = iv_lgnum
rsrc = iv_rsrc
_scope = '2'
_wait = abap_true
exceptions
foreign_lock = 1
system_failure = 2
others = 3.
if sy-subrc <> 0.
raise internal_error.
endif.
* Check if warehouse order is existing
select single * from /scwm/who into @ls_who
where
lgnum = @iv_lgnum and
who = @iv_who.
if sy-subrc <> 0.
raise who_not_found.
endif.
* Move warehouse order to error queue
call function 'ZMOVE_WHO_TO_ERROR_QUEUE'
exporting
iv_lgnum = iv_lgnum
is_rsrc = ls_rsrc
iv_who = iv_who
importing
ev_queue = ls_who-queue
exceptions
robot_not_found = 1
who_not_found = 2
who_locked = 3
no_error_queue = 4
queue_not_changed = 5
others = 6.
case sy-subrc.
when 0.
es_who = ls_who.
when 1.
raise robot_not_found.
when 2.
raise who_not_found.
when 3.
raise who_locked.
when 4.
raise no_error_queue.
when 5.
raise queue_not_changed.
when others.
raise internal_error.
endcase.
* Write alert
call function 'ZWHT_ROBOT_CONF_ERROR_ALERT'
exporting
iv_lgnum = iv_lgnum
iv_tanum = iv_tanum
iv_rsrc = iv_rsrc
iv_final_conf = abap_true.
endfunction.
| [
1174,
198,
1174,
15069,
357,
66,
8,
13130,
48323,
7946,
393,
281,
48323,
17375,
1664,
13,
1439,
2489,
10395,
13,
198,
1174,
198,
1174,
770,
2393,
318,
636,
286,
304,
26377,
12,
17721,
12,
305,
13645,
873,
198,
1174,
357,
3826,
3740,
1378,
12567,
13,
785,
14,
50,
2969,
14,
413,
76,
12,
17721,
12,
305,
13645,
873,
737,
198,
1174,
198,
1174,
770,
2393,
318,
11971,
739,
262,
24843,
10442,
13789,
11,
410,
13,
362,
2845,
355,
4367,
4306,
287,
262,
38559,
24290,
2393,
357,
5450,
1378,
12567,
13,
785,
14,
50,
2969,
14,
413,
76,
12,
17721,
12,
305,
13645,
873,
14,
2436,
672,
14,
9866,
14,
43,
2149,
24290,
8,
198,
1174,
198,
8818,
1976,
21280,
62,
12227,
62,
10414,
62,
18224,
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,
43,
16630,
5883,
8,
41876,
220,
1220,
6173,
22117,
14,
43,
16630,
5883,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
3824,
62,
6998,
7397,
8,
41876,
220,
1220,
6173,
22117,
14,
7206,
62,
6998,
7397,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
3824,
62,
41856,
8,
41876,
220,
1220,
6173,
22117,
14,
7206,
62,
41856,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
3824,
62,
51,
1565,
5883,
8,
41876,
220,
1220,
6173,
22117,
14,
51,
1565,
5883,
198,
9,
1,
220,
7788,
15490,
2751,
198,
9,
1,
220,
220,
220,
220,
4526,
24302,
18310,
7,
1546,
62,
41856,
8,
41876,
220,
1220,
6173,
22117,
14,
41856,
198,
9,
1,
220,
7788,
42006,
11053,
198,
9,
1,
220,
220,
220,
220,
220,
36449,
2394,
62,
11929,
62,
37,
15919,
198,
9,
1,
220,
220,
220,
220,
220,
19494,
62,
11929,
62,
37,
15919,
198,
9,
1,
220,
220,
220,
220,
220,
19494,
62,
36840,
1961,
198,
9,
1,
220,
220,
220,
220,
220,
8005,
62,
24908,
62,
48,
8924,
8924,
198,
9,
1,
220,
220,
220,
220,
220,
1195,
8924,
8924,
62,
11929,
62,
3398,
15567,
1961,
198,
9,
1,
220,
220,
220,
220,
220,
23255,
45,
1847,
62,
24908,
198,
9,
1,
10097,
23031,
628,
220,
1366,
25,
300,
85,
62,
305,
13645,
62,
4906,
2099,
1976,
413,
76,
62,
2934,
62,
305,
13645,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
8727,
220,
220,
220,
220,
220,
220,
220,
2099,
1220,
1416,
26377,
14,
8727,
11,
198,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
3808,
6015,
220,
220,
220,
220,
220,
220,
2099,
1220,
1416,
26377,
14,
3808,
6015,
13,
198,
198,
9,
3497,
9379,
4958,
1366,
198,
220,
869,
2163,
31051,
6173,
22117,
14,
6998,
7397,
62,
15675,
62,
50,
2751,
2538,
6,
198,
220,
220,
220,
39133,
198,
220,
220,
220,
220,
220,
21628,
62,
75,
4593,
388,
220,
220,
220,
796,
21628,
62,
75,
4593,
388,
198,
220,
220,
220,
220,
220,
21628,
62,
3808,
6015,
220,
220,
220,
220,
796,
21628,
62,
3808,
6015,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
1658,
62,
3808,
6015,
220,
220,
220,
220,
796,
43979,
62,
3808,
6015,
198,
220,
220,
220,
13269,
198,
220,
220,
220,
220,
220,
2642,
62,
15414,
796,
352,
198,
220,
220,
220,
220,
220,
407,
62,
9275,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
1854,
220,
220,
220,
220,
220,
796,
513,
13,
628,
220,
611,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
5298,
9379,
62,
1662,
62,
9275,
13,
198,
220,
2073,
13,
198,
9,
6822,
611,
8271,
318,
257,
9379,
198,
220,
220,
220,
2922,
2060,
9379,
62,
4906,
422,
1976,
413,
76,
62,
2213,
10677,
62,
28004,
656,
2488,
6780,
62,
305,
13645,
62,
4906,
198,
220,
220,
220,
220,
220,
810,
300,
4593,
388,
796,
2488,
452,
62,
75,
4593,
388,
290,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
374,
10677,
62,
4906,
796,
2488,
7278,
62,
3808,
6015,
12,
3808,
6015,
62,
4906,
13,
198,
220,
220,
220,
611,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
5298,
9379,
62,
1662,
62,
9275,
13,
198,
220,
220,
220,
45762,
13,
198,
220,
45762,
13,
198,
198,
9,
2039,
36560,
8271,
16237,
284,
20933,
1502,
198,
220,
869,
2163,
705,
1677,
48,
8924,
8924,
62,
36,
57,
6217,
44,
62,
10705,
16284,
13252,
8202,
6,
198,
220,
220,
220,
39133,
198,
220,
220,
220,
220,
220,
4235,
62,
14,
1416,
26377,
14,
3808,
6015,
796,
705,
55,
6,
198,
220,
220,
220,
220,
220,
6855,
83,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
827,
12,
22249,
83,
198,
220,
220,
220,
220,
220,
300,
4593,
388,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
75,
4593,
388,
198,
220,
220,
220,
220,
220,
374,
10677,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
3808,
6015,
198,
220,
220,
220,
220,
220,
4808,
29982,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
17,
6,
198,
220,
220,
220,
220,
220,
4808,
17077,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
450,
499,
62,
7942,
198,
220,
220,
220,
13269,
198,
220,
220,
220,
220,
220,
3215,
62,
5354,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
1080,
62,
32165,
495,
220,
796,
362,
198,
220,
220,
220,
220,
220,
1854,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
513,
13,
198,
220,
611,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
5298,
5387,
62,
18224,
13,
198,
220,
45762,
13,
198,
198,
9,
6822,
611,
20933,
1502,
318,
4683,
198,
220,
2922,
2060,
1635,
422,
1220,
1416,
26377,
14,
8727,
656,
2488,
7278,
62,
8727,
198,
220,
220,
220,
220,
220,
220,
220,
810,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS y_check_text_assembly DEFINITION PUBLIC INHERITING FROM y_check_base CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor.
PROTECTED SECTION.
METHODS inspect_tokens REDEFINITION.
ENDCLASS.
CLASS y_check_text_assembly IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
settings-pseudo_comment = '"#EC TEXT_ASSEMBLY'.
settings-disable_threshold_selection = abap_true.
settings-threshold = 0.
settings-documentation = |{ c_docs_path-checks }text-assembly.md|.
set_check_message( 'Use | to assemble text!' ).
ENDMETHOD.
METHOD inspect_tokens.
DATA(has_ampersand) = abap_false.
DATA(has_literal) = abap_false.
DATA(has_identifier) = abap_false.
LOOP AT ref_scan->tokens ASSIGNING FIELD-SYMBOL(<token>)
FROM statement-from TO statement-to.
IF <token>-str = '&&'.
has_ampersand = abap_true.
ELSEIF <token>-type = scan_token_type-literal.
has_literal = abap_true.
ELSEIF <token>-type = scan_token_type-identifier
AND sy-tabix <> statement-from.
has_identifier = abap_true.
ENDIF.
ENDLOOP.
IF has_ampersand = abap_false
OR has_literal = abap_false
OR has_identifier = abap_false.
RETURN.
ENDIF.
DATA(check_configuration) = detect_check_configuration( statement ).
raise_error( statement_level = statement-level
statement_index = index
statement_from = statement-from
check_configuration = check_configuration ).
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
62,
9122,
62,
5239,
62,
41873,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
331,
62,
9122,
62,
8692,
29244,
6158,
44731,
764,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
23772,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
10104,
62,
83,
482,
641,
23848,
36,
20032,
17941,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
331,
62,
9122,
62,
5239,
62,
41873,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
6739,
628,
220,
220,
220,
6460,
12,
7752,
12003,
62,
23893,
796,
705,
1,
2,
2943,
40383,
62,
10705,
3620,
9148,
56,
4458,
198,
220,
220,
220,
6460,
12,
40223,
62,
400,
10126,
62,
49283,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
6460,
12,
400,
10126,
796,
657,
13,
198,
220,
220,
220,
6460,
12,
22897,
341,
796,
930,
90,
269,
62,
31628,
62,
6978,
12,
42116,
1782,
5239,
12,
41873,
13,
9132,
91,
13,
628,
220,
220,
220,
900,
62,
9122,
62,
20500,
7,
705,
11041,
930,
284,
25432,
2420,
13679,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
10104,
62,
83,
482,
641,
13,
198,
220,
220,
220,
42865,
7,
10134,
62,
696,
364,
392,
8,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
42865,
7,
10134,
62,
18250,
1691,
8,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
42865,
7,
10134,
62,
738,
7483,
8,
796,
450,
499,
62,
9562,
13,
628,
220,
220,
220,
17579,
3185,
5161,
1006,
62,
35836,
3784,
83,
482,
641,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
30001,
43734,
198,
220,
220,
220,
16034,
2643,
12,
6738,
5390,
2643,
12,
1462,
13,
198,
220,
220,
220,
220,
220,
16876,
1279,
30001,
29,
12,
2536,
796,
705,
25226,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
468,
62,
696,
364,
392,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
17852,
5188,
5064,
1279,
30001,
29,
12,
4906,
796,
9367,
62,
30001,
62,
4906,
12,
18250,
1691,
13,
198,
220,
220,
220,
220,
220,
220,
220,
468,
62,
18250,
1691,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
17852,
5188,
5064,
1279,
30001,
29,
12,
4906,
796,
9367,
62,
30001,
62,
4906,
12,
738,
7483,
198,
220,
220,
220,
220,
220,
5357,
827,
12,
8658,
844,
1279,
29,
2643,
12,
6738,
13,
198,
220,
220,
220,
220,
220,
220,
220,
468,
62,
738,
7483,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
16876,
468,
62,
696,
364,
392,
796,
450,
499,
62,
9562,
198,
220,
220,
220,
6375,
468,
62,
18250,
1691,
796,
450,
499,
62,
9562,
198,
220,
220,
220,
6375,
468,
62,
738,
7483,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
42865,
7,
9122,
62,
11250,
3924,
8,
796,
4886,
62,
9122,
62,
11250,
3924,
7,
2643,
6739,
628,
220,
220,
220,
5298,
62,
18224,
7,
2643,
62,
5715,
796,
2643,
12,
5715,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2643,
62,
9630,
796,
6376,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2643,
62,
6738,
796,
2643,
12,
6738,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2198,
62,
11250,
3924,
796,
2198,
62,
11250,
3924,
6739,
198,
220,
23578,
49273,
13,
628,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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
] |
CLASS zcl_advent2020_day14_joltdx DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_advent2020_joltdx .
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_initialization,
address TYPE i,
value TYPE i,
END OF ty_initialization.
DATA mt_input TYPE STANDARD TABLE OF string.
DATA mt_initialization TYPE STANDARD TABLE OF ty_initialization WITH EMPTY KEY.
DATA mt_initialization_v2 TYPE STANDARD TABLE OF ty_initialization WITH EMPTY KEY.
DATA mv_or_mask TYPE xstring.
DATA mv_and_mask TYPE xstring.
DATA mv_floating_and TYPE xstring.
DATA mt_floating_or TYPE STANDARD TABLE OF xstring.
METHODS part_1
RETURNING
VALUE(result) TYPE string.
METHODS part_2
RETURNING
VALUE(result) TYPE string.
METHODS set_mask
IMPORTING
mask TYPE string.
METHODS set_mem
IMPORTING
address TYPE i
value TYPE i.
METHODS set_mem_v2
IMPORTING
address TYPE i
value TYPE i.
ENDCLASS.
CLASS ZCL_ADVENT2020_DAY14_joltdx IMPLEMENTATION.
METHOD zif_advent2020_joltdx~solve.
REPLACE ALL OCCURRENCES OF |\r| IN input WITH ||.
SPLIT input AT |\n| INTO TABLE mt_input.
output = |Part 1: { part_1( ) }\nPart 2: { part_2( ) }|.
ENDMETHOD.
METHOD part_1.
DATA mask TYPE string.
DATA address TYPE i.
DATA value TYPE i.
DATA sum TYPE i.
LOOP AT mt_input INTO DATA(input).
FIND REGEX 'mask = ([X10]*)' IN input SUBMATCHES mask.
IF sy-subrc = 0.
set_mask( mask ).
ELSE.
FIND REGEX 'mem\[(\d+)\] = (\d+)' IN input SUBMATCHES address value.
set_mem( address = address
value = value ).
ENDIF.
ENDLOOP.
LOOP AT mt_initialization INTO DATA(init).
sum = sum + init-value.
ENDLOOP.
result = sum.
ENDMETHOD.
METHOD part_2.
DATA mask TYPE string.
DATA address TYPE i.
DATA value TYPE i.
DATA sum TYPE i.
LOOP AT mt_input INTO DATA(input).
FIND REGEX 'mask = ([X10]*)' IN input SUBMATCHES mask.
IF sy-subrc = 0.
set_mask( mask ).
ELSE.
FIND REGEX 'mem\[(\d+)\] = (\d+)' IN input SUBMATCHES address value.
set_mem_v2( address = address
value = value ).
ENDIF.
ENDLOOP.
LOOP AT mt_initialization_v2 INTO DATA(init).
sum = sum + init-value.
ENDLOOP.
result = sum.
ENDMETHOD.
METHOD set_mask.
DATA bit_status TYPE c.
DATA bit_offset TYPE i.
DATA bit_number TYPE i.
DATA floating_mask TYPE xstring.
mv_or_mask = '0000000000'.
mv_and_mask = '0FFFFFFFFF'.
mv_floating_and = '0FFFFFFFFF'.
CLEAR mt_floating_or[].
DO 36 TIMES.
bit_offset = sy-index - 1.
bit_status = mask+bit_offset(1).
bit_number = sy-index + 4.
IF bit_status = '1'.
SET BIT bit_number OF mv_or_mask TO 1.
ELSEIF bit_status = '0'.
SET BIT bit_number OF mv_and_mask TO 0.
ELSEIF bit_status = 'X'.
IF lines( mt_floating_or ) = 0.
floating_mask = '0000000000'.
APPEND floating_mask TO mt_floating_or.
SET BIT bit_number OF floating_mask TO 1.
APPEND floating_mask TO mt_floating_or.
ELSE.
DATA(tmp_float_or) = mt_floating_or.
LOOP AT tmp_float_or INTO DATA(float_or).
floating_mask = float_or.
SET BIT bit_number OF floating_mask TO 1.
APPEND floating_mask TO mt_floating_or.
ENDLOOP.
ENDIF.
SET BIT bit_number OF mv_floating_and TO 0.
ENDIF.
ENDDO.
IF lines( mt_floating_or ) = 0.
floating_mask = '0000000000'.
APPEND floating_mask TO mt_floating_or.
ENDIF.
ENDMETHOD.
METHOD set_mem.
DATA hex_value TYPE xstring.
hex_value = value.
DO 5 - ( strlen( hex_value ) / 2 ) TIMES.
hex_value = |00{ hex_value }|.
ENDDO.
READ TABLE mt_initialization WITH KEY address = address ASSIGNING FIELD-SYMBOL(<mem>).
IF sy-subrc <> 0.
APPEND INITIAL LINE TO mt_initialization ASSIGNING <mem>.
<mem>-address = address.
ENDIF.
hex_value = ( hex_value BIT-OR mv_or_mask ) BIT-AND mv_and_mask.
<mem>-value = hex_value.
ENDMETHOD.
METHOD set_mem_v2.
DATA hex_address TYPE xstring.
DATA floating_address_and TYPE xstring.
DATA floating_address TYPE xstring.
DATA int_address TYPE i.
hex_address = address.
DO 5 - ( strlen( hex_address ) / 2 ) TIMES.
hex_address = |00{ hex_address }|.
ENDDO.
hex_address = ( hex_address BIT-OR mv_or_mask ) BIT-AND mv_floating_and.
LOOP AT mt_floating_or INTO DATA(floating_or).
floating_address = hex_address BIT-OR floating_or.
int_address = floating_address.
READ TABLE mt_initialization_v2 WITH KEY address = int_address ASSIGNING FIELD-SYMBOL(<mem>).
IF sy-subrc <> 0.
APPEND INITIAL LINE TO mt_initialization_v2 ASSIGNING <mem>.
<mem>-address = int_address.
ENDIF.
<mem>-value = value.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
324,
1151,
42334,
62,
820,
1415,
62,
73,
5978,
34350,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
324,
1151,
42334,
62,
73,
5978,
34350,
764,
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,
36733,
1634,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2209,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
36733,
1634,
13,
628,
220,
220,
220,
42865,
45079,
62,
15414,
41876,
49053,
9795,
43679,
3963,
4731,
13,
198,
220,
220,
220,
42865,
45079,
62,
36733,
1634,
41876,
49053,
9795,
43679,
3963,
1259,
62,
36733,
1634,
13315,
38144,
9936,
35374,
13,
198,
220,
220,
220,
42865,
45079,
62,
36733,
1634,
62,
85,
17,
41876,
49053,
9795,
43679,
3963,
1259,
62,
36733,
1634,
13315,
38144,
9936,
35374,
13,
198,
220,
220,
220,
42865,
285,
85,
62,
273,
62,
27932,
41876,
2124,
8841,
13,
198,
220,
220,
220,
42865,
285,
85,
62,
392,
62,
27932,
41876,
2124,
8841,
13,
198,
220,
220,
220,
42865,
285,
85,
62,
48679,
803,
62,
392,
41876,
2124,
8841,
13,
198,
220,
220,
220,
42865,
45079,
62,
48679,
803,
62,
273,
41876,
49053,
9795,
43679,
3963,
2124,
8841,
13,
628,
220,
220,
220,
337,
36252,
50,
636,
62,
16,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
4731,
13,
628,
220,
220,
220,
337,
36252,
50,
636,
62,
17,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
41876,
4731,
13,
628,
220,
220,
220,
337,
36252,
50,
900,
62,
27932,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
9335,
41876,
4731,
13,
628,
220,
220,
220,
337,
36252,
50,
900,
62,
11883,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
2209,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
41876,
1312,
13,
628,
220,
220,
220,
337,
36252,
50,
900,
62,
11883,
62,
85,
17,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
2209,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
41876,
1312,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
2885,
53,
3525,
42334,
62,
26442,
1415,
62,
73,
5978,
34350,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
324,
1151,
42334,
62,
73,
5978,
34350,
93,
82,
6442,
13,
198,
220,
220,
220,
45285,
11598,
11096,
440,
4093,
31302,
24181,
1546,
3963,
930,
59,
81,
91,
3268,
5128,
13315,
8614,
13,
198,
220,
220,
220,
46341,
2043,
5128,
5161,
930,
59,
77,
91,
39319,
43679,
45079,
62,
15414,
13,
198,
220,
220,
220,
5072,
796,
930,
7841,
352,
25,
1391,
636,
62,
16,
7,
1267,
1782,
59,
77,
7841,
362,
25,
1391,
636,
62,
17,
7,
1267,
1782,
91,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
636,
62,
16,
13,
198,
220,
220,
220,
42865,
9335,
41876,
4731,
13,
198,
220,
220,
220,
42865,
2209,
41876,
1312,
13,
198,
220,
220,
220,
42865,
1988,
41876,
1312,
13,
198,
220,
220,
220,
42865,
2160,
41876,
1312,
13,
198,
220,
220,
220,
17579,
3185,
5161,
45079,
62,
15414,
39319,
42865,
7,
15414,
737,
198,
220,
220,
220,
220,
220,
376,
12115,
23337,
6369,
705,
27932,
796,
29565,
55,
940,
60,
28104,
6,
3268,
5128,
28932,
44,
11417,
1546,
9335,
13,
198,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
900,
62,
27932,
7,
9335,
6739,
198,
220,
220,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
220,
220,
376,
12115,
23337,
6369,
705,
11883,
59,
58,
38016,
67,
10,
19415,
60,
796,
357,
59,
67,
28988,
6,
3268,
5128,
28932,
44,
11417,
1546,
2209,
1988,
13,
198,
220,
220,
220,
220,
220,
220,
220,
900,
62,
11883,
7,
2209,
796,
2209,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1988,
796,
1988,
6739,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
198,
220,
220,
220,
17579,
3185,
5161,
45079,
62,
36733,
1634,
39319,
42865,
7,
15003,
737,
198,
220,
220,
220,
220,
220,
2160,
796,
2160,
1343,
2315,
12,
8367,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
198,
220,
220,
220,
1255,
796,
2160,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
636,
62,
17,
13,
198,
220,
220,
220,
42865,
9335,
41876,
4731,
13,
198,
220,
220,
220,
42865,
2209,
41876,
1312,
13,
198,
220,
220,
220,
42865,
1988,
41876,
1312,
13,
198,
220,
220,
220,
42865,
2160,
41876,
1312,
13,
198,
220,
220,
220,
17579,
3185,
5161,
45079,
62,
15414,
39319,
42865,
7,
15414,
737,
198,
220,
220,
220,
220,
220,
376,
12115,
23337,
6369,
705,
27932,
796,
29565,
55,
940,
60,
28104,
6,
3268,
5128,
28932,
44,
11417,
1546,
9335,
13,
198,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
900,
62,
27932,
7,
9335,
6739,
198,
220,
220,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
220,
220,
376,
12115,
23337,
6369,
705,
11883,
59,
58,
38016,
67,
10,
19415,
60,
796,
357,
59,
67,
28988,
6,
3268,
5128,
28932,
44,
11417,
1546,
2209,
1988,
13,
198,
220,
220,
220,
220,
220,
220,
220,
900,
62,
11883,
62,
85,
17,
7,
2209,
796,
2209,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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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
] |
INTERFACE zif_excel_reader
PUBLIC .
METHODS load_file
IMPORTING
!i_filename TYPE csequence
!i_use_alternate_zip TYPE seoclsname DEFAULT space
!i_from_applserver TYPE abap_bool DEFAULT sy-batch
!iv_zcl_excel_classname TYPE clike OPTIONAL
RETURNING
VALUE(r_excel) TYPE REF TO zcl_excel
RAISING
zcx_excel .
METHODS load
IMPORTING
!i_excel2007 TYPE xstring
!i_use_alternate_zip TYPE seoclsname DEFAULT space
!iv_zcl_excel_classname TYPE clike OPTIONAL
RETURNING
VALUE(r_excel) TYPE REF TO zcl_excel
RAISING
zcx_excel .
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
1069,
5276,
62,
46862,
198,
220,
44731,
764,
628,
198,
220,
337,
36252,
50,
3440,
62,
7753,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
34345,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
1904,
62,
33645,
378,
62,
13344,
220,
220,
220,
41876,
384,
420,
7278,
3672,
5550,
38865,
2272,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
6738,
62,
1324,
75,
15388,
220,
220,
220,
220,
220,
41876,
450,
499,
62,
30388,
5550,
38865,
827,
12,
43501,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
89,
565,
62,
1069,
5276,
62,
4871,
3672,
41876,
537,
522,
39852,
2849,
1847,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
62,
1069,
5276,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
198,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
1069,
5276,
764,
198,
220,
337,
36252,
50,
3440,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
1069,
5276,
12726,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
2124,
8841,
198,
220,
220,
220,
220,
220,
5145,
72,
62,
1904,
62,
33645,
378,
62,
13344,
220,
220,
220,
41876,
384,
420,
7278,
3672,
5550,
38865,
2272,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
89,
565,
62,
1069,
5276,
62,
4871,
3672,
41876,
537,
522,
39852,
2849,
1847,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
62,
1069,
5276,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
198,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
1069,
5276,
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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c2018_input_helper.
METHODS:
setup,
teardown,
test_http FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_aoc2018_input_helper IMPLEMENTATION.
METHOD setup.
mo_cut = NEW zcl_aoc2018_input_helper( ).
ENDMETHOD.
METHOD teardown.
CLEAR mo_cut.
ENDMETHOD.
METHOD test_http.
mo_cut->get_from_http( EXPORTING id_url = 'https://bitbucket.org/jorgesancho/abap_adventsofcode_2018/src/master/d1/input_1'
EXCEPTIONS OTHERS = 999 ).
cl_abap_unit_assert=>assert_subrc( exp = 0 symsg = CORRESPONDING #( sy ) ).
cl_abap_unit_assert=>assert_true( mo_cut->has_next( ) ).
ENDMETHOD.
ENDCLASS.
| [
9,
1,
9,
779,
428,
2723,
2393,
329,
534,
9564,
2969,
4326,
1332,
6097,
198,
31631,
300,
83,
565,
62,
64,
420,
7908,
62,
15414,
62,
2978,
525,
5550,
20032,
17941,
25261,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
6941,
62,
8968,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
7908,
62,
15414,
62,
2978,
525,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
220,
220,
573,
446,
593,
11,
198,
220,
220,
220,
220,
220,
1332,
62,
4023,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
10619,
31631,
13,
628,
198,
31631,
300,
83,
565,
62,
64,
420,
7908,
62,
15414,
62,
2978,
525,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
6941,
62,
8968,
796,
12682,
1976,
565,
62,
64,
420,
7908,
62,
15414,
62,
2978,
525,
7,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
573,
446,
593,
13,
198,
220,
220,
220,
30301,
1503,
6941,
62,
8968,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
62,
4023,
13,
628,
220,
220,
220,
6941,
62,
8968,
3784,
1136,
62,
6738,
62,
4023,
7,
7788,
15490,
2751,
4686,
62,
6371,
220,
796,
705,
5450,
1378,
2545,
27041,
316,
13,
2398,
14,
73,
2398,
274,
3702,
78,
14,
397,
499,
62,
324,
1151,
568,
69,
8189,
62,
7908,
14,
10677,
14,
9866,
14,
67,
16,
14,
15414,
62,
16,
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,
7788,
42006,
11053,
440,
4221,
4877,
796,
36006,
6739,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
7266,
6015,
7,
1033,
796,
657,
827,
19662,
796,
23929,
19535,
47,
18672,
2751,
1303,
7,
827,
1267,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
7942,
7,
6941,
62,
8968,
3784,
10134,
62,
19545,
7,
1267,
6739,
628,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class ZCL_ZCV_ADASH_SETUP_C definition
public
inheriting from CL_SADL_GTK_EXPOSURE_MPC
final
create public .
public section.
protected section.
methods GET_PATHS
redefinition .
methods GET_TIMESTAMP
redefinition .
private section.
ENDCLASS.
CLASS ZCL_ZCV_ADASH_SETUP_C IMPLEMENTATION.
method GET_PATHS.
et_paths = VALUE #(
( |CDS~ZCV_ADASH_SETUP_C| )
).
endmethod.
method GET_TIMESTAMP.
RV_TIMESTAMP = 20200614185004.
endmethod.
ENDCLASS.
| [
4871,
1168,
5097,
62,
57,
33538,
62,
2885,
11211,
62,
28480,
8577,
62,
34,
6770,
198,
220,
1171,
198,
220,
10639,
1780,
422,
7852,
62,
50,
2885,
43,
62,
19555,
42,
62,
6369,
37997,
11335,
62,
44,
5662,
198,
220,
2457,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
198,
24326,
2665,
13,
628,
220,
5050,
17151,
62,
47,
1404,
7998,
198,
220,
220,
220,
34087,
17750,
764,
198,
220,
5050,
17151,
62,
51,
3955,
6465,
23518,
198,
220,
220,
220,
34087,
17750,
764,
198,
19734,
2665,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
57,
33538,
62,
2885,
11211,
62,
28480,
8577,
62,
34,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
2446,
17151,
62,
47,
1404,
7998,
13,
198,
316,
62,
6978,
82,
796,
26173,
8924,
1303,
7,
198,
7,
930,
34,
5258,
93,
57,
33538,
62,
2885,
11211,
62,
28480,
8577,
62,
34,
91,
1267,
198,
737,
198,
220,
886,
24396,
13,
628,
198,
220,
2446,
17151,
62,
51,
3955,
6465,
23518,
13,
198,
49,
53,
62,
51,
3955,
6465,
23518,
796,
1160,
13330,
1415,
1507,
4059,
19,
13,
198,
220,
886,
24396,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class ZLNKECL_LOG definition
public
final
create private .
*"* public components of class ZLNKECL_LOG
*"* do not include other source files here!!!
public section.
constants C_LOG_MSGTYP_ERROR type ZLNKELOG_MSGTYP_DE value 'E'. "#EC NOTEXT
constants C_LOG_MSGTYP_ABORT type ZLNKELOG_MSGTYP_DE value 'A'. "#EC NOTEXT
constants C_LOG_MSGTYP_SUCCESS type ZLNKELOG_MSGTYP_DE value 'S'. "#EC NOTEXT
constants C_LOG_MSGTYP_INFO type ZLNKELOG_MSGTYP_DE value 'I'. "#EC NOTEXT
constants C_LOG_MSGTYP_WARNING type ZLNKELOG_MSGTYP_DE value 'W'. "#EC NOTEXT
constants C_LOG_EVT_CONT_SERVER_REQ type ZLNKELOG_EVENT_DE value 'A'. "#EC NOTEXT
constants C_LOG_EVT_REQ_TO_AWS type ZLNKELOG_EVENT_DE value 'B'. "#EC NOTEXT
constants C_LOG_EVT_RESP_FROM_AWS type ZLNKELOG_EVENT_DE value 'C'. "#EC NOTEXT
constants C_LOG_EVT_BUCKET_CREATE type ZLNKELOG_EVENT_DE value 'D'. "#EC NOTEXT
constants C_LOG_EVT_BUCKET_DELETE type ZLNKELOG_EVENT_DE value 'E'. "#EC NOTEXT
constants C_LOG_EVT_BUCKET_LIFECYCLE type ZLNKELOG_EVENT_DE value 'F'. "#EC NOTEXT
constants C_LOG_EVT_USER_CREATED type ZLNKELOG_EVENT_DE value 'G'. "#EC NOTEXT
constants C_LOG_EVT_USER_EDITION type ZLNKELOG_EVENT_DE value 'H'. "#EC NOTEXT
constants C_LOG_EVT_USER_DELETED type ZLNKELOG_EVENT_DE value 'I'. "#EC NOTEXT
constants C_LOG_EVT_BUCKET_ENCRYPT type ZLNKELOG_EVENT_DE value 'J'. "#EC NOTEXT
constants C_LOG_EVT_AOBJ_ADD_BUCKET type ZLNKELOG_EVENT_DE value 'K'. "#EC NOTEXT
constants C_LOG_EVT_AOBJ_REMOVE_BUCKET type ZLNKELOG_EVENT_DE value 'L'. "#EC NOTEXT
constants C_LOG_EVT_AOBJ_EDITION type ZLNKELOG_EVENT_DE value 'M'. "#EC NOTEXT
constants C_LOG_EVT_CONT_SERVER_CX type ZLNKELOG_EVENT_DE value 'N'. "#EC NOTEXT
class-methods CLASS_CONSTRUCTOR .
class-methods APPEND_LOG_CONTENT_SERVER_REQ
importing
!I_HTTP_REQUEST type ref to IF_HTTP_REQUEST .
class-methods APPEND_LOG_CONTENT_SERVER_CX
importing
!I_EXCEPTION type ref to ZLNKECX_AWS_S3 .
class-methods APPEND_LOG_REQ_TO_AWS
importing
!I_HTTP_REQUEST type ref to IF_HTTP_REQUEST
!I_REQUEST type STRING .
class-methods APPEND_LOG_AOBJ_ADD_BUCKET
importing
!I_AOBJ type OBJCT_TR01
!I_BUCKET type ZLNKEBUCKET_DE
!I_ARCH_LINK type ARCH_LINK
!I_STORE_FRST type ARCH_STORE
!I_READARCSYS type ARCH_READ
!I_USER_NAME type UNAME default SY-UNAME .
class-methods APPEND_LOG_AOBJ_REMOVE_BUCKET
importing
!I_AOBJ type OBJCT_TR01
!I_BUCKET type ZLNKEBUCKET_DE
!I_ARCH_LINK type ARCH_LINK
!I_STORE_FRST type ARCH_STORE
!I_READARCSYS type ARCH_READ
!I_USER_NAME type UNAME default SY-UNAME .
class-methods APPEND_LOG_AOBJ_EDITION
importing
!I_AOBJ type OBJCT_TR01
!I_BUCKET_OLD type ZLNKEBUCKET_DE
!I_BUCKET_NEW type ZLNKEBUCKET_DE
!I_ARCH_LINK_OLD type ARCH_LINK
!I_ARCH_LINK_NEW type ARCH_LINK
!I_STORE_FRST_OLD type ARCH_STORE
!I_STORE_FRST_NEW type ARCH_STORE
!I_READARCSYS_OLD type ARCH_READ
!I_READARCSYS_NEW type ARCH_READ
!I_USER_NAME type UNAME default SY-UNAME .
class-methods APPEND_LOG_USER_CREATED
importing
!I_USER_DATA type ZLNKEUSER .
class-methods APPEND_LOG_USER_DELETED
importing
!I_USER_DATA type ZLNKEUSER .
class-methods APPEND_LOG_USER_EDITION
importing
!I_USER_DATA_OLD type ZLNKEUSER
!I_USER_DATA_NEW type ZLNKEUSER .
class-methods APPEND_LOG_RESP_FROM_AWS
importing
!I_HTTP_RESPONSE type ref to IF_HTTP_RESPONSE
!I_XRESPONSE type XSTRING optional
!I_EXCEPTION type ref to ZLNKECX_AWS_S3 optional .
class-methods APPEND_LOG_CREATE_BUCKET
importing
!I_BUCKET_NAME type STRING
!I_BUCKET_USER_NAME type ZLNKEUSERNAME_DE
!I_REGION type ZLNKEREGION_DE
!I_CLIENT_SIDE_ENCRYPTION type ZLNKECLIENT_SIDE_ENCRYPTION_DE
!I_SERVER_SIDE_ENCRYPTION type ZLNKESERVER_SIDE_ENCRYPTION_DE
!I_ZIP type ZLNKEZIPFLAG_DE
!I_USER_NAME type UNAME default SY-UNAME
!I_EXCEPTION type ref to ZLNKECX_AWS_S3 optional .
class-methods APPEND_LOG_DELETE_BUCKET
importing
!I_BUCKET_NAME type STRING
!I_USER_NAME type UNAME default SY-UNAME
!I_EXCEPTION type ref to ZLNKECX_AWS_S3 optional .
class-methods APPEND_LOG_BUCKET_LIFECYCLE
importing
!I_BUCKET_NAME type STRING
!I_USER_NAME type UNAME default SY-UNAME
!I_LIFECYCLE type ZLNKEBUCKET_LIFECYCLE_DE
!I_EXCEPTION type ref to ZLNKECX_AWS_S3 optional .
class-methods APPEND_LOG_BUCKET_SERV_ENCRYPT
importing
!I_BUCKET_NAME type STRING
!I_USER_NAME type UNAME default SY-UNAME
!I_SERVER_ENCRYPT_OLD type ZLNKESERVER_SIDE_ENCRYPTION_DE
!I_SERVER_ENCRYPT type ZLNKESERVER_SIDE_ENCRYPTION_DE .
protected section.
*"* protected components of class ZLNKECL_LOG
*"* do not include other source files here!!!
private section.
*"* private components of class ZLNKECL_LOG
*"* do not include other source files here!!!
type-pools ABAP .
class-data ATTR_LOG_RESPONSE_FROM_AWS type ABAP_BOOL .
class-data ATTR_LOG_REQ_RESP_FROM_AWS type ABAP_BOOL .
class-data ATTR_LOG_CONT_SERV_REQUEST type ABAP_BOOL .
class-data ATTR_KEEP_DAYS type ZLNKELOG_CFG-KEEP_DAYS .
constants C_DEFAULT_DAYS_TO_KEEP type I value 10. "#EC NOTEXT
class-methods APPEND_LOGX
importing
!I_LOG_EVENT type ZLNKELOG_EVENT_DE
!I_LOG_MSGTYP type ZLNKELOG_MSGTYP_DE
!I_XSTRING type XSTRING .
class-methods PURGE_LOG .
class-methods READ_CONFIG .
ENDCLASS.
CLASS ZLNKECL_LOG IMPLEMENTATION.
METHOD append_logx.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 11th April 2014
* Appends log to ZLNKElog
*--------------------------------------------------------------------*
DATA: l_timestampl TYPE timestampl.
DATA: l_guid TYPE ZLNKEguid.
DATA: ls_log TYPE ZLNKElog.
GET TIME STAMP FIELD l_timestampl.
CALL FUNCTION 'SYSTEM_UUID_CREATE'
IMPORTING
uuid = l_guid.
ls_log-guid = l_guid.
ls_log-timestamp = l_timestampl.
ls_log-log_event = i_log_event.
ls_log-log_msgtyp = i_log_msgtyp.
ls_log-event_user = sy-uname.
ls_log-rawdata = i_xstring.
MODIFY ZLNKElog FROM ls_log.
ENDMETHOD.
METHOD append_log_aobj_add_bucket.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 7th May 2014
* Appends log for AOBJ Add Bucket event
*--------------------------------------------------------------------*
DATA: l_xxml TYPE xstring.
DATA: l_aobj_s TYPE string,
l_bucket_s TYPE string,
l_arch_link_s TYPE string,
l_store_frst_s TYPE string,
l_readarcsys_s TYPE string,
l_user_name_s TYPE string.
DATA: lr_ixml TYPE REF TO if_ixml.
DATA: lr_ixml_document TYPE REF TO if_ixml_document.
DATA: lr_elem_aobj_add_bucket TYPE REF TO if_ixml_element.
* Create iXML object
lr_ixml = cl_ixml=>create( ).
* Create iXML document
lr_ixml_document = lr_ixml->create_document( ).
* Element AOBJ_AddBucket
lr_elem_aobj_add_bucket = lr_ixml_document->create_simple_element( "#EC NOTEXT
name = 'AOBJ_AddBucket'
parent = lr_ixml_document ).
* Element AOBJ
l_aobj_s = i_aobj.
lr_ixml_document->create_simple_element( name = 'AOBJ' "#EC NOTEXT
parent = lr_elem_aobj_add_bucket
value = l_aobj_s ).
* Element Bucket
l_bucket_s = i_bucket.
lr_ixml_document->create_simple_element( name = 'Bucket' "#EC NOTEXT
parent = lr_elem_aobj_add_bucket
value = l_bucket_s ).
* Element ARCH_LINK
IF i_arch_link = abap_true.
l_arch_link_s = 'true'. "#EC NOTEXT
ELSE.
l_arch_link_s = 'false'. "#EC NOTEXT
ENDIF.
lr_ixml_document->create_simple_element( name = 'ARCH_LINK' "#EC NOTEXT
parent = lr_elem_aobj_add_bucket
value = l_arch_link_s ).
* Element STORE_FRST
IF i_store_frst = abap_true.
l_store_frst_s = 'Store Before Deleting'. "#EC NOTEXT
ELSE.
l_store_frst_s = 'Delete Before Storing'. "#EC NOTEXT
ENDIF.
lr_ixml_document->create_simple_element( name = 'STORE_FRST' "#EC NOTEXT
parent = lr_elem_aobj_add_bucket
value = l_store_frst_s ).
* Element READARCSYS
IF i_readarcsys = abap_true.
l_readarcsys_s = 'true'. "#EC NOTEXT
ELSE.
l_readarcsys_s = 'false'. "#EC NOTEXT
ENDIF.
lr_ixml_document->create_simple_element( name = 'STORE_FRST' "#EC NOTEXT
parent = lr_elem_aobj_add_bucket
value = l_readarcsys_s ).
* Element UserName
l_user_name_s = i_user_name.
lr_ixml_document->create_simple_element( name = 'UserName' "#EC NOTEXT
parent = lr_elem_aobj_add_bucket
value = l_user_name_s ).
l_xxml = ZLNKEcl_xml_utils=>convert_ixml_doc_to_xstring( lr_ixml_document ).
CALL METHOD ZLNKEcl_log=>append_logx
EXPORTING
i_log_event = c_log_evt_aobj_add_bucket
i_log_msgtyp = c_log_msgtyp_success
i_xstring = l_xxml.
ENDMETHOD.
METHOD append_log_aobj_edition.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 7th May 2014
* Appends log for AOBJ Edition event
*--------------------------------------------------------------------*
DATA: l_xxml TYPE xstring.
DATA: l_aobj_s TYPE string,
l_bucket_s TYPE string,
l_arch_link_s TYPE string,
l_store_frst_s TYPE string,
l_readarcsys_s TYPE string,
l_user_name_s TYPE string.
DATA: lr_ixml TYPE REF TO if_ixml.
DATA: lr_ixml_document TYPE REF TO if_ixml_document.
DATA: lr_elem_aobj_edition TYPE REF TO if_ixml_element.
* Create iXML object
lr_ixml = cl_ixml=>create( ).
* Create iXML document
lr_ixml_document = lr_ixml->create_document( ).
* Element AOBJ_Edition
lr_elem_aobj_edition = lr_ixml_document->create_simple_element( "#EC NOTEXT
name = 'AOBJ_Edition'
parent = lr_ixml_document ).
* Element AOBJ
l_aobj_s = i_aobj.
lr_ixml_document->create_simple_element( name = 'AOBJ' "#EC NOTEXT
parent = lr_elem_aobj_edition
value = l_aobj_s ).
IF i_bucket_old <> i_bucket_new.
* Element Bucket Old
l_bucket_s = i_bucket_old.
lr_ixml_document->create_simple_element( name = 'Bucket_OLD' "#EC NOTEXT
parent = lr_elem_aobj_edition
value = l_bucket_s ).
* Element Bucket New
l_bucket_s = i_bucket_new.
lr_ixml_document->create_simple_element( name = 'Bucket_NEW' "#EC NOTEXT
parent = lr_elem_aobj_edition
value = l_bucket_s ).
ENDIF.
IF i_arch_link_old <> i_arch_link_new.
* Element ARCH_LINK_OLD
IF i_arch_link_old = abap_true.
l_arch_link_s = 'true'. "#EC NOTEXT
ELSE.
l_arch_link_s = 'false'. "#EC NOTEXT
ENDIF.
lr_ixml_document->create_simple_element( name = 'ARCH_LINK_OLD' "#EC NOTEXT
parent = lr_elem_aobj_edition
value = l_arch_link_s ).
* Element ARCH_LINK_NEW
IF i_arch_link_new = abap_true.
l_arch_link_s = 'true'. "#EC NOTEXT
ELSE.
l_arch_link_s = 'false'. "#EC NOTEXT
ENDIF.
lr_ixml_document->create_simple_element( name = 'ARCH_LINK_NEW' "#EC NOTEXT
parent = lr_elem_aobj_edition
value = l_arch_link_s ).
ENDIF.
IF i_store_frst_old <> i_store_frst_new.
* Element STORE_FRST_OLD
IF i_store_frst_old = abap_true.
l_store_frst_s = 'Store Before Deleting'. "#EC NOTEXT
ELSE.
l_store_frst_s = 'Delete Before Storing'. "#EC NOTEXT
ENDIF.
lr_ixml_document->create_simple_element( name = 'STORE_FRST_OLD' "#EC NOTEXT
parent = lr_elem_aobj_edition
value = l_store_frst_s ).
* Element STORE_FRST_NEW
IF i_store_frst_new = abap_true.
l_store_frst_s = 'Store Before Deleting'. "#EC NOTEXT
ELSE.
l_store_frst_s = 'Delete Before Storing'. "#EC NOTEXT
ENDIF.
lr_ixml_document->create_simple_element( name = 'STORE_FRST_NEW' "#EC NOTEXT
parent = lr_elem_aobj_edition
value = l_store_frst_s ).
ENDIF.
IF i_readarcsys_old <> i_readarcsys_new.
* Element READARCSYS_OLD
IF i_readarcsys_old = abap_true.
l_readarcsys_s = 'true'. "#EC NOTEXT
ELSE.
l_readarcsys_s = 'false'. "#EC NOTEXT
ENDIF.
lr_ixml_document->create_simple_element( name = 'READARCSYS_OLD' "#EC NOTEXT
parent = lr_elem_aobj_edition
value = l_readarcsys_s ).
* Element READARCSYS_NEW
IF i_readarcsys_new = abap_true.
l_readarcsys_s = 'true'. "#EC NOTEXT
ELSE.
l_readarcsys_s = 'false'. "#EC NOTEXT
ENDIF.
lr_ixml_document->create_simple_element( name = 'READARCSYS_NEW' "#EC NOTEXT
parent = lr_elem_aobj_edition
value = l_readarcsys_s ).
ENDIF.
* Element UserName
l_user_name_s = i_user_name.
lr_ixml_document->create_simple_element( name = 'UserName' "#EC NOTEXT
parent = lr_elem_aobj_edition
value = l_user_name_s ).
l_xxml = ZLNKEcl_xml_utils=>convert_ixml_doc_to_xstring( lr_ixml_document ).
CALL METHOD ZLNKEcl_log=>append_logx
EXPORTING
i_log_event = c_log_evt_aobj_edition
i_log_msgtyp = c_log_msgtyp_success
i_xstring = l_xxml.
ENDMETHOD.
METHOD append_log_aobj_remove_bucket.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 7th May 2014
* Appends log for AOBJ Remove Bucket event
*--------------------------------------------------------------------*
DATA: l_xxml TYPE xstring.
DATA: l_aobj_s TYPE string,
l_bucket_s TYPE string,
l_arch_link_s TYPE string,
l_store_frst_s TYPE string,
l_readarcsys_s TYPE string,
l_user_name_s TYPE string.
DATA: lr_ixml TYPE REF TO if_ixml.
DATA: lr_ixml_document TYPE REF TO if_ixml_document.
DATA: lr_elem_aobj_remove_bucket TYPE REF TO if_ixml_element.
* Create iXML object
lr_ixml = cl_ixml=>create( ).
* Create iXML document
lr_ixml_document = lr_ixml->create_document( ).
* Element AOBJ_AddBucket
lr_elem_aobj_remove_bucket = lr_ixml_document->create_simple_element( "#EC NOTEXT
name = 'AOBJ_RemoveBucket'
parent = lr_ixml_document ).
* Element AOBJ
l_aobj_s = i_aobj.
lr_ixml_document->create_simple_element( name = 'AOBJ' "#EC NOTEXT
parent = lr_elem_aobj_remove_bucket
value = l_aobj_s ).
* Element Bucket
l_bucket_s = i_bucket.
lr_ixml_document->create_simple_element( name = 'Bucket' "#EC NOTEXT
parent = lr_elem_aobj_remove_bucket
value = l_bucket_s ).
* Element ARCH_LINK
IF i_arch_link = abap_true.
l_arch_link_s = 'true'. "#EC NOTEXT
ELSE.
l_arch_link_s = 'false'. "#EC NOTEXT
ENDIF.
lr_ixml_document->create_simple_element( name = 'ARCH_LINK' "#EC NOTEXT
parent = lr_elem_aobj_remove_bucket
value = l_arch_link_s ).
* Element STORE_FRST
IF i_store_frst = abap_true.
l_store_frst_s = 'Store Before Deleting'. "#EC NOTEXT
ELSE.
l_store_frst_s = 'Delete Before Storing'. "#EC NOTEXT
ENDIF.
lr_ixml_document->create_simple_element( name = 'STORE_FRST' "#EC NOTEXT
parent = lr_elem_aobj_remove_bucket
value = l_store_frst_s ).
* Element READARCSYS
IF i_readarcsys = abap_true.
l_readarcsys_s = 'true'. "#EC NOTEXT
ELSE.
l_readarcsys_s = 'false'. "#EC NOTEXT
ENDIF.
lr_ixml_document->create_simple_element( name = 'STORE_FRST' "#EC NOTEXT
parent = lr_elem_aobj_remove_bucket
value = l_readarcsys_s ).
* Element UserName
l_user_name_s = i_user_name.
lr_ixml_document->create_simple_element( name = 'UserName' "#EC NOTEXT
parent = lr_elem_aobj_remove_bucket
value = l_user_name_s ).
l_xxml = ZLNKEcl_xml_utils=>convert_ixml_doc_to_xstring( lr_ixml_document ).
CALL METHOD ZLNKEcl_log=>append_logx
EXPORTING
i_log_event = c_log_evt_aobj_remove_bucket
i_log_msgtyp = c_log_msgtyp_success
i_xstring = l_xxml.
ENDMETHOD.
METHOD append_log_bucket_lifecycle.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 14th April 2014
* Appends log for Bucket Lifecycle event
*--------------------------------------------------------------------*
DATA: l_xxml TYPE xstring.
DATA: l_log_msgtyp TYPE ZLNKElog_msgtyp_de.
DATA: l_bucket_name TYPE string,
l_user_name TYPE string,
l_lifecycle_s TYPE string,
l_message_s TYPE string.
DATA: lr_ixml TYPE REF TO if_ixml.
DATA: lr_ixml_document TYPE REF TO if_ixml_document.
DATA: lr_elem_bucketlifecycle TYPE REF TO if_ixml_element.
* Create iXML object
lr_ixml = cl_ixml=>create( ).
* Create iXML document
lr_ixml_document = lr_ixml->create_document( ).
* Element BucketLifecycle
lr_elem_bucketlifecycle = lr_ixml_document->create_simple_element( "#EC NOTEXT
name = 'BucketLifecycle'
parent = lr_ixml_document ).
* Element ErrorMsg
IF i_exception IS NOT INITIAL.
l_message_s = i_exception->get_text( ).
lr_ixml_document->create_simple_element( name = 'ErrorMsg' "#EC NOTEXT
parent = lr_elem_bucketlifecycle
value = l_message_s ).
ENDIF.
* Element BucketName
l_bucket_name = i_bucket_name.
lr_ixml_document->create_simple_element( name = 'BucketName' "#EC NOTEXT
parent = lr_elem_bucketlifecycle
value = l_bucket_name ).
* Element Lifecycle
l_lifecycle_s = i_lifecycle.
lr_ixml_document->create_simple_element( name = 'Lifecycle' "#EC NOTEXT
parent = lr_elem_bucketlifecycle
value = l_lifecycle_s ).
* Element UserName
l_user_name = i_user_name.
lr_ixml_document->create_simple_element( name = 'UserName' "#EC NOTEXT
parent = lr_elem_bucketlifecycle
value = l_user_name ).
l_xxml = ZLNKEcl_xml_utils=>convert_ixml_doc_to_xstring( lr_ixml_document ).
IF i_exception IS INITIAL.
l_log_msgtyp = c_log_msgtyp_success.
ELSE.
l_log_msgtyp = c_log_msgtyp_error.
ENDIF.
CALL METHOD ZLNKEcl_log=>append_logx
EXPORTING
i_log_event = c_log_evt_bucket_lifecycle
i_log_msgtyp = l_log_msgtyp
i_xstring = l_xxml.
ENDMETHOD.
METHOD append_log_bucket_serv_encrypt.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 5th May 2014
* Appends log for Bucket server side encrypt edition
*--------------------------------------------------------------------*
DATA: l_xxml TYPE xstring.
DATA: l_bucket_name TYPE string,
l_user_name TYPE string,
l_encrypt_s TYPE string.
DATA: lr_ixml TYPE REF TO if_ixml.
DATA: lr_ixml_document TYPE REF TO if_ixml_document.
DATA: lr_elem_bucket_encrypt TYPE REF TO if_ixml_element.
* Create iXML object
lr_ixml = cl_ixml=>create( ).
* Create iXML document
lr_ixml_document = lr_ixml->create_document( ).
* Element BucketServerSideEncrypt
lr_elem_bucket_encrypt = lr_ixml_document->create_simple_element( "#EC NOTEXT
name = 'BucketServerSideEncrypt'
parent = lr_ixml_document ).
* Element BucketName
l_bucket_name = i_bucket_name.
lr_ixml_document->create_simple_element( name = 'BucketName' "#EC NOTEXT
parent = lr_elem_bucket_encrypt
value = l_bucket_name ).
* Element ServerSideEncryptOld
IF i_server_encrypt_old = abap_true.
l_encrypt_s = 'true'. "#EC NOTEXT
ELSE.
l_encrypt_s = 'false'. "#EC NOTEXT
ENDIF.
lr_ixml_document->create_simple_element( name = 'ServerSideEncryptOld' "#EC NOTEXT
parent = lr_elem_bucket_encrypt
value = l_encrypt_s ).
* Element ServerSideEncrypt
IF i_server_encrypt = abap_true.
l_encrypt_s = 'true'. "#EC NOTEXT
ELSE.
l_encrypt_s = 'false'. "#EC NOTEXT
ENDIF.
lr_ixml_document->create_simple_element( name = 'ServerSideEncrypt' "#EC NOTEXT
parent = lr_elem_bucket_encrypt
value = l_encrypt_s ).
* Element UserName
l_user_name = i_user_name.
lr_ixml_document->create_simple_element( name = 'UserName' "#EC NOTEXT
parent = lr_elem_bucket_encrypt
value = l_user_name ).
l_xxml = ZLNKEcl_xml_utils=>convert_ixml_doc_to_xstring( lr_ixml_document ).
CALL METHOD ZLNKEcl_log=>append_logx
EXPORTING
i_log_event = c_log_evt_bucket_encrypt
i_log_msgtyp = c_log_msgtyp_success
i_xstring = l_xxml.
ENDMETHOD.
METHOD append_log_content_server_cx.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 15th July 2014
* Appends log for Content Server exception
*--------------------------------------------------------------------*
DATA: l_xxml TYPE xstring.
DATA: l_message_s TYPE string.
DATA: lr_ixml TYPE REF TO if_ixml.
DATA: lr_ixml_document TYPE REF TO if_ixml_document.
DATA: lr_elem_cont_serv_cx TYPE REF TO if_ixml_element.
* Create iXML object
lr_ixml = cl_ixml=>create( ).
* Create iXML document
lr_ixml_document = lr_ixml->create_document( ).
* Element Content Server Exception
lr_elem_cont_serv_cx = lr_ixml_document->create_simple_element( "#EC NOTEXT
name = 'ContentServerException'
parent = lr_ixml_document ).
* Element ErrorMsg
IF i_exception IS NOT INITIAL.
l_message_s = i_exception->get_text( ).
lr_ixml_document->create_simple_element( name = 'ErrorMsg' "#EC NOTEXT
parent = lr_elem_cont_serv_cx
value = l_message_s ).
ENDIF.
l_xxml = ZLNKEcl_xml_utils=>convert_ixml_doc_to_xstring( lr_ixml_document ).
CALL METHOD ZLNKEcl_log=>append_logx
EXPORTING
i_log_event = c_log_evt_cont_server_cx
i_log_msgtyp = c_log_msgtyp_error
i_xstring = l_xxml.
ENDMETHOD.
METHOD append_log_content_server_req.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 11th April 2014
* Appends log for content server request
*--------------------------------------------------------------------*
DATA: lt_headers TYPE tihttpnvp.
DATA: l_xxml TYPE xstring.
DATA: lr_ixml TYPE REF TO if_ixml.
DATA: lr_ixml_document TYPE REF TO if_ixml_document.
DATA: lr_elem_cont_serv_req TYPE REF TO if_ixml_element.
DATA: lr_elem_headers TYPE REF TO if_ixml_element.
FIELD-SYMBOLS: <fs_ihttpnvp> TYPE ihttpnvp.
CHECK attr_log_cont_serv_request = abap_true.
CHECK i_http_request IS NOT INITIAL.
i_http_request->get_header_fields(
CHANGING fields = lt_headers ).
* Create iXML object
lr_ixml = cl_ixml=>create( ).
* Create iXML document
lr_ixml_document = lr_ixml->create_document( ).
* Element Content Server request
lr_elem_cont_serv_req = lr_ixml_document->create_simple_element(
name = 'ContentServerRequest'
parent = lr_ixml_document ).
* Element Headers
lr_elem_headers = lr_ixml_document->create_simple_element(
name = 'Headers' "#EC NOTEXT
parent = lr_elem_cont_serv_req ).
LOOP AT lt_headers ASSIGNING <fs_ihttpnvp> "#EC NOTEXT
WHERE name = '~request_method'
OR name = '~request_uri'
OR name = 'host'.
REPLACE '~' INTO <fs_ihttpnvp>-name WITH space.
CONDENSE <fs_ihttpnvp>-name NO-GAPS.
lr_ixml_document->create_simple_element( name = <fs_ihttpnvp>-name
parent = lr_elem_headers
value = <fs_ihttpnvp>-value ).
ENDLOOP.
l_xxml = ZLNKEcl_xml_utils=>convert_ixml_doc_to_xstring( lr_ixml_document ).
CALL METHOD ZLNKEcl_log=>append_logx
EXPORTING
i_log_event = c_log_evt_cont_server_req
i_log_msgtyp = c_log_msgtyp_info
i_xstring = l_xxml.
ENDMETHOD.
METHOD append_log_create_bucket.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 14th April 2014
* Appends log for Bucket Creation event
*--------------------------------------------------------------------*
DATA: l_xxml TYPE xstring.
DATA: l_log_msgtyp TYPE ZLNKElog_msgtyp_de.
DATA: l_bucket_name TYPE string,
l_bucket_user_name TYPE string,
l_user_name TYPE string,
l_region TYPE string,
l_server_side_encryption TYPE string,
l_client_side_encryption TYPE string,
l_zip TYPE string,
l_message_s TYPE string.
DATA: lr_ixml TYPE REF TO if_ixml.
DATA: lr_ixml_document TYPE REF TO if_ixml_document.
DATA: lr_elem_createbucket TYPE REF TO if_ixml_element.
* Create iXML object
lr_ixml = cl_ixml=>create( ).
* Create iXML document
lr_ixml_document = lr_ixml->create_document( ).
* Element CreateBucket
lr_elem_createbucket = lr_ixml_document->create_simple_element( "#EC NOTEXT
name = 'CreateBucket'
parent = lr_ixml_document ).
* Element ErrorMsg
IF i_exception IS NOT INITIAL.
l_message_s = i_exception->get_text( ).
lr_ixml_document->create_simple_element( name = 'ErrorMsg' "#EC NOTEXT
parent = lr_elem_createbucket
value = l_message_s ).
ENDIF.
* Element BucketName
l_bucket_name = i_bucket_name.
lr_ixml_document->create_simple_element( name = 'BucketName' "#EC NOTEXT
parent = lr_elem_createbucket
value = l_bucket_name ).
* Element BucketUserName
l_bucket_user_name = i_bucket_user_name.
lr_ixml_document->create_simple_element( name = 'BucketUserName' "#EC NOTEXT
parent = lr_elem_createbucket
value = l_bucket_user_name ).
* Element Region
l_region = i_region.
lr_ixml_document->create_simple_element( name = 'Region' "#EC NOTEXT
parent = lr_elem_createbucket
value = l_region ).
* Element ClientSideEncryption
IF i_client_side_encryption = abap_true.
l_client_side_encryption = 'true'.
ELSE.
l_client_side_encryption = 'false'.
ENDIF.
lr_ixml_document->create_simple_element( name = 'ClientSideEncryption' "#EC NOTEXT
parent = lr_elem_createbucket
value = l_client_side_encryption ).
* Element ServerSideEncryption
IF i_server_side_encryption = abap_true.
l_server_side_encryption = 'true'.
ELSE.
l_server_side_encryption = 'false'.
ENDIF.
lr_ixml_document->create_simple_element( name = 'ServerSideEncryption' "#EC NOTEXT
parent = lr_elem_createbucket
value = l_server_side_encryption ).
* Element Zip
IF i_zip = abap_true.
l_zip = 'true'.
ELSE.
l_zip = 'false'.
ENDIF.
lr_ixml_document->create_simple_element( name = 'Zip' "#EC NOTEXT
parent = lr_elem_createbucket
value = l_zip ).
* Element UserName
l_user_name = i_user_name.
lr_ixml_document->create_simple_element( name = 'UserName' "#EC NOTEXT
parent = lr_elem_createbucket
value = l_user_name ).
l_xxml = ZLNKEcl_xml_utils=>convert_ixml_doc_to_xstring( lr_ixml_document ).
IF i_exception IS INITIAL.
l_log_msgtyp = c_log_msgtyp_success.
ELSE.
l_log_msgtyp = c_log_msgtyp_error.
ENDIF.
CALL METHOD ZLNKEcl_log=>append_logx
EXPORTING
i_log_event = c_log_evt_bucket_create
i_log_msgtyp = l_log_msgtyp
i_xstring = l_xxml.
ENDMETHOD.
METHOD append_log_delete_bucket.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 14th April 2014
* Appends log for Bucket Delete event
*--------------------------------------------------------------------*
DATA: l_xxml TYPE xstring.
DATA: l_log_msgtyp TYPE ZLNKElog_msgtyp_de.
DATA: l_bucket_name TYPE string,
l_user_name TYPE string,
l_message_s TYPE string.
DATA: lr_ixml TYPE REF TO if_ixml.
DATA: lr_ixml_document TYPE REF TO if_ixml_document.
DATA: lr_elem_deletebucket TYPE REF TO if_ixml_element.
* Create iXML object
lr_ixml = cl_ixml=>create( ).
* Create iXML document
lr_ixml_document = lr_ixml->create_document( ).
* Element DeleteBucket
lr_elem_deletebucket = lr_ixml_document->create_simple_element(
name = 'DeleteBucket'
parent = lr_ixml_document ).
* Element ErrorMsg
IF i_exception IS NOT INITIAL.
l_message_s = i_exception->get_text( ).
lr_ixml_document->create_simple_element( name = 'ErrorMsg' "#EC NOTEXT
parent = lr_elem_deletebucket
value = l_message_s ).
ENDIF.
* Element BucketName
l_bucket_name = i_bucket_name.
lr_ixml_document->create_simple_element( name = 'BucketName'
parent = lr_elem_deletebucket
value = l_bucket_name ).
* Element UserName
l_user_name = i_user_name.
lr_ixml_document->create_simple_element( name = 'UserName'
parent = lr_elem_deletebucket
value = l_user_name ).
l_xxml = ZLNKEcl_xml_utils=>convert_ixml_doc_to_xstring( lr_ixml_document ).
IF i_exception IS INITIAL.
l_log_msgtyp = c_log_msgtyp_success.
ELSE.
l_log_msgtyp = c_log_msgtyp_error.
ENDIF.
CALL METHOD ZLNKEcl_log=>append_logx
EXPORTING
i_log_event = c_log_evt_bucket_delete
i_log_msgtyp = l_log_msgtyp
i_xstring = l_xxml.
ENDMETHOD.
METHOD append_log_req_to_aws.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 14th April 2014
* Appends log for Request to S3
*--------------------------------------------------------------------*
DATA: lt_headers TYPE tihttpnvp.
DATA: l_xxml TYPE xstring.
DATA: lr_ixml TYPE REF TO if_ixml.
DATA: lr_ixml_document TYPE REF TO if_ixml_document.
DATA: lr_elem_req_to_s3 TYPE REF TO if_ixml_element.
DATA: lr_elem_headers TYPE REF TO if_ixml_element.
FIELD-SYMBOLS: <fs_ihttpnvp> TYPE ihttpnvp.
CHECK attr_log_req_resp_from_aws = abap_true.
CHECK i_http_request IS NOT INITIAL.
i_http_request->get_header_fields(
CHANGING fields = lt_headers ).
* Create iXML object
lr_ixml = cl_ixml=>create( ).
* Create iXML document
lr_ixml_document = lr_ixml->create_document( ).
* Element RequestToS3
lr_elem_req_to_s3 = lr_ixml_document->create_simple_element( "#EC NOTEXT
name = 'RequestToS3'
parent = lr_ixml_document ).
* Element Request
lr_ixml_document->create_simple_element( name = 'Request' "#EC NOTEXT
parent = lr_elem_req_to_s3
value = i_request ).
* Element Headers
lr_elem_headers = lr_ixml_document->create_simple_element( "#EC NOTEXT
name = 'Headers'
parent = lr_elem_req_to_s3 ).
LOOP AT lt_headers ASSIGNING <fs_ihttpnvp>.
REPLACE '~' INTO <fs_ihttpnvp>-name WITH space.
CONDENSE <fs_ihttpnvp>-name NO-GAPS.
lr_ixml_document->create_simple_element( name = <fs_ihttpnvp>-name
parent = lr_elem_headers
value = <fs_ihttpnvp>-value ).
ENDLOOP.
l_xxml = ZLNKEcl_xml_utils=>convert_ixml_doc_to_xstring( lr_ixml_document ).
CALL METHOD ZLNKEcl_log=>append_logx
EXPORTING
i_log_event = c_log_evt_req_to_aws
i_log_msgtyp = c_log_msgtyp_info
i_xstring = l_xxml.
ENDMETHOD.
METHOD append_log_resp_from_aws.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 14th April 2014
* Appends log for Response from S3
*--------------------------------------------------------------------*
DATA: lt_headers TYPE tihttpnvp.
DATA: l_xxml TYPE xstring.
DATA: l_log_msgtyp TYPE ZLNKElog_msgtyp_de.
DATA: l_message_s TYPE string.
DATA: l_xml TYPE string.
DATA: l_response_is_xml TYPE abap_bool.
DATA: lr_ixml TYPE REF TO if_ixml.
DATA: lr_ixml_document TYPE REF TO if_ixml_document.
DATA: lr_elem_resp_from_s3 TYPE REF TO if_ixml_element.
DATA: lr_elem_headers TYPE REF TO if_ixml_element.
FIELD-SYMBOLS: <fs_ihttpnvp> TYPE ihttpnvp.
CHECK attr_log_req_resp_from_aws = abap_true.
CHECK i_http_response IS NOT INITIAL.
i_http_response->get_header_fields(
CHANGING fields = lt_headers ).
* Create iXML object
lr_ixml = cl_ixml=>create( ).
* Create iXML document
lr_ixml_document = lr_ixml->create_document( ).
* Element ResponseFromS3
lr_elem_resp_from_s3 = lr_ixml_document->create_simple_element( "#EC NOTEXT
name = 'ResponseFromS3'
parent = lr_ixml_document ).
* Element ErrorMsg
IF i_exception IS NOT INITIAL.
l_message_s = i_exception->get_text( ).
lr_ixml_document->create_simple_element( name = 'ErrorMsg' "#EC NOTEXT
parent = lr_elem_resp_from_s3
value = l_message_s ).
ENDIF.
* Element Headers
lr_elem_headers = lr_ixml_document->create_simple_element( "#EC NOTEXT
name = 'Headers'
parent = lr_elem_resp_from_s3 ).
LOOP AT lt_headers ASSIGNING <fs_ihttpnvp>.
IF <fs_ihttpnvp>-name = 'content-type'
AND ( <fs_ihttpnvp>-value = 'application/xml'
OR <fs_ihttpnvp>-value = 'text/xml' ).
l_response_is_xml = abap_true.
ENDIF.
REPLACE '~' INTO <fs_ihttpnvp>-name WITH space.
CONDENSE <fs_ihttpnvp>-name NO-GAPS.
lr_ixml_document->create_simple_element( name = <fs_ihttpnvp>-name
parent = lr_elem_headers
value = <fs_ihttpnvp>-value ).
ENDLOOP.
* If configuration is marked to log xml response and
* the response is XML, log it...
IF attr_log_response_from_aws = abap_true
AND l_response_is_xml = abap_true.
TRY.
CALL METHOD ZLNKEcl_string_conversions=>xstring_to_string
EXPORTING
input = i_xresponse
IMPORTING
output = l_xml.
lr_ixml_document->create_simple_element( "#EC NOTEXT
name = 'Response'
parent = lr_elem_resp_from_s3
value = l_xml ).
CATCH cx_sy_no_handler. "#EC NO_HANDLER
* Should not happen.
* In this case, we don't create element Response
ENDTRY.
ENDIF.
l_xxml = ZLNKEcl_xml_utils=>convert_ixml_doc_to_xstring( lr_ixml_document ).
IF i_exception IS INITIAL.
l_log_msgtyp = c_log_msgtyp_info.
ELSE.
l_log_msgtyp = c_log_msgtyp_error.
ENDIF.
CALL METHOD ZLNKEcl_log=>append_logx
EXPORTING
i_log_event = c_log_evt_resp_from_aws
i_log_msgtyp = l_log_msgtyp
i_xstring = l_xxml.
ENDMETHOD.
METHOD append_log_user_created.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 24th April 2014
* Appends log for Request to S3
*--------------------------------------------------------------------*
DATA: l_string TYPE string.
DATA: l_xxml TYPE xstring.
DATA: lr_ixml TYPE REF TO if_ixml.
DATA: lr_ixml_document TYPE REF TO if_ixml_document.
DATA: lr_elem_user TYPE REF TO if_ixml_element.
* Create iXML object
lr_ixml = cl_ixml=>create( ).
* Create iXML document
lr_ixml_document = lr_ixml->create_document( ).
* Element UserCreation
lr_elem_user = lr_ixml_document->create_simple_element( "#EC NOTEXT
name = 'UserCreation'
parent = lr_ixml_document ).
l_string = i_user_data-user_name.
lr_ixml_document->create_simple_element( name = 'USER_NAME' "#EC NOTEXT
parent = lr_elem_user
value = l_string ).
l_string = i_user_data-access_key.
lr_ixml_document->create_simple_element( name = 'ACCESS_KEY' "#EC NOTEXT
parent = lr_elem_user
value = l_string ).
l_string = i_user_data-secr_access_key.
lr_ixml_document->create_simple_element( name = 'SECR_ACCESS_KEY' "#EC NOTEXT
parent = lr_elem_user
value = l_string ).
l_xxml = ZLNKEcl_xml_utils=>convert_ixml_doc_to_xstring( lr_ixml_document ).
CALL METHOD ZLNKEcl_log=>append_logx
EXPORTING
i_log_event = c_log_evt_user_created
i_log_msgtyp = c_log_msgtyp_info
i_xstring = l_xxml.
ENDMETHOD.
METHOD append_log_user_deleted.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 24th April 2014
* Appends log for Request to S3
*--------------------------------------------------------------------*
DATA: l_string TYPE string.
DATA: l_xxml TYPE xstring.
DATA: lr_ixml TYPE REF TO if_ixml.
DATA: lr_ixml_document TYPE REF TO if_ixml_document.
DATA: lr_elem_user TYPE REF TO if_ixml_element.
* Create iXML object
lr_ixml = cl_ixml=>create( ).
* Create iXML document
lr_ixml_document = lr_ixml->create_document( ).
* Element UserCreation
lr_elem_user = lr_ixml_document->create_simple_element( "#EC NOTEXT
name = 'UserDeletion'
parent = lr_ixml_document ).
l_string = i_user_data-user_name.
lr_ixml_document->create_simple_element( name = 'USER_NAME' "#EC NOTEXT
parent = lr_elem_user
value = l_string ).
l_string = i_user_data-access_key.
lr_ixml_document->create_simple_element( name = 'ACCESS_KEY' "#EC NOTEXT
parent = lr_elem_user
value = l_string ).
l_string = i_user_data-secr_access_key.
lr_ixml_document->create_simple_element( name = 'SECR_ACCESS_KEY' "#EC NOTEXT
parent = lr_elem_user
value = l_string ).
l_xxml = ZLNKEcl_xml_utils=>convert_ixml_doc_to_xstring( lr_ixml_document ).
CALL METHOD ZLNKEcl_log=>append_logx
EXPORTING
i_log_event = c_log_evt_user_deleted
i_log_msgtyp = c_log_msgtyp_info
i_xstring = l_xxml.
ENDMETHOD.
METHOD append_log_user_edition.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 24th April 2014
* Appends log for Request to S3
*--------------------------------------------------------------------*
DATA: l_string TYPE string.
DATA: l_xxml TYPE xstring.
DATA: lr_ixml TYPE REF TO if_ixml.
DATA: lr_ixml_document TYPE REF TO if_ixml_document.
DATA: lr_elem_user TYPE REF TO if_ixml_element.
* Create iXML object
lr_ixml = cl_ixml=>create( ).
* Create iXML document
lr_ixml_document = lr_ixml->create_document( ).
* Element UserCreation
lr_elem_user = lr_ixml_document->create_simple_element( "#EC NOTEXT
name = 'UserEdition'
parent = lr_ixml_document ).
l_string = i_user_data_old-user_name.
lr_ixml_document->create_simple_element( name = 'USER_NAME' "#EC NOTEXT
parent = lr_elem_user
value = l_string ).
l_string = i_user_data_old-access_key.
lr_ixml_document->create_simple_element( name = 'ACCESS_KEY_OLD' "#EC NOTEXT
parent = lr_elem_user
value = l_string ).
l_string = i_user_data_old-secr_access_key.
lr_ixml_document->create_simple_element( name = 'SECR_ACCESS_KEY_OLD' "#EC NOTEXT
parent = lr_elem_user
value = l_string ).
l_string = i_user_data_new-access_key.
lr_ixml_document->create_simple_element( name = 'ACCESS_KEY_NEW' "#EC NOTEXT
parent = lr_elem_user
value = l_string ).
l_string = i_user_data_new-secr_access_key.
lr_ixml_document->create_simple_element( name = 'SECR_ACCESS_KEY_NEW' "#EC NOTEXT
parent = lr_elem_user
value = l_string ).
l_xxml = ZLNKEcl_xml_utils=>convert_ixml_doc_to_xstring( lr_ixml_document ).
CALL METHOD ZLNKEcl_log=>append_logx
EXPORTING
i_log_event = c_log_evt_user_edition
i_log_msgtyp = c_log_msgtyp_info
i_xstring = l_xxml.
ENDMETHOD.
METHOD class_constructor.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 14th April 2014
* Class constructor
*--------------------------------------------------------------------*
read_config( ).
purge_log( ).
ENDMETHOD.
METHOD purge_log.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 14th April 2014
* Deletes from log table old registers for events
* c_log_evt_cont_server_req
* c_log_evt_req_to_aws
* c_log_evt_resp_from_aws
*--------------------------------------------------------------------*
DATA: l_timestamp TYPE timestamp.
DATA: l_timestampl_c TYPE char21.
DATA: l_datum TYPE datum.
l_datum = sy-datum - attr_keep_days.
l_timestampl_c(8) = l_datum.
l_timestampl_c+8(6) = sy-uzeit.
l_timestamp = l_timestampl_c.
DELETE FROM ZLNKElog
WHERE timestamp < l_timestamp
AND log_event IN (c_log_evt_cont_server_req,
c_log_evt_req_to_aws,
c_log_evt_resp_from_aws).
ENDMETHOD.
METHOD read_config.
*--------------------------------------------------------------------*
* Company: RocketSteam
* Author: Jordi Escoda, 14th April 2014
* Reads configuration
*--------------------------------------------------------------------*
SELECT SINGLE keep_days log_xml_resp_aws log_req_resp_aws log_contserv_req
INTO (attr_keep_days, attr_log_response_from_aws,
attr_log_req_resp_from_aws, attr_log_cont_serv_request)
FROM ZLNKElog_cfg
WHERE dummyid = space.
IF sy-subrc <> 0.
* Value by default
attr_keep_days = c_default_days_to_keep.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
4871,
1168,
43,
46888,
2943,
43,
62,
25294,
6770,
198,
220,
1171,
198,
220,
2457,
198,
220,
2251,
2839,
764,
198,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1168,
43,
46888,
2943,
43,
62,
25294,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
11377,
2665,
13,
628,
220,
38491,
327,
62,
25294,
62,
5653,
38,
9936,
47,
62,
24908,
2099,
1168,
43,
46888,
3698,
7730,
62,
5653,
38,
9936,
47,
62,
7206,
1988,
705,
36,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
5653,
38,
9936,
47,
62,
6242,
9863,
2099,
1168,
43,
46888,
3698,
7730,
62,
5653,
38,
9936,
47,
62,
7206,
1988,
705,
32,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
5653,
38,
9936,
47,
62,
12564,
4093,
7597,
2099,
1168,
43,
46888,
3698,
7730,
62,
5653,
38,
9936,
47,
62,
7206,
1988,
705,
50,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
5653,
38,
9936,
47,
62,
10778,
2099,
1168,
43,
46888,
3698,
7730,
62,
5653,
38,
9936,
47,
62,
7206,
1988,
705,
40,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
5653,
38,
9936,
47,
62,
31502,
2099,
1168,
43,
46888,
3698,
7730,
62,
5653,
38,
9936,
47,
62,
7206,
1988,
705,
54,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
20114,
51,
62,
37815,
62,
35009,
5959,
62,
2200,
48,
2099,
1168,
43,
46888,
3698,
7730,
62,
20114,
3525,
62,
7206,
1988,
705,
32,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
20114,
51,
62,
2200,
48,
62,
10468,
62,
12298,
50,
2099,
1168,
43,
46888,
3698,
7730,
62,
20114,
3525,
62,
7206,
1988,
705,
33,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
20114,
51,
62,
19535,
47,
62,
10913,
2662,
62,
12298,
50,
2099,
1168,
43,
46888,
3698,
7730,
62,
20114,
3525,
62,
7206,
1988,
705,
34,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
20114,
51,
62,
33,
16696,
2767,
62,
43387,
6158,
2099,
1168,
43,
46888,
3698,
7730,
62,
20114,
3525,
62,
7206,
1988,
705,
35,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
20114,
51,
62,
33,
16696,
2767,
62,
7206,
2538,
9328,
2099,
1168,
43,
46888,
3698,
7730,
62,
20114,
3525,
62,
7206,
1988,
705,
36,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
20114,
51,
62,
33,
16696,
2767,
62,
43,
5064,
2943,
56,
29931,
2099,
1168,
43,
46888,
3698,
7730,
62,
20114,
3525,
62,
7206,
1988,
705,
37,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
20114,
51,
62,
29904,
62,
43387,
11617,
2099,
1168,
43,
46888,
3698,
7730,
62,
20114,
3525,
62,
7206,
1988,
705,
38,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
20114,
51,
62,
29904,
62,
1961,
17941,
2099,
1168,
43,
46888,
3698,
7730,
62,
20114,
3525,
62,
7206,
1988,
705,
39,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
20114,
51,
62,
29904,
62,
7206,
28882,
1961,
2099,
1168,
43,
46888,
3698,
7730,
62,
20114,
3525,
62,
7206,
1988,
705,
40,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
20114,
51,
62,
33,
16696,
2767,
62,
1677,
9419,
56,
11571,
2099,
1168,
43,
46888,
3698,
7730,
62,
20114,
3525,
62,
7206,
1988,
705,
41,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
20114,
51,
62,
32,
9864,
41,
62,
29266,
62,
33,
16696,
2767,
2099,
1168,
43,
46888,
3698,
7730,
62,
20114,
3525,
62,
7206,
1988,
705,
42,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
20114,
51,
62,
32,
9864,
41,
62,
2200,
11770,
6089,
62,
33,
16696,
2767,
2099,
1168,
43,
46888,
3698,
7730,
62,
20114,
3525,
62,
7206,
1988,
705,
43,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
20114,
51,
62,
32,
9864,
41,
62,
1961,
17941,
2099,
1168,
43,
46888,
3698,
7730,
62,
20114,
3525,
62,
7206,
1988,
705,
44,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
25294,
62,
20114,
51,
62,
37815,
62,
35009,
5959,
62,
34,
55,
2099,
1168,
43,
46888,
3698,
7730,
62,
20114,
3525,
62,
7206,
1988,
705,
45,
4458,
25113,
2943,
5626,
13918,
628,
220,
1398,
12,
24396,
82,
42715,
62,
10943,
46126,
1581,
764,
198,
220,
1398,
12,
24396,
82,
43504,
10619,
62,
25294,
62,
37815,
3525,
62,
35009,
5959,
62,
2200,
48,
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,
764,
198,
220,
1398,
12,
24396,
82,
43504,
10619,
62,
25294,
62,
37815,
3525,
62,
35009,
5959,
62,
34,
55,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
6369,
42006,
2849,
2099,
1006,
284,
1168,
43,
46888,
2943,
55,
62,
12298,
50,
62,
50,
18,
764,
198,
220,
1398,
12,
24396,
82,
43504,
10619,
62,
25294,
62,
2200,
48,
62,
10468,
62,
12298,
50,
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,
2200,
35780,
2099,
19269,
2751,
764,
198,
220,
1398,
12,
24396,
82,
43504,
10619,
62,
25294,
62,
32,
9864,
41,
62,
29266,
62,
33,
16696,
2767,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
32,
9864,
41,
2099,
25334,
41,
4177,
62,
5446,
486,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
33,
16696,
2767,
2099,
1168,
43,
45,
7336,
33,
16696,
2767,
62,
7206,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
31315,
62,
43,
17248,
2099,
5923,
3398,
62,
43,
17248,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
2257,
6965,
62,
10913,
2257,
2099,
5923,
3398,
62,
2257,
6965,
198,
220,
220,
220,
220,
220,
5145,
40,
62,
15675,
1503,
7902,
16309,
2099,
5923,
3398,
62,
15675,
198,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS 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.
DATA: lv_signature TYPE string.
lv_signature = zcl_abappgp_unit_test=>get_signature( ).
zcl_abappgp_unit_test=>message_identity( lv_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,
198,
220,
220,
220,
220,
220,
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,
42865,
25,
300,
85,
62,
12683,
1300,
41876,
4731,
13,
628,
198,
220,
220,
220,
300,
85,
62,
12683,
1300,
796,
1976,
565,
62,
397,
1324,
31197,
62,
20850,
62,
9288,
14804,
1136,
62,
12683,
1300,
7,
6739,
628,
220,
220,
220,
1976,
565,
62,
397,
1324,
31197,
62,
20850,
62,
9288,
14804,
20500,
62,
738,
414,
7,
300,
85,
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,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS /dmo/tc_flight_travel_api19 DEFINITION
PUBLIC
ABSTRACT
CREATE PUBLIC
FOR TESTING
DURATION MEDIUM
RISK LEVEL HARMLESS .
PUBLIC SECTION.
PROTECTED SECTION.
METHODS cuerd_travel FOR TESTING RAISING cx_static_check.
PRIVATE SECTION.
CLASS-DATA gv_agency_id_1 TYPE /dmo/agency_id19.
CLASS-DATA gv_agency_id_2 TYPE /dmo/agency_id19.
CLASS-DATA gv_agency_id_unknown TYPE /dmo/agency_id19.
CLASS-DATA gv_customer_id_1 TYPE /dmo/customer_id19.
CLASS-DATA gv_customer_id_2 TYPE /dmo/customer_id19.
CLASS-DATA gv_customer_id_unknown TYPE /dmo/customer_id19.
CLASS-METHODS class_setup.
ENDCLASS.
CLASS /dmo/tc_flight_travel_api19 IMPLEMENTATION.
METHOD class_setup.
DATA lt_agency_id TYPE SORTED TABLE OF /dmo/agency_id19 WITH UNIQUE KEY table_line.
SELECT DISTINCT agency_id FROM /dmo/agency19 ORDER BY agency_id DESCENDING INTO TABLE @lt_agency_id .
DATA lt_customer_id TYPE SORTED TABLE OF /dmo/customer_id19 WITH UNIQUE KEY table_line.
SELECT DISTINCT customer_id FROM /dmo/customer19 ORDER BY customer_id DESCENDING INTO TABLE @lt_customer_id .
" Select 2 known agency IDs
IF lines( lt_agency_id ) < 2.
cl_abap_unit_assert=>abort( msg = 'No agency data!' ).
ENDIF.
gv_agency_id_1 = lt_agency_id[ 1 ].
gv_agency_id_2 = lt_agency_id[ 2 ].
cl_abap_unit_assert=>assert_differs( act = gv_agency_id_1 exp = gv_agency_id_2 )." To be totally sure
" Select 2 known customer IDs
IF lines( lt_customer_id ) < 2.
cl_abap_unit_assert=>abort( msg = 'No customer data!' ).
ENDIF.
gv_customer_id_1 = lt_customer_id[ 1 ].
gv_customer_id_2 = lt_customer_id[ 2 ].
cl_abap_unit_assert=>assert_differs( act = gv_customer_id_1 exp = gv_customer_id_2 )." To be totally sure
" Determine an unknown agency ID
gv_agency_id_unknown = lt_agency_id[ 1 ].
DO.
gv_agency_id_unknown = gv_agency_id_unknown + 1.
READ TABLE lt_agency_id TRANSPORTING NO FIELDS WITH TABLE KEY table_line = gv_agency_id_unknown.
IF sy-subrc <> 0.
EXIT.
ENDIF.
ENDDO.
" Determine an unknown customer ID
gv_customer_id_unknown = lt_customer_id[ 1 ].
DO.
gv_customer_id_unknown = gv_customer_id_unknown + 1.
READ TABLE lt_customer_id TRANSPORTING NO FIELDS WITH TABLE KEY table_line = gv_customer_id_unknown.
IF sy-subrc <> 0.
EXIT.
ENDIF.
ENDDO.
ENDMETHOD.
METHOD cuerd_travel.
DATA ls_travel_in TYPE /dmo/if_flight_legacy19=>ts_travel_in.
DATA ls_travel_inx TYPE /dmo/if_flight_legacy19=>ts_travel_inx.
DATA ls_travel TYPE /dmo/travel19.
DATA lt_messages TYPE /dmo/if_flight_legacy19=>tt_message.
" Create Travel and Commit
ls_travel_in-agency_id = gv_agency_id_1.
ls_travel_in-customer_id = gv_customer_id_1.
ls_travel_in-begin_date = '20180101'.
ls_travel_in-end_date = '20180201'.
ls_travel_in-description = 'My Test'.
CALL FUNCTION '/DMO/FLIGHT_TRAVEL_CREATE19'
EXPORTING
is_travel = ls_travel_in
IMPORTING
es_travel = ls_travel
et_messages = lt_messages.
cl_abap_unit_assert=>assert_initial( lt_messages ).
DATA(lv_travel_id) = ls_travel-travel_id.
cl_abap_unit_assert=>assert_not_initial( lv_travel_id ).
CALL FUNCTION '/DMO/FLIGHT_TRAVEL_SAVE19'.
" DB Check
SELECT SINGLE agency_id, customer_id, description FROM /dmo/travel19 WHERE travel_id = @lv_travel_id INTO ( @DATA(lv_agency_id), @DATA(lv_customer_id), @DATA(lv_description) ).
cl_abap_unit_assert=>assert_subrc( ).
cl_abap_unit_assert=>assert_equals( act = lv_agency_id exp = gv_agency_id_1 ).
cl_abap_unit_assert=>assert_equals( act = lv_customer_id exp = gv_customer_id_1 ).
cl_abap_unit_assert=>assert_equals( act = lv_description exp = 'My Test' ).
" Update
CLEAR ls_travel_in.
ls_travel_in-travel_id = lv_travel_id.
ls_travel_in-agency_id = gv_agency_id_2.
ls_travel_in-customer_id = gv_customer_id_2.
ls_travel_in-description = 'My New Test'.
ls_travel_inx-travel_id = lv_travel_id.
ls_travel_inx-agency_id = abap_true.
ls_travel_inx-customer_id = abap_true.
ls_travel_inx-description = abap_true.
CALL FUNCTION '/DMO/FLIGHT_TRAVEL_UPDATE19'
EXPORTING
is_travel = ls_travel_in
is_travelx = ls_travel_inx
IMPORTING
et_messages = lt_messages.
cl_abap_unit_assert=>assert_initial( lt_messages ).
" Action
CALL FUNCTION '/DMO/FLIGHT_TRAVEL_SET_BOOK_19'
EXPORTING
iv_travel_id = lv_travel_id
IMPORTING
et_messages = lt_messages.
cl_abap_unit_assert=>assert_initial( lt_messages ).
" Faulty Update - All or Nothing -> Nothing
CLEAR ls_travel_in.
ls_travel_in-travel_id = lv_travel_id.
ls_travel_in-agency_id = gv_agency_id_unknown.
ls_travel_in-customer_id = gv_customer_id_1.
ls_travel_inx-travel_id = lv_travel_id.
ls_travel_inx-agency_id = abap_true.
ls_travel_inx-customer_id = abap_true.
CALL FUNCTION '/DMO/FLIGHT_TRAVEL_UPDATE19'
EXPORTING
is_travel = ls_travel_in
is_travelx = ls_travel_inx
IMPORTING
et_messages = lt_messages.
cl_abap_unit_assert=>assert_not_initial( lt_messages ).
" Faulty Update - All or Nothing -> Nothing
CLEAR lt_messages.
CLEAR ls_travel_in.
ls_travel_in-travel_id = lv_travel_id.
ls_travel_in-agency_id = gv_agency_id_1.
ls_travel_in-customer_id = gv_customer_id_unknown.
ls_travel_inx-travel_id = lv_travel_id.
ls_travel_inx-agency_id = abap_true.
ls_travel_inx-customer_id = abap_true.
CALL FUNCTION '/DMO/FLIGHT_TRAVEL_UPDATE19'
EXPORTING
is_travel = ls_travel_in
is_travelx = ls_travel_inx
IMPORTING
et_messages = lt_messages.
cl_abap_unit_assert=>assert_not_initial( lt_messages ).
" Read DB only
CLEAR ls_travel.
CALL FUNCTION '/DMO/FLIGHT_TRAVEL_READ19'
EXPORTING
iv_travel_id = lv_travel_id
iv_include_buffer = abap_false
IMPORTING
es_travel = ls_travel
et_messages = lt_messages.
cl_abap_unit_assert=>assert_initial( lt_messages ).
cl_abap_unit_assert=>assert_equals( act = ls_travel-travel_id exp = lv_travel_id ).
cl_abap_unit_assert=>assert_equals( act = ls_travel-agency_id exp = gv_agency_id_1 ).
cl_abap_unit_assert=>assert_equals( act = ls_travel-customer_id exp = gv_customer_id_1 ).
cl_abap_unit_assert=>assert_equals( act = ls_travel-status exp = CONV /dmo/travel_status19( /dmo/if_flight_legacy19=>travel_status-new ) ).
cl_abap_unit_assert=>assert_equals( act = ls_travel-description exp = 'My Test' ).
" Read with buffer
CLEAR ls_travel.
CALL FUNCTION '/DMO/FLIGHT_TRAVEL_READ19'
EXPORTING
iv_travel_id = lv_travel_id
iv_include_buffer = abap_true
IMPORTING
es_travel = ls_travel
et_messages = lt_messages.
cl_abap_unit_assert=>assert_initial( lt_messages ).
cl_abap_unit_assert=>assert_equals( act = ls_travel-travel_id exp = lv_travel_id ).
cl_abap_unit_assert=>assert_equals( act = ls_travel-agency_id exp = gv_agency_id_2 ).
cl_abap_unit_assert=>assert_equals( act = ls_travel-customer_id exp = gv_customer_id_2 ).
cl_abap_unit_assert=>assert_equals( act = ls_travel-status exp = CONV /dmo/travel_status19( /dmo/if_flight_legacy19=>travel_status-booked ) ).
cl_abap_unit_assert=>assert_equals( act = ls_travel-description exp = 'My New Test' ).
" Delete
CALL FUNCTION '/DMO/FLIGHT_TRAVEL_DELETE19'
EXPORTING
iv_travel_id = lv_travel_id
IMPORTING
et_messages = lt_messages.
cl_abap_unit_assert=>assert_initial( lt_messages ).
" Delete again -> Error
CALL FUNCTION '/DMO/FLIGHT_TRAVEL_DELETE19'
EXPORTING
iv_travel_id = lv_travel_id
IMPORTING
et_messages = lt_messages.
cl_abap_unit_assert=>assert_not_initial( lt_messages ).
CALL FUNCTION '/DMO/FLIGHT_TRAVEL_SAVE19'.
ENDMETHOD.
ENDCLASS.
| [
31631,
1220,
67,
5908,
14,
23047,
62,
22560,
62,
35927,
62,
15042,
1129,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
9564,
18601,
10659,
198,
220,
29244,
6158,
44731,
198,
220,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
26112,
41796,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
764,
628,
220,
44731,
44513,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
269,
15573,
67,
62,
35927,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42715,
12,
26947,
308,
85,
62,
40955,
62,
312,
62,
16,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
40955,
62,
312,
1129,
13,
198,
220,
220,
220,
42715,
12,
26947,
308,
85,
62,
40955,
62,
312,
62,
17,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
40955,
62,
312,
1129,
13,
198,
220,
220,
220,
42715,
12,
26947,
308,
85,
62,
40955,
62,
312,
62,
34680,
220,
220,
41876,
1220,
67,
5908,
14,
40955,
62,
312,
1129,
13,
628,
220,
220,
220,
42715,
12,
26947,
308,
85,
62,
23144,
263,
62,
312,
62,
16,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
23144,
263,
62,
312,
1129,
13,
198,
220,
220,
220,
42715,
12,
26947,
308,
85,
62,
23144,
263,
62,
312,
62,
17,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
23144,
263,
62,
312,
1129,
13,
198,
220,
220,
220,
42715,
12,
26947,
308,
85,
62,
23144,
263,
62,
312,
62,
34680,
41876,
1220,
67,
5908,
14,
23144,
263,
62,
312,
1129,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
1398,
62,
40406,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1220,
67,
5908,
14,
23047,
62,
22560,
62,
35927,
62,
15042,
1129,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
1398,
62,
40406,
13,
198,
220,
220,
220,
42865,
300,
83,
62,
40955,
62,
312,
41876,
311,
9863,
1961,
43679,
3963,
1220,
67,
5908,
14,
40955,
62,
312,
1129,
220,
220,
220,
220,
13315,
4725,
33866,
8924,
35374,
3084,
62,
1370,
13,
198,
220,
220,
220,
33493,
360,
8808,
1268,
4177,
4086,
62,
312,
16034,
1220,
67,
5908,
14,
40955,
1129,
220,
220,
220,
220,
38678,
11050,
4086,
62,
312,
220,
220,
22196,
34,
10619,
2751,
39319,
43679,
2488,
2528,
62,
40955,
62,
312,
764,
628,
220,
220,
220,
42865,
300,
83,
62,
23144,
263,
62,
312,
41876,
311,
9863,
1961,
43679,
3963,
1220,
67,
5908,
14,
23144,
263,
62,
312,
1129,
13315,
4725,
33866,
8924,
35374,
3084,
62,
1370,
13,
198,
220,
220,
220,
33493,
360,
8808,
1268,
4177,
6491,
62,
312,
16034,
1220,
67,
5908,
14,
23144,
263,
1129,
38678,
11050,
6491,
62,
312,
22196,
34,
10619,
2751,
39319,
43679,
2488,
2528,
62,
23144,
263,
62,
312,
764,
628,
220,
220,
220,
366,
9683,
362,
1900,
4086,
32373,
198,
220,
220,
220,
16876,
3951,
7,
300,
83,
62,
40955,
62,
312,
1267,
1279,
362,
13,
198,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
397,
419,
7,
31456,
796,
705,
2949,
4086,
1366,
13679,
220,
220,
6739,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
308,
85,
62,
40955,
62,
312,
62,
16,
796,
300,
83,
62,
40955,
62,
312,
58,
352,
20740,
198,
220,
220,
220,
308,
85,
62,
40955,
62,
312,
62,
17,
796,
300,
83,
62,
40955,
62,
312,
58,
362,
20740,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
26069,
364,
7,
719,
796,
308,
85,
62,
40955,
62,
312,
62,
16,
220,
1033,
796,
308,
85,
62,
40955,
62,
312,
62,
17,
1267,
526,
1675,
307,
6635,
1654,
628,
220,
220,
220,
366,
9683,
362,
1900,
6491,
32373,
198,
220,
220,
220,
16876,
3951,
7,
300,
83,
62,
23144,
263,
62,
312,
1267,
1279,
362,
13,
198,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
397,
419,
7,
31456,
796,
705,
2949,
6491,
1366,
13679,
6739,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
308,
85,
62,
23144,
263,
62,
312,
62,
16,
796,
300,
83,
62,
23144,
263,
62,
312,
58,
352,
20740,
198,
220,
220,
220,
308,
85,
62,
23144,
263,
62,
312,
62,
17,
796,
300,
83,
62,
23144,
263,
62,
312,
58,
362,
20740,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
26069,
364,
7,
719,
796,
308,
85,
62,
23144,
263,
62,
312,
62,
16,
220,
1033,
796,
308,
85,
62,
23144,
263,
62,
312,
62,
17,
1267,
526,
1675,
307,
6635,
1654,
628,
220,
220,
220,
366,
45559,
3810,
281,
6439,
4086,
4522,
198,
220,
220,
220,
308,
85,
62,
40955,
62,
312,
62,
34680,
796,
300,
83,
62,
40955,
62,
312,
58,
352,
20740,
198,
220,
220,
220,
8410,
13,
198,
220,
220,
220,
220,
220,
308,
85,
62,
40955,
62,
312,
62,
34680,
796,
308,
85,
62,
40955,
62,
312,
62,
34680,
1343,
352,
13,
198,
220,
220,
220,
220,
220,
20832,
43679,
300,
83,
62,
40955,
62,
312,
220,
220,
48213,
4303,
9863,
2751,
8005,
18930,
3698,
5258,
13315,
43679,
35374,
3084,
62,
1370,
796,
308,
85,
62,
40955,
62,
312,
62,
34680,
13,
198,
220,
220,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
2043,
13,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
18227,
13,
628,
220,
220,
220,
366,
45559,
3810,
281,
6439,
6491,
4522,
198,
220,
220,
220,
308,
85,
62,
23144,
263,
62,
312,
62,
34680,
796,
300,
83,
62,
23144,
263,
62,
312,
58,
352,
20740,
198,
220,
220,
220,
8410,
13,
198,
220,
220,
220,
220,
220,
308,
85,
62,
23144,
263,
62,
312,
62,
34680,
796,
308,
85,
62,
23144,
263,
62,
312,
62,
34680,
1343,
352,
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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*----------------------------------------------------------------------*
* CLASS ltcl_swag DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS ltcl_swag DEFINITION FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS
FINAL.
PUBLIC SECTION.
INTERFACES:
if_http_server,
if_http_request,
if_http_response.
PRIVATE SECTION.
DATA: mo_swag TYPE REF TO zcl_swag,
mv_reply TYPE string.
METHODS: setup,
test FOR TESTING RAISING cx_static_check.
CLASS-METHODS: to_string
IMPORTING iv_xstr TYPE xstring
RETURNING VALUE(rv_str) TYPE string.
ENDCLASS. "ltcl_Register
*----------------------------------------------------------------------*
* CLASS ltcl_swag IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS ltcl_swag IMPLEMENTATION.
METHOD to_string.
DATA: lo_conv TYPE REF TO cl_abap_conv_in_ce.
lo_conv = cl_abap_conv_in_ce=>create( input = iv_xstr ).
lo_conv->read(
IMPORTING
data = rv_str ).
ENDMETHOD. "to_string
METHOD setup.
me->if_http_server~request = me.
me->if_http_server~response = me.
CREATE OBJECT mo_swag
EXPORTING
ii_server = me
iv_base = ''
iv_title = 'test'.
ENDMETHOD. "setup
METHOD if_http_request~get_method.
method = zcl_swag=>c_method-get.
ENDMETHOD. "if_http_request~get_method
METHOD if_http_request~set_compression.
RETURN.
ENDMETHOD.
METHOD if_http_entity~get_header_field.
CASE name.
WHEN '~path'.
value = '/swag/foo/'.
WHEN OTHERS.
cl_abap_unit_assert=>fail( ).
ENDCASE.
ENDMETHOD. "if_http_entity~get_header_field
METHOD if_http_entity~set_data.
mv_reply = to_string( data ).
ENDMETHOD. "if_http_entity~set_data
METHOD if_http_entity~get_cdata.
data = 'bar'.
ENDMETHOD. "if_http_entity~get_cdata
METHOD if_http_response~set_status.
RETURN.
ENDMETHOD.
METHOD test.
DATA: lo_handler TYPE REF TO zcl_swag_example_handler.
CREATE OBJECT lo_handler.
mo_swag->register( lo_handler ).
mo_swag->run( ).
cl_abap_unit_assert=>assert_not_initial( mv_reply ).
cl_abap_unit_assert=>assert_char_cp(
act = mv_reply
exp = '*foobar*' ).
ENDMETHOD. "test
ENDCLASS. "ltcl_swag IMPLEMENTATION
| [
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
83,
565,
62,
2032,
363,
5550,
20032,
17941,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
31631,
300,
83,
565,
62,
2032,
363,
5550,
20032,
17941,
7473,
43001,
2751,
198,
220,
220,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
220,
220,
45698,
42,
49277,
43638,
5805,
7597,
198,
220,
220,
220,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
25,
198,
220,
220,
220,
220,
220,
611,
62,
4023,
62,
15388,
11,
198,
220,
220,
220,
220,
220,
611,
62,
4023,
62,
25927,
11,
198,
220,
220,
220,
220,
220,
611,
62,
4023,
62,
26209,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
6941,
62,
2032,
363,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
2032,
363,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
85,
62,
47768,
41876,
4731,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
9058,
11,
198,
220,
220,
220,
220,
220,
1332,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
25,
284,
62,
8841,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
87,
2536,
220,
220,
220,
220,
220,
220,
41876,
2124,
8841,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
2536,
8,
41876,
4731,
13,
198,
198,
10619,
31631,
13,
220,
220,
220,
220,
220,
220,
366,
2528,
565,
62,
38804,
198,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
300,
83,
565,
62,
2032,
363,
30023,
2538,
10979,
6234,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
31631,
300,
83,
565,
62,
2032,
363,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
284,
62,
8841,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
42946,
41876,
4526,
37,
5390,
537,
62,
397,
499,
62,
42946,
62,
259,
62,
344,
13,
628,
198,
220,
220,
220,
2376,
62,
42946,
796,
537,
62,
397,
499,
62,
42946,
62,
259,
62,
344,
14804,
17953,
7,
5128,
796,
21628,
62,
87,
2536,
6739,
628,
220,
220,
220,
2376,
62,
42946,
3784,
961,
7,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1366,
796,
374,
85,
62,
2536,
6739,
628,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
1462,
62,
8841,
628,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
502,
3784,
361,
62,
4023,
62,
15388,
93,
25927,
796,
502,
13,
198,
220,
220,
220,
502,
3784,
361,
62,
4023,
62,
15388,
93,
26209,
796,
502,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
6941,
62,
2032,
363,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21065,
62,
15388,
796,
502,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
8692,
220,
220,
796,
10148,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
7839,
220,
796,
705,
9288,
4458,
198,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
40406,
628,
220,
337,
36252,
611,
62,
4023,
62,
25927,
93,
1136,
62,
24396,
13,
198,
220,
220,
220,
2446,
796,
1976,
565,
62,
2032,
363,
14804,
66,
62,
24396,
12,
1136,
13,
198,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
361,
62,
4023,
62,
25927,
93,
1136,
62,
24396,
628,
220,
337,
36252,
611,
62,
4023,
62,
25927,
93,
2617,
62,
5589,
2234,
13,
198,
220,
220,
220,
30826,
27064,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
611,
62,
4023,
62,
26858,
93,
1136,
62,
25677,
62,
3245,
13,
198,
220,
220,
220,
42001,
1438,
13,
198,
220,
220,
220,
220,
220,
42099,
705,
93,
6978,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
1988,
796,
31051,
2032,
363,
14,
21943,
14,
4458,
198,
220,
220,
220,
220,
220,
42099,
440,
4221,
4877,
13,
198,
220,
220,
220,
220,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
32165,
7,
6739,
198,
220,
220,
220,
23578,
34,
11159,
13,
198,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
361,
62,
4023,
62,
26858,
93,
1136,
62,
25677,
62,
3245,
628,
220,
337,
36252,
611,
62,
4023,
62,
26858,
93,
2617,
62,
7890,
13,
198,
220,
220,
220,
285,
85,
62,
47768,
796,
284,
62,
8841,
7,
1366,
6739,
198,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
361,
62,
4023,
62,
26858,
93,
2617,
62,
7890,
628,
220,
337,
36252,
611,
62,
4023,
62,
26858,
93,
1136,
62,
66,
7890,
13,
198,
220,
220,
220,
1366,
796,
705,
5657,
4458,
198,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
361,
62,
4023,
62,
26858,
93,
1136,
62,
66,
7890,
628,
220,
337,
36252,
611,
62,
4023,
62,
26209,
93,
2617,
62,
13376,
13,
198,
220,
220,
220,
30826,
27064,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
30281,
41876,
4526,
37,
5390,
1976,
565,
62,
2032,
363,
62,
20688,
62,
30281,
13,
628,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
2376,
62,
30281,
13,
198,
220,
220,
220,
6941,
62,
2032,
363,
3784,
30238,
7,
2376,
62,
30281,
6739,
198,
220,
220,
220,
6941,
62,
2032,
363,
3784,
5143,
7,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
1662,
62,
36733,
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,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_tadir DEFINITION
PUBLIC
FINAL
CREATE PRIVATE
GLOBAL FRIENDS zcl_abapgit_factory .
PUBLIC SECTION.
INTERFACES zif_abapgit_tadir .
PROTECTED SECTION.
PRIVATE SECTION.
METHODS check_exists
IMPORTING
!it_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
RETURNING
VALUE(rt_tadir) TYPE zif_abapgit_definitions=>ty_tadir_tt
RAISING
zcx_abapgit_exception .
METHODS build
IMPORTING
!iv_package TYPE tadir-devclass
!io_dot TYPE REF TO zcl_abapgit_dot_abapgit
!iv_ignore_subpackages TYPE abap_bool DEFAULT abap_false
!iv_only_local_objects TYPE abap_bool DEFAULT abap_false
!ii_log TYPE REF TO zif_abapgit_log OPTIONAL
RETURNING
VALUE(rt_tadir) TYPE zif_abapgit_definitions=>ty_tadir_tt
RAISING
zcx_abapgit_exception .
METHODS select_objects
IMPORTING
!iv_package TYPE tadir-devclass
!iv_ignore_subpackages TYPE abap_bool DEFAULT abap_false
!iv_only_local_objects TYPE abap_bool
EXPORTING
!et_packages TYPE zif_abapgit_sap_package=>ty_devclass_tt
!et_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
RAISING
zcx_abapgit_exception .
METHODS skip_objects
IMPORTING
!iv_package TYPE tadir-devclass
!io_dot TYPE REF TO zcl_abapgit_dot_abapgit
!ii_log TYPE REF TO zif_abapgit_log OPTIONAL
CHANGING
!ct_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
RAISING
zcx_abapgit_exception ##NEEDED.
METHODS add_local_packages
IMPORTING
!it_packages TYPE zif_abapgit_sap_package=>ty_devclass_tt
CHANGING
!ct_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
RAISING
zcx_abapgit_exception .
METHODS add_namespaces
IMPORTING
!iv_package TYPE devclass
CHANGING
!ct_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
RAISING
zcx_abapgit_exception .
METHODS determine_path
IMPORTING
!iv_package TYPE tadir-devclass
!io_dot TYPE REF TO zcl_abapgit_dot_abapgit
CHANGING
!ct_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
RAISING
zcx_abapgit_exception .
METHODS adjust_objects
IMPORTING
!iv_package TYPE tadir-devclass
!io_dot TYPE REF TO zcl_abapgit_dot_abapgit
CHANGING
!ct_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
RAISING
zcx_abapgit_exception ##NEEDED.
ENDCLASS.
CLASS ZCL_ABAPGIT_TADIR IMPLEMENTATION.
METHOD add_local_packages.
FIELD-SYMBOLS:
<lv_package> LIKE LINE OF it_packages,
<ls_tadir> LIKE LINE OF ct_tadir.
LOOP AT it_packages ASSIGNING <lv_package>.
" Local packages are not in TADIR, only in TDEVC, act as if they were
IF <lv_package> CP '$*'. " OR <package> CP 'T*' ).
APPEND INITIAL LINE TO ct_tadir ASSIGNING <ls_tadir>.
<ls_tadir>-pgmid = 'R3TR'.
<ls_tadir>-object = 'DEVC'.
<ls_tadir>-obj_name = <lv_package>.
<ls_tadir>-devclass = <lv_package>.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD add_namespaces.
DATA:
lv_name TYPE progname,
lv_namespace TYPE namespace,
lv_prev_namespace TYPE namespace,
lt_tadir_nspc TYPE zif_abapgit_definitions=>ty_tadir_tt.
FIELD-SYMBOLS:
<ls_tadir> LIKE LINE OF ct_tadir,
<ls_nspc> LIKE LINE OF ct_tadir.
LOOP AT ct_tadir ASSIGNING <ls_tadir> WHERE obj_name(1) = '/'.
" Namespaces are not in TADIR, but are necessary for creating objects in transportable packages
lv_name = <ls_tadir>-obj_name.
CALL FUNCTION 'RS_NAME_SPLIT_NAMESPACE'
EXPORTING
name_with_namespace = lv_name
IMPORTING
namespace = lv_namespace
EXCEPTIONS
delimiter_error = 1
OTHERS = 2.
IF sy-subrc = 0 AND lv_namespace IS NOT INITIAL
AND lv_namespace <> lv_prev_namespace.
READ TABLE lt_tadir_nspc TRANSPORTING NO FIELDS
WITH KEY pgmid = 'R3TR' object = 'NSPC' obj_name = lv_namespace.
IF sy-subrc <> 0.
APPEND INITIAL LINE TO ct_tadir ASSIGNING <ls_nspc>.
<ls_nspc>-pgmid = 'R3TR'.
<ls_nspc>-object = 'NSPC'.
<ls_nspc>-obj_name = lv_namespace.
<ls_nspc>-devclass = iv_package.
INSERT <ls_nspc> INTO TABLE lt_tadir_nspc.
ENDIF.
lv_prev_namespace = lv_namespace.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD adjust_objects.
" Todo, replace with solution that will work with any object type (might depend on iv_package and io_dot)
FIELD-SYMBOLS <ls_tadir> LIKE LINE OF ct_tadir.
LOOP AT ct_tadir ASSIGNING <ls_tadir>.
IF <ls_tadir>-object = 'SICF'.
" Replace the internal GUID with a hash of the path
TRY.
CALL METHOD ('ZCL_ABAPGIT_OBJECT_SICF')=>read_sicf_url
EXPORTING
iv_obj_name = <ls_tadir>-obj_name
RECEIVING
rv_hash = <ls_tadir>-obj_name+15.
CATCH cx_sy_dyn_call_illegal_method ##NO_HANDLER.
" SICF might not be supported in some systems, assume this code is not called
ENDTRY.
ENDIF.
CLEAR <ls_tadir>-korrnum.
ENDLOOP.
ENDMETHOD.
METHOD build.
DATA lt_packages TYPE zif_abapgit_sap_package=>ty_devclass_tt.
select_objects(
EXPORTING
iv_package = iv_package
iv_ignore_subpackages = iv_ignore_subpackages
iv_only_local_objects = iv_only_local_objects
IMPORTING
et_tadir = rt_tadir
et_packages = lt_packages ).
skip_objects(
EXPORTING
iv_package = iv_package
io_dot = io_dot
ii_log = ii_log
CHANGING
ct_tadir = rt_tadir ).
add_local_packages(
EXPORTING
it_packages = lt_packages
CHANGING
ct_tadir = rt_tadir ).
add_namespaces(
EXPORTING
iv_package = iv_package
CHANGING
ct_tadir = rt_tadir ).
determine_path(
EXPORTING
iv_package = iv_package
io_dot = io_dot
CHANGING
ct_tadir = rt_tadir ).
adjust_objects(
EXPORTING
iv_package = iv_package
io_dot = io_dot
CHANGING
ct_tadir = rt_tadir ).
ENDMETHOD.
METHOD check_exists.
DATA: li_progress TYPE REF TO zif_abapgit_progress,
ls_item TYPE zif_abapgit_definitions=>ty_item.
FIELD-SYMBOLS: <ls_tadir> LIKE LINE OF it_tadir.
li_progress = zcl_abapgit_progress=>get_instance( lines( it_tadir ) ).
* rows from database table TADIR are not removed for
* transportable objects until the transport is released
LOOP AT it_tadir ASSIGNING <ls_tadir>.
IF sy-tabix MOD 200 = 0.
li_progress->show(
iv_current = sy-tabix
iv_text = |Check object exists { <ls_tadir>-object } { <ls_tadir>-obj_name }| ).
ENDIF.
ls_item-obj_type = <ls_tadir>-object.
ls_item-obj_name = <ls_tadir>-obj_name.
ls_item-devclass = <ls_tadir>-devclass.
IF zcl_abapgit_objects=>exists( ls_item ) = abap_true.
APPEND <ls_tadir> TO rt_tadir.
ENDIF.
ENDLOOP.
li_progress->off( ).
ENDMETHOD.
METHOD determine_path.
DATA:
lv_path TYPE string,
lo_folder_logic TYPE REF TO zcl_abapgit_folder_logic,
lv_last_package TYPE devclass VALUE cl_abap_char_utilities=>horizontal_tab.
FIELD-SYMBOLS <ls_tadir> LIKE LINE OF ct_tadir.
lo_folder_logic = zcl_abapgit_folder_logic=>get_instance( ).
LOOP AT ct_tadir ASSIGNING <ls_tadir>.
IF lv_last_package <> <ls_tadir>-devclass.
"Change in Package
lv_last_package = <ls_tadir>-devclass.
IF NOT io_dot IS INITIAL.
lv_path = lo_folder_logic->package_to_path(
iv_top = iv_package
io_dot = io_dot
iv_package = <ls_tadir>-devclass ).
ENDIF.
ENDIF.
<ls_tadir>-path = lv_path.
ENDLOOP.
ENDMETHOD.
METHOD select_objects.
DATA:
lt_excludes TYPE RANGE OF trobjtype,
ls_exclude LIKE LINE OF lt_excludes,
lt_srcsystem TYPE RANGE OF tadir-srcsystem,
ls_srcsystem LIKE LINE OF lt_srcsystem.
" Determine packages to read
IF iv_ignore_subpackages = abap_false.
et_packages = zcl_abapgit_factory=>get_sap_package( iv_package )->list_subpackages( ).
ENDIF.
INSERT iv_package INTO et_packages INDEX 1.
" Exclude object types with tadir entries that are included elsewhere
ls_exclude-sign = 'I'.
ls_exclude-option = 'EQ'.
ls_exclude-low = 'SOTR'. " automatically create for sap packages (DEVC)
APPEND ls_exclude TO lt_excludes.
ls_exclude-low = 'SFB1'. " covered by business function sets (SFBS)
APPEND ls_exclude TO lt_excludes.
ls_exclude-low = 'SFB2'. " covered by business functions (SFBF)
APPEND ls_exclude TO lt_excludes.
ls_exclude-low = 'STOB'. " auto generated by core data services (DDLS)
APPEND ls_exclude TO lt_excludes.
" Limit to objects belonging to this system
IF iv_only_local_objects = abap_true.
ls_srcsystem-sign = 'I'.
ls_srcsystem-option = 'EQ'.
ls_srcsystem-low = sy-sysid.
APPEND ls_srcsystem TO lt_srcsystem.
ENDIF.
IF et_packages IS NOT INITIAL.
SELECT * FROM tadir INTO CORRESPONDING FIELDS OF TABLE et_tadir
FOR ALL ENTRIES IN et_packages
WHERE devclass = et_packages-table_line
AND pgmid = 'R3TR'
AND object NOT IN lt_excludes
AND delflag = abap_false
AND srcsystem IN lt_srcsystem
ORDER BY PRIMARY KEY ##TOO_MANY_ITAB_FIELDS. "#EC CI_GENBUFF "#EC CI_SUBRC
ENDIF.
SORT et_tadir BY devclass pgmid object obj_name.
ENDMETHOD.
METHOD skip_objects.
" Todo, replace with solution that will work with any object type (might depend on iv_package and io_dot)
DATA lo_skip_objects TYPE REF TO zcl_abapgit_skip_objects.
lo_skip_objects = NEW #( ).
ct_tadir = lo_skip_objects->skip_sadl_generated_objects(
it_tadir = ct_tadir
ii_log = ii_log ).
ENDMETHOD.
METHOD zif_abapgit_tadir~get_object_package.
DATA: ls_tadir TYPE zif_abapgit_definitions=>ty_tadir,
ls_item TYPE zif_abapgit_definitions=>ty_item.
ls_tadir = zif_abapgit_tadir~read_single(
iv_pgmid = iv_pgmid
iv_object = iv_object
iv_obj_name = iv_obj_name ).
IF ls_tadir-delflag = 'X'.
RETURN. "Mark for deletion -> return nothing
ENDIF.
ls_item-obj_type = ls_tadir-object.
ls_item-obj_name = ls_tadir-obj_name.
ls_item-devclass = ls_tadir-devclass.
IF zcl_abapgit_objects=>exists( ls_item ) = abap_false.
RETURN.
ENDIF.
rv_devclass = ls_tadir-devclass.
ENDMETHOD.
METHOD zif_abapgit_tadir~read.
DATA: li_exit TYPE REF TO zif_abapgit_exit.
" Start recursion
" hmm, some problems here, should TADIR also build path?
rt_tadir = build(
iv_package = iv_package
io_dot = io_dot
iv_ignore_subpackages = iv_ignore_subpackages
iv_only_local_objects = iv_only_local_objects
ii_log = ii_log ).
li_exit = zcl_abapgit_exit=>get_instance( ).
li_exit->change_tadir(
EXPORTING
iv_package = iv_package
ii_log = ii_log
CHANGING
ct_tadir = rt_tadir ).
rt_tadir = check_exists( rt_tadir ).
ENDMETHOD.
METHOD zif_abapgit_tadir~read_single.
SELECT SINGLE * FROM tadir INTO CORRESPONDING FIELDS OF rs_tadir
WHERE pgmid = iv_pgmid
AND object = iv_object
AND obj_name = iv_obj_name. "#EC CI_SUBRC
CLEAR rs_tadir-korrnum.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
83,
324,
343,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
4810,
3824,
6158,
198,
220,
10188,
9864,
1847,
48167,
1677,
5258,
1976,
565,
62,
397,
499,
18300,
62,
69,
9548,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
83,
324,
343,
764,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
2198,
62,
1069,
1023,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
83,
324,
343,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
83,
324,
343,
62,
926,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
83,
324,
343,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
83,
324,
343,
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,
1382,
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,
220,
220,
41876,
36264,
343,
12,
7959,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
26518,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
46430,
62,
7266,
43789,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
8807,
62,
12001,
62,
48205,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
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,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
83,
324,
343,
8,
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,
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,
2922,
62,
48205,
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,
220,
220,
41876,
36264,
343,
12,
7959,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
46430,
62,
7266,
43789,
41876,
450,
499,
62,
30388,
5550,
38865,
450,
499,
62,
9562,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
8807,
62,
12001,
62,
48205,
41876,
450,
499,
62,
30388,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
316,
62,
43789,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
82,
499,
62,
26495,
14804,
774,
62,
7959,
4871,
62,
926,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
316,
62,
83,
324,
343,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
83,
324,
343,
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,
14267,
62,
48205,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
26495,
41876,
36264,
343,
12,
7959,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
26518,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
6404,
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,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
310,
62,
83,
324,
343,
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,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
22492,
12161,
1961,
1961,
13,
198,
220,
220,
220,
337,
36252,
50,
751,
62,
12001,
62,
43789,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
270,
62,
43789,
41876,
1976,
361,
62,
397,
499,
18300,
62,
82,
499,
62,
26495,
14804,
774,
62,
7959,
4871,
62,
926,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
310,
62,
83,
324,
343,
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,
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,
751,
62,
14933,
43076,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
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,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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 zcl_aps_parameterset_factory definition
public
final
create private.
public section.
class-methods:
provideFunctionUnitParameters
importing
i_settings type ref to zif_aps_settings
returning
value(result) type ref to zif_aps_parameterSet_func
raising
zcx_aps_unknown_executable,
provideReportParameters
importing
i_settings type ref to zif_aps_settings
returning
value(result) type ref to zif_aps_parameterSet_report
raising
zcx_aps_unknown_executable,
provideObjectParameters
importing
i_settings type ref to zif_aps_settings
returning
value(result) type ref to zif_aps_parameterSet_object.
protected section.
private section.
endclass.
class zcl_aps_parameterset_factory implementation.
method providefunctionunitparameters.
result = new zcl_aps_parameterset_func( i_settings ).
endmethod.
method provideobjectparameters.
result = new zcl_aps_parameterset_object( ).
endmethod.
method providereportparameters.
result = new zcl_aps_parameterset_report( i_settings ).
endmethod.
endclass.
| [
4871,
1976,
565,
62,
1686,
62,
17143,
7307,
316,
62,
69,
9548,
6770,
198,
220,
1171,
198,
220,
2457,
198,
220,
2251,
2839,
13,
628,
220,
1171,
2665,
13,
198,
220,
220,
220,
1398,
12,
24396,
82,
25,
198,
220,
220,
220,
220,
220,
2148,
22203,
26453,
48944,
198,
220,
220,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
33692,
220,
220,
220,
220,
220,
2099,
1006,
284,
1976,
361,
62,
1686,
62,
33692,
198,
220,
220,
220,
220,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1988,
7,
20274,
8,
220,
220,
2099,
1006,
284,
1976,
361,
62,
1686,
62,
17143,
2357,
7248,
62,
20786,
198,
220,
220,
220,
220,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
1686,
62,
34680,
62,
18558,
18187,
11,
198,
220,
220,
220,
220,
220,
2148,
19100,
48944,
198,
220,
220,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
33692,
220,
220,
220,
220,
220,
2099,
1006,
284,
1976,
361,
62,
1686,
62,
33692,
198,
220,
220,
220,
220,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1988,
7,
20274,
8,
220,
220,
2099,
1006,
284,
1976,
361,
62,
1686,
62,
17143,
2357,
7248,
62,
13116,
198,
220,
220,
220,
220,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
1686,
62,
34680,
62,
18558,
18187,
11,
198,
220,
220,
220,
220,
220,
2148,
10267,
48944,
198,
220,
220,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
33692,
220,
220,
220,
220,
220,
2099,
1006,
284,
1976,
361,
62,
1686,
62,
33692,
198,
220,
220,
220,
220,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1988,
7,
20274,
8,
220,
220,
2099,
1006,
284,
1976,
361,
62,
1686,
62,
17143,
2357,
7248,
62,
15252,
13,
628,
220,
6861,
2665,
13,
198,
220,
2839,
2665,
13,
198,
437,
4871,
13,
628,
198,
198,
4871,
1976,
565,
62,
1686,
62,
17143,
7307,
316,
62,
69,
9548,
7822,
13,
198,
220,
2446,
2148,
8818,
20850,
17143,
7307,
13,
198,
220,
220,
220,
1255,
796,
649,
1976,
565,
62,
1686,
62,
17143,
7307,
316,
62,
20786,
7,
1312,
62,
33692,
6739,
198,
220,
886,
24396,
13,
628,
220,
2446,
2148,
15252,
17143,
7307,
13,
198,
220,
220,
220,
1255,
796,
649,
1976,
565,
62,
1686,
62,
17143,
7307,
316,
62,
15252,
7,
6739,
198,
220,
886,
24396,
13,
628,
220,
2446,
2148,
13116,
17143,
7307,
13,
198,
220,
220,
220,
1255,
796,
649,
1976,
565,
62,
1686,
62,
17143,
7307,
316,
62,
13116,
7,
1312,
62,
33692,
6739,
198,
220,
886,
24396,
13,
198,
198,
437,
4871,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS ycl_abapgit_object_cmpt DEFINITION PUBLIC INHERITING FROM ycl_abapgit_objects_super FINAL.
PUBLIC SECTION.
METHODS:
constructor
IMPORTING
is_item TYPE yif_abapgit_definitions=>ty_item
iv_language TYPE spras.
INTERFACES yif_abapgit_object.
PRIVATE SECTION.
DATA: mo_cmp_db TYPE REF TO object,
mv_name TYPE c LENGTH 30.
ENDCLASS.
CLASS ycl_abapgit_object_cmpt IMPLEMENTATION.
METHOD constructor.
super->constructor( is_item = is_item
iv_language = iv_language ).
TRY.
CALL METHOD ('CL_CMP_TEMPLATE')=>('S_GET_DB_ACCESS')
RECEIVING
r_ref_db_access = mo_cmp_db.
CATCH cx_root.
ENDTRY.
mv_name = ms_item-obj_name.
ENDMETHOD.
METHOD yif_abapgit_object~changed_by.
DATA: lo_cmp_template TYPE REF TO object.
TRY.
CALL METHOD ('CL_CMP_TEMPLATE')=>('S_CREATE_FROM_DB')
EXPORTING
i_name = mv_name
i_version = 'A'
RECEIVING
r_ref_template = lo_cmp_template.
CALL METHOD lo_cmp_template->('IF_CMP_TEMPLATE_EDIT~GET_CHANGE_USER')
RECEIVING
r_user = rv_user.
CATCH cx_root.
ycx_abapgit_exception=>raise( 'CMPT not supported' ).
ENDTRY.
ENDMETHOD.
METHOD yif_abapgit_object~compare_to_remote_version.
CREATE OBJECT ro_comparison_result TYPE ycl_abapgit_comparison_null.
ENDMETHOD.
METHOD yif_abapgit_object~delete.
DATA: lv_deleted TYPE abap_bool.
TRY.
CALL METHOD mo_cmp_db->('IF_CMP_TEMPLATE_DB~DELETE_TEMPLATE')
EXPORTING
i_name = mv_name
i_version = 'A'
i_flg_header = abap_true
i_flg_lines = abap_true
RECEIVING
r_flg_deleted = lv_deleted.
CATCH cx_root.
ycx_abapgit_exception=>raise( 'CMPT not supported' ).
ENDTRY.
IF lv_deleted = abap_false.
ycx_abapgit_exception=>raise( |Error deleting CMPT { ms_item-obj_name }| ).
ENDIF.
ENDMETHOD.
METHOD yif_abapgit_object~deserialize.
DATA: lr_template TYPE REF TO data.
FIELD-SYMBOLS: <lg_template> TYPE any.
TRY.
CREATE DATA lr_template TYPE ('IF_CMP_TEMPLATE_DB=>TYP_TEMPLATE').
ASSIGN lr_template->* TO <lg_template>.
io_xml->read(
EXPORTING
iv_name = 'CMPT'
CHANGING
cg_data = <lg_template> ).
CALL METHOD mo_cmp_db->('IF_CMP_TEMPLATE_DB~SAVE_TEMPLATE')
EXPORTING
i_template_db = <lg_template>
i_flg_header = abap_true
i_flg_lines = abap_true.
CATCH cx_root.
ycx_abapgit_exception=>raise( 'CMPT not supported' ).
ENDTRY.
CALL FUNCTION 'RS_CORR_INSERT'
EXPORTING
object = ms_item-obj_name
object_class = ms_item-obj_type
mode = 'I'
global_lock = abap_true
devclass = iv_package
master_language = mv_language
EXCEPTIONS
cancelled = 1
permission_failure = 2
unknown_objectclass = 3
OTHERS = 4.
IF sy-subrc <> 0.
ycx_abapgit_exception=>raise( 'error from RS_CORR_INSERT, CMPT' ).
ENDIF.
ENDMETHOD.
METHOD yif_abapgit_object~exists.
TRY.
CALL METHOD ('CL_CMP_TEMPLATE')=>('S_TEMPLATE_EXISTS')
EXPORTING
i_name = mv_name
i_version = 'A'
RECEIVING
r_flg_exists = rv_bool.
CATCH cx_root.
ycx_abapgit_exception=>raise( 'CMPT not supported' ).
ENDTRY.
ENDMETHOD.
METHOD yif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-delete_tadir = abap_true.
ENDMETHOD.
METHOD yif_abapgit_object~has_changed_since.
rv_changed = abap_true.
ENDMETHOD.
METHOD yif_abapgit_object~jump.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = ms_item-obj_name
object_type = ms_item-obj_type
EXCEPTIONS
not_executed = 1
invalid_object_type = 2
OTHERS = 3.
IF sy-subrc <> 0.
ycx_abapgit_exception=>raise( |Error from RS_TOOL_ACCESS, CMPT| ).
ENDIF.
ENDMETHOD.
METHOD yif_abapgit_object~serialize.
DATA: lr_template TYPE REF TO data.
FIELD-SYMBOLS: <lg_template> TYPE any.
TRY.
CREATE DATA lr_template TYPE ('IF_CMP_TEMPLATE_DB=>TYP_TEMPLATE').
ASSIGN lr_template->* TO <lg_template>.
CALL METHOD mo_cmp_db->('IF_CMP_TEMPLATE_DB~READ_TEMPLATE')
EXPORTING
i_name = |{ ms_item-obj_name }|
i_version = 'A'
RECEIVING
r_template = <lg_template>.
io_xml->add( iv_name = 'CMPT'
ig_data = <lg_template> ).
CATCH cx_root.
ycx_abapgit_exception=>raise( 'CMPT not supported' ).
ENDTRY.
ENDMETHOD.
METHOD yif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
565,
62,
397,
499,
18300,
62,
15252,
62,
11215,
457,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
331,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
9186,
220,
220,
220,
220,
41876,
331,
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,
23255,
37,
2246,
1546,
331,
361,
62,
397,
499,
18300,
62,
15252,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
6941,
62,
48991,
62,
9945,
41876,
4526,
37,
5390,
2134,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
285,
85,
62,
3672,
220,
220,
41876,
269,
406,
49494,
1542,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
331,
565,
62,
397,
499,
18300,
62,
15252,
62,
11215,
457,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
628,
220,
220,
220,
2208,
3784,
41571,
273,
7,
318,
62,
9186,
220,
220,
220,
220,
796,
318,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16129,
796,
21628,
62,
16129,
6739,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42815,
337,
36252,
19203,
5097,
62,
34,
7378,
62,
51,
3620,
6489,
6158,
11537,
14804,
10786,
50,
62,
18851,
62,
11012,
62,
26861,
7597,
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,
374,
62,
5420,
62,
9945,
62,
15526,
796,
6941,
62,
48991,
62,
9945,
13,
628,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
15763,
13,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
220,
220,
285,
85,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
331,
361,
62,
397,
499,
18300,
62,
15252,
93,
40985,
62,
1525,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
48991,
62,
28243,
41876,
4526,
37,
5390,
2134,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42815,
337,
36252,
19203,
5097,
62,
34,
7378,
62,
51,
3620,
6489,
6158,
11537,
14804,
10786,
50,
62,
43387,
6158,
62,
10913,
2662,
62,
11012,
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,
1312,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
796,
285,
85,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
9641,
220,
220,
220,
220,
220,
796,
705,
32,
6,
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,
374,
62,
5420,
62,
28243,
796,
2376,
62,
48991,
62,
28243,
13,
628,
220,
220,
220,
220,
220,
220,
220,
42815,
337,
36252,
2376,
62,
48991,
62,
28243,
3784,
10786,
5064,
62,
34,
7378,
62,
51,
3620,
6489,
6158,
62,
24706,
93,
18851,
62,
3398,
27746,
62,
29904,
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,
374,
62,
7220,
796,
374,
85,
62,
7220,
13,
628,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
15763,
13,
198,
220,
220,
220,
220,
220,
220,
220,
331,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
34,
7378,
51,
407,
4855,
6,
6739,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
331,
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,
331,
565,
62,
397,
499,
18300,
62,
785,
1845,
1653,
62,
8423,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
331,
361,
62,
397,
499,
18300,
62,
15252,
93,
33678,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
2934,
33342,
41876,
450,
499,
62,
30388,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42815,
337,
36252,
6941,
62,
48991,
62,
9945,
3784,
10786,
5064,
62,
34,
7378,
62,
51,
3620,
6489,
6158,
62,
11012,
93,
7206,
2538,
9328,
62,
51,
3620,
6489,
6158,
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,
1312,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
796,
285,
85,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
9641,
220,
220,
220,
220,
796,
705,
32,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
2704,
70,
62,
25677,
220,
796,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
2704,
70,
62,
6615,
220,
220,
796,
450,
499,
62,
7942,
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,
374,
62,
2704,
70,
62,
2934,
33342,
796,
300,
85,
62,
2934,
33342,
13,
628,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
15763,
13,
198,
220,
220,
220,
220,
220,
220,
220,
331,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
34,
7378,
51,
407,
4855,
6,
6739,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 ltcl_test DEFINITION DEFERRED.
CLASS zcl_aoc_check_35 DEFINITION LOCAL FRIENDS ltcl_test.
CLASS ltcl_test DEFINITION FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS
FINAL.
PRIVATE SECTION.
METHODS:
setup,
export_import FOR TESTING,
analyze FOR TESTING.
DATA: mo_check TYPE REF TO zcl_aoc_check_35.
ENDCLASS. "ltcl_Test
CLASS ltcl_test IMPLEMENTATION.
METHOD setup.
CREATE OBJECT mo_check.
ENDMETHOD. "setup
METHOD export_import.
zcl_aoc_unit_test=>export_import( mo_check ).
ENDMETHOD.
METHOD analyze.
* it is difficult to do both positive and negative test for this check
DATA: lv_code TYPE sci_errc,
lt_t100 TYPE zcl_aoc_check_35=>ty_t100_tt.
FIELD-SYMBOLS: <ls_t100> LIKE LINE OF lt_t100.
APPEND INITIAL LINE TO lt_t100 ASSIGNING <ls_t100>.
<ls_t100>-arbgb = 'ZAOC_TEST'.
<ls_t100>-msgnr = '123'.
lv_code = mo_check->analyze( lt_t100 ).
cl_abap_unit_assert=>assert_equals(
act = lv_code
exp = '001' ).
mo_check->get_message_text(
p_test = ''
p_code = lv_code ).
ENDMETHOD.
ENDCLASS.
| [
198,
31631,
300,
83,
565,
62,
9288,
5550,
20032,
17941,
23449,
1137,
22083,
13,
198,
31631,
1976,
565,
62,
64,
420,
62,
9122,
62,
2327,
5550,
20032,
17941,
37347,
1847,
48167,
1677,
5258,
300,
83,
565,
62,
9288,
13,
198,
198,
31631,
300,
83,
565,
62,
9288,
5550,
20032,
17941,
7473,
43001,
2751,
198,
220,
220,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
220,
220,
45698,
42,
49277,
43638,
5805,
7597,
198,
220,
220,
220,
25261,
13,
628,
220,
4810,
3824,
6158,
44513,
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,
16602,
7473,
43001,
2751,
13,
628,
220,
220,
220,
42865,
25,
6941,
62,
9122,
41876,
4526,
37,
5390,
1976,
565,
62,
64,
420,
62,
9122,
62,
2327,
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,
9058,
13,
198,
220,
220,
220,
29244,
6158,
25334,
23680,
6941,
62,
9122,
13,
198,
220,
23578,
49273,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
40406,
628,
220,
337,
36252,
10784,
62,
11748,
13,
198,
220,
220,
220,
1976,
565,
62,
64,
420,
62,
20850,
62,
9288,
14804,
39344,
62,
11748,
7,
6941,
62,
9122,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
16602,
13,
198,
9,
340,
318,
2408,
284,
466,
1111,
3967,
290,
4633,
1332,
329,
428,
2198,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
8189,
41876,
20681,
62,
263,
6015,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
83,
3064,
41876,
1976,
565,
62,
64,
420,
62,
9122,
62,
2327,
14804,
774,
62,
83,
3064,
62,
926,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
7278,
62,
83,
3064,
29,
34178,
48920,
3963,
300,
83,
62,
83,
3064,
13,
628,
198,
220,
220,
220,
43504,
10619,
3268,
2043,
12576,
48920,
5390,
300,
83,
62,
83,
3064,
24994,
3528,
15871,
1279,
7278,
62,
83,
3064,
28401,
198,
220,
220,
220,
1279,
7278,
62,
83,
3064,
29,
12,
38039,
22296,
796,
705,
34892,
4503,
62,
51,
6465,
4458,
198,
220,
220,
220,
1279,
7278,
62,
83,
3064,
29,
12,
907,
4593,
81,
796,
705,
10163,
4458,
628,
220,
220,
220,
300,
85,
62,
8189,
796,
6941,
62,
9122,
3784,
38200,
2736,
7,
300,
83,
62,
83,
3064,
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,
719,
796,
300,
85,
62,
8189,
198,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
705,
8298,
6,
6739,
628,
220,
220,
220,
6941,
62,
9122,
3784,
1136,
62,
20500,
62,
5239,
7,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
9288,
796,
10148,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
8189,
796,
300,
85,
62,
8189,
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,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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_repo DEFINITION
PUBLIC
ABSTRACT
CREATE PUBLIC .
PUBLIC SECTION.
METHODS bind_listener
IMPORTING
!ii_listener TYPE REF TO zif_abapgit_repo_listener .
METHODS deserialize_checks
RETURNING
VALUE(rs_checks) TYPE zif_abapgit_definitions=>ty_deserialize_checks
RAISING
zcx_abapgit_exception .
METHODS delete_checks
RETURNING
VALUE(rs_checks) TYPE zif_abapgit_definitions=>ty_delete_checks
RAISING
zcx_abapgit_exception .
METHODS constructor
IMPORTING
!is_data TYPE zif_abapgit_persistence=>ty_repo .
METHODS get_key
RETURNING
VALUE(rv_key) TYPE zif_abapgit_persistence=>ty_value .
METHODS get_name
RETURNING
VALUE(rv_name) TYPE string
RAISING
zcx_abapgit_exception .
METHODS get_files_local
IMPORTING
!ii_log TYPE REF TO zif_abapgit_log OPTIONAL
!it_filter TYPE zif_abapgit_definitions=>ty_tadir_tt OPTIONAL
RETURNING
VALUE(rt_files) TYPE zif_abapgit_definitions=>ty_files_item_tt
RAISING
zcx_abapgit_exception .
METHODS get_local_checksums_per_file
RETURNING
VALUE(rt_checksums) TYPE zif_abapgit_definitions=>ty_file_signatures_tt .
METHODS get_files_remote
RETURNING
VALUE(rt_files) TYPE zif_abapgit_definitions=>ty_files_tt
RAISING
zcx_abapgit_exception .
METHODS get_package
RETURNING
VALUE(rv_package) TYPE zif_abapgit_persistence=>ty_repo-package .
METHODS get_dot_abapgit
RETURNING
VALUE(ro_dot_abapgit) TYPE REF TO zcl_abapgit_dot_abapgit .
METHODS set_dot_abapgit
IMPORTING
!io_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit
RAISING
zcx_abapgit_exception .
METHODS get_dot_apack
RETURNING
VALUE(ro_dot_apack) TYPE REF TO zcl_abapgit_apack_reader .
METHODS deserialize
IMPORTING
!is_checks TYPE zif_abapgit_definitions=>ty_deserialize_checks
!ii_log TYPE REF TO zif_abapgit_log
RAISING
zcx_abapgit_exception .
METHODS refresh
IMPORTING
!iv_drop_cache TYPE abap_bool DEFAULT abap_false
RAISING
zcx_abapgit_exception .
METHODS update_local_checksums
IMPORTING
!it_files TYPE zif_abapgit_definitions=>ty_file_signatures_tt
RAISING
zcx_abapgit_exception .
METHODS rebuild_local_checksums
RAISING
zcx_abapgit_exception .
METHODS find_remote_dot_abapgit
RETURNING
VALUE(ro_dot) TYPE REF TO zcl_abapgit_dot_abapgit
RAISING
zcx_abapgit_exception .
METHODS find_remote_dot_apack
RETURNING
VALUE(ro_dot) TYPE REF TO zcl_abapgit_apack_reader
RAISING
zcx_abapgit_exception .
METHODS is_offline
RETURNING
VALUE(rv_offline) TYPE abap_bool
RAISING
zcx_abapgit_exception .
METHODS set_files_remote
IMPORTING
!it_files TYPE zif_abapgit_definitions=>ty_files_tt .
METHODS get_local_settings
RETURNING
VALUE(rs_settings) TYPE zif_abapgit_persistence=>ty_repo-local_settings .
METHODS set_local_settings
IMPORTING
!is_settings TYPE zif_abapgit_persistence=>ty_repo-local_settings
RAISING
zcx_abapgit_exception .
METHODS has_remote_source
ABSTRACT
RETURNING
VALUE(rv_yes) TYPE abap_bool .
METHODS status
IMPORTING
!ii_log TYPE REF TO zif_abapgit_log OPTIONAL
RETURNING
VALUE(rt_results) TYPE zif_abapgit_definitions=>ty_results_tt
RAISING
zcx_abapgit_exception .
METHODS switch_repo_type
IMPORTING
!iv_offline TYPE abap_bool
RAISING
zcx_abapgit_exception .
METHODS create_new_log
IMPORTING
!iv_title TYPE string OPTIONAL
RETURNING
VALUE(ri_log) TYPE REF TO zif_abapgit_log .
METHODS get_log
RETURNING
VALUE(ri_log) TYPE REF TO zif_abapgit_log .
METHODS reset_log .
METHODS refresh_local_object
IMPORTING
!iv_obj_type TYPE tadir-object
!iv_obj_name TYPE tadir-obj_name
RAISING
zcx_abapgit_exception .
METHODS refresh_local_objects
RAISING
zcx_abapgit_exception .
METHODS reset_status .
METHODS validate
ABSTRACT
RAISING
zcx_abapgit_exception .
METHODS reset
ABSTRACT
RAISING
zcx_abapgit_exception .
PROTECTED SECTION.
DATA mt_local TYPE zif_abapgit_definitions=>ty_files_item_tt .
DATA mt_remote TYPE zif_abapgit_definitions=>ty_files_tt .
DATA mv_request_local_refresh TYPE abap_bool .
DATA ms_data TYPE zif_abapgit_persistence=>ty_repo .
DATA mv_request_remote_refresh TYPE abap_bool .
DATA mt_status TYPE zif_abapgit_definitions=>ty_results_tt .
DATA mi_log TYPE REF TO zif_abapgit_log .
METHODS set_dot_apack
IMPORTING
!io_dot_apack TYPE REF TO zcl_abapgit_apack_reader
RAISING
zcx_abapgit_exception .
METHODS set
IMPORTING
!it_checksums TYPE zif_abapgit_persistence=>ty_local_checksum_tt OPTIONAL
!iv_url TYPE zif_abapgit_persistence=>ty_repo-url OPTIONAL
!iv_branch_name TYPE zif_abapgit_persistence=>ty_repo-branch_name OPTIONAL
!iv_head_branch TYPE zif_abapgit_persistence=>ty_repo-head_branch OPTIONAL
!iv_offline TYPE zif_abapgit_persistence=>ty_repo-offline OPTIONAL
!is_dot_abapgit TYPE zif_abapgit_persistence=>ty_repo-dot_abapgit OPTIONAL
!is_local_settings TYPE zif_abapgit_persistence=>ty_repo-local_settings OPTIONAL
!iv_deserialized_at TYPE zif_abapgit_persistence=>ty_repo-deserialized_at OPTIONAL
!iv_deserialized_by TYPE zif_abapgit_persistence=>ty_repo-deserialized_by OPTIONAL
!iv_switched_origin TYPE zif_abapgit_persistence=>ty_repo-switched_origin OPTIONAL
RAISING
zcx_abapgit_exception .
METHODS reset_remote .
PRIVATE SECTION.
DATA mi_listener TYPE REF TO zif_abapgit_repo_listener.
DATA mo_apack_reader TYPE REF TO zcl_abapgit_apack_reader.
METHODS get_local_checksums
RETURNING
VALUE(rt_checksums) TYPE zif_abapgit_persistence=>ty_local_checksum_tt .
METHODS notify_listener
IMPORTING
!is_change_mask TYPE zif_abapgit_persistence=>ty_repo_meta_mask
RAISING
zcx_abapgit_exception .
METHODS build_dotabapgit_file
RETURNING
VALUE(rs_file) TYPE zif_abapgit_definitions=>ty_file
RAISING
zcx_abapgit_exception .
METHODS build_apack_manifest_file
RETURNING
VALUE(rs_file) TYPE zif_abapgit_definitions=>ty_file
RAISING
zcx_abapgit_exception .
METHODS update_last_deserialize
RAISING
zcx_abapgit_exception .
METHODS check_for_restart .
ENDCLASS.
CLASS ZCL_ABAPGIT_REPO IMPLEMENTATION.
METHOD bind_listener.
mi_listener = ii_listener.
ENDMETHOD.
METHOD build_apack_manifest_file.
DATA: lo_manifest_reader TYPE REF TO zcl_abapgit_apack_reader,
ls_descriptor TYPE zif_abapgit_apack_definitions=>ty_descriptor,
lo_manifest_writer TYPE REF TO zcl_abapgit_apack_writer.
lo_manifest_reader = zcl_abapgit_apack_reader=>create_instance( ms_data-package ).
IF lo_manifest_reader->has_manifest( ) = abap_true.
ls_descriptor = lo_manifest_reader->get_manifest_descriptor( ).
lo_manifest_writer = zcl_abapgit_apack_writer=>create_instance( ls_descriptor ).
rs_file-path = zif_abapgit_definitions=>c_root_dir.
rs_file-filename = zif_abapgit_apack_definitions=>c_dot_apack_manifest.
rs_file-data = zcl_abapgit_convert=>string_to_xstring_utf8( lo_manifest_writer->serialize( ) ).
rs_file-sha1 = zcl_abapgit_hash=>sha1( iv_type = zif_abapgit_definitions=>c_type-blob
iv_data = rs_file-data ).
ENDIF.
ENDMETHOD.
METHOD build_dotabapgit_file.
rs_file-path = zif_abapgit_definitions=>c_root_dir.
rs_file-filename = zif_abapgit_definitions=>c_dot_abapgit.
rs_file-data = get_dot_abapgit( )->serialize( ).
rs_file-sha1 = zcl_abapgit_hash=>sha1( iv_type = zif_abapgit_definitions=>c_type-blob
iv_data = rs_file-data ).
ENDMETHOD.
METHOD check_for_restart.
CONSTANTS:
lc_abapgit_prog TYPE progname VALUE `ZABAPGIT`.
" If abapGit was used to update itself, then restart to avoid LOAD_PROGRAM_&_MISMATCH dumps
" because abapGit code was changed at runtime
IF zcl_abapgit_ui_factory=>get_gui_functions( )->gui_is_available( ) = abap_true AND
zcl_abapgit_url=>is_abapgit_repo( ms_data-url ) = abap_true AND
sy-batch = abap_false AND
sy-cprog = lc_abapgit_prog.
MESSAGE 'abapGit was updated and will restart itself' TYPE 'I'.
SUBMIT (sy-cprog).
ENDIF.
ENDMETHOD.
METHOD constructor.
ASSERT NOT is_data-key IS INITIAL.
ms_data = is_data.
mv_request_remote_refresh = abap_true.
ENDMETHOD.
METHOD create_new_log.
CREATE OBJECT mi_log TYPE zcl_abapgit_log.
mi_log->set_title( iv_title ).
ri_log = mi_log.
ENDMETHOD.
METHOD delete_checks.
DATA: li_package TYPE REF TO zif_abapgit_sap_package.
li_package = zcl_abapgit_factory=>get_sap_package( get_package( ) ).
rs_checks-transport-required = li_package->are_changes_recorded_in_tr_req( ).
ENDMETHOD.
METHOD deserialize.
DATA: lt_updated_files TYPE zif_abapgit_definitions=>ty_file_signatures_tt,
lx_error TYPE REF TO zcx_abapgit_exception.
deserialize_checks( ).
IF is_checks-requirements-met = zif_abapgit_definitions=>gc_no AND is_checks-requirements-decision IS INITIAL.
zcx_abapgit_exception=>raise( 'Requirements not met and undecided' ).
ENDIF.
IF is_checks-dependencies-met = zif_abapgit_definitions=>gc_no.
zcx_abapgit_exception=>raise( 'APACK dependencies not met' ).
ENDIF.
IF is_checks-transport-required = abap_true AND is_checks-transport-transport IS INITIAL.
zcx_abapgit_exception=>raise( |No transport request was supplied| ).
ENDIF.
TRY.
lt_updated_files = zcl_abapgit_objects=>deserialize(
io_repo = me
is_checks = is_checks
ii_log = ii_log ).
CATCH zcx_abapgit_exception INTO lx_error.
* ensure to reset default transport request task
zcl_abapgit_default_transport=>get_instance( )->reset( ).
RAISE EXCEPTION lx_error.
ENDTRY.
APPEND get_dot_abapgit( )->get_signature( ) TO lt_updated_files.
CLEAR: mt_local.
update_local_checksums( lt_updated_files ).
update_last_deserialize( ).
reset_status( ).
COMMIT WORK AND WAIT.
check_for_restart( ).
ENDMETHOD.
METHOD deserialize_checks.
DATA: lt_requirements TYPE zif_abapgit_dot_abapgit=>ty_requirement_tt,
lt_dependencies TYPE zif_abapgit_apack_definitions=>tt_dependencies,
lv_master_language TYPE spras,
lv_logon_language TYPE spras.
find_remote_dot_abapgit( ).
find_remote_dot_apack( ).
lv_master_language = get_dot_abapgit( )->get_master_language( ).
lv_logon_language = sy-langu.
IF get_local_settings( )-write_protected = abap_true.
zcx_abapgit_exception=>raise( 'Cannot deserialize. Local code is write-protected by repo config' ).
ELSEIF lv_master_language <> lv_logon_language.
zcx_abapgit_exception=>raise( |Current login language |
&& |'{ zcl_abapgit_convert=>conversion_exit_isola_output( lv_logon_language ) }'|
&& | does not match master language |
&& |'{ zcl_abapgit_convert=>conversion_exit_isola_output( lv_master_language ) }'.|
&& | Run 'Advanced' > 'Open in master language'| ).
ENDIF.
rs_checks = zcl_abapgit_objects=>deserialize_checks( me ).
lt_requirements = get_dot_abapgit( )->get_data( )-requirements.
rs_checks-requirements-met = zcl_abapgit_requirement_helper=>is_requirements_met( lt_requirements ).
lt_dependencies = get_dot_apack( )->get_manifest_descriptor( )-dependencies.
rs_checks-dependencies-met = zcl_abapgit_apack_helper=>are_dependencies_met( lt_dependencies ).
ENDMETHOD.
METHOD find_remote_dot_abapgit.
FIELD-SYMBOLS: <ls_remote> LIKE LINE OF mt_remote.
get_files_remote( ).
READ TABLE mt_remote ASSIGNING <ls_remote>
WITH KEY path = zif_abapgit_definitions=>c_root_dir
filename = zif_abapgit_definitions=>c_dot_abapgit.
IF sy-subrc = 0.
ro_dot = zcl_abapgit_dot_abapgit=>deserialize( <ls_remote>-data ).
set_dot_abapgit( ro_dot ).
COMMIT WORK AND WAIT. " to release lock
ELSEIF lines( mt_remote ) > 3.
" Less files means it's a new repo (with just readme and license, for example) which is ok
zcx_abapgit_exception=>raise( |Cannot find .abapgit.xml - Is this an abapGit repo?| ).
ENDIF.
ENDMETHOD.
METHOD find_remote_dot_apack.
FIELD-SYMBOLS: <ls_remote> LIKE LINE OF mt_remote.
get_files_remote( ).
READ TABLE mt_remote ASSIGNING <ls_remote>
WITH KEY path = zif_abapgit_definitions=>c_root_dir
filename = zif_abapgit_apack_definitions=>c_dot_apack_manifest.
IF sy-subrc = 0.
ro_dot = zcl_abapgit_apack_reader=>deserialize( iv_package_name = ms_data-package
iv_xstr = <ls_remote>-data ).
set_dot_apack( ro_dot ).
ENDIF.
ENDMETHOD.
METHOD get_dot_abapgit.
CREATE OBJECT ro_dot_abapgit
EXPORTING
is_data = ms_data-dot_abapgit.
ENDMETHOD.
METHOD get_dot_apack.
IF mo_apack_reader IS NOT BOUND.
mo_apack_reader = zcl_abapgit_apack_reader=>create_instance( ms_data-package ).
ENDIF.
ro_dot_apack = mo_apack_reader.
ENDMETHOD.
METHOD get_files_local.
DATA: lo_filter TYPE REF TO zcl_abapgit_repo_filter,
lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt,
lo_serialize TYPE REF TO zcl_abapgit_serialize,
lt_found LIKE rt_files,
lv_force TYPE abap_bool,
ls_apack_file TYPE zif_abapgit_definitions=>ty_file.
FIELD-SYMBOLS: <ls_return> LIKE LINE OF rt_files.
" Serialization happened before and no refresh request
IF lines( mt_local ) > 0 AND mv_request_local_refresh = abap_false.
rt_files = mt_local.
RETURN.
ENDIF.
APPEND INITIAL LINE TO rt_files ASSIGNING <ls_return>.
<ls_return>-file = build_dotabapgit_file( ).
ls_apack_file = build_apack_manifest_file( ).
IF ls_apack_file IS NOT INITIAL.
APPEND INITIAL LINE TO rt_files ASSIGNING <ls_return>.
<ls_return>-file = ls_apack_file.
ENDIF.
lt_tadir = zcl_abapgit_factory=>get_tadir( )->read(
iv_package = get_package( )
iv_ignore_subpackages = get_local_settings( )-ignore_subpackages
iv_only_local_objects = get_local_settings( )-only_local_objects
io_dot = get_dot_abapgit( )
ii_log = ii_log ).
CREATE OBJECT lo_filter
EXPORTING
iv_package = get_package( ).
lo_filter->apply( EXPORTING it_filter = it_filter
CHANGING ct_tadir = lt_tadir ).
CREATE OBJECT lo_serialize
EXPORTING
iv_serialize_master_lang_only = ms_data-local_settings-serialize_master_lang_only.
* if there are less than 10 objects run in single thread
* this helps a lot when debugging, plus performance gain
* with low number of objects does not matter much
lv_force = boolc( lines( lt_tadir ) < 10 ).
lt_found = lo_serialize->serialize(
it_tadir = lt_tadir
iv_language = get_dot_abapgit( )->get_master_language( )
ii_log = ii_log
iv_force_sequential = lv_force ).
APPEND LINES OF lt_found TO rt_files.
mt_local = rt_files.
mv_request_local_refresh = abap_false. " Fulfill refresh
ENDMETHOD.
METHOD get_files_remote.
rt_files = mt_remote.
ENDMETHOD.
METHOD get_key.
rv_key = ms_data-key.
ENDMETHOD.
METHOD get_local_checksums.
rt_checksums = ms_data-local_checksums.
ENDMETHOD.
METHOD get_local_checksums_per_file.
FIELD-SYMBOLS <ls_object> LIKE LINE OF ms_data-local_checksums.
LOOP AT ms_data-local_checksums ASSIGNING <ls_object>.
" Check if item exists
READ TABLE mt_local TRANSPORTING NO FIELDS
WITH KEY item = <ls_object>-item.
IF sy-subrc = 0.
APPEND LINES OF <ls_object>-files TO rt_checksums.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD get_local_settings.
rs_settings = ms_data-local_settings.
ENDMETHOD.
METHOD get_log.
ri_log = mi_log.
ENDMETHOD.
METHOD get_name.
rv_name = ms_data-local_settings-display_name.
ENDMETHOD.
METHOD get_package.
rv_package = ms_data-package.
ENDMETHOD.
METHOD is_offline.
rv_offline = ms_data-offline.
ENDMETHOD.
METHOD notify_listener.
DATA ls_meta_slug TYPE zif_abapgit_persistence=>ty_repo_xml.
IF mi_listener IS BOUND.
MOVE-CORRESPONDING ms_data TO ls_meta_slug.
mi_listener->on_meta_change(
iv_key = ms_data-key
is_meta = ls_meta_slug
is_change_mask = is_change_mask ).
ENDIF.
ENDMETHOD.
METHOD rebuild_local_checksums.
DATA:
lt_local TYPE zif_abapgit_definitions=>ty_files_item_tt,
ls_last_item TYPE zif_abapgit_definitions=>ty_item,
lt_checksums TYPE zif_abapgit_persistence=>ty_local_checksum_tt.
FIELD-SYMBOLS:
<ls_checksum> LIKE LINE OF lt_checksums,
<ls_file_sig> LIKE LINE OF <ls_checksum>-files,
<ls_local> LIKE LINE OF lt_local.
lt_local = get_files_local( ).
DELETE lt_local " Remove non-code related files except .abapgit
WHERE item IS INITIAL
AND NOT ( file-path = zif_abapgit_definitions=>c_root_dir
AND file-filename = zif_abapgit_definitions=>c_dot_abapgit ).
SORT lt_local BY item.
LOOP AT lt_local ASSIGNING <ls_local>.
IF ls_last_item <> <ls_local>-item OR sy-tabix = 1. " First or New item reached ?
APPEND INITIAL LINE TO lt_checksums ASSIGNING <ls_checksum>.
<ls_checksum>-item = <ls_local>-item.
ls_last_item = <ls_local>-item.
ENDIF.
APPEND INITIAL LINE TO <ls_checksum>-files ASSIGNING <ls_file_sig>.
MOVE-CORRESPONDING <ls_local>-file TO <ls_file_sig>.
ENDLOOP.
set( it_checksums = lt_checksums ).
reset_status( ).
ENDMETHOD.
METHOD refresh.
mv_request_local_refresh = abap_true.
reset_remote( ).
CLEAR mi_log.
IF iv_drop_cache = abap_true.
CLEAR: mt_local.
ENDIF.
ENDMETHOD.
METHOD refresh_local_object.
DATA:
ls_tadir TYPE zif_abapgit_definitions=>ty_tadir,
lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt,
lt_new_local_files TYPE zif_abapgit_definitions=>ty_files_item_tt,
lo_serialize TYPE REF TO zcl_abapgit_serialize.
lt_tadir = zcl_abapgit_factory=>get_tadir( )->read(
iv_package = ms_data-package
io_dot = get_dot_abapgit( ) ).
DELETE mt_local WHERE item-obj_type = iv_obj_type
AND item-obj_name = iv_obj_name.
READ TABLE lt_tadir INTO ls_tadir
WITH KEY object = iv_obj_type
obj_name = iv_obj_name.
IF sy-subrc <> 0 OR ls_tadir-delflag = abap_true.
" object doesn't exist anymore, nothing todo here
RETURN.
ENDIF.
CLEAR lt_tadir.
INSERT ls_tadir INTO TABLE lt_tadir.
CREATE OBJECT lo_serialize.
lt_new_local_files = lo_serialize->serialize( lt_tadir ).
INSERT LINES OF lt_new_local_files INTO TABLE mt_local.
ENDMETHOD.
METHOD refresh_local_objects.
mv_request_local_refresh = abap_true.
get_files_local( ).
ENDMETHOD.
METHOD reset_log.
CLEAR mi_log.
ENDMETHOD.
METHOD reset_remote.
CLEAR mt_remote.
mv_request_remote_refresh = abap_true.
reset_status( ).
ENDMETHOD.
METHOD reset_status.
CLEAR mt_status.
ENDMETHOD.
METHOD set.
* TODO: refactor, maybe use zcl_abapgit_string_map ?
DATA: ls_mask TYPE zif_abapgit_persistence=>ty_repo_meta_mask.
ASSERT it_checksums IS SUPPLIED
OR iv_url IS SUPPLIED
OR iv_branch_name IS SUPPLIED
OR iv_head_branch IS SUPPLIED
OR iv_offline IS SUPPLIED
OR is_dot_abapgit IS SUPPLIED
OR is_local_settings IS SUPPLIED
OR iv_deserialized_by IS SUPPLIED
OR iv_deserialized_at IS SUPPLIED
OR iv_switched_origin IS SUPPLIED.
IF it_checksums IS SUPPLIED.
ms_data-local_checksums = it_checksums.
ls_mask-local_checksums = abap_true.
ENDIF.
IF iv_url IS SUPPLIED.
ms_data-url = iv_url.
ls_mask-url = abap_true.
ENDIF.
IF iv_branch_name IS SUPPLIED.
ms_data-branch_name = iv_branch_name.
ls_mask-branch_name = abap_true.
ENDIF.
IF iv_head_branch IS SUPPLIED.
ms_data-head_branch = iv_head_branch.
ls_mask-head_branch = abap_true.
ENDIF.
IF iv_offline IS SUPPLIED.
ms_data-offline = iv_offline.
ls_mask-offline = abap_true.
ENDIF.
IF is_dot_abapgit IS SUPPLIED.
ms_data-dot_abapgit = is_dot_abapgit.
ls_mask-dot_abapgit = abap_true.
ENDIF.
IF is_local_settings IS SUPPLIED.
ms_data-local_settings = is_local_settings.
ls_mask-local_settings = abap_true.
ENDIF.
IF iv_deserialized_at IS SUPPLIED OR iv_deserialized_by IS SUPPLIED.
ms_data-deserialized_at = iv_deserialized_at.
ms_data-deserialized_by = iv_deserialized_by.
ls_mask-deserialized_at = abap_true.
ls_mask-deserialized_by = abap_true.
ENDIF.
IF iv_switched_origin IS SUPPLIED.
ms_data-switched_origin = iv_switched_origin.
ls_mask-switched_origin = abap_true.
ENDIF.
notify_listener( ls_mask ).
ENDMETHOD.
METHOD set_dot_abapgit.
set( is_dot_abapgit = io_dot_abapgit->get_data( ) ).
ENDMETHOD.
METHOD set_dot_apack.
get_dot_apack( ).
mo_apack_reader->set_manifest_descriptor( io_dot_apack->get_manifest_descriptor( ) ).
ENDMETHOD.
METHOD set_files_remote.
mt_remote = it_files.
mv_request_remote_refresh = abap_false.
ENDMETHOD.
METHOD set_local_settings.
set( is_local_settings = is_settings ).
ENDMETHOD.
METHOD status.
IF lines( mt_status ) = 0.
mt_status = zcl_abapgit_file_status=>status(
io_repo = me
ii_log = ii_log ).
ENDIF.
rt_results = mt_status.
ENDMETHOD.
METHOD switch_repo_type.
IF iv_offline = ms_data-offline.
zcx_abapgit_exception=>raise( |Cannot switch_repo_type, offline already = "{ ms_data-offline }"| ).
ENDIF.
IF iv_offline = abap_true. " On-line -> OFFline
set(
iv_url = zcl_abapgit_url=>name( ms_data-url )
iv_branch_name = ''
iv_head_branch = ''
iv_offline = abap_true ).
ELSE. " OFFline -> On-line
set( iv_offline = abap_false ).
ENDIF.
ENDMETHOD.
METHOD update_last_deserialize.
DATA: lv_deserialized_at TYPE zif_abapgit_persistence=>ty_repo-deserialized_at,
lv_deserialized_by TYPE zif_abapgit_persistence=>ty_repo-deserialized_by.
GET TIME STAMP FIELD lv_deserialized_at.
lv_deserialized_by = sy-uname.
set( iv_deserialized_at = lv_deserialized_at
iv_deserialized_by = lv_deserialized_by ).
ENDMETHOD.
METHOD update_local_checksums.
" ASSUMTION: SHA1 in param is actual and correct.
" Push fills it from local files before pushing, deserialize from remote
" If this is not true that there is an error somewhere but not here
DATA: lt_checksums TYPE zif_abapgit_persistence=>ty_local_checksum_tt,
lt_files_idx TYPE zif_abapgit_definitions=>ty_file_signatures_tt,
lt_local TYPE zif_abapgit_definitions=>ty_files_item_tt,
lv_chks_row TYPE i,
lv_file_row TYPE i.
FIELD-SYMBOLS: <ls_checksum> LIKE LINE OF lt_checksums,
<ls_file> LIKE LINE OF <ls_checksum>-files,
<ls_local> LIKE LINE OF lt_local,
<ls_new_state> LIKE LINE OF it_files.
lt_checksums = get_local_checksums( ).
lt_files_idx = it_files.
SORT lt_files_idx BY path filename. " Sort for binary search
" Loop through current chacksum state, update sha1 for common files
LOOP AT lt_checksums ASSIGNING <ls_checksum>.
lv_chks_row = sy-tabix.
LOOP AT <ls_checksum>-files ASSIGNING <ls_file>.
lv_file_row = sy-tabix.
READ TABLE lt_files_idx ASSIGNING <ls_new_state>
WITH KEY path = <ls_file>-path filename = <ls_file>-filename
BINARY SEARCH.
CHECK sy-subrc = 0. " Missing in param table, skip
IF <ls_new_state>-sha1 IS INITIAL. " Empty input sha1 is a deletion marker
DELETE <ls_checksum>-files INDEX lv_file_row.
ELSE.
<ls_file>-sha1 = <ls_new_state>-sha1. " Update sha1
CLEAR <ls_new_state>-sha1. " Mark as processed
ENDIF.
ENDLOOP.
IF lines( <ls_checksum>-files ) = 0. " Remove empty objects
DELETE lt_checksums INDEX lv_chks_row.
ENDIF.
ENDLOOP.
DELETE lt_files_idx WHERE sha1 IS INITIAL. " Remove processed
IF lines( lt_files_idx ) > 0.
lt_local = get_files_local( ).
SORT lt_local BY file-path file-filename. " Sort for binary search
ENDIF.
" Add new files - not deleted and not marked as processed above
LOOP AT lt_files_idx ASSIGNING <ls_new_state>.
READ TABLE lt_local ASSIGNING <ls_local>
WITH KEY file-path = <ls_new_state>-path file-filename = <ls_new_state>-filename
BINARY SEARCH.
IF sy-subrc <> 0.
* if the deserialization fails, the local file might not be there
CONTINUE.
ENDIF.
READ TABLE lt_checksums ASSIGNING <ls_checksum> " TODO Optimize
WITH KEY item = <ls_local>-item.
IF sy-subrc > 0.
APPEND INITIAL LINE TO lt_checksums ASSIGNING <ls_checksum>.
<ls_checksum>-item = <ls_local>-item.
ENDIF.
APPEND <ls_new_state> TO <ls_checksum>-files.
ENDLOOP.
SORT lt_checksums BY item.
set( it_checksums = lt_checksums ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
9564,
18601,
10659,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
11007,
62,
4868,
877,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
4868,
877,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
260,
7501,
62,
4868,
877,
764,
198,
220,
220,
220,
337,
36252,
50,
748,
48499,
1096,
62,
42116,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
42116,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
8906,
48499,
1096,
62,
42116,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
12233,
62,
42116,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
42116,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
33678,
62,
42116,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
7890,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
2539,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
2539,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
8367,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
3672,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
3672,
8,
41876,
4731,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
16624,
62,
12001,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
6404,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
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,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
16624,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
16624,
62,
9186,
62,
926,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
12001,
62,
42116,
5700,
62,
525,
62,
7753,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
42116,
5700,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
7753,
62,
12683,
6691,
62,
926,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
16624,
62,
47960,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
16624,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
16624,
62,
926,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
26495,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
26495,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
19276,
13274,
14804,
774,
62,
260,
7501,
12,
26495,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
26518,
62,
397,
499,
18300,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
26518,
62,
397,
499,
18300,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
764,
198,
220,
220,
220,
337,
36252,
50,
900,
62,
26518,
62,
397,
499,
18300,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
952,
62,
26518,
62,
397,
499,
18300,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
26518,
62,
499,
441,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
305,
62,
26518,
62,
499,
441,
8,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
499,
441,
62,
46862,
764,
198,
220,
220,
220,
337,
36252,
50,
748,
48499,
1096,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
271,
62,
42116,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
8906,
48499,
1096,
62,
42116,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
6404,
220,
220,
220,
41876
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS /dmo/cl_travel_auxiliary04 DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
* Type definition for import parameters --------------------------
TYPES tt_travel_create TYPE TABLE FOR CREATE /dmo/i_travel_u04.
TYPES tt_travel_update TYPE TABLE FOR UPDATE /dmo/i_travel_u04.
TYPES tt_travel_delete TYPE TABLE FOR DELETE /dmo/i_travel_u04.
TYPES tt_travel_failed TYPE TABLE FOR FAILED /dmo/i_travel_u04.
TYPES tt_travel_mapped TYPE TABLE FOR MAPPED /dmo/i_travel_u04.
TYPES tt_travel_reported TYPE TABLE FOR REPORTED /dmo/i_travel_u04.
TYPES tt_booking_create TYPE TABLE FOR CREATE /dmo/i_booking_u04.
TYPES tt_booking_update TYPE TABLE FOR UPDATE /dmo/i_booking_u04.
TYPES tt_booking_delete TYPE TABLE FOR DELETE /dmo/i_booking_u04.
TYPES tt_booking_failed TYPE TABLE FOR FAILED /dmo/i_booking_u04.
TYPES tt_booking_mapped TYPE TABLE FOR MAPPED /dmo/i_booking_u04.
TYPES tt_booking_reported TYPE TABLE FOR REPORTED /dmo/i_booking_u04.
TYPES tt_bookingsupplement_failed TYPE TABLE FOR FAILED /dmo/i_bookingsupplement_u04.
TYPES tt_bookingsupplement_mapped TYPE TABLE FOR MAPPED /dmo/i_bookingsupplement_u04.
TYPES tt_bookingsupplement_reported TYPE TABLE FOR REPORTED /dmo/i_bookingsupplement_u04.
CLASS-METHODS map_travel_cds_to_db
IMPORTING is_i_travel_u TYPE /dmo/i_travel_u04
RETURNING VALUE(rs_travel) TYPE /dmo/if_flight_legacy04=>ts_travel_in.
CLASS-METHODS map_travel_message
IMPORTING iv_cid TYPE string OPTIONAL
iv_travel_id TYPE /dmo/travel_id04 OPTIONAL
is_message TYPE LINE OF /dmo/if_flight_legacy04=>tt_message
RETURNING VALUE(rs_report) TYPE LINE OF tt_travel_reported.
CLASS-METHODS map_booking_cds_to_db
IMPORTING is_i_booking TYPE /dmo/i_booking_u04
RETURNING VALUE(rs_booking) TYPE /dmo/if_flight_legacy04=>ts_booking_in.
CLASS-METHODS map_booking_message
IMPORTING iv_cid TYPE string OPTIONAL
iv_travel_id TYPE /dmo/travel_id04 OPTIONAL
iv_booking_id TYPE /dmo/booking_id04 OPTIONAL
is_message TYPE LINE OF /dmo/if_flight_legacy04=>tt_message
RETURNING VALUE(rs_report) TYPE LINE OF tt_booking_reported.
CLASS-METHODS map_bookingsupplemnt_cds_to_db
IMPORTING is_i_bookingsupplement TYPE /dmo/i_bookingsupplement_u04
RETURNING VALUE(rs_bookingsupplement) TYPE /dmo/if_flight_legacy04=>ts_booking_supplement_in.
CLASS-METHODS map_bookingsupplemnt_message
IMPORTING iv_cid TYPE string OPTIONAL
iv_travel_id TYPE /dmo/travel_id04 OPTIONAL
iv_booking_id TYPE /dmo/booking_id04 OPTIONAL
iv_bookingsupplement_id TYPE /dmo/booking_supplement_id04 OPTIONAL
is_message TYPE LINE OF /dmo/if_flight_legacy04=>tt_message
RETURNING VALUE(rs_report) TYPE LINE OF tt_bookingsupplement_reported.
PROTECTED SECTION.
PRIVATE SECTION.
CLASS-METHODS new_message
IMPORTING id TYPE symsgid
number TYPE symsgno
severity TYPE if_abap_behv_message=>t_severity
v1 TYPE simple OPTIONAL
v2 TYPE simple OPTIONAL
v3 TYPE simple OPTIONAL
v4 TYPE simple OPTIONAL
RETURNING VALUE(obj) TYPE REF TO if_abap_behv_message .
ENDCLASS.
CLASS /dmo/cl_travel_auxiliary04 IMPLEMENTATION.
METHOD map_travel_cds_to_db.
rs_travel = CORRESPONDING #( is_i_travel_u MAPPING travel_id = travelid
agency_id = agencyid
customer_id = customerid
begin_date = begindate
end_date = enddate
booking_fee = bookingfee
total_price = totalprice
currency_code = currencycode
description = memo
status = status ).
ENDMETHOD.
METHOD map_travel_message.
DATA(lo) = new_message( id = is_message-msgid
number = is_message-msgno
severity = if_abap_behv_message=>severity-error
v1 = is_message-msgv1
v2 = is_message-msgv2
v3 = is_message-msgv3
v4 = is_message-msgv4 ).
rs_report-%cid = iv_cid.
rs_report-travelid = iv_travel_id.
rs_report-%msg = lo.
ENDMETHOD.
METHOD map_booking_cds_to_db.
rs_booking = CORRESPONDING #( is_i_booking MAPPING booking_id = bookingid
booking_date = bookingdate
customer_id = customerid
carrier_id = airlineid
connection_id = connectionid
flight_date = flightdate
flight_price = flightprice
currency_code = currencycode ).
ENDMETHOD.
METHOD map_booking_message.
DATA(lo) = new_message( id = is_message-msgid
number = is_message-msgno
severity = if_abap_behv_message=>severity-error
v1 = is_message-msgv1
v2 = is_message-msgv2
v3 = is_message-msgv3
v4 = is_message-msgv4 ).
rs_report-%cid = iv_cid.
rs_report-travelid = iv_travel_id.
rs_report-bookingid = iv_booking_id.
rs_report-%msg = lo.
ENDMETHOD.
METHOD map_bookingsupplemnt_cds_to_db.
rs_bookingsupplement = CORRESPONDING #( is_i_bookingsupplement MAPPING booking_id = bookingid
booking_supplement_id = bookingsupplementid
supplement_id = supplementid
price = price
currency_code = currencycode ).
ENDMETHOD.
METHOD map_bookingsupplemnt_message.
DATA(lo) = new_message( id = is_message-msgid
number = is_message-msgno
severity = if_abap_behv_message=>severity-error
v1 = is_message-msgv1
v2 = is_message-msgv2
v3 = is_message-msgv3
v4 = is_message-msgv4 ).
rs_report-%cid = iv_cid.
rs_report-travelid = iv_travel_id.
rs_report-bookingid = iv_booking_id.
rs_report-bookingSupplementid = iv_bookingsupplement_id.
rs_report-%msg = lo.
ENDMETHOD.
METHOD new_message.
obj = NEW lcl_abap_behv_msg(
textid = VALUE #(
msgid = id
msgno = number
attr1 = COND #( WHEN v1 IS NOT INITIAL THEN 'IF_T100_DYN_MSG~MSGV1' )
attr2 = COND #( WHEN v2 IS NOT INITIAL THEN 'IF_T100_DYN_MSG~MSGV2' )
attr3 = COND #( WHEN v3 IS NOT INITIAL THEN 'IF_T100_DYN_MSG~MSGV3' )
attr4 = COND #( WHEN v4 IS NOT INITIAL THEN 'IF_T100_DYN_MSG~MSGV4' )
)
msgty = SWITCH #( severity
WHEN if_abap_behv_message=>severity-error THEN 'E'
WHEN if_abap_behv_message=>severity-warning THEN 'W'
WHEN if_abap_behv_message=>severity-information THEN 'I'
WHEN if_abap_behv_message=>severity-success THEN 'S' )
msgv1 = |{ v1 }|
msgv2 = |{ v2 }|
msgv3 = |{ v3 }|
msgv4 = |{ v4 }|
).
obj->m_severity = severity.
ENDMETHOD.
ENDCLASS.
| [
31631,
1220,
67,
5908,
14,
565,
62,
35927,
62,
14644,
28129,
3023,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
198,
198,
5105,
32936,
44513,
13,
628,
198,
9,
220,
220,
5994,
6770,
329,
1330,
10007,
220,
22369,
438,
198,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
35927,
62,
17953,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
43679,
7473,
29244,
6158,
220,
220,
1220,
67,
5908,
14,
72,
62,
35927,
62,
84,
3023,
13,
198,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
35927,
62,
19119,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
43679,
7473,
35717,
220,
220,
1220,
67,
5908,
14,
72,
62,
35927,
62,
84,
3023,
13,
198,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
35927,
62,
33678,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
43679,
7473,
5550,
2538,
9328,
220,
220,
1220,
67,
5908,
14,
72,
62,
35927,
62,
84,
3023,
13,
628,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
35927,
62,
47904,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
43679,
7473,
9677,
4146,
1961,
220,
220,
1220,
67,
5908,
14,
72,
62,
35927,
62,
84,
3023,
13,
198,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
35927,
62,
76,
6320,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
43679,
7473,
337,
24805,
1961,
220,
220,
1220,
67,
5908,
14,
72,
62,
35927,
62,
84,
3023,
13,
198,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
35927,
62,
26263,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
43679,
7473,
39099,
1961,
1220,
67,
5908,
14,
72,
62,
35927,
62,
84,
3023,
13,
628,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
2070,
278,
62,
17953,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
43679,
7473,
29244,
6158,
220,
220,
220,
1220,
67,
5908,
14,
72,
62,
2070,
278,
62,
84,
3023,
13,
198,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
2070,
278,
62,
19119,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
43679,
7473,
35717,
220,
220,
220,
1220,
67,
5908,
14,
72,
62,
2070,
278,
62,
84,
3023,
13,
198,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
2070,
278,
62,
33678,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
43679,
7473,
5550,
2538,
9328,
220,
220,
220,
1220,
67,
5908,
14,
72,
62,
2070,
278,
62,
84,
3023,
13,
628,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
2070,
278,
62,
47904,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
43679,
7473,
9677,
4146,
1961,
220,
220,
220,
1220,
67,
5908,
14,
72,
62,
2070,
278,
62,
84,
3023,
13,
198,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
2070,
278,
62,
76,
6320,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
43679,
7473,
337,
24805,
1961,
220,
220,
220,
1220,
67,
5908,
14,
72,
62,
2070,
278,
62,
84,
3023,
13,
198,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
2070,
278,
62,
26263,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
43679,
7473,
39099,
1961,
220,
1220,
67,
5908,
14,
72,
62,
2070,
278,
62,
84,
3023,
13,
628,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
2070,
654,
7211,
1732,
62,
47904,
220,
220,
41876,
43679,
7473,
9677,
4146,
1961,
220,
220,
220,
1220,
67,
5908,
14,
72,
62,
2070,
654,
7211,
1732,
62,
84,
3023,
13,
198,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
2070,
654,
7211,
1732,
62,
76,
6320,
220,
220,
41876,
43679,
7473,
337,
24805,
1961,
220,
220,
220,
1220,
67,
5908,
14,
72,
62,
2070,
654,
7211,
1732,
62,
84,
3023,
13,
198,
220,
220,
220,
24412,
47,
1546,
256,
83,
62,
2070,
654,
7211,
1732,
62,
26263,
41876,
43679,
7473,
39099,
1961,
220,
1220,
67,
5908,
14,
72,
62,
2070,
654,
7211,
1732,
62,
84,
3023,
13,
628,
198,
220,
220,
220,
42715,
12,
49273,
50,
3975,
62,
35927,
62,
66,
9310,
62,
1462,
62,
9945,
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,
30023,
9863,
2751,
220,
220,
318,
62,
72,
62,
35927,
62,
84,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
72,
62,
35927,
62,
84,
3023,
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,
30826,
4261,
15871,
26173,
8924,
7,
3808,
62,
35927,
8,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
361,
62,
22560,
62,
1455,
1590,
3023,
14804,
912,
62,
35927,
62,
259,
13,
628,
198,
220,
220,
220,
42715,
12,
49273,
50,
3975,
62,
35927,
62,
20500,
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,
30023,
9863,
2751,
21628,
62,
66,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
35927,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1220,
67,
5908,
14,
35927,
62,
312,
3023,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
20500,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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
] |
CLASS zcl_complex_response DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
TYPES: BEGIN OF ts_phone_number,
type TYPE char50,
number TYPE char50,
END OF ts_phone_number,
tt_phone_number TYPE STANDARD TABLE OF ts_phone_number.
DATA: name TYPE char50,
age TYPE i,
city TYPE char50,
telno TYPE tt_phone_number.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_complex_response IMPLEMENTATION.
ENDCLASS.
| [
31631,
1976,
565,
62,
41887,
62,
26209,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
40379,
62,
4862,
62,
17618,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2099,
220,
220,
41876,
1149,
1120,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1271,
41876,
1149,
1120,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
40379,
62,
4862,
62,
17618,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
256,
83,
62,
4862,
62,
17618,
41876,
49053,
9795,
43679,
3963,
40379,
62,
4862,
62,
17618,
13,
628,
220,
220,
220,
42865,
25,
1438,
220,
41876,
1149,
1120,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2479,
220,
220,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1748,
220,
41876,
1149,
1120,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13632,
3919,
41876,
256,
83,
62,
4862,
62,
17618,
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,
41887,
62,
26209,
30023,
2538,
10979,
6234,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_fmwp_main DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
TYPES:
BEGIN OF ts_tfdir,
gnrte TYPE abap_bool,
funcname TYPE tfdir-funcname,
pname TYPE tfdir-pname,
area TYPE area,
END OF ts_tfdir.
METHODS constructor
IMPORTING
i_builder TYPE REF TO zif_fmwp_builder.
METHODS on_value_request_lib
CHANGING
p_flib TYPE rs38l_area.
METHODS start_of_selection
IMPORTING
i_area TYPE rs38l_area OPTIONAL.
PROTECTED SECTION.
PRIVATE SECTION.
DATA mo_table TYPE REF TO cl_salv_table.
DATA m_alv TYPE REF TO cl_gui_alv_grid.
DATA mt_fieldcat TYPE lvc_t_fcat.
DATA ms_layout TYPE lvc_s_layo.
DATA mt_tfdir TYPE STANDARD TABLE OF ts_tfdir.
DATA mr_builder TYPE REF TO zif_fmwp_builder.
DATA m_area TYPE string.
CONSTANTS c_ucomm_generate TYPE syst-ucomm VALUE 'GENERATE'.
METHODS: on_single_click FOR EVENT link_click OF cl_salv_events_table
IMPORTING row column,
on_double_click FOR EVENT double_click OF cl_salv_events_table
IMPORTING row column,
start_of_selection_salv
IMPORTING
i_area TYPE string OPTIONAL,
update_from_existing_class.
" event handlers
METHODS:
on_grid_double_click FOR EVENT double_click
OF cl_gui_alv_grid
IMPORTING
e_row
e_column
es_row_no,
on_toolbar FOR EVENT toolbar
OF cl_gui_alv_grid
IMPORTING
e_object,
on_user_command FOR EVENT user_command
OF cl_gui_alv_grid
IMPORTING
e_ucomm.
ENDCLASS.
CLASS zcl_fmwp_main IMPLEMENTATION.
METHOD constructor.
mr_builder = i_builder.
ASSERT mr_builder IS BOUND.
ENDMETHOD.
METHOD on_double_click.
MESSAGE |Double click { column }| TYPE 'I'.
ENDMETHOD.
METHOD on_grid_double_click.
DATA(ls_row_idx) = e_row-index.
DATA(ls_method) = mt_tfdir[ ls_row_idx ].
mr_builder->generate(
EXPORTING
i_area = CONV #( ls_method-area )
it_funcnames = VALUE #( ( ls_method-funcname ) )
).
ENDMETHOD.
METHOD on_single_click.
MESSAGE column TYPE 'I'.
ENDMETHOD.
METHOD on_value_request_lib.
CALL FUNCTION 'REPOSITORY_INFO_SYSTEM_F4'
EXPORTING
object_type = 'F'
object_name = p_flib
suppress_selection = 'X'
IMPORTING
object_name_selected = p_flib
EXCEPTIONS
cancel = 00.
ENDMETHOD.
METHOD start_of_selection.
DATA(l_pname) = |SAPL{ i_area }|.
m_area = i_area.
SELECT pname, funcname, substring( pname, 4, 30 ) AS area
FROM tfdir
WHERE pname = @l_pname
INTO CORRESPONDING FIELDS OF TABLE @mt_tfdir .
WRITE /.
m_alv = NEW cl_gui_alv_grid(
i_parent = cl_gui_container=>default_screen ).
SET HANDLER:
on_grid_double_click FOR m_alv,
on_toolbar FOR m_alv,
on_user_command FOR m_alv.
update_from_existing_class( ).
mt_fieldcat = VALUE #(
( fieldname = 'GNRTE' checkbox = abap_true edit = abap_true )
( fieldname = 'AREA' rollname = 'AREA' )
( fieldname = 'FUNCNAME' rollname = 'RS381_FNAM' )
).
ms_layout = VALUE #( cwidth_opt = abap_true ).
CALL METHOD m_alv->set_table_for_first_display
EXPORTING
is_layout = ms_layout
CHANGING
it_fieldcatalog = mt_fieldcat
it_outtab = mt_tfdir.
ENDMETHOD.
METHOD start_of_selection_salv.
DATA lt_tfdir TYPE STANDARD TABLE OF ts_tfdir.
DATA(l_pname) = |SAPL{ i_area }|.
m_area = i_area.
SELECT pname, funcname, substring( pname,4,30 ) AS area FROM tfdir WHERE pname = @l_pname INTO CORRESPONDING FIELDS OF TABLE @lt_tfdir .
CALL METHOD cl_salv_table=>factory
EXPORTING
list_display = abap_true
IMPORTING
r_salv_table = mo_table
CHANGING
t_table = lt_tfdir.
DATA(lr_columns) = mo_table->get_columns( ).
DATA(lr_column) = CAST cl_salv_column_table( lr_columns->get_column( 'UTASK' ) ).
lr_column->set_cell_type( if_salv_c_cell_type=>checkbox ).
DATA(lr_events) = mo_table->get_event( ).
SET HANDLER on_double_click FOR lr_events.
SET HANDLER on_single_click FOR lr_events.
mo_table->display( ).
ENDMETHOD.
METHOD on_toolbar.
* Add application specific toolbar functions
DATA: ls_tb TYPE stb_button.
ls_tb-butn_type = 3.
INSERT ls_tb INTO e_object->mt_toolbar INDEX 1.
INSERT VALUE #(
function = c_ucomm_generate
icon = icon_generate
quickinfo = 'Generate'(001)
butn_type = '0'
) INTO e_object->mt_toolbar INDEX 1.
* ls_tb-function = 'EXAMPLE_TWO'.
* ls_tb-icon = icon_bw_ra_setting_active.
* ls_tb-quickinfo = 'Anwendungsfunktion 1'(002).
* ls_tb-butn_type = '0'.
*
* INSERT ls_tb INTO e_object->mt_toolbar INDEX 1.
* ls_tb-function = 'EXAMPLE_THREE'.
* ls_tb-icon = icon_close.
* ls_tb-quickinfo = 'Anwendungsfunktion 3'(003).
* ls_tb-butn_type = '0'.
*
* APPEND ls_tb TO e_object->mt_toolbar.
ENDMETHOD.
METHOD on_user_command.
DATA:
lt_funcnames TYPE STANDARD TABLE OF rs38l_fnam.
CASE e_ucomm.
WHEN c_ucomm_generate.
MESSAGE |generate { m_area }| TYPE 'I'.
lt_funcnames = VALUE #( FOR <x> IN mt_tfdir WHERE ( gnrte = abap_true )
( <x>-funcname ) ).
mr_builder->generate(
EXPORTING
i_area = m_area
it_funcnames = lt_funcnames
).
ENDCASE.
ENDMETHOD.
METHOD update_from_existing_class.
DATA(lr_cls) = mr_builder->load( m_area ).
IF lr_cls IS BOUND.
LOOP AT lr_cls->method_get_all_methods( ) INTO DATA(ls_meth).
DATA(lr_func) = REF #( mt_tfdir[ funcname = ls_meth-cmpname ] OPTIONAL ).
IF lr_func IS BOUND.
lr_func->gnrte = abap_true.
ENDIF.
ENDLOOP.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
38353,
24142,
62,
12417,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
40379,
62,
27110,
15908,
11,
198,
220,
220,
220,
220,
220,
220,
220,
19967,
81,
660,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
25439,
3672,
41876,
48700,
15908,
12,
20786,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
279,
3672,
220,
220,
220,
41876,
48700,
15908,
12,
79,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1989,
220,
220,
220,
220,
41876,
1989,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
40379,
62,
27110,
15908,
13,
198,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
38272,
41876,
4526,
37,
5390,
1976,
361,
62,
38353,
24142,
62,
38272,
13,
198,
220,
220,
220,
337,
36252,
50,
319,
62,
8367,
62,
25927,
62,
8019,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
279,
62,
2704,
571,
41876,
44608,
2548,
75,
62,
20337,
13,
198,
220,
220,
220,
337,
36252,
50,
923,
62,
1659,
62,
49283,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
20337,
41876,
44608,
2548,
75,
62,
20337,
39852,
2849,
1847,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
42865,
6941,
62,
11487,
41876,
4526,
37,
5390,
537,
62,
21680,
85,
62,
11487,
13,
198,
220,
220,
220,
42865,
285,
62,
282,
85,
41876,
4526,
37,
5390,
537,
62,
48317,
62,
282,
85,
62,
25928,
13,
198,
220,
220,
220,
42865,
45079,
62,
3245,
9246,
41876,
300,
28435,
62,
83,
62,
69,
9246,
13,
198,
220,
220,
220,
42865,
13845,
62,
39786,
41876,
300,
28435,
62,
82,
62,
10724,
78,
13,
198,
220,
220,
220,
42865,
45079,
62,
27110,
15908,
41876,
49053,
9795,
43679,
3963,
40379,
62,
27110,
15908,
13,
198,
220,
220,
220,
42865,
285,
81,
62,
38272,
41876,
4526,
37,
5390,
1976,
361,
62,
38353,
24142,
62,
38272,
13,
198,
220,
220,
220,
42865,
285,
62,
20337,
41876,
4731,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
84,
9503,
62,
8612,
378,
41876,
827,
301,
12,
84,
9503,
26173,
8924,
705,
35353,
1137,
6158,
4458,
628,
220,
220,
220,
337,
36252,
50,
25,
319,
62,
29762,
62,
12976,
7473,
49261,
2792,
62,
12976,
3963,
537,
62,
21680,
85,
62,
31534,
62,
11487,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
5752,
5721,
11,
198,
220,
220,
220,
220,
220,
319,
62,
23352,
62,
12976,
7473,
49261,
4274,
62,
12976,
3963,
537,
62,
21680,
85,
62,
31534,
62,
11487,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
5752,
5721,
11,
198,
220,
220,
220,
220,
220,
923,
62,
1659,
62,
49283,
62,
21680,
85,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
20337,
41876,
4731,
39852,
2849,
1847,
11,
198,
220,
220,
220,
220,
220,
4296,
62,
6738,
62,
25687,
62,
4871,
13,
628,
220,
220,
220,
366,
1785,
32847,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
319,
62,
25928,
62,
23352,
62,
12976,
7473,
49261,
4274,
62,
12976,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3963,
537,
62,
48317,
62,
282,
85,
62,
25928,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
304,
62,
808,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
304,
62,
28665,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1658,
62,
808,
62,
3919,
11,
198,
220,
220,
220,
220,
220,
319,
62,
25981,
5657,
7473,
49261,
50149,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3963,
220,
537,
62,
48317,
62,
282,
85,
62,
25928,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
304,
62,
15252,
11,
198,
220,
220,
220,
220,
220,
319,
62,
7220,
62,
21812,
7473,
49261,
2836,
62,
21812,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3963,
537,
62,
48317,
62,
282,
85,
62,
25928,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
304,
62,
84,
9503,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
38353,
24142,
62,
12417,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
285,
81,
62,
38272,
796,
1312,
62,
38272,
13,
198,
220,
220,
220,
24994,
17395,
285,
81,
62,
38272,
3180,
347,
15919,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
319,
62,
23352,
62,
12976,
13,
628,
220,
220,
220,
337,
1546,
4090,
8264,
930,
25628,
3904,
1391,
5721,
1782,
91,
41876,
705,
40,
4458,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
319,
62,
25928,
62,
23352,
62,
12976,
13,
628,
220,
220,
220,
42865,
7,
7278,
62,
808,
62,
312,
87,
8,
796,
304,
62,
808,
12,
9630,
13,
198,
220,
220,
220,
42865,
7,
7278,
62,
24396,
8,
796,
45079,
62,
27110,
15908,
58,
43979,
62,
808,
62,
312,
87,
20740,
198,
220,
220,
220,
285,
81,
62,
38272,
3784,
8612,
378,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
*"* use this source file for your ABAP unit test classes
CLASS ltc_main DEFINITION
FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS
INHERITING FROM zcl_io_test.
PRIVATE SECTION.
METHODS test FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltc_main IMPLEMENTATION.
METHOD test.
test_c_reader( NEW zcl_io_string_c_reader( str = CONV #( sy-abcde ) ) ).
ENDMETHOD.
ENDCLASS.
| [
9,
1,
9,
779,
428,
2723,
2393,
329,
534,
9564,
2969,
4326,
1332,
6097,
198,
198,
31631,
300,
23047,
62,
12417,
5550,
20032,
17941,
198,
220,
220,
220,
220,
220,
7473,
43001,
2751,
198,
220,
220,
220,
220,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
220,
220,
220,
220,
45698,
42,
49277,
43638,
5805,
7597,
198,
220,
220,
220,
220,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
952,
62,
9288,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
23047,
62,
12417,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
1332,
13,
198,
220,
220,
220,
1332,
62,
66,
62,
46862,
7,
12682,
1976,
565,
62,
952,
62,
8841,
62,
66,
62,
46862,
7,
965,
796,
7102,
53,
1303,
7,
827,
12,
39305,
2934,
1267,
1267,
6739,
198,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS ltcl_json_config_generator DEFINITION FINAL FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
TYPES:
BEGIN OF third,
name_3 TYPE makt-maktx,
END OF third,
BEGIN OF second,
name_2 TYPE char20,
third TYPE third,
END OF second,
BEGIN OF main,
name_1 TYPE string,
second TYPE second,
END OF main,
BEGIN OF table_line,
name TYPE string,
END OF table_line,
t_table TYPE STANDARD TABLE OF table_line WITH DEFAULT KEY,
BEGIN OF struct_table,
name TYPE string,
table_1 TYPE t_table,
END OF struct_table.
DATA: struct TYPE main,
table_struct TYPE struct_table,
cut TYPE REF TO zcl_json_config_generator.
METHODS:
setup,
assert_instance_is_bound
IMPORTING
instance TYPE REF TO object,
check_list_size
IMPORTING
list TYPE REF TO cl_object_map
size TYPE i,
check_contains_key
IMPORTING
list TYPE REF TO cl_object_map
key TYPE string,
assert_equals
IMPORTING
exp TYPE any
act TYPE any
msg TYPE csequence OPTIONAL,
assert_instances_is_not_equals
IMPORTING
instance_1 TYPE any
instance_2 TYPE any
msg TYPE csequence OPTIONAL,
assert_not_bound
IMPORTING
obj TYPE REF TO object.
METHODS:
process_element FOR TESTING,
process_deep_structure FOR TESTING,
process_deep_structure_camel FOR TESTING,
process_table FOR TESTING,
process_two_times_instance FOR TESTING,
require_all_fields FOR TESTING.
ENDCLASS.
CLASS ltcl_json_config_generator IMPLEMENTATION.
METHOD setup.
cut = NEW #( ).
ENDMETHOD.
METHOD assert_instance_is_bound.
cl_abap_unit_assert=>assert_bound(
EXPORTING
act = instance
msg = 'Should returns a valid instance'
).
ENDMETHOD.
METHOD check_list_size.
cl_abap_unit_assert=>assert_equals(
EXPORTING
act = list->size( )
exp = size
msg = |List should have exact number of itens { size } passed by parameter|
).
ENDMETHOD.
METHOD check_contains_key.
cl_abap_unit_assert=>assert_true(
EXPORTING
act = list->contains_key( key )
msg = |List should have the key: { key }|
).
ENDMETHOD.
METHOD assert_equals.
cl_abap_unit_assert=>assert_equals( msg = msg exp = exp act = act ).
ENDMETHOD.
METHOD assert_not_bound.
cl_abap_unit_assert=>assert_not_bound(
EXPORTING
act = obj
* msg =
).
ENDMETHOD.
METHOD process_element.
DATA: name TYPE string.
DATA(json_field_config) = cut->generate_data_type_config(
EXPORTING
name = 'NAME'
data = name ).
assert_instance_is_bound( json_field_config ).
assert_equals( exp = 'NAME'
act = json_field_config->abap_name ).
ENDMETHOD.
METHOD process_deep_structure.
DATA(field_config) = cut->generate_data_type_config(
EXPORTING
data = struct
).
DATA(field_cfg_aux) = field_config.
assert_instance_is_bound( field_config ).
check_list_size( list = field_config->children
size = 2 ).
field_cfg_aux ?= field_config->children->get( 'NAME_1' ).
assert_equals(
EXPORTING
exp = 'name1'
act = field_cfg_aux->ext_name
).
field_config ?= field_config->children->get( 'SECOND' ).
assert_instance_is_bound( field_config ).
assert_equals(
EXPORTING
exp = 'second'
act = field_config->ext_name
).
check_list_size( list = field_config->children
size = 2 ).
check_contains_key( list = field_config->children
key = 'NAME_2' ).
field_cfg_aux ?= field_config->children->get( 'NAME_2' ).
assert_equals(
EXPORTING
exp = 'name2'
act = field_cfg_aux->ext_name
).
check_contains_key( list = field_config->children
key = 'THIRD' ).
field_config ?= field_config->children->get( 'THIRD' ).
assert_instance_is_bound( field_config ).
assert_equals(
EXPORTING
exp = 'third'
act = field_config->ext_name
).
check_list_size( list = field_config->children
size = 1 ).
check_contains_key( list = field_config->children
key = 'NAME_3' ).
field_cfg_aux ?= field_config->children->get( 'NAME_3' ).
assert_equals(
EXPORTING
exp = 'name3'
act = field_cfg_aux->ext_name
).
ENDMETHOD.
METHOD process_table.
DATA: struct TYPE struct_table.
DATA(json_field_config) = cut->generate_data_type_config(
EXPORTING
data = struct
).
assert_instance_is_bound( json_field_config ).
check_list_size( list = json_field_config->children
size = 2 ).
check_contains_key( list = json_field_config->children
key = 'NAME' ).
check_contains_key( list = json_field_config->children
key = 'TABLE_1' ).
json_field_config ?= json_field_config->children->get( 'TABLE_1' ).
assert_instance_is_bound( json_field_config ).
check_list_size( list = json_field_config->children
size = 1 ).
check_contains_key( list = json_field_config->children
key = 'TLINE' ).
json_field_config ?= json_field_config->children->get( 'TLINE' ).
assert_instance_is_bound( json_field_config ).
check_list_size( list = json_field_config->children
size = 1 ).
check_contains_key( list = json_field_config->children
key = 'NAME' ).
ENDMETHOD.
METHOD process_deep_structure_camel.
"Switching off camel case
cut->name_to_camel_case = abap_false.
DATA(field_config) = cut->generate_data_type_config(
EXPORTING
data = struct
).
DATA(field_cfg_aux) = field_config.
assert_instance_is_bound( field_config ).
check_list_size( list = field_config->children
size = 2 ).
field_cfg_aux ?= field_config->children->get( 'NAME_1' ).
assert_equals(
EXPORTING
exp = 'NAME_1'
act = field_cfg_aux->abap_name
).
field_config ?= field_config->children->get( 'SECOND' ).
assert_instance_is_bound( field_config ).
assert_equals(
EXPORTING
exp = 'SECOND'
act = field_config->abap_name
).
check_list_size( list = field_config->children
size = 2 ).
check_contains_key( list = field_config->children
key = 'NAME_2' ).
field_cfg_aux ?= field_config->children->get( 'NAME_2' ).
assert_equals(
EXPORTING
exp = 'NAME_2'
act = field_cfg_aux->abap_name
).
check_contains_key( list = field_config->children
key = 'THIRD' ).
field_config ?= field_config->children->get( 'THIRD' ).
assert_instance_is_bound( field_config ).
assert_equals(
EXPORTING
exp = 'THIRD'
act = field_config->abap_name
).
check_list_size( list = field_config->children
size = 1 ).
check_contains_key( list = field_config->children
key = 'NAME_3' ).
field_cfg_aux ?= field_config->children->get( 'NAME_3' ).
assert_equals(
EXPORTING
exp = 'NAME_3'
act = field_cfg_aux->abap_name
).
ENDMETHOD.
METHOD process_two_times_instance.
DATA(json_field_config) = cut->generate_data_type_config(
EXPORTING
data = struct
).
DATA(json_field) = cut->generate_data_type_config(
EXPORTING
data = struct
).
assert_instances_is_not_equals(
EXPORTING
instance_1 = json_field_config
instance_2 = json_field
* msg =
).
ENDMETHOD.
METHOD assert_instances_is_not_equals.
IF instance_2 NE instance_1.
RETURN.
ENDIF.
cl_abap_unit_assert=>fail( msg ).
ENDMETHOD.
METHOD require_all_fields.
cut->require_all_fields = abap_true.
DATA(element_config) = cut->generate_data_type_config(
EXPORTING
data = table_struct
).
assert_equals( exp = abap_true act = element_config->required ).
DATA: nested_element_config TYPE REF TO zcl_json_element_config.
nested_element_config ?= element_config->children->get( 'NAME' ).
assert_equals( exp = abap_true act = nested_element_config->required ).
element_config ?= element_config->children->get( 'TABLE_1' ).
assert_equals( exp = abap_true act = element_config->required ).
element_config ?= element_config->children->get( 'TLINE' ).
assert_equals( exp = abap_true act = element_config->required ).
element_config ?= element_config->children->get( 'NAME' ).
assert_equals( exp = abap_true act = element_config->required ).
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
83,
565,
62,
17752,
62,
11250,
62,
8612,
1352,
5550,
20032,
17941,
25261,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
2368,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
62,
18,
41876,
285,
461,
83,
12,
76,
461,
17602,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
2368,
11,
628,
220,
220,
220,
220,
220,
347,
43312,
3963,
1218,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
62,
17,
41876,
1149,
1238,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2368,
220,
41876,
2368,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1218,
11,
628,
220,
220,
220,
220,
220,
347,
43312,
3963,
1388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
62,
16,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1218,
41876,
1218,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
1388,
11,
628,
220,
220,
220,
220,
220,
347,
43312,
3963,
3084,
62,
1370,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
3084,
62,
1370,
11,
628,
220,
220,
220,
220,
220,
256,
62,
11487,
41876,
49053,
9795,
43679,
3963,
3084,
62,
1370,
13315,
5550,
38865,
35374,
11,
628,
220,
220,
220,
220,
220,
347,
43312,
3963,
2878,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
3084,
62,
16,
41876,
256,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
2878,
62,
11487,
13,
628,
220,
220,
220,
42865,
25,
2878,
220,
220,
220,
220,
220,
220,
41876,
1388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
3084,
62,
7249,
41876,
2878,
62,
11487,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2005,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
17752,
62,
11250,
62,
8612,
1352,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9058,
11,
628,
220,
220,
220,
220,
220,
6818,
62,
39098,
62,
271,
62,
7784,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4554,
41876,
4526,
37,
5390,
2134,
11,
628,
220,
220,
220,
220,
220,
2198,
62,
4868,
62,
7857,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1351,
41876,
4526,
37,
5390,
537,
62,
15252,
62,
8899,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2546,
41876,
1312,
11,
628,
220,
220,
220,
220,
220,
2198,
62,
3642,
1299,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1351,
41876,
4526,
37,
5390,
537,
62,
15252,
62,
8899,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1994,
220,
41876,
4731,
11,
628,
220,
220,
220,
220,
220,
6818,
62,
4853,
874,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1033,
41876,
597,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
719,
41876,
597,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
41876,
269,
43167,
39852,
2849,
1847,
11,
628,
220,
220,
220,
220,
220,
6818,
62,
8625,
1817,
62,
271,
62,
1662,
62,
4853,
874,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4554,
62,
16,
41876,
597,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
4554,
62,
17,
41876,
597,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31456,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
43167,
39852,
2849,
1847,
11,
628,
220,
220,
220,
220,
220,
6818,
62,
1662,
62,
7784,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26181,
41876,
4526,
37,
5390,
2134,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
1429,
62,
30854,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1429,
62,
22089,
62,
301,
5620,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1429,
62,
22089,
62,
301,
5620,
62,
66,
17983,
220,
220,
220,
220,
220,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1429,
62,
11487,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
1429,
62,
11545,
62,
22355,
62,
39098,
220,
220,
220,
220,
220,
220,
220,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
2421,
62,
439,
62,
25747,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
43001,
2751,
13,
198,
10619,
31631,
13,
628,
198,
31631,
300,
83,
565,
62,
17752,
62,
11250,
62,
8612,
1352,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
2005,
796,
12682,
1303,
7,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
6818,
62,
39098,
62,
271,
62,
7784,
13,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
7784,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
719,
796,
4554,
198,
220,
220,
220,
220,
220,
220,
220,
31456,
796,
705,
19926,
5860,
257,
4938,
4554,
6,
198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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class YCL_OA2C_CE_ZGOOGLE definition
public
final
create public .
public section.
interfaces IF_BADI_INTERFACE .
interfaces IF_OA2C_CONFIG_EXTENSION .
protected section.
private section.
ENDCLASS.
CLASS YCL_OA2C_CE_ZGOOGLE IMPLEMENTATION.
METHOD if_oa2c_config_extension~get_ac_auth_requ_params.
DATA: ls_nvp LIKE LINE OF et_additional_params.
* parameter: access_type
ls_nvp-name = `access_type`.
ls_nvp-value = `offline`. "online|offline
APPEND ls_nvp TO et_additional_params.
* parameter: approval_prompt
ls_nvp-name = `approval_prompt`.
ls_nvp-value = `force`. "auto|force
APPEND ls_nvp TO et_additional_params.
ENDMETHOD.
method IF_OA2C_CONFIG_EXTENSION~GET_SAML20_AT_REQU_PARAMS.
endmethod.
ENDCLASS.
| [
4871,
575,
5097,
62,
23621,
17,
34,
62,
5222,
62,
57,
38,
6684,
38,
2538,
6770,
198,
220,
1171,
198,
220,
2457,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
20314,
16876,
62,
33,
2885,
40,
62,
41358,
49836,
764,
198,
220,
20314,
16876,
62,
23621,
17,
34,
62,
10943,
16254,
62,
13918,
16938,
2849,
764,
198,
24326,
2665,
13,
198,
19734,
2665,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
575,
5097,
62,
23621,
17,
34,
62,
5222,
62,
57,
38,
6684,
38,
2538,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
611,
62,
12162,
17,
66,
62,
11250,
62,
2302,
3004,
93,
1136,
62,
330,
62,
18439,
62,
8897,
62,
37266,
13,
628,
220,
220,
220,
42865,
25,
43979,
62,
77,
36133,
34178,
48920,
3963,
2123,
62,
2860,
1859,
62,
37266,
13,
198,
9,
11507,
25,
1895,
62,
4906,
198,
220,
220,
220,
43979,
62,
77,
36133,
12,
3672,
796,
4600,
15526,
62,
4906,
44646,
198,
220,
220,
220,
43979,
62,
77,
36133,
12,
8367,
796,
4600,
2364,
1370,
44646,
366,
25119,
91,
2364,
1370,
198,
220,
220,
220,
43504,
10619,
43979,
62,
77,
36133,
5390,
2123,
62,
2860,
1859,
62,
37266,
13,
198,
198,
9,
11507,
25,
7546,
62,
16963,
457,
198,
220,
220,
220,
43979,
62,
77,
36133,
12,
3672,
796,
4600,
21064,
2100,
62,
16963,
457,
44646,
198,
220,
220,
220,
43979,
62,
77,
36133,
12,
8367,
796,
4600,
3174,
44646,
366,
23736,
91,
3174,
198,
220,
220,
220,
43504,
10619,
43979,
62,
77,
36133,
5390,
2123,
62,
2860,
1859,
62,
37266,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
2446,
16876,
62,
23621,
17,
34,
62,
10943,
16254,
62,
13918,
16938,
2849,
93,
18851,
62,
49302,
43,
1238,
62,
1404,
62,
2200,
10917,
62,
27082,
40834,
13,
198,
220,
886,
24396,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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_ci_test_header_comment DEFINITION
PUBLIC
INHERITING FROM cl_ci_test_scan
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor .
METHODS run REDEFINITION.
PROTECTED SECTION.
PRIVATE SECTION.
CONSTANTS: con_my_name TYPE seoclsname VALUE 'ZCL_CI_TEST_HEADER_COMMENT' ##NO_TEXT
.
METHODS:
failed
, get_nonclass_1st_relevt_token
RETURNING VALUE(r_token_index) TYPE sytabix.
ENDCLASS.
CLASS ZCL_CI_TEST_HEADER_COMMENT IMPLEMENTATION.
METHOD constructor .
************************************************************************
* ATC/Code Inspector Test for header comments.
* Checks for PROG, FUGR, CLAS and INTF, that a header comment was created.
* Author: Edo von Glan, www.draeger.com
*
* Required position of the comment:
* - For normal programs, first line of frame program
* - Header comments for global classes have to be placed in the constructor
* method of the class, after the line
* METHOD constructor.
* (in most cases, you will have to define a constructor just for this purpose.
* If you are in a subclass, you have to call
* super->constructor( ).
* at the end of the method.).
* - For global exception classes, the CLASS_CONSTRUCTOR has to be used
* - For global interfaces, in the line directly after the INTERFACE statement
* - For function pools, in TOP-include, starting in the first line (i.e. in front of the FUNCTION-POOL statement)
*
************************************************************************
* MIT License
*
* Copyright (c) 2019 DSAG
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
************************************************************************
super->constructor( ).
description = TEXT-000.
category = |ZCL_CI_CATEGORY_DSAG|.
position = 2.
has_attributes = abap_false.
attributes_ok = abap_false.
has_documentation = abap_true.
add_obj_type( 'PROG' ).
add_obj_type( 'FUGR' ).
add_obj_type( 'CLAS' ).
add_obj_type( 'INTF' ).
" enhancement implementations cannot be tested here - this class is not called by the framework even if ENHO is added as relevant object type
" (ZCL_CI_TEST_TRANSLATIONS is called, presumably because it only inherits from CL_CI_TEST_ROOT)
scimessages = VALUE #( ( test = con_my_name code = '0001' kind = c_warning text = TEXT-001 pcom = c_exceptn_imposibl ) ). " Kopfkommentar fehlt in &1 &2
ENDMETHOD.
METHOD failed.
inform( p_sub_obj_type = object_type
p_sub_obj_name = object_name
p_test = con_my_name
p_code = '0001'
p_param_1 = object_type
p_param_2 = object_name ).
ENDMETHOD.
METHOD get_nonclass_1st_relevt_token.
CASE object_type.
WHEN 'PROG'.
r_token_index = 1.
WHEN 'FUGR'.
DATA(top_include) = ref_scan->levels[ 2 ].
ASSERT ID zlog FIELDS object_name CONDITION top_include-name CP 'L*TOP'. " FUGR TOP include should always be in second line of scanned levels
r_token_index = ref_scan->statements[ top_include-from ]-from.
WHEN 'INTF'.
LOOP AT ref_scan->statements REFERENCE INTO DATA(stmt) WHERE type = 'K'.
IF ref_scan->tokens[ stmt->from ]-str = 'INTERFACE'.
r_token_index = stmt->to + 1.
RETURN.
ENDIF.
ENDLOOP.
ASSERT ID zlog FIELDS object_name CONDITION lines( ref_scan->levels ) = 2. " INTF should contain an INTERFACE statement
ENDCASE.
ENDMETHOD.
METHOD run.
CHECK object_type IN typelist.
CHECK get( ).
IF object_type = 'CLAS'.
DATA(parse_status) = |0 CLAS Init|.
ELSE.
DATA(nonclass_first_relevant_token) = get_nonclass_1st_relevt_token( ). " first relevant token, for objects other than CLAS
ENDIF.
DATA(lines) = lines( ref_scan->tokens ).
DATA(comment_lines_found) = 0.
LOOP AT ref_scan->tokens FROM nonclass_first_relevant_token REFERENCE INTO DATA(token).
DATA(index) = sy-tabix.
" If the current token is a potential comment
IF parse_status = '2 CLAS Constr Impl'
OR object_type <> 'CLAS' AND index >= nonclass_first_relevant_token.
" Check that the first five lines are comments (for comments, one token = one line)
FIND REGEX '^\*' IN token->str. " alternativ: token->type = 'C'
IF sy-subrc <> 0.
parse_status = '- No Comment Found'.
EXIT.
ELSE.
ADD 1 TO comment_lines_found.
IF comment_lines_found >= 5.
parse_status = '+ Comment Found'.
EXIT.
ENDIF.
ENDIF.
ENDIF.
IF object_type = 'CLAS'.
" Check whether we have progressed to a new position/status
CASE token->str.
WHEN 'CLASS'.
IF parse_status = '0 CLAS Init' AND lines >= index + 2
AND ref_scan->tokens[ index + 1 ]-str = object_name
AND ref_scan->tokens[ index + 2 ]-str = 'IMPLEMENTATION'.
parse_status = '1 CLAS Impl'.
ENDIF.
WHEN 'CONSTRUCTOR'.
IF object_name CP 'ZCL*'
AND parse_status = '1 CLAS Impl' AND index > 1
AND ref_scan->tokens[ index - 1 ]-str = 'METHOD'.
parse_status = '2 CLAS Constr Impl'.
ENDIF.
WHEN 'CLASS_CONSTRUCTOR'.
IF object_name CP 'ZCX*' " for exception classes, the constructor is generated and cannot be modified
AND parse_status = '1 CLAS Impl' AND index > 1
AND ref_scan->tokens[ index - 1 ]-str = 'METHOD'.
parse_status = '2 CLAS Constr Impl'.
ENDIF.
WHEN 'ENDMETHOD'.
IF parse_status = '2 CLAS Constr Impl'.
parse_status = '- No Comment Found'.
EXIT.
ENDIF.
ENDCASE.
ENDIF.
ENDLOOP.
IF parse_status <> '+ Comment Found'.
failed( ).
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
979,
62,
9288,
62,
25677,
62,
23893,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
537,
62,
979,
62,
9288,
62,
35836,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
23772,
764,
198,
220,
220,
220,
337,
36252,
50,
1057,
23848,
36,
20032,
17941,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
25,
369,
62,
1820,
62,
3672,
41876,
384,
420,
7278,
3672,
26173,
8924,
705,
57,
5097,
62,
25690,
62,
51,
6465,
62,
37682,
1137,
62,
9858,
10979,
6,
22492,
15285,
62,
32541,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
764,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
4054,
198,
220,
220,
220,
837,
651,
62,
13159,
4871,
62,
16,
301,
62,
260,
2768,
83,
62,
30001,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
30001,
62,
9630,
8,
41876,
827,
8658,
844,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
25690,
62,
51,
6465,
62,
37682,
1137,
62,
9858,
10979,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
764,
198,
17174,
17174,
4557,
198,
9,
317,
4825,
14,
10669,
24625,
6208,
329,
13639,
3651,
13,
198,
9,
47719,
329,
38688,
11,
376,
7340,
49,
11,
7852,
1921,
290,
3268,
10234,
11,
326,
257,
13639,
2912,
373,
2727,
13,
198,
9,
6434,
25,
1717,
78,
18042,
2671,
272,
11,
7324,
13,
32491,
11893,
13,
785,
198,
9,
198,
9,
20906,
2292,
286,
262,
2912,
25,
198,
9,
532,
1114,
3487,
4056,
11,
717,
1627,
286,
5739,
1430,
198,
9,
532,
48900,
3651,
329,
3298,
6097,
423,
284,
307,
4624,
287,
262,
23772,
198,
9,
220,
220,
2446,
286,
262,
1398,
11,
706,
262,
1627,
198,
9,
220,
220,
220,
220,
337,
36252,
23772,
13,
198,
9,
220,
220,
357,
259,
749,
2663,
11,
345,
481,
423,
284,
8160,
257,
23772,
655,
329,
428,
4007,
13,
198,
9,
220,
220,
1002,
345,
389,
287,
257,
47611,
11,
345,
423,
284,
869,
198,
9,
220,
220,
220,
220,
2208,
3784,
41571,
273,
7,
6739,
198,
9,
220,
220,
379,
262,
886,
286,
262,
2446,
15729,
198,
9,
532,
1114,
3298,
6631,
6097,
11,
262,
42715,
62,
10943,
46126,
1581,
468,
284,
307,
973,
198,
9,
532,
1114,
3298,
20314,
11,
287,
262,
1627,
3264,
706,
262,
23255,
49836,
2643,
198,
9,
532,
1114,
2163,
20354,
11,
287,
28662,
12,
17256,
11,
3599,
287,
262,
717,
1627,
357,
72,
13,
68,
13,
287,
2166,
286,
262,
29397,
4177,
2849,
12,
16402,
3535,
2643,
8,
198,
9,
198,
17174,
17174,
4557,
198,
9,
17168,
13789,
198,
9,
198,
9,
15069,
357,
66,
8,
13130,
360,
4090,
38,
198,
9,
198,
9,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
198,
9,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
25423,
12340,
284,
1730,
198,
9,
287,
262,
10442,
1231,
17504,
11,
1390,
1231,
17385,
262,
2489,
198,
9,
284,
779,
11,
4866,
11,
13096,
11,
20121,
11,
7715,
11,
14983,
11,
850,
43085,
11,
290,
14,
273,
3677,
198,
9,
9088,
286,
262,
10442,
11,
290,
284,
8749,
6506,
284,
4150,
262,
10442,
318,
198,
9,
30760,
284,
466,
523,
11,
2426,
284,
262,
1708,
3403,
25,
198,
9,
198,
9,
383,
2029,
6634,
4003,
290,
428,
7170,
4003,
2236,
307,
3017,
287,
477,
198,
9,
9088,
393,
8904,
16690,
286,
262,
10442,
13,
198,
9,
198,
9,
3336,
47466,
3180,
36592,
2389,
1961,
366,
1921,
3180,
1600,
42881,
34764,
56,
3963,
15529,
509,
12115,
11,
7788,
32761,
6375,
198,
9,
8959,
49094,
11,
47783,
2751,
21728,
5626,
40880,
5390,
3336,
34764,
11015,
3963,
34482,
3398,
1565,
5603,
25382,
11,
198,
9,
376,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
5357,
44521,
1268,
10913,
2751,
12529,
13,
3268,
8005,
49261,
50163,
3336,
198,
9,
37195,
20673,
6375,
27975,
38162,
9947,
367,
15173,
4877,
9348,
43031,
19146,
7473,
15529,
47666,
3955,
11,
29506,
25552,
6375,
25401,
198,
9,
43031,
25382,
11,
7655,
2767,
16879,
3268,
3537,
40282,
3963,
27342,
10659,
11,
309,
9863,
6375,
25401,
54,
24352,
11,
5923,
1797,
2751,
16034,
11,
198,
9,
16289,
3963,
6375,
3268,
7102,
45,
24565,
13315,
3336,
47466,
6375,
3336,
23210,
6375,
25401,
5550,
1847,
20754,
3268,
3336,
198,
9,
47466,
13,
198,
17174,
17174,
4557,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
6739,
628,
220,
220,
220,
6764,
220,
220,
220,
796,
40383,
12,
830,
13,
198,
220,
220,
220,
6536,
220,
220,
220,
220,
220,
220,
796,
930,
57,
5097,
62,
25690,
62,
34,
6158,
38,
15513,
62,
35,
4090,
38,
91,
13,
198,
220,
220,
220,
2292,
220,
220,
220,
220,
220,
220,
796,
362,
13,
198,
220,
220,
220,
468,
62,
1078,
7657,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
12608,
62,
482,
220,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
468,
62,
22897,
341,
796,
450,
499,
62,
7942,
13,
628,
220,
220,
220,
751,
62,
26801,
62,
4906,
7,
705,
4805,
7730,
6,
6739,
198,
220,
220,
220,
751,
62,
26801,
62,
4906,
7,
705,
37,
7340,
49,
6,
6739,
198,
220,
220,
220,
751,
62,
26801,
62,
4906,
7,
705,
5097,
1921,
6,
6739,
198,
220,
220,
220,
751,
62,
26801,
62,
4906,
7,
705,
1268,
10234,
6,
6739,
198,
220,
220,
220,
366,
28554,
25504,
2314,
307,
6789,
994,
532,
428,
1398,
318,
407,
1444,
416,
262,
9355,
772,
611,
12964,
32298,
318,
2087,
355,
5981,
2134,
2099,
198,
220,
220,
220,
366,
357,
57,
5097,
62,
25690,
62,
51,
6465,
62,
5446,
1565,
8634,
18421,
318,
1444,
11,
14572,
780,
340,
691,
10639,
896,
422,
7852,
62,
25690,
62,
51,
6465,
62,
13252,
2394,
8,
628,
220,
220,
220,
629,
320,
408,
1095,
796,
26173,
8924,
1303,
7,
357,
1332,
796,
369,
62,
1820,
62,
3672,
2438
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
method ZAS_EMPSET_DELETE_ENTITY.
RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc
EXPORTING
textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented
method = 'ZAS_EMPSET_DELETE_ENTITY'.
endmethod. | [
220,
2446,
1168,
1921,
62,
3620,
3705,
2767,
62,
7206,
2538,
9328,
62,
3525,
9050,
13,
198,
220,
17926,
24352,
7788,
42006,
2849,
41876,
1220,
14246,
65,
538,
14,
66,
87,
62,
11296,
86,
62,
1662,
62,
23928,
62,
41194,
198,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
2420,
312,
796,
1220,
14246,
65,
538,
14,
66,
87,
62,
11296,
86,
62,
1662,
62,
23928,
62,
41194,
14804,
24396,
62,
1662,
62,
320,
1154,
12061,
198,
220,
220,
220,
220,
220,
2446,
796,
705,
57,
1921,
62,
3620,
3705,
2767,
62,
7206,
2538,
9328,
62,
3525,
9050,
4458,
198,
220,
886,
24396,
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
] |
CLASS zcl_abapgit_object_styl DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES: BEGIN OF ty_style,
header TYPE itcda,
paragraphs TYPE STANDARD TABLE OF itcdp WITH DEFAULT KEY,
strings TYPE STANDARD TABLE OF itcds WITH DEFAULT KEY,
tabs TYPE STANDARD TABLE OF itcdq WITH DEFAULT KEY,
END OF ty_style.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_STYL IMPLEMENTATION.
METHOD zif_abapgit_object~changed_by.
DATA: ls_style TYPE ty_style,
lv_name TYPE itcda-tdstyle.
lv_name = ms_item-obj_name.
CALL FUNCTION 'READ_STYLE'
EXPORTING
style = lv_name
IMPORTING
style_header = ls_style-header
TABLES
paragraphs = ls_style-paragraphs
strings = ls_style-strings
tabs = ls_style-tabs.
rv_user = ls_style-header-tdluser.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_style TYPE itcda-tdstyle.
lv_style = ms_item-obj_name.
CALL FUNCTION 'DELETE_STYLE'
EXPORTING
style = lv_style
language = '*'.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_style TYPE ty_style.
io_xml->read( EXPORTING iv_name = 'STYLE'
CHANGING cg_data = ls_style ).
CALL FUNCTION 'SAVE_STYLE'
EXPORTING
style_header = ls_style-header
TABLES
paragraphs = ls_style-paragraphs
strings = ls_style-strings
tabs = ls_style-tabs.
tadir_insert( iv_package ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: ls_style TYPE ty_style,
lv_name TYPE itcda-tdstyle,
lv_found TYPE abap_bool.
lv_name = ms_item-obj_name.
CALL FUNCTION 'READ_STYLE'
EXPORTING
style = lv_name
IMPORTING
found = lv_found
TABLES
paragraphs = ls_style-paragraphs
strings = ls_style-strings
tabs = ls_style-tabs.
rv_bool = boolc( lv_found = abap_true ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
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.
DATA: ls_bcdata TYPE bdcdata,
lt_bcdata TYPE STANDARD TABLE OF bdcdata.
ls_bcdata-program = 'SAPMSSCS'.
ls_bcdata-dynpro = '1100'.
ls_bcdata-dynbegin = 'X'.
APPEND ls_bcdata TO lt_bcdata.
CLEAR ls_bcdata.
ls_bcdata-fnam = 'RSSCS-TDSTYLE'.
ls_bcdata-fval = ms_item-obj_name.
APPEND ls_bcdata TO lt_bcdata.
CLEAR ls_bcdata.
ls_bcdata-fnam = 'RSSCS-TDSPRAS'.
ls_bcdata-fval = sy-langu.
APPEND ls_bcdata TO lt_bcdata.
CLEAR ls_bcdata.
ls_bcdata-fnam = 'RSSCS-TDHEADEROB'.
ls_bcdata-fval = 'X'.
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 = 'SE72'
mode_val = 'E'
TABLES
using_tab = lt_bcdata
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from ABAP4_CALL_TRANSACTION, STYL' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: ls_style TYPE ty_style,
lv_name TYPE itcda-tdstyle.
lv_name = ms_item-obj_name.
CALL FUNCTION 'READ_STYLE'
EXPORTING
style = lv_name
IMPORTING
style_header = ls_style-header
TABLES
paragraphs = ls_style-paragraphs
strings = ls_style-strings
tabs = ls_style-tabs.
CLEAR: ls_style-header-tdfuser,
ls_style-header-tdfdate,
ls_style-header-tdftime,
ls_style-header-tdfreles,
ls_style-header-tdluser,
ls_style-header-tdldate,
ls_style-header-tdltime,
ls_style-header-tdlreles.
io_xml->add( iv_name = 'STYLE'
ig_data = ls_style ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
301,
2645,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
7635,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13639,
220,
220,
220,
220,
41876,
340,
66,
6814,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23549,
41876,
49053,
9795,
43679,
3963,
340,
10210,
79,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
13042,
220,
220,
220,
41876,
49053,
9795,
43679,
3963,
340,
66,
9310,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
22524,
220,
220,
220,
220,
220,
220,
41876,
49053,
9795,
43679,
3963,
340,
10210,
80,
13315,
5550,
38865,
35374,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
7635,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
2257,
45448,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
40985,
62,
1525,
13,
628,
220,
220,
220,
42865,
25,
43979,
62,
7635,
41876,
1259,
62,
7635,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
3672,
220,
41876,
340,
66,
6814,
12,
8671,
7635,
13,
628,
198,
220,
220,
220,
300,
85,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
15675,
62,
2257,
56,
2538,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
3918,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
3672,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
3918,
62,
25677,
796,
43979,
62,
7635,
12,
25677,
198,
220,
220,
220,
220,
220,
309,
6242,
28378,
198,
220,
220,
220,
220,
220,
220,
220,
23549,
220,
220,
796,
43979,
62,
7635,
12,
20360,
82,
198,
220,
220,
220,
220,
220,
220,
220,
13042,
220,
220,
220,
220,
220,
796,
43979,
62,
7635,
12,
37336,
198,
220,
220,
220,
220,
220,
220,
220,
22524,
220,
220,
220,
220,
220,
220,
220,
220,
796,
43979,
62,
7635,
12,
8658,
82,
13,
628,
220,
220,
220,
374,
85,
62,
7220,
796,
43979,
62,
7635,
12,
25677,
12,
8671,
75,
7220,
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,
7635,
41876,
340,
66,
6814,
12,
8671,
7635,
13,
628,
198,
220,
220,
220,
300,
85,
62,
7635,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
7206,
2538,
9328,
62,
2257,
56,
2538,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
3918,
220,
220,
220,
796,
300,
85,
62,
7635,
198,
220,
220,
220,
220,
220,
220,
220,
3303,
796,
705,
9,
4458,
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,
7635,
41876,
1259,
62,
7635,
13,
628,
198,
220,
220,
220,
33245,
62,
19875,
3784,
961,
7,
7788,
15490,
2751,
21628,
62,
3672,
796,
705,
2257,
56,
2538,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5870,
15567,
2751,
269,
70,
62,
7890,
796,
43979,
62,
7635,
6739,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
4090,
6089,
62,
2257,
56,
2538,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
3918,
62,
25677,
796,
43979,
62,
7635,
12,
25677,
198,
220,
220,
220,
220,
220,
309,
6242,
28378,
198,
220,
220,
220,
220,
220,
220,
220,
23549,
220,
220,
796,
43979,
62,
7635,
12,
20360,
82,
198,
220,
220,
220,
220,
220,
220,
220,
13042,
220,
220,
220,
220,
220,
796,
43979,
62,
7635,
12,
37336,
198,
220,
220,
220,
220,
220,
220,
220,
22524,
220,
220,
220,
220,
220,
220,
220,
220,
796,
43979,
62,
7635,
12,
8658,
82,
13,
628,
220,
220,
220,
36264,
343,
62,
28463,
7,
21628,
62,
26495,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
1069,
1023,
13,
628,
220,
220,
220,
42865,
25,
43979,
62,
7635,
41876,
1259,
62,
7635,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
3672,
220,
41876,
340,
66,
6814,
12,
8671,
7635,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
9275,
41876,
450,
499,
62,
30388,
13,
628,
198,
220,
220,
220,
300,
85,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
15675,
62,
2257,
56,
2538,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
3918,
220,
220,
220,
220,
220,
796,
300,
85,
62,
3672,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1043,
220,
220,
220,
220,
220,
796,
300,
85,
62,
9275,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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
] |
REPORT z_highlight_js.
*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
* Purpose:
* ~~~~~~~~
* This reports illustrates how an ABAP program looks in Highlight.js
*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
DATA: gt_sflight TYPE sflight OCCURS 0, " Output-Table
gt_fieldcatalog TYPE lvc_t_fcat,
ok_code LIKE sy-ucomm,
save_ok LIKE sy-ucomm. " OK-Code
*###############################################################
* LOCAL CLASSES
*###############################################################
*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* §4.Define a class for a data object to exchange data
* within ALV Control when using the drag and drop operation.
CLASS LCL_DRAGDROPOBJ DEFINITION.
PUBLIC SECTION.
DATA: cps_sflight TYPE sflight,
cp_node_text TYPE lvc_value,
cp_node_key TYPE lvc_nkey.
ENDCLASS.
START-OF-SELECTION.
WRITE 'END OF TEST'.
END-OF-SELECTION. | [
2200,
15490,
220,
1976,
62,
8929,
2971,
62,
8457,
13,
198,
9,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
198,
9,
32039,
25,
198,
9,
220,
15116,
198,
9,
770,
3136,
21290,
703,
281,
9564,
2969,
1430,
3073,
287,
3334,
2971,
13,
8457,
198,
9,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
25226,
5,
198,
198,
26947,
25,
308,
83,
62,
82,
22560,
220,
220,
220,
220,
220,
41876,
264,
22560,
440,
4093,
4261,
50,
657,
11,
220,
220,
220,
220,
220,
366,
25235,
12,
10962,
198,
220,
220,
220,
220,
220,
308,
83,
62,
3245,
9246,
11794,
41876,
300,
28435,
62,
83,
62,
69,
9246,
11,
198,
220,
220,
220,
220,
220,
12876,
62,
8189,
34178,
827,
12,
84,
9503,
11,
198,
220,
220,
220,
220,
220,
3613,
62,
482,
34178,
827,
12,
84,
9503,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
7477,
12,
10669,
198,
198,
9,
29113,
14468,
7804,
4242,
21017,
198,
9,
37347,
1847,
42715,
1546,
198,
9,
29113,
14468,
7804,
4242,
21017,
198,
9,
27156,
27156,
27156,
27156,
8728,
198,
9,
8460,
19,
13,
7469,
500,
257,
1398,
329,
257,
1366,
2134,
284,
5163,
1366,
198,
9,
220,
220,
220,
1626,
8355,
53,
6779,
618,
1262,
262,
6715,
290,
4268,
4905,
13,
198,
31631,
406,
5097,
62,
35,
33202,
7707,
3185,
9864,
41,
5550,
20032,
17941,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
42865,
25,
269,
862,
62,
82,
22560,
41876,
264,
22560,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31396,
62,
17440,
62,
5239,
41876,
300,
28435,
62,
8367,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
31396,
62,
17440,
62,
2539,
41876,
300,
28435,
62,
77,
2539,
13,
198,
198,
10619,
31631,
13,
198,
198,
2257,
7227,
12,
19238,
12,
46506,
2849,
13,
198,
220,
44423,
705,
10619,
3963,
43001,
4458,
198,
198,
10619,
12,
19238,
12,
46506,
2849,
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,
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your ABAP unit test classes
CLASS ltcl_fieldcatalog_should DEFINITION DEFERRED.
CLASS ZCL_OP_SIMPLE_FIELD_CATALOG DEFINITION LOCAL FRIENDS ltcl_fieldcatalog_should.
CLASS ltcl_fieldcatalog_should DEFINITION FINAL FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS.
PRIVATE SECTION.
DATA: lo_cut TYPE REF TO ZCL_OP_SIMPLE_FIELD_CATALOG.
METHODS:
setup,
get_fields_in_right_order FOR TESTING RAISING cx_static_check,
get_fieldcatalog_of_local_type FOR TESTING RAISING cx_static_check,
get_fieldcatalog_nostruc_table FOR TESTING RAISING cx_static_check,
get_fieldcat_of_local_typ_incl for testing raising cx_static_check.
ENDCLASS.
CLASS ltcl_fieldcatalog_should IMPLEMENTATION.
METHOD get_fields_in_right_order.
DATA: field_catalog TYPE lvc_t_fcat.
TYPES: BEGIN OF t_col2,
col1 TYPE i,
col2 TYPE i,
END OF t_col2.
TYPES: BEGIN OF t_struct,
col1 TYPE i,
col2 TYPE t_col2,
END OF t_struct.
TYPES: my_itab_type TYPE STANDARD TABLE OF t_struct WITH DEFAULT KEY.
TYPES: BEGIN OF nested_type,
col1 TYPE i,
col2 TYPE t_col2,
col3 TYPE my_itab_type,
END OF nested_type.
DATA(itab_in_struc) = VALUE nested_type( col1 = 1
col2 = VALUE #(
col1 = 11
col2 = 22
)
col3 = VALUE #(
( col1 = 311 col2 = VALUE #( col1 = 3121 col2 = 3122 ) )
( col1 = 321 col2 = VALUE #( col1 = 3221 col2 = 3222 ) )
)
).
field_catalog = lo_cut->get_by_data( EXPORTING i_structure = itab_in_struc ).
cl_abap_unit_assert=>assert_equals(
EXPORTING
act = field_catalog[ 1 ]-fieldname
exp = |COL1|
msg = |Order of fieldcatalog fieldnames is not ok| ).
cl_abap_unit_assert=>assert_equals(
EXPORTING
act = field_catalog[ 2 ]-fieldname
exp = |COL2|
msg = |Order of fieldcatalog fieldnames is not ok| ).
cl_abap_unit_assert=>assert_equals(
EXPORTING
act = field_catalog[ 3 ]-fieldname
exp = |COL3|
msg = |Order of fieldcatalog fieldnames is not ok| ).
ENDMETHOD.
METHOD setup.
lo_cut = NEW ZCL_OP_SIMPLE_FIELD_CATALOG( ).
ENDMETHOD.
METHOD get_fieldcatalog_of_local_type.
TYPES: BEGIN OF ts_flight_data,
carrid TYPE s_carr_id,
connid TYPE s_conn_id,
fldate TYPE s_date,
price TYPE s_price,
END OF ts_flight_data,
tt_flight_data TYPE STANDARD TABLE OF ts_flight_data WITH EMPTY KEY,
BEGIN OF ts_flight_data_deep,
col1 TYPE tt_flight_data,
END OF ts_flight_data_deep,
tt_flight_data_deep TYPE STANDARD TABLE OF ts_flight_data_deep WITH EMPTY KEY.
DATA(flights) = VALUE tt_flight_data_deep( ( col1 = VALUE #(
( carrid = 'AA' connid = '0017' fldate = '20170810' price = '422.94 ' )
( carrid = 'AA' connid = '0017' fldate = '20170810' price = '422.94 ' )
)
)
( col1 = VALUE #(
( carrid = 'AA' connid = '0017' fldate = '20170810' price = '422.94 ' )
( carrid = 'AA' connid = '0017' fldate = '20170810' price = '422.94 ' )
)
)
).
DATA(lt_field_catalog) = lo_cut->get_by_data( i_table = flights ).
cl_abap_unit_assert=>assert_not_initial( EXPORTING act = lt_field_catalog[]
msg = |Field catalog was not created| ).
ENDMETHOD.
METHOD get_fieldcatalog_nostruc_table.
TYPES: tt_nostruc TYPE STANDARD TABLE OF i WITH EMPTY KEY.
DATA(table) = VALUE tt_nostruc( ( 1 ) ( 2 ) ( 3 ) ).
DATA(lt_field_catalog) = lo_cut->get_by_data( i_table = table ).
cl_abap_unit_assert=>assert_not_initial( EXPORTING act = lt_field_catalog[]
msg = |Field catalog was not created| ).
ENDMETHOD.
method get_fieldcat_of_local_typ_incl.
types begin of gtyp_struct.
include type t000.
types dummy_field_1 type i.
types dummy_field_2 type string.
types end of gtyp_struct .
data(ls_struct)
= value gtyp_struct(
mandt = '000'
logsys = 'DUMMY_1'
dummy_field_1 = 666
dummy_field_2 = 'Hello'
).
data(lt_field_catalog_act)
= lo_cut->get_fieldcat_from_local_type(
i_structure_description
= cast cl_abap_structdescr( cl_abap_structdescr=>describe_by_data( p_data = ls_struct ) )
).
data(lt_field_catalog_exp) = value lvc_t_fcat(
(
fieldname = 'MANDT'
outputlen = '000003'
seltext = 'MANDT'
inttype = 'C'
)
(
fieldname = 'MTEXT'
outputlen = '000025'
seltext = 'MTEXT'
inttype = 'C'
)
(
fieldname = 'ORT01'
outputlen = '000025'
seltext = 'ORT01'
inttype = 'C'
)
(
fieldname = 'MWAER'
outputlen = '000005'
seltext = 'MWAER'
inttype = 'C'
)
(
fieldname = 'ADRNR'
outputlen = '000010'
seltext = 'ADRNR'
inttype = 'C'
)
(
fieldname = 'CCCATEGORY'
outputlen = '000001'
seltext = 'CCCATEGORY'
inttype = 'C'
)
(
fieldname = 'CCCORACTIV'
outputlen = '000001'
seltext = 'CCCORACTIV'
inttype = 'C'
)
(
fieldname = 'CCNOCLIIND'
outputlen = '000001'
seltext = 'CCNOCLIIND'
inttype = 'C'
)
(
fieldname = 'CCCOPYLOCK'
outputlen = '000001'
seltext = 'CCCOPYLOCK'
inttype = 'C'
)
(
fieldname = 'CCNOCASCAD'
outputlen = '000001'
seltext = 'CCNOCASCAD'
inttype = 'C'
)
(
fieldname = 'CCSOFTLOCK'
outputlen = '000001'
seltext = 'CCSOFTLOCK'
inttype = 'C'
)
(
fieldname = 'CCORIGCONT'
outputlen = '000001'
seltext = 'CCORIGCONT'
inttype = 'C'
)
(
fieldname = 'CCIMAILDIS'
outputlen = '000001'
seltext = 'CCIMAILDIS'
inttype = 'C'
)
(
fieldname = 'CCTEMPLOCK'
outputlen = '000001'
seltext = 'CCTEMPLOCK'
inttype = 'C'
)
(
fieldname = 'CHANGEUSER'
outputlen = '000012'
seltext = 'CHANGEUSER'
inttype = 'C'
)
(
fieldname = 'CHANGEDATE'
outputlen = '000010'
seltext = 'CHANGEDATE'
inttype = 'D'
)
(
fieldname = 'LOGSYS'
outputlen = '000010'
convexit = '==ALP'
seltext = 'LOGSYS'
inttype = 'C'
)
(
fieldname = 'DUMMY_FIELD_1'
outputlen = '000011'
seltext = 'DUMMY_FIELD_1'
inttype = 'I'
)
(
fieldname = 'DUMMY_FIELD_2'
seltext = 'DUMMY_FIELD_2'
inttype = 'g'
)
).
cl_abap_unit_assert=>assert_equals(
exporting
act = lt_field_catalog_act
exp = lt_field_catalog_exp
* ignore_hash_sequence = abap_false
* tol =
* msg =
* level = if_abap_unit_constant=>severity-medium
* quit = if_abap_unit_constant=>quit-test
* receiving
* assertion_failed =
).
endmethod.
ENDCLASS.
| [
9,
1,
9,
779,
428,
2723,
2393,
329,
534,
9564,
2969,
4326,
1332,
6097,
198,
31631,
300,
83,
565,
62,
3245,
9246,
11794,
62,
21754,
5550,
20032,
17941,
23449,
1137,
22083,
13,
198,
31631,
1168,
5097,
62,
3185,
62,
48913,
16437,
62,
44603,
62,
34,
1404,
1847,
7730,
5550,
20032,
17941,
37347,
1847,
48167,
1677,
5258,
300,
83,
565,
62,
3245,
9246,
11794,
62,
21754,
13,
198,
31631,
300,
83,
565,
62,
3245,
9246,
11794,
62,
21754,
5550,
20032,
17941,
25261,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
8968,
41876,
4526,
37,
5390,
1168,
5097,
62,
3185,
62,
48913,
16437,
62,
44603,
62,
34,
1404,
1847,
7730,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
220,
220,
651,
62,
25747,
62,
259,
62,
3506,
62,
2875,
220,
220,
220,
220,
220,
220,
220,
220,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
651,
62,
3245,
9246,
11794,
62,
1659,
62,
12001,
62,
4906,
220,
220,
220,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
651,
62,
3245,
9246,
11794,
62,
77,
455,
622,
66,
62,
11487,
220,
220,
220,
7473,
43001,
2751,
17926,
1797,
2751,
43213,
62,
12708,
62,
9122,
11,
198,
220,
220,
220,
220,
220,
651,
62,
3245,
9246,
62,
1659,
62,
12001,
62,
28004,
62,
259,
565,
220,
220,
220,
329,
4856,
8620,
43213,
62,
12708,
62,
9122,
13,
198,
10619,
31631,
13,
628,
198,
31631,
300,
83,
565,
62,
3245,
9246,
11794,
62,
21754,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
651,
62,
25747,
62,
259,
62,
3506,
62,
2875,
13,
198,
220,
220,
220,
42865,
25,
2214,
62,
9246,
11794,
41876,
300,
28435,
62,
83,
62,
69,
9246,
13,
628,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
256,
62,
4033,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
951,
16,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
951,
17,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
256,
62,
4033,
17,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
256,
62,
7249,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
951,
16,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
951,
17,
41876,
256,
62,
4033,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
256,
62,
7249,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
616,
62,
270,
397,
62,
4906,
41876,
49053,
9795,
43679,
3963,
256,
62,
7249,
13315,
5550,
38865,
35374,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
28376,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
951,
16,
41876,
1312,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
951,
17,
41876,
256,
62,
4033,
17,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
951,
18,
41876,
616,
62,
270,
397,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
28376,
62,
4906,
13,
628,
220,
220,
220,
42865,
7,
270,
397,
62,
259,
62,
19554,
66,
8,
796,
26173,
8924,
28376,
62,
4906,
7,
951,
16,
796,
352,
628,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
951,
17,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
951,
16,
796,
1367,
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,
951,
17,
796,
2534,
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,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
951,
18,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
951,
16,
796,
35592,
951,
17,
796,
26173,
8924,
1303,
7,
951,
16,
796,
513,
19244,
951,
17,
796,
513,
18376,
1267,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
357,
951,
16,
796,
39595,
951,
17,
796,
26173,
8924,
1303,
7,
951,
16,
796,
513,
26115,
951,
17,
796,
513,
23148,
1267,
1267,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS ycl_abapgit_object_sfpi DEFINITION PUBLIC INHERITING FROM ycl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES yif_abapgit_object.
ALIASES mo_files FOR yif_abapgit_object~mo_files.
PRIVATE SECTION.
METHODS:
load
RETURNING VALUE(ri_wb_interface) TYPE REF TO if_fp_wb_interface
RAISING ycx_abapgit_exception,
interface_to_xstring
RETURNING VALUE(rv_xstr) TYPE xstring
RAISING ycx_abapgit_exception.
ENDCLASS.
CLASS ycl_abapgit_object_sfpi IMPLEMENTATION.
METHOD yif_abapgit_object~has_changed_since.
rv_changed = abap_true.
ENDMETHOD.
METHOD yif_abapgit_object~changed_by.
SELECT SINGLE lastuser FROM fpinterface
INTO rv_user
WHERE name = ms_item-obj_name
AND state = 'A'.
IF rv_user IS INITIAL.
SELECT SINGLE firstuser FROM fpinterface
INTO rv_user
WHERE name = ms_item-obj_name
AND state = 'A'.
ENDIF.
IF rv_user IS INITIAL.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD yif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
ENDMETHOD.
METHOD yif_abapgit_object~exists.
DATA: lv_name TYPE fpinterface-name.
SELECT SINGLE name FROM fpinterface
INTO lv_name
WHERE name = ms_item-obj_name
AND state = 'A'.
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD yif_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 yif_abapgit_object~delete.
DATA: lv_name TYPE fpname,
lo_wb_interface TYPE REF TO cl_fp_wb_interface.
lo_wb_interface ?= load( ).
lv_name = ms_item-obj_name.
TRY.
lo_wb_interface->delete( lv_name ).
CATCH cx_fp_api.
ycx_abapgit_exception=>raise( 'SFPI error, delete' ).
ENDTRY.
ENDMETHOD.
METHOD load.
DATA: lv_name TYPE fpname.
lv_name = ms_item-obj_name.
TRY.
ri_wb_interface = cl_fp_wb_interface=>load( lv_name ).
CATCH cx_fp_api.
ycx_abapgit_exception=>raise( 'SFPI error, load' ).
ENDTRY.
ENDMETHOD.
METHOD interface_to_xstring.
DATA: li_fp_interface TYPE REF TO if_fp_interface,
li_wb_interface TYPE REF TO if_fp_wb_interface.
TRY.
li_wb_interface = load( ).
li_fp_interface ?= li_wb_interface->get_object( ).
rv_xstr = cl_fp_helper=>convert_interface_to_xstring( li_fp_interface ).
CATCH cx_fp_api.
ycx_abapgit_exception=>raise( 'SFPI error, interface_to_xstring' ).
ENDTRY.
ENDMETHOD.
METHOD yif_abapgit_object~serialize.
DATA: lv_xstr TYPE xstring,
li_document TYPE REF TO if_ixml_document.
lv_xstr = interface_to_xstring( ).
li_document = cl_ixml_80_20=>parse_to_document( stream_xstring = lv_xstr ).
ycl_abapgit_object_sfpf=>fix_oref( li_document ).
io_xml->set_raw( li_document->get_root_element( ) ).
ENDMETHOD.
METHOD yif_abapgit_object~deserialize.
DATA: lv_xstr TYPE xstring,
lv_name TYPE fpname,
li_wb_object TYPE REF TO if_fp_wb_interface,
li_interface TYPE REF TO if_fp_interface.
lv_name = ms_item-obj_name.
lv_xstr = cl_ixml_80_20=>render_to_xstring( io_xml->get_raw( ) ).
TRY.
li_interface = cl_fp_helper=>convert_xstring_to_interface( lv_xstr ).
tadir_insert( iv_package ).
li_wb_object = cl_fp_wb_interface=>create( i_name = lv_name
i_interface = li_interface ).
li_wb_object->save( ).
li_wb_object->free( ).
CATCH cx_fp_api.
ycx_abapgit_exception=>raise( 'SFPI error, deserialize' ).
ENDTRY.
ycl_abapgit_objects_activation=>add_item( ms_item ).
ENDMETHOD.
METHOD yif_abapgit_object~compare_to_remote_version.
CREATE OBJECT ro_comparison_result TYPE ycl_abapgit_comparison_null.
ENDMETHOD.
METHOD yif_abapgit_object~is_locked.
DATA: lv_object TYPE seqg3-garg.
lv_object = |{ ms_item-obj_name }|.
OVERLAY lv_object WITH ' '.
lv_object = lv_object && '*'.
rv_is_locked = exists_a_lock_entry_for( iv_lock_object = 'EFPINTERFACE'
iv_argument = lv_object ).
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
565,
62,
397,
499,
18300,
62,
15252,
62,
28202,
14415,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
331,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
331,
361,
62,
397,
499,
18300,
62,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
7473,
331,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
3440,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
380,
62,
39346,
62,
39994,
8,
41876,
4526,
37,
5390,
611,
62,
46428,
62,
39346,
62,
39994,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
331,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
7071,
62,
1462,
62,
87,
8841,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
85,
62,
87,
2536,
8,
41876,
2124,
8841,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
331,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
331,
565,
62,
397,
499,
18300,
62,
15252,
62,
28202,
14415,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
331,
361,
62,
397,
499,
18300,
62,
15252,
93,
10134,
62,
40985,
62,
20777,
13,
198,
220,
220,
220,
374,
85,
62,
40985,
796,
450,
499,
62,
7942,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
331,
361,
62,
397,
499,
18300,
62,
15252,
93,
40985,
62,
1525,
13,
628,
220,
220,
220,
33493,
311,
2751,
2538,
938,
7220,
16034,
277,
79,
39994,
198,
220,
220,
220,
220,
220,
39319,
374,
85,
62,
7220,
198,
220,
220,
220,
220,
220,
33411,
1438,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
5357,
1181,
796,
705,
32,
4458,
198,
220,
220,
220,
16876,
374,
85,
62,
7220,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
33493,
311,
2751,
2538,
717,
7220,
16034,
277,
79,
39994,
198,
220,
220,
220,
220,
220,
220,
220,
39319,
374,
85,
62,
7220,
198,
220,
220,
220,
220,
220,
220,
220,
33411,
1438,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
5357,
1181,
796,
705,
32,
4458,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
16876,
374,
85,
62,
7220,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
374,
85,
62,
7220,
796,
269,
62,
7220,
62,
34680,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
331,
361,
62,
397,
499,
18300,
62,
15252,
93,
1136,
62,
38993,
13,
198,
220,
220,
220,
44608,
62,
38993,
796,
651,
62,
38993,
7,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
331,
361,
62,
397,
499,
18300,
62,
15252,
93,
1069,
1023,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
3672,
41876,
277,
79,
39994,
12,
3672,
13,
628,
220,
220,
220,
33493,
311,
2751,
2538,
1438,
16034,
277,
79,
39994,
198,
220,
220,
220,
220,
220,
39319,
300,
85,
62,
3672,
198,
220,
220,
220,
220,
220,
33411,
1438,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
5357,
1181,
796,
705,
32,
4458,
198,
220,
220,
220,
374,
85,
62,
30388,
796,
20512,
66,
7,
827,
12,
7266,
6015,
796,
657,
6739,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
331,
361,
62,
397,
499,
18300,
62,
15252,
93,
43327,
13,
628,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
6998,
62,
10468,
3535,
62,
26861,
7597,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
4905,
220,
220,
796,
705,
9693,
3913,
6,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
2134,
62,
4906,
796,
13845,
62,
9186,
12,
26801,
62,
4906,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
331,
361,
62,
397,
499,
18300,
62,
15252,
93,
33678,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
277,
79,
3672,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
39346,
62,
39994,
41876,
4526,
37,
5390,
537,
62,
46428,
62,
39346,
62,
39994,
13,
628,
198,
220,
220,
220,
2376,
62,
39346,
62,
39994,
5633,
28,
3440,
7,
6739,
628,
220,
220,
220,
300,
85,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
39346,
62,
39994,
3784,
33678,
7,
300,
85,
62,
3672,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
46428,
62,
15042,
13,
198,
220,
220,
220,
220,
220,
220,
220,
331,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
50,
5837,
40,
4049,
11,
12233,
6,
6739,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
3440,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
3672,
41876,
277,
79,
3672,
13,
628,
198,
220,
220,
220,
300,
85,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
374,
72,
62,
39346,
62,
39994,
796,
537,
62,
46428,
62,
39346,
62,
39994,
14804,
2220,
7,
300,
85,
62,
3672,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
46428,
62,
15042,
13,
198,
220,
220,
220,
220,
220,
220,
220,
331,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
705,
50,
5837,
40,
4049,
11,
3440,
6,
6739,
198,
220,
220,
220,
23578,
40405
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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_THREAD_RUNNER'. "#EC NOTEXT
methods run
abstract .
methods get_state_ref
abstract
returning
value(rv_ref) type ref to data .
methods serialize_state
returning
value(rv_xstr) type xstring .
methods deserialize_state
importing
!iv_xstr type xstring .
methods run_parallel
importing
!iv_thread_name type clike optional .
methods on_end_of_task
importing
!p_task type clike .
methods is_ready
returning
value(rv_yes) type abap_bool .
methods has_error
returning
value(rv_yes) type abap_bool .
methods error
returning
value(rv_error) type string .
methods set_dispatcher
importing
!io_dispatcher type ref to zcl_thread_queue_dispatcher .
protected section.
data mv_error type string.
data mv_ready type abap_bool.
data mo_queue_dispatcher type ref to zcl_thread_queue_dispatcher.
methods debug
importing
iv_msg type string.
private section.
ENDCLASS.
CLASS ZCL_THREAD_RUNNER_SLUG IMPLEMENTATION.
method debug.
* field-symbols <log> type string_table.
* assign ('(ZTHREAD_RUNNER_TEST_MULTI_ONLY)gt_log') to <log>.
* if sy-subrc is initial.
* append iv_msg to <log>.
* endif.
endmethod.
method deserialize_state.
data lv_ref type ref to data.
field-symbols <state> type any.
lv_ref = get_state_ref( ).
assign lv_ref->* to <state>.
import data = <state> from data buffer iv_xstr.
assert sy-subrc = 0.
endmethod.
method error.
rv_error = mv_error.
endmethod.
method has_error.
rv_yes = boolc( mv_error is not initial ).
endmethod.
method is_ready.
rv_yes = mv_ready.
endmethod.
method on_end_of_task.
data lv_xstr type xstring.
receive results from function c_runner_fm_name
importing
ev_raw_result = lv_xstr
exceptions
others = 4.
if sy-subrc <> 0.
mv_error = |{ sy-msgv1 }{ sy-msgv2 }{ sy-msgv3 }{ sy-msgv3 }|.
else.
deserialize_state( lv_xstr ).
endif.
mv_ready = abap_true.
if mo_queue_dispatcher is bound. " Queued thread
mo_queue_dispatcher->clear_thread( |{ p_task }| ).
endif.
endmethod.
method run_parallel.
data lv_class_name type string.
data lv_xstr type xstring.
data lv_thread_name type string.
data lv_server_group type rzlli_apcl.
lv_server_group = zcl_thread_queue_dispatcher=>c_default_group.
lv_thread_name = iv_thread_name.
if mo_queue_dispatcher is bound. " Queued thread
lv_server_group = mo_queue_dispatcher->get_server_group( ).
lv_thread_name = mo_queue_dispatcher->get_free_thread( ).
endif.
assert lv_thread_name is not initial.
lv_class_name = cl_abap_typedescr=>describe_by_object_ref( me )->absolute_name.
lv_xstr = serialize_state( ).
debug( |runner->run_parallel({ lv_thread_name }), pre start| ).
call function c_runner_fm_name
starting new task lv_thread_name
destination in group lv_server_group
calling on_end_of_task on end of task
exporting
iv_runner_class_name = lv_class_name
iv_raw_params = lv_xstr
exceptions
communication_failure = 1
system_failure = 2
resource_failure = 3
others = 4.
data(rc) = sy-subrc.
if rc = 3.
data r_free_threads type i.
CALL FUNCTION 'SPBT_GET_CURR_RESOURCE_INFO'
IMPORTING
free_pbt_wps = r_free_threads
EXCEPTIONS
internal_error = 1
pbt_env_not_initialized_yet = 2
OTHERS = 3.
debug( |runner->run_parallel({ lv_thread_name }), resource_failure, free_threads = { r_free_threads }, rc={ sy-subrc }| ).
* if r_free_threads = 0 or sy-subrc <> 0.
* debug( ' ^^^^^^^^^^^^^^^^^^' ).
* endif.
endif.
if rc <> 0.
mv_error = |starting new task failed with rc={ rc }: { sy-msgv1 }{ sy-msgv2 }{ sy-msgv3 }{ sy-msgv3 }|.
mv_ready = abap_true.
debug( |runner->run_parallel({ lv_thread_name }), failed: { mv_error }| ).
if mo_queue_dispatcher is bound. " Queued thread
mo_queue_dispatcher->clear_thread( |{ lv_thread_name }| ).
endif.
else.
debug( |runner->run_parallel({ lv_thread_name }), started ok| ).
endif.
endmethod.
method serialize_state.
data lv_ref type ref to data.
field-symbols <state> type any.
lv_ref = get_state_ref( ).
assign lv_ref->* to <state>.
export data = <state> to data buffer rv_xstr.
assert sy-subrc = 0.
endmethod.
method set_dispatcher.
mo_queue_dispatcher = io_dispatcher.
endmethod.
ENDCLASS.
| [
4871,
1168,
5097,
62,
4221,
15675,
62,
49,
4944,
21479,
62,
8634,
7340,
6770,
198,
220,
1171,
198,
220,
12531,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
38491,
269,
62,
16737,
62,
38353,
62,
3672,
2099,
4731,
1988,
705,
57,
62,
4221,
15675,
62,
49,
4944,
21479,
4458,
25113,
2943,
5626,
13918,
628,
220,
5050,
1057,
198,
220,
12531,
764,
198,
220,
5050,
651,
62,
5219,
62,
5420,
198,
220,
12531,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
81,
85,
62,
5420,
8,
2099,
1006,
284,
1366,
764,
198,
220,
5050,
11389,
1096,
62,
5219,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
81,
85,
62,
87,
2536,
8,
2099,
2124,
8841,
764,
198,
220,
5050,
748,
48499,
1096,
62,
5219,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
87,
2536,
2099,
2124,
8841,
764,
198,
220,
5050,
1057,
62,
1845,
29363,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
452,
62,
16663,
62,
3672,
2099,
537,
522,
11902,
764,
198,
220,
5050,
319,
62,
437,
62,
1659,
62,
35943,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
79,
62,
35943,
2099,
537,
522,
764,
198,
220,
5050,
318,
62,
1493,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
81,
85,
62,
8505,
8,
2099,
450,
499,
62,
30388,
764,
198,
220,
5050,
468,
62,
18224,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
81,
85,
62,
8505,
8,
2099,
450,
499,
62,
30388,
764,
198,
220,
5050,
4049,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
81,
85,
62,
18224,
8,
2099,
4731,
764,
198,
220,
5050,
900,
62,
6381,
8071,
2044,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
952,
62,
6381,
8071,
2044,
2099,
1006,
284,
1976,
565,
62,
16663,
62,
36560,
62,
6381,
8071,
2044,
764,
198,
220,
6861,
2665,
13,
628,
220,
220,
220,
1366,
285,
85,
62,
18224,
2099,
4731,
13,
198,
220,
220,
220,
1366,
285,
85,
62,
1493,
2099,
450,
499,
62,
30388,
13,
198,
220,
220,
220,
1366,
6941,
62,
36560,
62,
6381,
8071,
2044,
2099,
1006,
284,
1976,
565,
62,
16663,
62,
36560,
62,
6381,
8071,
2044,
13,
628,
220,
220,
220,
5050,
14257,
198,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
19662,
2099,
4731,
13,
628,
220,
2839,
2665,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
4221,
15675,
62,
49,
4944,
21479,
62,
8634,
7340,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
2446,
14257,
13,
198,
9,
220,
220,
220,
2214,
12,
1837,
2022,
10220,
1279,
6404,
29,
2099,
4731,
62,
11487,
13,
198,
9,
220,
220,
220,
8333,
19203,
7,
57,
4221,
15675,
62,
49,
4944,
21479,
62,
51,
6465,
62,
44,
16724,
40,
62,
1340,
11319,
8,
13655,
62,
6404,
11537,
284,
1279,
6404,
28401,
198,
9,
220,
220,
220,
611,
827,
12,
7266,
6015,
318,
4238,
13,
198,
9,
220,
220,
220,
220,
220,
24443,
21628,
62,
19662,
284,
1279,
6404,
28401,
198,
9,
220,
220,
220,
45762,
13,
198,
220,
886,
24396,
13,
628,
198,
220,
2446,
748,
48499,
1096,
62,
5219,
13,
198,
220,
220,
220,
1366,
300,
85,
62,
5420,
2099,
1006,
284,
1366,
13,
198,
220,
220,
220,
2214,
12,
1837,
2022,
10220,
1279,
5219,
29,
2099,
597,
13,
628,
220,
220,
220,
300,
85,
62,
5420,
796,
651,
62,
5219,
62,
5420,
7,
6739,
198,
220,
220,
220,
8333,
300,
85,
62,
5420,
3784,
9,
284,
1279,
5219,
28401,
198,
220,
220,
220,
1330,
1366,
796,
1279,
5219,
29,
422,
1366,
11876,
21628,
62,
87,
2536,
13,
198,
220,
220,
220,
6818,
827,
12,
7266,
6015,
796,
657,
13,
198,
220,
886,
24396,
13,
628,
198,
220,
2446,
4049,
13,
198,
220,
220,
220,
374,
85,
62,
18224,
796,
285,
85,
62,
18224,
13,
198,
220,
886,
24396,
13,
628,
198,
220,
2446,
468,
62,
18224,
13,
198,
220,
220,
220,
374,
85,
62,
8505,
796,
20512,
66,
7,
285,
85,
62,
18224,
318,
407,
4238,
6739,
198,
220,
886,
24396,
13,
628,
198,
220,
2446,
318,
62,
1493,
13,
198,
220,
220,
220,
374,
85,
62,
8505,
796,
285,
85,
62,
1493,
13,
198,
220,
886,
24396,
13,
628,
198,
220,
2446,
319,
62,
437,
62,
1659,
62,
35943,
13,
628,
220,
220,
220,
1366,
300,
85,
62,
87,
2536,
2099,
2124,
8841,
13,
628,
220,
220,
220,
3328,
2482,
422,
2163,
269,
62,
16737,
62,
38353,
62,
3672,
198,
220,
220,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
220,
220,
819,
62,
1831,
62,
20274,
796,
300,
85,
62,
87,
2536,
198,
220,
220,
220,
220,
220,
13269,
198,
220,
220,
220,
220,
220,
220,
220,
1854,
220,
220,
220,
220,
220,
220,
220,
796,
604,
13,
628,
220,
220,
220,
611,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
285,
85,
62,
18224,
796,
930,
90,
827,
12,
19662,
85,
16,
1782,
90,
827,
12,
19662,
85,
17,
1782,
90,
827,
12,
19662,
85,
18,
1782,
90,
827,
12,
19662,
85,
18,
1782,
91,
13,
198,
220,
220,
220,
2073,
13,
198,
220,
220,
220,
220,
220,
748,
48499,
1096,
62,
5219,
7,
300,
85,
62,
87,
2536,
6739,
198,
220,
220,
220,
45762,
13,
628,
220,
220,
220,
285,
85,
62,
1493,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
611,
6941,
62,
36560,
62,
6381,
8071,
2044,
318,
5421,
13,
366,
4670,
1739,
4704,
198,
220,
220,
220,
220,
220,
6941,
62,
36560,
62,
6381,
8071,
2044,
3784,
20063,
62,
16663,
7,
930,
90,
279,
62,
35943,
1782,
91,
6739,
198,
220,
220,
220,
45762,
13,
628,
220,
886,
24396,
13,
628,
198,
220,
2446,
1057,
62,
1845,
29363,
13,
628,
220,
220,
220,
1366,
300,
85,
62,
4871,
62,
3672,
2099,
4731,
13,
198,
220,
220,
220,
1366,
300,
85,
62,
87,
2536,
2099
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS z2mse_famix_inheritance DEFINITION INHERITING FROM Z2MSE_famix_association
PUBLIC
CREATE PUBLIC.
PUBLIC SECTION.
METHODS constructor IMPORTING model TYPE REF TO z2mse_model.
"! defines an inheritance
"! @parameter element_id | the ID of the element where the ID shall be added
"! @parameter subclass_element | the FAMIX element of the subclass Type
"! @parameter subclass_name_group | the name group of the subclass
"! @parameter subclass_name | the name of the subclass
"! @parameter superclass_element | the FAMIX element of the subclass Type
"! @parameter superclass_name_group | the name group
"! @parameter superclass_name | the name of the subclass of the superclass
METHODS set_sub_and_super_class
IMPORTING
element_id TYPE i
subclass_element TYPE clike
subclass_name_group TYPE clike
subclass_name TYPE clike
superclass_element TYPE clike
superclass_name_group TYPE clike
superclass_name TYPE clike.
ENDCLASS.
CLASS z2mse_famix_inheritance IMPLEMENTATION.
METHOD constructor.
CALL METHOD super->constructor( model ).
g_elementname = 'FAMIX.Inheritance'.
ENDMETHOD.
METHOD set_sub_and_super_class.
g_model->add_reference_by_name( EXPORTING element_id = element_id
attribute_name = 'subclass'
type_of_reference = subclass_element
name_group_of_reference = subclass_name_group
name_of_reference = subclass_name ).
g_model->add_reference_by_name( EXPORTING element_id = element_id
attribute_name = 'superclass'
type_of_reference = superclass_element
name_group_of_reference = superclass_name_group
name_of_reference = superclass_name ).
ENDMETHOD.
ENDCLASS.
| [
198,
198,
31631,
1976,
17,
76,
325,
62,
44769,
844,
62,
259,
372,
42942,
5550,
20032,
17941,
3268,
16879,
2043,
2751,
16034,
1168,
17,
44,
5188,
62,
44769,
844,
62,
562,
41003,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
13,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
23772,
30023,
9863,
2751,
2746,
41876,
4526,
37,
5390,
1976,
17,
76,
325,
62,
19849,
13,
198,
220,
220,
220,
366,
0,
15738,
281,
24155,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
5002,
62,
312,
930,
262,
4522,
286,
262,
5002,
810,
262,
4522,
2236,
307,
2087,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
47611,
62,
30854,
930,
262,
42129,
10426,
5002,
286,
262,
47611,
5994,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
47611,
62,
3672,
62,
8094,
930,
262,
1438,
1448,
286,
262,
47611,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
47611,
62,
3672,
930,
262,
1438,
286,
262,
47611,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
2208,
4871,
62,
30854,
930,
262,
42129,
10426,
5002,
286,
262,
47611,
5994,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
2208,
4871,
62,
3672,
62,
8094,
930,
262,
1438,
1448,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
2208,
4871,
62,
3672,
930,
262,
1438,
286,
262,
47611,
286,
262,
2208,
4871,
198,
220,
220,
220,
337,
36252,
50,
900,
62,
7266,
62,
392,
62,
16668,
62,
4871,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5002,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
47611,
62,
30854,
220,
220,
220,
220,
220,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
220,
220,
47611,
62,
3672,
62,
8094,
220,
220,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
220,
220,
47611,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
220,
220,
2208,
4871,
62,
30854,
220,
220,
220,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
220,
220,
2208,
4871,
62,
3672,
62,
8094,
41876,
537,
522,
198,
220,
220,
220,
220,
220,
220,
220,
2208,
4871,
62,
3672,
220,
220,
220,
220,
220,
220,
41876,
537,
522,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
1976,
17,
76,
325,
62,
44769,
844,
62,
259,
372,
42942,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
42815,
337,
36252,
2208,
3784,
41571,
273,
7,
2746,
6739,
198,
220,
220,
220,
308,
62,
30854,
3672,
796,
705,
37,
2390,
10426,
13,
818,
372,
42942,
4458,
198,
220,
23578,
49273,
13,
198,
220,
337,
36252,
900,
62,
7266,
62,
392,
62,
16668,
62,
4871,
13,
198,
220,
220,
220,
308,
62,
19849,
3784,
2860,
62,
35790,
62,
1525,
62,
3672,
7,
7788,
15490,
2751,
5002,
62,
312,
796,
5002,
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,
11688,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
7266,
4871,
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,
2099,
62,
1659,
62,
35790,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
47611,
62,
30854,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
62,
8094,
62,
1659,
62,
35790,
796,
47611,
62,
3672,
62,
8094,
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,
1438,
62,
1659,
62,
35790,
220,
220,
220,
220,
220,
220,
796,
47611,
62,
3672,
6739,
198,
220,
220,
220,
308,
62,
19849,
3784,
2860,
62,
35790,
62,
1525,
62,
3672,
7,
7788,
15490,
2751,
5002,
62,
312,
796,
5002,
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,
11688,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
705,
16668,
4871,
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,
2099,
62,
1659,
62,
35790,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
2208,
4871,
62,
30854,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1438,
62,
8094,
62,
1659,
62,
35790,
796,
2208,
4871,
62,
3672,
62,
8094,
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,
1438,
62,
1659,
62,
35790,
220,
220,
220,
220,
220,
220,
796,
2208,
4871,
62,
3672,
6739,
628,
220,
23578,
49273,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
"! abapGit API facade
"! <p>
"! https://docs.abapgit.org/development/api.html
"! </p>
"! <p>
"! There is no hardcoded dependency to abapGit because CILIB_EXIT might be used on production and test systems
"! while abapGit might only be installed in a local package on the development system. Events are redirected to the
"! development system using RFC.
"! </p>
CLASS zcl_cilib_git_abapgit DEFINITION
PUBLIC
FINAL
CREATE PRIVATE
GLOBAL FRIENDS zcl_cilib_factory.
PUBLIC SECTION.
INTERFACES:
zif_cilib_git_abapgit.
METHODS:
constructor.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_cilib_git_abapgit IMPLEMENTATION.
METHOD zif_cilib_git_abapgit~get_repo_url.
DATA: lo_repo_srv TYPE REF TO object,
lo_repo TYPE REF TO object.
TRY.
CALL METHOD ('ZCL_ABAPGIT_REPO_SRV')=>('GET_INSTANCE')
RECEIVING
ri_srv = lo_repo_srv.
CALL METHOD lo_repo_srv->('ZIF_ABAPGIT_REPO_SRV~GET')
EXPORTING
iv_key = iv_repo_key
RECEIVING
ro_repo = lo_repo.
IF cl_abap_typedescr=>describe_by_object_ref( lo_repo )->absolute_name NP '\CLASS=ZCL_ABAPGIT_REPO_ONLINE*'.
RAISE EXCEPTION TYPE zcx_cilib_not_found.
ENDIF.
CALL METHOD lo_repo->('GET_URL')
RECEIVING
rv_url = rv_url.
CATCH cx_root INTO DATA(lx_ex).
IF cl_abap_typedescr=>describe_by_object_ref( lx_ex )->absolute_name CP '\CLASS=ZCX_ABAPGIT_EXCEPTION*'.
RAISE EXCEPTION TYPE zcx_cilib_not_found.
ELSE.
RAISE EXCEPTION lx_ex.
ENDIF.
ENDTRY.
ENDMETHOD.
METHOD zif_cilib_git_abapgit~is_object_part_of_online_repo.
DATA: lt_package_range TYPE RANGE OF devclass,
lo_found_repo TYPE REF TO object,
lo_repo_srv TYPE REF TO object,
lt_repos TYPE STANDARD TABLE OF REF TO object,
lv_repo_package TYPE devclass.
SELECT SINGLE devclass INTO @DATA(lv_package)
FROM tadir
WHERE pgmid = 'R3TR'
AND object = @is_object-type
AND obj_name = @is_object-name.
IF sy-subrc <> 0 OR lv_package IS INITIAL.
RAISE EXCEPTION TYPE zcx_cilib_not_found.
ENDIF.
INSERT VALUE #( sign = 'I' option = 'EQ' low = lv_package ) INTO TABLE lt_package_range.
DO.
SELECT SINGLE parentcl INTO @DATA(lv_parent_package)
FROM tdevc
WHERE devclass = @lv_package.
ASSERT sy-subrc = 0.
IF lv_parent_package IS INITIAL OR lv_parent_package = lv_package.
EXIT.
ENDIF.
INSERT VALUE #( sign = 'I' option = 'EQ' low = lv_parent_package ) INTO TABLE lt_package_range.
lv_package = lv_parent_package.
ENDDO.
CALL METHOD ('ZCL_ABAPGIT_REPO_SRV')=>('GET_INSTANCE')
RECEIVING
ri_srv = lo_repo_srv.
CALL METHOD lo_repo_srv->('ZIF_ABAPGIT_REPO_SRV~LIST')
RECEIVING
rt_list = lt_repos.
LOOP AT lt_repos INTO DATA(lo_repo).
CALL METHOD lo_repo->('GET_PACKAGE')
RECEIVING
rv_package = lv_repo_package.
IF lv_repo_package IN lt_package_range.
IF cl_abap_typedescr=>describe_by_object_ref( lo_repo )->absolute_name CP '\CLASS=ZCL_ABAPGIT_REPO_ONLINE*'.
lo_found_repo = lo_repo.
EXIT.
ENDIF.
ENDIF.
ENDLOOP.
IF lo_found_repo IS BOUND.
rv_is_part = abap_true.
CALL METHOD lo_found_repo->('GET_KEY')
RECEIVING
rv_key = ev_repo_key.
ELSE.
RAISE EXCEPTION TYPE zcx_cilib_not_found.
ENDIF.
ENDMETHOD.
METHOD constructor.
CONSTANTS: lc_version_attribute TYPE string VALUE `ZIF_ABAPGIT_VERSION=>GC_ABAP_VERSION`.
FIELD-SYMBOLS: <lv_version> TYPE string.
ASSIGN (lc_version_attribute) TO <lv_version>.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_cilib_git_abapgit_missing.
ENDIF.
SPLIT <lv_version> AT '.' INTO DATA(lv_major) DATA(lv_minor) DATA(lv_patch).
IF lv_major < 1 OR ( lv_major = 1 AND lv_minor < 81 ).
RAISE EXCEPTION TYPE zcx_cilib_git_abapgit_missing.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
40484,
450,
499,
38,
270,
7824,
43562,
198,
40484,
1279,
79,
29,
198,
40484,
3740,
1378,
31628,
13,
397,
499,
18300,
13,
2398,
14,
31267,
14,
15042,
13,
6494,
198,
40484,
7359,
79,
29,
198,
40484,
1279,
79,
29,
198,
40484,
1318,
318,
645,
1327,
40976,
20203,
284,
450,
499,
38,
270,
780,
327,
4146,
9865,
62,
6369,
2043,
1244,
307,
973,
319,
3227,
290,
1332,
3341,
198,
40484,
981,
450,
499,
38,
270,
1244,
691,
307,
6589,
287,
257,
1957,
5301,
319,
262,
2478,
1080,
13,
18715,
389,
45158,
284,
262,
198,
40484,
2478,
1080,
1262,
30978,
13,
198,
40484,
7359,
79,
29,
198,
31631,
1976,
565,
62,
2856,
571,
62,
18300,
62,
397,
499,
18300,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
4810,
3824,
6158,
198,
220,
10188,
9864,
1847,
48167,
1677,
5258,
1976,
565,
62,
2856,
571,
62,
69,
9548,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
25,
198,
220,
220,
220,
220,
220,
1976,
361,
62,
2856,
571,
62,
18300,
62,
397,
499,
18300,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
23772,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
2856,
571,
62,
18300,
62,
397,
499,
18300,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
1976,
361,
62,
2856,
571,
62,
18300,
62,
397,
499,
18300,
93,
1136,
62,
260,
7501,
62,
6371,
13,
198,
220,
220,
220,
42865,
25,
2376,
62,
260,
7501,
62,
27891,
85,
41876,
4526,
37,
5390,
2134,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
260,
7501,
220,
220,
220,
220,
41876,
4526,
37,
5390,
2134,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42815,
337,
36252,
19203,
57,
5097,
62,
6242,
2969,
38,
2043,
62,
2200,
16402,
62,
12562,
53,
11537,
14804,
10786,
18851,
62,
38604,
19240,
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,
374,
72,
62,
27891,
85,
796,
2376,
62,
260,
7501,
62,
27891,
85,
13,
628,
220,
220,
220,
220,
220,
220,
220,
42815,
337,
36252,
2376,
62,
260,
7501,
62,
27891,
85,
3784,
10786,
57,
5064,
62,
6242,
2969,
38,
2043,
62,
2200,
16402,
62,
12562,
53,
93,
18851,
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,
21628,
62,
2539,
220,
796,
21628,
62,
260,
7501,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
19644,
36,
3824,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
686,
62,
260,
7501,
796,
2376,
62,
260,
7501,
13,
628,
220,
220,
220,
220,
220,
220,
220,
16876,
537,
62,
397,
499,
62,
774,
9124,
3798,
81,
14804,
20147,
4892,
62,
1525,
62,
15252,
62,
5420,
7,
2376,
62,
260,
7501,
1267,
3784,
48546,
62,
3672,
28498,
705,
59,
31631,
28,
57,
5097,
62,
6242,
2969,
38,
2043,
62,
2200,
16402,
62,
1340,
24027,
9,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17926,
24352,
7788,
42006,
2849,
41876,
1976,
66,
87,
62,
2856,
571,
62,
1662,
62,
9275,
13,
198,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
220,
220,
220,
220,
42815,
337,
36252,
2376,
62,
260,
7501,
3784,
10786,
18851,
62,
21886,
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,
374,
85,
62,
6371,
796,
374,
85,
62,
6371,
13,
628,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
15763,
39319,
42865,
7,
75,
87,
62,
1069,
737,
198,
220,
220,
220,
220,
220,
220,
220,
16876,
537,
62,
397,
499,
62,
774,
9124,
3798,
81,
14804,
20147,
4892,
62,
1525,
62,
15252,
62,
5420,
7,
300,
87,
62,
1069,
1267,
3784,
48546,
62,
3672,
16932,
705,
59,
31631,
28,
57,
34,
55,
62,
6242,
2969,
38,
2043,
62,
6369,
42006,
2849,
9,
4458,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17926,
24352,
7788,
42006,
2849,
41876,
1976,
66,
87,
62,
2856,
571,
62,
1662,
62,
9275,
13,
198,
220,
220,
220,
220,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
17926,
24352,
7788,
42006,
2849,
300,
87,
62,
1069,
13,
198,
220,
220,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
40405,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1976,
361,
62,
2856,
571,
62,
18300,
62,
397,
499,
18300,
93,
271,
62,
15252,
62,
3911,
62,
1659,
62,
25119,
62,
260,
7501,
13,
198,
220,
220,
220,
42865,
25,
300,
83,
62,
26495,
62,
9521,
41876,
371,
27746,
3963,
1614,
4871,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
9275,
62,
260,
7501,
220,
220,
220,
41876,
4526,
37,
5390,
2134,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
260,
7501,
62,
27891,
85,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
2134,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
260,
1930,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
49053,
9795,
43679,
3963,
4526,
37,
5390,
2134,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
260,
7501,
62,
26495,
220,
41876,
1614,
4871,
13,
628,
220,
220,
220,
33493,
311,
2751,
2538,
1614,
4871,
39319,
2488,
26947,
7,
6780,
62,
26495,
8,
198,
220,
220,
220,
220,
220,
16034,
36264,
343,
198,
220,
220,
220,
220,
220,
33411,
23241,
13602,
220,
220,
220,
796,
705,
49,
18,
5446,
6,
198,
220,
220,
220,
220,
220,
220,
220,
5357,
2134,
220,
220,
796,
2488,
271,
62,
15252,
12,
4906,
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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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class /GAL/CX_CONFIG_EX_NO_VALUE definition
public
inheriting from /GAL/CX_CONFIG_EXCEPTION
final
create public .
public section.
type-pools ABAP .
constants /GAL/CX_CONFIG_EX_NO_VALUE type SOTR_CONC value '00155DF935091ED798CA1305899516A9'. "#EC NOTEXT
constants NO_VALUE_DEFINED type SOTR_CONC value '00155DF935091ED798CA102E25FDF6A9'. "#EC NOTEXT
methods CONSTRUCTOR
importing
!TEXTID like TEXTID optional
!PREVIOUS like PREVIOUS optional
!VAR1 type STRING optional
!VAR2 type STRING optional
!VAR3 type STRING optional
!VAR4 type STRING optional
!VAR5 type STRING optional
!VAR6 type STRING optional
!VAR7 type STRING optional
!VAR8 type STRING optional
!VAR9 type STRING optional .
protected section.
private section.
ENDCLASS.
CLASS /GAL/CX_CONFIG_EX_NO_VALUE IMPLEMENTATION.
method CONSTRUCTOR.
CALL METHOD SUPER->CONSTRUCTOR
EXPORTING
TEXTID = TEXTID
PREVIOUS = PREVIOUS
VAR1 = VAR1
VAR2 = VAR2
VAR3 = VAR3
VAR4 = VAR4
VAR5 = VAR5
VAR6 = VAR6
VAR7 = VAR7
VAR8 = VAR8
VAR9 = VAR9
.
IF textid IS INITIAL.
me->textid = /GAL/CX_CONFIG_EX_NO_VALUE .
ENDIF.
endmethod.
ENDCLASS.
| [
4871,
1220,
38,
1847,
14,
34,
55,
62,
10943,
16254,
62,
6369,
62,
15285,
62,
39488,
6770,
198,
220,
1171,
198,
220,
10639,
1780,
422,
1220,
38,
1847,
14,
34,
55,
62,
10943,
16254,
62,
6369,
42006,
2849,
198,
220,
2457,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
198,
220,
2099,
12,
7742,
82,
9564,
2969,
764,
628,
220,
38491,
1220,
38,
1847,
14,
34,
55,
62,
10943,
16254,
62,
6369,
62,
15285,
62,
39488,
2099,
311,
2394,
49,
62,
10943,
34,
1988,
705,
405,
18742,
8068,
6052,
1120,
6420,
1961,
43240,
8141,
12952,
3365,
33438,
1433,
32,
24,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
8005,
62,
39488,
62,
7206,
20032,
1961,
2099,
311,
2394,
49,
62,
10943,
34,
1988,
705,
405,
18742,
8068,
6052,
1120,
6420,
1961,
43240,
8141,
15377,
36,
1495,
37,
8068,
21,
32,
24,
4458,
25113,
2943,
5626,
13918,
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,
53,
1503,
16,
2099,
19269,
2751,
11902,
198,
220,
220,
220,
220,
220,
5145,
53,
1503,
17,
2099,
19269,
2751,
11902,
198,
220,
220,
220,
220,
220,
5145,
53,
1503,
18,
2099,
19269,
2751,
11902,
198,
220,
220,
220,
220,
220,
5145,
53,
1503,
19,
2099,
19269,
2751,
11902,
198,
220,
220,
220,
220,
220,
5145,
53,
1503,
20,
2099,
19269,
2751,
11902,
198,
220,
220,
220,
220,
220,
5145,
53,
1503,
21,
2099,
19269,
2751,
11902,
198,
220,
220,
220,
220,
220,
5145,
53,
1503,
22,
2099,
19269,
2751,
11902,
198,
220,
220,
220,
220,
220,
5145,
53,
1503,
23,
2099,
19269,
2751,
11902,
198,
220,
220,
220,
220,
220,
5145,
53,
1503,
24,
2099,
19269,
2751,
11902,
764,
198,
24326,
2665,
13,
198,
19734,
2665,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1220,
38,
1847,
14,
34,
55,
62,
10943,
16254,
62,
6369,
62,
15285,
62,
39488,
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,
53,
1503,
16,
796,
569,
1503,
16,
198,
53,
1503,
17,
796,
569,
1503,
17,
198,
53,
1503,
18,
796,
569,
1503,
18,
198,
53,
1503,
19,
796,
569,
1503,
19,
198,
53,
1503,
20,
796,
569,
1503,
20,
198,
53,
1503,
21,
796,
569,
1503,
21,
198,
53,
1503,
22,
796,
569,
1503,
22,
198,
53,
1503,
23,
796,
569,
1503,
23,
198,
53,
1503,
24,
796,
569,
1503,
24,
198,
13,
198,
16876,
2420,
312,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
502,
3784,
5239,
312,
796,
1220,
38,
1847,
14,
34,
55,
62,
10943,
16254,
62,
6369,
62,
15285,
62,
39488,
764,
198,
23578,
5064,
13,
198,
220,
886,
24396,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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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
] |
class ZSAPLINK_VIEWS 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_VIEWS definition
*----------------------------------------------------------------------*
* class ZSAPLINK_VIEWS implementation.
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class ZSAPLINK_VIEWS 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,
dd25v_wa TYPE dd25v.
l_name = objname.
CALL FUNCTION 'DDIF_VIEW_GET'
EXPORTING
name = l_name
IMPORTING
dd25v_wa = dd25v_wa
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc = 0 AND dd25v_wa-viewname 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,
dd25v_wa TYPE dd25v,
dd09l_wa TYPE dd09v,
dd26v_tab TYPE STANDARD TABLE OF dd26v,
dd26v_wa LIKE LINE OF dd26v_tab,
dd27p_tab TYPE STANDARD TABLE OF dd27p,
dd27p_wa LIKE LINE OF dd27p_tab,
dd28j_tab TYPE STANDARD TABLE OF dd28j,
dd28j_wa LIKE LINE OF dd28j_tab,
dd28v_tab TYPE STANDARD TABLE OF dd28v,
dd28v_wa LIKE LINE OF dd28v_tab.
*xml nodes
DATA rootnode TYPE REF TO if_ixml_element.
DATA dd09l_node TYPE REF TO if_ixml_element.
DATA dd26v_node TYPE REF TO if_ixml_element.
DATA dd27p_node TYPE REF TO if_ixml_element.
DATA dd28j_node TYPE REF TO if_ixml_element.
DATA dd28v_node TYPE REF TO if_ixml_element.
DATA rc TYPE sysubrc.
DATA _viewname TYPE ddobjname.
_viewname = objname.
CALL FUNCTION 'DDIF_VIEW_GET'
EXPORTING
name = _viewname
langu = sy-langu
IMPORTING
gotstate = gotstate
dd25v_wa = dd25v_wa
dd09l_wa = dd09l_wa
TABLES
dd26v_tab = dd26v_tab
dd27p_tab = dd27p_tab
dd28j_tab = dd28j_tab
dd28v_tab = dd28v_tab
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc <> 0 OR dd25v_wa-viewname 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 = dd25v_wa ).
dd09l_node = xmldoc->create_element( 'dd09l' ).
setattributesfromstructure( node = dd09l_node structure = dd09l_wa ).
rc = rootnode->append_child( dd09l_node ).
LOOP AT dd26v_tab INTO dd26v_wa.
dd26v_node = xmldoc->create_element( 'dd26v' ).
setattributesfromstructure( node = dd26v_node structure = dd26v_wa ).
rc = rootnode->append_child( dd26v_node ).
ENDLOOP.
LOOP AT dd27p_tab INTO dd27p_wa.
dd27p_node = xmldoc->create_element( 'dd27p' ).
setattributesfromstructure( node = dd27p_node structure = dd27p_wa ).
rc = rootnode->append_child( dd27p_node ).
ENDLOOP.
LOOP AT dd28j_tab INTO dd28j_wa.
dd28j_node = xmldoc->create_element( 'dd28j' ).
setattributesfromstructure( node = dd28j_node structure = dd28j_wa ).
rc = rootnode->append_child( dd28j_node ).
ENDLOOP.
LOOP AT dd28v_tab INTO dd28v_wa.
dd28v_node = xmldoc->create_element( 'dd28v' ).
setattributesfromstructure( node = dd28v_node structure = dd28v_wa ).
rc = rootnode->append_child( dd28v_node ).
ENDLOOP.
*\--------------------------------------------------------------------/
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,
dd25v_wa type dd25v,
dd09l_wa type dd09v,
dd26v_tab type standard table of dd26v,
dd26v_wa like line of dd26v_tab,
dd27p_tab type standard table of dd27p,
dd27p_wa like line of dd27p_tab,
dd28j_tab type standard table of dd28j,
dd28j_wa like line of dd28j_tab,
dd28v_tab type standard table of dd28v,
dd28v_wa like line of dd28v_tab.
*xml nodes
DATA rootnode TYPE REF TO if_ixml_element.
data dd09l_node type ref to if_ixml_element.
data dd26v_node type ref to if_ixml_element.
data dd27p_node type ref to if_ixml_element.
data dd28j_node type ref to if_ixml_element.
data dd28v_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 _tablname 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 = dd25v_wa.
objname = dd25v_wa-viewname.
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.
dd09l_node = xmldoc->find_from_name( 'dd09l' ).
CALL METHOD getstructurefromattributes
EXPORTING
node = dd09l_node
CHANGING
structure = dd09l_wa.
* retrieve Tabl details
FREE: filter, iterator, node.
filter = xmldoc->create_filter_name( 'dd26v' ).
iterator = xmldoc->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
WHILE node IS NOT INITIAL.
CLEAR dd26v_node.
CALL METHOD getstructurefromattributes
EXPORTING
node = node
CHANGING
structure = dd26v_wa.
APPEND dd26v_wa TO dd26v_tab.
node ?= iterator->get_next( ).
ENDWHILE.
FREE: filter, iterator, node.
filter = xmldoc->create_filter_name( 'dd27p' ).
iterator = xmldoc->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
WHILE node IS NOT INITIAL.
CLEAR dd27p_node.
CALL METHOD getstructurefromattributes
EXPORTING
node = node
CHANGING
structure = dd27p_wa.
APPEND dd27p_wa TO dd27p_tab.
node ?= iterator->get_next( ).
ENDWHILE.
FREE: filter, iterator, node.
filter = xmldoc->create_filter_name( 'dd28j' ).
iterator = xmldoc->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
WHILE node IS NOT INITIAL.
CLEAR dd28j_node.
CALL METHOD getstructurefromattributes
EXPORTING
node = node
CHANGING
structure = dd28j_wa.
APPEND dd28j_wa TO dd28j_tab.
node ?= iterator->get_next( ).
ENDWHILE.
FREE: filter, iterator, node.
filter = xmldoc->create_filter_name( 'dd28v' ).
iterator = xmldoc->create_iterator_filtered( filter ).
node ?= iterator->get_next( ).
WHILE node IS NOT INITIAL.
CLEAR dd28v_node.
CALL METHOD getstructurefromattributes
EXPORTING
node = node
CHANGING
structure = dd28v_wa.
APPEND dd28v_wa TO dd28v_tab.
node ?= iterator->get_next( ).
ENDWHILE.
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_VIEW_PUT'
EXPORTING
name = l_dd_objname
dd25v_wa = dd25v_wa
dd09l_wa = dd09l_wa
TABLES
dd26v_tab = dd26v_tab
dd27p_tab = dd27p_tab
dd28j_tab = dd28j_tab
dd28v_tab = dd28v_tab
EXCEPTIONS
view_not_found = 1
name_inconsistent = 2
view_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 = 'VIEW'. "Views
endmethod.
endclass. "ZSAPLINK_VIEWS implementation | [
4871,
1168,
50,
2969,
43,
17248,
62,
28206,
50,
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,
28206,
50,
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,
28206,
50,
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,
28206,
50,
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,
5870,
25171,
6369,
1797,
4694,
13,
201,
198,
201,
198,
9,
220,
220,
220,
220,
220,
42636,
2727,
416,
25,
201,
198,
9,
220,
220,
220,
220,
220,
5658,
27134,
201,
198,
9,
220,
220,
220,
220,
220,
294,
16911,
13,
73,
2150,
16,
31,
14816,
13,
785,
201,
198,
201,
198,
220,
42865,
25,
300,
62,
3672,
41876,
49427,
26801,
3672,
11,
201,
198,
220,
220,
220,
220,
220,
220,
220,
49427,
1495,
85,
62,
10247,
41876,
49427,
1495,
85,
13,
201,
198,
220,
300,
62,
3672,
796,
26181,
3672,
13,
201,
198,
201,
198,
220,
42815,
29397,
4177,
2849,
705,
16458,
5064,
62,
28206,
62,
18851,
6,
201,
198,
220,
220,
220,
7788,
15490,
2751,
201,
198,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
62,
3672,
201,
198,
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,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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
] |
*"* use this source file for your ABAP unit test classes
CLASS lcl_test DEFINITION
INHERITING FROM zcl_glds_demo_test_units
FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT.
ENDCLASS.
| [
9,
1,
9,
779,
428,
2723,
2393,
329,
534,
9564,
2969,
4326,
1332,
6097,
198,
31631,
300,
565,
62,
9288,
5550,
20032,
17941,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
70,
335,
82,
62,
9536,
78,
62,
9288,
62,
41667,
198,
220,
7473,
43001,
2751,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
198,
220,
360,
4261,
6234,
6006,
9863,
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
] |
"! I describe an element of type package
CLASS z2mse_extr3_packages DEFINITION
PUBLIC
INHERITING FROM z2mse_extr3_elements
CREATE PRIVATE
GLOBAL FRIENDS z2mse_extr3_packages_mock.
PUBLIC SECTION.
TYPES:
ty_s_pack TYPE RANGE OF tadir-devclass.
TYPES: BEGIN OF ty_package,
package TYPE devclass,
parentpackage TYPE parentcl,
END OF ty_package.
TYPES ty_packages TYPE HASHED TABLE OF ty_package WITH UNIQUE KEY package.
CLASS-METHODS clear.
CLASS-METHODS get_instance
IMPORTING
i_element_manager TYPE REF TO z2mse_extr3_element_manager
RETURNING VALUE(r_instance) TYPE REF TO z2mse_extr3_packages.
METHODS add
IMPORTING package TYPE devclass
EXPORTING VALUE(is_added) TYPE abap_bool
VALUE(new_element_id) TYPE z2mse_extr3_element_manager=>element_id_type.
METHODS devclass
IMPORTING
i_element_id TYPE i
RETURNING
VALUE(r_result) TYPE devclass.
METHODS make_model REDEFINITION.
METHODS name REDEFINITION.
METHODS collect_infos REDEFINITION.
PROTECTED SECTION.
METHODS _does_package_exists
IMPORTING
i_package TYPE devclass
RETURNING
VALUE(exists) TYPE abap_bool.
PRIVATE SECTION.
TYPES: BEGIN OF element_type,
element_id TYPE z2mse_extr3_element_manager=>element_id_type,
devclass TYPE devclass,
END OF element_type.
CLASS-DATA instance TYPE REF TO z2mse_extr3_packages.
DATA elements_element_id TYPE HASHED TABLE OF element_type WITH UNIQUE KEY element_id.
DATA elements_devclass TYPE HASHED TABLE OF element_type WITH UNIQUE KEY devclass.
ENDCLASS.
CLASS z2mse_extr3_packages IMPLEMENTATION.
METHOD clear.
CLEAR instance.
ENDMETHOD.
METHOD add.
DATA element TYPE element_type.
READ TABLE elements_devclass INTO element WITH KEY devclass = package.
IF sy-subrc EQ 0.
is_added = abap_true.
new_element_id = element-element_id.
ELSE.
DATA exists TYPE abap_bool.
exists = _does_package_exists( package ).
IF exists EQ abap_true.
is_added = abap_true.
new_element_id = element_manager->add_element( element = me
is_specific = abap_false ).
element-element_id = new_element_id.
element-devclass = package.
INSERT element INTO TABLE elements_element_id.
INSERT element INTO TABLE elements_devclass.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD devclass.
DATA element TYPE element_type.
READ TABLE elements_element_id INTO element WITH TABLE KEY element_id = i_element_id.
ASSERT sy-subrc EQ 0.
r_result = element-devclass.
ENDMETHOD.
METHOD get_instance.
IF instance IS NOT BOUND.
CREATE OBJECT instance
EXPORTING
i_element_manager = i_element_manager.
ENDIF.
instance->type = package_type.
r_instance = instance.
ENDMETHOD.
METHOD collect_infos.
ENDMETHOD.
METHOD make_model.
DATA element TYPE element_type.
READ TABLE elements_element_id INTO element WITH TABLE KEY element_id = element_id.
ASSERT sy-subrc EQ 0.
element_manager->famix_package->add( name = element-devclass
name_group = ng_abap_package ).
ENDMETHOD.
METHOD _does_package_exists.
" SAP_2_FAMIX_66
" Local packages start with a $ and have no entry in table TADIR. So report them always as existing
IF i_package+0(1) EQ '$'.
exists = abap_true.
RETURN.
ENDIF.
" Does package exists?
DATA found_obj_name TYPE sobj_name.
TEST-SEAM tadir.
SELECT SINGLE obj_name FROM tadir INTO found_obj_name WHERE pgmid = 'R3TR'
AND object = 'DEVC'
AND obj_name = i_package.
END-TEST-SEAM.
IF sy-subrc EQ 0.
exists = abap_true.
ENDIF.
ENDMETHOD.
METHOD name.
DATA devclass TYPE devclass.
devclass = devclass( i_element_id = element_id ).
element_type = |ABAPPackage|.
parent_name = ||.
name = devclass.
ENDMETHOD.
ENDCLASS.
| [
40484,
314,
6901,
281,
5002,
286,
2099,
5301,
198,
31631,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
43789,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
68,
3639,
198,
220,
29244,
6158,
4810,
3824,
6158,
198,
220,
10188,
9864,
1847,
48167,
1677,
5258,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
43789,
62,
76,
735,
13,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
1259,
62,
82,
62,
8002,
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,
371,
27746,
3963,
36264,
343,
12,
7959,
4871,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
1259,
62,
26495,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5301,
220,
220,
220,
220,
220,
220,
41876,
1614,
4871,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2560,
26495,
41876,
2560,
565,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
1259,
62,
26495,
13,
198,
220,
220,
220,
24412,
47,
1546,
1259,
62,
43789,
41876,
367,
11211,
1961,
43679,
3963,
1259,
62,
26495,
13315,
4725,
33866,
8924,
35374,
5301,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
1598,
13,
198,
220,
220,
220,
42715,
12,
49273,
50,
651,
62,
39098,
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,
30854,
62,
37153,
41876,
4526,
37,
5390,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
30854,
62,
37153,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
39098,
8,
41876,
4526,
37,
5390,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
43789,
13,
198,
220,
220,
220,
337,
36252,
50,
751,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
5301,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
26173,
8924,
7,
271,
62,
29373,
8,
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,
26173,
8924,
7,
3605,
62,
30854,
62,
312,
8,
41876,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
30854,
62,
37153,
14804,
30854,
62,
312,
62,
4906,
13,
198,
220,
220,
220,
337,
36252,
50,
1614,
4871,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
30854,
62,
312,
220,
220,
220,
41876,
1312,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
1614,
4871,
13,
198,
220,
220,
220,
337,
36252,
50,
787,
62,
19849,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
1438,
23848,
36,
20032,
17941,
13,
198,
220,
220,
220,
337,
36252,
50,
2824,
62,
10745,
418,
23848,
36,
20032,
17941,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
4808,
22437,
62,
26495,
62,
1069,
1023,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1312,
62,
26495,
220,
220,
220,
220,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
1069,
1023,
8,
41876,
450,
499,
62,
30388,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
24412,
47,
1546,
25,
347,
43312,
3963,
5002,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5002,
62,
312,
41876,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
30854,
62,
37153,
14804,
30854,
62,
312,
62,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1614,
4871,
220,
220,
41876,
1614,
4871,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
5002,
62,
4906,
13,
198,
220,
220,
220,
42715,
12,
26947,
4554,
41876,
4526,
37,
5390,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
43789,
13,
198,
220,
220,
220,
42865,
4847,
62,
30854,
62,
312,
41876,
367,
11211,
1961,
43679,
3963,
5002,
62,
4906,
13315,
4725,
33866,
8924,
35374,
5002,
62,
312,
13,
198,
220,
220,
220,
42865,
4847,
62,
7959,
4871,
41876,
367,
11211,
1961,
43679,
3963,
5002,
62,
4906,
13315,
4725,
33866,
8924,
35374,
1614,
4871,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
17,
76,
325,
62,
2302,
81,
18,
62,
43789,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
1598,
13,
198,
220,
220,
220,
30301,
1503,
4554,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
751,
13,
628,
220,
220,
220,
42865,
5002,
41876,
5002,
62,
4906,
13,
628,
220,
220,
220,
20832,
43679,
4847,
62,
7959,
4871,
39319,
5002,
13315,
35374,
1614,
4871,
796,
5301,
13,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
36529,
657,
13,
198,
220,
220,
220,
220,
220,
318,
62,
29373,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
649,
62,
30854,
62,
312,
796,
5002,
12,
30854,
62,
312,
13,
198,
220,
220,
220,
17852,
5188,
13,
628,
220,
220,
220,
220,
220,
42865,
7160,
41876,
450,
499,
62,
30388,
13,
628,
220,
220,
220,
220,
220,
7160,
796,
4808,
22437,
62,
26495,
62,
1069,
1023,
7,
5301,
6739,
198,
220,
220,
220,
220,
220,
16876,
7160,
36529,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
220,
220,
220,
220,
318,
62,
29373,
796,
450,
499,
62,
7942,
13,
628,
220,
220,
220,
220,
220,
220,
220,
649,
62,
30854,
62,
312,
796,
5002,
62,
37153,
3784,
2860,
62,
30854,
7,
5002,
796,
502,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220
] |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
] |
"! <p class="shorttext synchronized" lang="en">Value Conversion Helper</p>
CLASS /gal/convert DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
TYPE-POOLS abap .
"! <p class="shorttext synchronized" lang="en">Convert integer value to hexadecimal string</p>
"!
"! @parameter input | <p class="shorttext synchronized" lang="en">Input value</p>
"! @parameter input | <p class="shorttext synchronized" lang="en">Input value</p>
"! @parameter output | <p class="shorttext synchronized" lang="en">Output value</p>
"! @raising /gal/cx_conversion_exception | <p class="shorttext synchronized" lang="en">Conversion Exception</p>
CLASS-METHODS integer_to_hex_string
IMPORTING
!input TYPE i
!length TYPE i OPTIONAL
RETURNING
VALUE(output) TYPE string
RAISING
/gal/cx_conversion_exception .
"! <p class="shorttext synchronized" lang="en">Convert hexadecimal string to integer value</p>
"!
"! @parameter input | <p class="shorttext synchronized" lang="en">Input value</p>
"! @parameter output | <p class="shorttext synchronized" lang="en">Output value</p>
"! @raising /gal/cx_conversion_exception | <p class="shorttext synchronized" lang="en">Conversion Exception</p>
CLASS-METHODS hex_string_to_integer
IMPORTING
!input TYPE csequence
RETURNING
VALUE(output) TYPE i
RAISING
/gal/cx_conversion_exception .
"! <p class="shorttext synchronized" lang="en">Convert SAP language key to ISO language key</p>
"!
"! @parameter language_key_sap | <p class="shorttext synchronized" lang="en">Language key (SAP)</p>
"! @parameter language_key_iso | <p class="shorttext synchronized" lang="en">Language key (ISO)</p>
"! @raising /gal/cx_conversion_exception | <p class="shorttext synchronized" lang="en">Conversion Exception</p>
CLASS-METHODS language_key_sap_to_iso
IMPORTING
!language_key_sap TYPE langu
RETURNING
VALUE(language_key_iso) TYPE laiso
RAISING
/gal/cx_conversion_exception .
"! <p class="shorttext synchronized" lang="en">Move to corresponding fields (by field names)</p>
"!
"! @parameter input | <p class="shorttext synchronized" lang="en">Input value</p>
"! @parameter output | <p class="shorttext synchronized" lang="en">Output value</p>
CLASS-METHODS move_corresponding
IMPORTING
!input TYPE any
EXPORTING
!output TYPE any .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS /GAL/CONVERT IMPLEMENTATION.
METHOD hex_string_to_integer.
CONSTANTS lc_digits(16) TYPE c VALUE '0123456789ABCDEF'.
DATA: l_hex TYPE string,
l_length TYPE i,
l_offset TYPE i.
l_hex = input.
TRANSLATE l_hex TO UPPER CASE.
l_length = strlen( l_hex ).
WHILE l_offset < l_length AND lc_digits CA l_hex+l_offset(1).
output = 16 * output + sy-fdpos.
l_offset = l_offset + 1.
ENDWHILE.
IF l_offset < l_length.
RAISE EXCEPTION TYPE /gal/cx_conversion_exception
EXPORTING
textid = /gal/cx_conversion_exception=>input_no_hex_string
var1 = input.
ENDIF.
ENDMETHOD.
METHOD integer_to_hex_string.
CONSTANTS lc_digits(16) TYPE c VALUE '0123456789ABCDEF'.
DATA: l_length TYPE i,
l_pos TYPE i,
l_integer TYPE i,
l_exception TYPE REF TO /gal/cx_conversion_exception.
l_integer = input.
IF length IS INITIAL.
IF l_integer < 0.
l_exception ?= /gal/cx_exception=>create_with_generic_types( exception_class = `/GAL/CX_CONVERSION_EXCEPTION`
textid = /gal/cx_conversion_exception=>neg_int_to_hex_string
var1 = input ).
RAISE EXCEPTION l_exception.
ELSEIF l_integer < 16.
l_length = 1.
ELSE.
l_length = floor( log( l_integer ) / log( 16 ) ) + 1.
ENDIF.
ELSE.
l_length = length.
ENDIF.
DO l_length TIMES.
l_pos = l_integer MOD 16.
l_integer = l_integer DIV 16.
CONCATENATE lc_digits+l_pos(1) output INTO output.
ENDDO.
IF l_integer > 0.
l_exception ?= /gal/cx_exception=>create_with_generic_types( exception_class = `/GAL/CX_CONVERSION_EXCEPTION`
textid = /gal/cx_conversion_exception=>input_too_high_for_hex_string
var1 = input
var2 = length ).
RAISE EXCEPTION l_exception.
ENDIF.
ENDMETHOD.
METHOD language_key_sap_to_iso.
DATA l_sap_language_key TYPE string.
SELECT SINGLE laiso FROM t002
INTO language_key_iso
WHERE spras = language_key_sap.
IF sy-subrc <> 0.
l_sap_language_key = language_key_sap.
RAISE EXCEPTION TYPE /gal/cx_conversion_exception
EXPORTING
textid = /gal/cx_conversion_exception=>unknown_language_key
var1 = l_sap_language_key.
ENDIF.
ENDMETHOD.
METHOD move_corresponding.
DATA: l_input_type TYPE REF TO cl_abap_typedescr,
l_input_struct_type TYPE REF TO cl_abap_structdescr,
l_output_type TYPE REF TO cl_abap_typedescr,
l_output_struct_type TYPE REF TO cl_abap_structdescr,
l_wa_output_table TYPE REF TO data.
FIELD-SYMBOLS: <l_components> TYPE LINE OF abap_compdescr_tab,
<l_input_component> TYPE any,
<l_output_component> TYPE any,
<l_input_table> TYPE ANY TABLE,
<l_output_table> TYPE ANY TABLE,
<l_wa_input_table> TYPE any,
<l_wa_output_table> TYPE any.
* Initialize result
CLEAR output.
* Get type description for source and target
l_input_type = cl_abap_typedescr=>describe_by_data( input ).
l_output_type = cl_abap_typedescr=>describe_by_data( output ).
* Just copy input to output if types match
IF l_input_type->absolute_name = l_output_type->absolute_name.
output = input.
RETURN.
ENDIF.
* Move structure to structure (match by name)
IF ( l_input_type->type_kind = cl_abap_typedescr=>typekind_struct1 OR
l_input_type->type_kind = cl_abap_typedescr=>typekind_struct2 ) AND
( l_output_type->type_kind = cl_abap_typedescr=>typekind_struct1 OR
l_output_type->type_kind = cl_abap_typedescr=>typekind_struct2 ).
l_input_struct_type ?= l_input_type.
l_output_struct_type ?= l_output_type.
LOOP AT l_input_struct_type->components ASSIGNING <l_components>.
READ TABLE l_output_struct_type->components
WITH KEY name = <l_components>-name
TRANSPORTING NO FIELDS.
CHECK sy-subrc = 0.
ASSIGN COMPONENT <l_components>-name OF STRUCTURE input TO <l_input_component>.
ASSIGN COMPONENT <l_components>-name OF STRUCTURE output TO <l_output_component>.
move_corresponding( EXPORTING input = <l_input_component>
IMPORTING output = <l_output_component> ).
ENDLOOP.
* Move structure to table (insert single row)
ELSEIF ( l_input_type->type_kind = cl_abap_typedescr=>typekind_struct1 OR
l_input_type->type_kind = cl_abap_typedescr=>typekind_struct2 ) AND
l_output_type->type_kind = cl_abap_typedescr=>typekind_table.
ASSIGN output TO <l_output_table>.
CREATE DATA l_wa_output_table LIKE LINE OF <l_output_table>.
ASSIGN l_wa_output_table->* TO <l_wa_output_table>.
move_corresponding( EXPORTING input = input
IMPORTING output = <l_wa_output_table> ).
INSERT <l_wa_output_table> INTO TABLE <l_output_table>.
* Move table to structure (first table entry only)
ELSEIF l_input_type->type_kind = cl_abap_typedescr=>typekind_table AND
( l_output_type->type_kind = cl_abap_typedescr=>typekind_struct1 OR
l_output_type->type_kind = cl_abap_typedescr=>typekind_struct2 ).
ASSIGN input TO <l_input_table>.
LOOP AT <l_input_table> ASSIGNING <l_wa_input_table>.
move_corresponding( EXPORTING input = <l_wa_input_table>
IMPORTING output = output ).
EXIT.
ENDLOOP.
* Move table to table (line by line)
ELSEIF l_input_type->type_kind = cl_abap_typedescr=>typekind_table AND
l_output_type->type_kind = cl_abap_typedescr=>typekind_table.
ASSIGN input TO <l_input_table>.
ASSIGN output TO <l_output_table>.
CREATE DATA l_wa_output_table LIKE LINE OF <l_output_table>.
ASSIGN l_wa_output_table->* TO <l_wa_output_table>.
LOOP AT <l_input_table> ASSIGNING <l_wa_input_table>.
move_corresponding( EXPORTING input = <l_wa_input_table>
IMPORTING output = <l_wa_output_table> ).
INSERT <l_wa_output_table> INTO TABLE <l_output_table>.
ENDLOOP.
* Move object reference to object reference (casting)
ELSEIF l_input_type->type_kind = cl_abap_typedescr=>typekind_oref AND
l_output_type->type_kind = cl_abap_typedescr=>typekind_oref.
output ?= input.
* Use built-in conversion for anything else
ELSE.
output = input.
ENDIF.
ENDMETHOD.
ENDCLASS.
| [
40484,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
11395,
44101,
5053,
525,
3556,
79,
29,
198,
31631,
1220,
13528,
14,
1102,
1851,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
41876,
12,
16402,
3535,
50,
450,
499,
764,
628,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
3103,
1851,
18253,
1988,
284,
17910,
671,
66,
4402,
4731,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
5128,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
20560,
1988,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
5128,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
20560,
1988,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
5072,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
26410,
1988,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
2488,
32741,
220,
220,
1220,
13528,
14,
66,
87,
62,
1102,
9641,
62,
1069,
4516,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
3103,
9641,
35528,
3556,
79,
29,
198,
220,
220,
220,
42715,
12,
49273,
50,
18253,
62,
1462,
62,
33095,
62,
8841,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
15414,
220,
220,
220,
220,
220,
220,
220,
41876,
1312,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
13664,
220,
220,
220,
220,
220,
220,
41876,
1312,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
22915,
8,
41876,
4731,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1220,
13528,
14,
66,
87,
62,
1102,
9641,
62,
1069,
4516,
764,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
3103,
1851,
17910,
671,
66,
4402,
4731,
284,
18253,
1988,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
5128,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
20560,
1988,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
5072,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
26410,
1988,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
2488,
32741,
220,
220,
1220,
13528,
14,
66,
87,
62,
1102,
9641,
62,
1069,
4516,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
3103,
9641,
35528,
3556,
79,
29,
198,
220,
220,
220,
42715,
12,
49273,
50,
17910,
62,
8841,
62,
1462,
62,
41433,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
15414,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
43167,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
22915,
8,
41876,
1312,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1220,
13528,
14,
66,
87,
62,
1102,
9641,
62,
1069,
4516,
764,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
3103,
1851,
48323,
3303,
1994,
284,
19694,
3303,
1994,
3556,
79,
29,
198,
220,
220,
220,
366,
0,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
3303,
62,
2539,
62,
82,
499,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
32065,
1994,
357,
50,
2969,
36475,
79,
29,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
3303,
62,
2539,
62,
26786,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
32065,
1994,
357,
40734,
36475,
79,
29,
198,
220,
220,
220,
366,
0,
2488,
32741,
220,
220,
1220,
13528,
14,
66,
87,
62,
1102,
9641,
62,
1069,
4516,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
3103,
9641,
35528,
3556,
79,
29,
198,
220,
220,
220,
42715,
12,
49273,
50,
3303,
62,
2539,
62,
82,
499,
62,
1462,
62,
26786,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
16129,
62,
2539,
62,
82,
499,
220,
220,
220,
220,
220,
220,
41876,
2786,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
16129,
62,
2539,
62,
26786,
8,
41876,
8591,
26786,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1220,
13528,
14,
66,
87,
62,
1102,
9641,
62,
1069,
4516,
764,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
21774,
284,
11188,
7032,
357,
1525,
2214,
3891,
36475,
79,
29,
198,
220,
220,
220,
366,
0,
198,
220,
220,
220,
366,
0,
2488,
17143,
2357,
5128,
220,
930,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
20560,
1988,
3556,
79,
29,
198,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
*"* use this source file for your ABAP unit test classes
CLASS lcl_abap_unit DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT.
PRIVATE SECTION.
CONSTANTS c_node_key TYPE /bobf/obm_node_key VALUE '1111111111111111'.
DATA mt_key TYPE /bobf/t_frw_key.
DATA mt_keyindex TYPE /bobf/t_frw_keyindex.
DATA mt_keylink TYPE /bobf/t_frw_key_link.
DATA mt_node_attribute TYPE /bobf/t_frw_name.
DATA mr_message TYPE REF TO /bobf/if_frw_message.
DATA mr_change TYPE REF TO /bobf/if_frw_change.
DATA mr_td_bobf_frw_read TYPE REF TO /bobf/if_frw_read.
DATA mr_cut TYPE REF TO zcl_td_bobf_frw_read.
METHODS setup.
METHODS teardown.
METHODS test_call_compare FOR TESTING.
METHODS test_call_convert_altern_key FOR TESTING.
METHODS test_call_get_root_key FOR TESTING.
METHODS test_call_retrieve FOR TESTING.
METHODS test_call_ret_by_association FOR TESTING.
ENDCLASS.
CLASS lcl_abap_unit IMPLEMENTATION.
METHOD setup.
mr_td_bobf_frw_read = CAST /bobf/if_frw_read( cl_abap_testdouble=>create( '/BOBF/IF_FRW_READ' ) ).
mr_cut = NEW #( ir_td_bobf_frw_read = mr_td_bobf_frw_read ).
mr_message = /bobf/cl_frw_factory=>get_message( ).
mr_change = /bobf/cl_frw_factory=>get_change( ).
mt_key = VALUE #( ( key = c_node_key ) ).
mt_keyindex = VALUE #( ( index = 1 key = c_node_key ) ).
mt_keylink = VALUE #( ( source_key = c_node_key target_key = c_node_key ) ).
mt_node_attribute = VALUE #( ( |DUMMY| ) ).
ENDMETHOD.
METHOD teardown.
FREE mr_td_bobf_frw_read.
FREE mr_cut.
ENDMETHOD.
METHOD test_call_compare.
cl_abap_testdouble=>configure_call( mr_td_bobf_frw_read )->set_parameter( name = 'EO_CHANGE' value = mr_change ).
mr_td_bobf_frw_read->compare(
EXPORTING
iv_node_key = c_node_key
it_key = mt_key
iv_fill_attributes = abap_true
iv_scope = /bobf/if_frw_c=>sc_scope_local ).
mr_cut->/bobf/if_frw_read~compare(
EXPORTING
iv_node_key = c_node_key
it_key = mt_key
iv_fill_attributes = abap_true
iv_scope = /bobf/if_frw_c=>sc_scope_local
IMPORTING
eo_change = DATA(lr_ret_change) ).
cl_abap_unit_assert=>assert_true( mr_cut->ms_assert-compare-called ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-compare-calls exp = 1 ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-compare-parameters[ 1 ]-iv_node_key exp = c_node_key ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-compare-parameters[ 1 ]-it_key exp = mt_key ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-compare-parameters[ 1 ]-iv_fill_attributes exp = abap_true ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-compare-parameters[ 1 ]-iv_scope exp = /bobf/if_frw_c=>sc_scope_local ).
cl_abap_unit_assert=>assert_equals( act = lr_ret_change exp = mr_change ).
ENDMETHOD.
METHOD test_call_convert_altern_key.
DATA lt_ret_key TYPE /bobf/t_frw_key.
cl_abap_testdouble=>configure_call( mr_td_bobf_frw_read )->set_parameter( name = 'ET_RESULT' value = mt_keyindex
)->set_parameter( name = 'ET_KEY' value = mt_key ).
mr_td_bobf_frw_read->convert_altern_key(
EXPORTING
iv_node_key = c_node_key
iv_altkey_key = c_node_key
iv_target_altkey_key = /bobf/if_frw_c=>sc_alternative_key_key
it_key = mt_key
iv_before_image = abap_true
iv_invalidate_cache = abap_true ).
mr_cut->/bobf/if_frw_read~convert_altern_key(
EXPORTING
iv_node_key = c_node_key
iv_altkey_key = c_node_key
iv_target_altkey_key = /bobf/if_frw_c=>sc_alternative_key_key
it_key = mt_key
iv_before_image = abap_true
iv_invalidate_cache = abap_true
IMPORTING
et_result = DATA(lt_ret_result)
et_key = lt_ret_key ).
cl_abap_unit_assert=>assert_true( mr_cut->ms_assert-convert_altern_key-called ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-convert_altern_key-calls exp = 1 ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-convert_altern_key-parameters[ 1 ]-iv_node_key exp = c_node_key ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-convert_altern_key-parameters[ 1 ]-iv_altkey_key exp = c_node_key ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-convert_altern_key-parameters[ 1 ]-iv_target_altkey_key exp = /bobf/if_frw_c=>sc_alternative_key_key ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-convert_altern_key-parameters[ 1 ]-iv_before_image exp = abap_true ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-convert_altern_key-parameters[ 1 ]-iv_invalidate_cache exp = abap_true ).
cl_abap_unit_assert=>assert_equals( act = lt_ret_result exp = mt_keyindex ).
cl_abap_unit_assert=>assert_equals( act = lt_ret_key exp = mt_key ).
ENDMETHOD.
METHOD test_call_get_root_key.
cl_abap_testdouble=>configure_call( mr_td_bobf_frw_read )->set_parameter( name = 'ET_TARGET_KEY' value = mt_key
)->set_parameter( name = 'ET_KEY_LINK' value = mt_keylink
)->set_parameter( name = 'ET_FAILED_KEY' value = mt_key ).
mr_td_bobf_frw_read->get_root_key(
EXPORTING
iv_node = c_node_key
it_key = mt_key
iv_before_image = abap_true ).
mr_cut->/bobf/if_frw_read~get_root_key(
EXPORTING
iv_node = c_node_key
it_key = mt_key
iv_before_image = abap_true
IMPORTING
et_target_key = DATA(lt_ret_target_key)
et_key_link = DATA(lt_ret_key_link)
et_failed_key = DATA(lt_ret_failed_key) ).
cl_abap_unit_assert=>assert_true( mr_cut->ms_assert-get_root_key-called ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-get_root_key-calls exp = 1 ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-get_root_key-parameters[ 1 ]-iv_node exp = c_node_key ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-get_root_key-parameters[ 1 ]-it_key exp = mt_key ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-get_root_key-parameters[ 1 ]-iv_before_image exp = abap_true ).
cl_abap_unit_assert=>assert_equals( act = lt_ret_target_key exp = mt_key ).
cl_abap_unit_assert=>assert_equals( act = lt_ret_key_link exp = mt_keylink ).
cl_abap_unit_assert=>assert_equals( act = lt_ret_failed_key exp = mt_key ).
ENDMETHOD.
METHOD test_call_retrieve.
DATA lt_ret_data TYPE /bobf/t_frw_key.
DATA(lt_node_cat) = VALUE /bobf/t_frw_node_cat( ( key = c_node_key ) ).
cl_abap_testdouble=>configure_call( mr_td_bobf_frw_read )->set_parameter( name = 'EO_MESSAGE' value = mr_message
)->set_parameter( name = 'ET_DATA' value = mt_key
)->set_parameter( name = 'ET_FAILED_KEY' value = mt_key
)->set_parameter( name = 'ET_NODE_CAT' value = lt_node_cat ).
mr_td_bobf_frw_read->retrieve(
EXPORTING
iv_node = c_node_key
it_key = mt_key
iv_before_image = abap_true
iv_fill_data = abap_true
it_requested_attributes = mt_node_attribute ).
mr_cut->/bobf/if_frw_read~retrieve(
EXPORTING
iv_node = c_node_key
it_key = mt_key
iv_before_image = abap_true
iv_fill_data = abap_true
it_requested_attributes = mt_node_attribute
IMPORTING
eo_message = DATA(lr_ret_message)
et_data = lt_ret_data
et_failed_key = DATA(lt_ret_failed_key)
et_node_cat = DATA(lt_ret_node_cat) ).
cl_abap_unit_assert=>assert_true( mr_cut->ms_assert-retrieve-called ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-retrieve-calls exp = 1 ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-retrieve-parameters[ 1 ]-iv_node exp = c_node_key ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-retrieve-parameters[ 1 ]-it_key exp = mt_key ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-retrieve-parameters[ 1 ]-iv_before_image exp = abap_true ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-retrieve-parameters[ 1 ]-iv_fill_data exp = abap_true ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-retrieve-parameters[ 1 ]-it_requested_attributes exp = mt_node_attribute ).
cl_abap_unit_assert=>assert_equals( act = lr_ret_message exp = mr_message ).
cl_abap_unit_assert=>assert_equals( act = lt_ret_data exp = mt_key ).
cl_abap_unit_assert=>assert_equals( act = lt_ret_failed_key exp = mt_key ).
cl_abap_unit_assert=>assert_equals( act = lt_ret_node_cat exp = lt_node_cat ).
ENDMETHOD.
METHOD test_call_ret_by_association.
DATA lr_parameters TYPE REF TO data.
DATA lt_ret_data TYPE /bobf/t_frw_key.
cl_abap_testdouble=>configure_call( mr_td_bobf_frw_read )->set_parameter( name = 'EO_MESSAGE' value = mr_message
)->set_parameter( name = 'ET_DATA' value = mt_key
)->set_parameter( name = 'ET_KEY_LINK' value = mt_keylink
)->set_parameter( name = 'ET_TARGET_KEY' value = mt_key
)->set_parameter( name = 'ET_FAILED_KEY' value = mt_key ).
mr_td_bobf_frw_read->retrieve_by_association(
EXPORTING
iv_node = c_node_key
it_key = mt_key
iv_association = c_node_key
is_parameters = lr_parameters
it_filtered_attributes = mt_node_attribute
iv_fill_data = abap_true
iv_before_image = abap_true
it_requested_attributes = mt_node_attribute ).
mr_cut->/bobf/if_frw_read~retrieve_by_association(
EXPORTING
iv_node = c_node_key
it_key = mt_key
iv_association = c_node_key
is_parameters = lr_parameters
it_filtered_attributes = mt_node_attribute
iv_fill_data = abap_true
iv_before_image = abap_true
it_requested_attributes = mt_node_attribute
IMPORTING
eo_message = DATA(lr_ret_message)
et_data = lt_ret_data
et_key_link = DATA(lt_ret_key_link)
et_target_key = DATA(lt_ret_target_key)
et_failed_key = DATA(lt_ret_failed_key) ).
cl_abap_unit_assert=>assert_true( mr_cut->ms_assert-retrieve_by_association-called ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-retrieve_by_association-calls exp = 1 ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-retrieve_by_association-parameters[ 1 ]-iv_node exp = c_node_key ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-retrieve_by_association-parameters[ 1 ]-it_key exp = mt_key ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-retrieve_by_association-parameters[ 1 ]-iv_association exp = c_node_key ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-retrieve_by_association-parameters[ 1 ]-is_parameters exp = lr_parameters ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-retrieve_by_association-parameters[ 1 ]-it_filtered_attributes exp = mt_node_attribute ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-retrieve_by_association-parameters[ 1 ]-iv_fill_data exp = abap_true ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-retrieve_by_association-parameters[ 1 ]-iv_before_image exp = abap_true ).
cl_abap_unit_assert=>assert_equals( act = mr_cut->ms_assert-retrieve_by_association-parameters[ 1 ]-it_requested_attributes exp = mt_node_attribute ).
cl_abap_unit_assert=>assert_equals( act = lr_ret_message exp = mr_message ).
cl_abap_unit_assert=>assert_equals( act = lt_ret_data exp = mt_key ).
cl_abap_unit_assert=>assert_equals( act = lt_ret_key_link exp = mt_keylink ).
cl_abap_unit_assert=>assert_equals( act = lt_ret_target_key exp = mt_key ).
cl_abap_unit_assert=>assert_equals( act = lt_ret_failed_key exp = mt_key ).
ENDMETHOD.
ENDCLASS.
| [
9,
1,
9,
779,
428,
2723,
2393,
329,
534,
9564,
2969,
4326,
1332,
6097,
198,
198,
31631,
300,
565,
62,
397,
499,
62,
20850,
5550,
20032,
17941,
7473,
43001,
2751,
45698,
42,
49277,
43638,
5805,
7597,
360,
4261,
6234,
6006,
9863,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
17440,
62,
2539,
41876,
1220,
65,
672,
69,
14,
672,
76,
62,
17440,
62,
2539,
26173,
8924,
705,
26259,
26259,
26259,
26259,
4458,
628,
220,
220,
220,
42865,
45079,
62,
2539,
41876,
1220,
65,
672,
69,
14,
83,
62,
8310,
86,
62,
2539,
13,
198,
220,
220,
220,
42865,
45079,
62,
2539,
9630,
41876,
1220,
65,
672,
69,
14,
83,
62,
8310,
86,
62,
2539,
9630,
13,
198,
220,
220,
220,
42865,
45079,
62,
2539,
8726,
41876,
1220,
65,
672,
69,
14,
83,
62,
8310,
86,
62,
2539,
62,
8726,
13,
198,
220,
220,
220,
42865,
45079,
62,
17440,
62,
42348,
41876,
1220,
65,
672,
69,
14,
83,
62,
8310,
86,
62,
3672,
13,
628,
220,
220,
220,
42865,
285,
81,
62,
20500,
41876,
4526,
37,
5390,
1220,
65,
672,
69,
14,
361,
62,
8310,
86,
62,
20500,
13,
198,
220,
220,
220,
42865,
285,
81,
62,
3803,
41876,
4526,
37,
5390,
1220,
65,
672,
69,
14,
361,
62,
8310,
86,
62,
3803,
13,
628,
220,
220,
220,
42865,
285,
81,
62,
8671,
62,
65,
672,
69,
62,
8310,
86,
62,
961,
41876,
4526,
37,
5390,
1220,
65,
672,
69,
14,
361,
62,
8310,
86,
62,
961,
13,
198,
220,
220,
220,
42865,
285,
81,
62,
8968,
41876,
4526,
37,
5390,
1976,
565,
62,
8671,
62,
65,
672,
69,
62,
8310,
86,
62,
961,
13,
628,
220,
220,
220,
337,
36252,
50,
9058,
13,
198,
220,
220,
220,
337,
36252,
50,
573,
446,
593,
13,
628,
220,
220,
220,
337,
36252,
50,
1332,
62,
13345,
62,
5589,
533,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
13345,
62,
1102,
1851,
62,
33645,
62,
2539,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
13345,
62,
1136,
62,
15763,
62,
2539,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
13345,
62,
1186,
30227,
7473,
43001,
2751,
13,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
13345,
62,
1186,
62,
1525,
62,
562,
41003,
7473,
43001,
2751,
13,
198,
10619,
31631,
13,
628,
198,
31631,
300,
565,
62,
397,
499,
62,
20850,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
285,
81,
62,
8671,
62,
65,
672,
69,
62,
8310,
86,
62,
961,
796,
327,
11262,
1220,
65,
672,
69,
14,
361,
62,
8310,
86,
62,
961,
7,
537,
62,
397,
499,
62,
9288,
23352,
14804,
17953,
7,
31051,
8202,
29499,
14,
5064,
62,
10913,
54,
62,
15675,
6,
1267,
6739,
198,
220,
220,
220,
285,
81,
62,
8968,
796,
12682,
1303,
7,
4173,
62,
8671,
62,
65,
672,
69,
62,
8310,
86,
62,
961,
796,
285,
81,
62,
8671,
62,
65,
672,
69,
62,
8310,
86,
62,
961,
6739,
628,
220,
220,
220,
285,
81,
62,
20500,
796,
1220,
65,
672,
69,
14,
565,
62,
8310,
86,
62,
69,
9548,
14804,
1136,
62,
20500,
7,
6739,
198,
220,
220,
220,
285,
81,
62,
3803,
796,
1220,
65,
672,
69,
14,
565,
62,
8310,
86,
62,
69,
9548,
14804,
1136,
62,
3803,
7,
6739,
628,
220,
220,
220,
45079,
62,
2539,
796,
26173,
8924,
1303,
7,
357,
1994,
796,
269,
62,
17440,
62,
2539,
1267,
6739,
198,
220,
220,
220,
45079,
62,
2539,
9630,
796,
26173,
8924,
1303,
7,
357,
6376,
796,
352,
1994,
796,
269,
62,
17440,
62,
2539,
1267,
6739,
198,
220,
220,
220,
45079,
62,
2539,
8726,
796,
26173,
8924,
1303,
7,
357,
2723,
62,
2539,
796,
269,
62,
17440,
62,
2539,
2496,
62,
2539,
796,
269,
62,
17440,
62,
2539,
1267,
6739,
198,
220,
220,
220,
45079,
62,
17440,
62,
42348,
796,
26173,
8924,
1303,
7,
357,
930,
35,
5883,
26708,
91,
1267,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
573,
446,
593,
13,
198,
220,
220,
220,
17189,
285,
81,
62,
8671,
62,
65,
672,
69,
62,
8310,
86,
62,
961,
13,
198,
220,
220,
220,
17189,
285,
81,
62,
8968,
13,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
1332,
62,
13345,
62,
5589,
533,
13,
198,
220,
220,
220,
537,
62,
397,
499,
62,
9288,
23352,
14804,
11250,
495,
62,
13345,
7,
285,
81,
62,
8671,
62,
65,
672,
69,
62,
8310,
86,
62,
961,
1267,
3784,
2617,
62,
17143,
2357,
7,
1438,
796,
705,
4720,
62,
3398,
27746,
6,
1988,
796,
285,
81,
62,
3803,
6739,
628,
220,
220,
220,
285,
81,
62,
8671,
62,
65,
672,
69,
62,
8310,
86,
62,
961,
3784,
5589,
533,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
17440,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
796,
269,
62,
17440,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
340,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
45079,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
20797,
62,
1078,
7657,
796,
450,
499,
62,
7942,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
29982,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
1220,
65,
672,
69,
14,
361,
62,
8310,
86,
62,
66,
14804,
1416,
62,
29982,
62,
12001,
6739,
628,
220,
220,
220,
285,
81,
62,
8968,
3784,
14,
65,
672,
69,
14,
361,
62,
8310,
86,
62,
961,
93,
5589,
533,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
17440,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
796,
269,
62,
17440,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
340,
62,
2539,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
45079,
62,
2539,
198,
220,
220,
220,
220,
220,
220,
220,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
* Build exception instance from SYST message fields
* Inspiration: http://help.sap.com/abapdocu_740/en/abenmessage_interface_abexa.htm
class lcx_t100_syst definition inheriting from cx_dynamic_check final.
public section.
interfaces if_t100_message.
methods constructor.
data msgv1 type symsgv.
data msgv2 type symsgv.
data msgv3 type symsgv.
data msgv4 type symsgv.
endclass. "cx_t100 DEFINITION
*----------------------------------------------------------------------*
* CLASS cx_t100 IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
class lcx_t100_syst implementation.
method constructor.
super->constructor( ).
me->msgv1 = sy-msgv1.
me->msgv2 = sy-msgv2.
me->msgv3 = sy-msgv3.
me->msgv4 = sy-msgv4.
if_t100_message~t100key-msgid = sy-msgid.
if_t100_message~t100key-msgno = sy-msgno.
if_t100_message~t100key-attr1 = 'MSGV1'.
if_t100_message~t100key-attr2 = 'MSGV2'.
if_t100_message~t100key-attr3 = 'MSGV3'.
if_t100_message~t100key-attr4 = 'MSGV4'.
endmethod. "constructor
endclass. "cx_t100 IMPLEMENTATION
| [
9,
10934,
6631,
4554,
422,
19704,
2257,
3275,
7032,
198,
9,
25300,
15297,
25,
2638,
1378,
16794,
13,
82,
499,
13,
785,
14,
397,
499,
15390,
84,
62,
45598,
14,
268,
14,
397,
268,
20500,
62,
39994,
62,
397,
1069,
64,
13,
19211,
198,
198,
4871,
300,
66,
87,
62,
83,
3064,
62,
1837,
301,
6770,
10639,
1780,
422,
43213,
62,
67,
28995,
62,
9122,
2457,
13,
198,
220,
1171,
2665,
13,
198,
220,
220,
220,
20314,
611,
62,
83,
3064,
62,
20500,
13,
198,
220,
220,
220,
5050,
23772,
13,
198,
220,
220,
220,
1366,
31456,
85,
16,
2099,
827,
19662,
85,
13,
198,
220,
220,
220,
1366,
31456,
85,
17,
2099,
827,
19662,
85,
13,
198,
220,
220,
220,
1366,
31456,
85,
18,
2099,
827,
19662,
85,
13,
198,
220,
220,
220,
1366,
31456,
85,
19,
2099,
827,
19662,
85,
13,
198,
437,
4871,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
66,
87,
62,
83,
3064,
5550,
20032,
17941,
198,
198,
9,
10097,
23031,
9,
198,
9,
220,
220,
220,
220,
220,
220,
42715,
43213,
62,
83,
3064,
30023,
2538,
10979,
6234,
198,
9,
10097,
23031,
9,
198,
9,
198,
9,
10097,
23031,
9,
198,
4871,
300,
66,
87,
62,
83,
3064,
62,
1837,
301,
7822,
13,
198,
220,
2446,
23772,
13,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
6739,
198,
220,
220,
220,
502,
3784,
19662,
85,
16,
796,
827,
12,
19662,
85,
16,
13,
198,
220,
220,
220,
502,
3784,
19662,
85,
17,
796,
827,
12,
19662,
85,
17,
13,
198,
220,
220,
220,
502,
3784,
19662,
85,
18,
796,
827,
12,
19662,
85,
18,
13,
198,
220,
220,
220,
502,
3784,
19662,
85,
19,
796,
827,
12,
19662,
85,
19,
13,
198,
220,
220,
220,
611,
62,
83,
3064,
62,
20500,
93,
83,
3064,
2539,
12,
19662,
312,
796,
827,
12,
19662,
312,
13,
198,
220,
220,
220,
611,
62,
83,
3064,
62,
20500,
93,
83,
3064,
2539,
12,
19662,
3919,
796,
827,
12,
19662,
3919,
13,
198,
220,
220,
220,
611,
62,
83,
3064,
62,
20500,
93,
83,
3064,
2539,
12,
35226,
16,
796,
705,
5653,
37094,
16,
4458,
198,
220,
220,
220,
611,
62,
83,
3064,
62,
20500,
93,
83,
3064,
2539,
12,
35226,
17,
796,
705,
5653,
37094,
17,
4458,
198,
220,
220,
220,
611,
62,
83,
3064,
62,
20500,
93,
83,
3064,
2539,
12,
35226,
18,
796,
705,
5653,
37094,
18,
4458,
198,
220,
220,
220,
611,
62,
83,
3064,
62,
20500,
93,
83,
3064,
2539,
12,
35226,
19,
796,
705,
5653,
37094,
19,
4458,
198,
220,
886,
24396,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
41571,
273,
198,
437,
4871,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
66,
87,
62,
83,
3064,
30023,
2538,
10979,
6234,
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,
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test FOR TESTING.
ENDCLASS. "ltcl_Test
CLASS ltcl_test IMPLEMENTATION.
METHOD test.
zcl_abappgp_unit_test=>subpacket_identity(
iv_data = '01'
iv_type = zif_abappgp_constants=>c_sub_type-features ).
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,
486,
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,
40890,
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
] |
CLASS y_check_unit_test_assert DEFINITION PUBLIC INHERITING FROM y_check_base CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor.
PROTECTED SECTION.
METHODS inspect_tokens REDEFINITION.
PRIVATE SECTION.
METHODS get_parameter_reference IMPORTING statement TYPE sstmnt
parameter TYPE string
RETURNING VALUE(result) TYPE string
RAISING cx_sy_itab_line_not_found.
METHODS is_variable IMPORTING token TYPE stokesx
RETURNING VALUE(result) TYPE abap_bool.
ENDCLASS.
CLASS y_check_unit_test_assert IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
settings-pseudo_comment = '"#EC UT_ASSERT' ##NO_TEXT.
settings-disable_threshold_selection = abap_true.
settings-apply_on_productive_code = abap_false.
settings-apply_on_test_code = abap_true.
settings-threshold = 0.
settings-documentation = |{ c_docs_path-checks }unit_test_assert.md|.
relevant_statement_types = VALUE #( ( scan_struc_stmnt_type-method ) ).
relevant_structure_types = VALUE #( ).
set_check_message( 'Invalid Unit Test Assertion!' ).
ENDMETHOD.
METHOD inspect_tokens.
DATA(token) = ref_scan_manager->tokens[ statement-from ].
IF token-str NP '*ASSERT*'
OR token-type = scan_token_type-comment.
RETURN.
ENDIF.
TRY.
DATA(act) = get_parameter_reference( statement = statement
parameter = 'ACT' ).
DATA(exp) = get_parameter_reference( statement = statement
parameter = 'EXP' ).
CATCH cx_sy_itab_line_not_found.
RETURN.
ENDTRY.
IF act IS INITIAL
OR exp IS INITIAL.
RETURN.
ENDIF.
IF act <> exp.
RETURN.
ENDIF.
DATA(check_configuration) = detect_check_configuration( statement ).
IF check_configuration IS INITIAL.
RETURN.
ENDIF.
raise_error( statement_level = statement-level
statement_index = index
statement_from = statement-from
error_priority = check_configuration-prio ).
ENDMETHOD.
METHOD get_parameter_reference.
DATA(in) = abap_false.
DATA(depth) = 0.
DATA(position) = statement-from.
DO.
IF position = statement-to.
RETURN.
ENDIF.
DATA(token) = ref_scan_manager->tokens[ position ].
IF token-type = scan_token_type-comment.
position = position + 1.
CONTINUE.
ENDIF.
IF token-str = parameter.
in = abap_true.
depth = 0.
position = position + 2.
CONTINUE.
ENDIF.
IF in = abap_false.
position = position + 1.
CONTINUE.
ENDIF.
IF token-str CP '*(*'.
depth = depth + 1.
ELSEIF token-str CP '*)*'.
depth = depth - 1.
ENDIF.
IF depth = 0
AND line_exists( ref_scan_manager->tokens[ position + 1 ] ).
DATA(next) = ref_scan_manager->tokens[ position + 1 ].
IF next-str = '='.
in = abap_false.
RETURN.
ENDIF.
ENDIF.
IF is_variable( token ) = abap_false.
token-str = '*'.
ENDIF.
result = COND #( WHEN result IS INITIAL THEN token-str
ELSE |{ result } { token-str }| ).
position = position + 1.
ENDDO.
ENDMETHOD.
METHOD is_variable.
CHECK token-type = scan_token_type-identifier.
result = xsdbool( token-str CN '0123456789' ).
ENDMETHOD.
ENDCLASS.
| [
31631,
331,
62,
9122,
62,
20850,
62,
9288,
62,
30493,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
331,
62,
9122,
62,
8692,
29244,
6158,
44731,
764,
198,
220,
44731,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
23772,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
10104,
62,
83,
482,
641,
23848,
36,
20032,
17941,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
651,
62,
17143,
2357,
62,
35790,
30023,
9863,
2751,
2643,
41876,
264,
301,
76,
429,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11507,
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,
30826,
4261,
15871,
26173,
8924,
7,
20274,
8,
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,
17926,
1797,
2751,
43213,
62,
1837,
62,
270,
397,
62,
1370,
62,
1662,
62,
9275,
13,
628,
220,
220,
220,
337,
36252,
50,
318,
62,
45286,
30023,
9863,
2751,
11241,
41876,
336,
3369,
87,
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,
20274,
8,
41876,
450,
499,
62,
30388,
13,
198,
198,
10619,
31631,
13,
628,
198,
31631,
331,
62,
9122,
62,
20850,
62,
9288,
62,
30493,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
6739,
628,
220,
220,
220,
6460,
12,
7752,
12003,
62,
23893,
796,
705,
1,
2,
2943,
19255,
62,
10705,
17395,
6,
22492,
15285,
62,
32541,
13,
198,
220,
220,
220,
6460,
12,
40223,
62,
400,
10126,
62,
49283,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
6460,
12,
39014,
62,
261,
62,
27781,
62,
8189,
796,
450,
499,
62,
9562,
13,
198,
220,
220,
220,
6460,
12,
39014,
62,
261,
62,
9288,
62,
8189,
796,
450,
499,
62,
7942,
13,
198,
220,
220,
220,
6460,
12,
400,
10126,
796,
657,
13,
198,
220,
220,
220,
6460,
12,
22897,
341,
796,
930,
90,
269,
62,
31628,
62,
6978,
12,
42116,
1782,
20850,
62,
9288,
62,
30493,
13,
9132,
91,
13,
628,
220,
220,
220,
5981,
62,
26090,
62,
19199,
796,
26173,
8924,
1303,
7,
357,
9367,
62,
19554,
66,
62,
301,
76,
429,
62,
4906,
12,
24396,
1267,
6739,
198,
220,
220,
220,
5981,
62,
301,
5620,
62,
19199,
796,
26173,
8924,
1303,
7,
6739,
628,
220,
220,
220,
900,
62,
9122,
62,
20500,
7,
705,
44651,
11801,
6208,
2195,
861,
295,
13679,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
10104,
62,
83,
482,
641,
13,
198,
220,
220,
220,
42865,
7,
30001,
8,
796,
1006,
62,
35836,
62,
37153,
3784,
83,
482,
641,
58,
2643,
12,
6738,
20740,
628,
220,
220,
220,
16876,
11241,
12,
2536,
28498,
705,
9,
10705,
17395,
9,
6,
198,
220,
220,
220,
6375,
11241,
12,
4906,
796,
9367,
62,
30001,
62,
4906,
12,
23893,
13,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
529,
8,
796,
651,
62,
17143,
2357,
62,
35790,
7,
2643,
796,
2643,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11507,
796,
705,
10659,
6,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
11201,
8,
796,
651,
62,
17143,
2357,
62,
35790,
7,
2643,
796,
2643,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
11507,
796,
705,
49864,
6,
6739,
198,
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,
30826,
27064,
13,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
220,
220,
16876,
719,
3180,
3268,
2043,
12576,
198,
220,
220,
220,
6375,
1033,
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,
16876,
719,
1279,
29,
1033,
13,
198,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
42865,
7,
9122,
62,
11250,
3924,
8,
796,
4886,
62,
9122,
62,
11250,
3924,
7,
2643,
6739,
628,
220,
220,
220,
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,
796,
2643,
12,
5715,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2643,
62,
9630,
796,
6376,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2643,
62,
6738,
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,
796,
2198,
62,
11250,
3924,
12,
3448,
78,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
17143,
2357,
62,
35790
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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002, SKIP 1.
PARAMETER: TBLNAME LIKE DD02L-TABNAME.
IF TBLNAME IS INITIAL.
CALL FUNCTION 'UPLOAD'
EXPORTING
FILENAME = 'tablenames.txt'
IMPORTING
CANCEL = FILEOPENCANCELLED
TABLES
DATA_TAB = ITAB_TABLES.
IF NOT FILEOPENCANCELLED IS INITIAL.
EXIT.
ENDIF.
ELSE.
CLEAR ITAB_TABLES. REFRESH ITAB_TABLES.
ITAB_TABLES-TABNAME = TBLNAME.
APPEND ITAB_TABLES.
ENDIF.
SORT ITAB_TABLES.
DELETE ADJACENT DUPLICATES FROM ITAB_TABLES.
TRANSLATE ITAB_TABLES-TABNAME TO UPPER CASE.
SELECT TABNAME DDTEXT FROM DD02T
INTO CORRESPONDING FIELDS OF DD02T
FOR ALL ENTRIES IN ITAB_TABLES
WHERE TABNAME = ITAB_TABLES-TABNAME AND
DDLANGUAGE = 'E'.
FORMAT COLOR COL_KEY.
WRITE: / 'N ' AS SYMBOL,
DD02T-TABNAME RIGHT-JUSTIFIED, '-', DD02T-DDTEXT,
'? ' AS SYMBOL.
HIDE DD02T-TABNAME.
FORMAT COLOR OFF.
SELECT FIELDNAME ROLLNAME DATATYPE LENG DOMNAME FROM DD03L
INTO CORRESPONDING FIELDS OF DD03L
WHERE TABNAME = DD02T-TABNAME.
SELECT DDTEXT FROM DD04T
INTO CORRESPONDING FIELDS OF DD04T
WHERE ROLLNAME = DD03L-ROLLNAME AND
DDLANGUAGE = 'E'.
WRITE: /
DD03L-FIELDNAME, DD03L-ROLLNAME,
DD03L-DATATYPE, DD03L-LENG NO-ZERO,
DD03L-DOMNAME, (35) DD04T-DDTEXT.
ENDSELECT.
ENDSELECT.
ULINE.
ENDSELECT.
CLEAR DD02T-TABNAME.
AT LINE-SELECTION.
IF NOT DD02T-TABNAME IS INITIAL.
call function 'RS_DD_DEF_SHOW'
EXPORTING
OBJNAME = DD02T-TABNAME.
ENDIF.
CLEAR DD02T-TABNAME.
| [
2200,
15490,
1168,
51,
9148,
10778,
48920,
12,
33489,
4019,
13,
198,
198,
5603,
9148,
1546,
25,
20084,
2999,
43,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20084,
2999,
51,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20084,
3070,
43,
11,
198,
220,
220,
220,
220,
220,
220,
220,
20084,
3023,
51,
13,
198,
198,
26947,
25,
347,
43312,
3963,
314,
5603,
33,
62,
5603,
9148,
1546,
440,
4093,
4261,
50,
657,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
309,
6242,
20608,
34178,
20084,
2999,
43,
12,
5603,
15766,
10067,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
314,
5603,
33,
62,
5603,
9148,
1546,
13,
198,
198,
26947,
25,
45811,
3185,
24181,
19240,
3069,
1961,
13,
198,
198,
46506,
2849,
12,
6173,
2200,
1677,
25,
9440,
10979,
352,
7,
1795,
8,
40383,
12,
8298,
11,
14277,
4061,
352,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
9440,
10979,
352,
7,
1795,
8,
40383,
12,
21601,
11,
14277,
4061,
352,
13,
198,
27082,
2390,
2767,
1137,
25,
309,
9148,
20608,
34178,
20084,
2999,
43,
12,
5603,
15766,
10067,
13,
198,
198,
5064,
309,
9148,
20608,
3180,
3268,
2043,
12576,
13,
198,
220,
42815,
29397,
4177,
2849,
705,
52,
6489,
41048,
6,
198,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
34020,
1677,
10067,
796,
705,
8658,
11925,
1047,
13,
14116,
6,
198,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
15628,
34,
3698,
220,
220,
796,
45811,
3185,
24181,
19240,
3069,
1961,
198,
220,
220,
220,
220,
220,
220,
309,
6242,
28378,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
42865,
62,
5603,
33,
796,
314,
5603,
33,
62,
5603,
9148,
1546,
13,
198,
220,
16876,
5626,
45811,
3185,
24181,
19240,
3069,
1961,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
7788,
2043,
13,
198,
220,
23578,
5064,
13,
198,
3698,
5188,
13,
198,
220,
30301,
1503,
314,
5603,
33,
62,
5603,
9148,
1546,
13,
4526,
10913,
44011,
314,
5603,
33,
62,
5603,
9148,
1546,
13,
198,
220,
314,
5603,
33,
62,
5603,
9148,
1546,
12,
5603,
15766,
10067,
796,
309,
9148,
20608,
13,
198,
220,
43504,
10619,
314,
5603,
33,
62,
5603,
9148,
1546,
13,
198,
10619,
5064,
13,
198,
198,
50,
9863,
314,
5603,
33,
62,
5603,
9148,
1546,
13,
198,
7206,
2538,
9328,
5984,
41,
2246,
3525,
35480,
31484,
29462,
16034,
314,
5603,
33,
62,
5603,
9148,
1546,
13,
198,
5446,
1565,
8634,
6158,
314,
5603,
33,
62,
5603,
9148,
1546,
12,
5603,
15766,
10067,
5390,
471,
10246,
1137,
42001,
13,
198,
198,
46506,
309,
6242,
20608,
20084,
32541,
16034,
20084,
2999,
51,
198,
220,
220,
220,
220,
220,
220,
39319,
23929,
19535,
47,
18672,
2751,
18930,
3698,
5258,
3963,
20084,
2999,
51,
198,
220,
220,
220,
220,
220,
220,
7473,
11096,
12964,
5446,
11015,
3268,
314,
5603,
33,
62,
5603,
9148,
1546,
198,
220,
220,
220,
220,
220,
220,
33411,
309,
6242,
20608,
796,
314,
5603,
33,
62,
5603,
9148,
1546,
12,
5603,
15766,
10067,
5357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
360,
19260,
15567,
52,
11879,
796,
705,
36,
4458,
198,
220,
7473,
41636,
20444,
1581,
20444,
62,
20373,
13,
198,
220,
44423,
25,
1220,
705,
45,
705,
7054,
19704,
10744,
3535,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20084,
2999,
51,
12,
5603,
15766,
10067,
33621,
12,
25008,
28343,
11,
705,
12,
3256,
20084,
2999,
51,
12,
16458,
32541,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
705,
30,
705,
7054,
19704,
10744,
3535,
13,
198,
220,
367,
14114,
20084,
2999,
51,
12,
5603,
15766,
10067,
13,
198,
220,
7473,
41636,
20444,
1581,
18562,
13,
198,
220,
33493,
18930,
24639,
20608,
15107,
3069,
20608,
360,
1404,
1404,
56,
11401,
406,
26808,
24121,
20608,
16034,
20084,
3070,
43,
198,
220,
220,
220,
220,
220,
220,
220,
220,
39319,
23929,
19535,
47,
18672,
2751,
18930,
3698,
5258,
3963,
20084,
3070,
43,
198,
220,
220,
220,
220,
220,
220,
220,
220,
33411,
309,
6242,
20608,
796,
20084,
2999,
51,
12,
5603,
15766,
10067,
13,
198,
220,
220,
220,
33493,
20084,
32541,
16034,
20084,
3023,
51,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
39319,
23929,
19535,
47,
18672,
2751,
18930,
3698,
5258,
3963,
20084,
3023,
51,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33411,
15107,
3069,
20608,
796,
20084,
3070,
43,
12,
13252,
3069,
20608,
5357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
360,
19260,
15567,
52,
11879,
796,
705,
36,
4458,
198,
220,
220,
220,
220,
220,
44423,
25,
1220,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20084,
3070,
43,
12,
44603,
20608,
11,
20084,
3070,
43,
12,
13252,
3069,
20608,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20084,
3070,
43,
12,
35,
1404,
1404,
56,
11401,
11,
20084,
3070,
43,
12,
43,
26808,
8005,
12,
57,
34812,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
20084,
3070,
43,
12,
39170,
20608,
11,
357,
2327,
8,
20084,
3023,
51,
12,
16458,
32541,
13,
198,
220,
220,
220,
23578,
46506,
13,
198,
220,
23578,
46506,
13,
198,
220,
471,
24027,
13,
198,
10619,
46506,
13,
198,
29931,
1503,
20084,
2999,
51,
12,
5603,
15766,
10067,
13,
198,
198,
1404,
48920,
12,
46506,
2849,
13,
198,
220,
16876,
5626,
20084,
2999,
51,
12,
5603,
15766,
10067,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
869,
2163,
705,
6998,
62,
16458,
62,
32988,
62,
9693,
3913,
6,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
25334,
41,
20608,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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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
] |
CLASS zcl_abapgit_object_ecsd DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_object_ecatt_super
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
PROTECTED SECTION.
METHODS:
get_object_type REDEFINITION,
get_upload REDEFINITION,
get_download REDEFINITION,
get_lock_object REDEFINITION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_abapgit_object_ecsd IMPLEMENTATION.
METHOD get_download.
CREATE OBJECT ro_download TYPE zcl_abapgit_ecatt_system_downl.
ENDMETHOD.
METHOD get_lock_object.
rv_lock_object = 'E_ECATT_SD'.
ENDMETHOD.
METHOD get_object_type.
rv_object_type = cl_apl_ecatt_const=>obj_type_system_data.
ENDMETHOD.
METHOD get_upload.
CREATE OBJECT ro_upload TYPE zcl_abapgit_ecatt_system_upl.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
721,
21282,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
721,
1078,
62,
16668,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
651,
62,
15252,
62,
4906,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
651,
62,
25850,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
651,
62,
15002,
23848,
36,
20032,
17941,
11,
198,
220,
220,
220,
220,
220,
651,
62,
5354,
62,
15252,
23848,
36,
20032,
17941,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
721,
21282,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
651,
62,
15002,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
686,
62,
15002,
41876,
1976,
565,
62,
397,
499,
18300,
62,
721,
1078,
62,
10057,
62,
2902,
75,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
5354,
62,
15252,
13,
628,
220,
220,
220,
374,
85,
62,
5354,
62,
15252,
796,
705,
36,
62,
2943,
17139,
62,
10305,
4458,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
15252,
62,
4906,
13,
628,
220,
220,
220,
374,
85,
62,
15252,
62,
4906,
796,
537,
62,
64,
489,
62,
721,
1078,
62,
9979,
14804,
26801,
62,
4906,
62,
10057,
62,
7890,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
25850,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
686,
62,
25850,
41876,
1976,
565,
62,
397,
499,
18300,
62,
721,
1078,
62,
10057,
62,
84,
489,
13,
628,
220,
23578,
49273,
13,
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
] |
CLASS zcl_excel_reader_2007 DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
*"* public components of class ZCL_EXCEL_READER_2007
*"* do not include other source files here!!!
TYPE-POOLS ixml .
INTERFACES zif_excel_reader .
CLASS-METHODS fill_struct_from_attributes
IMPORTING
!ip_element TYPE REF TO if_ixml_element
CHANGING
!cp_structure TYPE any .
PROTECTED SECTION.
TYPES:
*"* protected components of class ZCL_EXCEL_READER_2007
*"* do not include other source files here!!!
BEGIN OF t_relationship,
id TYPE string,
type TYPE string,
target TYPE string,
targetmode TYPE string,
worksheet TYPE REF TO zcl_excel_worksheet,
sheetid TYPE string, "ins #235 - repeat rows/cols - needed to identify correct sheet
localsheetid TYPE string,
END OF t_relationship .
TYPES:
BEGIN OF t_fileversion,
appname TYPE string,
lastedited TYPE string,
lowestedited TYPE string,
rupbuild TYPE string,
codename TYPE string,
END OF t_fileversion .
TYPES:
BEGIN OF t_sheet,
name TYPE string,
sheetid TYPE string,
id TYPE string,
state TYPE string,
END OF t_sheet .
TYPES:
BEGIN OF t_workbookpr,
codename TYPE string,
defaultthemeversion TYPE string,
END OF t_workbookpr .
TYPES:
BEGIN OF t_sheetpr,
codename TYPE string,
END OF t_sheetpr .
TYPES:
BEGIN OF t_range,
name TYPE string,
hidden TYPE string, "inserted with issue #235 because Autofilters didn't passthrough
localsheetid TYPE string, " issue #163
END OF t_range .
TYPES:
t_fills TYPE STANDARD TABLE OF REF TO zcl_excel_style_fill WITH NON-UNIQUE DEFAULT KEY .
TYPES:
t_borders TYPE STANDARD TABLE OF REF TO zcl_excel_style_borders WITH NON-UNIQUE DEFAULT KEY .
TYPES:
t_fonts TYPE STANDARD TABLE OF REF TO zcl_excel_style_font WITH NON-UNIQUE DEFAULT KEY .
TYPES:
t_style_refs TYPE STANDARD TABLE OF REF TO zcl_excel_style WITH NON-UNIQUE DEFAULT KEY .
TYPES:
BEGIN OF t_color,
indexed TYPE string,
rgb TYPE string,
theme TYPE string,
tint TYPE string,
END OF t_color .
TYPES:
BEGIN OF t_rel_drawing,
id TYPE string,
content TYPE xstring,
file_ext TYPE string,
content_xml TYPE REF TO if_ixml_document,
END OF t_rel_drawing .
TYPES:
t_rel_drawings TYPE STANDARD TABLE OF t_rel_drawing WITH NON-UNIQUE DEFAULT KEY .
TYPES:
BEGIN OF gts_external_hyperlink,
id TYPE string,
target TYPE string,
END OF gts_external_hyperlink .
TYPES:
gtt_external_hyperlinks TYPE HASHED TABLE OF gts_external_hyperlink WITH UNIQUE KEY id .
TYPES:
BEGIN OF ty_ref_formulae,
sheet TYPE REF TO zcl_excel_worksheet,
row TYPE i,
column TYPE i,
si TYPE i,
ref TYPE string,
formula TYPE string,
END OF ty_ref_formulae .
TYPES:
tyt_ref_formulae TYPE HASHED TABLE OF ty_ref_formulae WITH UNIQUE KEY sheet row column .
TYPES:
BEGIN OF t_shared_string,
value TYPE string,
rtf TYPE zexcel_t_rtf,
END OF t_shared_string .
TYPES:
t_shared_strings TYPE STANDARD TABLE OF t_shared_string WITH DEFAULT KEY .
DATA shared_strings TYPE t_shared_strings .
DATA styles TYPE t_style_refs .
DATA mt_ref_formulae TYPE tyt_ref_formulae .
DATA mt_dxf_styles TYPE zexcel_t_styles_cond_mapping .
METHODS fill_row_outlines
IMPORTING
!io_worksheet TYPE REF TO zcl_excel_worksheet
RAISING
zcx_excel .
METHODS get_from_zip_archive
IMPORTING
!i_filename TYPE string
RETURNING
VALUE(r_content) TYPE xstring
RAISING
zcx_excel .
METHODS get_ixml_from_zip_archive
IMPORTING
!i_filename TYPE string
!is_normalizing TYPE abap_bool DEFAULT 'X'
RETURNING
VALUE(r_ixml) TYPE REF TO if_ixml_document
RAISING
zcx_excel .
METHODS load_drawing_anchor
IMPORTING
!io_anchor_element TYPE REF TO if_ixml_element
!io_worksheet TYPE REF TO zcl_excel_worksheet
!it_related_drawings TYPE t_rel_drawings .
METHODS load_shared_strings
IMPORTING
!ip_path TYPE string
RAISING
zcx_excel .
METHODS load_styles
IMPORTING
!ip_path TYPE string
!ip_excel TYPE REF TO zcl_excel
RAISING
zcx_excel .
METHODS load_dxf_styles
IMPORTING
!iv_path TYPE string
!io_excel TYPE REF TO zcl_excel
RAISING
zcx_excel .
METHODS load_style_borders
IMPORTING
!ip_xml TYPE REF TO if_ixml_document
RETURNING
VALUE(ep_borders) TYPE t_borders .
METHODS load_style_fills
IMPORTING
!ip_xml TYPE REF TO if_ixml_document
RETURNING
VALUE(ep_fills) TYPE t_fills .
METHODS load_style_font
IMPORTING
!io_xml_element TYPE REF TO if_ixml_element
RETURNING
VALUE(ro_font) TYPE REF TO zcl_excel_style_font .
METHODS load_style_fonts
IMPORTING
!ip_xml TYPE REF TO if_ixml_document
RETURNING
VALUE(ep_fonts) TYPE t_fonts .
METHODS load_style_num_formats
IMPORTING
!ip_xml TYPE REF TO if_ixml_document
RETURNING
VALUE(ep_num_formats) TYPE zcl_excel_style_number_format=>t_num_formats .
METHODS load_workbook
IMPORTING
!iv_workbook_full_filename TYPE string
!io_excel TYPE REF TO zcl_excel
RAISING
zcx_excel .
METHODS load_worksheet
IMPORTING
!ip_path TYPE string
!io_worksheet TYPE REF TO zcl_excel_worksheet
RAISING
zcx_excel .
METHODS load_worksheet_cond_format
IMPORTING
!io_ixml_worksheet TYPE REF TO if_ixml_document
!io_worksheet TYPE REF TO zcl_excel_worksheet
RAISING
zcx_excel .
METHODS load_worksheet_cond_format_aa
IMPORTING
!io_ixml_rule TYPE REF TO if_ixml_element
!io_style_cond TYPE REF TO zcl_excel_style_cond.
METHODS load_worksheet_cond_format_ci
IMPORTING
!io_ixml_rule TYPE REF TO if_ixml_element
!io_style_cond TYPE REF TO zcl_excel_style_cond .
METHODS load_worksheet_cond_format_cs
IMPORTING
!io_ixml_rule TYPE REF TO if_ixml_element
!io_style_cond TYPE REF TO zcl_excel_style_cond .
METHODS load_worksheet_cond_format_ex
IMPORTING
!io_ixml_rule TYPE REF TO if_ixml_element
!io_style_cond TYPE REF TO zcl_excel_style_cond .
METHODS load_worksheet_cond_format_is
IMPORTING
!io_ixml_rule TYPE REF TO if_ixml_element
!io_style_cond TYPE REF TO zcl_excel_style_cond .
METHODS load_worksheet_cond_format_db
IMPORTING
!io_ixml_rule TYPE REF TO if_ixml_element
!io_style_cond TYPE REF TO zcl_excel_style_cond .
METHODS load_worksheet_cond_format_t10
IMPORTING
!io_ixml_rule TYPE REF TO if_ixml_element
!io_style_cond TYPE REF TO zcl_excel_style_cond .
METHODS load_worksheet_drawing
IMPORTING
!ip_path TYPE string
!io_worksheet TYPE REF TO zcl_excel_worksheet
RAISING
zcx_excel .
METHODS load_worksheet_hyperlinks
IMPORTING
!io_ixml_worksheet TYPE REF TO if_ixml_document
!io_worksheet TYPE REF TO zcl_excel_worksheet
!it_external_hyperlinks TYPE gtt_external_hyperlinks
RAISING
zcx_excel .
METHODS load_worksheet_ignored_errors
IMPORTING
!io_ixml_worksheet TYPE REF TO if_ixml_document
!io_worksheet TYPE REF TO zcl_excel_worksheet
RAISING
zcx_excel .
METHODS load_worksheet_pagebreaks
IMPORTING
!io_ixml_worksheet TYPE REF TO if_ixml_document
!io_worksheet TYPE REF TO zcl_excel_worksheet
RAISING
zcx_excel .
METHODS load_worksheet_autofilter
IMPORTING
io_ixml_worksheet TYPE REF TO if_ixml_document
io_worksheet TYPE REF TO zcl_excel_worksheet
RAISING
zcx_excel.
METHODS load_worksheet_pagemargins
IMPORTING
!io_ixml_worksheet TYPE REF TO if_ixml_document
!io_worksheet TYPE REF TO zcl_excel_worksheet
RAISING
zcx_excel .
CLASS-METHODS resolve_path
IMPORTING
!ip_path TYPE string
RETURNING
VALUE(rp_result) TYPE string .
METHODS resolve_referenced_formulae .
METHODS get_dxf_style_guid
IMPORTING
!io_ixml_dxf TYPE REF TO if_ixml_element
!io_excel TYPE REF TO zcl_excel
RETURNING
VALUE(rv_style_guid) TYPE zexcel_cell_style .
METHODS load_theme
IMPORTING
VALUE(iv_path) TYPE string
!ip_excel TYPE REF TO zcl_excel
RAISING
zcx_excel .
PRIVATE SECTION.
DATA zip TYPE REF TO lcl_zip_archive .
METHODS create_zip_archive
IMPORTING
!i_xlsx_binary TYPE xstring
!i_use_alternate_zip TYPE seoclsname OPTIONAL
RETURNING
VALUE(e_zip) TYPE REF TO lcl_zip_archive
RAISING
zcx_excel .
METHODS read_from_applserver
IMPORTING
!i_filename TYPE csequence
RETURNING
VALUE(r_excel_data) TYPE xstring
RAISING
zcx_excel.
METHODS read_from_local_file
IMPORTING
!i_filename TYPE csequence
RETURNING
VALUE(r_excel_data) TYPE xstring
RAISING
zcx_excel .
ENDCLASS.
CLASS zcl_excel_reader_2007 IMPLEMENTATION.
METHOD create_zip_archive.
CASE i_use_alternate_zip.
WHEN space.
e_zip = lcl_abap_zip_archive=>create( i_xlsx_binary ).
WHEN OTHERS.
e_zip = lcl_alternate_zip_archive=>create( i_data = i_xlsx_binary
i_alternate_zip_class = i_use_alternate_zip ).
ENDCASE.
ENDMETHOD.
METHOD fill_row_outlines.
TYPES: BEGIN OF lts_row_data,
row TYPE i,
outline_level TYPE i,
END OF lts_row_data,
ltt_row_data TYPE SORTED TABLE OF lts_row_data WITH UNIQUE KEY row.
DATA: lt_row_data TYPE ltt_row_data,
ls_row_data LIKE LINE OF lt_row_data,
lt_collapse_rows TYPE HASHED TABLE OF i WITH UNIQUE KEY table_line,
lv_collapsed TYPE abap_bool,
lv_outline_level TYPE i,
lv_next_consecutive_row TYPE i,
lt_outline_rows TYPE zcl_excel_worksheet=>mty_ts_outlines_row,
ls_outline_row LIKE LINE OF lt_outline_rows,
lo_row TYPE REF TO zcl_excel_row,
lo_row_iterator TYPE REF TO zcl_excel_collection_iterator,
lv_row_offset TYPE i,
lv_row_collapse_flag TYPE i.
FIELD-SYMBOLS: <ls_row_data> LIKE LINE OF lt_row_data.
* First collect information about outlines ( outline leven and collapsed state )
lo_row_iterator = io_worksheet->get_rows_iterator( ).
WHILE lo_row_iterator->has_next( ) = abap_true.
lo_row ?= lo_row_iterator->get_next( ).
ls_row_data-row = lo_row->get_row_index( ).
ls_row_data-outline_level = lo_row->get_outline_level( ).
IF ls_row_data-outline_level IS NOT INITIAL.
INSERT ls_row_data INTO TABLE lt_row_data.
ENDIF.
lv_collapsed = lo_row->get_collapsed( ).
IF lv_collapsed = abap_true.
INSERT lo_row->get_row_index( ) INTO TABLE lt_collapse_rows.
ENDIF.
ENDWHILE.
* Now parse this information - we need consecutive rows - any gap will create a new outline
DO 7 TIMES. " max number of outlines allowed
lv_outline_level = sy-index.
CLEAR lv_next_consecutive_row.
CLEAR ls_outline_row.
LOOP AT lt_row_data ASSIGNING <ls_row_data> WHERE outline_level >= lv_outline_level.
IF lv_next_consecutive_row <> <ls_row_data>-row " A gap --> close all open outlines
AND lv_next_consecutive_row IS NOT INITIAL. " First time in loop.
INSERT ls_outline_row INTO TABLE lt_outline_rows.
CLEAR: ls_outline_row.
ENDIF.
IF ls_outline_row-row_from IS INITIAL.
ls_outline_row-row_from = <ls_row_data>-row.
ENDIF.
ls_outline_row-row_to = <ls_row_data>-row.
lv_next_consecutive_row = <ls_row_data>-row + 1.
ENDLOOP.
IF ls_outline_row-row_from IS NOT INITIAL.
INSERT ls_outline_row INTO TABLE lt_outline_rows.
ENDIF.
ENDDO.
* lt_outline_rows holds all outline information
* we now need to determine whether the outline is collapsed or not
LOOP AT lt_outline_rows INTO ls_outline_row.
IF io_worksheet->zif_excel_sheet_properties~summarybelow = zif_excel_sheet_properties=>c_below_off.
lv_row_collapse_flag = ls_outline_row-row_from - 1.
ELSE.
lv_row_collapse_flag = ls_outline_row-row_to + 1.
ENDIF.
READ TABLE lt_collapse_rows TRANSPORTING NO FIELDS WITH TABLE KEY table_line = lv_row_collapse_flag.
IF sy-subrc = 0.
ls_outline_row-collapsed = abap_true.
ENDIF.
io_worksheet->set_row_outline( iv_row_from = ls_outline_row-row_from
iv_row_to = ls_outline_row-row_to
iv_collapsed = ls_outline_row-collapsed ).
ENDLOOP.
* Finally purge outline information ( collapsed state, outline leve) from row_dimensions, since we want to keep these in the outline-table
lo_row_iterator = io_worksheet->get_rows_iterator( ).
WHILE lo_row_iterator->has_next( ) = abap_true.
lo_row ?= lo_row_iterator->get_next( ).
lo_row->set_outline_level( 0 ).
lo_row->set_collapsed( abap_false ).
ENDWHILE.
ENDMETHOD.
METHOD fill_struct_from_attributes.
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-07
* - ...
* changes: renaming variables to naming conventions
* aligning code
* adding comments to explain what we are trying to achieve
*--------------------------------------------------------------------*
DATA: lv_name TYPE string,
lo_attributes TYPE REF TO if_ixml_named_node_map,
lo_attribute TYPE REF TO if_ixml_attribute,
lo_iterator TYPE REF TO if_ixml_node_iterator.
FIELD-SYMBOLS: <component> TYPE any.
*--------------------------------------------------------------------*
* The values of named attributes of a tag are being read and moved into corresponding
* fields of given structure
* Behaves like move-corresonding tag to structure
* Example:
* <Relationship Target="docProps/app.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Id="rId3"/>
* Here the attributes are Target, Type and Id. Thus if the passed
* structure has fieldnames Id and Target these would be filled with
* "rId3" and "docProps/app.xml" respectively
*--------------------------------------------------------------------*
CLEAR cp_structure.
lo_attributes = ip_element->get_attributes( ).
lo_iterator = lo_attributes->create_iterator( ).
lo_attribute ?= lo_iterator->get_next( ).
WHILE lo_attribute IS BOUND.
lv_name = lo_attribute->get_name( ).
TRANSLATE lv_name TO UPPER CASE.
ASSIGN COMPONENT lv_name OF STRUCTURE cp_structure TO <component>.
IF sy-subrc = 0.
<component> = lo_attribute->get_value( ).
ENDIF.
lo_attribute ?= lo_iterator->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD get_dxf_style_guid.
DATA: lo_ixml_dxf_children TYPE REF TO if_ixml_node_list,
lo_ixml_iterator_dxf_children TYPE REF TO if_ixml_node_iterator,
lo_ixml_dxf_child TYPE REF TO if_ixml_element,
lv_dxf_child_type TYPE string,
lo_ixml_element TYPE REF TO if_ixml_element,
lo_ixml_element2 TYPE REF TO if_ixml_element,
lv_val TYPE string.
DATA: ls_cstyle TYPE zexcel_s_cstyle_complete,
ls_cstylex TYPE zexcel_s_cstylex_complete.
lo_ixml_dxf_children = io_ixml_dxf->get_children( ).
lo_ixml_iterator_dxf_children = lo_ixml_dxf_children->create_iterator( ).
lo_ixml_dxf_child ?= lo_ixml_iterator_dxf_children->get_next( ).
WHILE lo_ixml_dxf_child IS BOUND.
lv_dxf_child_type = lo_ixml_dxf_child->get_name( ).
CASE lv_dxf_child_type.
WHEN 'font'.
*--------------------------------------------------------------------*
* italic
*--------------------------------------------------------------------*
lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'i' ).
IF lo_ixml_element IS BOUND.
CLEAR lv_val.
lv_val = lo_ixml_element->get_attribute_ns( 'val' ).
IF lv_val <> '0'.
ls_cstyle-font-italic = 'X'.
ls_cstylex-font-italic = 'X'.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* bold
*--------------------------------------------------------------------*
lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'b' ).
IF lo_ixml_element IS BOUND.
CLEAR lv_val.
lv_val = lo_ixml_element->get_attribute_ns( 'val' ).
IF lv_val <> '0'.
ls_cstyle-font-bold = 'X'.
ls_cstylex-font-bold = 'X'.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* strikethrough
*--------------------------------------------------------------------*
lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'strike' ).
IF lo_ixml_element IS BOUND.
CLEAR lv_val.
lv_val = lo_ixml_element->get_attribute_ns( 'val' ).
IF lv_val <> '0'.
ls_cstyle-font-strikethrough = 'X'.
ls_cstylex-font-strikethrough = 'X'.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* color
*--------------------------------------------------------------------*
lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'color' ).
IF lo_ixml_element IS BOUND.
CLEAR lv_val.
lv_val = lo_ixml_element->get_attribute_ns( 'rgb' ).
ls_cstyle-font-color-rgb = lv_val.
ls_cstylex-font-color-rgb = 'X'.
ENDIF.
WHEN 'fill'.
lo_ixml_element = lo_ixml_dxf_child->find_from_name( 'patternFill' ).
IF lo_ixml_element IS BOUND.
lo_ixml_element2 = lo_ixml_element->find_from_name( 'bgColor' ).
IF lo_ixml_element2 IS BOUND.
CLEAR lv_val.
lv_val = lo_ixml_element2->get_attribute_ns( 'rgb' ).
IF lv_val IS NOT INITIAL.
ls_cstyle-fill-filltype = zcl_excel_style_fill=>c_fill_solid.
ls_cstyle-fill-bgcolor-rgb = lv_val.
ls_cstylex-fill-filltype = 'X'.
ls_cstylex-fill-bgcolor-rgb = 'X'.
ENDIF.
CLEAR lv_val.
lv_val = lo_ixml_element2->get_attribute_ns( 'theme' ).
IF lv_val IS NOT INITIAL.
ls_cstyle-fill-filltype = zcl_excel_style_fill=>c_fill_solid.
ls_cstyle-fill-bgcolor-theme = lv_val.
ls_cstylex-fill-filltype = 'X'.
ls_cstylex-fill-bgcolor-theme = 'X'.
ENDIF.
CLEAR lv_val.
ENDIF.
ENDIF.
ENDCASE.
lo_ixml_dxf_child ?= lo_ixml_iterator_dxf_children->get_next( ).
ENDWHILE.
rv_style_guid = io_excel->get_static_cellstyle_guid( ip_cstyle_complete = ls_cstyle
ip_cstylex_complete = ls_cstylex ).
ENDMETHOD.
METHOD get_from_zip_archive.
ASSERT zip IS BOUND. " zip object has to exist at this point
r_content = zip->read( i_filename ).
ENDMETHOD.
METHOD get_ixml_from_zip_archive.
DATA: lv_content TYPE xstring,
lo_ixml TYPE REF TO if_ixml,
lo_streamfactory TYPE REF TO if_ixml_stream_factory,
lo_istream TYPE REF TO if_ixml_istream,
lo_parser TYPE REF TO if_ixml_parser.
*--------------------------------------------------------------------*
* Load XML file from archive into an input stream,
* and parse that stream into an ixml object
*--------------------------------------------------------------------*
lv_content = me->get_from_zip_archive( i_filename ).
lo_ixml = cl_ixml=>create( ).
lo_streamfactory = lo_ixml->create_stream_factory( ).
lo_istream = lo_streamfactory->create_istream_xstring( lv_content ).
r_ixml = lo_ixml->create_document( ).
lo_parser = lo_ixml->create_parser( stream_factory = lo_streamfactory
istream = lo_istream
document = r_ixml ).
lo_parser->set_normalizing( is_normalizing ).
lo_parser->set_validating( mode = if_ixml_parser=>co_no_validation ).
lo_parser->parse( ).
ENDMETHOD.
METHOD load_drawing_anchor.
TYPES: BEGIN OF t_c_nv_pr,
name TYPE string,
id TYPE string,
END OF t_c_nv_pr.
TYPES: BEGIN OF t_blip,
cstate TYPE string,
embed TYPE string,
END OF t_blip.
TYPES: BEGIN OF t_chart,
id TYPE string,
END OF t_chart.
TYPES: BEGIN OF t_ext,
cx TYPE string,
cy TYPE string,
END OF t_ext.
CONSTANTS: lc_xml_attr_true TYPE string VALUE 'true',
lc_xml_attr_true_int TYPE string VALUE '1'.
CONSTANTS: lc_rel_chart TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart',
lc_rel_image TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image'.
DATA: lo_drawing TYPE REF TO zcl_excel_drawing,
node TYPE REF TO if_ixml_element,
node2 TYPE REF TO if_ixml_element,
node3 TYPE REF TO if_ixml_element,
node4 TYPE REF TO if_ixml_element,
ls_upper TYPE zexcel_drawing_location,
ls_lower TYPE zexcel_drawing_location,
ls_size TYPE zexcel_drawing_size,
ext TYPE t_ext,
lv_content TYPE xstring,
lv_relation_id TYPE string,
lv_title TYPE string,
cnvpr TYPE t_c_nv_pr,
blip TYPE t_blip,
chart TYPE t_chart,
drawing_type TYPE zexcel_drawing_type,
rel_drawing TYPE t_rel_drawing.
node ?= io_anchor_element->find_from_name( name = 'from' namespace = 'xdr' ).
CHECK node IS NOT INITIAL.
node2 ?= node->find_from_name( name = 'col' namespace = 'xdr' ).
ls_upper-col = node2->get_value( ).
node2 ?= node->find_from_name( name = 'row' namespace = 'xdr' ).
ls_upper-row = node2->get_value( ).
node2 ?= node->find_from_name( name = 'colOff' namespace = 'xdr' ).
ls_upper-col_offset = node2->get_value( ).
node2 ?= node->find_from_name( name = 'rowOff' namespace = 'xdr' ).
ls_upper-row_offset = node2->get_value( ).
node ?= io_anchor_element->find_from_name( name = 'ext' namespace = 'xdr' ).
IF node IS INITIAL.
CLEAR ls_size.
ELSE.
me->fill_struct_from_attributes( EXPORTING ip_element = node CHANGING cp_structure = ext ).
ls_size-width = ext-cx.
ls_size-height = ext-cy.
TRY.
ls_size-width = zcl_excel_drawing=>emu2pixel( ls_size-width ).
CATCH cx_root.
ENDTRY.
TRY.
ls_size-height = zcl_excel_drawing=>emu2pixel( ls_size-height ).
CATCH cx_root.
ENDTRY.
ENDIF.
node ?= io_anchor_element->find_from_name( name = 'to' namespace = 'xdr' ).
IF node IS INITIAL.
CLEAR ls_lower.
ELSE.
node2 ?= node->find_from_name( name = 'col' namespace = 'xdr' ).
ls_lower-col = node2->get_value( ).
node2 ?= node->find_from_name( name = 'row' namespace = 'xdr' ).
ls_lower-row = node2->get_value( ).
node2 ?= node->find_from_name( name = 'colOff' namespace = 'xdr' ).
ls_lower-col_offset = node2->get_value( ).
node2 ?= node->find_from_name( name = 'rowOff' namespace = 'xdr' ).
ls_lower-row_offset = node2->get_value( ).
ENDIF.
node ?= io_anchor_element->find_from_name( name = 'pic' namespace = 'xdr' ).
IF node IS NOT INITIAL.
node2 ?= node->find_from_name( name = 'nvPicPr' namespace = 'xdr' ).
CHECK node2 IS NOT INITIAL.
node3 ?= node2->find_from_name( name = 'cNvPr' namespace = 'xdr' ).
CHECK node3 IS NOT INITIAL.
me->fill_struct_from_attributes( EXPORTING ip_element = node3 CHANGING cp_structure = cnvpr ).
lv_title = cnvpr-name.
node2 ?= node->find_from_name( name = 'blipFill' namespace = 'xdr' ).
CHECK node2 IS NOT INITIAL.
node3 ?= node2->find_from_name( name = 'blip' namespace = 'a' ).
CHECK node3 IS NOT INITIAL.
me->fill_struct_from_attributes( EXPORTING ip_element = node3 CHANGING cp_structure = blip ).
lv_relation_id = blip-embed.
drawing_type = zcl_excel_drawing=>type_image.
ENDIF.
node ?= io_anchor_element->find_from_name( name = 'graphicFrame' namespace = 'xdr' ).
IF node IS NOT INITIAL.
node2 ?= node->find_from_name( name = 'nvGraphicFramePr' namespace = 'xdr' ).
CHECK node2 IS NOT INITIAL.
node3 ?= node2->find_from_name( name = 'cNvPr' namespace = 'xdr' ).
CHECK node3 IS NOT INITIAL.
me->fill_struct_from_attributes( EXPORTING ip_element = node3 CHANGING cp_structure = cnvpr ).
lv_title = cnvpr-name.
node2 ?= node->find_from_name( name = 'graphic' namespace = 'a' ).
CHECK node2 IS NOT INITIAL.
node3 ?= node2->find_from_name( name = 'graphicData' namespace = 'a' ).
CHECK node3 IS NOT INITIAL.
node4 ?= node2->find_from_name( name = 'chart' namespace = 'c' ).
CHECK node4 IS NOT INITIAL.
me->fill_struct_from_attributes( EXPORTING ip_element = node4 CHANGING cp_structure = chart ).
lv_relation_id = chart-id.
drawing_type = zcl_excel_drawing=>type_chart.
ENDIF.
lo_drawing = io_worksheet->excel->add_new_drawing(
ip_type = drawing_type
ip_title = lv_title ).
io_worksheet->add_drawing( lo_drawing ).
lo_drawing->set_position2(
EXPORTING
ip_from = ls_upper
ip_to = ls_lower ).
READ TABLE it_related_drawings INTO rel_drawing
WITH KEY id = lv_relation_id.
lo_drawing->set_media(
EXPORTING
ip_media = rel_drawing-content
ip_media_type = rel_drawing-file_ext
ip_width = ls_size-width
ip_height = ls_size-height ).
IF drawing_type = zcl_excel_drawing=>type_chart.
* Begin fix for Issue #551
DATA: lo_tmp_node_2 TYPE REF TO if_ixml_element.
lo_tmp_node_2 ?= rel_drawing-content_xml->find_from_name( name = 'pieChart' namespace = 'c' ).
IF lo_tmp_node_2 IS NOT INITIAL.
lo_drawing->graph_type = zcl_excel_drawing=>c_graph_pie.
ELSE.
lo_tmp_node_2 ?= rel_drawing-content_xml->find_from_name( name = 'barChart' namespace = 'c' ).
IF lo_tmp_node_2 IS NOT INITIAL.
lo_drawing->graph_type = zcl_excel_drawing=>c_graph_bars.
ELSE.
lo_tmp_node_2 ?= rel_drawing-content_xml->find_from_name( name = 'lineChart' namespace = 'c' ).
IF lo_tmp_node_2 IS NOT INITIAL.
lo_drawing->graph_type = zcl_excel_drawing=>c_graph_line.
ENDIF.
ENDIF.
ENDIF.
* End fix for issue #551
"-------------Added by Alessandro Iannacci - Should load chart attributes
lo_drawing->load_chart_attributes( rel_drawing-content_xml ).
ENDIF.
ENDMETHOD.
METHOD load_dxf_styles.
DATA: lo_styles_xml TYPE REF TO if_ixml_document,
lo_node_dxfs TYPE REF TO if_ixml_element,
lo_nodes_dxf TYPE REF TO if_ixml_node_collection,
lo_iterator_dxf TYPE REF TO if_ixml_node_iterator,
lo_node_dxf TYPE REF TO if_ixml_element,
lv_dxf_count TYPE i.
FIELD-SYMBOLS: <ls_dxf_style> LIKE LINE OF mt_dxf_styles.
*--------------------------------------------------------------------*
* Look for dxfs-node
*--------------------------------------------------------------------*
lo_styles_xml = me->get_ixml_from_zip_archive( iv_path ).
lo_node_dxfs = lo_styles_xml->find_from_name( 'dxfs' ).
CHECK lo_node_dxfs IS BOUND.
*--------------------------------------------------------------------*
* loop through all dxf-nodes and create style for each
*--------------------------------------------------------------------*
lo_nodes_dxf ?= lo_node_dxfs->get_elements_by_tag_name( 'dxf' ).
lo_iterator_dxf = lo_nodes_dxf->create_iterator( ).
lo_node_dxf ?= lo_iterator_dxf->get_next( ).
WHILE lo_node_dxf IS BOUND.
APPEND INITIAL LINE TO mt_dxf_styles ASSIGNING <ls_dxf_style>.
<ls_dxf_style>-dxf = lv_dxf_count. " We start counting at 0
ADD 1 TO lv_dxf_count. " prepare next entry
<ls_dxf_style>-guid = get_dxf_style_guid( io_ixml_dxf = lo_node_dxf
io_excel = io_excel ).
lo_node_dxf ?= lo_iterator_dxf->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_shared_strings.
*--------------------------------------------------------------------*
* ToDos:
* 2do§1 Support partial formatting of strings in cells
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-11
* - ...
* changes: renaming variables to naming conventions
* renaming variables to indicate what they are used for
* aligning code
* adding comments to explain what we are trying to achieve
* rewriting code for better readibility
*--------------------------------------------------------------------*
DATA:
lo_shared_strings_xml TYPE REF TO if_ixml_document,
lo_node_si TYPE REF TO if_ixml_element,
lo_node_si_child TYPE REF TO if_ixml_element,
lo_node_r_child_t TYPE REF TO if_ixml_element,
lo_node_r_child_rpr TYPE REF TO if_ixml_element,
lo_font TYPE REF TO zcl_excel_style_font,
ls_rtf TYPE zexcel_s_rtf,
lv_current_offset TYPE int2,
lv_tag_name TYPE string,
lv_node_value TYPE string.
FIELD-SYMBOLS: <ls_shared_string> LIKE LINE OF me->shared_strings.
*--------------------------------------------------------------------*
* §1 Parse shared strings file and get into internal table
* So far I have encountered 2 ways how a string can be represented in the shared strings file
* §1.1 - "simple" strings
* §1.2 - rich text formatted strings
* Following is an example how this file could be set up; 2 strings in simple formatting, 3rd string rich textformatted
* <?xml version="1.0" encoding="UTF-8" standalone="true"?>
* <sst uniqueCount="6" count="6" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
* <si>
* <t>This is a teststring 1</t>
* </si>
* <si>
* <t>This is a teststring 2</t>
* </si>
* <si>
* <r>
* <t>T</t>
* </r>
* <r>
* <rPr>
* <sz val="11"/>
* <color rgb="FFFF0000"/>
* <rFont val="Calibri"/>
* <family val="2"/>
* <scheme val="minor"/>
* </rPr>
* <t xml:space="preserve">his is a </t>
* </r>
* <r>
* <rPr>
* <sz val="11"/>
* <color theme="1"/>
* <rFont val="Calibri"/>
* <family val="2"/>
* <scheme val="minor"/>
* </rPr>
* <t>teststring 3</t>
* </r>
* </si>
* </sst>
*--------------------------------------------------------------------*
lo_shared_strings_xml = me->get_ixml_from_zip_archive( i_filename = ip_path
is_normalizing = space ). " NO!!! normalizing - otherwise leading blanks will be omitted and that is not really desired for the stringtable
lo_node_si ?= lo_shared_strings_xml->find_from_name( 'si' ).
WHILE lo_node_si IS BOUND.
APPEND INITIAL LINE TO me->shared_strings ASSIGNING <ls_shared_string>. " Each <si>-entry in the xml-file must lead to an entry in our stringtable
lo_node_si_child ?= lo_node_si->get_first_child( ).
IF lo_node_si_child IS BOUND.
lv_tag_name = lo_node_si_child->get_name( ).
IF lv_tag_name = 't'.
*--------------------------------------------------------------------*
* §1.1 - "simple" strings
* Example: see above
*--------------------------------------------------------------------*
<ls_shared_string>-value = lo_node_si_child->get_value( ).
ELSE.
*--------------------------------------------------------------------*
* §1.2 - rich text formatted strings
* it is sufficient to strip the <t>...</t> tag from each <r>-tag and concatenate these
* as long as rich text formatting is not supported (2do§1) ignore all info about formatting
* Example: see above
*--------------------------------------------------------------------*
CLEAR: lv_current_offset.
WHILE lo_node_si_child IS BOUND. " actually these children of <si> are <r>-tags
CLEAR: ls_rtf.
lo_node_r_child_rpr ?= lo_node_si_child->find_from_name( 'rPr' ). " extracting rich text formating data
IF lo_node_r_child_rpr IS BOUND.
lo_font = load_style_font( lo_node_r_child_rpr ).
ls_rtf-font = lo_font->get_structure( ).
ENDIF.
ls_rtf-offset = lv_current_offset.
lo_node_r_child_t ?= lo_node_si_child->find_from_name( 't' ). " extract the <t>...</t> part of each <r>-tag
IF lo_node_r_child_t IS BOUND.
lv_node_value = lo_node_r_child_t->get_value( ).
CONCATENATE <ls_shared_string>-value lv_node_value INTO <ls_shared_string>-value RESPECTING BLANKS.
ls_rtf-length = strlen( lv_node_value ).
ENDIF.
lv_current_offset = strlen( <ls_shared_string>-value ).
APPEND ls_rtf TO <ls_shared_string>-rtf.
lo_node_si_child ?= lo_node_si_child->get_next( ).
ENDWHILE.
ENDIF.
ENDIF.
lo_node_si ?= lo_node_si->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_styles.
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (wip ) 2012-11-25
* - ...
* changes: renaming variables and types to naming conventions
* aligning code
* adding comments to explain what we are trying to achieve
*--------------------------------------------------------------------*
TYPES: BEGIN OF lty_xf,
applyalignment TYPE string,
applyborder TYPE string,
applyfill TYPE string,
applyfont TYPE string,
applynumberformat TYPE string,
applyprotection TYPE string,
borderid TYPE string,
fillid TYPE string,
fontid TYPE string,
numfmtid TYPE string,
pivotbutton TYPE string,
quoteprefix TYPE string,
xfid TYPE string,
END OF lty_xf.
TYPES: BEGIN OF lty_alignment,
horizontal TYPE string,
indent TYPE string,
justifylastline TYPE string,
readingorder TYPE string,
relativeindent TYPE string,
shrinktofit TYPE string,
textrotation TYPE string,
vertical TYPE string,
wraptext TYPE string,
END OF lty_alignment.
TYPES: BEGIN OF lty_protection,
hidden TYPE string,
locked TYPE string,
END OF lty_protection.
DATA: lo_styles_xml TYPE REF TO if_ixml_document,
lo_style TYPE REF TO zcl_excel_style,
lt_num_formats TYPE zcl_excel_style_number_format=>t_num_formats,
lt_fills TYPE t_fills,
lt_borders TYPE t_borders,
lt_fonts TYPE t_fonts,
ls_num_format TYPE zcl_excel_style_number_format=>t_num_format,
ls_fill TYPE REF TO zcl_excel_style_fill,
ls_cell_border TYPE REF TO zcl_excel_style_borders,
ls_font TYPE REF TO zcl_excel_style_font,
lo_node_cellxfs TYPE REF TO if_ixml_element,
lo_node_cellxfs_xf TYPE REF TO if_ixml_element,
lo_node_cellxfs_xf_alignment TYPE REF TO if_ixml_element,
lo_node_cellxfs_xf_protection TYPE REF TO if_ixml_element,
lo_nodes_xf TYPE REF TO if_ixml_node_collection,
lo_iterator_cellxfs TYPE REF TO if_ixml_node_iterator,
ls_xf TYPE lty_xf,
ls_alignment TYPE lty_alignment,
ls_protection TYPE lty_protection,
lv_index TYPE i.
*--------------------------------------------------------------------*
* To build a complete style that fully describes how a cell looks like
* we need the various parts
* §1 - Numberformat
* §2 - Fillstyle
* §3 - Borders
* §4 - Font
* §5 - Alignment
* §6 - Protection
* Following is an example how this part of a file could be set up
* ...
* parts with various formatinformation - see §1,§2,§3,§4
* ...
* <cellXfs count="26">
* <xf numFmtId="0" borderId="0" fillId="0" fontId="0" xfId="0"/>
* <xf numFmtId="0" borderId="0" fillId="2" fontId="0" xfId="0" applyFill="1"/>
* <xf numFmtId="0" borderId="1" fillId="3" fontId="0" xfId="0" applyFill="1" applyBorder="1"/>
* <xf numFmtId="0" borderId="2" fillId="3" fontId="0" xfId="0" applyFill="1" applyBorder="1"/>
* <xf numFmtId="0" borderId="3" fillId="3" fontId="0" xfId="0" applyFill="1" applyBorder="1"/>
* <xf numFmtId="0" borderId="4" fillId="3" fontId="0" xfId="0" applyFill="1" applyBorder="1"/>
* <xf numFmtId="0" borderId="0" fillId="3" fontId="0" xfId="0" applyFill="1" applyBorder="1"/>
* ...
* </cellXfs>
*--------------------------------------------------------------------*
lo_styles_xml = me->get_ixml_from_zip_archive( ip_path ).
*--------------------------------------------------------------------*
* The styles are build up from
* §1 number formats
* §2 fill styles
* §3 border styles
* §4 fonts
* These need to be read before we can try to build up a complete
* style that describes the look of a cell
*--------------------------------------------------------------------*
lt_num_formats = load_style_num_formats( lo_styles_xml ). " §1
lt_fills = load_style_fills( lo_styles_xml ). " §2
lt_borders = load_style_borders( lo_styles_xml ). " §3
lt_fonts = load_style_fonts( lo_styles_xml ). " §4
*--------------------------------------------------------------------*
* Now everything is prepared to build a "full" style
*--------------------------------------------------------------------*
lo_node_cellxfs = lo_styles_xml->find_from_name( name = 'cellXfs' ).
IF lo_node_cellxfs IS BOUND.
lo_nodes_xf = lo_node_cellxfs->get_elements_by_tag_name( name = 'xf' ).
lo_iterator_cellxfs = lo_nodes_xf->create_iterator( ).
lo_node_cellxfs_xf ?= lo_iterator_cellxfs->get_next( ).
WHILE lo_node_cellxfs_xf IS BOUND.
lo_style = ip_excel->add_new_style( ).
fill_struct_from_attributes( EXPORTING
ip_element = lo_node_cellxfs_xf
CHANGING
cp_structure = ls_xf ).
*--------------------------------------------------------------------*
* §2 fill style
*--------------------------------------------------------------------*
IF ls_xf-applyfill = '1' AND ls_xf-fillid IS NOT INITIAL.
lv_index = ls_xf-fillid + 1.
READ TABLE lt_fills INTO ls_fill INDEX lv_index.
IF sy-subrc = 0.
lo_style->fill = ls_fill.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* §1 number format
*--------------------------------------------------------------------*
IF ls_xf-numfmtid IS NOT INITIAL.
READ TABLE lt_num_formats INTO ls_num_format WITH TABLE KEY id = ls_xf-numfmtid.
IF sy-subrc = 0.
lo_style->number_format = ls_num_format-format.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* §3 border style
*--------------------------------------------------------------------*
IF ls_xf-applyborder = '1' AND ls_xf-borderid IS NOT INITIAL.
lv_index = ls_xf-borderid + 1.
READ TABLE lt_borders INTO ls_cell_border INDEX lv_index.
IF sy-subrc = 0.
lo_style->borders = ls_cell_border.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* §4 font
*--------------------------------------------------------------------*
IF ls_xf-applyfont = '1' AND ls_xf-fontid IS NOT INITIAL.
lv_index = ls_xf-fontid + 1.
READ TABLE lt_fonts INTO ls_font INDEX lv_index.
IF sy-subrc = 0.
lo_style->font = ls_font.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* §5 - Alignment
*--------------------------------------------------------------------*
lo_node_cellxfs_xf_alignment ?= lo_node_cellxfs_xf->find_from_name( 'alignment' ).
IF lo_node_cellxfs_xf_alignment IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node_cellxfs_xf_alignment
CHANGING
cp_structure = ls_alignment ).
IF ls_alignment-horizontal IS NOT INITIAL.
lo_style->alignment->horizontal = ls_alignment-horizontal.
ENDIF.
IF ls_alignment-vertical IS NOT INITIAL.
lo_style->alignment->vertical = ls_alignment-vertical.
ENDIF.
IF ls_alignment-textrotation IS NOT INITIAL.
lo_style->alignment->textrotation = ls_alignment-textrotation.
ENDIF.
IF ls_alignment-wraptext = '1' OR ls_alignment-wraptext = 'true'.
lo_style->alignment->wraptext = abap_true.
ENDIF.
IF ls_alignment-shrinktofit = '1' OR ls_alignment-shrinktofit = 'true'.
lo_style->alignment->shrinktofit = abap_true.
ENDIF.
IF ls_alignment-indent IS NOT INITIAL.
lo_style->alignment->indent = ls_alignment-indent.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* §6 - Protection
*--------------------------------------------------------------------*
lo_node_cellxfs_xf_protection ?= lo_node_cellxfs_xf->find_from_name( 'protection' ).
IF lo_node_cellxfs_xf_protection IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node_cellxfs_xf_protection
CHANGING
cp_structure = ls_protection ).
IF ls_protection-locked = '1' OR ls_protection-locked = 'true'.
lo_style->protection->locked = zcl_excel_style_protection=>c_protection_locked.
ELSE.
lo_style->protection->locked = zcl_excel_style_protection=>c_protection_unlocked.
ENDIF.
IF ls_protection-hidden = '1' OR ls_protection-hidden = 'true'.
lo_style->protection->hidden = zcl_excel_style_protection=>c_protection_hidden.
ELSE.
lo_style->protection->hidden = zcl_excel_style_protection=>c_protection_unhidden.
ENDIF.
ENDIF.
INSERT lo_style INTO TABLE me->styles.
lo_node_cellxfs_xf ?= lo_iterator_cellxfs->get_next( ).
ENDWHILE.
ENDIF.
ENDMETHOD.
METHOD load_style_borders.
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-25
* - ...
* changes: renaming variables and types to naming conventions
* aligning code
* renaming variables to indicate what they are used for
* adding comments to explain what we are trying to achieve
*--------------------------------------------------------------------*
DATA: lo_node_border TYPE REF TO if_ixml_element,
lo_node_bordertype TYPE REF TO if_ixml_element,
lo_node_bordercolor TYPE REF TO if_ixml_element,
lo_cell_border TYPE REF TO zcl_excel_style_borders,
lo_border TYPE REF TO zcl_excel_style_border,
ls_color TYPE t_color.
*--------------------------------------------------------------------*
* We need a table of used borderformats to build up our styles
* §1 A cell has 4 outer borders and 2 diagonal "borders"
* These borders can be formatted separately but the diagonal borders
* are always being formatted the same
* We'll parse through the <border>-tag for each of the bordertypes
* §2 and read the corresponding formatting information
* Following is an example how this part of a file could be set up
* <border diagonalDown="1">
* <left style="mediumDashDotDot">
* <color rgb="FFFF0000"/>
* </left>
* <right/>
* <top style="thick">
* <color rgb="FFFF0000"/>
* </top>
* <bottom style="thick">
* <color rgb="FFFF0000"/>
* </bottom>
* <diagonal style="thick">
* <color rgb="FFFF0000"/>
* </diagonal>
* </border>
*--------------------------------------------------------------------*
lo_node_border ?= ip_xml->find_from_name( 'border' ).
WHILE lo_node_border IS BOUND.
CREATE OBJECT lo_cell_border.
*--------------------------------------------------------------------*
* Diagonal borderlines are formatted the equally. Determine what kind of diagonal borders are present if any
*--------------------------------------------------------------------*
* DiagonalNone = 0
* DiagonalUp = 1
* DiagonalDown = 2
* DiagonalBoth = 3
*--------------------------------------------------------------------*
IF lo_node_border->get_attribute( 'diagonalDown' ) IS NOT INITIAL.
ADD zcl_excel_style_borders=>c_diagonal_down TO lo_cell_border->diagonal_mode.
ENDIF.
IF lo_node_border->get_attribute( 'diagonalUp' ) IS NOT INITIAL.
ADD zcl_excel_style_borders=>c_diagonal_up TO lo_cell_border->diagonal_mode.
ENDIF.
lo_node_bordertype ?= lo_node_border->get_first_child( ).
WHILE lo_node_bordertype IS BOUND.
*--------------------------------------------------------------------*
* §1 Determine what kind of border we are talking about
*--------------------------------------------------------------------*
* Up, down, left, right, diagonal
*--------------------------------------------------------------------*
CREATE OBJECT lo_border.
CASE lo_node_bordertype->get_name( ).
WHEN 'left'.
lo_cell_border->left = lo_border.
WHEN 'right'.
lo_cell_border->right = lo_border.
WHEN 'top'.
lo_cell_border->top = lo_border.
WHEN 'bottom'.
lo_cell_border->down = lo_border.
WHEN 'diagonal'.
lo_cell_border->diagonal = lo_border.
ENDCASE.
*--------------------------------------------------------------------*
* §2 Read the border-formatting
*--------------------------------------------------------------------*
lo_border->border_style = lo_node_bordertype->get_attribute( 'style' ).
lo_node_bordercolor ?= lo_node_bordertype->find_from_name( 'color' ).
IF lo_node_bordercolor IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node_bordercolor
CHANGING
cp_structure = ls_color ).
lo_border->border_color-rgb = ls_color-rgb.
IF ls_color-indexed IS NOT INITIAL.
lo_border->border_color-indexed = ls_color-indexed.
ENDIF.
IF ls_color-theme IS NOT INITIAL.
lo_border->border_color-theme = ls_color-theme.
ENDIF.
lo_border->border_color-tint = ls_color-tint.
ENDIF.
lo_node_bordertype ?= lo_node_bordertype->get_next( ).
ENDWHILE.
INSERT lo_cell_border INTO TABLE ep_borders.
lo_node_border ?= lo_node_border->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_style_fills.
*--------------------------------------------------------------------*
* ToDos:
* 2do§1 Support gradientFill
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-25
* - ...
* changes: renaming variables and types to naming conventions
* aligning code
* commenting on problems/future enhancements/todos we already know of or should decide upon
* adding comments to explain what we are trying to achieve
* renaming variables to indicate what they are used for
*--------------------------------------------------------------------*
DATA: lv_value TYPE string,
lo_node_fill TYPE REF TO if_ixml_element,
lo_node_fill_child TYPE REF TO if_ixml_element,
lo_node_bgcolor TYPE REF TO if_ixml_element,
lo_node_fgcolor TYPE REF TO if_ixml_element,
lo_node_stop TYPE REF TO if_ixml_element,
lo_fill TYPE REF TO zcl_excel_style_fill,
ls_color TYPE t_color.
*--------------------------------------------------------------------*
* We need a table of used fillformats to build up our styles
* Following is an example how this part of a file could be set up
* <fill>
* <patternFill patternType="gray125"/>
* </fill>
* <fill>
* <patternFill patternType="solid">
* <fgColor rgb="FFFFFF00"/>
* <bgColor indexed="64"/>
* </patternFill>
* </fill>
*--------------------------------------------------------------------*
lo_node_fill ?= ip_xml->find_from_name( 'fill' ).
WHILE lo_node_fill IS BOUND.
CREATE OBJECT lo_fill.
lo_node_fill_child ?= lo_node_fill->get_first_child( ).
lv_value = lo_node_fill_child->get_name( ).
CASE lv_value.
*--------------------------------------------------------------------*
* Patternfill
*--------------------------------------------------------------------*
WHEN 'patternFill'.
lo_fill->filltype = lo_node_fill_child->get_attribute( 'patternType' ).
*--------------------------------------------------------------------*
* Patternfill - background color
*--------------------------------------------------------------------*
lo_node_bgcolor = lo_node_fill_child->find_from_name( 'bgColor' ).
IF lo_node_bgcolor IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node_bgcolor
CHANGING
cp_structure = ls_color ).
lo_fill->bgcolor-rgb = ls_color-rgb.
IF ls_color-indexed IS NOT INITIAL.
lo_fill->bgcolor-indexed = ls_color-indexed.
ENDIF.
IF ls_color-theme IS NOT INITIAL.
lo_fill->bgcolor-theme = ls_color-theme.
ENDIF.
lo_fill->bgcolor-tint = ls_color-tint.
ENDIF.
*--------------------------------------------------------------------*
* Patternfill - foreground color
*--------------------------------------------------------------------*
lo_node_fgcolor = lo_node_fill->find_from_name( 'fgColor' ).
IF lo_node_fgcolor IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node_fgcolor
CHANGING
cp_structure = ls_color ).
lo_fill->fgcolor-rgb = ls_color-rgb.
IF ls_color-indexed IS NOT INITIAL.
lo_fill->fgcolor-indexed = ls_color-indexed.
ENDIF.
IF ls_color-theme IS NOT INITIAL.
lo_fill->fgcolor-theme = ls_color-theme.
ENDIF.
lo_fill->fgcolor-tint = ls_color-tint.
ENDIF.
*--------------------------------------------------------------------*
* gradientFill
*--------------------------------------------------------------------*
WHEN 'gradientFill'.
lo_fill->gradtype-type = lo_node_fill_child->get_attribute( 'type' ).
lo_fill->gradtype-top = lo_node_fill_child->get_attribute( 'top' ).
lo_fill->gradtype-left = lo_node_fill_child->get_attribute( 'left' ).
lo_fill->gradtype-right = lo_node_fill_child->get_attribute( 'right' ).
lo_fill->gradtype-bottom = lo_node_fill_child->get_attribute( 'bottom' ).
lo_fill->gradtype-degree = lo_node_fill_child->get_attribute( 'degree' ).
FREE lo_node_stop.
lo_node_stop ?= lo_node_fill_child->find_from_name( 'stop' ).
WHILE lo_node_stop IS BOUND.
IF lo_fill->gradtype-position1 IS INITIAL.
lo_fill->gradtype-position1 = lo_node_stop->get_attribute( 'position' ).
lo_node_bgcolor = lo_node_stop->find_from_name( 'color' ).
IF lo_node_bgcolor IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node_bgcolor
CHANGING
cp_structure = ls_color ).
lo_fill->bgcolor-rgb = ls_color-rgb.
IF ls_color-indexed IS NOT INITIAL.
lo_fill->bgcolor-indexed = ls_color-indexed.
ENDIF.
IF ls_color-theme IS NOT INITIAL.
lo_fill->bgcolor-theme = ls_color-theme.
ENDIF.
lo_fill->bgcolor-tint = ls_color-tint.
ENDIF.
ELSEIF lo_fill->gradtype-position2 IS INITIAL.
lo_fill->gradtype-position2 = lo_node_stop->get_attribute( 'position' ).
lo_node_fgcolor = lo_node_stop->find_from_name( 'color' ).
IF lo_node_fgcolor IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node_fgcolor
CHANGING
cp_structure = ls_color ).
lo_fill->fgcolor-rgb = ls_color-rgb.
IF ls_color-indexed IS NOT INITIAL.
lo_fill->fgcolor-indexed = ls_color-indexed.
ENDIF.
IF ls_color-theme IS NOT INITIAL.
lo_fill->fgcolor-theme = ls_color-theme.
ENDIF.
lo_fill->fgcolor-tint = ls_color-tint.
ENDIF.
ELSEIF lo_fill->gradtype-position3 IS INITIAL.
lo_fill->gradtype-position3 = lo_node_stop->get_attribute( 'position' ).
"BGColor is filled already with position 1 no need to check again
ENDIF.
lo_node_stop ?= lo_node_stop->get_next( ).
ENDWHILE.
WHEN OTHERS.
ENDCASE.
INSERT lo_fill INTO TABLE ep_fills.
lo_node_fill ?= lo_node_fill->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_style_font.
DATA: lo_node_font TYPE REF TO if_ixml_element,
lo_node2 TYPE REF TO if_ixml_element,
lo_font TYPE REF TO zcl_excel_style_font,
ls_color TYPE t_color.
lo_node_font = io_xml_element.
CREATE OBJECT lo_font.
*--------------------------------------------------------------------*
* Bold
*--------------------------------------------------------------------*
IF lo_node_font->find_from_name( 'b' ) IS BOUND.
lo_font->bold = abap_true.
ENDIF.
*--------------------------------------------------------------------*
* Italic
*--------------------------------------------------------------------*
IF lo_node_font->find_from_name( 'i' ) IS BOUND.
lo_font->italic = abap_true.
ENDIF.
*--------------------------------------------------------------------*
* Underline
*--------------------------------------------------------------------*
lo_node2 = lo_node_font->find_from_name( 'u' ).
IF lo_node2 IS BOUND.
lo_font->underline = abap_true.
lo_font->underline_mode = lo_node2->get_attribute( 'val' ).
ENDIF.
*--------------------------------------------------------------------*
* StrikeThrough
*--------------------------------------------------------------------*
IF lo_node_font->find_from_name( 'strike' ) IS BOUND.
lo_font->strikethrough = abap_true.
ENDIF.
*--------------------------------------------------------------------*
* Fontsize
*--------------------------------------------------------------------*
lo_node2 = lo_node_font->find_from_name( 'sz' ).
IF lo_node2 IS BOUND.
lo_font->size = lo_node2->get_attribute( 'val' ).
ENDIF.
*--------------------------------------------------------------------*
* Fontname
*--------------------------------------------------------------------*
lo_node2 = lo_node_font->find_from_name( 'name' ).
IF lo_node2 IS BOUND.
lo_font->name = lo_node2->get_attribute( 'val' ).
ELSE.
lo_node2 = lo_node_font->find_from_name( 'rFont' ).
IF lo_node2 IS BOUND.
lo_font->name = lo_node2->get_attribute( 'val' ).
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* Fontfamily
*--------------------------------------------------------------------*
lo_node2 = lo_node_font->find_from_name( 'family' ).
IF lo_node2 IS BOUND.
lo_font->family = lo_node2->get_attribute( 'val' ).
ENDIF.
*--------------------------------------------------------------------*
* Fontscheme
*--------------------------------------------------------------------*
lo_node2 = lo_node_font->find_from_name( 'scheme' ).
IF lo_node2 IS BOUND.
lo_font->scheme = lo_node2->get_attribute( 'val' ).
ELSE.
CLEAR lo_font->scheme.
ENDIF.
*--------------------------------------------------------------------*
* Fontcolor
*--------------------------------------------------------------------*
lo_node2 = lo_node_font->find_from_name( 'color' ).
IF lo_node2 IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node2
CHANGING
cp_structure = ls_color ).
lo_font->color-rgb = ls_color-rgb.
IF ls_color-indexed IS NOT INITIAL.
lo_font->color-indexed = ls_color-indexed.
ENDIF.
IF ls_color-theme IS NOT INITIAL.
lo_font->color-theme = ls_color-theme.
ENDIF.
lo_font->color-tint = ls_color-tint.
ENDIF.
ro_font = lo_font.
ENDMETHOD.
METHOD load_style_fonts.
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-25
* - ...
* changes: renaming variables and types to naming conventions
* aligning code
* removing unused variables
* adding comments to explain what we are trying to achieve
*--------------------------------------------------------------------*
DATA: lo_node_font TYPE REF TO if_ixml_element,
lo_font TYPE REF TO zcl_excel_style_font.
*--------------------------------------------------------------------*
* We need a table of used fonts to build up our styles
* Following is an example how this part of a file could be set up
* <font>
* <sz val="11"/>
* <color theme="1"/>
* <name val="Calibri"/>
* <family val="2"/>
* <scheme val="minor"/>
* </font>
*--------------------------------------------------------------------*
lo_node_font ?= ip_xml->find_from_name( 'font' ).
WHILE lo_node_font IS BOUND.
lo_font = load_style_font( lo_node_font ).
INSERT lo_font INTO TABLE ep_fonts.
lo_node_font ?= lo_node_font->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_style_num_formats.
*--------------------------------------------------------------------*
* ToDos:
* 2do§1 Explain gaps in predefined formats
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-25
* - ...
* changes: renaming variables and types to naming conventions
* adding comments to explain what we are trying to achieve
* aligning code
*--------------------------------------------------------------------*
DATA: lo_node_numfmt TYPE REF TO if_ixml_element,
ls_num_format TYPE zcl_excel_style_number_format=>t_num_format.
*--------------------------------------------------------------------*
* We need a table of used numberformats to build up our styles
* there are two kinds of numberformats
* §1 built-in numberformats
* §2 and those that have been explicitly added by the createor of the excel-file
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* §1 built-in numberformats
*--------------------------------------------------------------------*
ep_num_formats = zcl_excel_style_number_format=>mt_built_in_num_formats.
*--------------------------------------------------------------------*
* §2 Get non-internal numberformats that are found in the file explicitly
* Following is an example how this part of a file could be set up
* <numFmts count="1">
* <numFmt formatCode="#,###,###,###,##0.00" numFmtId="164"/>
* </numFmts>
*--------------------------------------------------------------------*
lo_node_numfmt ?= ip_xml->find_from_name( 'numFmt' ).
WHILE lo_node_numfmt IS BOUND.
CLEAR ls_num_format.
CREATE OBJECT ls_num_format-format.
ls_num_format-format->format_code = lo_node_numfmt->get_attribute( 'formatCode' ).
ls_num_format-id = lo_node_numfmt->get_attribute( 'numFmtId' ).
INSERT ls_num_format INTO TABLE ep_num_formats.
lo_node_numfmt ?= lo_node_numfmt->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_theme.
DATA theme TYPE REF TO zcl_excel_theme.
DATA: lo_theme_xml TYPE REF TO if_ixml_document.
CREATE OBJECT theme.
lo_theme_xml = me->get_ixml_from_zip_archive( iv_path ).
theme->read_theme( io_theme_xml = lo_theme_xml ).
ip_excel->set_theme( io_theme = theme ).
ENDMETHOD.
METHOD load_workbook.
*--------------------------------------------------------------------*
* ToDos:
* 2do§1 Move macro-reading from zcl_excel_reader_xlsm to this class
* autodetect existance of macro/vba content
* Allow inputparameter to explicitly tell reader to ignore vba-content
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-10
* - ...
* changes: renaming variables to naming conventions
* aligning code
* removing unused variables
* adding me-> where possible
* renaming variables to indicate what they are used for
* adding comments to explain what we are trying to achieve
* renaming i/o parameters: previous input-parameter ip_path holds a (full) filename and not a path --> rename to iv_workbook_full_filename
* ip_excel renamed while being at it --> rename to io_excel
*--------------------------------------------------------------------*
* issue #232 - Read worksheetstate hidden/veryHidden
* - Stefan Schmoecker, 2012-11-11
*--------------------------------------------------------------------*
* issue#235 - repeat rows/columns
* - Stefan Schmoecker, 2012-12-02
* changes: correction in named ranges to correctly attach
* sheetlocal names/ranges to the correct sheet
*--------------------------------------------------------------------*
* issue#284 - Copied formulae ignored when reading excelfile
* - Stefan Schmoecker, 2013-08-02
* changes: initialize area to hold referenced formulaedata
* after all worksheets have been read resolve formuae
*--------------------------------------------------------------------*
CONSTANTS: lcv_shared_strings TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings',
lcv_worksheet TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet',
lcv_styles TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles',
lcv_vba_project TYPE string VALUE 'http://schemas.microsoft.com/office/2006/relationships/vbaProject', "#EC NEEDED for future incorporation of XLSM-reader
lcv_theme TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme',
*--------------------------------------------------------------------*
* #232: Read worksheetstate hidden/veryHidden - begin data declarations
*--------------------------------------------------------------------*
lcv_worksheet_state_hidden TYPE string VALUE 'hidden',
lcv_worksheet_state_veryhidden TYPE string VALUE 'veryHidden'.
*--------------------------------------------------------------------*
* #232: Read worksheetstate hidden/veryHidden - end data declarations
*--------------------------------------------------------------------*
DATA:
lv_path TYPE string,
lv_filename TYPE chkfile,
lv_full_filename TYPE string,
lo_rels_workbook TYPE REF TO if_ixml_document,
lt_worksheets TYPE STANDARD TABLE OF t_relationship WITH NON-UNIQUE DEFAULT KEY,
lo_workbook TYPE REF TO if_ixml_document,
lv_workbook_index TYPE i,
lv_worksheet_path TYPE string,
ls_sheet TYPE t_sheet,
lo_node TYPE REF TO if_ixml_element,
ls_relationship TYPE t_relationship,
lo_worksheet TYPE REF TO zcl_excel_worksheet,
lo_range TYPE REF TO zcl_excel_range,
lv_worksheet_title TYPE zexcel_sheet_title,
lv_tabix TYPE sytabix, " #235 - repeat rows/cols. Needed to link defined name to correct worksheet
ls_range TYPE t_range,
lv_range_value TYPE zexcel_range_value,
lv_position_temp TYPE i,
*--------------------------------------------------------------------*
* #229: Set active worksheet - begin data declarations
*--------------------------------------------------------------------*
lv_active_sheet_string TYPE string,
lv_zexcel_active_worksheet TYPE zexcel_active_worksheet,
*--------------------------------------------------------------------*
* issue#235 - repeat rows/columns - added autofilter support while changing this section
lo_autofilter TYPE REF TO zcl_excel_autofilter,
ls_area TYPE zexcel_s_autofilter_area,
lv_col_start_alpha TYPE zexcel_cell_column_alpha,
lv_col_end_alpha TYPE zexcel_cell_column_alpha,
lv_row_start TYPE zexcel_cell_row,
lv_row_end TYPE zexcel_cell_row,
lv_regex TYPE string,
lv_range_value_1 TYPE zexcel_range_value,
lv_range_value_2 TYPE zexcel_range_value.
*--------------------------------------------------------------------*
* #229: Set active worksheet - end data declarations
*--------------------------------------------------------------------*
FIELD-SYMBOLS: <worksheet> TYPE t_relationship.
*--------------------------------------------------------------------*
* §1 Get the position of files related to this workbook
* Usually this will be <root>/xl/workbook.xml
* Thus the workbookroot will be <root>/xl/
* The position of all related files will be given in file
* <workbookroot>/_rels/<workbookfilename>.rels and their positions
* be be given relative to the workbookroot
* Following is an example how this file could be set up
* <?xml version="1.0" encoding="UTF-8" standalone="true"?>
* <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
* <Relationship Target="styles.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Id="rId6"/>
* <Relationship Target="theme/theme1.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme" Id="rId5"/>
* <Relationship Target="worksheets/sheet1.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Id="rId1"/>
* <Relationship Target="worksheets/sheet2.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Id="rId2"/>
* <Relationship Target="worksheets/sheet3.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Id="rId3"/>
* <Relationship Target="worksheets/sheet4.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Id="rId4"/>
* <Relationship Target="sharedStrings.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Id="rId7"/>
* </Relationships>
*
* §2 Load data that is relevant to the complete workbook
* Currently supported is:
* §2.1 Shared strings - This holds all strings that are used in all worksheets
* §2.2 Styles - This holds all styles that are used in all worksheets
* §2.3 Worksheets - For each worksheet in the workbook one entry appears here to point to the file that holds the content of this worksheet
* §2.4 [Themes] - not supported
* §2.5 [VBA (Macro)] - supported in class zcl_excel_reader_xlsm but should be moved here and autodetect
* ...
*
* §3 Some information is held in the workbookfile as well
* §3.1 Names and order of of worksheets
* §3.2 Active worksheet
* §3.3 Defined names
* ...
* Following is an example how this file could be set up
* <?xml version="1.0" encoding="UTF-8" standalone="true"?>
* <workbook xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
* <fileVersion rupBuild="4506" lowestEdited="4" lastEdited="4" appName="xl"/>
* <workbookPr defaultThemeVersion="124226"/>
* <bookViews>
* <workbookView activeTab="1" windowHeight="8445" windowWidth="19035" yWindow="120" xWindow="120"/>
* </bookViews>
* <sheets>
* <sheet r:id="rId1" sheetId="1" name="Sheet1"/>
* <sheet r:id="rId2" sheetId="2" name="Sheet2"/>
* <sheet r:id="rId3" sheetId="3" name="Sheet3" state="hidden"/>
* <sheet r:id="rId4" sheetId="4" name="Sheet4"/>
* </sheets>
* <definedNames/>
* <calcPr calcId="125725"/>
* </workbook>
*--------------------------------------------------------------------*
CLEAR me->mt_ref_formulae. " ins issue#284
*--------------------------------------------------------------------*
* §1 Get the position of files related to this workbook
* Entry into this method is with the filename of the workbook
*--------------------------------------------------------------------*
CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH'
EXPORTING
full_name = iv_workbook_full_filename
IMPORTING
stripped_name = lv_filename
file_path = lv_path.
CONCATENATE lv_path '_rels/' lv_filename '.rels'
INTO lv_full_filename.
lo_rels_workbook = me->get_ixml_from_zip_archive( lv_full_filename ).
lo_node ?= lo_rels_workbook->find_from_name( 'Relationship' ). "#EC NOTEXT
WHILE lo_node IS BOUND.
me->fill_struct_from_attributes( EXPORTING ip_element = lo_node CHANGING cp_structure = ls_relationship ).
CASE ls_relationship-type.
*--------------------------------------------------------------------*
* §2.1 Shared strings - This holds all strings that are used in all worksheets
*--------------------------------------------------------------------*
WHEN lcv_shared_strings.
CONCATENATE lv_path ls_relationship-target
INTO lv_full_filename.
me->load_shared_strings( lv_full_filename ).
*--------------------------------------------------------------------*
* §2.3 Worksheets
* For each worksheet in the workbook one entry appears here to point to the file that holds the content of this worksheet
* Shared strings and styles have to be present before we can start with creating the worksheets
* thus we only store this information for use when parsing the workbookfile for sheetinformations
*--------------------------------------------------------------------*
WHEN lcv_worksheet.
APPEND ls_relationship TO lt_worksheets.
*--------------------------------------------------------------------*
* §2.2 Styles - This holds the styles that are used in all worksheets
*--------------------------------------------------------------------*
WHEN lcv_styles.
CONCATENATE lv_path ls_relationship-target
INTO lv_full_filename.
me->load_styles( ip_path = lv_full_filename
ip_excel = io_excel ).
me->load_dxf_styles( iv_path = lv_full_filename
io_excel = io_excel ).
WHEN lcv_theme.
CONCATENATE lv_path ls_relationship-target
INTO lv_full_filename.
me->load_theme(
EXPORTING
iv_path = lv_full_filename
ip_excel = io_excel " Excel creator
).
WHEN OTHERS.
ENDCASE.
lo_node ?= lo_node->get_next( ).
ENDWHILE.
*--------------------------------------------------------------------*
* §3 Some information held in the workbookfile
*--------------------------------------------------------------------*
lo_workbook = me->get_ixml_from_zip_archive( iv_workbook_full_filename ).
*--------------------------------------------------------------------*
* §3.1 Names and order of of worksheets
*--------------------------------------------------------------------*
lo_node ?= lo_workbook->find_from_name( 'sheet' ).
lv_workbook_index = 1.
WHILE lo_node IS BOUND.
me->fill_struct_from_attributes( EXPORTING
ip_element = lo_node
CHANGING
cp_structure = ls_sheet ).
*--------------------------------------------------------------------*
* Create new worksheet in workbook with correct name
*--------------------------------------------------------------------*
lv_worksheet_title = ls_sheet-name.
IF lv_workbook_index = 1. " First sheet has been added automatically by creating io_excel
lo_worksheet = io_excel->get_active_worksheet( ).
lo_worksheet->set_title( lv_worksheet_title ).
ELSE.
lo_worksheet = io_excel->add_new_worksheet( lv_worksheet_title ).
ENDIF.
*--------------------------------------------------------------------*
* #232 - Read worksheetstate hidden/veryHidden - begin of coding
* Set status hidden if necessary
*--------------------------------------------------------------------*
CASE ls_sheet-state.
WHEN lcv_worksheet_state_hidden.
lo_worksheet->zif_excel_sheet_properties~hidden = zif_excel_sheet_properties=>c_hidden.
WHEN lcv_worksheet_state_veryhidden.
lo_worksheet->zif_excel_sheet_properties~hidden = zif_excel_sheet_properties=>c_veryhidden.
ENDCASE.
*--------------------------------------------------------------------*
* #232 - Read worksheetstate hidden/veryHidden - end of coding
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* Load worksheetdata
*--------------------------------------------------------------------*
READ TABLE lt_worksheets ASSIGNING <worksheet> WITH KEY id = ls_sheet-id.
IF sy-subrc = 0.
<worksheet>-sheetid = ls_sheet-sheetid. "ins #235 - repeat rows/cols - needed to identify correct sheet
<worksheet>-localsheetid = |{ lv_workbook_index - 1 }|.
CONCATENATE lv_path <worksheet>-target
INTO lv_worksheet_path.
me->load_worksheet( ip_path = lv_worksheet_path
io_worksheet = lo_worksheet ).
<worksheet>-worksheet = lo_worksheet.
ENDIF.
lo_node ?= lo_node->get_next( ).
ADD 1 TO lv_workbook_index.
ENDWHILE.
SORT lt_worksheets BY sheetid. " needed for localSheetid -referencing
*--------------------------------------------------------------------*
* #284: Set active worksheet - Resolve referenced formulae to
* explicit formulae those cells
*--------------------------------------------------------------------*
me->resolve_referenced_formulae( ).
" ins issue#284
*--------------------------------------------------------------------*
* #229: Set active worksheet - begin coding
* §3.2 Active worksheet
*--------------------------------------------------------------------*
lv_zexcel_active_worksheet = 1. " First sheet = active sheet if nothing else specified.
lo_node ?= lo_workbook->find_from_name( 'workbookView' ).
IF lo_node IS BOUND.
lv_active_sheet_string = lo_node->get_attribute( 'activeTab' ).
TRY.
lv_zexcel_active_worksheet = lv_active_sheet_string + 1. " EXCEL numbers the sheets from 0 onwards --> index into worksheettable is increased by one
CATCH cx_sy_conversion_error. "#EC NO_HANDLER - error here --> just use the default 1st sheet
ENDTRY.
ENDIF.
io_excel->set_active_sheet_index( lv_zexcel_active_worksheet ).
*--------------------------------------------------------------------*
* #229: Set active worksheet - end coding
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* §3.3 Defined names
* So far I have encountered these
* - named ranges - sheetlocal
* - named ranges - workbookglobal
* - autofilters - sheetlocal ( special range )
* - repeat rows/cols - sheetlocal ( special range )
*
*--------------------------------------------------------------------*
lo_node ?= lo_workbook->find_from_name( 'definedName' ).
WHILE lo_node IS BOUND.
CLEAR lo_range. "ins issue #235 - repeat rows/cols
me->fill_struct_from_attributes( EXPORTING
ip_element = lo_node
CHANGING
cp_structure = ls_range ).
lv_range_value = lo_node->get_value( ).
IF ls_range-localsheetid IS NOT INITIAL. " issue #163+
* READ TABLE lt_worksheets ASSIGNING <worksheet> WITH KEY id = ls_range-localsheetid. "del issue #235 - repeat rows/cols " issue #163+
* lo_range = <worksheet>-worksheet->add_new_range( ). "del issue #235 - repeat rows/cols " issue #163+
*--------------------------------------------------------------------*
* issue#235 - repeat rows/columns - begin
*--------------------------------------------------------------------*
READ TABLE lt_worksheets ASSIGNING <worksheet> WITH KEY localsheetid = ls_range-localsheetid.
IF sy-subrc = 0.
CASE ls_range-name.
*--------------------------------------------------------------------*
* insert autofilters
*--------------------------------------------------------------------*
WHEN zcl_excel_autofilters=>c_autofilter.
" begin Dennis Schaaf
TRY.
zcl_excel_common=>convert_range2column_a_row( EXPORTING i_range = lv_range_value
IMPORTING e_column_start = lv_col_start_alpha
e_column_end = lv_col_end_alpha
e_row_start = ls_area-row_start
e_row_end = ls_area-row_end ).
ls_area-col_start = zcl_excel_common=>convert_column2int( lv_col_start_alpha ).
ls_area-col_end = zcl_excel_common=>convert_column2int( lv_col_end_alpha ).
lo_autofilter = io_excel->add_new_autofilter( io_sheet = <worksheet>-worksheet ) .
lo_autofilter->set_filter_area( is_area = ls_area ).
CATCH zcx_excel.
" we expected a range but it was not usable, so just ignore it
ENDTRY.
" end Dennis Schaaf
*--------------------------------------------------------------------*
* repeat print rows/columns
*--------------------------------------------------------------------*
WHEN zif_excel_sheet_printsettings=>gcv_print_title_name.
lo_range = <worksheet>-worksheet->add_new_range( ).
lo_range->name = zif_excel_sheet_printsettings=>gcv_print_title_name.
*--------------------------------------------------------------------*
* This might be a temporary solution. Maybe ranges get be reworked
* to support areas consisting of multiple rectangles
* But for now just split the range into row and columnpart
*--------------------------------------------------------------------*
CLEAR:lv_range_value_1,
lv_range_value_2.
IF lv_range_value IS INITIAL.
* Empty --> nothing to do
ELSE.
IF lv_range_value(1) = `'`. " Escaped
lv_regex = `^('[^']*')+![^,]*,`.
ELSE.
lv_regex = `^[^!]*![^,]*,`.
ENDIF.
* Split into two ranges if necessary
FIND REGEX lv_regex IN lv_range_value MATCH LENGTH lv_position_temp.
IF sy-subrc = 0 AND lv_position_temp > 0.
lv_range_value_2 = lv_range_value+lv_position_temp.
SUBTRACT 1 FROM lv_position_temp.
lv_range_value_1 = lv_range_value(lv_position_temp).
ELSE.
lv_range_value_1 = lv_range_value.
ENDIF.
ENDIF.
* 1st range
zcl_excel_common=>convert_range2column_a_row( EXPORTING i_range = lv_range_value_1
i_allow_1dim_range = abap_true
IMPORTING e_column_start = lv_col_start_alpha
e_column_end = lv_col_end_alpha
e_row_start = lv_row_start
e_row_end = lv_row_end ).
IF lv_col_start_alpha IS NOT INITIAL.
<worksheet>-worksheet->zif_excel_sheet_printsettings~set_print_repeat_columns( iv_columns_from = lv_col_start_alpha
iv_columns_to = lv_col_end_alpha ).
ENDIF.
IF lv_row_start IS NOT INITIAL.
<worksheet>-worksheet->zif_excel_sheet_printsettings~set_print_repeat_rows( iv_rows_from = lv_row_start
iv_rows_to = lv_row_end ).
ENDIF.
* 2nd range
zcl_excel_common=>convert_range2column_a_row( EXPORTING i_range = lv_range_value_2
i_allow_1dim_range = abap_true
IMPORTING e_column_start = lv_col_start_alpha
e_column_end = lv_col_end_alpha
e_row_start = lv_row_start
e_row_end = lv_row_end ).
IF lv_col_start_alpha IS NOT INITIAL.
<worksheet>-worksheet->zif_excel_sheet_printsettings~set_print_repeat_columns( iv_columns_from = lv_col_start_alpha
iv_columns_to = lv_col_end_alpha ).
ENDIF.
IF lv_row_start IS NOT INITIAL.
<worksheet>-worksheet->zif_excel_sheet_printsettings~set_print_repeat_rows( iv_rows_from = lv_row_start
iv_rows_to = lv_row_end ).
ENDIF.
WHEN OTHERS.
ENDCASE.
ENDIF.
*--------------------------------------------------------------------*
* issue#235 - repeat rows/columns - end
*--------------------------------------------------------------------*
ELSE. " issue #163+
lo_range = io_excel->add_new_range( ). " issue #163+
ENDIF. " issue #163+
* lo_range = ip_excel->add_new_range( ). " issue #163-
IF lo_range IS BOUND. "ins issue #235 - repeat rows/cols
lo_range->name = ls_range-name.
lo_range->set_range_value( lv_range_value ).
ENDIF. "ins issue #235 - repeat rows/cols
lo_node ?= lo_node->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_worksheet.
*--------------------------------------------------------------------*
* ToDos:
* 2do§1 Header/footer
*
* Please don't just delete these ToDos if they are not
* needed but leave a comment that states this
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker,
* - ...
* changes: renaming variables to naming conventions
* aligning code (started)
* add a list of open ToDos here
* adding comments to explain what we are trying to achieve (started)
*--------------------------------------------------------------------*
* issue #345 - Dump on small pagemargins
* Took the chance to modularize this very long method
* by extracting the code that needed correction into
* own method ( load_worksheet_pagemargins )
*--------------------------------------------------------------------*
TYPES: BEGIN OF lty_cell,
r TYPE string,
t TYPE string,
s TYPE string,
END OF lty_cell.
TYPES: BEGIN OF lty_column,
min TYPE string,
max TYPE string,
width TYPE float,
customwidth TYPE string,
style TYPE string,
bestfit TYPE string,
collapsed TYPE string,
hidden TYPE string,
outlinelevel TYPE string,
END OF lty_column.
TYPES: BEGIN OF lty_sheetview,
showgridlines TYPE zexcel_show_gridlines,
tabselected TYPE string,
zoomscalenormal TYPE string,
workbookviewid TYPE string,
showrowcolheaders TYPE string,
righttoleft TYPE string,
END OF lty_sheetview.
TYPES: BEGIN OF lty_mergecell,
ref TYPE string,
END OF lty_mergecell.
TYPES: BEGIN OF lty_row,
r TYPE string,
customheight TYPE string,
ht TYPE float,
spans TYPE string,
thickbot TYPE string,
customformat TYPE string,
thicktop TYPE string,
collapsed TYPE string,
hidden TYPE string,
outlinelevel TYPE string,
END OF lty_row.
TYPES: BEGIN OF lty_page_setup,
id TYPE string,
orientation TYPE string,
scale TYPE string,
fittoheight TYPE string,
fittowidth TYPE string,
papersize TYPE string,
END OF lty_page_setup.
TYPES: BEGIN OF lty_sheetformatpr,
customheight TYPE string,
defaultrowheight TYPE string,
customwidth TYPE string,
defaultcolwidth TYPE string,
END OF lty_sheetformatpr.
TYPES: BEGIN OF lty_headerfooter,
alignwithmargins TYPE string,
differentoddeven TYPE string,
END OF lty_headerfooter.
TYPES: BEGIN OF lty_tabcolor,
rgb TYPE string,
theme TYPE string,
END OF lty_tabcolor.
TYPES: BEGIN OF lty_datavalidation,
type TYPE zexcel_data_val_type,
allowblank TYPE flag,
showinputmessage TYPE flag,
showerrormessage TYPE flag,
showdropdown TYPE flag,
operator TYPE zexcel_data_val_operator,
formula1 TYPE zexcel_validation_formula1,
formula2 TYPE zexcel_validation_formula1,
sqref TYPE string,
cell_column TYPE zexcel_cell_column_alpha,
cell_column_to TYPE zexcel_cell_column_alpha,
cell_row TYPE zexcel_cell_row,
cell_row_to TYPE zexcel_cell_row,
error TYPE string,
errortitle TYPE string,
prompt TYPE string,
prompttitle TYPE string,
errorstyle TYPE zexcel_data_val_error_style,
END OF lty_datavalidation.
CONSTANTS: lc_xml_attr_true TYPE string VALUE 'true',
lc_xml_attr_true_int TYPE string VALUE '1',
lc_rel_drawing TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing',
lc_rel_hyperlink TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink',
lc_rel_printer TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings'.
DATA: lo_ixml_worksheet TYPE REF TO if_ixml_document,
lo_ixml_cells TYPE REF TO if_ixml_node_collection,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lo_ixml_iterator2 TYPE REF TO if_ixml_node_iterator,
lo_ixml_row_elem TYPE REF TO if_ixml_element,
lo_ixml_cell_elem TYPE REF TO if_ixml_element,
ls_cell TYPE lty_cell,
lv_index TYPE i,
lv_index_temp TYPE i,
lo_ixml_value_elem TYPE REF TO if_ixml_element,
lo_ixml_formula_elem TYPE REF TO if_ixml_element,
lv_cell_value TYPE zexcel_cell_value,
lv_cell_formula TYPE zexcel_cell_formula,
lv_cell_column TYPE zexcel_cell_column_alpha,
lv_cell_row TYPE zexcel_cell_row,
lo_excel_style TYPE REF TO zcl_excel_style,
lv_style_guid TYPE zexcel_cell_style,
lo_ixml_imension_elem TYPE REF TO if_ixml_element, "#+234
lv_dimension_range TYPE string, "#+234
lo_ixml_sheetview_elem TYPE REF TO if_ixml_element,
ls_sheetview TYPE lty_sheetview,
lo_ixml_pane_elem TYPE REF TO if_ixml_element,
ls_excel_pane TYPE zexcel_pane,
lv_pane_cell_row TYPE zexcel_cell_row,
lv_pane_cell_col_a TYPE zexcel_cell_column_alpha,
lv_pane_cell_col TYPE zexcel_cell_column,
lo_ixml_mergecells TYPE REF TO if_ixml_node_collection,
lo_ixml_mergecell_elem TYPE REF TO if_ixml_element,
ls_mergecell TYPE lty_mergecell,
lv_merge_column_start TYPE zexcel_cell_column_alpha,
lv_merge_column_end TYPE zexcel_cell_column_alpha,
lv_merge_row_start TYPE zexcel_cell_row,
lv_merge_row_end TYPE zexcel_cell_row,
lo_ixml_sheetformatpr_elem TYPE REF TO if_ixml_element,
ls_sheetformatpr TYPE lty_sheetformatpr,
lv_height TYPE float,
lo_ixml_headerfooter_elem TYPE REF TO if_ixml_element,
ls_headerfooter TYPE lty_headerfooter,
ls_odd_header TYPE zexcel_s_worksheet_head_foot,
ls_odd_footer TYPE zexcel_s_worksheet_head_foot,
ls_even_header TYPE zexcel_s_worksheet_head_foot,
ls_even_footer TYPE zexcel_s_worksheet_head_foot,
lo_ixml_hf_value_elem TYPE REF TO if_ixml_element,
lo_ixml_pagesetup_elem TYPE REF TO if_ixml_element,
lo_ixml_sheetpr TYPE REF TO if_ixml_element,
lv_fit_to_page TYPE string,
ls_pagesetup TYPE lty_page_setup,
lo_ixml_columns TYPE REF TO if_ixml_node_collection,
lo_ixml_column_elem TYPE REF TO if_ixml_element,
ls_column TYPE lty_column,
lv_column_alpha TYPE zexcel_cell_column_alpha,
lo_column TYPE REF TO zcl_excel_column,
lv_outline_level TYPE int4,
lo_ixml_tabcolor TYPE REF TO if_ixml_element,
ls_tabcolor TYPE lty_tabcolor,
ls_excel_s_tabcolor TYPE zexcel_s_tabcolor,
lo_ixml_rows TYPE REF TO if_ixml_node_collection,
ls_row TYPE lty_row,
lv_max_col TYPE i, "for use with SPANS element
* lv_min_col TYPE i, "for use with SPANS element " not in use currently
lv_max_col_s TYPE char10, "for use with SPANS element
lv_min_col_s TYPE char10, "for use with SPANS element
lo_row TYPE REF TO zcl_excel_row,
*--- End of current code aligning -------------------------------------------------------------------
lv_path TYPE string,
lo_ixml_node TYPE REF TO if_ixml_element,
ls_relationship TYPE t_relationship,
lo_ixml_rels_worksheet TYPE REF TO if_ixml_document,
lv_rels_worksheet_path TYPE string,
lv_stripped_name TYPE chkfile,
lv_dirname TYPE string,
lt_external_hyperlinks TYPE gtt_external_hyperlinks,
ls_external_hyperlink LIKE LINE OF lt_external_hyperlinks,
lo_ixml_datavalidations TYPE REF TO if_ixml_node_collection,
lo_ixml_datavalidation_elem TYPE REF TO if_ixml_element,
ls_datavalidation TYPE lty_datavalidation,
lo_data_validation TYPE REF TO zcl_excel_data_validation,
lv_datavalidation_range TYPE string,
lt_datavalidation_range TYPE TABLE OF string,
lt_rtf TYPE zexcel_t_rtf,
ex TYPE REF TO cx_root.
FIELD-SYMBOLS:
<ls_shared_string> TYPE t_shared_string.
*--------------------------------------------------------------------*
* §2 We need to read the the file "\\_rels\.rels" because it tells
* us where in this folder structure the data for the workbook
* is located in the xlsx zip-archive
*
* The xlsx Zip-archive has generally the following folder structure:
* <root> |
* |--> _rels
* |--> doc_Props
* |--> xl |
* |--> _rels
* |--> theme
* |--> worksheets
*--------------------------------------------------------------------*
" Read Workbook Relationships
CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH'
EXPORTING
full_name = ip_path
IMPORTING
stripped_name = lv_stripped_name
file_path = lv_dirname.
CONCATENATE lv_dirname '_rels/' lv_stripped_name '.rels'
INTO lv_rels_worksheet_path.
TRY. " +#222 _rels/xxx.rels might not be present. If not found there can be no drawings --> just ignore this section
lo_ixml_rels_worksheet = me->get_ixml_from_zip_archive( lv_rels_worksheet_path ).
lo_ixml_node ?= lo_ixml_rels_worksheet->find_from_name( 'Relationship' ).
CATCH zcx_excel. "#EC NO_HANDLER +#222
" +#222 No errorhandling necessary - node will be unbound if error occurs
ENDTRY. " +#222
WHILE lo_ixml_node IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_node
CHANGING
cp_structure = ls_relationship ).
CONCATENATE lv_dirname ls_relationship-target INTO lv_path.
lv_path = resolve_path( lv_path ).
CASE ls_relationship-type.
WHEN lc_rel_drawing.
" Read Drawings
* Issue # 339 Not all drawings are in the path mentioned below.
* Some Excel elements like textfields (which we don't support ) have a drawing-part in the relationsships
* but no "xl/drawings/_rels/drawing____.xml.rels" part.
* Since we don't support these there is no need to read them. Catching exceptions thrown
* in the "load_worksheet_drawing" shouldn't lead to an abortion of the reading
TRY.
me->load_worksheet_drawing( ip_path = lv_path
io_worksheet = io_worksheet ).
CATCH zcx_excel. "--> then ignore it
ENDTRY.
WHEN lc_rel_printer.
" Read Printer settings
WHEN lc_rel_hyperlink.
MOVE-CORRESPONDING ls_relationship TO ls_external_hyperlink.
INSERT ls_external_hyperlink INTO TABLE lt_external_hyperlinks.
WHEN OTHERS.
ENDCASE.
lo_ixml_node ?= lo_ixml_node->get_next( ).
ENDWHILE.
lo_ixml_worksheet = me->get_ixml_from_zip_archive( ip_path ).
lo_ixml_tabcolor ?= lo_ixml_worksheet->find_from_name( 'tabColor' ).
IF lo_ixml_tabcolor IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_tabcolor
CHANGING
cp_structure = ls_tabcolor ).
* Theme not supported yet
IF ls_tabcolor-rgb IS NOT INITIAL.
ls_excel_s_tabcolor-rgb = ls_tabcolor-rgb.
io_worksheet->set_tabcolor( ls_excel_s_tabcolor ).
ENDIF.
ENDIF.
lo_ixml_rows = lo_ixml_worksheet->get_elements_by_tag_name( name = 'row' ).
lo_ixml_iterator = lo_ixml_rows->create_iterator( ).
lo_ixml_row_elem ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml_row_elem IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_row_elem
CHANGING
cp_structure = ls_row ).
SPLIT ls_row-spans AT ':' INTO lv_min_col_s lv_max_col_s.
lv_index = lv_max_col_s.
IF lv_index > lv_max_col.
lv_max_col = lv_index.
ENDIF.
lv_cell_row = ls_row-r.
lo_row = io_worksheet->get_row( lv_cell_row ).
IF ls_row-customheight = '1'.
lo_row->set_row_height( ip_row_height = ls_row-ht ip_custom_height = abap_true ).
ELSE.
lo_row->set_row_height( ip_row_height = ls_row-ht ip_custom_height = abap_false ).
ENDIF.
IF ls_row-collapsed = lc_xml_attr_true
OR ls_row-collapsed = lc_xml_attr_true_int.
lo_row->set_collapsed( abap_true ).
ENDIF.
IF ls_row-hidden = lc_xml_attr_true
OR ls_row-hidden = lc_xml_attr_true_int.
lo_row->set_visible( abap_false ).
ENDIF.
IF ls_row-outlinelevel > ''.
* outline_level = condense( row-outlineLevel ). "For basis 7.02 and higher
CONDENSE ls_row-outlinelevel.
lv_outline_level = ls_row-outlinelevel.
IF lv_outline_level > 0.
lo_row->set_outline_level( lv_outline_level ).
ENDIF.
ENDIF.
lo_ixml_cells = lo_ixml_row_elem->get_elements_by_tag_name( name = 'c' ).
lo_ixml_iterator2 = lo_ixml_cells->create_iterator( ).
lo_ixml_cell_elem ?= lo_ixml_iterator2->get_next( ).
WHILE lo_ixml_cell_elem IS BOUND.
CLEAR: lv_cell_value,
lv_cell_formula,
lv_style_guid.
fill_struct_from_attributes( EXPORTING ip_element = lo_ixml_cell_elem CHANGING cp_structure = ls_cell ).
lo_ixml_value_elem = lo_ixml_cell_elem->find_from_name( name = 'v' ).
CASE ls_cell-t.
WHEN 's'. " String values are stored as index in shared string table
IF lo_ixml_value_elem IS BOUND.
lv_index = lo_ixml_value_elem->get_value( ) + 1.
READ TABLE shared_strings ASSIGNING <ls_shared_string> INDEX lv_index.
IF sy-subrc = 0.
lv_cell_value = <ls_shared_string>-value.
lt_rtf = <ls_shared_string>-rtf.
ENDIF.
ENDIF.
WHEN 'inlineStr'. " inlineStr values are kept in special node
lo_ixml_value_elem = lo_ixml_cell_elem->find_from_name( name = 'is' ).
IF lo_ixml_value_elem IS BOUND.
lv_cell_value = lo_ixml_value_elem->get_value( ).
ENDIF.
WHEN OTHERS. "other types are stored directly
IF lo_ixml_value_elem IS BOUND.
lv_cell_value = lo_ixml_value_elem->get_value( ).
ENDIF.
ENDCASE.
CLEAR lv_style_guid.
"read style based on index
IF ls_cell-s IS NOT INITIAL.
lv_index = ls_cell-s + 1.
READ TABLE styles INTO lo_excel_style INDEX lv_index.
IF sy-subrc = 0.
lv_style_guid = lo_excel_style->get_guid( ).
ENDIF.
ENDIF.
lo_ixml_formula_elem = lo_ixml_cell_elem->find_from_name( name = 'f' ).
IF lo_ixml_formula_elem IS BOUND.
lv_cell_formula = lo_ixml_formula_elem->get_value( ).
*--------------------------------------------------------------------*
* Begin of insertion issue#284 - Copied formulae not
*--------------------------------------------------------------------*
DATA: BEGIN OF ls_formula_attributes,
ref TYPE string,
si TYPE i,
t TYPE string,
END OF ls_formula_attributes,
ls_ref_formula TYPE ty_ref_formulae.
fill_struct_from_attributes( EXPORTING ip_element = lo_ixml_formula_elem CHANGING cp_structure = ls_formula_attributes ).
IF ls_formula_attributes-t = 'shared'.
zcl_excel_common=>convert_columnrow2column_a_row( EXPORTING
i_columnrow = ls_cell-r
IMPORTING
e_column = lv_cell_column
e_row = lv_cell_row ).
TRY.
CLEAR ls_ref_formula.
ls_ref_formula-sheet = io_worksheet.
ls_ref_formula-row = lv_cell_row.
ls_ref_formula-column = zcl_excel_common=>convert_column2int( lv_cell_column ).
ls_ref_formula-si = ls_formula_attributes-si.
ls_ref_formula-ref = ls_formula_attributes-ref.
ls_ref_formula-formula = lv_cell_formula.
INSERT ls_ref_formula INTO TABLE me->mt_ref_formulae.
CATCH cx_root INTO ex.
RAISE EXCEPTION TYPE zcx_excel
EXPORTING
previous = ex.
ENDTRY.
ENDIF.
*--------------------------------------------------------------------*
* End of insertion issue#284 - Copied formulae not
*--------------------------------------------------------------------*
ENDIF.
IF lv_cell_value IS NOT INITIAL
OR lv_cell_formula IS NOT INITIAL
OR lv_style_guid IS NOT INITIAL.
zcl_excel_common=>convert_columnrow2column_a_row( EXPORTING
i_columnrow = ls_cell-r
IMPORTING
e_column = lv_cell_column
e_row = lv_cell_row ).
io_worksheet->set_cell( ip_column = lv_cell_column " cell_elem Column
ip_row = lv_cell_row " cell_elem row_elem
ip_value = lv_cell_value " cell_elem Value
ip_formula = lv_cell_formula
ip_data_type = ls_cell-t
ip_style = lv_style_guid
it_rtf = lt_rtf ).
ENDIF.
lo_ixml_cell_elem ?= lo_ixml_iterator2->get_next( ).
ENDWHILE.
lo_ixml_row_elem ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
*--------------------------------------------------------------------*
*#234 - column width not read correctly - begin of coding
* reason - libre office doesn't use SPAN in row - definitions
*--------------------------------------------------------------------*
IF lv_max_col = 0.
lo_ixml_imension_elem = lo_ixml_worksheet->find_from_name( name = 'dimension' ).
IF lo_ixml_imension_elem IS BOUND.
lv_dimension_range = lo_ixml_imension_elem->get_attribute( 'ref' ).
IF lv_dimension_range CS ':'.
REPLACE REGEX '\D+\d+:(\D+)\d+' IN lv_dimension_range WITH '$1'. " Get max column
ELSE.
REPLACE REGEX '(\D+)\d+' IN lv_dimension_range WITH '$1'. " Get max column
ENDIF.
lv_max_col = zcl_excel_common=>convert_column2int( lv_dimension_range ).
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
*#234 - column width not read correctly - end of coding
*--------------------------------------------------------------------*
"Get the customized column width
lo_ixml_columns = lo_ixml_worksheet->get_elements_by_tag_name( name = 'col' ).
lo_ixml_iterator = lo_ixml_columns->create_iterator( ).
lo_ixml_column_elem ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml_column_elem IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_column_elem
CHANGING
cp_structure = ls_column ).
lo_ixml_column_elem ?= lo_ixml_iterator->get_next( ).
IF ls_column-customwidth = lc_xml_attr_true
OR ls_column-customwidth = lc_xml_attr_true_int
OR ls_column-bestfit = lc_xml_attr_true
OR ls_column-bestfit = lc_xml_attr_true_int
OR ls_column-collapsed = lc_xml_attr_true
OR ls_column-collapsed = lc_xml_attr_true_int
OR ls_column-hidden = lc_xml_attr_true
OR ls_column-hidden = lc_xml_attr_true_int
OR ls_column-outlinelevel > ''
OR ls_column-style > ''.
lv_index = ls_column-min.
WHILE lv_index <= ls_column-max AND lv_index <= lv_max_col.
lv_column_alpha = zcl_excel_common=>convert_column2alpha( lv_index ).
lo_column = io_worksheet->get_column( lv_column_alpha ).
IF ls_column-customwidth = lc_xml_attr_true
OR ls_column-customwidth = lc_xml_attr_true_int
OR ls_column-width IS NOT INITIAL. "+#234
lo_column->set_width( ls_column-width ).
ENDIF.
IF ls_column-bestfit = lc_xml_attr_true
OR ls_column-bestfit = lc_xml_attr_true_int.
lo_column->set_auto_size( abap_true ).
ENDIF.
IF ls_column-collapsed = lc_xml_attr_true
OR ls_column-collapsed = lc_xml_attr_true_int.
lo_column->set_collapsed( abap_true ).
ENDIF.
IF ls_column-hidden = lc_xml_attr_true
OR ls_column-hidden = lc_xml_attr_true_int.
lo_column->set_visible( abap_false ).
ENDIF.
IF ls_column-outlinelevel > ''.
CONDENSE ls_column-outlinelevel.
lv_outline_level = ls_column-outlinelevel.
IF lv_outline_level > 0.
lo_column->set_outline_level( lv_outline_level ).
ENDIF.
ENDIF.
IF ls_column-style > ''.
lv_index_temp = ls_column-style + 1.
READ TABLE styles INTO lo_excel_style INDEX lv_index_temp.
DATA: dummy_zexcel_cell_style TYPE zexcel_cell_style.
dummy_zexcel_cell_style = lo_excel_style->get_guid( ).
lo_column->set_column_style_by_guid( dummy_zexcel_cell_style ).
ENDIF.
ADD 1 TO lv_index.
ENDWHILE.
ENDIF.
* issue #367 - hide columns from
IF ls_column-max = zcl_excel_common=>c_excel_sheet_max_col. " Max = very right column
IF ls_column-hidden = 1 " all hidden
AND ls_column-min > 0.
io_worksheet->zif_excel_sheet_properties~hide_columns_from = zcl_excel_common=>convert_column2alpha( ls_column-min ).
ELSEIF ls_column-style > ''.
lv_index_temp = ls_column-style + 1.
READ TABLE styles INTO lo_excel_style INDEX lv_index_temp.
dummy_zexcel_cell_style = lo_excel_style->get_guid( ).
* Set style for remaining columns
io_worksheet->zif_excel_sheet_properties~set_style( dummy_zexcel_cell_style ).
ENDIF.
ENDIF.
ENDWHILE.
"Now we need to get information from the sheetView node
lo_ixml_sheetview_elem = lo_ixml_worksheet->find_from_name( name = 'sheetView' ).
fill_struct_from_attributes( EXPORTING ip_element = lo_ixml_sheetview_elem CHANGING cp_structure = ls_sheetview ).
IF ls_sheetview-showgridlines IS INITIAL OR
ls_sheetview-showgridlines = lc_xml_attr_true OR
ls_sheetview-showgridlines = lc_xml_attr_true_int.
"If the attribute is not specified or set to true, we will show grid lines
ls_sheetview-showgridlines = abap_true.
ELSE.
ls_sheetview-showgridlines = abap_false.
ENDIF.
io_worksheet->set_show_gridlines( ls_sheetview-showgridlines ).
IF ls_sheetview-righttoleft = lc_xml_attr_true
OR ls_sheetview-righttoleft = lc_xml_attr_true_int.
io_worksheet->zif_excel_sheet_properties~set_right_to_left( abap_true ).
ENDIF.
"Add merge cell information
lo_ixml_mergecells = lo_ixml_worksheet->get_elements_by_tag_name( name = 'mergeCell' ).
lo_ixml_iterator = lo_ixml_mergecells->create_iterator( ).
lo_ixml_mergecell_elem ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml_mergecell_elem IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_mergecell_elem
CHANGING
cp_structure = ls_mergecell ).
zcl_excel_common=>convert_range2column_a_row( EXPORTING
i_range = ls_mergecell-ref
IMPORTING
e_column_start = lv_merge_column_start
e_column_end = lv_merge_column_end
e_row_start = lv_merge_row_start
e_row_end = lv_merge_row_end ).
lo_ixml_mergecell_elem ?= lo_ixml_iterator->get_next( ).
io_worksheet->set_merge( EXPORTING
ip_column_start = lv_merge_column_start
ip_column_end = lv_merge_column_end
ip_row = lv_merge_row_start
ip_row_to = lv_merge_row_end ).
ENDWHILE.
" read sheet format properties
lo_ixml_sheetformatpr_elem = lo_ixml_worksheet->find_from_name( 'sheetFormatPr' ).
IF lo_ixml_sheetformatpr_elem IS NOT INITIAL.
fill_struct_from_attributes( EXPORTING ip_element = lo_ixml_sheetformatpr_elem CHANGING cp_structure = ls_sheetformatpr ).
IF ls_sheetformatpr-customheight = '1'.
lv_height = ls_sheetformatpr-defaultrowheight.
lo_row = io_worksheet->get_default_row( ).
lo_row->set_row_height( lv_height ).
ENDIF.
" TODO... column
ENDIF.
" Read in page margins
me->load_worksheet_pagemargins( EXPORTING
io_ixml_worksheet = lo_ixml_worksheet
io_worksheet = io_worksheet ).
* FitToPage
lo_ixml_sheetpr ?= lo_ixml_worksheet->find_from_name( 'pageSetUpPr' ).
IF lo_ixml_sheetpr IS BOUND.
lv_fit_to_page = lo_ixml_sheetpr->get_attribute_ns( 'fitToPage' ).
IF lv_fit_to_page IS NOT INITIAL.
io_worksheet->sheet_setup->fit_to_page = 'X'.
ENDIF.
ENDIF.
" Read in page setup
lo_ixml_pagesetup_elem = lo_ixml_worksheet->find_from_name( 'pageSetup' ).
IF lo_ixml_pagesetup_elem IS NOT INITIAL.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_pagesetup_elem
CHANGING
cp_structure = ls_pagesetup ).
io_worksheet->sheet_setup->orientation = ls_pagesetup-orientation.
io_worksheet->sheet_setup->scale = ls_pagesetup-scale.
io_worksheet->sheet_setup->paper_size = ls_pagesetup-papersize.
IF io_worksheet->sheet_setup->fit_to_page = 'X'.
IF ls_pagesetup-fittowidth IS NOT INITIAL.
io_worksheet->sheet_setup->fit_to_width = ls_pagesetup-fittowidth.
ELSE.
io_worksheet->sheet_setup->fit_to_width = 1. " Default if not given - Excel doesn't write this to xml
ENDIF.
IF ls_pagesetup-fittoheight IS NOT INITIAL.
io_worksheet->sheet_setup->fit_to_height = ls_pagesetup-fittoheight.
ELSE.
io_worksheet->sheet_setup->fit_to_height = 1. " Default if not given - Excel doesn't write this to xml
ENDIF.
ENDIF.
ENDIF.
" Read header footer
lo_ixml_headerfooter_elem = lo_ixml_worksheet->find_from_name( 'headerFooter' ).
IF lo_ixml_headerfooter_elem IS NOT INITIAL.
fill_struct_from_attributes( EXPORTING ip_element = lo_ixml_headerfooter_elem CHANGING cp_structure = ls_headerfooter ).
io_worksheet->sheet_setup->diff_oddeven_headerfooter = ls_headerfooter-differentoddeven.
lo_ixml_hf_value_elem = lo_ixml_headerfooter_elem->find_from_name( 'oddFooter' ).
IF lo_ixml_hf_value_elem IS NOT INITIAL.
ls_odd_footer-left_value = lo_ixml_hf_value_elem->get_value( ).
ENDIF.
* 2do§1 Header/footer
" TODO.. get the rest.
io_worksheet->sheet_setup->set_header_footer( ip_odd_header = ls_odd_header
ip_odd_footer = ls_odd_footer
ip_even_header = ls_even_header
ip_even_footer = ls_even_footer ).
ENDIF.
" Start fix 194 Read attributes HIDDEN, OUTLINELEVEL, COLLAPSED in ZCL_EXCEL_READER_2007
" Read pane
lo_ixml_pane_elem = lo_ixml_sheetview_elem->find_from_name( name = 'pane' ).
IF lo_ixml_pane_elem IS BOUND.
fill_struct_from_attributes( EXPORTING ip_element = lo_ixml_pane_elem CHANGING cp_structure = ls_excel_pane ).
" Issue #194
" Replace REGEX with method from the common class
zcl_excel_common=>convert_columnrow2column_a_row( EXPORTING
i_columnrow = ls_excel_pane-topleftcell
IMPORTING
e_column = lv_pane_cell_col_a " Cell Column
e_row = lv_pane_cell_row ). " Natural number
lv_pane_cell_col = zcl_excel_common=>convert_column2int( lv_pane_cell_col_a ).
SUBTRACT 1 FROM: lv_pane_cell_col,
lv_pane_cell_row.
IF lv_pane_cell_col > 0
AND lv_pane_cell_row > 0.
io_worksheet->freeze_panes( ip_num_rows = lv_pane_cell_row
ip_num_columns = lv_pane_cell_col ).
ELSEIF lv_pane_cell_row > 0.
io_worksheet->freeze_panes( ip_num_rows = lv_pane_cell_row ).
ELSE.
io_worksheet->freeze_panes( ip_num_columns = lv_pane_cell_col ).
ENDIF.
ENDIF.
" End fix 194 Read attributes HIDDEN, OUTLINELEVEL, COLLAPSED in ZCL_EXCEL_READER_2007
" Start fix 276 Read data validations
lo_ixml_datavalidations = lo_ixml_worksheet->get_elements_by_tag_name( name = 'dataValidation' ).
lo_ixml_iterator = lo_ixml_datavalidations->create_iterator( ).
lo_ixml_datavalidation_elem ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml_datavalidation_elem IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_datavalidation_elem
CHANGING
cp_structure = ls_datavalidation ).
CLEAR lo_ixml_formula_elem.
lo_ixml_formula_elem = lo_ixml_datavalidation_elem->find_from_name( name = 'formula1' ).
IF lo_ixml_formula_elem IS BOUND.
ls_datavalidation-formula1 = lo_ixml_formula_elem->get_value( ).
ENDIF.
CLEAR lo_ixml_formula_elem.
lo_ixml_formula_elem = lo_ixml_datavalidation_elem->find_from_name( name = 'formula2' ).
IF lo_ixml_formula_elem IS BOUND.
ls_datavalidation-formula2 = lo_ixml_formula_elem->get_value( ).
ENDIF.
SPLIT ls_datavalidation-sqref AT space INTO TABLE lt_datavalidation_range.
LOOP AT lt_datavalidation_range INTO lv_datavalidation_range.
zcl_excel_common=>convert_range2column_a_row( EXPORTING
i_range = lv_datavalidation_range
IMPORTING
e_column_start = ls_datavalidation-cell_column
e_column_end = ls_datavalidation-cell_column_to
e_row_start = ls_datavalidation-cell_row
e_row_end = ls_datavalidation-cell_row_to ).
lo_data_validation = io_worksheet->add_new_data_validation( ).
lo_data_validation->type = ls_datavalidation-type.
lo_data_validation->allowblank = ls_datavalidation-allowblank.
IF ls_datavalidation-showinputmessage IS INITIAL.
lo_data_validation->showinputmessage = abap_false.
ELSE.
lo_data_validation->showinputmessage = abap_true.
ENDIF.
IF ls_datavalidation-showerrormessage IS INITIAL.
lo_data_validation->showerrormessage = abap_false.
ELSE.
lo_data_validation->showerrormessage = abap_true.
ENDIF.
IF ls_datavalidation-showdropdown IS INITIAL.
lo_data_validation->showdropdown = abap_false.
ELSE.
lo_data_validation->showdropdown = abap_true.
ENDIF.
lo_data_validation->operator = ls_datavalidation-operator.
lo_data_validation->formula1 = ls_datavalidation-formula1.
lo_data_validation->formula2 = ls_datavalidation-formula2.
lo_data_validation->prompttitle = ls_datavalidation-prompttitle.
lo_data_validation->prompt = ls_datavalidation-prompt.
lo_data_validation->errortitle = ls_datavalidation-errortitle.
lo_data_validation->error = ls_datavalidation-error.
lo_data_validation->errorstyle = ls_datavalidation-errorstyle.
lo_data_validation->cell_row = ls_datavalidation-cell_row.
lo_data_validation->cell_row_to = ls_datavalidation-cell_row_to.
lo_data_validation->cell_column = ls_datavalidation-cell_column.
lo_data_validation->cell_column_to = ls_datavalidation-cell_column_to.
ENDLOOP.
lo_ixml_datavalidation_elem ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
" End fix 276 Read data validations
" Read hyperlinks
TRY.
me->load_worksheet_hyperlinks( io_ixml_worksheet = lo_ixml_worksheet
io_worksheet = io_worksheet
it_external_hyperlinks = lt_external_hyperlinks ).
CATCH zcx_excel. " Ignore Hyperlink reading errors - pass everything we were able to identify
ENDTRY.
TRY.
me->fill_row_outlines( io_worksheet = io_worksheet ).
CATCH zcx_excel. " Ignore Hyperlink reading errors - pass everything we were able to identify
ENDTRY.
" Issue #366 - conditional formatting
TRY.
me->load_worksheet_cond_format( io_ixml_worksheet = lo_ixml_worksheet
io_worksheet = io_worksheet ).
CATCH zcx_excel. " Ignore Hyperlink reading errors - pass everything we were able to identify
ENDTRY.
" Issue #377 - pagebreaks
TRY.
me->load_worksheet_pagebreaks( io_ixml_worksheet = lo_ixml_worksheet
io_worksheet = io_worksheet ).
CATCH zcx_excel. " Ignore pagebreak reading errors - pass everything we were able to identify
ENDTRY.
TRY.
me->load_worksheet_autofilter( io_ixml_worksheet = lo_ixml_worksheet
io_worksheet = io_worksheet ).
CATCH zcx_excel. " Ignore autofilter reading errors - pass everything we were able to identify
ENDTRY.
TRY.
me->load_worksheet_ignored_errors( io_ixml_worksheet = lo_ixml_worksheet
io_worksheet = io_worksheet ).
CATCH zcx_excel. " Ignore "ignoredErrors" reading errors - pass everything we were able to identify
ENDTRY.
ENDMETHOD.
METHOD load_worksheet_autofilter.
TYPES: BEGIN OF lty_autofilter,
ref TYPE string,
END OF lty_autofilter.
DATA: lo_ixml_autofilter_elem TYPE REF TO if_ixml_element,
lv_ref TYPE string,
lo_ixml_filter_column_coll TYPE REF TO if_ixml_node_collection,
lo_ixml_filter_column_iter TYPE REF TO if_ixml_node_iterator,
lo_ixml_filter_column TYPE REF TO if_ixml_element,
lv_col_id TYPE i,
lv_column TYPE zexcel_cell_column,
lo_ixml_filters_coll TYPE REF TO if_ixml_node_collection,
lo_ixml_filters_iter TYPE REF TO if_ixml_node_iterator,
lo_ixml_filters TYPE REF TO if_ixml_element,
lo_ixml_filter_coll TYPE REF TO if_ixml_node_collection,
lo_ixml_filter_iter TYPE REF TO if_ixml_node_iterator,
lo_ixml_filter TYPE REF TO if_ixml_element,
lv_val TYPE string,
lo_autofilters TYPE REF TO zcl_excel_autofilters,
lo_autofilter TYPE REF TO zcl_excel_autofilter.
lo_autofilters = io_worksheet->excel->get_autofilters_reference( ).
lo_ixml_autofilter_elem = io_ixml_worksheet->find_from_name( 'autoFilter' ).
IF lo_ixml_autofilter_elem IS BOUND.
lv_ref = lo_ixml_autofilter_elem->get_attribute_ns( 'ref' ).
lo_ixml_filter_column_coll = lo_ixml_autofilter_elem->get_elements_by_tag_name( name = 'filterColumn' ).
lo_ixml_filter_column_iter = lo_ixml_filter_column_coll->create_iterator( ).
lo_ixml_filter_column ?= lo_ixml_filter_column_iter->get_next( ).
WHILE lo_ixml_filter_column IS BOUND.
lv_col_id = lo_ixml_filter_column->get_attribute_ns( 'colId' ).
lv_column = lv_col_id + 1.
lo_ixml_filters_coll = lo_ixml_filter_column->get_elements_by_tag_name( name = 'filters' ).
lo_ixml_filters_iter = lo_ixml_filters_coll->create_iterator( ).
lo_ixml_filters ?= lo_ixml_filters_iter->get_next( ).
WHILE lo_ixml_filters IS BOUND.
lo_ixml_filter_coll = lo_ixml_filter_column->get_elements_by_tag_name( name = 'filter' ).
lo_ixml_filter_iter = lo_ixml_filter_coll->create_iterator( ).
lo_ixml_filter ?= lo_ixml_filter_iter->get_next( ).
WHILE lo_ixml_filter IS BOUND.
lv_val = lo_ixml_filter->get_attribute_ns( 'val' ).
lo_autofilter = lo_autofilters->get( io_worksheet = io_worksheet ).
IF lo_autofilter IS NOT BOUND.
lo_autofilter = lo_autofilters->add( io_sheet = io_worksheet ).
ENDIF.
lo_autofilter->set_value(
i_column = lv_column
i_value = lv_val ).
lo_ixml_filter ?= lo_ixml_filter_iter->get_next( ).
ENDWHILE.
lo_ixml_filters ?= lo_ixml_filters_iter->get_next( ).
ENDWHILE.
lo_ixml_filter_column ?= lo_ixml_filter_column_iter->get_next( ).
ENDWHILE.
ENDIF.
ENDMETHOD.
METHOD load_worksheet_cond_format.
DATA: lo_ixml_cond_formats TYPE REF TO if_ixml_node_collection,
lo_ixml_cond_format TYPE REF TO if_ixml_element,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lo_ixml_rules TYPE REF TO if_ixml_node_collection,
lo_ixml_rule TYPE REF TO if_ixml_element,
lo_ixml_iterator2 TYPE REF TO if_ixml_node_iterator,
lo_style_cond TYPE REF TO zcl_excel_style_cond,
lo_style_cond2 TYPE REF TO zcl_excel_style_cond.
DATA: lv_area TYPE string,
lt_areas TYPE STANDARD TABLE OF string WITH NON-UNIQUE DEFAULT KEY,
lv_area_start_row TYPE zexcel_cell_row,
lv_area_end_row TYPE zexcel_cell_row,
lv_area_start_col TYPE zexcel_cell_column_alpha,
lv_area_end_col TYPE zexcel_cell_column_alpha,
lv_rule TYPE zexcel_condition_rule.
lo_ixml_cond_formats = io_ixml_worksheet->get_elements_by_tag_name( name = 'conditionalFormatting' ).
lo_ixml_iterator = lo_ixml_cond_formats->create_iterator( ).
lo_ixml_cond_format ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml_cond_format IS BOUND.
CLEAR: lv_area,
lo_ixml_rule,
lo_style_cond.
*--------------------------------------------------------------------*
* Get type of rule
*--------------------------------------------------------------------*
lo_ixml_rules = lo_ixml_cond_format->get_elements_by_tag_name( name = 'cfRule' ).
lo_ixml_iterator2 = lo_ixml_rules->create_iterator( ).
lo_ixml_rule ?= lo_ixml_iterator2->get_next( ).
WHILE lo_ixml_rule IS BOUND.
lv_rule = lo_ixml_rule->get_attribute_ns( 'type' ).
CLEAR lo_style_cond.
*--------------------------------------------------------------------*
* Depending on ruletype get additional information
*--------------------------------------------------------------------*
CASE lv_rule.
WHEN zcl_excel_style_cond=>c_rule_cellis.
lo_style_cond = io_worksheet->add_new_style_cond( '' ).
load_worksheet_cond_format_ci( io_ixml_rule = lo_ixml_rule
io_style_cond = lo_style_cond ).
WHEN zcl_excel_style_cond=>c_rule_databar.
lo_style_cond = io_worksheet->add_new_style_cond( '' ).
load_worksheet_cond_format_db( io_ixml_rule = lo_ixml_rule
io_style_cond = lo_style_cond ).
WHEN zcl_excel_style_cond=>c_rule_expression.
lo_style_cond = io_worksheet->add_new_style_cond( '' ).
load_worksheet_cond_format_ex( io_ixml_rule = lo_ixml_rule
io_style_cond = lo_style_cond ).
WHEN zcl_excel_style_cond=>c_rule_iconset.
lo_style_cond = io_worksheet->add_new_style_cond( '' ).
load_worksheet_cond_format_is( io_ixml_rule = lo_ixml_rule
io_style_cond = lo_style_cond ).
WHEN zcl_excel_style_cond=>c_rule_colorscale.
lo_style_cond = io_worksheet->add_new_style_cond( '' ).
load_worksheet_cond_format_cs( io_ixml_rule = lo_ixml_rule
io_style_cond = lo_style_cond ).
WHEN zcl_excel_style_cond=>c_rule_top10.
lo_style_cond = io_worksheet->add_new_style_cond( '' ).
load_worksheet_cond_format_t10( io_ixml_rule = lo_ixml_rule
io_style_cond = lo_style_cond ).
WHEN zcl_excel_style_cond=>c_rule_above_average.
lo_style_cond = io_worksheet->add_new_style_cond( '' ).
load_worksheet_cond_format_aa( io_ixml_rule = lo_ixml_rule
io_style_cond = lo_style_cond ).
WHEN OTHERS.
ENDCASE.
IF lo_style_cond IS BOUND.
lo_style_cond->rule = lv_rule.
lo_style_cond->priority = lo_ixml_rule->get_attribute_ns( 'priority' ).
*--------------------------------------------------------------------*
* Set area to which conditional formatting belongs
*--------------------------------------------------------------------*
lv_area = lo_ixml_cond_format->get_attribute_ns( 'sqref' ).
SPLIT lv_area AT space INTO TABLE lt_areas.
DELETE lt_areas WHERE table_line IS INITIAL.
LOOP AT lt_areas INTO lv_area.
zcl_excel_common=>convert_range2column_a_row( EXPORTING i_range = lv_area
IMPORTING e_column_start = lv_area_start_col
e_column_end = lv_area_end_col
e_row_start = lv_area_start_row
e_row_end = lv_area_end_row ).
lo_style_cond->add_range( ip_start_column = lv_area_start_col
ip_stop_column = lv_area_end_col
ip_start_row = lv_area_start_row
ip_stop_row = lv_area_end_row ).
ENDLOOP.
ENDIF.
lo_ixml_rule ?= lo_ixml_iterator2->get_next( ).
ENDWHILE.
lo_ixml_cond_format ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_worksheet_cond_format_aa.
DATA: lv_dxf_style_index TYPE i,
val TYPE string.
FIELD-SYMBOLS: <ls_dxf_style> LIKE LINE OF me->mt_dxf_styles.
*--------------------------------------------------------------------*
* above or below average
*--------------------------------------------------------------------*
val = io_ixml_rule->get_attribute_ns( 'aboveAverage' ).
IF val = '0'. " 0 = below average
io_style_cond->mode_above_average-above_average = space.
ELSE.
io_style_cond->mode_above_average-above_average = 'X'. " Not present or <> 0 --> we use above average
ENDIF.
*--------------------------------------------------------------------*
* Equal average also?
*--------------------------------------------------------------------*
CLEAR val.
val = io_ixml_rule->get_attribute_ns( 'equalAverage' ).
IF val = '1'. " 0 = below average
io_style_cond->mode_above_average-equal_average = 'X'.
ELSE.
io_style_cond->mode_above_average-equal_average = ' '. " Not present or <> 1 --> we use not equal average
ENDIF.
*--------------------------------------------------------------------*
* Standard deviation instead of value ( 2nd stddev, 3rd stdev )
*--------------------------------------------------------------------*
CLEAR val.
val = io_ixml_rule->get_attribute_ns( 'stdDev' ).
CASE val.
WHEN 1
OR 2
OR 3. " These seem to be supported by excel - don't try anything more
io_style_cond->mode_above_average-standard_deviation = val.
ENDCASE.
*--------------------------------------------------------------------*
* Cell formatting for top10
*--------------------------------------------------------------------*
lv_dxf_style_index = io_ixml_rule->get_attribute_ns( 'dxfId' ).
READ TABLE me->mt_dxf_styles ASSIGNING <ls_dxf_style> WITH KEY dxf = lv_dxf_style_index.
IF sy-subrc = 0.
io_style_cond->mode_above_average-cell_style = <ls_dxf_style>-guid.
ENDIF.
ENDMETHOD.
METHOD load_worksheet_cond_format_ci.
DATA: lo_ixml_nodes TYPE REF TO if_ixml_node_collection,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lo_ixml TYPE REF TO if_ixml_element,
lv_dxf_style_index TYPE i,
lo_excel_style LIKE LINE OF me->styles.
FIELD-SYMBOLS: <ls_dxf_style> LIKE LINE OF me->mt_dxf_styles.
io_style_cond->mode_cellis-operator = io_ixml_rule->get_attribute_ns( 'operator' ).
lv_dxf_style_index = io_ixml_rule->get_attribute_ns( 'dxfId' ).
READ TABLE me->mt_dxf_styles ASSIGNING <ls_dxf_style> WITH KEY dxf = lv_dxf_style_index.
IF sy-subrc = 0.
io_style_cond->mode_cellis-cell_style = <ls_dxf_style>-guid.
ENDIF.
lo_ixml_nodes ?= io_ixml_rule->get_elements_by_tag_name( 'formula' ).
lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
lo_ixml ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml IS BOUND.
CASE sy-index.
WHEN 1.
io_style_cond->mode_cellis-formula = lo_ixml->get_value( ).
WHEN 2.
io_style_cond->mode_cellis-formula2 = lo_ixml->get_value( ).
WHEN OTHERS.
EXIT.
ENDCASE.
lo_ixml ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_worksheet_cond_format_cs.
DATA: lo_ixml_nodes TYPE REF TO if_ixml_node_collection,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lo_ixml TYPE REF TO if_ixml_element.
lo_ixml_nodes ?= io_ixml_rule->get_elements_by_tag_name( 'cfvo' ).
lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
lo_ixml ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml IS BOUND.
CASE sy-index.
WHEN 1.
io_style_cond->mode_colorscale-cfvo1_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_colorscale-cfvo1_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN 2.
io_style_cond->mode_colorscale-cfvo2_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_colorscale-cfvo2_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN 3.
io_style_cond->mode_colorscale-cfvo3_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_colorscale-cfvo2_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN OTHERS.
EXIT.
ENDCASE.
lo_ixml ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
lo_ixml_nodes ?= io_ixml_rule->get_elements_by_tag_name( 'color' ).
lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
lo_ixml ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml IS BOUND.
CASE sy-index.
WHEN 1.
io_style_cond->mode_colorscale-colorrgb1 = lo_ixml->get_attribute_ns( 'rgb' ).
WHEN 2.
io_style_cond->mode_colorscale-colorrgb2 = lo_ixml->get_attribute_ns( 'rgb' ).
WHEN 3.
io_style_cond->mode_colorscale-colorrgb3 = lo_ixml->get_attribute_ns( 'rgb' ).
WHEN OTHERS.
EXIT.
ENDCASE.
lo_ixml ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_worksheet_cond_format_db.
DATA: lo_ixml_nodes TYPE REF TO if_ixml_node_collection,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lo_ixml TYPE REF TO if_ixml_element.
lo_ixml ?= io_ixml_rule->find_from_name( 'color' ).
IF lo_ixml IS BOUND.
io_style_cond->mode_databar-colorrgb = lo_ixml->get_attribute_ns( 'rgb' ).
ENDIF.
lo_ixml_nodes ?= io_ixml_rule->get_elements_by_tag_name( 'cfvo' ).
lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
lo_ixml ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml IS BOUND.
CASE sy-index.
WHEN 1.
io_style_cond->mode_databar-cfvo1_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_databar-cfvo1_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN 2.
io_style_cond->mode_databar-cfvo2_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_databar-cfvo2_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN OTHERS.
EXIT.
ENDCASE.
lo_ixml ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_worksheet_cond_format_ex.
DATA: lo_ixml_nodes TYPE REF TO if_ixml_node_collection,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lo_ixml TYPE REF TO if_ixml_element,
lv_dxf_style_index TYPE i,
lo_excel_style LIKE LINE OF me->styles.
FIELD-SYMBOLS: <ls_dxf_style> LIKE LINE OF me->mt_dxf_styles.
lv_dxf_style_index = io_ixml_rule->get_attribute_ns( 'dxfId' ).
READ TABLE me->mt_dxf_styles ASSIGNING <ls_dxf_style> WITH KEY dxf = lv_dxf_style_index.
IF sy-subrc = 0.
io_style_cond->mode_expression-cell_style = <ls_dxf_style>-guid.
ENDIF.
lo_ixml_nodes ?= io_ixml_rule->get_elements_by_tag_name( 'formula' ).
lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
lo_ixml ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml IS BOUND.
CASE sy-index.
WHEN 1.
io_style_cond->mode_expression-formula = lo_ixml->get_value( ).
WHEN OTHERS.
EXIT.
ENDCASE.
lo_ixml ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_worksheet_cond_format_is.
DATA: lo_ixml_nodes TYPE REF TO if_ixml_node_collection,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lo_ixml TYPE REF TO if_ixml_element,
lo_ixml_rule_iconset TYPE REF TO if_ixml_element.
lo_ixml_rule_iconset ?= io_ixml_rule->get_first_child( ).
io_style_cond->mode_iconset-iconset = lo_ixml_rule_iconset->get_attribute_ns( 'iconSet' ).
io_style_cond->mode_iconset-showvalue = lo_ixml_rule_iconset->get_attribute_ns( 'showValue' ).
lo_ixml_nodes ?= lo_ixml_rule_iconset->get_elements_by_tag_name( 'cfvo' ).
lo_ixml_iterator = lo_ixml_nodes->create_iterator( ).
lo_ixml ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml IS BOUND.
CASE sy-index.
WHEN 1.
io_style_cond->mode_iconset-cfvo1_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_iconset-cfvo1_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN 2.
io_style_cond->mode_iconset-cfvo2_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_iconset-cfvo2_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN 3.
io_style_cond->mode_iconset-cfvo3_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_iconset-cfvo3_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN 4.
io_style_cond->mode_iconset-cfvo4_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_iconset-cfvo4_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN 5.
io_style_cond->mode_iconset-cfvo5_type = lo_ixml->get_attribute_ns( 'type' ).
io_style_cond->mode_iconset-cfvo5_value = lo_ixml->get_attribute_ns( 'val' ).
WHEN OTHERS.
EXIT.
ENDCASE.
lo_ixml ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_worksheet_cond_format_t10.
DATA: lv_dxf_style_index TYPE i.
FIELD-SYMBOLS: <ls_dxf_style> LIKE LINE OF me->mt_dxf_styles.
io_style_cond->mode_top10-topxx_count = io_ixml_rule->get_attribute_ns( 'rank' ). " Top10, Top20, Top 50...
io_style_cond->mode_top10-percent = io_ixml_rule->get_attribute_ns( 'percent' ). " Top10 percent instead of Top10 values
IF io_style_cond->mode_top10-percent = '1'.
io_style_cond->mode_top10-percent = 'X'.
ELSE.
io_style_cond->mode_top10-percent = ' '.
ENDIF.
io_style_cond->mode_top10-bottom = io_ixml_rule->get_attribute_ns( 'bottom' ). " Bottom10 instead of Top10
IF io_style_cond->mode_top10-bottom = '1'.
io_style_cond->mode_top10-bottom = 'X'.
ELSE.
io_style_cond->mode_top10-bottom = ' '.
ENDIF.
*--------------------------------------------------------------------*
* Cell formatting for top10
*--------------------------------------------------------------------*
lv_dxf_style_index = io_ixml_rule->get_attribute_ns( 'dxfId' ).
READ TABLE me->mt_dxf_styles ASSIGNING <ls_dxf_style> WITH KEY dxf = lv_dxf_style_index.
IF sy-subrc = 0.
io_style_cond->mode_top10-cell_style = <ls_dxf_style>-guid.
ENDIF.
ENDMETHOD.
METHOD load_worksheet_drawing.
TYPES: BEGIN OF t_c_nv_pr,
name TYPE string,
id TYPE string,
END OF t_c_nv_pr.
TYPES: BEGIN OF t_blip,
cstate TYPE string,
embed TYPE string,
END OF t_blip.
TYPES: BEGIN OF t_chart,
id TYPE string,
END OF t_chart.
CONSTANTS: lc_xml_attr_true TYPE string VALUE 'true',
lc_xml_attr_true_int TYPE string VALUE '1'.
CONSTANTS: lc_rel_chart TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart',
lc_rel_image TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image'.
DATA: drawing TYPE REF TO if_ixml_document,
anchors TYPE REF TO if_ixml_node_collection,
node TYPE REF TO if_ixml_element,
coll_length TYPE i,
iterator TYPE REF TO if_ixml_node_iterator,
anchor_elem TYPE REF TO if_ixml_element,
relationship TYPE t_relationship,
rel_drawings TYPE t_rel_drawings,
rel_drawing TYPE t_rel_drawing,
rels_drawing TYPE REF TO if_ixml_document,
rels_drawing_path TYPE string,
stripped_name TYPE chkfile,
dirname TYPE string,
path TYPE string,
path2 TYPE text255,
file_ext2 TYPE char10.
" Read Workbook Relationships
CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH'
EXPORTING
full_name = ip_path
IMPORTING
stripped_name = stripped_name
file_path = dirname.
CONCATENATE dirname '_rels/' stripped_name '.rels'
INTO rels_drawing_path.
rels_drawing_path = resolve_path( rels_drawing_path ).
rels_drawing = me->get_ixml_from_zip_archive( rels_drawing_path ).
node ?= rels_drawing->find_from_name( 'Relationship' ).
WHILE node IS BOUND.
fill_struct_from_attributes( EXPORTING ip_element = node CHANGING cp_structure = relationship ).
rel_drawing-id = relationship-id.
CONCATENATE dirname relationship-target INTO path.
path = resolve_path( path ).
rel_drawing-content = me->get_from_zip_archive( path ). "------------> This is for template usage
path2 = path.
zcl_excel_common=>split_file( EXPORTING ip_file = path2
IMPORTING ep_extension = file_ext2 ).
rel_drawing-file_ext = file_ext2.
"-------------Added by Alessandro Iannacci - Should load graph xml
CASE relationship-type.
WHEN lc_rel_chart.
"Read chart xml
rel_drawing-content_xml = me->get_ixml_from_zip_archive( path ).
WHEN OTHERS.
ENDCASE.
"----------------------------
APPEND rel_drawing TO rel_drawings.
node ?= node->get_next( ).
ENDWHILE.
drawing = me->get_ixml_from_zip_archive( ip_path ).
* one-cell anchor **************
anchors = drawing->get_elements_by_tag_name( name = 'oneCellAnchor' namespace = 'xdr' ).
coll_length = anchors->get_length( ).
iterator = anchors->create_iterator( ).
DO coll_length TIMES.
anchor_elem ?= iterator->get_next( ).
CALL METHOD me->load_drawing_anchor
EXPORTING
io_anchor_element = anchor_elem
io_worksheet = io_worksheet
it_related_drawings = rel_drawings.
ENDDO.
* two-cell anchor ******************
anchors = drawing->get_elements_by_tag_name( name = 'twoCellAnchor' namespace = 'xdr' ).
coll_length = anchors->get_length( ).
iterator = anchors->create_iterator( ).
DO coll_length TIMES.
anchor_elem ?= iterator->get_next( ).
CALL METHOD me->load_drawing_anchor
EXPORTING
io_anchor_element = anchor_elem
io_worksheet = io_worksheet
it_related_drawings = rel_drawings.
ENDDO.
ENDMETHOD.
METHOD load_worksheet_hyperlinks.
DATA: lo_ixml_hyperlinks TYPE REF TO if_ixml_node_collection,
lo_ixml_hyperlink TYPE REF TO if_ixml_element,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lv_row_start 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_is_internal TYPE abap_bool,
lv_url TYPE string,
lv_value TYPE zexcel_cell_value.
DATA: BEGIN OF ls_hyperlink,
ref TYPE string,
display TYPE string,
location TYPE string,
tooltip TYPE string,
r_id TYPE string,
END OF ls_hyperlink.
FIELD-SYMBOLS: <ls_external_hyperlink> LIKE LINE OF it_external_hyperlinks.
lo_ixml_hyperlinks = io_ixml_worksheet->get_elements_by_tag_name( name = 'hyperlink' ).
lo_ixml_iterator = lo_ixml_hyperlinks->create_iterator( ).
lo_ixml_hyperlink ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml_hyperlink IS BOUND.
CLEAR ls_hyperlink.
CLEAR lv_url.
ls_hyperlink-ref = lo_ixml_hyperlink->get_attribute_ns( 'ref' ).
ls_hyperlink-display = lo_ixml_hyperlink->get_attribute_ns( 'display' ).
ls_hyperlink-location = lo_ixml_hyperlink->get_attribute_ns( 'location' ).
ls_hyperlink-tooltip = lo_ixml_hyperlink->get_attribute_ns( 'tooltip' ).
ls_hyperlink-r_id = lo_ixml_hyperlink->get_attribute( name = 'id'
namespace = 'r' ).
IF ls_hyperlink-r_id IS INITIAL. " Internal link
lv_is_internal = abap_true.
lv_url = ls_hyperlink-location.
ELSE. " External link
READ TABLE it_external_hyperlinks ASSIGNING <ls_external_hyperlink> WITH TABLE KEY id = ls_hyperlink-r_id.
IF sy-subrc = 0.
lv_is_internal = abap_false.
lv_url = <ls_external_hyperlink>-target.
ENDIF.
ENDIF.
IF lv_url IS NOT INITIAL. " because of unsupported external links
zcl_excel_common=>convert_range2column_a_row(
EXPORTING
i_range = ls_hyperlink-ref
IMPORTING
e_column_start = lv_column_start
e_column_end = lv_column_end
e_row_start = lv_row_start
e_row_end = lv_row_end ).
io_worksheet->set_area_hyperlink(
EXPORTING
ip_column_start = lv_column_start
ip_column_end = lv_column_end
ip_row = lv_row_start
ip_row_to = lv_row_end
ip_url = lv_url
ip_is_internal = lv_is_internal ).
ENDIF.
lo_ixml_hyperlink ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD load_worksheet_ignored_errors.
DATA: lo_ixml_ignored_errors TYPE REF TO if_ixml_node_collection,
lo_ixml_ignored_error TYPE REF TO if_ixml_element,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
ls_ignored_error TYPE zcl_excel_worksheet=>mty_s_ignored_errors,
lt_ignored_errors TYPE zcl_excel_worksheet=>mty_th_ignored_errors.
DATA: BEGIN OF ls_raw_ignored_error,
sqref TYPE string,
evalerror TYPE string,
twodigittextyear TYPE string,
numberstoredastext TYPE string,
formula TYPE string,
formularange TYPE string,
unlockedformula TYPE string,
emptycellreference TYPE string,
listdatavalidation TYPE string,
calculatedcolumn TYPE string,
END OF ls_raw_ignored_error.
CLEAR lt_ignored_errors.
lo_ixml_ignored_errors = io_ixml_worksheet->get_elements_by_tag_name( name = 'ignoredError' ).
lo_ixml_iterator = lo_ixml_ignored_errors->create_iterator( ).
lo_ixml_ignored_error ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml_ignored_error IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_ignored_error
CHANGING
cp_structure = ls_raw_ignored_error ).
CLEAR ls_ignored_error.
ls_ignored_error-cell_coords = ls_raw_ignored_error-sqref.
ls_ignored_error-eval_error = boolc( ls_raw_ignored_error-evalerror = '1' ).
ls_ignored_error-two_digit_text_year = boolc( ls_raw_ignored_error-twodigittextyear = '1' ).
ls_ignored_error-number_stored_as_text = boolc( ls_raw_ignored_error-numberstoredastext = '1' ).
ls_ignored_error-formula = boolc( ls_raw_ignored_error-formula = '1' ).
ls_ignored_error-formula_range = boolc( ls_raw_ignored_error-formularange = '1' ).
ls_ignored_error-unlocked_formula = boolc( ls_raw_ignored_error-unlockedformula = '1' ).
ls_ignored_error-empty_cell_reference = boolc( ls_raw_ignored_error-emptycellreference = '1' ).
ls_ignored_error-list_data_validation = boolc( ls_raw_ignored_error-listdatavalidation = '1' ).
ls_ignored_error-calculated_column = boolc( ls_raw_ignored_error-calculatedcolumn = '1' ).
INSERT ls_ignored_error INTO TABLE lt_ignored_errors.
lo_ixml_ignored_error ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
io_worksheet->set_ignored_errors( lt_ignored_errors ).
ENDMETHOD.
METHOD load_worksheet_pagebreaks.
DATA: lo_node TYPE REF TO if_ixml_element,
lo_ixml_rowbreaks TYPE REF TO if_ixml_node_collection,
lo_ixml_colbreaks TYPE REF TO if_ixml_node_collection,
lo_ixml_iterator TYPE REF TO if_ixml_node_iterator,
lo_ixml_rowbreak TYPE REF TO if_ixml_element,
lo_ixml_colbreak TYPE REF TO if_ixml_element,
lo_style_cond TYPE REF TO zcl_excel_style_cond,
lv_count TYPE i.
DATA: lt_pagebreaks TYPE STANDARD TABLE OF zcl_excel_worksheet_pagebreaks=>ts_pagebreak_at,
lo_pagebreaks TYPE REF TO zcl_excel_worksheet_pagebreaks.
FIELD-SYMBOLS: <ls_pagebreak_row> LIKE LINE OF lt_pagebreaks.
FIELD-SYMBOLS: <ls_pagebreak_col> LIKE LINE OF lt_pagebreaks.
*--------------------------------------------------------------------*
* Get minimal number of cells where to add pagebreaks
* Since rows and columns are handled in separate nodes
* Build table to identify these cells
*--------------------------------------------------------------------*
lo_node ?= io_ixml_worksheet->find_from_name( 'rowBreaks' ).
CHECK lo_node IS BOUND.
lo_ixml_rowbreaks = lo_node->get_elements_by_tag_name( name = 'brk' ).
lo_ixml_iterator = lo_ixml_rowbreaks->create_iterator( ).
lo_ixml_rowbreak ?= lo_ixml_iterator->get_next( ).
WHILE lo_ixml_rowbreak IS BOUND.
APPEND INITIAL LINE TO lt_pagebreaks ASSIGNING <ls_pagebreak_row>.
<ls_pagebreak_row>-cell_row = lo_ixml_rowbreak->get_attribute_ns( 'id' ).
lo_ixml_rowbreak ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
CHECK <ls_pagebreak_row> IS ASSIGNED.
lo_node ?= io_ixml_worksheet->find_from_name( 'colBreaks' ).
CHECK lo_node IS BOUND.
lo_ixml_colbreaks = lo_node->get_elements_by_tag_name( name = 'brk' ).
lo_ixml_iterator = lo_ixml_colbreaks->create_iterator( ).
lo_ixml_colbreak ?= lo_ixml_iterator->get_next( ).
CLEAR lv_count.
WHILE lo_ixml_colbreak IS BOUND.
ADD 1 TO lv_count.
READ TABLE lt_pagebreaks INDEX lv_count ASSIGNING <ls_pagebreak_col>.
IF sy-subrc <> 0.
APPEND INITIAL LINE TO lt_pagebreaks ASSIGNING <ls_pagebreak_col>.
<ls_pagebreak_col>-cell_row = <ls_pagebreak_row>-cell_row.
ENDIF.
<ls_pagebreak_col>-cell_column = lo_ixml_colbreak->get_attribute_ns( 'id' ).
lo_ixml_colbreak ?= lo_ixml_iterator->get_next( ).
ENDWHILE.
*--------------------------------------------------------------------*
* Finally add each pagebreak
*--------------------------------------------------------------------*
lo_pagebreaks = io_worksheet->get_pagebreaks( ).
LOOP AT lt_pagebreaks ASSIGNING <ls_pagebreak_row>.
lo_pagebreaks->add_pagebreak( ip_column = <ls_pagebreak_row>-cell_column
ip_row = <ls_pagebreak_row>-cell_row ).
ENDLOOP.
ENDMETHOD.
METHOD load_worksheet_pagemargins.
TYPES: BEGIN OF lty_page_margins,
footer TYPE string,
header TYPE string,
bottom TYPE string,
top TYPE string,
right TYPE string,
left TYPE string,
END OF lty_page_margins.
DATA:lo_ixml_pagemargins_elem TYPE REF TO if_ixml_element,
ls_pagemargins TYPE lty_page_margins.
lo_ixml_pagemargins_elem = io_ixml_worksheet->find_from_name( 'pageMargins' ).
IF lo_ixml_pagemargins_elem IS NOT INITIAL.
fill_struct_from_attributes( EXPORTING
ip_element = lo_ixml_pagemargins_elem
CHANGING
cp_structure = ls_pagemargins ).
io_worksheet->sheet_setup->margin_bottom = zcl_excel_common=>excel_string_to_number( ls_pagemargins-bottom ).
io_worksheet->sheet_setup->margin_footer = zcl_excel_common=>excel_string_to_number( ls_pagemargins-footer ).
io_worksheet->sheet_setup->margin_header = zcl_excel_common=>excel_string_to_number( ls_pagemargins-header ).
io_worksheet->sheet_setup->margin_left = zcl_excel_common=>excel_string_to_number( ls_pagemargins-left ).
io_worksheet->sheet_setup->margin_right = zcl_excel_common=>excel_string_to_number( ls_pagemargins-right ).
io_worksheet->sheet_setup->margin_top = zcl_excel_common=>excel_string_to_number( ls_pagemargins-top ).
ENDIF.
ENDMETHOD.
METHOD read_from_applserver.
DATA: lv_filelength TYPE i,
lt_binary_data TYPE STANDARD TABLE OF x255 WITH NON-UNIQUE DEFAULT KEY,
ls_binary_data LIKE LINE OF lt_binary_data,
lv_filename TYPE string,
lv_max_length_line TYPE i,
lv_actual_length_line TYPE i,
lv_errormessage TYPE string.
lv_filename = i_filename.
DESCRIBE FIELD ls_binary_data LENGTH lv_max_length_line IN BYTE MODE.
OPEN DATASET lv_filename FOR INPUT IN BINARY MODE.
IF sy-subrc <> 0.
lv_errormessage = 'A problem occured when reading the file'(001).
zcx_excel=>raise_text( lv_errormessage ).
ENDIF.
WHILE sy-subrc = 0.
READ DATASET lv_filename INTO ls_binary_data MAXIMUM LENGTH lv_max_length_line ACTUAL LENGTH lv_actual_length_line.
APPEND ls_binary_data TO lt_binary_data.
lv_filelength = lv_filelength + lv_actual_length_line.
ENDWHILE.
CLOSE DATASET lv_filename.
*--------------------------------------------------------------------*
* Binary data needs to be provided as XSTRING for further processing
*--------------------------------------------------------------------*
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
input_length = lv_filelength
IMPORTING
buffer = r_excel_data
TABLES
binary_tab = lt_binary_data.
ENDMETHOD.
METHOD read_from_local_file.
DATA: lv_filelength TYPE i,
lt_binary_data TYPE STANDARD TABLE OF x255 WITH NON-UNIQUE DEFAULT KEY,
ls_binary_data LIKE LINE OF lt_binary_data,
lv_filename TYPE string,
lv_errormessage TYPE string.
lv_filename = i_filename.
cl_gui_frontend_services=>gui_upload( EXPORTING
filename = lv_filename
filetype = 'BIN' " We are basically working with zipped directories --> force binary read
IMPORTING
filelength = lv_filelength
CHANGING
data_tab = lt_binary_data
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19 ).
IF sy-subrc <> 0.
lv_errormessage = 'A problem occured when reading the file'(001).
zcx_excel=>raise_text( lv_errormessage ).
ENDIF.
*--------------------------------------------------------------------*
* Binary data needs to be provided as XSTRING for further processing
*--------------------------------------------------------------------*
CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
EXPORTING
input_length = lv_filelength
IMPORTING
buffer = r_excel_data
TABLES
binary_tab = lt_binary_data.
ENDMETHOD.
METHOD resolve_path.
*--------------------------------------------------------------------*
* ToDos:
* 2do§1 Determine whether the replacement should be done
* iterative to allow /../../.. or something alike
* 2do§2 Determine whether /./ has to be supported as well
* 2do§3 Create unit-test for this method
*
* Please don't just delete these ToDos if they are not
* needed but leave a comment that states this
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-11-11
* - ...
* changes: replaced previous coding by regular expression
* adding comments to explain what we are trying to achieve
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* §1 This routine will receive a path, that may have a relative pathname (/../) included somewhere
* The output should be a resolved path without relative references
* Example: Input xl/worksheets/../drawings/drawing1.xml
* Output xl/drawings/drawing1.xml
*--------------------------------------------------------------------*
rp_result = ip_path.
*--------------------------------------------------------------------*
* §1 Remove relative pathnames
*--------------------------------------------------------------------*
* Regular expression [^/]*/\.\./
* [^/]* --> any number of characters other than /
* followed by /\.\./ --> the sequence /../
* ==> worksheets/../ will be found in the example
*--------------------------------------------------------------------*
REPLACE REGEX '[^/]*/\.\./' IN rp_result WITH ``.
ENDMETHOD.
METHOD resolve_referenced_formulae.
TYPES: BEGIN OF ty_referenced_cells,
sheet TYPE REF TO zcl_excel_worksheet,
si TYPE i,
row_from TYPE i,
row_to TYPE i,
col_from TYPE i,
col_to TYPE i,
formula TYPE string,
ref_cell TYPE char10,
END OF ty_referenced_cells.
DATA: ls_ref_formula LIKE LINE OF me->mt_ref_formulae,
lts_referenced_cells TYPE SORTED TABLE OF ty_referenced_cells WITH NON-UNIQUE KEY sheet si row_from row_to col_from col_to,
ls_referenced_cell LIKE LINE OF lts_referenced_cells,
lv_col_from TYPE zexcel_cell_column_alpha,
lv_col_to TYPE zexcel_cell_column_alpha,
lv_resulting_formula TYPE string,
lv_current_cell TYPE char10.
me->mt_ref_formulae = me->mt_ref_formulae.
*--------------------------------------------------------------------*
* Get referenced Cells, Build ranges for easy lookup
*--------------------------------------------------------------------*
LOOP AT me->mt_ref_formulae INTO ls_ref_formula WHERE ref <> space.
CLEAR ls_referenced_cell.
ls_referenced_cell-sheet = ls_ref_formula-sheet.
ls_referenced_cell-si = ls_ref_formula-si.
ls_referenced_cell-formula = ls_ref_formula-formula.
TRY.
zcl_excel_common=>convert_range2column_a_row( EXPORTING i_range = ls_ref_formula-ref
IMPORTING e_column_start = lv_col_from
e_column_end = lv_col_to
e_row_start = ls_referenced_cell-row_from
e_row_end = ls_referenced_cell-row_to ).
ls_referenced_cell-col_from = zcl_excel_common=>convert_column2int( lv_col_from ).
ls_referenced_cell-col_to = zcl_excel_common=>convert_column2int( lv_col_to ).
CLEAR ls_referenced_cell-ref_cell.
TRY.
ls_referenced_cell-ref_cell(3) = zcl_excel_common=>convert_column2alpha( ls_ref_formula-column ).
ls_referenced_cell-ref_cell+3 = ls_ref_formula-row.
CONDENSE ls_referenced_cell-ref_cell NO-GAPS.
CATCH zcx_excel.
ENDTRY.
INSERT ls_referenced_cell INTO TABLE lts_referenced_cells.
CATCH zcx_excel.
ENDTRY.
ENDLOOP.
* break x0009004.
*--------------------------------------------------------------------*
* For each referencing cell determine the referenced cell
* and resolve the formula
*--------------------------------------------------------------------*
LOOP AT me->mt_ref_formulae INTO ls_ref_formula WHERE ref = space.
CLEAR lv_current_cell.
TRY.
lv_current_cell(3) = zcl_excel_common=>convert_column2alpha( ls_ref_formula-column ).
lv_current_cell+3 = ls_ref_formula-row.
CONDENSE lv_current_cell NO-GAPS.
CATCH zcx_excel.
ENDTRY.
LOOP AT lts_referenced_cells INTO ls_referenced_cell WHERE sheet = ls_ref_formula-sheet
AND si = ls_ref_formula-si
AND row_from <= ls_ref_formula-row
AND row_to >= ls_ref_formula-row
AND col_from <= ls_ref_formula-column
AND col_to >= ls_ref_formula-column.
TRY.
lv_resulting_formula = zcl_excel_common=>determine_resulting_formula( iv_reference_cell = ls_referenced_cell-ref_cell
iv_reference_formula = ls_referenced_cell-formula
iv_current_cell = lv_current_cell ).
ls_referenced_cell-sheet->set_cell_formula( ip_column = ls_ref_formula-column
ip_row = ls_ref_formula-row
ip_formula = lv_resulting_formula ).
CATCH zcx_excel.
ENDTRY.
EXIT.
ENDLOOP.
ENDLOOP.
ENDMETHOD.
METHOD zif_excel_reader~load.
*--------------------------------------------------------------------*
* ToDos:
* 2do§1 Map Document Properties to ZCL_EXCEL
*--------------------------------------------------------------------*
CONSTANTS: lcv_core_properties TYPE string VALUE 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties',
lcv_office_document TYPE string VALUE 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument'.
DATA: lo_rels TYPE REF TO if_ixml_document,
lo_node TYPE REF TO if_ixml_element,
ls_relationship TYPE t_relationship.
*--------------------------------------------------------------------*
* §1 Create EXCEL-Object we want to return to caller
* §2 We need to read the the file "\\_rels\.rels" because it tells
* us where in this folder structure the data for the workbook
* is located in the xlsx zip-archive
*
* The xlsx Zip-archive has generally the following folder structure:
* <root> |
* |--> _rels
* |--> doc_Props
* |--> xl |
* |--> _rels
* |--> theme
* |--> worksheets
* §3 Extracting from this the path&file where the workbook is located
* Following is an example how this file could be set up
* <?xml version="1.0" encoding="UTF-8" standalone="true"?>
* <Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">
* <Relationship Target="docProps/app.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" Id="rId3"/>
* <Relationship Target="docProps/core.xml" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Id="rId2"/>
* <Relationship Target="xl/workbook.xml" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Id="rId1"/>
* </Relationships>
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* §1 Create EXCEL-Object we want to return to caller
*--------------------------------------------------------------------*
IF iv_zcl_excel_classname IS INITIAL.
CREATE OBJECT r_excel.
ELSE.
CREATE OBJECT r_excel TYPE (iv_zcl_excel_classname).
ENDIF.
zip = create_zip_archive( i_xlsx_binary = i_excel2007
i_use_alternate_zip = i_use_alternate_zip ).
*--------------------------------------------------------------------*
* §2 Get file in folderstructure
*--------------------------------------------------------------------*
lo_rels = get_ixml_from_zip_archive( '_rels/.rels' ).
*--------------------------------------------------------------------*
* §3 Cycle through the Relationship Tags and use the ones we need
*--------------------------------------------------------------------*
lo_node ?= lo_rels->find_from_name( 'Relationship' ). "#EC NOTEXT
WHILE lo_node IS BOUND.
fill_struct_from_attributes( EXPORTING
ip_element = lo_node
CHANGING
cp_structure = ls_relationship ).
CASE ls_relationship-type.
WHEN lcv_office_document.
*--------------------------------------------------------------------*
* Parse workbook - main part here
*--------------------------------------------------------------------*
load_workbook( iv_workbook_full_filename = ls_relationship-target
io_excel = r_excel ).
WHEN lcv_core_properties.
" 2do§1 Map Document Properties to ZCL_EXCEL
WHEN OTHERS.
ENDCASE.
lo_node ?= lo_node->get_next( ).
ENDWHILE.
ENDMETHOD.
METHOD zif_excel_reader~load_file.
DATA: lv_excel_data TYPE xstring.
*--------------------------------------------------------------------*
* Read file into binary string
*--------------------------------------------------------------------*
IF i_from_applserver = abap_true.
lv_excel_data = read_from_applserver( i_filename ).
ELSE.
lv_excel_data = read_from_local_file( i_filename ).
ENDIF.
*--------------------------------------------------------------------*
* Parse Excel data into ZCL_EXCEL object from binary string
*--------------------------------------------------------------------*
r_excel = zif_excel_reader~load( i_excel2007 = lv_excel_data
i_use_alternate_zip = i_use_alternate_zip
iv_zcl_excel_classname = iv_zcl_excel_classname ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
1069,
5276,
62,
46862,
62,
12726,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1168,
5097,
62,
6369,
34,
3698,
62,
15675,
1137,
62,
12726,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
220,
220,
220,
41876,
12,
16402,
3535,
50,
220,
844,
4029,
764,
628,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
1069,
5276,
62,
46862,
764,
628,
220,
220,
220,
42715,
12,
49273,
50,
6070,
62,
7249,
62,
6738,
62,
1078,
7657,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
541,
62,
30854,
220,
220,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
13155,
62,
301,
5620,
41876,
597,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
24412,
47,
1546,
25,
198,
9,
1,
9,
6861,
6805,
286,
1398,
1168,
5097,
62,
6369,
34,
3698,
62,
15675,
1137,
62,
12726,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
256,
62,
39468,
1056,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4686,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2496,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2496,
14171,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
2499,
25473,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
5225,
25473,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9629,
312,
220,
220,
220,
220,
220,
41876,
4731,
11,
220,
220,
220,
220,
366,
1040,
1303,
22370,
532,
9585,
15274,
14,
4033,
82,
532,
2622,
284,
5911,
3376,
9629,
198,
220,
220,
220,
220,
220,
220,
220,
17205,
25473,
312,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
256,
62,
39468,
1056,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
256,
62,
7753,
9641,
11,
198,
220,
220,
220,
220,
220,
220,
220,
598,
3672,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
15436,
863,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1877,
7287,
863,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
374,
929,
11249,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
14873,
12453,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
256,
62,
7753,
9641,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
256,
62,
21760,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
9629,
312,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4686,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1181,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
256,
62,
21760,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
256,
62,
1818,
2070,
1050,
11,
198,
220,
220,
220,
220,
220,
220,
220,
14873,
12453,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
4277,
43810,
9641,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
256,
62,
1818,
2070,
1050,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
256,
62,
21760,
1050,
11,
198,
220,
220,
220,
220,
220,
220,
220,
14873,
12453,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
23578,
3963,
256,
62,
21760,
1050,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
347,
43312,
3963,
256,
62,
9521,
11,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
198,
220,
220,
220,
220,
220,
220,
220,
7104,
220,
220,
220,
220,
220,
220,
41876,
4731,
11,
220,
220,
220,
220,
220,
220,
366,
28463,
276,
351,
2071,
1303,
22370,
780,
5231,
1659,
346,
1010,
1422,
470,
38836,
48476,
740,
198,
220,
220,
220,
220,
220,
220,
220,
17205,
25473,
312,
41876,
4731,
11,
220,
220,
220,
220,
220,
220,
366,
2071,
1303,
24136,
198,
220,
220,
220,
220,
220,
23578,
3963,
256,
62,
9521,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
256,
62,
69,
2171,
220,
220,
41876,
49053,
9795,
43679,
3963,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
7635,
62,
20797,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
256,
62,
65,
6361,
41876,
49053,
9795,
43679,
3963,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
7635,
62,
65,
6361,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
256,
62,
10331,
82,
220,
220,
41876,
49053,
9795,
43679,
3963,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
7635,
62,
10331,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
764,
198,
220,
220,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
220,
220,
256,
62,
7635,
62,
5420,
82,
41876,
49053,
9795,
43679,
3963,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
7635,
13315,
44521,
12,
4944,
33866,
8924,
5550,
38865,
35374,
764,
198,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS ltc_statistics DEFINITION FOR TESTING
RISK LEVEL HARMLESS
DURATION SHORT.
PRIVATE SECTION.
DATA: cut TYPE REF TO y_scan_statistics.
METHODS:
setup,
is_bound FOR TESTING,
check_errors FOR TESTING,
check_warnings FOR TESTING,
check_notes FOR TESTING,
check_pseudo_comments FOR TESTING,
increment_pseudo_comments FOR TESTING.
ENDCLASS.
CLASS ltc_statistics IMPLEMENTATION.
METHOD setup.
cut = NEW y_scan_statistics( ).
ENDMETHOD.
METHOD is_bound.
cl_abap_unit_assert=>assert_bound( cut ).
ENDMETHOD.
METHOD check_errors.
cut->y_if_scan_statistics~collect( kind = y_check_base=>c_error
pc = '' ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_errors( )
exp = 1 ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_warnings( )
exp = 0 ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_notes( )
exp = 0 ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_pseudo_comments( )
exp = 0 ).
ENDMETHOD.
METHOD check_warnings.
cut->y_if_scan_statistics~collect( kind = y_check_base=>c_warning
pc = '' ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_errors( )
exp = 0 ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_warnings( )
exp = 1 ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_notes( )
exp = 0 ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_pseudo_comments( )
exp = 0 ).
ENDMETHOD.
METHOD check_notes.
cut->y_if_scan_statistics~collect( kind = y_check_base=>c_note
pc = '' ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_errors( )
exp = 0 ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_warnings( )
exp = 0 ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_notes( )
exp = 1 ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_pseudo_comments( )
exp = 0 ).
ENDMETHOD.
METHOD check_pseudo_comments.
cut->y_if_scan_statistics~collect( kind = y_check_base=>c_error
pc = 'P' ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_errors( )
exp = 0 ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_warnings( )
exp = 0 ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_notes( )
exp = 0 ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_pseudo_comments( )
exp = 1 ).
ENDMETHOD.
METHOD increment_pseudo_comments.
cut->y_if_scan_statistics~collect( kind = y_check_base=>c_error
pc = 'P' ).
cut->y_if_scan_statistics~collect( kind = y_check_base=>c_error
pc = 'P' ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_errors( )
exp = 0 ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_warnings( )
exp = 0 ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_notes( )
exp = 0 ).
cl_abap_unit_assert=>assert_equals( act = cut->y_if_scan_statistics~get_number_pseudo_comments( )
exp = 2 ).
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
23047,
62,
14269,
3969,
5550,
20032,
17941,
7473,
43001,
2751,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
198,
220,
360,
4261,
6234,
6006,
9863,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
2005,
41876,
4526,
37,
5390,
331,
62,
35836,
62,
14269,
3969,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
220,
220,
318,
62,
7784,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
2198,
62,
48277,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
2198,
62,
40539,
654,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
2198,
62,
17815,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
2198,
62,
7752,
12003,
62,
15944,
7473,
43001,
2751,
11,
198,
220,
220,
220,
220,
220,
18703,
62,
7752,
12003,
62,
15944,
7473,
43001,
2751,
13,
198,
10619,
31631,
13,
198,
198,
31631,
300,
23047,
62,
14269,
3969,
30023,
2538,
10979,
6234,
13,
198,
220,
337,
36252,
9058,
13,
198,
220,
220,
220,
2005,
796,
12682,
331,
62,
35836,
62,
14269,
3969,
7,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
318,
62,
7784,
13,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
7784,
7,
2005,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
2198,
62,
48277,
13,
198,
220,
220,
220,
2005,
3784,
88,
62,
361,
62,
35836,
62,
14269,
3969,
93,
33327,
7,
1611,
796,
331,
62,
9122,
62,
8692,
14804,
66,
62,
18224,
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,
40653,
220,
220,
796,
10148,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
719,
796,
2005,
3784,
88,
62,
361,
62,
35836,
62,
14269,
3969,
93,
1136,
62,
17618,
62,
48277,
7,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
352,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
719,
796,
2005,
3784,
88,
62,
361,
62,
35836,
62,
14269,
3969,
93,
1136,
62,
17618,
62,
40539,
654,
7,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
657,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
719,
796,
2005,
3784,
88,
62,
361,
62,
35836,
62,
14269,
3969,
93,
1136,
62,
17618,
62,
17815,
7,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
657,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
719,
796,
2005,
3784,
88,
62,
361,
62,
35836,
62,
14269,
3969,
93,
1136,
62,
17618,
62,
7752,
12003,
62,
15944,
7,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
657,
6739,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
2198,
62,
40539,
654,
13,
198,
220,
220,
220,
2005,
3784,
88,
62,
361,
62,
35836,
62,
14269,
3969,
93,
33327,
7,
1611,
796,
331,
62,
9122,
62,
8692,
14804,
66,
62,
43917,
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,
40653,
220,
220,
796,
10148,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
719,
796,
2005,
3784,
88,
62,
361,
62,
35836,
62,
14269,
3969,
93,
1136,
62,
17618,
62,
48277,
7,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
657,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
719,
796,
2005,
3784,
88,
62,
361,
62,
35836,
62,
14269,
3969,
93,
1136,
62,
17618,
62,
40539,
654,
7,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
352,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
719,
796,
2005,
3784,
88,
62,
361,
62,
35836,
62,
14269,
3969,
93,
1136,
62,
17618,
62,
17815,
7,
1267,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1033,
796,
657,
6739,
628,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
719,
796,
2005,
3784,
88,
62,
361,
62,
35836,
62,
14269,
3969,
93,
1136,
62,
17618,
62,
7752,
12003,
62,
15944,
7,
1267,
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,
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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
] |
*---------------------------------------------------------------------*
* view related FORM routines
* generation date: 12.02.2022 at 10:47:26
* view maintenance generator version: #001407#
*---------------------------------------------------------------------*
* base table related FORM-routines.............
INCLUDE LSVIMFTX .
| [
9,
10097,
30934,
9,
198,
9,
220,
220,
220,
1570,
3519,
49144,
31878,
198,
9,
220,
220,
5270,
3128,
25,
1105,
13,
2999,
13,
1238,
1828,
379,
838,
25,
2857,
25,
2075,
198,
9,
220,
220,
1570,
9262,
17301,
2196,
25,
1303,
405,
1415,
2998,
2,
198,
9,
10097,
30934,
9,
198,
198,
9,
2779,
3084,
3519,
49144,
12,
81,
448,
1127,
44274,
198,
1268,
5097,
52,
7206,
30948,
53,
3955,
9792,
55,
764,
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
] |
FUNCTION-POOL ZABAPGIT_REVIEW. "MESSAGE-ID ..
* INCLUDE LZABAPGIT_REVIEWD... " Local class definition
| [
42296,
4177,
2849,
12,
16402,
3535,
1168,
6242,
2969,
38,
2043,
62,
2200,
28206,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
44,
1546,
4090,
8264,
12,
2389,
11485,
198,
198,
9,
3268,
5097,
52,
7206,
406,
57,
6242,
2969,
38,
2043,
62,
2200,
28206,
35,
986,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
366,
10714,
1398,
6770,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS ltcl_run_checks DEFINITION DEFERRED.
CLASS zcl_abapgit_file_status DEFINITION LOCAL FRIENDS ltcl_run_checks.
CLASS ltcl_run_checks DEFINITION FOR TESTING RISK LEVEL HARMLESS
DURATION SHORT FINAL.
PRIVATE SECTION.
DATA: mt_results TYPE zif_abapgit_definitions=>ty_results_tt,
mo_dot TYPE REF TO zcl_abapgit_dot_abapgit,
mi_log TYPE REF TO zif_abapgit_log.
METHODS:
append_result IMPORTING iv_obj_type TYPE trobjtype
iv_obj_name TYPE sobj_name
iv_match TYPE abap_bool
iv_lstate TYPE char1
iv_rstate TYPE char1
iv_package TYPE devclass
iv_path TYPE string
iv_filename TYPE string
iv_packmove TYPE abap_bool OPTIONAL,
setup,
positive FOR TESTING RAISING zcx_abapgit_exception,
neg_diff_path_for_same_obj FOR TESTING RAISING zcx_abapgit_exception,
neg_incorrect_path_vs_pack FOR TESTING RAISING zcx_abapgit_exception,
neg_similar_filenames FOR TESTING RAISING zcx_abapgit_exception,
neg_empty_filenames FOR TESTING RAISING zcx_abapgit_exception,
package_move FOR TESTING RAISING zcx_abapgit_exception,
check_namespace FOR TESTING RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS ltcl_run_checks IMPLEMENTATION.
METHOD append_result.
DATA ls_result LIKE LINE OF mt_results.
ls_result-inactive = abap_false.
ls_result-obj_type = iv_obj_type.
ls_result-obj_name = iv_obj_name.
ls_result-match = iv_match.
ls_result-lstate = iv_lstate.
ls_result-rstate = iv_rstate.
ls_result-package = iv_package.
ls_result-path = iv_path.
ls_result-filename = iv_filename.
ls_result-packmove = iv_packmove.
APPEND ls_result TO mt_results.
ENDMETHOD.
METHOD setup.
CREATE OBJECT mi_log TYPE zcl_abapgit_log.
mo_dot = zcl_abapgit_dot_abapgit=>build_default( ).
mo_dot->set_starting_folder( '/' ). " assumed by unit tests
ENDMETHOD.
METHOD positive.
" 0 Positive
append_result( iv_obj_type = 'CLAS'
iv_obj_name = 'ZCLASS1'
iv_match = ' '
iv_lstate = ' '
iv_rstate = 'A'
iv_package = '$Z$'
iv_path = '/'
iv_filename = 'zclass1.clas.abap' ).
append_result( iv_obj_type = 'CLAS'
iv_obj_name = 'ZCLASS1'
iv_match = 'X'
iv_lstate = ' '
iv_rstate = ' '
iv_package = '$Z$'
iv_path = '/'
iv_filename = 'zclass1.clas.xml' ).
append_result( iv_obj_type = 'DOMA'
iv_obj_name = 'ZDOMA1'
iv_match = 'X'
iv_lstate = ' '
iv_rstate = ' '
iv_package = '$Z$'
iv_path = '/'
iv_filename = 'zdoma1.doma.xml' ).
append_result( iv_obj_type = 'DOMA'
iv_obj_name = 'ZDOMA2'
iv_match = ' '
iv_lstate = 'M'
iv_rstate = ' '
iv_package = '$Z$'
iv_path = '/'
iv_filename = 'zdoma2.doma.xml' ).
zcl_abapgit_file_status=>run_checks(
ii_log = mi_log
it_results = mt_results
io_dot = mo_dot
iv_top = '$Z$' ).
cl_abap_unit_assert=>assert_equals(
act = mi_log->count( )
exp = 0 ).
ENDMETHOD.
METHOD neg_diff_path_for_same_obj.
" 1 Negative, different path for same object
append_result( iv_obj_type = 'CLAS'
iv_obj_name = 'ZCLASS1'
iv_match = ' '
iv_lstate = ' '
iv_rstate = 'A'
iv_package = '$Z$'
iv_path = '/'
iv_filename = 'zclass1.clas.abap' ).
append_result( iv_obj_type = 'CLAS'
iv_obj_name = 'ZCLASS1'
iv_match = 'X'
iv_lstate = ' '
iv_rstate = ' '
iv_package = '$Z$'
iv_path = '/sub'
iv_filename = 'zclass1.clas.xml' ).
append_result( iv_obj_type = 'DOMA'
iv_obj_name = 'ZDOMA1'
iv_match = 'X'
iv_lstate = ' '
iv_rstate = ' '
iv_package = '$Z$'
iv_path = '/'
iv_filename = 'zdoma1.doma.xml' ).
append_result( iv_obj_type = 'DOMA'
iv_obj_name = 'ZDOMA2'
iv_match = ' '
iv_lstate = 'M'
iv_rstate = ' '
iv_package = '$Z$'
iv_path = '/'
iv_filename = 'zdoma2.doma.xml' ).
zcl_abapgit_file_status=>run_checks(
ii_log = mi_log
it_results = mt_results
io_dot = mo_dot
iv_top = '$Z$' ).
" This one is not pure - incorrect path also triggers path vs package check
cl_abap_unit_assert=>assert_equals(
act = mi_log->count( )
exp = 2 ).
cl_abap_unit_assert=>assert_equals(
act = mi_log->has_rc( '1' )
exp = abap_true ).
ENDMETHOD.
METHOD neg_incorrect_path_vs_pack.
" 2 Negative, incorrect path vs package
append_result( iv_obj_type = 'CLAS'
iv_obj_name = '$$ZCLASS1'
iv_match = ' '
iv_lstate = ' '
iv_rstate = 'A'
iv_package = '$Z$'
iv_path = '/'
iv_filename = '$$zclass1.clas.abap' ).
append_result( iv_obj_type = 'CLAS'
iv_obj_name = '$$ZCLASS1'
iv_match = 'X'
iv_lstate = ' '
iv_rstate = ' '
iv_package = '$Z$'
iv_path = '/'
iv_filename = '$$zclass1.clas.xml' ).
append_result( iv_obj_type = 'DOMA'
iv_obj_name = '$$ZDOMA1'
iv_match = 'X'
iv_lstate = ' '
iv_rstate = ' '
iv_package = '$Z$'
iv_path = '/sub'
iv_filename = '$$zdoma1.doma.xml' ).
append_result( iv_obj_type = 'DOMA'
iv_obj_name = '$$ZDOMA2'
iv_match = ' '
iv_lstate = 'M'
iv_rstate = ' '
iv_package = '$Z$'
iv_path = '/'
iv_filename = '$$zdoma2.doma.xml' ).
zcl_abapgit_file_status=>run_checks(
ii_log = mi_log
it_results = mt_results
io_dot = mo_dot
iv_top = '$Z$' ).
cl_abap_unit_assert=>assert_equals(
act = mi_log->count( )
exp = 1 ).
cl_abap_unit_assert=>assert_equals(
act = mi_log->has_rc( '2' )
exp = abap_true ).
ENDMETHOD.
METHOD neg_similar_filenames.
" 3 Negative, similar filenames
append_result( iv_obj_type = 'CLAS'
iv_obj_name = '$$ZCLASS1'
iv_match = ' '
iv_lstate = ' '
iv_rstate = 'A'
iv_package = '$Z$'
iv_path = '/'
iv_filename = '$$zclass1.clas.abap' ).
append_result( iv_obj_type = 'CLAS'
iv_obj_name = '$$ZCLASS1'
iv_match = 'X'
iv_lstate = ' '
iv_rstate = ' '
iv_package = '$Z$'
iv_path = '/'
iv_filename = '$$zclass1.clas.xml' ).
append_result( iv_obj_type = 'DOMA'
iv_obj_name = '$$ZDOMA1'
iv_match = 'X'
iv_lstate = ' '
iv_rstate = ' '
iv_package = '$Z$'
iv_path = '/'
iv_filename = '$$zdoma1.doma.xml' ).
append_result( iv_obj_type = 'DOMA'
iv_obj_name = '$$ZDOMA2'
iv_match = ' '
iv_lstate = 'M'
iv_rstate = ' '
iv_package = '$Z$'
iv_path = '/'
iv_filename = '$$zdoma1.doma.xml' ).
zcl_abapgit_file_status=>run_checks(
ii_log = mi_log
it_results = mt_results
io_dot = mo_dot
iv_top = '$Z$' ).
cl_abap_unit_assert=>assert_equals(
act = mi_log->count( )
exp = 1 ).
cl_abap_unit_assert=>assert_equals(
act = mi_log->has_rc( '3' )
exp = abap_true ).
ENDMETHOD.
METHOD neg_empty_filenames.
" 4 Negative, empty filenames
append_result( iv_obj_type = 'CLAS'
iv_obj_name = '$$ZCLASS1'
iv_match = ' '
iv_lstate = ' '
iv_rstate = 'A'
iv_package = '$Z$'
iv_path = '/'
iv_filename = '$$zclass1.clas.abap' ).
append_result( iv_obj_type = 'CLAS'
iv_obj_name = '$$ZCLASS1'
iv_match = 'X'
iv_lstate = ' '
iv_rstate = ' '
iv_package = '$Z$'
iv_path = '/'
iv_filename = '$$zclass1.clas.xml' ).
append_result( iv_obj_type = 'DOMA'
iv_obj_name = '$$ZDOMA1'
iv_match = 'X'
iv_lstate = ' '
iv_rstate = ' '
iv_package = '$Z$'
iv_path = '/'
iv_filename = '' ).
zcl_abapgit_file_status=>run_checks(
ii_log = mi_log
it_results = mt_results
io_dot = mo_dot
iv_top = '$Z$' ).
cl_abap_unit_assert=>assert_equals(
act = mi_log->count( )
exp = 1 ).
cl_abap_unit_assert=>assert_equals(
act = mi_log->has_rc( '4' )
exp = abap_true ).
ENDMETHOD.
METHOD package_move.
" 5 Changed package assignment
append_result( iv_obj_type = 'CLAS'
iv_obj_name = 'ZCLASS1'
iv_match = ' '
iv_lstate = ' '
iv_rstate = 'A'
iv_package = '$Z$'
iv_path = '/'
iv_filename = 'zclass1.clas.abap'
iv_packmove = 'X' ).
append_result( iv_obj_type = 'CLAS'
iv_obj_name = 'ZCLASS1'
iv_match = ' '
iv_lstate = 'A'
iv_rstate = ' '
iv_package = '$Z$SUB'
iv_path = '/sub'
iv_filename = 'zclass1.clas.abap'
iv_packmove = 'X' ).
append_result( iv_obj_type = 'CLAS'
iv_obj_name = 'ZCLASS1'
iv_match = ' '
iv_lstate = ' '
iv_rstate = 'A'
iv_package = '$Z$'
iv_path = '/'
iv_filename = 'zclass1.clas.xml'
iv_packmove = 'X' ).
append_result( iv_obj_type = 'CLAS'
iv_obj_name = 'ZCLASS1'
iv_match = ' '
iv_lstate = 'A'
iv_rstate = ' '
iv_package = '$Z$SUB'
iv_path = '/sub'
iv_filename = 'zclass1.clas.xml'
iv_packmove = 'X' ).
append_result( iv_obj_type = 'DOMA'
iv_obj_name = 'ZDOMA1'
iv_match = ' '
iv_lstate = 'A'
iv_rstate = ' '
iv_package = '$Z$'
iv_path = '/'
iv_filename = 'zdoma1.doma.xml'
iv_packmove = 'X' ).
append_result( iv_obj_type = 'DOMA'
iv_obj_name = 'ZDOMA2'
iv_match = ' '
iv_lstate = ' '
iv_rstate = 'A'
iv_package = '$Z$SUB'
iv_path = '/sub'
iv_filename = 'zdoma1.doma.xml'
iv_packmove = 'X' ).
zcl_abapgit_file_status=>run_checks(
ii_log = mi_log
it_results = mt_results
io_dot = mo_dot
iv_top = '$Z$' ).
" Three files, but only two msg (for two changed objects)
cl_abap_unit_assert=>assert_equals(
act = mi_log->count( )
exp = 2 ).
cl_abap_unit_assert=>assert_equals(
act = mi_log->has_rc( '5' )
exp = abap_true ).
ENDMETHOD.
METHOD check_namespace.
" 6 Missing namespace
append_result( iv_obj_type = 'CLAS'
iv_obj_name = '/NOTEXIST/ZCLASS1'
iv_match = ' '
iv_lstate = ' '
iv_rstate = 'A'
iv_package = '/NOTEXIST/Z'
iv_path = '/'
iv_filename = '#notexist#zclass1.clas.xml' ).
zcl_abapgit_file_status=>run_checks(
ii_log = mi_log
it_results = mt_results
io_dot = mo_dot
iv_top = '/NOTEXIST/Z' ).
cl_abap_unit_assert=>assert_equals(
act = mi_log->count( )
exp = 1 ).
cl_abap_unit_assert=>assert_equals(
act = mi_log->has_rc( '6' )
exp = abap_true ).
ENDMETHOD.
ENDCLASS.
CLASS lcl_status_result DEFINITION.
PUBLIC SECTION.
METHODS:
constructor
IMPORTING
it_results TYPE zif_abapgit_definitions=>ty_results_tt,
get_line
IMPORTING
iv_line TYPE i
RETURNING
VALUE(rs_data) TYPE zif_abapgit_definitions=>ty_result,
assert_lines
IMPORTING
iv_lines TYPE i
iv_msg TYPE csequence OPTIONAL.
PRIVATE SECTION.
DATA: mt_results TYPE zif_abapgit_definitions=>ty_results_tt.
ENDCLASS.
CLASS lcl_status_result IMPLEMENTATION.
METHOD constructor.
mt_results = it_results.
SORT mt_results BY path filename.
ENDMETHOD.
METHOD get_line.
READ TABLE mt_results INDEX iv_line INTO rs_data.
cl_abap_unit_assert=>assert_subrc( ).
ENDMETHOD.
METHOD assert_lines.
cl_abap_unit_assert=>assert_equals(
act = lines( mt_results )
exp = iv_lines
msg = iv_msg ).
ENDMETHOD.
ENDCLASS.
CLASS ltcl_status_helper DEFINITION DEFERRED.
CLASS zcl_abapgit_file_status DEFINITION LOCAL FRIENDS ltcl_status_helper.
CLASS ltcl_status_helper DEFINITION FOR TESTING.
PUBLIC SECTION.
INTERFACES:
zif_abapgit_tadir.
METHODS:
constructor,
add_tadir
IMPORTING
iv_obj_type TYPE tadir-object
iv_obj_name TYPE tadir-obj_name
iv_devclass TYPE tadir-devclass,
add_remote
IMPORTING
iv_path TYPE string DEFAULT '/'
iv_filename TYPE string
iv_sha1 TYPE zif_abapgit_definitions=>ty_sha1,
add_local
IMPORTING
iv_path TYPE string DEFAULT '/'
iv_filename TYPE string
iv_sha1 TYPE zif_abapgit_definitions=>ty_sha1
iv_obj_type TYPE tadir-object OPTIONAL
iv_obj_name TYPE tadir-obj_name OPTIONAL
iv_devclass TYPE devclass DEFAULT '$Z$',
add_state
IMPORTING
iv_path TYPE string DEFAULT '/'
iv_filename TYPE string
iv_sha1 TYPE zif_abapgit_definitions=>ty_sha1,
run
IMPORTING
iv_devclass TYPE devclass DEFAULT '$Z$'
RETURNING
VALUE(ro_result) TYPE REF TO lcl_status_result
RAISING
zcx_abapgit_exception.
PRIVATE SECTION.
TYPES: BEGIN OF ty_tadir,
obj_type TYPE tadir-object,
obj_name TYPE tadir-obj_name,
devclass TYPE tadir-devclass,
END OF ty_tadir.
DATA:
mt_tadir TYPE STANDARD TABLE OF ty_tadir WITH DEFAULT KEY,
mt_local TYPE zif_abapgit_definitions=>ty_files_item_tt,
mt_remote TYPE zif_abapgit_definitions=>ty_files_tt,
mt_state TYPE zif_abapgit_definitions=>ty_file_signatures_tt.
ENDCLASS.
CLASS ltcl_status_helper IMPLEMENTATION.
METHOD constructor.
zcl_abapgit_injector=>set_tadir( me ).
ENDMETHOD.
METHOD add_tadir.
FIELD-SYMBOLS: <ls_tadir> LIKE LINE OF mt_tadir.
APPEND INITIAL LINE TO mt_tadir ASSIGNING <ls_tadir>.
<ls_tadir>-obj_type = iv_obj_type.
<ls_tadir>-obj_name = iv_obj_name.
<ls_tadir>-devclass = iv_devclass.
ENDMETHOD.
METHOD zif_abapgit_tadir~get_object_package.
DATA: ls_tadir LIKE LINE OF mt_tadir.
IF lines( mt_tadir ) > 0.
READ TABLE mt_tadir INTO ls_tadir WITH KEY
obj_type = iv_object
obj_name = iv_obj_name.
cl_abap_unit_assert=>assert_subrc( ).
rv_devclass = ls_tadir-devclass.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_tadir~read.
cl_abap_unit_assert=>fail( ).
ENDMETHOD.
METHOD zif_abapgit_tadir~read_single.
cl_abap_unit_assert=>fail( ).
ENDMETHOD.
METHOD add_remote.
FIELD-SYMBOLS: <ls_remote> LIKE LINE OF mt_remote.
APPEND INITIAL LINE TO mt_remote ASSIGNING <ls_remote>.
<ls_remote>-path = iv_path.
<ls_remote>-filename = iv_filename.
<ls_remote>-sha1 = iv_sha1.
ENDMETHOD.
METHOD add_local.
FIELD-SYMBOLS: <ls_local> LIKE LINE OF mt_local.
APPEND INITIAL LINE TO mt_local ASSIGNING <ls_local>.
<ls_local>-item-obj_type = iv_obj_type.
<ls_local>-item-obj_name = iv_obj_name.
<ls_local>-item-devclass = iv_devclass.
<ls_local>-file-path = iv_path.
<ls_local>-file-filename = iv_filename.
<ls_local>-file-sha1 = iv_sha1.
ENDMETHOD.
METHOD add_state.
FIELD-SYMBOLS: <ls_state> LIKE LINE OF mt_state.
APPEND INITIAL LINE TO mt_state ASSIGNING <ls_state>.
<ls_state>-path = iv_path.
<ls_state>-filename = iv_filename.
<ls_state>-sha1 = iv_sha1.
ENDMETHOD.
METHOD run.
DATA: lt_results TYPE zif_abapgit_definitions=>ty_results_tt,
lo_dot TYPE REF TO zcl_abapgit_dot_abapgit.
lo_dot = zcl_abapgit_dot_abapgit=>build_default( ).
lo_dot->set_starting_folder( '/' ). " assumed by unit tests
lt_results = zcl_abapgit_file_status=>calculate_status(
iv_devclass = iv_devclass
io_dot = lo_dot
it_local = mt_local
it_remote = mt_remote
it_cur_state = mt_state ).
CREATE OBJECT ro_result
EXPORTING
it_results = lt_results.
ENDMETHOD.
ENDCLASS.
CLASS ltcl_calculate_status DEFINITION DEFERRED.
CLASS zcl_abapgit_file_status DEFINITION LOCAL FRIENDS ltcl_calculate_status.
CLASS ltcl_calculate_status DEFINITION FOR TESTING RISK LEVEL HARMLESS
DURATION SHORT FINAL.
PRIVATE SECTION.
DATA:
mo_helper TYPE REF TO ltcl_status_helper,
mo_result TYPE REF TO lcl_status_result.
METHODS:
setup,
only_remote FOR TESTING RAISING zcx_abapgit_exception,
only_local FOR TESTING RAISING zcx_abapgit_exception,
match FOR TESTING RAISING zcx_abapgit_exception,
diff FOR TESTING RAISING zcx_abapgit_exception,
moved FOR TESTING RAISING zcx_abapgit_exception,
local_outside_main FOR TESTING RAISING zcx_abapgit_exception,
complete FOR TESTING RAISING zcx_abapgit_exception,
complete_local,
complete_remote,
complete_state,
deleted_remotely FOR TESTING RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS ltcl_calculate_status IMPLEMENTATION.
METHOD setup.
CREATE OBJECT mo_helper.
ENDMETHOD.
METHOD moved.
mo_helper->add_local(
iv_obj_type = 'DOMA'
iv_obj_name = '$$ZDOMA1'
iv_filename = '$$zdoma1.doma.xml'
iv_path = '/foo/'
iv_devclass = 'FOO'
iv_sha1 = 'D1' ).
mo_helper->add_remote(
iv_filename = '$$zdoma1.doma.xml'
iv_path = '/bar/'
iv_sha1 = 'D1' ).
mo_helper->add_tadir(
iv_obj_type = 'DOMA'
iv_obj_name = '$$ZDOMA1'
iv_devclass = 'FOO' ).
mo_result = mo_helper->run( iv_devclass = 'FOO' ).
mo_result->assert_lines(
iv_lines = 2
iv_msg = 'there must be a status calculated for both files, they are in different folders' ).
ENDMETHOD.
METHOD only_remote.
mo_helper->add_remote(
iv_filename = '$$zdoma1.doma.xml'
iv_sha1 = 'D1' ).
mo_result = mo_helper->run( ).
mo_result->assert_lines( 1 ).
cl_abap_unit_assert=>assert_equals(
act = mo_result->get_line( 1 )-rstate
exp = zif_abapgit_definitions=>c_state-added ).
ENDMETHOD.
METHOD only_local.
mo_helper->add_local(
iv_obj_type = 'DOMA'
iv_obj_name = '$$ZDOMA1'
iv_filename = '$$zdoma1.doma.xml'
iv_sha1 = 'D1' ).
mo_result = mo_helper->run( ).
mo_result->assert_lines( 1 ).
cl_abap_unit_assert=>assert_equals(
act = mo_result->get_line( 1 )-lstate
exp = zif_abapgit_definitions=>c_state-added ).
ENDMETHOD.
METHOD match.
mo_helper->add_local(
iv_obj_type = 'DOMA'
iv_obj_name = '$$ZDOMA1'
iv_filename = '$$zdoma1.doma.xml'
iv_sha1 = 'D1' ).
mo_helper->add_remote(
iv_filename = '$$zdoma1.doma.xml'
iv_sha1 = 'D1' ).
mo_result = mo_helper->run( ).
mo_result->assert_lines( 1 ).
cl_abap_unit_assert=>assert_equals(
act = mo_result->get_line( 1 )-match
exp = abap_true ).
ENDMETHOD.
METHOD diff.
mo_helper->add_local(
iv_obj_type = 'DOMA'
iv_obj_name = '$$ZDOMA1'
iv_filename = '$$zdoma1.doma.xml'
iv_sha1 = '12345' ).
mo_helper->add_remote(
iv_filename = '$$zdoma1.doma.xml'
iv_sha1 = '54321' ).
mo_result = mo_helper->run( ).
mo_result->assert_lines( 1 ).
cl_abap_unit_assert=>assert_equals(
act = mo_result->get_line( 1 )-lstate
exp = zif_abapgit_definitions=>c_state-modified ).
cl_abap_unit_assert=>assert_equals(
act = mo_result->get_line( 1 )-rstate
exp = zif_abapgit_definitions=>c_state-modified ).
ENDMETHOD.
METHOD local_outside_main.
mo_helper->add_tadir(
iv_obj_type = 'DOMA'
iv_obj_name = '$$ZDOMA1'
iv_devclass = '$OUTSIDE$' ).
mo_helper->add_remote(
iv_filename = '$$zdoma1.doma.xml'
iv_sha1 = '54321' ).
mo_result = mo_helper->run( ).
mo_result->assert_lines( 1 ).
" it should appear as not existing locally
cl_abap_unit_assert=>assert_equals(
act = mo_result->get_line( 1 )-rstate
exp = zif_abapgit_definitions=>c_state-added ).
ENDMETHOD.
METHOD complete_local.
mo_helper->add_local(
iv_path = '/'
iv_filename = '.abapgit.xml'
iv_sha1 = '1017' ).
mo_helper->add_local(
iv_path = '/src/'
iv_filename = 'ztest_created_locally.prog.abap'
iv_sha1 = '1001' ).
mo_helper->add_local(
iv_path = '/src/'
iv_filename = 'ztest_created_locally.prog.xml'
iv_sha1 = '1022' ).
mo_helper->add_local(
iv_path = '/src/'
iv_filename = 'ztest_deleted_remotely.prog.abap'
iv_sha1 = '1016' ).
mo_helper->add_local(
iv_path = '/src/'
iv_filename = 'ztest_deleted_remotely.prog.xml'
iv_sha1 = '1003' ).
mo_helper->add_local(
iv_path = '/src/'
iv_filename = 'ztest_modified_both.prog.abap'
iv_sha1 = '1028' ).
mo_helper->add_local(
iv_path = '/src/'
iv_filename = 'ztest_modified_both.prog.xml'
iv_sha1 = '1032' ).
mo_helper->add_local(
iv_path = '/src/'
iv_filename = 'ztest_modified_locally.prog.abap'
iv_sha1 = '1023' ).
mo_helper->add_local(
iv_path = '/src/'
iv_filename = 'ztest_modified_locally.prog.xml'
iv_sha1 = '1033' ).
mo_helper->add_local(
iv_path = '/src/'
iv_filename = 'ztest_modified_remotely.prog.abap'
iv_sha1 = '1018' ).
mo_helper->add_local(
iv_path = '/src/'
iv_filename = 'ztest_modified_remotely.prog.xml'
iv_sha1 = '1011' ).
mo_helper->add_local(
iv_path = '/src/'
iv_filename = 'ztest_mod_del.prog.abap'
iv_sha1 = '1012' ).
mo_helper->add_local(
iv_path = '/src/'
iv_filename = 'ztest_mod_del.prog.xml'
iv_sha1 = '1006' ).
mo_helper->add_local(
iv_path = '/src/'
iv_filename = 'package.devc.xml'
iv_sha1 = '1027' ).
mo_helper->add_local(
iv_path = '/src/sub/'
iv_filename = 'ztest_move_package.prog.xml'
iv_sha1 = '1040' ).
mo_helper->add_local(
iv_path = '/src/sub/'
iv_filename = 'package.devc.xml'
iv_sha1 = '1041' ).
mo_helper->add_local(
iv_path = '/src/sub/'
iv_filename = 'ztest_move_package_w_change.prog.xml'
iv_sha1 = '1042' ).
ENDMETHOD.
METHOD complete_remote.
mo_helper->add_remote(
iv_path = '/'
iv_filename = '.abapgit.xml'
iv_sha1 = '1017' ).
mo_helper->add_remote(
iv_path = '/'
iv_filename = 'README.md'
iv_sha1 = '1007' ).
mo_helper->add_remote(
iv_path = '/src/'
iv_filename = 'package.devc.xml'
iv_sha1 = '1027' ).
mo_helper->add_remote(
iv_path = '/src/'
iv_filename = 'ztest_created_remotely.prog.abap'
iv_sha1 = '1025' ).
mo_helper->add_remote(
iv_path = '/src/'
iv_filename = 'ztest_created_remotely.prog.xml'
iv_sha1 = '1015' ).
mo_helper->add_remote(
iv_path = '/src/'
iv_filename = 'ztest_del_mod.prog.abap'
iv_sha1 = '1024' ).
mo_helper->add_remote(
iv_path = '/src/'
iv_filename = 'ztest_del_mod.prog.xml'
iv_sha1 = '1013' ).
mo_helper->add_remote(
iv_path = '/src/'
iv_filename = 'ztest_deleted_locally.prog.abap'
iv_sha1 = '1008' ).
mo_helper->add_remote(
iv_path = '/src/'
iv_filename = 'ztest_deleted_locally.prog.xml'
iv_sha1 = '1009' ).
mo_helper->add_remote(
iv_path = '/src/'
iv_filename = 'ztest_modified_both.prog.abap'
iv_sha1 = '1002' ).
mo_helper->add_remote(
iv_path = '/src/'
iv_filename = 'ztest_modified_both.prog.xml'
iv_sha1 = '1030' ).
mo_helper->add_remote(
iv_path = '/src/'
iv_filename = 'ztest_modified_locally.prog.abap'
iv_sha1 = '1026' ).
mo_helper->add_remote(
iv_path = '/src/'
iv_filename = 'ztest_modified_locally.prog.xml'
iv_sha1 = '1021' ).
mo_helper->add_remote(
iv_path = '/src/'
iv_filename = 'ztest_modified_remotely.prog.abap'
iv_sha1 = '1019' ).
mo_helper->add_remote(
iv_path = '/src/'
iv_filename = 'ztest_modified_remotely.prog.xml'
iv_sha1 = '1031' ).
mo_helper->add_remote(
iv_path = '/src/'
iv_filename = 'ztest_move_package.prog.xml'
iv_sha1 = '1040' ).
mo_helper->add_remote(
iv_path = '/src/sub/'
iv_filename = 'package.devc.xml'
iv_sha1 = '1041' ).
mo_helper->add_remote(
iv_path = '/src/'
iv_filename = 'ztest_move_package_w_change.prog.xml'
iv_sha1 = '2042' ).
ENDMETHOD.
METHOD complete_state.
mo_helper->add_state(
iv_path = '/'
iv_filename = '.abapgit.xml'
iv_sha1 = '1017' ).
mo_helper->add_state(
iv_path = '/src/'
iv_filename = 'package.devc.xml'
iv_sha1 = '1027' ).
mo_helper->add_state(
iv_path = '/src/'
iv_filename = 'ztest_deleted_locally.prog.abap'
iv_sha1 = '1008' ).
mo_helper->add_state(
iv_path = '/src/'
iv_filename = 'ztest_deleted_locally.prog.xml'
iv_sha1 = '1009' ).
mo_helper->add_state(
iv_path = '/src/'
iv_filename = 'ztest_deleted_remotely.prog.abap'
iv_sha1 = '1016' ).
mo_helper->add_state(
iv_path = '/src/'
iv_filename = 'ztest_deleted_remotely.prog.xml'
iv_sha1 = '1003' ).
mo_helper->add_state(
iv_path = '/src/'
iv_filename = 'ztest_del_mod.prog.abap'
iv_sha1 = '1020' ).
mo_helper->add_state(
iv_path = '/src/'
iv_filename = 'ztest_del_mod.prog.xml'
iv_sha1 = '1029' ).
mo_helper->add_state(
iv_path = '/src/'
iv_filename = 'ztest_modified_both.prog.abap'
iv_sha1 = '1010' ).
mo_helper->add_state(
iv_path = '/src/'
iv_filename = 'ztest_modified_both.prog.xml'
iv_sha1 = '1004' ).
mo_helper->add_state(
iv_path = '/src/'
iv_filename = 'ztest_modified_locally.prog.abap'
iv_sha1 = '1026' ).
mo_helper->add_state(
iv_path = '/src/'
iv_filename = 'ztest_modified_locally.prog.xml'
iv_sha1 = '1021' ).
mo_helper->add_state(
iv_path = '/src/'
iv_filename = 'ztest_modified_remotely.prog.abap'
iv_sha1 = '1018' ).
mo_helper->add_state(
iv_path = '/src/'
iv_filename = 'ztest_modified_remotely.prog.xml'
iv_sha1 = '1011' ).
mo_helper->add_state(
iv_path = '/src/'
iv_filename = 'ztest_mod_del.prog.abap'
iv_sha1 = '1014' ).
mo_helper->add_state(
iv_path = '/src/'
iv_filename = 'ztest_mod_del.prog.xml'
iv_sha1 = '1005' ).
mo_helper->add_state(
iv_path = '/src/sub/'
iv_filename = 'ztest_move_package.prog.xml'
iv_sha1 = '1040' ).
mo_helper->add_state(
iv_path = '/src/sub/'
iv_filename = 'package.devc.xml'
iv_sha1 = '1041' ).
mo_helper->add_state(
iv_path = '/src/sub/'
iv_filename = 'ztest_move_package_w_change.prog.xml'
iv_sha1 = '1042' ).
ENDMETHOD.
METHOD complete.
DATA:
ls_line TYPE zif_abapgit_definitions=>ty_result,
lv_act TYPE c LENGTH 4,
lv_exp TYPE c LENGTH 4.
complete_local( ).
complete_remote( ).
complete_state( ).
mo_result = mo_helper->run( ).
mo_result->assert_lines( 26 ).
DO 26 TIMES.
ls_line = mo_result->get_line( sy-index ).
lv_act+0(1) = ls_line-match.
lv_act+1(1) = ls_line-lstate.
lv_act+2(1) = ls_line-rstate.
lv_act+3(1) = ls_line-packmove.
CASE sy-index.
WHEN 1.
lv_exp = 'X '. " no changes
WHEN 2.
lv_exp = ' A'. " add remote
WHEN 3.
lv_exp = 'X '. " no change
WHEN 4 OR 5.
lv_exp = ' A '. " add local
WHEN 6 OR 7.
lv_exp = ' A'. " add remote
WHEN 8 OR 9.
lv_exp = ' DM'. " delete local, modify remote
WHEN 10 OR 11.
lv_exp = ' D '. " delete local
WHEN 12 OR 13.
lv_exp = ' D'. " delete remote
WHEN 14 OR 15.
lv_exp = ' MD'. " modify local, delete remote
WHEN 16 OR 17.
lv_exp = ' MM'. " modify both sides
WHEN 18 OR 19.
lv_exp = ' M '. " modify local
WHEN 20 OR 21.
lv_exp = ' M'. " modify remote
WHEN 22.
lv_exp = ' D X'. " package move (no change)
WHEN 23.
lv_exp = ' D '. " package move with change
WHEN 24.
lv_exp = 'X '. " no chagen
WHEN 25.
lv_exp = ' A X'. " package move (no change)
WHEN 26.
lv_exp = ' A '. " package move with change
ENDCASE.
cl_abap_unit_assert=>assert_equals(
act = lv_act
exp = lv_exp
msg = |Line { sy-index }: { ls_line-filename }| ).
ENDDO.
ENDMETHOD.
METHOD deleted_remotely.
mo_helper->add_local(
iv_path = '/src/'
iv_filename = 'ztest_deleted_remotely.prog.abap'
iv_sha1 = '1016' ).
mo_helper->add_state(
iv_path = '/src/'
iv_filename = 'ztest_deleted_remotely.prog.abap'
iv_sha1 = '2016' ). " different checksum
mo_result = mo_helper->run( ).
mo_result->assert_lines( 1 ).
" it should appear as deleted remotely
cl_abap_unit_assert=>assert_equals(
act = mo_result->get_line( 1 )-rstate
exp = zif_abapgit_definitions=>c_state-deleted ).
ENDMETHOD.
ENDCLASS.
| [
31631,
300,
83,
565,
62,
5143,
62,
42116,
5550,
20032,
17941,
23449,
1137,
22083,
13,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
7753,
62,
13376,
5550,
20032,
17941,
37347,
1847,
48167,
1677,
5258,
300,
83,
565,
62,
5143,
62,
42116,
13,
198,
198,
31631,
300,
83,
565,
62,
5143,
62,
42116,
5550,
20032,
17941,
7473,
43001,
2751,
45698,
42,
49277,
43638,
5805,
7597,
198,
220,
360,
4261,
6234,
6006,
9863,
25261,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
45079,
62,
43420,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
43420,
62,
926,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
6941,
62,
26518,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21504,
62,
6404,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
24443,
62,
20274,
30023,
9863,
2751,
21628,
62,
26801,
62,
4906,
41876,
4161,
50007,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
26801,
62,
3672,
41876,
27355,
73,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
15699,
220,
220,
220,
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,
21628,
62,
75,
5219,
220,
220,
41876,
1149,
16,
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,
21628,
62,
81,
5219,
220,
220,
41876,
1149,
16,
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,
21628,
62,
26495,
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,
21628,
62,
6978,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
34345,
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,
21628,
62,
8002,
21084,
41876,
450,
499,
62,
30388,
39852,
2849,
1847,
11,
198,
220,
220,
220,
220,
220,
9058,
11,
198,
220,
220,
220,
220,
220,
3967,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
2469,
62,
26069,
62,
6978,
62,
1640,
62,
31642,
62,
26801,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
2469,
62,
1939,
47315,
62,
6978,
62,
14259,
62,
8002,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
2469,
62,
38610,
62,
10379,
268,
1047,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
2469,
62,
28920,
62,
10379,
268,
1047,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
5301,
62,
21084,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
2198,
62,
14933,
10223,
7473,
43001,
2751,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
198,
10619,
31631,
13,
198,
198,
31631,
300,
83,
565,
62,
5143,
62,
42116,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
24443,
62,
20274,
13,
628,
220,
220,
220,
42865,
43979,
62,
20274,
34178,
48920,
3963,
45079,
62,
43420,
13,
628,
220,
220,
220,
43979,
62,
20274,
12,
259,
5275,
796,
450,
499,
62,
9562,
13,
628,
220,
220,
220,
43979,
62,
20274,
12,
26801,
62,
4906,
796,
21628,
62,
26801,
62,
4906,
13,
198,
220,
220,
220,
43979,
62,
20274,
12,
26801,
62,
3672,
796,
21628,
62,
26801,
62,
3672,
13,
198,
220,
220,
220,
43979,
62,
20274,
12,
15699,
220,
220,
220,
796,
21628,
62,
15699,
13,
198,
220,
220,
220,
43979,
62,
20274,
12,
75,
5219,
220,
220,
796,
21628,
62,
75,
5219,
13,
198,
220,
220,
220,
43979,
62,
20274,
12,
81,
5219,
220,
220,
796,
21628,
62,
81,
5219,
13,
198,
220,
220,
220,
43979,
62,
20274,
12,
26495,
220,
796,
21628,
62,
26495,
13,
198,
220,
220,
220,
43979,
62,
20274,
12,
6978,
220,
220,
220,
220,
796,
21628,
62,
6978,
13,
198,
220,
220,
220,
43979,
62,
20274,
12,
34345,
796,
21628,
62,
34345,
13,
198,
220,
220,
220,
43979,
62,
20274,
12,
8002,
21084,
796,
21628,
62,
8002,
21084,
13,
628,
220,
220,
220,
43504,
10619,
43979,
62,
20274,
5390,
45079,
62,
43420,
13,
628,
220,
23578,
49273,
13,
628,
220,
337,
36252,
9058,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
21504,
62,
6404,
41876,
1976,
565,
62,
397,
499,
18300,
62,
6404,
13,
628,
220,
220,
220,
6941,
62,
26518,
796,
1976,
565,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
14804,
11249,
62,
12286,
7,
6739,
198,
220,
220,
220,
6941,
62,
26518,
3784,
2617,
62,
38690,
62,
43551,
7,
31051,
6
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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ecatt_download.
METHODS:
download REDEFINITION.
PROTECTED SECTION.
METHODS:
download_data REDEFINITION.
PRIVATE SECTION.
DATA:
mv_xml_stream TYPE xstring.
ENDCLASS.
CLASS zcl_abapgit_ecatt_config_downl IMPLEMENTATION.
METHOD download.
" Downport
DATA: lv_partyp TYPE string.
load_help = im_load_help.
typ = im_object_type.
TRY.
cl_apl_ecatt_object=>show_object(
EXPORTING
im_obj_type = im_object_type
im_name = im_object_name
im_version = im_object_version
IMPORTING
re_object = ecatt_object ).
CATCH cx_ecatt INTO ex_ecatt.
RETURN.
ENDTRY.
lv_partyp = cl_apl_ecatt_const=>params_type_par.
set_attributes_to_template( ).
ecatt_config ?= ecatt_object.
CALL METHOD ('SET_ECATT_OBJECTS_TO_TEMPLATE'). " doesn't exist in 702
* MS180406
set_var_mode_to_dom( ).
* ENDMS180406
get_general_params_data( im_params = ecatt_config->params
im_ptyp = lv_partyp ).
LOOP AT parm INTO wa_parm.
set_general_params_data_to_dom( ).
IF NOT wa_parm-val_type IS INITIAL.
set_deep_stru_to_dom( ecatt_config->params ).
set_deep_data_to_dom( im_params = ecatt_config->params
im_pindex = wa_parm-pindex ).
ENDIF.
ENDLOOP.
set_variants_to_dom( ecatt_config->params ).
download_data( ).
ENDMETHOD.
METHOD download_data.
" Downport
mv_xml_stream = zcl_abapgit_ecatt_helper=>download_data( template_over_all ).
ENDMETHOD.
METHOD zif_abapgit_ecatt_download~get_xml_stream.
rv_xml_stream = mv_xml_stream.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
721,
1078,
62,
11250,
62,
2902,
75,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
537,
62,
64,
489,
62,
721,
1078,
62,
11250,
62,
15002,
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,
721,
1078,
62,
15002,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
4321,
23848,
36,
20032,
17941,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
4321,
62,
7890,
23848,
36,
20032,
17941,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
285,
85,
62,
19875,
62,
5532,
41876,
2124,
8841,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
721,
1078,
62,
11250,
62,
2902,
75,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
4321,
13,
628,
220,
220,
220,
366,
5588,
634,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
3911,
4464,
41876,
4731,
13,
628,
220,
220,
220,
3440,
62,
16794,
796,
545,
62,
2220,
62,
16794,
13,
198,
220,
220,
220,
2170,
796,
545,
62,
15252,
62,
4906,
13,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
537,
62,
64,
489,
62,
721,
1078,
62,
15252,
14804,
12860,
62,
15252,
7,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
545,
62,
26801,
62,
4906,
796,
545,
62,
15252,
62,
4906,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
545,
62,
3672,
220,
220,
220,
220,
796,
545,
62,
15252,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
545,
62,
9641,
220,
796,
545,
62,
15252,
62,
9641,
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,
302,
62,
15252,
220,
220,
796,
9940,
1078,
62,
15252,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
721,
1078,
39319,
409,
62,
721,
1078,
13,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
27064,
13,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
220,
220,
300,
85,
62,
3911,
4464,
796,
537,
62,
64,
489,
62,
721,
1078,
62,
9979,
14804,
37266,
62,
4906,
62,
1845,
13,
628,
220,
220,
220,
900,
62,
1078,
7657,
62,
1462,
62,
28243,
7,
6739,
198,
220,
220,
220,
9940,
1078,
62,
11250,
5633,
28,
9940,
1078,
62,
15252,
13,
628,
220,
220,
220,
42815,
337,
36252,
19203,
28480,
62,
2943,
17139,
62,
9864,
41,
2943,
4694,
62,
10468,
62,
51,
3620,
6489,
6158,
27691,
366,
1595,
470,
2152,
287,
43379,
198,
198,
9,
6579,
15259,
29703,
198,
220,
220,
220,
900,
62,
7785,
62,
14171,
62,
1462,
62,
3438,
7,
6739,
198,
9,
23578,
5653,
15259,
29703,
198,
220,
220,
220,
651,
62,
24622,
62,
37266,
62,
7890,
7,
545,
62,
37266,
796,
9940,
1078,
62,
11250,
3784,
37266,
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,
545,
62,
457,
4464,
220,
220,
796,
300,
85,
62,
3911,
4464,
6739,
198,
220,
220,
220,
17579,
3185,
5161,
1582,
76,
39319,
2082,
62,
79,
1670,
13,
198,
220,
220,
220,
220,
220,
900,
62,
24622,
62,
37266,
62,
7890,
62,
1462,
62,
3438,
7,
6739,
198,
220,
220,
220,
220,
220,
16876,
5626,
2082,
62,
79,
1670,
12,
2100,
62,
4906,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
220,
220,
900,
62,
22089,
62,
19554,
62,
1462,
62,
3438,
7,
9940,
1078,
62,
11250,
3784,
37266,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
900,
62,
22089,
62,
7890,
62,
1462,
62,
3438,
7,
545,
62,
37266,
796,
9940,
1078,
62,
11250,
3784,
37266,
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,
545,
62,
79,
9630,
796,
2082,
62,
79,
1670,
12,
79,
9630,
6739,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
220,
220,
900,
62,
25641,
1187,
62,
1462,
62,
3438,
7,
9940,
1078,
62,
11250,
3784,
37266,
6739,
628,
220,
220,
220,
4321,
62,
7890,
7,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
4321,
62,
7890,
13,
628,
220,
220,
220,
366,
5588,
634,
628,
220,
220,
220,
285,
85,
62,
19875,
62,
5532,
796,
1976,
565,
62,
397,
499,
18300,
62,
721,
1078,
62,
2978,
525,
14804,
15002,
62,
7890,
7,
11055,
62,
2502,
62,
439,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
721,
1078,
62,
15002,
93,
1136,
62,
19875,
62,
5532,
13,
628,
220,
220,
220,
374,
85,
62,
19875,
62,
5532,
796,
285,
85,
62,
19875,
62,
5532,
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,
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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
] |
*&---------------------------------------------------------------------*
*& Report ZBUGTRACKER02
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zbugtracker01.
DATA: o_bug TYPE REF TO zcl_bug.
START-OF-SELECTION.
END-OF-SELECTION.
CALL FUNCTION 'ZBT_CREATE_BUG'
IMPORTING
bug = o_bug.
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
220,
1168,
12953,
5446,
8120,
1137,
2999,
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,
25456,
2213,
10735,
486,
13,
198,
198,
26947,
25,
267,
62,
25456,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
25456,
13,
198,
198,
2257,
7227,
12,
19238,
12,
46506,
2849,
13,
198,
198,
10619,
12,
19238,
12,
46506,
2849,
13,
628,
220,
42815,
29397,
4177,
2849,
705,
57,
19313,
62,
43387,
6158,
62,
12953,
6,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
5434,
796,
267,
62,
25456,
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
] |
CLASS zcl_glds_demo_switch_tests DEFINITION
PUBLIC
INHERITING FROM zcl_glds_demo_test_helper
ABSTRACT
CREATE PUBLIC
FOR TESTING
DURATION SHORT
RISK LEVEL HARMLESS .
PUBLIC SECTION.
METHODS constructor .
METHODS test_0 FOR TESTING .
METHODS test_1 FOR TESTING .
METHODS test_2 FOR TESTING .
METHODS test_3 FOR TESTING .
METHODS test_4 FOR TESTING .
METHODS test_5 FOR TESTING .
METHODS test_6 FOR TESTING .
METHODS test_7 FOR TESTING .
METHODS test_8 FOR TESTING .
METHODS test_9 FOR TESTING .
METHODS test_10 FOR TESTING .
METHODS test_greater_ten FOR TESTING .
METHODS test_dummy FOR TESTING.
PROTECTED SECTION.
PRIVATE SECTION.
DATA mo_class_to_test TYPE REF TO zif_glds_demo_numin_strout .
ENDCLASS.
CLASS ZCL_GLDS_DEMO_SWITCH_TESTS IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
mo_class_to_test ?= mo_class_to_test_generic.
ENDMETHOD.
METHOD test_0.
cl_abap_unit_assert=>assert_equals(
exp = `zero`
act = mo_class_to_test->test_me( 0 )
msg = '0 should be ZERO' ).
ENDMETHOD.
METHOD test_1.
cl_abap_unit_assert=>assert_equals(
exp = `one`
act = mo_class_to_test->test_me( 1 )
msg = '1 should be ONE' ).
ENDMETHOD.
METHOD test_10.
cl_abap_unit_assert=>assert_equals(
exp = `ten`
act = mo_class_to_test->test_me( 10 )
msg = '10 should be TEN' ).
ENDMETHOD.
METHOD test_2.
cl_abap_unit_assert=>assert_equals(
exp = `two`
act = mo_class_to_test->test_me( 2 )
msg = '2 should be TWO' ).
ENDMETHOD.
METHOD test_3.
cl_abap_unit_assert=>assert_equals(
exp = `three`
act = mo_class_to_test->test_me( 3 )
msg = '3 should be THREE' ).
ENDMETHOD.
METHOD test_4.
cl_abap_unit_assert=>assert_equals(
exp = `four`
act = mo_class_to_test->test_me( 4 )
msg = '4 should be FOUR' ).
ENDMETHOD.
METHOD test_5.
cl_abap_unit_assert=>assert_equals(
exp = `five`
act = mo_class_to_test->test_me( 5 )
msg = '5 should be FIVE' ).
ENDMETHOD.
METHOD test_6.
cl_abap_unit_assert=>assert_equals(
exp = `six`
act = mo_class_to_test->test_me( 6 )
msg = '6 should be SIX' ).
ENDMETHOD.
METHOD test_7.
cl_abap_unit_assert=>assert_equals(
exp = `seven`
act = mo_class_to_test->test_me( 7 )
msg = '7 should be SEVEN' ).
ENDMETHOD.
METHOD test_8.
cl_abap_unit_assert=>assert_equals(
exp = `eight`
act = mo_class_to_test->test_me( 8 )
msg = '8 should be EIGHT' ).
ENDMETHOD.
METHOD test_9.
cl_abap_unit_assert=>assert_equals(
exp = `nine`
act = mo_class_to_test->test_me( 9 )
msg = '9 should be NINE' ).
ENDMETHOD.
METHOD test_dummy.
cl_abap_unit_assert=>assert_equals(
exp = 1
act = 0
msg = |Don't worry - This test always fails to display all other results. |
level = if_aunit_constants=>tolerable ).
ENDMETHOD.
METHOD test_greater_ten.
DATA(number_to_test) = 10.
DO 90 TIMES.
ADD 1 TO number_to_test.
cl_abap_unit_assert=>assert_equals(
exp = ``
act = mo_class_to_test->test_me( number_to_test )
msg = 'any number greater than 10 should return an empty string' ).
ENDDO.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
70,
335,
82,
62,
9536,
78,
62,
31943,
62,
41989,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
70,
335,
82,
62,
9536,
78,
62,
9288,
62,
2978,
525,
198,
220,
9564,
18601,
10659,
198,
220,
29244,
6158,
44731,
198,
220,
7473,
43001,
2751,
198,
220,
360,
4261,
6234,
6006,
9863,
198,
220,
45698,
42,
49277,
43638,
5805,
7597,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
23772,
764,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
15,
220,
7473,
43001,
2751,
764,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
16,
220,
7473,
43001,
2751,
764,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
17,
220,
7473,
43001,
2751,
764,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
18,
220,
7473,
43001,
2751,
764,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
19,
220,
7473,
43001,
2751,
764,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
20,
220,
7473,
43001,
2751,
764,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
21,
220,
7473,
43001,
2751,
764,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
22,
220,
7473,
43001,
2751,
764,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
23,
220,
7473,
43001,
2751,
764,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
24,
220,
7473,
43001,
2751,
764,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
940,
7473,
43001,
2751,
764,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
18223,
263,
62,
1452,
7473,
43001,
2751,
764,
198,
220,
220,
220,
337,
36252,
50,
1332,
62,
67,
13513,
7473,
43001,
2751,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
42865,
6941,
62,
4871,
62,
1462,
62,
9288,
41876,
4526,
37,
5390,
1976,
361,
62,
70,
335,
82,
62,
9536,
78,
62,
77,
7230,
62,
2536,
448,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
8763,
5258,
62,
39429,
46,
62,
17887,
31949,
62,
51,
1546,
4694,
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,
6941,
62,
4871,
62,
1462,
62,
9288,
5633,
28,
6941,
62,
4871,
62,
1462,
62,
9288,
62,
41357,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1332,
62,
15,
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,
1033,
796,
4600,
22570,
63,
198,
220,
220,
220,
220,
220,
719,
796,
6941,
62,
4871,
62,
1462,
62,
9288,
3784,
9288,
62,
1326,
7,
657,
1267,
198,
220,
220,
220,
220,
220,
31456,
796,
705,
15,
815,
307,
1168,
34812,
6,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1332,
62,
16,
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,
1033,
796,
4600,
505,
63,
198,
220,
220,
220,
220,
220,
719,
796,
6941,
62,
4871,
62,
1462,
62,
9288,
3784,
9288,
62,
1326,
7,
352,
1267,
198,
220,
220,
220,
220,
220,
31456,
796,
705,
16,
815,
307,
16329,
6,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1332,
62,
940,
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,
1033,
796,
4600,
1452,
63,
198,
220,
220,
220,
220,
220,
719,
796,
6941,
62,
4871,
62,
1462,
62,
9288,
3784,
9288,
62,
1326,
7,
838,
1267,
198,
220,
220,
220,
220,
220,
31456,
796,
705,
940,
815,
307,
309,
1677,
6,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1332,
62,
17,
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,
1033,
796,
4600,
11545,
63,
198,
220,
220,
220,
220,
220,
719,
796,
6941,
62,
4871,
62,
1462,
62,
9288,
3784,
9288,
62,
1326,
7,
362,
1267,
198,
220,
220,
220,
220,
220,
31456,
796,
705,
17,
815,
307,
35288,
6,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1332,
62,
18,
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,
1033,
796,
4600,
15542,
63,
198,
220,
220,
220,
220,
220,
719,
796,
6941,
62,
4871,
62,
1462,
62,
9288,
3784,
9288,
62,
1326,
7,
513,
1267,
198,
220,
220,
220,
220,
220,
31456,
796,
705,
18,
815,
307,
48697,
6,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1332,
62,
19,
13,
198,
220,
220,
220,
537,
62,
397,
499,
62,
20850,
62,
30493,
14804,
30493,
62,
4853,
874,
7,
198,
220,
220,
220,
220,
220,
1033,
796,
4600,
14337,
63,
198,
220,
220,
220,
220,
220,
719,
796,
6941,
62,
4871,
62,
1462,
62,
9288,
3784,
9288,
62,
1326,
7,
604,
1267,
198,
220,
220,
220,
220,
220,
31456,
796,
705,
19,
815,
307,
376,
11698,
6,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1332,
62,
20,
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,
1033,
796,
4600,
13261,
63,
198,
220,
220,
220,
220,
220,
719,
796,
6941,
62,
4871,
62,
1462,
62,
9288,
3784,
9288,
62,
1326,
7,
642,
1267,
198,
220,
220,
220,
220,
220,
31456,
796,
705,
20,
815,
307,
376,
9306,
6,
6739,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1332,
62,
21,
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,
1033,
796,
4600,
19412,
63,
198,
220,
220,
220,
220,
220,
719,
796,
6941,
62,
4871,
62,
1462,
62,
9288,
3784,
9288,
62,
1326,
7,
718
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_persist_injector DEFINITION
PUBLIC
CREATE PRIVATE
FOR TESTING .
PUBLIC SECTION.
CLASS-METHODS set_repo
IMPORTING
!ii_repo TYPE REF TO zif_abapgit_persist_repo .
CLASS-METHODS set_settings
IMPORTING
!ii_settings TYPE REF TO zif_abapgit_persist_settings .
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_ABAPGIT_PERSIST_INJECTOR IMPLEMENTATION.
METHOD set_repo.
zcl_abapgit_persist_factory=>gi_repo = ii_repo.
ENDMETHOD.
METHOD set_settings.
zcl_abapgit_persist_factory=>gi_settings = ii_settings.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
19276,
396,
62,
259,
752,
273,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
29244,
6158,
4810,
3824,
6158,
198,
220,
7473,
43001,
2751,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
900,
62,
260,
7501,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
260,
7501,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
19276,
396,
62,
260,
7501,
764,
628,
220,
220,
220,
42715,
12,
49273,
50,
900,
62,
33692,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
4178,
62,
33692,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
19276,
396,
62,
33692,
764,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
628,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
47,
4877,
8808,
62,
1268,
23680,
1581,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
900,
62,
260,
7501,
13,
628,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
19276,
396,
62,
69,
9548,
14804,
12397,
62,
260,
7501,
796,
21065,
62,
260,
7501,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
900,
62,
33692,
13,
628,
220,
220,
220,
1976,
565,
62,
397,
499,
18300,
62,
19276,
396,
62,
69,
9548,
14804,
12397,
62,
33692,
796,
21065,
62,
33692,
13,
628,
220,
23578,
49273,
13,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
class ZCL_JSON_PARSER definition
public
inheriting from ZCL_OBJECT
final
create public .
public section.
*"* public components of class zCL_JSON_PARSER
*"* do not include other source files here!!!
constants JSON_TOKEN_ARRAY_START type C value '['. "#EC NOTEXT
constants JSON_TOKEN_ARRAY_END type C value ']'. "#EC NOTEXT
constants JSON_TOKEN_OBJECT_START type C value '{'. "#EC NOTEXT
constants JSON_TOKEN_OBJECT_END type C value '}'. "#EC NOTEXT
constants JSON_TOKEN_NAME_VAL_SEPARATOR type C value ':'. "#EC NOTEXT
constants JSON_TOKEN_VALUE_SEPARATOR type C value ','. "#EC NOTEXT
constants JSON_TOKEN_STRING type C value '"'. "#EC NOTEXT
constants JSON_TOKEN_ESCAPE type C value '\'. "#EC NOTEXT
class-methods CLASS_CONSTRUCTOR .
class-methods UTF8_BYTE_VALUE
importing
!CHAR type CHAR1
returning
value(RETURNING) type XSTRING .
methods DESERIALIZE
importing
!JSON_STRING type STRING
returning
value(RETURNING) type ref to ZIF_JSON_VALUE
raising
ZCX_JSON_PARSE_ERROR .
methods SERIALIZE
importing
!JSON_VALUE type ref to ZIF_JSON_VALUE
returning
value(RETURNING) type STRING .
protected section.
*"* protected components of class zCL_JSON_PARSER
*"* do not include other source files here!!!
private section.
*"* private components of class zCL_JSON_PARSER
*"* do not include other source files here!!!
class-data UTF8_CONVERTER type ref to CL_ABAP_CONV_OUT_CE .
methods JSON_ARRAY_TO_STRING
importing
!JSON_ARRAY type ref to ZCL_JSON_ARRAY
returning
value(RETURNING) type STRING .
methods JSON_BOOLEAN_TO_STRING
importing
!JSON_BOOLEAN type ref to ZCL_JSON_BOOLEAN
returning
value(RETURNING) type STRING .
methods JSON_NUMBER_TO_STRING
importing
!JSON_NUMBER type ref to ZCL_JSON_NUMBER
returning
value(RETURNING) type STRING .
methods JSON_OBJECT_TO_STRING
importing
!JSON_OBJECT type ref to ZCL_JSON_OBJECT
returning
value(RETURNING) type STRING .
methods JSON_STRING_TO_STRING
importing
!JSON_STRING type ref to ZCL_JSON_STRING
returning
value(RETURNING) type STRING .
methods _SUBSTRING
importing
!THESTRING type STRING
!BEGININDEX type I
!ENDINDEX type I optional
returning
value(RETURNING) type STRING .
ENDCLASS.
CLASS ZCL_JSON_PARSER IMPLEMENTATION.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Static Public Method ZCL_JSON_PARSER=>CLASS_CONSTRUCTOR
* +-------------------------------------------------------------------------------------------------+
* +--------------------------------------------------------------------------------------</SIGNATURE>
method class_constructor.
utf8_converter = cl_abap_conv_out_ce=>create( encoding = 'UTF-8' ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_JSON_PARSER->DESERIALIZE
* +-------------------------------------------------------------------------------------------------+
* | [--->] JSON_STRING TYPE STRING
* | [<-()] RETURNING TYPE REF TO ZIF_JSON_VALUE
* | [!CX!] ZCX_JSON_PARSE_ERROR
* +--------------------------------------------------------------------------------------</SIGNATURE>
method deserialize.
data msg type string.
data result type ref to zif_json_value.
data parent type ref to zif_json_value.
data state type c.
data state_stack type standard table of c.
data value_stack type standard table of ref to zif_json_value.
data stack_depth type i value 1.
data position type i value 0.
" Helper variables
data parent_object type ref to zcl_json_object.
data parent_array type ref to zcl_json_array.
data json_pair type ref to zcl_json_pair.
data json_pair_name type ref to zif_json_value.
data json_pair_name_string type ref to zcl_json_string.
" The main loop; process each character in the received JSON string
data limit type i.
limit = strlen( json_string ).
while position < limit.
" Get the character at the current position
data char type c.
data byte_value type xstring.
char = json_string+position(1).
byte_value = me->utf8_byte_value( char ).
" Ignore spaces and control characters
if byte_value <= '20' or
( byte_value >= '7F' and byte_value <= 'C2A0' ).
position = position + 1.
continue.
endif.
" Process the character
case char.
when json_token_object_start. " Start of object
insert state into state_stack index stack_depth.
insert parent into value_stack index stack_depth.
stack_depth = stack_depth + 1.
create object parent type zcl_json_object.
clear result.
state = char.
when json_token_object_end. " End of object
if state = json_token_name_val_separator.
" End of object reached and state is a name/value separator
" This means the parent is an object and the result is a value
" It also means the value stack has a string (name) on top
" - Get the pair name
stack_depth = stack_depth - 1.
read table value_stack into json_pair_name index stack_depth.
json_pair_name_string ?= json_pair_name.
" - Create the pair
create object json_pair
exporting
name = json_pair_name_string
value = result.
" - Add the pair to the parent
parent_object ?= parent.
parent_object->add( json_pair ).
clear: parent_object, json_pair_name, json_pair_name_string, json_pair.
" Set state to its previous value
read table state_stack into state index stack_depth.
endif.
if state = json_token_object_start.
" End of object reached and state is the begin of an object
" Parent becomes the result (we could be finished here)...
result = parent.
" ...and set the parent and state to their previous values
stack_depth = stack_depth - 1.
read table state_stack into state index stack_depth.
read table value_stack into parent index stack_depth.
else.
" Can only reach end of object if state is the start of an object
message e002(zjson) with position json_token_object_end into msg.
raise exception type zcx_json_parse_error
exporting
message = msg.
endif.
when json_token_array_start. " Start of array
insert state into state_stack index stack_depth.
insert parent into value_stack index stack_depth.
stack_depth = stack_depth + 1.
create object parent type zcl_json_array.
clear result.
state = char.
when json_token_array_end. " End of array
if state = json_token_array_start.
" End of array reached and state is the start of an array
" This means the parent is an array and the result is a value
if result is bound. " Only add the result to the array if its bound
parent_array ?= parent.
parent_array->add( result ).
clear parent_array.
" Parent becomes the result (we could be finished here)...
result = parent.
" ...and set the parent and state to their previous values
stack_depth = stack_depth - 1.
read table state_stack into state index stack_depth.
read table value_stack into parent index stack_depth.
endif.
else.
" Can only reach end of array if state is the start of an array
message e002(zjson) with position json_token_array_end into msg.
raise exception type zcx_json_parse_error
exporting
message = msg.
endif.
when json_token_value_separator. " Value separator
" Cannot reach a value separator when there is no result yet
if result is not bound.
message e002(zjson) with position json_token_value_separator into msg.
raise exception type zcx_json_parse_error
exporting
message = msg.
endif.
if state = json_token_name_val_separator.
" Value separator reached and state is a name/value separator
" This means the parent is an object and the result is a value
" It also means the value stack has a string (name) on top
" - Get the pair name
stack_depth = stack_depth - 1.
read table value_stack into json_pair_name index stack_depth.
json_pair_name_string ?= json_pair_name.
" - Create the pair
create object json_pair
exporting
name = json_pair_name_string
value = result.
" - Add the pair to the parent
parent_object ?= parent.
parent_object->add( json_pair ).
clear: parent_object, json_pair_name, json_pair_name_string, json_pair.
" Set state to its previous value
read table state_stack into state index stack_depth.
" Clear the result because there should be another value coming after this
clear result.
elseif state = json_token_array_start.
" Value separator reached and state is the start of an array
" This means the parent is an array and the result is a value
parent_array ?= parent.
parent_array->add( result ).
clear parent_array.
" Keep state the same while we're inside an array
" Clear the result because there should be another value coming after this
clear result.
else.
message e002(zjson) with position json_token_value_separator into msg.
raise exception type zcx_json_parse_error
exporting
message = msg.
endif.
when json_token_name_val_separator. " Name/value separator
" Can only reach a name/value separator while we're inside an object
if state = json_token_object_start.
" Name/value separator reached and state is the start of an object
" This means the parent is an object and the result is a string (name)
insert state into state_stack index stack_depth.
insert result into value_stack index stack_depth.
stack_depth = stack_depth + 1.
state = char.
" Clear the result because there should be a value coming after this
clear result.
else.
message e002(zjson) with position json_token_name_val_separator into msg.
raise exception type zcx_json_parse_error
exporting
message = msg.
endif.
when json_token_string. " String value
" Process the entire string value before continuing the main loop
data string_start_position type i.
data previous_was_json_token_escape type abap_bool.
data is_escaped_string type abap_bool.
string_start_position = position + 1. " Skip the first character since it's the string token
previous_was_json_token_escape = abap_false.
is_escaped_string = abap_false.
while position < limit.
" Get the next character
position = position + 1.
char = json_string+position(1).
byte_value = me->utf8_byte_value( char ).
" Keep looping until another unescaped string separator is found
if previous_was_json_token_escape = abap_true.
previous_was_json_token_escape = abap_false.
continue.
elseif char = json_token_escape.
" The string contains escaped characters
is_escaped_string = abap_true.
continue.
elseif char = json_token_string.
" End of string reached, get its value by retrieving the substring
data result_string type string.
result_string = _substring( thestring = json_string beginindex = string_start_position endindex = position ).
if is_escaped_string = abap_true.
" String has escaped characters
" Use javascript engine to evaluate the string
data js_processor_string type ref to cl_java_script.
data script_string type string.
concatenate `var jsonString = "` result_string `";` into script_string. "#EC NOTEXT
js_processor_string = cl_java_script=>create( ).
js_processor_string->compile( script_name = 'evaljsonstring.js' script = script_string ). "#EC NOTEXT
js_processor_string->execute( script_name = 'evaljsonstring.js' ). "#EC NOTEXT
result_string = js_processor_string->evaluate( java_script = 'jsonString;' ). "#EC NOTEXT
endif.
" Set the json string value as result
create object result type zcl_json_string
exporting
value = result_string.
exit. " Exit string value loop
endif.
endwhile.
when others.
" Possible values which don't have an indicator are a number, boolean, or null value
data end4 type i.
data substring4 type string.
end4 = position + 4.
substring4 = _substring( thestring = json_string beginindex = position endindex = end4 ).
data end5 type i.
data substring5 type string.
end5 = position + 5.
substring5 = _substring( thestring = json_string beginindex = position endindex = end5 ).
if ( byte_value >= '30' and byte_value <= '39' ) or " 0,1,2,3,4,5,6,7,8,9
byte_value = '2B' or byte_value = '2D' or " + -
byte_value = '2E'. " .
" Number
" Process the entire number value before continuing the main loop
data num_start_position type i.
num_start_position = position.
while position < limit.
" Get the next character
position = position + 1.
char = json_string+position(1).
byte_value = me->utf8_byte_value( char ).
" Keep looping until anything non-number related is found
if ( byte_value >= '30' and byte_value <= '39' ) or " 0,1,2,3,4,5,6,7,8,9
byte_value = '2B' or byte_value = '2D' or " + -
byte_value = '2E' or " .
byte_value = '45' or byte_value = '65'. " e E
" Continue number value loop
continue.
else.
" End of number reached
exit.
endif.
endwhile.
" Get the number value by retrieving the substring
data result_num_string type string.
result_num_string = _substring( thestring = json_string beginindex = num_start_position endindex = position ).
" Convert the string to a float, simply by assigning it to a variable of type F.
" This is possible, because the ABAP float notation is identical to
" the JSON notation (which is amazing really!)
data result_num type f.
result_num = result_num_string.
" Set the json number value as result
create object result type zcl_json_number
exporting
value = result_num.
" Go back one step, so the main loop can continue with the next char
position = position - 1.
elseif substring4 = 'null'. "#EC NOTEXT
" Null
create object result type zcl_json_null.
position = position + 3.
elseif substring4 = 'true'. "#EC NOTEXT
" Boolean, true
create object result type zcl_json_boolean
exporting
value = abap_true.
position = position + 3.
elseif substring5 = 'false'. "#EC NOTEXT
" Boolean, false
create object result type zcl_json_boolean
exporting
value = abap_false.
position = position + 4.
endif.
endcase.
" Continue to next position
position = position + 1.
endwhile.
" Return the result
returning = result.
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Private Method ZCL_JSON_PARSER->JSON_ARRAY_TO_STRING
* +-------------------------------------------------------------------------------------------------+
* | [--->] JSON_ARRAY TYPE REF TO ZCL_JSON_ARRAY
* | [<-()] RETURNING TYPE STRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method json_array_to_string.
data string_value type string.
data is_first type abap_bool.
data iterator type ref to zif_iterator.
is_first = abap_true.
iterator = json_array->iterator( ).
while iterator->hasnext( ) = abap_true.
data json_value type ref to zif_json_value.
json_value ?= iterator->next( ).
data value type string.
case json_value->get_type( ).
when zcl_json_types=>type_string.
data json_string_value type ref to zcl_json_string.
json_string_value ?= json_value.
value = me->json_string_to_string( json_string_value ).
when zcl_json_types=>type_number.
data json_number_value type ref to zcl_json_number.
json_number_value ?= json_value.
value = me->json_number_to_string( json_number_value ).
when zcl_json_types=>type_boolean.
data json_boolean_value type ref to zcl_json_boolean.
json_boolean_value ?= json_value.
value = me->json_boolean_to_string( json_boolean_value ).
when zcl_json_types=>type_null.
value = `null`. "#EC NOTEXT
when zcl_json_types=>type_object.
data json_object_value type ref to zcl_json_object.
json_object_value ?= json_value.
value = me->json_object_to_string( json_object_value ).
when zcl_json_types=>type_array.
data json_array_value type ref to zcl_json_array.
json_array_value ?= json_value.
value = me->json_array_to_string( json_array_value ).
endcase.
if is_first = abap_true.
string_value = value.
is_first = abap_false.
else.
concatenate string_value `, ` value into string_value.
endif.
endwhile.
concatenate `[ ` string_value ` ]` into string_value.
returning = string_value.
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Private Method ZCL_JSON_PARSER->JSON_BOOLEAN_TO_STRING
* +-------------------------------------------------------------------------------------------------+
* | [--->] JSON_BOOLEAN TYPE REF TO ZCL_JSON_BOOLEAN
* | [<-()] RETURNING TYPE STRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method json_boolean_to_string.
data value type string.
if json_boolean->value = abap_true.
value = 'true'. "#EC NOTEXT
else.
value = 'false'. "#EC NOTEXT
endif.
returning = value.
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Private Method ZCL_JSON_PARSER->JSON_NUMBER_TO_STRING
* +-------------------------------------------------------------------------------------------------+
* | [--->] JSON_NUMBER TYPE REF TO ZCL_JSON_NUMBER
* | [<-()] RETURNING TYPE STRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method json_number_to_string.
data value type string.
value = json_number->value.
returning = value.
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Private Method ZCL_JSON_PARSER->JSON_OBJECT_TO_STRING
* +-------------------------------------------------------------------------------------------------+
* | [--->] JSON_OBJECT TYPE REF TO ZCL_JSON_OBJECT
* | [<-()] RETURNING TYPE STRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method json_object_to_string.
data string_value type string.
data is_first type abap_bool.
data iterator type ref to zif_iterator.
is_first = abap_true.
iterator = json_object->iterator( ).
while iterator->hasnext( ) = abap_true.
data json_pair type ref to zcl_json_pair.
json_pair ?= iterator->next( ).
" - Name
data name type string.
name = me->json_string_to_string( json_pair->name ).
" - Value
data json_value type ref to zif_json_value.
json_value = json_pair->value.
data value type string.
case json_value->get_type( ).
when zcl_json_types=>type_string.
data json_string_value type ref to zcl_json_string.
json_string_value ?= json_value.
value = me->json_string_to_string( json_string_value ).
when zcl_json_types=>type_number.
data json_number_value type ref to zcl_json_number.
json_number_value ?= json_value.
value = me->json_number_to_string( json_number_value ).
when zcl_json_types=>type_boolean.
data json_boolean_value type ref to zcl_json_boolean.
json_boolean_value ?= json_value.
value = me->json_boolean_to_string( json_boolean_value ).
when zcl_json_types=>type_null.
value = `null`. "#EC NOTEXT
when zcl_json_types=>type_object.
data json_object_value type ref to zcl_json_object.
json_object_value ?= json_value.
value = me->json_object_to_string( json_object_value ).
when zcl_json_types=>type_array.
data json_array_value type ref to zcl_json_array.
json_array_value ?= json_value.
value = me->json_array_to_string( json_array_value ).
endcase.
if is_first = abap_true.
concatenate name ` : ` value into string_value.
is_first = abap_false.
else.
concatenate string_value `, ` name ` : ` value into string_value.
endif.
endwhile.
concatenate `{ ` string_value ` }` into string_value.
returning = string_value.
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Private Method ZCL_JSON_PARSER->JSON_STRING_TO_STRING
* +-------------------------------------------------------------------------------------------------+
* | [--->] JSON_STRING TYPE REF TO ZCL_JSON_STRING
* | [<-()] RETURNING TYPE STRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method json_string_to_string.
data value type string.
value = json_string->value.
" Escape characters according to json spec
" - Backslashes first so the backslashes added by the other escapes won't be double-escaped
replace all occurrences of '\' in value with '\\'.
" - Double quote
replace all occurrences of '"' in value with '\"'.
" - Slash
replace all occurrences of '/' in value with '\/'.
" Convert the value to UTF-8 bytes, so we can easily find and replace characters which must be escaped
data converter_out type ref to cl_abap_conv_out_ce.
converter_out = cl_abap_conv_out_ce=>create( encoding = `UTF-8` ).
data value_x type xstring.
converter_out->convert( exporting data = value importing buffer = value_x ).
" - Backspace
data backspace_x type x length 1 value `08`.
data escaped_backspace type string value `\b`.
data escaped_backspace_x type xstring.
converter_out->convert( exporting data = escaped_backspace importing buffer = escaped_backspace_x ).
replace all occurrences of backspace_x in value_x with escaped_backspace_x in byte mode.
" - Formfeed
data formfeed_x type x length 1 value `0C`.
data escaped_formfeed type string value `\f`.
data escaped_formfeed_x type xstring.
converter_out->convert( exporting data = escaped_formfeed importing buffer = escaped_formfeed_x ).
replace all occurrences of formfeed_x in value_x with escaped_formfeed_x in byte mode.
" - Newline
data newline_x type x length 1 value `0A`.
data escaped_newline type string value `\n`.
data escaped_newline_x type xstring.
converter_out->convert( exporting data = escaped_newline importing buffer = escaped_newline_x ).
replace all occurrences of newline_x in value_x with escaped_newline_x in byte mode.
" - Carriage return
data carriagereturn_x type x length 1 value `0D`.
data escaped_carriagereturn type string value `\r`.
data escaped_carriagereturn_x type xstring.
converter_out->convert( exporting data = escaped_carriagereturn importing buffer = escaped_carriagereturn_x ).
replace all occurrences of carriagereturn_x in value_x with escaped_carriagereturn_x in byte mode.
" - Horizontal tab
data horizontaltab_x type x length 1 value `09`.
data escaped_horizontaltab type string value `\t`.
data escaped_horizontaltab_x type xstring.
converter_out->convert( exporting data = escaped_horizontaltab importing buffer = escaped_horizontaltab_x ).
replace all occurrences of horizontaltab_x in value_x with escaped_horizontaltab_x in byte mode.
" Convert the value back to a UTF-8 string
data converter_in type ref to cl_abap_conv_in_ce.
converter_in = cl_abap_conv_in_ce=>create( encoding = `UTF-8` ).
converter_in->convert( exporting input = value_x importing data = value ).
" Surround value with double quotes
concatenate `"` value `"` into value.
returning = value.
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method ZCL_JSON_PARSER->SERIALIZE
* +-------------------------------------------------------------------------------------------------+
* | [--->] JSON_VALUE TYPE REF TO ZIF_JSON_VALUE
* | [<-()] RETURNING TYPE STRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method serialize.
data value type string.
case json_value->get_type( ).
when zcl_json_types=>type_string.
data json_string_value type ref to zcl_json_string.
json_string_value ?= json_value.
value = me->json_string_to_string( json_string_value ).
when zcl_json_types=>type_number.
data json_number_value type ref to zcl_json_number.
json_number_value ?= json_value.
value = me->json_number_to_string( json_number_value ).
when zcl_json_types=>type_boolean.
data json_boolean_value type ref to zcl_json_boolean.
json_boolean_value ?= json_value.
value = me->json_boolean_to_string( json_boolean_value ).
when zcl_json_types=>type_null.
value = `null`. "#EC NOTEXT
when zcl_json_types=>type_object.
data json_object_value type ref to zcl_json_object.
json_object_value ?= json_value.
value = me->json_object_to_string( json_object_value ).
when zcl_json_types=>type_array.
data json_array_value type ref to zcl_json_array.
json_array_value ?= json_value.
value = me->json_array_to_string( json_array_value ).
endcase.
returning = value.
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Static Public Method ZCL_JSON_PARSER=>UTF8_BYTE_VALUE
* +-------------------------------------------------------------------------------------------------+
* | [--->] CHAR TYPE CHAR1
* | [<-()] RETURNING TYPE XSTRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method utf8_byte_value.
utf8_converter->reset( ).
utf8_converter->write( data = char ).
returning = utf8_converter->get_buffer( ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Private Method ZCL_JSON_PARSER->_SUBSTRING
* +-------------------------------------------------------------------------------------------------+
* | [--->] THESTRING TYPE STRING
* | [--->] BEGININDEX TYPE I
* | [--->] ENDINDEX TYPE I(optional)
* | [<-()] RETURNING TYPE STRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method _substring.
data begin type i.
data end type i.
if endindex is not supplied.
end = strlen( thestring ).
else.
end = endindex.
endif.
if beginindex < 0.
begin = 0.
else.
begin = beginindex.
endif.
if end > strlen( thestring ).
end = strlen( thestring ).
endif.
if begin > end.
return.
endif.
data substring type string.
if begin = 0 and end = strlen( thestring ).
substring = thestring.
else.
data len type i.
len = end - begin.
substring = thestring+begin(len).
endif.
returning = substring.
endmethod.
ENDCLASS.
| [
4871,
1168,
5097,
62,
40386,
62,
27082,
35009,
6770,
201,
198,
220,
1171,
201,
198,
220,
10639,
1780,
422,
1168,
5097,
62,
9864,
23680,
201,
198,
220,
2457,
201,
198,
220,
2251,
1171,
764,
201,
198,
201,
198,
11377,
2665,
13,
201,
198,
201,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1976,
5097,
62,
40386,
62,
27082,
35009,
201,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
201,
198,
220,
38491,
19449,
62,
10468,
43959,
62,
1503,
30631,
62,
2257,
7227,
2099,
327,
1988,
44438,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
19449,
62,
10468,
43959,
62,
1503,
30631,
62,
10619,
2099,
327,
1988,
705,
60,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
19449,
62,
10468,
43959,
62,
9864,
23680,
62,
2257,
7227,
2099,
327,
1988,
705,
90,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
19449,
62,
10468,
43959,
62,
9864,
23680,
62,
10619,
2099,
327,
1988,
705,
92,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
19449,
62,
10468,
43959,
62,
20608,
62,
23428,
62,
5188,
27082,
25633,
2099,
327,
1988,
705,
25,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
19449,
62,
10468,
43959,
62,
39488,
62,
5188,
27082,
25633,
2099,
327,
1988,
705,
4032,
13,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
19449,
62,
10468,
43959,
62,
18601,
2751,
2099,
327,
1988,
705,
1,
4458,
25113,
2943,
5626,
13918,
201,
198,
220,
38491,
19449,
62,
10468,
43959,
62,
1546,
33177,
36,
2099,
327,
1988,
705,
59,
4458,
25113,
2943,
5626,
13918,
201,
198,
201,
198,
220,
1398,
12,
24396,
82,
42715,
62,
10943,
46126,
1581,
764,
201,
198,
220,
1398,
12,
24396,
82,
41002,
23,
62,
17513,
9328,
62,
39488,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
38019,
2099,
28521,
16,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
1395,
18601,
2751,
764,
201,
198,
220,
5050,
22196,
1137,
12576,
35400,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
40386,
62,
18601,
2751,
2099,
19269,
2751,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
1006,
284,
1168,
5064,
62,
40386,
62,
39488,
201,
198,
220,
220,
220,
8620,
201,
198,
220,
220,
220,
220,
220,
1168,
34,
55,
62,
40386,
62,
27082,
5188,
62,
24908,
764,
201,
198,
220,
5050,
18871,
12576,
35400,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
40386,
62,
39488,
2099,
1006,
284,
1168,
5064,
62,
40386,
62,
39488,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
19269,
2751,
764,
201,
198,
24326,
2665,
13,
201,
198,
9,
1,
9,
6861,
6805,
286,
1398,
1976,
5097,
62,
40386,
62,
27082,
35009,
201,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
201,
198,
19734,
2665,
13,
201,
198,
201,
198,
9,
1,
9,
2839,
6805,
286,
1398,
1976,
5097,
62,
40386,
62,
27082,
35009,
201,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
201,
198,
220,
1398,
12,
7890,
41002,
23,
62,
10943,
5959,
5781,
2099,
1006,
284,
7852,
62,
6242,
2969,
62,
10943,
53,
62,
12425,
62,
5222,
764,
201,
198,
201,
198,
220,
5050,
19449,
62,
1503,
30631,
62,
10468,
62,
18601,
2751,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
40386,
62,
1503,
30631,
2099,
1006,
284,
1168,
5097,
62,
40386,
62,
1503,
30631,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
19269,
2751,
764,
201,
198,
220,
5050,
19449,
62,
33,
6684,
2538,
1565,
62,
10468,
62,
18601,
2751,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
40386,
62,
33,
6684,
2538,
1565,
2099,
1006,
284,
1168,
5097,
62,
40386,
62,
33,
6684,
2538,
1565,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
19269,
2751,
764,
201,
198,
220,
5050,
19449,
62,
41359,
13246,
62,
10468,
62,
18601,
2751,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
40386,
62,
41359,
13246,
2099,
1006,
284,
1168,
5097,
62,
40386,
62,
41359,
13246,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
19269,
2751,
764,
201,
198,
220,
5050,
19449,
62,
9864,
23680,
62,
10468,
62,
18601,
2751,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
40386,
62,
9864,
23680,
2099,
1006,
284,
1168,
5097,
62,
40386,
62,
9864,
23680,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
19269,
2751,
764,
201,
198,
220,
5050,
19449,
62,
18601,
2751,
62,
10468,
62,
18601,
2751,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
40386,
62,
18601,
2751,
2099,
1006,
284,
1168,
5097,
62,
40386,
62,
18601,
2751,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
19269,
2751,
764,
201,
198,
220,
5050,
4808,
50,
10526,
18601,
2751,
201,
198,
220,
220,
220,
33332,
201,
198,
220,
220,
220,
220,
220,
5145,
4221,
1546,
5446,
2751,
2099,
19269,
2751,
201,
198,
220,
220,
220,
220,
220,
5145,
33,
43312,
12115,
6369,
2099,
314,
201,
198,
220,
220,
220,
220,
220,
5145,
10619,
12115,
6369,
2099,
314,
11902,
201,
198,
220,
220,
220,
8024,
201,
198,
220,
220,
220,
220,
220,
1988,
7,
26087,
4261,
15871,
8,
2099,
19269,
2751,
764,
201,
198,
10619,
31631,
13,
201,
198,
201,
198,
201,
198,
201,
198,
31631,
1168,
5097,
62,
40386,
62,
27082,
35009,
30023,
2538,
10979,
6234,
13,
201,
198,
201,
198,
201,
198,
9,
1279,
46224,
40086,
29,
10097,
19351,
6329,
10,
201,
198,
9,
930,
36125,
5094,
11789,
1168,
5097,
62,
40386
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
method /IWBEP/IF_SB_DPC_COMM_SERVICES~GET_GENERATION_STRATEGY.
* Get generation strategy
rv_generation_strategy = '1'.
endmethod. | [
220,
2446,
1220,
40,
45607,
8905,
14,
5064,
62,
16811,
62,
35,
5662,
62,
9858,
44,
62,
35009,
53,
34444,
93,
18851,
62,
35353,
1137,
6234,
62,
18601,
6158,
31212,
13,
198,
9,
3497,
5270,
4811,
198,
220,
374,
85,
62,
20158,
62,
2536,
4338,
796,
705,
16,
4458,
198,
220,
886,
24396,
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
] |
CLASS zcl_abapgit_ecatt_val_obj_upl DEFINITION
PUBLIC
INHERITING FROM cl_apl_ecatt_upload
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES:
zif_abapgit_ecatt_upload.
METHODS:
upload REDEFINITION.
PROTECTED SECTION.
METHODS:
upload_data_from_stream REDEFINITION,
get_business_msgs_from_dom
RAISING
cx_ecatt_apl,
get_impl_detail_from_dom
RAISING
cx_ecatt_apl,
get_vo_flags_from_dom
RAISING
cx_ecatt_apl.
PRIVATE SECTION.
DATA:
mv_external_xml TYPE xstring.
ENDCLASS.
CLASS zcl_abapgit_ecatt_val_obj_upl IMPLEMENTATION.
METHOD get_business_msgs_from_dom.
" downport from CL_APL_ECATT_VO_UPLOAD
DATA: li_section TYPE REF TO if_ixml_element,
lt_buss_msg_ref TYPE zif_abapgit_ecatt=>etvo_bus_msg_tabtype,
lv_exception_occurred TYPE etonoff,
lo_ecatt_vo TYPE REF TO object.
FIELD-SYMBOLS: <lg_ecatt_vo> TYPE any.
li_section = template_over_all->find_from_name_ns( 'ETVO_MSG' ).
IF NOT li_section IS INITIAL.
CALL FUNCTION 'SDIXML_DOM_TO_DATA'
EXPORTING
data_as_dom = li_section
IMPORTING
dataobject = lt_buss_msg_ref
EXCEPTIONS
illegal_object = 1
OTHERS = 2.
IF sy-subrc <> 0.
CLEAR lt_buss_msg_ref.
ENDIF.
ENDIF.
ASSIGN ('ECATT_OBJECT') TO <lg_ecatt_vo>.
ASSERT sy-subrc = 0.
lo_ecatt_vo = <lg_ecatt_vo>.
TRY.
CALL METHOD lo_ecatt_vo->('SET_BUSSINESS_MSG')
EXPORTING
im_buss_msg_ref = lt_buss_msg_ref.
CATCH cx_ecatt_apl INTO exception_to_raise.
lv_exception_occurred = 'X'.
ENDTRY.
IF lv_exception_occurred = 'X'.
raise_upload_exception( previous = exception_to_raise ).
ENDIF.
ENDMETHOD.
METHOD get_impl_detail_from_dom.
" downport from CL_APL_ECATT_VO_UPLOAD
DATA: li_section TYPE REF TO if_ixml_element,
ls_impl_details TYPE zif_abapgit_ecatt=>etvoimpl_det,
lv_exception_occurred TYPE etonoff,
lo_ecatt_vo TYPE REF TO object.
FIELD-SYMBOLS: <lg_ecatt_vo> TYPE any.
li_section = template_over_all->find_from_name_ns( 'IMPL_DET' ).
IF NOT li_section IS INITIAL.
CALL FUNCTION 'SDIXML_DOM_TO_DATA'
EXPORTING
data_as_dom = li_section
IMPORTING
dataobject = ls_impl_details
EXCEPTIONS
illegal_object = 1
OTHERS = 2.
IF sy-subrc <> 0.
CLEAR ls_impl_details.
ENDIF.
ENDIF.
ASSIGN ('ECATT_OBJECT') TO <lg_ecatt_vo>.
ASSERT sy-subrc = 0.
lo_ecatt_vo = <lg_ecatt_vo>.
TRY.
CALL METHOD lo_ecatt_vo->('SET_IMPL_DETAILS')
EXPORTING
im_impl_details = ls_impl_details.
CATCH cx_ecatt_apl INTO exception_to_raise.
lv_exception_occurred = 'X'.
ENDTRY.
IF lv_exception_occurred = 'X'.
raise_upload_exception( previous = exception_to_raise ).
ENDIF.
ENDMETHOD.
METHOD get_vo_flags_from_dom.
" downport from CL_APL_ECATT_VO_UPLOAD
DATA: li_section TYPE REF TO if_ixml_element,
lv_error_prio TYPE zif_abapgit_ecatt=>etvo_error_prio,
lv_invert_validation TYPE zif_abapgit_ecatt=>etvo_invert_validation,
lv_exception_occurred TYPE etonoff,
lo_ecatt_vo TYPE REF TO object.
FIELD-SYMBOLS: <lg_ecatt_vo> TYPE any.
li_section = template_over_all->find_from_name_ns( 'INVERT_VALIDATION' ).
IF NOT li_section IS INITIAL.
CALL FUNCTION 'SDIXML_DOM_TO_DATA'
EXPORTING
data_as_dom = li_section
IMPORTING
dataobject = lv_invert_validation
EXCEPTIONS
illegal_object = 1
OTHERS = 2.
IF sy-subrc <> 0.
CLEAR lv_invert_validation.
ENDIF.
ENDIF.
ASSIGN ('ECATT_OBJECT') TO <lg_ecatt_vo>.
ASSERT sy-subrc = 0.
lo_ecatt_vo = <lg_ecatt_vo>.
TRY.
CALL METHOD lo_ecatt_vo->('SET_INVERT_VALIDATION_FLAG')
EXPORTING
im_invert_validation = lv_invert_validation.
CATCH cx_ecatt_apl INTO exception_to_raise.
lv_exception_occurred = 'X'.
ENDTRY.
li_section = template_over_all->find_from_name_ns( 'ERROR_PRIORITY' ).
IF NOT li_section IS INITIAL.
CALL FUNCTION 'SDIXML_DOM_TO_DATA'
EXPORTING
data_as_dom = li_section
IMPORTING
dataobject = lv_error_prio
EXCEPTIONS
illegal_object = 1
OTHERS = 2.
IF sy-subrc <> 0.
CLEAR lv_invert_validation.
ENDIF.
ENDIF.
TRY.
CALL METHOD lo_ecatt_vo->('SET_ERROR_PRIORITY')
EXPORTING
im_error_prio = lv_error_prio.
CATCH cx_ecatt_apl INTO exception_to_raise.
lv_exception_occurred = 'X'.
ENDTRY.
IF lv_exception_occurred = 'X'.
raise_upload_exception( previous = exception_to_raise ).
ENDIF.
ENDMETHOD.
METHOD upload.
" We inherit from CL_APL_ECATT_UPLOAD because CL_APL_ECATT_VO_UPLOAD
" doesn't exist in 702
" downport from CL_APL_ECATT_VO_UPLOAD
DATA: lx_ex TYPE REF TO cx_ecatt_apl,
lv_exists TYPE etonoff,
lv_exc_occ TYPE etonoff,
ls_tadir TYPE tadir,
lo_ecatt_vo TYPE REF TO object,
lo_params TYPE REF TO cl_apl_ecatt_params.
FIELD-SYMBOLS: <lg_ecatt_vo> TYPE any,
<lg_params> TYPE data,
<lv_d_akh> TYPE data,
<lv_i_akh> TYPE data.
TRY.
ch_object-i_devclass = ch_object-d_devclass.
ASSIGN COMPONENT 'D_AKH' OF STRUCTURE ch_object
TO <lv_d_akh>. " doesn't exist in 702
ASSIGN COMPONENT 'I_AKH' OF STRUCTURE ch_object
TO <lv_i_akh>. " doesn't exist in 702
IF <lv_d_akh> IS ASSIGNED AND <lv_i_akh> IS ASSIGNED.
<lv_i_akh> = <lv_d_akh>.
ENDIF.
super->upload(
CHANGING
ch_object = ch_object ).
upload_data_from_stream( ch_object-filename ).
CATCH cx_ecatt_apl INTO lx_ex.
IF template_over_all IS INITIAL.
RAISE EXCEPTION lx_ex.
ELSE.
lv_exc_occ = 'X'.
ENDIF.
ENDTRY.
TRY.
CALL METHOD ('GET_ATTRIBUTES_FROM_DOM_NEW') " doesn't exit in 702
CHANGING
ch_object = ch_object.
CATCH cx_ecatt_apl INTO lx_ex.
lv_exc_occ = 'X'.
ENDTRY.
ASSIGN ('ECATT_OBJECT') TO <lg_ecatt_vo>.
ASSERT sy-subrc = 0.
lo_ecatt_vo = <lg_ecatt_vo>.
ASSIGN lo_ecatt_vo->('PARAMS') TO <lg_params>.
ASSERT sy-subrc = 0.
lo_params = <lg_params>.
TRY.
get_impl_detail_from_dom( ).
CATCH cx_ecatt_apl INTO lx_ex.
lv_exc_occ = 'X'.
ENDTRY.
TRY.
get_vo_flags_from_dom( ).
CATCH cx_ecatt_apl INTO lx_ex.
lv_exc_occ = 'X'.
ENDTRY.
TRY.
get_business_msgs_from_dom( ).
CATCH cx_ecatt_apl INTO lx_ex.
lv_exc_occ = 'X'.
ENDTRY.
TRY.
CALL METHOD ('GET_PARAMS_FROM_DOM_NEW') " doesn't exist in 702
EXPORTING
im_params = lo_params.
CATCH cx_ecatt_apl INTO lx_ex.
lv_exc_occ = 'X'.
ENDTRY.
TRY.
get_variants_from_dom( lo_params ).
CATCH cx_ecatt_apl INTO lx_ex.
lv_exc_occ = 'X'.
ENDTRY.
TRY.
lv_exists = cl_apl_ecatt_object=>existence_check_object(
im_name = ch_object-d_obj_name
im_version = ch_object-d_obj_ver
im_obj_type = ch_object-s_obj_type
im_exists_any_version = 'X' ).
IF lv_exists EQ space.
CALL METHOD lo_ecatt_vo->('SET_TADIR_FOR_NEW_OBJECT')
EXPORTING
im_tadir_for_new_object = tadir_preset.
ENDIF.
CATCH cx_ecatt.
CLEAR lv_exists.
ENDTRY.
TRY.
CALL METHOD lo_ecatt_vo->('SAVE')
EXPORTING
im_do_commit = 'X'.
CATCH cx_ecatt_apl INTO lx_ex.
lv_exc_occ = 'X'.
ENDTRY.
* get devclass from existing object
TRY.
cl_apl_ecatt_object=>get_tadir_entry(
EXPORTING im_obj_name = ch_object-d_obj_name
im_obj_type = ch_object-s_obj_type
IMPORTING ex_tadir = ls_tadir ).
ch_object-d_devclass = ls_tadir-devclass.
CATCH cx_ecatt.
CLEAR ls_tadir.
ENDTRY.
IF lv_exc_occ = 'X'.
raise_upload_exception( previous = lx_ex ).
ENDIF.
ENDMETHOD.
METHOD upload_data_from_stream.
" Downport
template_over_all = zcl_abapgit_ecatt_helper=>upload_data_from_stream( mv_external_xml ).
ENDMETHOD.
METHOD zif_abapgit_ecatt_upload~set_stream_for_upload.
" downport from CL_ABAPGIT_ECATT_DATA_UPLOAD SET_STREAM_FOR_UPLOAD
mv_external_xml = iv_xml.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
721,
1078,
62,
2100,
62,
26801,
62,
84,
489,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
537,
62,
64,
489,
62,
721,
1078,
62,
25850,
198,
220,
25261,
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,
721,
1078,
62,
25850,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9516,
23848,
36,
20032,
17941,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
220,
220,
9516,
62,
7890,
62,
6738,
62,
5532,
23848,
36,
20032,
17941,
11,
628,
220,
220,
220,
220,
220,
651,
62,
22680,
62,
907,
14542,
62,
6738,
62,
3438,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
721,
1078,
62,
64,
489,
11,
628,
220,
220,
220,
220,
220,
651,
62,
23928,
62,
49170,
62,
6738,
62,
3438,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
721,
1078,
62,
64,
489,
11,
628,
220,
220,
220,
220,
220,
651,
62,
13038,
62,
33152,
62,
6738,
62,
3438,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43213,
62,
721,
1078,
62,
64,
489,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
285,
85,
62,
22615,
62,
19875,
41876,
2124,
8841,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
721,
1078,
62,
2100,
62,
26801,
62,
84,
489,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
651,
62,
22680,
62,
907,
14542,
62,
6738,
62,
3438,
13,
628,
220,
220,
220,
366,
866,
634,
422,
7852,
62,
2969,
43,
62,
2943,
17139,
62,
29516,
62,
52,
6489,
41048,
628,
220,
220,
220,
42865,
25,
7649,
62,
5458,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
611,
62,
844,
4029,
62,
30854,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
65,
1046,
62,
19662,
62,
5420,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
721,
1078,
14804,
316,
13038,
62,
10885,
62,
19662,
62,
8658,
4906,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
1069,
4516,
62,
13966,
12808,
41876,
304,
1122,
2364,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
721,
1078,
62,
13038,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
2134,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
25,
1279,
75,
70,
62,
721,
1078,
62,
13038,
29,
41876,
597,
13,
628,
220,
220,
220,
7649,
62,
5458,
796,
11055,
62,
2502,
62,
439,
3784,
19796,
62,
6738,
62,
3672,
62,
5907,
7,
705,
2767,
29516,
62,
5653,
38,
6,
6739,
628,
220,
220,
220,
16876,
5626,
7649,
62,
5458,
3180,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
10305,
10426,
5805,
62,
39170,
62,
10468,
62,
26947,
6,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
62,
292,
62,
3438,
220,
220,
220,
796,
7649,
62,
5458,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1366,
15252,
220,
220,
220,
220,
796,
300,
83,
62,
65,
1046,
62,
19662,
62,
5420,
198,
220,
220,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
5293,
62,
15252,
796,
352,
198,
220,
220,
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,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
220,
220,
30301,
1503,
300,
83,
62,
65,
1046,
62,
19662,
62,
5420,
13,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
24994,
16284,
19203,
2943,
17139,
62,
9864,
23680,
11537,
5390,
1279,
75,
70,
62,
721,
1078,
62,
13038,
28401,
198,
220,
220,
220,
24994,
17395,
827,
12,
7266,
6015,
796,
657,
13,
628,
220,
220,
220,
2376,
62,
721,
1078,
62,
13038,
796,
1279,
75,
70,
62,
721,
1078,
62,
13038,
28401,
628,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
42815,
337,
36252,
2376,
62,
721,
1078,
62,
13038,
3784,
10786,
28480,
62,
33,
32835,
44180,
62,
5653,
38,
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,
545,
62,
65,
1046,
62,
19662,
62,
5420,
796,
300,
83,
62,
65,
1046,
62,
19662,
62,
5420,
13,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
721,
1078,
62,
64,
489,
39319,
6631,
62,
1462,
62,
40225,
13,
198,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
1069,
4516,
62,
13966,
12808,
796,
705,
55,
4458,
198,
220,
220,
220,
23578,
40405,
13,
628,
220,
220,
220,
16876,
300,
85,
62,
1069,
4516,
62,
13966,
12808,
796,
705,
55,
4458,
198,
220,
220,
220,
220,
220,
5298,
62,
25850,
62,
1069,
4516,
7,
2180,
796,
6631,
62,
1462,
62,
40225,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
651,
62,
23928,
62,
49170,
62,
6738,
62,
3438,
13,
628,
220,
220,
220,
366,
866,
634,
422,
7852,
62,
2969,
43,
62,
2943,
17139,
62,
29516,
62,
52,
6489,
41048
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
*---------------------------------------------------------------------*
* program for: VIEWFRAME_ZVTBDLS
* generation date: 13.11.2020 at 11:11:48
* view maintenance generator version: #001407#
*---------------------------------------------------------------------*
FUNCTION VIEWFRAME_ZVTBDLS .
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_ZVTBDLS'
EXPORTING
FCODE = READ
VIEW_ACTION = VIEW_ACTION
VIEW_NAME = VIEW_NAME
TABLES
EXCL_CUA_FUNCT = EXCL_CUA_FUNCT
EXTRACT = ZVTBDLS_EXTRACT
TOTAL = ZVTBDLS_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_ZVTBDLS'
EXPORTING
FCODE = EDIT
VIEW_ACTION = MAINT_MODE
VIEW_NAME = VIEW_NAME
CORR_NUMBER = CORR_NUMBER
IMPORTING
UCOMM = FUNCTION
UPDATE_REQUIRED = STATUS_ZVTBDLS-UPD_FLAG
TABLES
EXCL_CUA_FUNCT = EXCL_CUA_FUNCT
EXTRACT = ZVTBDLS_EXTRACT
TOTAL = ZVTBDLS_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_ZVTBDLS-UPD_FLAG NE SPACE.
PERFORM BEENDEN.
CASE SY-SUBRC.
WHEN 0.
CALL FUNCTION 'VIEWPROC_ZVTBDLS'
EXPORTING
FCODE = SAVE
VIEW_ACTION = MAINT_MODE
VIEW_NAME = VIEW_NAME
CORR_NUMBER = CORR_NUMBER
IMPORTING
UPDATE_REQUIRED = STATUS_ZVTBDLS-UPD_FLAG
TABLES
EXCL_CUA_FUNCT = EXCL_CUA_FUNCT
EXTRACT = ZVTBDLS_EXTRACT
TOTAL = ZVTBDLS_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_ZVTBDLS-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_ZVTBDLS-UPD_FLAG NE SPACE.
PERFORM TRANSPORTIEREN.
CASE SY-SUBRC.
WHEN 0.
CALL FUNCTION 'VIEWPROC_ZVTBDLS'
EXPORTING
FCODE = SAVE
VIEW_ACTION = MAINT_MODE
VIEW_NAME = VIEW_NAME
CORR_NUMBER = CORR_NUMBER
IMPORTING
UPDATE_REQUIRED =
STATUS_ZVTBDLS-UPD_FLAG
TABLES
EXCL_CUA_FUNCT = EXCL_CUA_FUNCT
EXTRACT = ZVTBDLS_EXTRACT
TOTAL = ZVTBDLS_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_ZVTBDLS'
EXPORTING
FCODE = FUNCTION
VIEW_ACTION = MAINT_MODE
VIEW_NAME = VIEW_NAME
CORR_NUMBER = CORR_NUMBER
IMPORTING
UPDATE_REQUIRED = STATUS_ZVTBDLS-UPD_FLAG
TABLES
EXCL_CUA_FUNCT = EXCL_CUA_FUNCT
EXTRACT = ZVTBDLS_EXTRACT
TOTAL = ZVTBDLS_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,
36392,
14529,
6561,
198,
9,
220,
220,
5270,
3128,
25,
1511,
13,
1157,
13,
42334,
379,
1367,
25,
1157,
25,
2780,
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,
36392,
14529,
6561,
220,
220,
220,
220,
220,
220,
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,
36392,
14529,
6561,
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,
36392,
14529,
6561,
62,
6369,
5446,
10659,
198,
51,
27510,
796,
1168,
36392,
14529,
6561,
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,
36392,
14529,
6561,
6,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
10029,
16820,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
48483,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49880,
62,
44710,
220,
220,
220,
220,
796,
8779,
12394,
62,
49058,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
49880,
62,
20608,
220,
220,
220,
220,
220,
220,
796,
49880,
62,
20608,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23929,
49,
62,
41359,
13246,
220,
220,
220,
220,
796,
23929,
49,
62,
41359,
13246,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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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
] |
CLASS local_test_class 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 local_test_class IMPLEMENTATION.
METHOD get_cut.
result ?= NEW y_check_constants_interface( ).
ENDMETHOD.
METHOD get_code_with_issue.
result = VALUE #(
( 'REPORT y_example.' )
( 'INTERFACE lcl_interface.' )
( ' CONSTANTS: BEGIN OF struct, ' )
( ' int TYPE i VALUE 1,' )
( ' END OF struct.' )
( ' CONSTANTS const_name TYPE abap_bool VALUE abap_false. ' )
( 'ENDINTERFACE.' )
).
ENDMETHOD.
METHOD get_code_without_issue.
result = VALUE #(
( 'REPORT y_example.' )
( 'INTERFACE lcl_interface. ' )
( ' METHODS method_name. ' )
( ' CONSTANTS const_name TYPE abap_bool VALUE abap_false. ' )
( 'ENDINTERFACE.' )
).
ENDMETHOD.
METHOD get_code_with_exemption.
result = VALUE #(
( 'REPORT y_example.' )
( 'INTERFACE lcl_interface. "#EC CONS_INTF' )
( ' CONSTANTS: BEGIN OF struct, ' )
( ' int TYPE i VALUE 1,' )
( ' END OF struct.' )
( ' CONSTANTS const_name TYPE abap_bool VALUE abap_false. ' )
( 'ENDINTERFACE.' )
).
ENDMETHOD.
ENDCLASS.
| [
31631,
1957,
62,
9288,
62,
4871,
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,
1957,
62,
9288,
62,
4871,
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,
9979,
1187,
62,
39994,
7,
6739,
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,
2200,
15490,
331,
62,
20688,
2637,
1267,
628,
220,
220,
220,
220,
220,
357,
705,
41358,
49836,
300,
565,
62,
39994,
2637,
1267,
198,
220,
220,
220,
220,
220,
357,
705,
7102,
2257,
1565,
4694,
25,
347,
43312,
3963,
2878,
11,
705,
1267,
198,
220,
220,
220,
220,
220,
357,
705,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
493,
41876,
1312,
26173,
8924,
352,
4032,
1267,
198,
220,
220,
220,
220,
220,
357,
705,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
2878,
2637,
1267,
198,
220,
220,
220,
220,
220,
357,
705,
7102,
2257,
1565,
4694,
1500,
62,
3672,
41876,
450,
499,
62,
30388,
26173,
8924,
450,
499,
62,
9562,
13,
705,
1267,
198,
220,
220,
220,
220,
220,
357,
705,
10619,
41358,
49836,
2637,
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,
2200,
15490,
331,
62,
20688,
2637,
1267,
628,
220,
220,
220,
220,
220,
357,
705,
41358,
49836,
300,
565,
62,
39994,
13,
705,
1267,
198,
220,
220,
220,
220,
220,
357,
705,
337,
36252,
50,
2446,
62,
3672,
13,
705,
1267,
198,
220,
220,
220,
220,
220,
357,
705,
7102,
2257,
1565,
4694,
1500,
62,
3672,
41876,
450,
499,
62,
30388,
26173,
8924,
450,
499,
62,
9562,
13,
705,
1267,
198,
220,
220,
220,
220,
220,
357,
705,
10619,
41358,
49836,
2637,
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,
2200,
15490,
331,
62,
20688,
2637,
1267,
628,
220,
220,
220,
220,
220,
357,
705,
41358,
49836,
300,
565,
62,
39994,
13,
25113,
2943,
39537,
62,
1268,
10234,
6,
1267,
198,
220,
220,
220,
220,
220,
357,
705,
7102,
2257,
1565,
4694,
25,
347,
43312,
3963,
2878,
11,
705,
1267,
198,
220,
220,
220,
220,
220,
357,
705,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
493,
41876,
1312,
26173,
8924,
352,
4032,
1267,
198,
220,
220,
220,
220,
220,
357,
705,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
23578,
3963,
2878,
2637,
1267,
198,
220,
220,
220,
220,
220,
357,
705,
7102,
2257,
1565,
4694,
1500,
62,
3672,
41876,
450,
499,
62,
30388,
26173,
8924,
450,
499,
62,
9562,
13,
705,
1267,
198,
220,
220,
220,
220,
220,
357,
705,
10619,
41358,
49836,
2637,
1267,
198,
220,
220,
220,
6739,
198,
220,
23578,
49273,
13,
198,
198,
10619,
31631,
13,
198
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1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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
] |
*/--------------------------------------------------------------------------------\
*| This file is part of Mockup loader |
*| |
*| The MIT License (MIT) |
*| |
*| Copyright (c) 2015 SBCG Team (www.sbcg.com.ua), Alexander Tsybulsky |
*| |
*| Permission is hereby granted, free of charge, to any person obtaining a copy |
*| of this software and associated documentation files (the "Software"), to deal |
*| in the Software without restriction, including without limitation the rights |
*| to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
*| copies of the Software, and to permit persons to whom the Software is |
*| furnished to do so, subject to the following conditions: |
*| |
*| The above copyright notice and this permission notice shall be included in all |
*| copies or substantial portions of the Software. |
*| |
*| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
*| IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
*| FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
*| AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
*| LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
*| OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
*| SOFTWARE. |
*\--------------------------------------------------------------------------------/
*| project homepage: https://github.com/sbcgua/mockup_loader |
*\--------------------------------------------------------------------------------/
**********************************************************************
* MACRO
**********************************************************************
define test_parse.
clear dummy.
read table lo_struc_descr->components into ls_component with key name = '&1'.
o->parse_field(
exporting
is_component = ls_component
i_data = &2
importing
e_field = dummy-&1 ).
end-of-definition.
define test_parse_positive.
clear lo_ex.
try.
test_parse &1 &2.
catch zcx_mockup_loader_error into lo_ex.
cl_abap_unit_assert=>fail( lo_ex->get_text( ) ).
endtry.
cl_abap_unit_assert=>assert_equals( act = dummy-&1 exp = &3 msg = 'Parse field positive:' && &2 ).
end-of-definition.
define test_parse_negative.
clear lo_ex.
try.
test_parse &1 &2.
catch zcx_mockup_loader_error into lo_ex.
endtry.
cl_abap_unit_assert=>assert_not_initial( act = lo_ex msg = 'Parse field negative:' && &2 ).
cl_abap_unit_assert=>assert_equals( exp = &3 act = lo_ex->code ).
end-of-definition.
define append_dummy.
e_dummy_struc-tdate = &1.
e_dummy_struc-tchar = &2.
e_dummy_struc-tstring = &3.
e_dummy_struc-tdecimal = &4.
e_dummy_struc-tnumber = &5.
if i_strict = abap_true.
e_dummy_struc-traw = &6.
e_dummy_struc-tinteger = &7.
e_dummy_struc-talpha = &8.
endif.
append e_dummy_struc to e_dummy_tab.
end-of-definition.
define assert_excode.
cl_abap_unit_assert=>assert_not_initial( act = lo_ex ).
cl_abap_unit_assert=>assert_equals( exp = &1 act = lo_ex->code ).
end-of-definition.
**********************************************************************
* DEPENDENCIES CHECK
**********************************************************************
class ltcl_dependencies_version definition final
for testing
duration short
risk level harmless.
private section.
methods check_text2tab_version for testing.
endclass.
class ltcl_dependencies_version implementation.
method check_text2tab_version.
constants lc_required_ver type string value zif_mockup_loader=>c_required_text2tab_ver.
if abap_false = zcl_text2tab_parser=>check_version_fits( lc_required_ver ).
cl_abap_unit_assert=>fail( |data parser version ({
zif_text2tab_constants=>version }) is lower than required ({
lc_required_ver })| ). "#EC NOTEXT
endif.
endmethod.
endclass.
**********************************************************************
* Test Class definition
**********************************************************************
class ltcl_test_mockup_loader definition for testing
duration short
risk level harmless.
public section.
types:
begin of ty_dummy,
mandt type mandt,
tdate type datum,
tchar type c length 8,
traw type thraw1,
tstring type string,
talpha type veri_alpha,
tdecimal type dmbtr,
tnumber type n length 4,
tinteger type i,
end of ty_dummy,
tt_dummy type table of ty_dummy with default key.
types:
begin of ty_dummy_corresponding,
tdate type datum,
tchar type c length 8,
_another type i,
end of ty_dummy_corresponding,
tt_dummy_corresponding type standard table of ty_dummy_corresponding with default key.
types:
begin of ty_deep_line,
docid type i,
lineid type i,
text type string,
end of ty_deep_line,
tt_deep_line type standard table of ty_deep_line with key docid lineid,
begin of ty_deep_head,
docid type i,
lines type tt_deep_line,
first_line type ty_deep_line,
end of ty_deep_head,
tt_deep_head type standard table of ty_deep_head with key docid.
private section.
constants c_tab like cl_abap_char_utilities=>horizontal_tab value cl_abap_char_utilities=>horizontal_tab.
constants c_crlf like cl_abap_char_utilities=>cr_lf value cl_abap_char_utilities=>cr_lf.
constants c_lf like cl_abap_char_utilities=>newline value cl_abap_char_utilities=>newline.
data o type ref to zcl_mockup_loader. "class under test
class-methods class_setup.
methods setup.
methods read_zip for testing.
methods integrated_test for testing.
methods source_redirect_test for testing.
methods utf16_encoding for testing.
methods parse_data for testing.
methods load_blob for testing raising zcx_mockup_loader_error.
methods load_data_to_ref for testing.
methods load_deep for testing raising zcx_mockup_loader_error.
methods load_deep_negative for testing.
methods load_corresponding for testing raising zcx_mockup_loader_error.
methods load_corresponding_w_filter for testing raising zcx_mockup_loader_error.
methods load_w_renames for testing raising zcx_mockup_loader_error.
methods assert_version for testing.
methods get_dummy_data
importing
i_strict type abap_bool default abap_true
exporting
e_dummy_struc type ty_dummy
e_dummy_tab type tt_dummy
e_dummy_string type string.
methods create_default
returning value(r_o) type ref to zcl_mockup_loader
raising zcx_mockup_loader_error.
endclass.
* Friends
class zcl_mockup_loader definition local friends ltcl_test_mockup_loader.
**********************************************************************
* Implementation
**********************************************************************
class ltcl_test_mockup_loader implementation.
**********************************************************************
* Setup methods
**********************************************************************
method class_setup.
data l_type_tmp type zif_mockup_loader=>ty_src_type.
get parameter id 'ZMOCKUP_LOADER_STYPE' field l_type_tmp.
if l_type_tmp is not initial.
cl_abap_unit_assert=>fail(
quit = 2 "cancel-class
msg = 'Load source is redirected,'
&& ' please reset with ZMOCKUP_LOADER_SWITCH_SOURCE before running the test' ). "#EC NOTEXT
endif.
endmethod.
method create_default.
r_o = zcl_mockup_loader=>create(
i_type = 'MIME'
i_path = 'ZMOCKUP_LOADER_UNIT_TEST'
i_amt_format = '' " default
i_encoding = zif_mockup_loader_constants=>encoding_utf8 ). " utf8
endmethod.
method setup.
data lo_ex type ref to zcx_mockup_loader_error.
try.
o = create_default( ).
catch zcx_mockup_loader_error into lo_ex.
cl_abap_unit_assert=>fail( lo_ex->get_text( ) ).
endtry.
endmethod.
**********************************************************************
* Dummy data generation
**********************************************************************
method get_dummy_data.
data l_string type string.
if i_strict = abap_true.
l_string = 'MANDT\tTDATE\tTCHAR\tTRAW\tTSTRING\tTALPHA\tTDECIMAL\tTNUMBER\tTINTEGER\n'
&& '\t01.01.2015\tTrololo1\t8A\tString1\t100000\t1234567,81\t2015\t1111\n'
&& '\t02.01.2016\tTrololo2\t8B\tString2\t200000\t1234567,82\t2016\t2222\n'
&& '\t03.01.2016\tTrololo3\t8C\tString3\t300000\t1234567,83\t2015\t3333\n' .
else.
l_string = 'TDATE\tTSTRING\tTCHAR\tTDECIMAL\tTNUMBER\n'
&& '01.01.2015\tString1\tTrololo1\t1234567,81\t2015\n'
&& '02.01.2016\tString2\tTrololo2\t1234567,82\t2016\n'
&& '03.01.2016\tString3\tTrololo3\t1234567,83\t2015\n' .
endif.
replace all occurrences of '\t' in l_string with c_tab.
replace all occurrences of '\n' in l_string with c_crlf.
clear e_dummy_tab.
" TDATE TCHAR TSTRING TDECIMAL TNUM TRAW TINT TALPHA
append_dummy '20150101' 'Trololo1' 'String1' '1234567.81' 2015 '8A' 1111 '0000100000'.
append_dummy '20160102' 'Trololo2' 'String2' '1234567.82' 2016 '8B' 2222 '0000200000'.
append_dummy '20160103' 'Trololo3' 'String3' '1234567.83' 2015 '8C' 3333 '0000300000'.
read table e_dummy_tab into e_dummy_struc index 1.
e_dummy_string = l_string.
endmethod.
**********************************************************************
* Simple integrated test - most basic usage of the class
**********************************************************************
method integrated_test.
data:
dummy_act type ty_dummy,
dummy_exp type ty_dummy,
dummy_tab_act type tt_dummy,
dummy_tab_exp type tt_dummy,
lo_ex type ref to zcx_mockup_loader_error.
get_dummy_data(
importing
e_dummy_struc = dummy_exp
e_dummy_tab = dummy_tab_exp ).
" Strict ********************************************************
try.
o->load_data(
exporting
i_obj = 'testdir/testfile_complete'
i_strict = abap_true
importing
e_container = dummy_tab_act ).
cl_abap_unit_assert=>assert_equals( act = dummy_tab_act exp = dummy_tab_exp ).
o->load_data(
exporting
i_obj = 'testdir/testfile_complete'
i_strict = abap_true
importing
e_container = dummy_act ).
cl_abap_unit_assert=>assert_equals( act = dummy_act exp = dummy_exp ).
o->load_data( " No MANDT field in file
exporting
i_obj = 'testdir/testfile_no_mandt'
i_strict = abap_true
importing
e_container = dummy_tab_act ).
cl_abap_unit_assert=>assert_equals( act = dummy_tab_act exp = dummy_tab_exp ).
catch zcx_mockup_loader_error into lo_ex.
cl_abap_unit_assert=>fail( lo_ex->get_text( ) ).
endtry.
" NOT Strict ****************************************************
get_dummy_data(
exporting i_strict = abap_false
importing e_dummy_tab = dummy_tab_exp ).
try.
o->load_data(
exporting
i_obj = 'testdir/testfile_no_strict'
i_strict = abap_false
importing
e_container = dummy_tab_act ).
cl_abap_unit_assert=>assert_equals( act = dummy_tab_act exp = dummy_tab_exp ).
catch zcx_mockup_loader_error into lo_ex.
cl_abap_unit_assert=>fail( lo_ex->get_text( ) ).
endtry.
" With where ****************************************************
get_dummy_data( importing e_dummy_tab = dummy_tab_exp ).
read table dummy_tab_exp into dummy_exp with key tnumber = '2016'.
delete dummy_tab_exp where tnumber <> '2016'.
try.
o->load_data(
exporting
i_obj = 'testdir/testfile_complete'
i_where = 'TNUMBER = 2016'
importing
e_container = dummy_tab_act ).
cl_abap_unit_assert=>assert_equals( act = dummy_tab_act exp = dummy_tab_exp ).
o->load_data(
exporting
i_obj = 'testdir/testfile_complete'
i_where = 'TNUMBER = 2016'
importing
e_container = dummy_act ).
cl_abap_unit_assert=>assert_equals( act = dummy_act exp = dummy_exp ).
catch zcx_mockup_loader_error into lo_ex.
cl_abap_unit_assert=>fail( lo_ex->get_text( ) ).
endtry.
" No container ***************************************************
try.
o->load_data( i_obj = 'testdir/testfile_complete' ).
catch zcx_mockup_loader_error into lo_ex.
endtry.
assert_excode 'NC'.
endmethod.
**********************************************************************
* Source redirection via SET/GET parameters test
**********************************************************************
method source_redirect_test.
constants:
lc_getset_type type memoryid value 'ZMOCKUP_LOADER_STYPE',
lc_getset_mime type memoryid value 'ZMOCKUP_LOADER_SMIME',
lc_getset_file type memoryid value 'ZMOCKUP_LOADER_SPATH'.
data:
lx_ut type ref to cx_aunit_fail,
l_mime_bak type c length 40,
l_file_bak type c length 40.
data:
lo_ex type ref to zcx_mockup_loader_error,
l_type type zif_mockup_loader=>ty_src_type,
l_path type c length 40.
" "DANGEROUS" TEST AS MODIFIES SET/GET PARAMS
define _bak_params.
get parameter id lc_getset_file field l_file_bak.
get parameter id lc_getset_mime field l_mime_bak.
end-of-definition.
define _restore_params.
clear l_type.
set parameter id lc_getset_type field l_type.
set parameter id lc_getset_file field l_file_bak.
set parameter id lc_getset_mime field l_mime_bak.
end-of-definition.
cl_abap_unit_assert=>assert_false( o->zif_mockup_loader~is_redirected( ) ).
" MIME
_bak_params.
l_type = 'MIME'.
set parameter id lc_getset_type field l_type.
l_path = 'ZMOCKUP_LOADER_WRONG_OBJECT'.
set parameter id lc_getset_mime field l_path.
clear lo_ex.
try.
o = create_default( ).
cl_abap_unit_assert=>assert_true( o->zif_mockup_loader~is_redirected( ) ).
catch zcx_mockup_loader_error into lo_ex.
endtry.
_restore_params.
assert_excode 'RE'.
" FILE
_bak_params.
l_type = 'FILE'.
set parameter id lc_getset_type field l_type.
l_path = 'ZMOCKUP_LOADER_WRONG_OBJECT'.
set parameter id lc_getset_file field l_path.
l_path = 'ZMOCKUP_LOADER_UNIT_TEST'.
set parameter id lc_getset_mime field l_path. " replace the mock which was in setup
clear lo_ex.
try.
o = create_default( ).
cl_abap_unit_assert=>assert_true( o->zif_mockup_loader~is_redirected( ) ).
catch zcx_mockup_loader_error into lo_ex.
endtry.
_restore_params.
assert_excode 'RE'.
" FILE, BUT FOR ANOTHER MIME
_bak_params.
l_type = 'FILE'.
set parameter id lc_getset_type field l_type.
l_path = 'ZMOCKUP_LOADER_WRONG_OBJECT'.
set parameter id lc_getset_file field l_path.
l_path = 'ZMOCKUP_LOADER_NOT_EXISTING'.
set parameter id lc_getset_mime field l_path. " replace the mock which was in setup
clear lo_ex.
try.
o = create_default( ).
cl_abap_unit_assert=>assert_false( o->zif_mockup_loader~is_redirected( ) ).
catch zcx_mockup_loader_error into lo_ex.
endtry.
_restore_params.
cl_abap_unit_assert=>assert_initial( lo_ex ).
cl_abap_unit_assert=>assert_false( o->zif_mockup_loader~is_redirected( ) ).
endmethod.
**********************************************************************
* Check Unicode encoding parsing
**********************************************************************
method utf16_encoding.
data:
dummy_tab_act type tt_dummy,
dummy_tab_exp type tt_dummy,
lo_ex type ref to zcx_mockup_loader_error.
get_dummy_data( importing e_dummy_tab = dummy_tab_exp ).
try.
o->set_params( i_amt_format = '' i_encoding = zif_mockup_loader_constants=>encoding_utf16 ). " UTF16
o->load_data(
exporting i_obj = 'testdir/testfile_complete_utf16'
importing e_container = dummy_tab_act ).
catch zcx_mockup_loader_error into lo_ex.
cl_abap_unit_assert=>fail( lo_ex->get_text( ) ).
endtry.
cl_abap_unit_assert=>assert_equals( act = dummy_tab_act exp = dummy_tab_exp ).
endmethod.
**********************************************************************
* Test of data parser - dummy data is supplied to the tested method
**********************************************************************
method parse_data.
data:
dummy_val type c length 40,
dummy_act type ty_dummy,
dummy_tab_act type tt_dummy,
dummy_htab type hashed table of ty_dummy with unique key tdate,
dummy_stab type sorted table of ty_dummy with unique key tdate,
dummy_exp type ty_dummy,
dummy_tab_exp type tt_dummy,
l_string type string,
lo_ex type ref to zcx_mockup_loader_error.
" Strict parsing *********************************
get_dummy_data(
importing
e_dummy_struc = dummy_exp
e_dummy_tab = dummy_tab_exp
e_dummy_string = l_string ).
try.
o->parse_data(
exporting
i_rawdata = l_string
i_strict = abap_true
importing
e_container = dummy_act ).
o->parse_data(
exporting
i_rawdata = l_string
i_strict = abap_true
importing
e_container = dummy_tab_act ).
catch zcx_mockup_loader_error into lo_ex.
cl_abap_unit_assert=>fail( lo_ex->get_text( ) ).
endtry.
cl_abap_unit_assert=>assert_equals( act = dummy_act exp = dummy_exp ).
cl_abap_unit_assert=>assert_equals( act = dummy_tab_act exp = dummy_tab_exp ).
" Parse to sorted and hashed tables ***************
try.
o->parse_data(
exporting
i_rawdata = l_string
i_strict = abap_true
importing
e_container = dummy_stab ).
catch zcx_mockup_loader_error into lo_ex.
cl_abap_unit_assert=>fail( lo_ex->get_text( ) ).
endtry.
cl_abap_unit_assert=>assert_equals( act = dummy_stab exp = dummy_tab_exp ).
try.
o->parse_data(
exporting
i_strict = abap_true
i_rawdata = l_string
importing
e_container = dummy_htab ).
catch zcx_mockup_loader_error into lo_ex.
cl_abap_unit_assert=>fail( lo_ex->get_text( ) ).
endtry.
cl_abap_unit_assert=>assert_equals( act = dummy_htab exp = dummy_tab_exp ).
" NOT STRICT parsing ******************************
get_dummy_data(
exporting
i_strict = abap_false
importing
e_dummy_tab = dummy_tab_exp
e_dummy_string = l_string ).
try.
o->parse_data(
exporting
i_rawdata = l_string
i_strict = abap_false
importing
e_container = dummy_tab_act ).
catch zcx_mockup_loader_error into lo_ex.
cl_abap_unit_assert=>fail( lo_ex->get_text( ) ).
endtry.
cl_abap_unit_assert=>assert_equals( act = dummy_tab_act exp = dummy_tab_exp ).
" Catch parser errors, e.g. unknown field
clear lo_ex.
get_dummy_data( importing e_dummy_string = l_string ).
replace first occurrence of 'TDATE' in l_string with 'UNKNOWN_FIELD'.
try.
o->parse_data(
exporting
i_rawdata = l_string
i_strict = abap_true
importing
e_container = dummy_tab_act ).
catch zcx_mockup_loader_error into lo_ex.
endtry.
assert_excode 'XE'.
" Parse to field (not table or structure) *************
clear lo_ex.
get_dummy_data( importing e_dummy_string = l_string ).
try.
o->parse_data(
exporting
i_rawdata = l_string
i_strict = abap_true
importing
e_container = dummy_val ).
catch zcx_mockup_loader_error into lo_ex.
endtry.
assert_excode 'DT'.
" Parse empty file ************************************
clear lo_ex.
clear l_string.
try.
o->parse_data(
exporting
i_rawdata = l_string
i_strict = abap_true
importing
e_container = dummy_tab_act ).
catch zcx_mockup_loader_error into lo_ex.
endtry.
assert_excode 'XE'. " parser error
endmethod.
**********************************************************************
* ZIP file read test - gets data from SMW0 ZMOCKUP_LOADER_UNIT_TEST
**********************************************************************
method read_zip.
data:
l_str type string,
lo_ex type ref to zcx_mockup_loader_error.
cl_abap_unit_assert=>assert_not_initial( act = lines( o->mo_zip->files ) ).
" Positive ***************************************
try.
l_str = o->read_zip( i_name = 'testdir/testfile_complete.txt' ).
catch zcx_mockup_loader_error into lo_ex.
cl_abap_unit_assert=>fail( lo_ex->get_text( ) ).
endtry.
cl_abap_unit_assert=>assert_not_initial( act = l_str ).
" NEGATIVE - wrong file name **********************
clear lo_ex.
try.
l_str = o->read_zip( i_name = 'testdir/wrong_filename.xyz' ).
catch zcx_mockup_loader_error into lo_ex.
endtry.
assert_excode 'ZF'.
" NEGATIVE - wrong code page **********************
clear lo_ex.
try.
l_str = o->read_zip( i_name = 'testdir/testfile_complete_utf16.txt' ).
catch zcx_mockup_loader_error into lo_ex.
endtry.
assert_excode 'CP'.
endmethod.
**********************************************************************
* LOAD_RAW - test load only method e.g. for XMLs
**********************************************************************
method load_blob.
data:
lo_ex type ref to zcx_mockup_loader_error,
l_str_exp type string,
l_xstr_act type xstring,
l_str_act type string,
lo_conv type ref to cl_abap_conv_in_ce.
l_str_exp = '<?xml version="1.0"?><mytag>mydata</mytag>'.
" .XML
lo_conv = cl_abap_conv_in_ce=>create( encoding = zif_mockup_loader_constants=>encoding_utf8 ).
l_xstr_act = o->load_blob( 'testdir/test_raw.xml' ).
lo_conv->convert(
exporting
input = l_xstr_act
importing
data = l_str_act ).
cl_abap_unit_assert=>assert_equals(
act = l_str_act
exp = l_str_exp ).
" .TXT
l_xstr_act = o->load_blob( 'testdir/test_raw.txt' ).
lo_conv->convert(
exporting
input = l_xstr_act
importing
data = l_str_act ).
cl_abap_unit_assert=>assert_equals(
act = l_str_act
exp = l_str_exp ).
" Missing file
try .
o->load_blob( 'testdir/no-file-like-this' ).
cl_abap_unit_assert=>fail( ).
catch zcx_mockup_loader_error into lo_ex.
cl_abap_unit_assert=>assert_equals(
act = lo_ex->code
exp = 'ZF' ).
endtry.
" Case insensitive path
lo_conv = cl_abap_conv_in_ce=>create( encoding = zif_mockup_loader_constants=>encoding_utf8 ).
l_xstr_act = o->load_blob( 'TESTDIR/test_raw.xml' ).
lo_conv->convert(
exporting
input = l_xstr_act
importing
data = l_str_act ).
cl_abap_unit_assert=>assert_equals(
act = l_str_act
exp = l_str_exp ).
endmethod.
method load_data_to_ref.
data:
dummy_tab_act type tt_dummy,
dummy_tab_exp type tt_dummy,
lo_ex type ref to zcx_mockup_loader_error.
data lr_data type ref to data.
create data lr_data type tt_dummy.
field-symbols <act> type tt_dummy.
get_dummy_data( importing e_dummy_tab = dummy_tab_exp ).
try.
o->load_data(
exporting i_obj = 'testdir/testfile_complete'
importing e_container = lr_data ).
assign lr_data->* to <act>.
cl_abap_unit_assert=>assert_equals( act = <act> exp = dummy_tab_exp ).
catch zcx_mockup_loader_error into lo_ex.
cl_abap_unit_assert=>fail( lo_ex->get_text( ) ).
endtry.
endmethod. " load_data_to_ref.
method assert_version.
data lx type ref to zcx_mockup_loader_error.
try .
zcl_mockup_loader=>assert_version( zif_mockup_loader=>version ).
catch zcx_mockup_loader_error into lx.
endtry.
cl_abap_unit_assert=>assert_not_bound( lx ).
try .
zcl_mockup_loader=>assert_version( 'v999.999.999' ).
catch zcx_mockup_loader_error into lx.
cl_abap_unit_assert=>assert_char_cp(
act = lx->msg
exp = '*loader version*' ).
endtry.
cl_abap_unit_assert=>assert_bound( lx ).
endmethod.
method load_deep.
" DATA
data lt_docs_exp type tt_deep_head.
field-symbols <h> like line of lt_docs_exp.
field-symbols <l> like line of <h>-lines.
append initial line to lt_docs_exp assigning <h>.
<h>-docid = 1.
<h>-first_line-docid = 1.
<h>-first_line-lineid = 1.
<h>-first_line-text = 'Hello'.
append initial line to <h>-lines assigning <l>.
<l>-docid = 1.
<l>-lineid = 1.
<l>-text = 'Hello'.
append initial line to <h>-lines assigning <l>.
<l>-docid = 1.
<l>-lineid = 2.
<l>-text = 'Mockup'.
append initial line to lt_docs_exp assigning <h>.
<h>-docid = 2.
<h>-first_line-docid = 2.
<h>-first_line-lineid = 1.
<h>-first_line-text = 'Loader'.
append initial line to <h>-lines assigning <l>.
<l>-docid = 2.
<l>-lineid = 1.
<l>-text = 'Loader'.
append initial line to lt_docs_exp assigning <h>.
<h>-docid = 3.
append initial line to lt_docs_exp assigning <h>.
<h>-docid = 4.
<h>-first_line-docid = 99.
<h>-first_line-lineid = 1.
<h>-first_line-text = '!!!'.
append initial line to <h>-lines assigning <l>.
<l>-docid = 99.
<l>-lineid = 1.
<l>-text = '!!!'.
append initial line to lt_docs_exp assigning <h>.
<h>-docid = 5.
" TEST
data lt_docs_act like lt_docs_exp.
o->load_data(
exporting
i_obj = 'testdir/deep_head'
i_deep = abap_true
importing
e_container = lt_docs_act ).
cl_abap_unit_assert=>assert_equals( act = lt_docs_act exp = lt_docs_exp ).
endmethod.
method load_deep_negative.
data lt_docs_act type tt_deep_head.
data lx type ref to zcx_mockup_loader_error.
try .
o->load_data(
exporting
i_obj = 'testdir/deep_head_with_wrong_path'
i_deep = abap_true
importing
e_container = lt_docs_act ).
cl_abap_unit_assert=>fail( ).
catch zcx_mockup_loader_error into lx.
cl_abap_unit_assert=>assert_equals( act = lx->code exp = 'XE' ).
endtry.
try .
o->load_data(
exporting
i_obj = 'testdir/deep_head_with_wrong_field'
i_deep = abap_true
importing
e_container = lt_docs_act ).
cl_abap_unit_assert=>fail( ).
catch zcx_mockup_loader_error into lx.
cl_abap_unit_assert=>assert_equals( act = lx->code exp = 'XE' ).
endtry.
endmethod.
method load_corresponding.
data:
dummy_tab_act type tt_dummy_corresponding,
dummy_tab_exp type tt_dummy_corresponding,
dummy_tab_exp_full type tt_dummy.
field-symbols <full> like line of dummy_tab_exp_full.
field-symbols <exp> like line of dummy_tab_exp.
get_dummy_data( importing e_dummy_tab = dummy_tab_exp_full ).
loop at dummy_tab_exp_full assigning <full>.
append initial line to dummy_tab_exp assigning <exp>.
move-corresponding <full> to <exp>.
endloop.
o->load_data(
exporting
i_obj = 'testdir/testfile_complete'
i_strict = abap_false
i_corresponding = abap_true
importing
e_container = dummy_tab_act ).
cl_abap_unit_assert=>assert_equals(
act = dummy_tab_act
exp = dummy_tab_exp ).
delete dummy_tab_exp where tchar <> 'Trololo3'.
clear dummy_tab_act.
o->load_data(
exporting
i_obj = 'testdir/testfile_complete'
i_strict = abap_false
i_corresponding = abap_true
i_where = 'tchar = Trololo3'
importing
e_container = dummy_tab_act ).
cl_abap_unit_assert=>assert_equals(
act = dummy_tab_act
exp = dummy_tab_exp ).
endmethod.
method load_corresponding_w_filter.
data:
dummy_tab_act type tt_dummy_corresponding,
dummy_tab_exp type tt_dummy_corresponding,
dummy_tab_exp_full type tt_dummy.
field-symbols <full> like line of dummy_tab_exp_full.
field-symbols <exp> like line of dummy_tab_exp.
get_dummy_data( importing e_dummy_tab = dummy_tab_exp_full ).
loop at dummy_tab_exp_full assigning <full>.
check <full>-tnumber = '2015'.
append initial line to dummy_tab_exp assigning <exp>.
move-corresponding <full> to <exp>.
endloop.
o->load_data(
exporting
i_obj = 'testdir/testfile_complete'
i_strict = abap_false
i_corresponding = abap_true
i_where = 'tnumber = 2015'
importing
e_container = dummy_tab_act ).
cl_abap_unit_assert=>assert_equals(
act = dummy_tab_act
exp = dummy_tab_exp ).
data lt_filter type zif_mockup_loader=>tt_filter.
data lt_range type range of ty_dummy-tnumber.
" Filter table
field-symbols <f> like line of lt_filter.
append initial line to lt_filter assigning <f>.
<f>-name = 'TNUMBER'.
<f>-type = 'R'.
get reference of lt_range into <f>-valref.
field-symbols <r> like line of lt_range.
append initial line to lt_range assigning <r>.
<r>-sign = 'I'.
<r>-option = 'EQ'.
<r>-low = '2015'.
clear dummy_tab_act.
o->load_data(
exporting
i_obj = 'testdir/testfile_complete'
i_strict = abap_false
i_corresponding = abap_true
i_where = lt_filter
importing
e_container = dummy_tab_act ).
cl_abap_unit_assert=>assert_equals(
act = dummy_tab_act
exp = dummy_tab_exp ).
endmethod.
method load_w_renames.
types:
begin of lty_dummy_w_renames,
tdate type datum,
ychar type c length 8,
end of lty_dummy_w_renames.
data:
dummy_act type lty_dummy_w_renames,
dummy_exp type lty_dummy_w_renames.
o->load_data(
exporting
i_obj = 'testdir/testfile_complete'
i_strict = abap_false
i_rename_fields = 'tchar:ychar'
i_corresponding = abap_true
importing
e_container = dummy_act ).
dummy_exp-tdate = '20150101'.
dummy_exp-ychar = 'Trololo1'.
cl_abap_unit_assert=>assert_equals(
act = dummy_act
exp = dummy_exp ).
endmethod.
endclass.
| [
16208,
10097,
1783,
59,
198,
9,
91,
770,
2393,
318,
636,
286,
44123,
929,
40213,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
383,
17168,
13789,
357,
36393,
8,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
15069,
357,
66,
8,
1853,
311,
2749,
38,
4816,
357,
2503,
13,
82,
15630,
70,
13,
785,
13,
6413,
828,
10009,
309,
1837,
65,
5753,
2584,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
2448,
3411,
318,
29376,
7520,
11,
1479,
286,
3877,
11,
284,
597,
1048,
16727,
257,
4866,
220,
220,
930,
198,
9,
91,
286,
428,
3788,
290,
3917,
10314,
3696,
357,
1169,
366,
25423,
12340,
284,
1730,
220,
930,
198,
9,
91,
287,
262,
10442,
1231,
17504,
11,
1390,
1231,
17385,
262,
2489,
220,
220,
930,
198,
9,
91,
284,
779,
11,
4866,
11,
13096,
11,
20121,
11,
7715,
11,
14983,
11,
850,
43085,
11,
290,
14,
273,
3677,
220,
220,
220,
220,
220,
930,
198,
9,
91,
9088,
286,
262,
10442,
11,
290,
284,
8749,
6506,
284,
4150,
262,
10442,
318,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
30760,
284,
466,
523,
11,
2426,
284,
262,
1708,
3403,
25,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
383,
2029,
6634,
4003,
290,
428,
7170,
4003,
2236,
307,
3017,
287,
477,
930,
198,
9,
91,
9088,
393,
8904,
16690,
286,
262,
10442,
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,
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,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
3336,
47466,
3180,
36592,
2389,
1961,
366,
1921,
3180,
1600,
42881,
34764,
56,
3963,
15529,
509,
12115,
11,
7788,
32761,
6375,
220,
220,
220,
220,
930,
198,
9,
91,
8959,
49094,
11,
47783,
2751,
21728,
5626,
40880,
5390,
3336,
34764,
11015,
3963,
34482,
3398,
1565,
5603,
25382,
11,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
376,
46144,
7473,
317,
16652,
2149,
37232,
33079,
48933,
5357,
44521,
1268,
10913,
2751,
12529,
13,
3268,
8005,
49261,
50163,
3336,
220,
220,
220,
930,
198,
9,
91,
37195,
20673,
6375,
27975,
38162,
9947,
367,
15173,
4877,
9348,
43031,
19146,
7473,
15529,
47666,
3955,
11,
29506,
25552,
6375,
25401,
220,
220,
220,
220,
220,
220,
220,
220,
930,
198,
9,
91,
43031,
25382,
11,
7655,
2767,
16879,
3268,
3537,
40282,
3963,
27342,
10659,
11,
309,
9863,
6375,
25401,
54,
24352,
11,
5923,
1797,
2751,
16034,
11,
220,
930,
198,
9,
91,
16289,
3963,
6375,
3268,
7102,
45,
24565,
13315,
3336,
47466,
6375,
3336,
23210,
6375,
25401,
5550,
1847,
20754,
3268,
3336,
220,
930,
198,
9,
91,
47466,
13,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,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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
] |
class ZCL_ALV_TOOL definition
public
final
create public .
public section.
methods CONSTRUCTOR
importing
!IM_EVENT_HANDLER type ref to ZIF_ALV_EVENT_HANDLER optional .
methods GET_ALV_ROW
importing
!IM_ROW type SALV_DE_ROW
returning
value(RE_ROW) type ref to DATA .
methods INITIALIZE
importing
!IM_ALV_KEY type ZZE_ALV_KEY optional
!IM_OBJECT type ref to OBJECT
!IM_EVENT_HANDLER type ref to ZIF_ALV_EVENT_HANDLER optional
changing
!CH_DATA type TABLE .
methods GET_EVENT
returning
value(RE_EVENT) type ref to CL_SALV_EVENTS_TABLE .
methods REFRESH .
type-pools ABAP .
methods GET_STRUCT_NAME
returning
value(RE_STRUCT) type ABAP_ABSTYPENAME .
methods GET_COLUMNS
returning
value(RE_RETURN) type ref to CL_SALV_COLUMNS_TABLE .
methods DISPLAY .
methods SET_EVENT_HANDLER
importing
!IM_EVENT_HANDLER type ref to ZIF_ALV_EVENT_HANDLER .
protected section.
private section.
data AT_O_ALV type ref to CL_SALV_TABLE .
data AT_ALV_KEY type ZZE_ALV_KEY .
data AT_DATA type ref to DATA .
data AT_OBJECT type ref to OBJECT .
data AT_EVENT_HANDLER type ref to ZIF_ALV_EVENT_HANDLER .
constants C_PROG type SYREPID value 'ZPR_REPORT_TEMPLATE'. "#EC NOTEXT
constants C_PFSTATUS type SYPFKEY value 'STANDARD'. "#EC NOTEXT
methods GET_REPID
returning
value(RE_RETURN) type SYREPID .
methods SET_FUNCTIONS_ALV .
methods COLUMN_HEADING
importing
!IM_COLUMN_NAME type LVC_FNAME
!IM_TXT type SCRTEXT_L .
methods SET_COLUMNS_ALV .
methods SET_HEADER_ALV .
methods ONDOUBLE_CLICK
for event DOUBLE_CLICK of CL_SALV_EVENTS_TABLE
importing
!ROW
!COLUMN .
methods ONLINK_CLICK
for event LINK_CLICK of CL_SALV_EVENTS_TABLE
importing
!ROW
!COLUMN .
methods ONUSER_COMMAND
for event ADDED_FUNCTION of CL_SALV_EVENTS
importing
!E_SALV_FUNCTION .
methods ONBEFORE_ACTION
for event BEFORE_SALV_FUNCTION of CL_SALV_EVENTS_TABLE
importing
!E_SALV_FUNCTION .
methods ONAFTER_ACTION
for event AFTER_SALV_FUNCTION of CL_SALV_EVENTS_TABLE
importing
!E_SALV_FUNCTION .
ENDCLASS.
CLASS ZCL_ALV_TOOL IMPLEMENTATION.
method COLUMN_HEADING.
DATA lo_cx_salv_not_found TYPE REF TO cx_salv_not_found.
data lv_string TYPE string.
data lo_columns TYPE REF TO cl_salv_columns_table.
data lo_column TYPE REF TO cl_salv_column.
data lv_len type DDLENG.
data lv_medium type scrtext_m.
data lv_short type scrtext_s.
lv_len = strlen( im_txt ).
lv_medium = im_txt.
lv_short = im_txt.
lo_columns = at_o_alv->get_columns( ).
TRY.
lo_column = lo_columns->get_column( im_column_name ).
lo_column->set_long_text( im_txt ).
lo_column->set_medium_text( lv_medium ).
lo_column->set_short_text( lv_short ).
lo_column->set_output_length( lv_len ).
CATCH cx_salv_not_found INTO lo_cx_salv_not_found.
lv_string = lo_cx_salv_not_found->get_text( ).
MESSAGE i999 WITH lv_string.
ENDTRY.
endmethod.
method CONSTRUCTOR.
at_event_handler = im_event_handler.
endmethod.
method DISPLAY.
data lv_badi TYPE REF TO ZBADI_MANIPULATE_ALV.
data lo_columns TYPE REF TO cl_salv_columns_table.
data lo_events type ref to CL_SALV_EVENTS_TABLE.
check at_data is bound.
TRY.
GET BADI lv_badi FILTERS alv_key = at_alv_key.
CALL BADI lv_badi->manipulate_alv
EXPORTING
im_alv = me
im_report = at_object.
CATCH cx_badi_not_implemented.
CATCH cx_badi "No BADI implementation exist
cx_sy_dyn_call_error.
ENDTRY.
lo_events = get_event( ).
set handler ondouble_click for lo_events.
set handler onlink_click for lo_events.
set handler onuser_command for lo_events.
set handler onbefore_action for lo_events.
set handler onafter_action for lo_events.
* Display the ALV
* Column Optimize
lo_columns = at_o_alv->get_columns( ).
lo_columns->set_optimize( 'X' ).
at_o_alv->display( ).
endmethod.
method GET_ALV_ROW.
data: lv_data type ref to data.
field-symbols: <table> type standard table.
field-symbols: <row> type any.
assign at_data->* to <table>.
create data lv_data like line of <table>.
read table <table> assigning <row> index im_row.
if <row> is assigned.
get reference of <row> into lv_data.
endif.
re_row = lv_data.
endmethod.
method GET_COLUMNS.
re_return = at_o_alv->get_columns( ).
endmethod.
method GET_EVENT.
re_event = at_o_alv->get_event( ).
endmethod.
method GET_REPID.
CALL FUNCTION 'RS_CUA_GET_STATUS_FUNCTIONS'
EXPORTING
PROGRAM = sy-cprog
STATUS = c_pfstatus
EXCEPTIONS
MENU_NOT_FOUND = 1
PROGRAM_NOT_FOUND = 2
STATUS_NOT_FOUND = 3
OTHERS = 4.
if SY-SUBRC <> 0.
CALL FUNCTION 'RS_CUA_GET_STATUS_FUNCTIONS'
EXPORTING
PROGRAM = c_prog
STATUS = c_pfstatus
EXCEPTIONS
MENU_NOT_FOUND = 1
PROGRAM_NOT_FOUND = 2
STATUS_NOT_FOUND = 3
OTHERS = 4.
if sy-subrc = 0.
re_return = c_prog.
endif.
else.
re_return = sy-cprog.
endif.
endmethod.
method GET_STRUCT_NAME.
re_struct = CL_ABAP_STRUCTDESCR=>describe_by_data_ref( at_data )->GET_RELATIVE_NAME( ).
endmethod.
method INITIALIZE.
data lo_msg TYPE REF TO cx_salv_msg.
data lv_string type string.
DATA lv_badi TYPE REF TO ZBADI_ALV_TOOL_TRANSFORM_DATA.
field-symbols <fs_table> type table.
field-symbols <fs_line> type any.
field-symbols <fs_new_line> type any.
data lv_line type ref to data.
data lt_table type ref to data.
data lv_name type string.
if im_event_handler is supplied.
at_event_handler = im_event_handler.
endif.
if im_alv_key is supplied.
at_alv_key = im_alv_key.
endif.
if at_object is not bound.
at_object = im_object.
endif.
*** Get the BADI using ALV KEY as filter
*** This BAdI is used to modify the data and/or structure of the displayed table
TRY.
GET BADI lv_badi FILTERS alv_key = at_alv_key.
CALL BADI lv_badi->get_struct_name
CHANGING
ch_name = lv_name.
if lv_name is not initial.
create data lv_line type (lv_name).
create data lt_table type table of (lv_name).
assign lv_line->* to <fs_new_line>.
loop at ch_data assigning <fs_line>.
TRY.
CALL BADI lv_badi->transform_data_alv
EXPORTING
im_data = <fs_line>
im_object = at_object
CHANGING
ch_data = <fs_new_line>.
if <fs_table> is not assigned.
assign lt_table->* TO <fs_table>.
endif.
append <fs_new_line> to <fs_table>.
CATCH cx_badi "No BADI implementation exist
cx_sy_dyn_call_error. "Catch dynamic call errors
ENDTRY.
endloop.
else.
assign ch_data to <fs_table>.
endif.
** If BAdI is not implemented, just copy the table
CATCH cx_badi_not_implemented.
assign ch_data to <fs_table>.
ENDTRY.
** Call factory method of ALV Grid
check <fs_table> is assigned.
TRY.
if at_o_alv is bound.
free at_o_alv.
endif.
CALL METHOD cl_salv_table=>factory
IMPORTING
r_salv_table = at_o_alv
CHANGING
t_table = <fs_table>.
CATCH cx_salv_msg INTO lo_msg.
lv_string = lo_msg->get_text( ).
MESSAGE i999 WITH lv_string.
ENDTRY.
** Save the data in a Class Attribute
get reference of <fs_table> into at_data.
** Configure ALV based on tables
me->set_functions_alv( ).
me->set_header_alv( ).
me->set_columns_alv( ).
endmethod.
method ONAFTER_ACTION.
check at_event_handler is bound.
at_event_handler->onafter_action( exporting im_function = e_salv_function
im_alv_key = at_alv_key ).
refresh( ).
endmethod.
method ONBEFORE_ACTION.
check at_event_handler is bound.
at_event_handler->onbefore_action( exporting im_function = e_salv_function
im_alv_key = at_alv_key ).
refresh( ).
endmethod.
method ONDOUBLE_CLICK.
check at_event_handler is bound.
at_event_handler->ondouble_click( im_row = row
im_col = column
im_data = get_alv_row( row )
im_struct = get_struct_name( )
im_alv_key = at_alv_key ).
refresh( ).
endmethod.
method ONLINK_CLICK.
check at_event_handler is bound.
at_event_handler->onlink_click( im_row = row
im_col = column
im_data = get_alv_row( row )
im_struct = get_struct_name( )
im_alv_key = at_alv_key ).
refresh( ).
endmethod.
method ONUSER_COMMAND.
data lv_method type string.
check at_event_handler is bound.
concatenate 'ONFUNC' e_salv_function+4(2) into lv_method.
try.
call method at_event_handler->(lv_method) exporting im_alv_key = at_alv_key.
catch cx_root.
endtry.
refresh( ).
endmethod.
method REFRESH.
at_o_alv->refresh( ).
endmethod.
method SET_COLUMNS_ALV.
* Column Heading
* DATA: ls_components TYPE abap_compdescr.
DATA: ls_components TYPE DFIES.
data: lo_tabdescr type ref to cl_abap_structdescr.
data lt_dfies type ddfields.
data: lv_data type ref to data.
field-symbols: <table> type standard table.
data lo_columns TYPE REF TO cl_salv_columns_table.
data lo_column TYPE REF TO cl_salv_column_table.
lo_columns = at_o_alv->get_columns( ).
assign at_data->* to <table>.
create data lv_data like line of <table>.
lo_tabdescr ?= cl_abap_structdescr=>describe_by_data_ref( lv_data ).
lt_dfies = CL_SALV_DATA_DESCR=>read_structdescr( lo_tabdescr ).
* loop at lo_tabdescr->components into ls_components.
loop at lt_dfies into ls_components.
if ZCL_ALV_CONFIG=>exists_text( im_alv_key = at_alv_key im_column_name = ls_components-FIELDNAME ) = 'X'.
me->column_heading( im_column_name = ls_components-FIELDNAME im_txt = ZCL_ALV_CONFIG=>get_text( im_alv_key = at_alv_key im_column_name = ls_components-FIELDNAME ) ).
lo_column ?= lo_columns->get_column( ls_components-FIELDNAME ).
lo_column->set_visible( ZCL_ALV_CONFIG=>is_active( im_alv_key = at_alv_key im_column_name = ls_components-FIELDNAME ) ).
if ZCL_ALV_CONFIG=>is_hotspot( im_alv_key = at_alv_key im_column_name = ls_components-FIELDNAME ) = 'X'.
lo_column->set_cell_type( if_salv_c_cell_type=>hotspot ).
endif.
endif.
endloop.
endmethod.
method SET_EVENT_HANDLER.
check at_event_handler is bound.
at_event_handler = im_event_handler.
endmethod.
method SET_FUNCTIONS_ALV.
* data lt_functions type SALV_T_UI_FUNC.
* data lv_function type line of SALV_T_UI_FUNC.
* data lv_prog type syrepid.
* data lt_active_functions type ZZT_ALV_FUNC.
* data lv_func_name type zze_alv_functions.
* data lo_functions type ref to cl_salv_functions_list.
* data lo_layout TYPE REF TO cl_salv_layout.
* data lv_key TYPE salv_s_layout_key.
*
*** Look for program ID to use to get the PF Status
* lv_prog = get_repid( ).
*
* check lv_prog is not initial and at_o_alv is bound.
*
*** Activate the saving layout option
* lo_layout = at_o_alv->get_layout( ).
* lv_key-report = lv_prog.
* lo_layout->set_key( lv_key ).
* lo_layout->set_default( 'X' ).
* lo_layout->set_save_restriction( if_salv_c_layout=>restrict_none ).
*
*** Set PF Status with predefined functions
* at_o_alv->set_screen_status( pfstatus = c_pfstatus
* report = lv_prog
* set_functions = at_o_alv->c_functions_all ).
*
*** Get Active Functions from Config
* lt_active_functions = ZCL_ALV_CONFIG=>get_functions( at_alv_key ).
**
* lo_functions = at_o_alv->get_functions( ).
** lo_functions->set_all( abap_true ).
* lt_functions = lo_functions->get_functions( ).
*
** Deactivate those client functions not in config
* loop at lt_functions into lv_function.
* lv_func_name = lv_function-r_function->GET_NAME( ).
* if lv_func_name(4) eq 'FUNC'.
* read table lt_active_functions transporting no fields with key function = lv_func_name.
* if sy-subrc eq 4.
* lv_function-r_function->set_visible( abap_false ).
* endif.
* endif.
* endloop.
endmethod.
method SET_HEADER_ALV.
data lv_line type ZHRT_ALV_HEADER.
data lt_table type ZZT_ALV_HEADER.
data lv_string type string.
data lv_method type string.
data lv_field type string.
data lv_struct type string.
field-symbols <fs_string> type any.
field-symbols <fs_struct> type any.
field-symbols <fs_field> type any.
data lv_data type ref to data.
data lo_grid TYPE REF TO cl_salv_form_layout_grid.
data lo_flow TYPE REF TO cl_salv_form_layout_flow.
data lv_row type i.
data lv_col type i.
CREATE OBJECT lo_grid.
lt_table = ZCL_ALV_CONFIG=>get_header( at_alv_key ).
loop at lt_table into lv_line.
lv_row = lv_line-alv_row.
* lv_col = ( lv_line-alv_col * 2 ) - 1.
lv_col = lv_line-alv_col.
lo_flow = lo_grid->create_flow( row = lv_row column = lv_col ).
if lv_line-alv_label is not initial.
lo_flow->create_label( text = lv_line-alv_label tooltip = lv_line-alv_label ).
* lv_col = lv_col + 1.
endif.
try.
case lv_line-alv_header.
when '1'.
call method at_object->(lv_line-source) receiving re_return = lv_string.
when '2'.
assign at_object->(lv_line-source) to <fs_string>.
if sy-subrc eq 0.
lv_string = <fs_string>.
endif.
when '3'.
assign component lv_line-source of structure sy to <fs_string>.
if sy-subrc eq 0.
lv_string = <fs_string>.
endif.
when '4'.
lv_string = lv_line-source.
when '5'.
lv_method = substring_before( val = lv_line-source sub = '-' ).
lv_struct = substring_before( val = substring_after( val = lv_line-source sub = '-' ) sub = '-' ).
lv_field = substring_after( val = substring_after( val = lv_line-source sub = '-' ) sub = '-' ).
create data lv_data type (lv_struct).
assign lv_data->* to <fs_struct>.
call method at_object->(lv_method) receiving re_return = <fs_struct>.
assign component lv_field of structure <fs_struct> to <fs_field>.
if sy-subrc eq 0.
lv_string = <fs_field>.
endif.
endcase.
lo_flow->create_text( text = lv_string tooltip = lv_string ).
clear lv_string.
unassign <fs_string>.
catch cx_root.
endtry.
endloop.
at_o_alv->set_top_of_list( value = lo_grid ).
endmethod.
ENDCLASS.
| [
4871,
1168,
5097,
62,
1847,
53,
62,
10468,
3535,
6770,
198,
220,
1171,
198,
220,
2457,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
5050,
7102,
46126,
1581,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3955,
62,
20114,
3525,
62,
39,
6981,
39878,
2099,
1006,
284,
1168,
5064,
62,
1847,
53,
62,
20114,
3525,
62,
39,
6981,
39878,
11902,
764,
198,
220,
5050,
17151,
62,
1847,
53,
62,
49,
3913,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3955,
62,
49,
3913,
2099,
42475,
53,
62,
7206,
62,
49,
3913,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
2200,
62,
49,
3913,
8,
2099,
1006,
284,
42865,
764,
198,
220,
5050,
3268,
2043,
12576,
35400,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3955,
62,
1847,
53,
62,
20373,
2099,
1168,
21211,
62,
1847,
53,
62,
20373,
11902,
198,
220,
220,
220,
220,
220,
5145,
3955,
62,
9864,
23680,
2099,
1006,
284,
25334,
23680,
198,
220,
220,
220,
220,
220,
5145,
3955,
62,
20114,
3525,
62,
39,
6981,
39878,
2099,
1006,
284,
1168,
5064,
62,
1847,
53,
62,
20114,
3525,
62,
39,
6981,
39878,
11902,
198,
220,
220,
220,
5609,
198,
220,
220,
220,
220,
220,
5145,
3398,
62,
26947,
2099,
43679,
764,
198,
220,
5050,
17151,
62,
20114,
3525,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
2200,
62,
20114,
3525,
8,
2099,
1006,
284,
7852,
62,
50,
1847,
53,
62,
20114,
15365,
62,
38148,
764,
198,
220,
5050,
4526,
10913,
44011,
764,
198,
220,
2099,
12,
7742,
82,
9564,
2969,
764,
198,
220,
5050,
17151,
62,
46126,
62,
20608,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
2200,
62,
46126,
8,
2099,
9564,
2969,
62,
6242,
2257,
48232,
1677,
10067,
764,
198,
220,
5050,
17151,
62,
25154,
5883,
8035,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
2200,
62,
26087,
27064,
8,
2099,
1006,
284,
7852,
62,
50,
1847,
53,
62,
25154,
5883,
8035,
62,
38148,
764,
198,
220,
5050,
13954,
31519,
764,
198,
220,
5050,
25823,
62,
20114,
3525,
62,
39,
6981,
39878,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3955,
62,
20114,
3525,
62,
39,
6981,
39878,
2099,
1006,
284,
1168,
5064,
62,
1847,
53,
62,
20114,
3525,
62,
39,
6981,
39878,
764,
198,
24326,
2665,
13,
198,
19734,
2665,
13,
628,
220,
1366,
5161,
62,
46,
62,
1847,
53,
2099,
1006,
284,
7852,
62,
50,
1847,
53,
62,
38148,
764,
198,
220,
1366,
5161,
62,
1847,
53,
62,
20373,
2099,
1168,
21211,
62,
1847,
53,
62,
20373,
764,
198,
220,
1366,
5161,
62,
26947,
2099,
1006,
284,
42865,
764,
198,
220,
1366,
5161,
62,
9864,
23680,
2099,
1006,
284,
25334,
23680,
764,
198,
220,
1366,
5161,
62,
20114,
3525,
62,
39,
6981,
39878,
2099,
1006,
284,
1168,
5064,
62,
1847,
53,
62,
20114,
3525,
62,
39,
6981,
39878,
764,
198,
220,
38491,
327,
62,
4805,
7730,
2099,
19704,
35316,
2389,
1988,
705,
57,
4805,
62,
2200,
15490,
62,
51,
3620,
6489,
6158,
4458,
25113,
2943,
5626,
13918,
198,
220,
38491,
327,
62,
42668,
35744,
2937,
2099,
19704,
42668,
20373,
1988,
705,
2257,
6981,
9795,
4458,
25113,
2943,
5626,
13918,
628,
220,
5050,
17151,
62,
35316,
2389,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
2200,
62,
26087,
27064,
8,
2099,
19704,
35316,
2389,
764,
198,
220,
5050,
25823,
62,
42296,
4177,
11053,
62,
1847,
53,
764,
198,
220,
5050,
20444,
5883,
45,
62,
37682,
2751,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
3955,
62,
25154,
5883,
45,
62,
20608,
2099,
406,
15922,
62,
37,
20608,
198,
220,
220,
220,
220,
220,
5145,
3955,
62,
51,
25010,
2099,
6374,
14181,
13918,
62,
43,
764,
198,
220,
5050,
25823,
62,
25154,
5883,
8035,
62,
1847,
53,
764,
198,
220,
5050,
25823,
62,
37682,
1137,
62,
1847,
53,
764,
198,
220,
5050,
6177,
35,
2606,
19146,
62,
5097,
11860,
198,
220,
220,
220,
329,
1785,
360,
2606,
19146,
62,
5097,
11860,
286,
7852,
62,
50,
1847,
53,
62,
20114,
15365,
62,
38148,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
49,
3913,
198,
220,
220,
220,
220,
220,
5145,
25154,
5883,
45,
764,
198,
220,
5050,
6177,
43,
17248,
62,
5097,
11860,
198,
220,
220,
220,
329,
1785,
34426,
62,
5097,
11860,
286,
7852,
62,
50,
1847,
53,
62,
20114,
15365,
62,
38148,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
49,
3913,
198,
220,
220,
220,
220,
220,
5145,
25154,
5883,
45,
764,
198,
220,
5050,
6177,
29904,
62,
9858,
44,
6981,
198,
220,
220,
220,
329,
1785,
27841,
1961,
62,
42296,
4177,
2849,
286,
7852,
62,
50,
1847,
53,
62,
20114,
15365,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
36,
62,
50,
1847,
53,
62,
42296,
4177,
2849,
764,
198,
220,
5050,
6177,
12473,
30818,
62,
44710,
198,
220,
220,
220,
329,
1785,
38331,
62,
50,
1847,
53,
62,
42296,
4177,
2849,
286,
7852,
62,
50,
1847,
53,
62,
20114,
15365,
62,
38148,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
36,
62,
50,
1847,
53,
62,
42296,
4177,
2849,
764,
198,
220,
5050,
440,
4535,
37,
5781,
62,
44710,
198,
220,
220,
220,
329,
1785,
36050,
62,
50,
1847,
53,
62,
42296,
4177,
2849,
286,
7852,
62,
50,
1847,
53,
62,
20114,
15365,
62,
38148,
198,
220,
220,
220,
33332,
198,
220,
220,
220,
220,
220,
5145,
36,
62,
50,
1847,
53,
62,
42296,
4177,
2849,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
1847,
53,
62,
10468,
3535,
30023,
2538,
10979,
6234,
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
] |
CLASS zcl_abapgit_file_status DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
CLASS-METHODS status
IMPORTING io_repo TYPE REF TO zcl_abapgit_repo
ii_log TYPE REF TO zif_abapgit_log OPTIONAL
RETURNING VALUE(rt_results) TYPE zif_abapgit_definitions=>ty_results_tt
RAISING zcx_abapgit_exception.
PROTECTED SECTION.
PRIVATE SECTION.
CLASS-METHODS:
calculate_status
IMPORTING iv_devclass TYPE devclass
io_dot TYPE REF TO zcl_abapgit_dot_abapgit
it_local TYPE zif_abapgit_definitions=>ty_files_item_tt
it_remote TYPE zif_abapgit_definitions=>ty_files_tt
it_cur_state TYPE zif_abapgit_definitions=>ty_file_signatures_tt
RETURNING VALUE(rt_results) TYPE zif_abapgit_definitions=>ty_results_tt
RAISING zcx_abapgit_exception,
run_checks
IMPORTING ii_log TYPE REF TO zif_abapgit_log
it_results TYPE zif_abapgit_definitions=>ty_results_tt
io_dot TYPE REF TO zcl_abapgit_dot_abapgit
iv_top TYPE devclass
RAISING zcx_abapgit_exception,
build_existing
IMPORTING is_local TYPE zif_abapgit_definitions=>ty_file_item
is_remote TYPE zif_abapgit_definitions=>ty_file
it_state TYPE zif_abapgit_definitions=>ty_file_signatures_ts
RETURNING VALUE(rs_result) TYPE zif_abapgit_definitions=>ty_result,
build_new_local
IMPORTING is_local TYPE zif_abapgit_definitions=>ty_file_item
RETURNING VALUE(rs_result) TYPE zif_abapgit_definitions=>ty_result,
build_new_remote
IMPORTING iv_devclass TYPE devclass
io_dot TYPE REF TO zcl_abapgit_dot_abapgit
is_remote TYPE zif_abapgit_definitions=>ty_file
it_items TYPE zif_abapgit_definitions=>ty_items_ts
it_state TYPE zif_abapgit_definitions=>ty_file_signatures_ts
RETURNING VALUE(rs_result) TYPE zif_abapgit_definitions=>ty_result
RAISING zcx_abapgit_exception,
identify_object
IMPORTING iv_filename TYPE string
iv_path TYPE string
iv_devclass TYPE devclass
io_dot TYPE REF TO zcl_abapgit_dot_abapgit
EXPORTING es_item TYPE zif_abapgit_definitions=>ty_item
ev_is_xml TYPE abap_bool
RAISING zcx_abapgit_exception,
get_object_package
IMPORTING
iv_object TYPE tadir-object
iv_obj_name TYPE tadir-obj_name
RETURNING
VALUE(rv_devclass) TYPE devclass
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS ZCL_ABAPGIT_FILE_STATUS IMPLEMENTATION.
METHOD build_existing.
DATA: ls_file_sig LIKE LINE OF it_state.
" Item
rs_result-obj_type = is_local-item-obj_type.
rs_result-obj_name = is_local-item-obj_name.
rs_result-package = is_local-item-devclass.
" File
rs_result-path = is_local-file-path.
rs_result-filename = is_local-file-filename.
IF is_local-file-sha1 = is_remote-sha1.
rs_result-match = abap_true.
RETURN.
ENDIF.
" Match against current state
READ TABLE it_state INTO ls_file_sig
WITH KEY path = is_local-file-path
filename = is_local-file-filename
BINARY SEARCH.
IF sy-subrc = 0.
IF ls_file_sig-sha1 <> is_local-file-sha1.
rs_result-lstate = zif_abapgit_definitions=>c_state-modified.
ENDIF.
IF ls_file_sig-sha1 <> is_remote-sha1.
rs_result-rstate = zif_abapgit_definitions=>c_state-modified.
ENDIF.
rs_result-match = boolc( rs_result-lstate IS INITIAL
AND rs_result-rstate IS INITIAL ).
ELSE.
" This is a strange situation. As both local and remote exist
" the state should also be present. Maybe this is a first run of the code.
" In this case just compare hashes directly and mark both changed
" the user will presumably decide what to do after checking the actual diff
rs_result-match = boolc( is_local-file-sha1 = is_remote-sha1 ).
IF rs_result-match = abap_false.
rs_result-lstate = zif_abapgit_definitions=>c_state-modified.
rs_result-rstate = zif_abapgit_definitions=>c_state-modified.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD build_new_local.
" Item
rs_result-obj_type = is_local-item-obj_type.
rs_result-obj_name = is_local-item-obj_name.
rs_result-package = is_local-item-devclass.
" File
rs_result-path = is_local-file-path.
rs_result-filename = is_local-file-filename.
" Match
rs_result-match = abap_false.
rs_result-lstate = zif_abapgit_definitions=>c_state-added.
ENDMETHOD.
METHOD build_new_remote.
DATA: ls_item LIKE LINE OF it_items,
ls_file_sig LIKE LINE OF it_state.
" Common and default part
rs_result-path = is_remote-path.
rs_result-filename = is_remote-filename.
rs_result-match = abap_false.
rs_result-rstate = zif_abapgit_definitions=>c_state-added.
identify_object( EXPORTING iv_filename = is_remote-filename
iv_path = is_remote-path
iv_devclass = iv_devclass
io_dot = io_dot
IMPORTING es_item = ls_item ).
" Check if in item index + get package
READ TABLE it_items INTO ls_item
WITH KEY obj_type = ls_item-obj_type obj_name = ls_item-obj_name
BINARY SEARCH.
IF sy-subrc = 0.
" Completely new (xml, abap) and new file in an existing object
rs_result-obj_type = ls_item-obj_type.
rs_result-obj_name = ls_item-obj_name.
rs_result-package = ls_item-devclass.
READ TABLE it_state INTO ls_file_sig
WITH KEY path = is_remote-path filename = is_remote-filename
BINARY SEARCH.
" Existing file but from another package
" was not added during local file proc as was not in tadir for repo package
IF sy-subrc = 0.
IF ls_file_sig-sha1 = is_remote-sha1.
rs_result-match = abap_true.
CLEAR rs_result-rstate.
ELSE.
rs_result-rstate = zif_abapgit_definitions=>c_state-modified.
ENDIF.
" Item is in state and in cache but with no package - it was deleted
" OR devclass is the same as repo package (see #532)
IF ls_item-devclass IS INITIAL OR ls_item-devclass = iv_devclass.
rs_result-match = abap_false.
rs_result-lstate = zif_abapgit_definitions=>c_state-deleted.
ENDIF.
ENDIF.
ELSE. " Completely unknown file, probably non-abapgit
ASSERT 1 = 1. " No action, just follow defaults
ENDIF.
ENDMETHOD.
METHOD calculate_status.
DATA: lt_remote LIKE it_remote,
lt_items TYPE zif_abapgit_definitions=>ty_items_tt,
ls_item LIKE LINE OF lt_items,
lv_is_xml TYPE abap_bool,
lv_sub_fetched TYPE abap_bool,
lt_sub_packages TYPE zif_abapgit_sap_package=>ty_devclass_tt,
lt_items_idx TYPE zif_abapgit_definitions=>ty_items_ts,
lt_state_idx TYPE zif_abapgit_definitions=>ty_file_signatures_ts. " Sorted by path+filename
FIELD-SYMBOLS: <ls_remote> LIKE LINE OF it_remote,
<ls_result> LIKE LINE OF rt_results,
<ls_local> LIKE LINE OF it_local.
lt_state_idx = it_cur_state. " Force sort it
lt_remote = it_remote.
SORT lt_remote BY path filename.
" Process local files and new local files
LOOP AT it_local ASSIGNING <ls_local>.
APPEND INITIAL LINE TO rt_results ASSIGNING <ls_result>.
IF <ls_local>-item IS NOT INITIAL.
APPEND <ls_local>-item TO lt_items. " Collect for item index
ENDIF.
READ TABLE lt_remote ASSIGNING <ls_remote>
WITH KEY path = <ls_local>-file-path filename = <ls_local>-file-filename
BINARY SEARCH.
IF sy-subrc = 0. " Exist local and remote
<ls_result> = build_existing(
is_local = <ls_local>
is_remote = <ls_remote>
it_state = lt_state_idx ).
ASSERT <ls_remote>-sha1 IS NOT INITIAL.
CLEAR <ls_remote>-sha1. " Mark as processed
ELSE. " Only L exists
<ls_result> = build_new_local( <ls_local> ).
" Check if same file exists in different location
READ TABLE lt_remote ASSIGNING <ls_remote>
WITH KEY filename = <ls_local>-file-filename.
IF sy-subrc = 0 AND <ls_local>-file-sha1 = <ls_remote>-sha1.
<ls_result>-packmove = abap_true.
ENDIF.
ENDIF.
<ls_result>-inactive = <ls_local>-item-inactive.
ENDLOOP.
" Complete item index for unmarked remote files
LOOP AT lt_remote ASSIGNING <ls_remote> WHERE sha1 IS NOT INITIAL.
identify_object( EXPORTING iv_filename = <ls_remote>-filename
iv_path = <ls_remote>-path
io_dot = io_dot
iv_devclass = iv_devclass
IMPORTING es_item = ls_item
ev_is_xml = lv_is_xml ).
CHECK lv_is_xml = abap_true. " Skip all but obj definitions
ls_item-devclass = get_object_package(
iv_object = ls_item-obj_type
iv_obj_name = ls_item-obj_name ).
IF NOT ls_item-devclass IS INITIAL AND iv_devclass <> ls_item-devclass.
IF lv_sub_fetched = abap_false.
lt_sub_packages = zcl_abapgit_factory=>get_sap_package( iv_devclass )->list_subpackages( ).
lv_sub_fetched = abap_true.
SORT lt_sub_packages BY table_line. "Optimize Read Access
ENDIF.
* make sure the package is under the repo main package
READ TABLE lt_sub_packages TRANSPORTING NO FIELDS
WITH KEY table_line = ls_item-devclass
BINARY SEARCH.
IF sy-subrc <> 0.
CLEAR ls_item-devclass.
ENDIF.
ENDIF.
APPEND ls_item TO lt_items.
ENDLOOP.
SORT lt_items DESCENDING. " Default key - type, name, pkg, inactive
DELETE ADJACENT DUPLICATES FROM lt_items COMPARING obj_type obj_name devclass.
lt_items_idx = lt_items. " Self protection + UNIQUE records assertion
" Process new remote files (marked above with empty SHA1)
LOOP AT lt_remote ASSIGNING <ls_remote> WHERE sha1 IS NOT INITIAL.
APPEND INITIAL LINE TO rt_results ASSIGNING <ls_result>.
<ls_result> = build_new_remote( iv_devclass = iv_devclass
io_dot = io_dot
is_remote = <ls_remote>
it_items = lt_items_idx
it_state = lt_state_idx ).
" Check if same file exists in different location
READ TABLE it_local ASSIGNING <ls_local>
WITH KEY file-filename = <ls_remote>-filename.
IF sy-subrc = 0 AND <ls_local>-file-sha1 = <ls_remote>-sha1.
<ls_result>-packmove = abap_true.
ENDIF.
ENDLOOP.
SORT rt_results BY
obj_type ASCENDING
obj_name ASCENDING
filename ASCENDING.
ENDMETHOD.
METHOD get_object_package.
DATA: lv_name TYPE devclass,
li_package TYPE REF TO zif_abapgit_sap_package.
rv_devclass = zcl_abapgit_factory=>get_tadir( )->get_object_package(
iv_object = iv_object
iv_obj_name = iv_obj_name ).
IF rv_devclass IS INITIAL AND iv_object = 'DEVC' AND iv_obj_name(1) = '$'.
" local packages usually have no tadir entry
lv_name = iv_obj_name.
li_package = zcl_abapgit_factory=>get_sap_package( lv_name ).
IF li_package->exists( ) = abap_true.
rv_devclass = lv_name.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD identify_object.
DATA: lv_name TYPE string,
lv_type TYPE string,
lv_ext TYPE string.
" Guess object type and name
SPLIT to_upper( iv_filename ) AT '.' INTO lv_name lv_type lv_ext.
" Handle namespaces
REPLACE ALL OCCURRENCES OF '#' IN lv_name WITH '/'.
REPLACE ALL OCCURRENCES OF '#' IN lv_type WITH '/'.
REPLACE ALL OCCURRENCES OF '#' IN lv_ext WITH '/'.
" The counter part to this logic must be maintained in ZCL_ABAPGIT_OBJECTS_FILES->FILENAME
IF lv_type = 'DEVC'.
" Try to get a unique package name for DEVC by using the path
ASSERT lv_name = 'PACKAGE'.
lv_name = zcl_abapgit_folder_logic=>get_instance( )->path_to_package(
iv_top = iv_devclass
io_dot = io_dot
iv_create_if_not_exists = abap_false
iv_path = iv_path ).
ELSE.
" Get original object name
lv_name = cl_http_utility=>unescape_url( lv_name ).
ENDIF.
CLEAR es_item.
es_item-obj_type = lv_type.
es_item-obj_name = lv_name.
ev_is_xml = boolc( lv_ext = 'XML' AND strlen( lv_type ) = 4 ).
ENDMETHOD.
METHOD run_checks.
DATA: lv_path TYPE string,
ls_item TYPE zif_abapgit_definitions=>ty_item,
ls_file TYPE zif_abapgit_definitions=>ty_file_signature,
lt_res_sort LIKE it_results,
lt_item_idx LIKE it_results,
lt_move_idx LIKE it_results,
lo_folder_logic TYPE REF TO zcl_abapgit_folder_logic.
FIELD-SYMBOLS: <ls_res1> LIKE LINE OF it_results,
<ls_res2> LIKE LINE OF it_results.
IF ii_log IS INITIAL.
* huh?
RETURN.
ENDIF.
" Find all objects which were assigned to a different package
LOOP AT it_results ASSIGNING <ls_res1>
WHERE lstate = zif_abapgit_definitions=>c_state-added AND packmove = abap_true.
READ TABLE lt_move_idx TRANSPORTING NO FIELDS
WITH KEY obj_type = <ls_res1>-obj_type obj_name = <ls_res1>-obj_name
BINARY SEARCH. " Sorted since it_result is sorted
IF sy-subrc <> 0.
ii_log->add( iv_msg = |Changed package assignment for object { <ls_res1>-obj_type } { <ls_res1>-obj_name }|
iv_type = 'W'
iv_rc = '5' ) ##no_text.
APPEND INITIAL LINE TO lt_move_idx ASSIGNING <ls_res2>.
<ls_res2>-obj_type = <ls_res1>-obj_type.
<ls_res2>-obj_name = <ls_res1>-obj_name.
<ls_res2>-path = <ls_res1>-path.
ENDIF.
ENDLOOP.
" Collect object indexe
lt_res_sort = it_results.
SORT lt_res_sort BY obj_type ASCENDING obj_name ASCENDING.
LOOP AT it_results ASSIGNING <ls_res1> WHERE NOT obj_type IS INITIAL AND packmove = abap_false.
IF NOT ( <ls_res1>-obj_type = ls_item-obj_type
AND <ls_res1>-obj_name = ls_item-obj_name ).
APPEND INITIAL LINE TO lt_item_idx ASSIGNING <ls_res2>.
<ls_res2>-obj_type = <ls_res1>-obj_type.
<ls_res2>-obj_name = <ls_res1>-obj_name.
<ls_res2>-path = <ls_res1>-path.
MOVE-CORRESPONDING <ls_res1> TO ls_item.
ENDIF.
ENDLOOP.
" Check files for one object is in the same folder
LOOP AT it_results ASSIGNING <ls_res1>
WHERE NOT obj_type IS INITIAL AND obj_type <> 'DEVC' AND packmove = abap_false.
READ TABLE lt_item_idx ASSIGNING <ls_res2>
WITH KEY obj_type = <ls_res1>-obj_type obj_name = <ls_res1>-obj_name
BINARY SEARCH. " Sorted above
IF sy-subrc <> 0 OR <ls_res1>-path <> <ls_res2>-path. " All paths are same
ii_log->add( iv_msg = |Files for object { <ls_res1>-obj_type } {
<ls_res1>-obj_name } are not placed in the same folder|
iv_type = 'W'
iv_rc = '1' ) ##no_text.
ENDIF.
ENDLOOP.
" Check that objects are created in package corresponding to folder
lo_folder_logic = zcl_abapgit_folder_logic=>get_instance( ).
LOOP AT it_results ASSIGNING <ls_res1>
WHERE NOT package IS INITIAL AND NOT path IS INITIAL AND packmove = abap_false.
lv_path = lo_folder_logic->package_to_path(
iv_top = iv_top
io_dot = io_dot
iv_package = <ls_res1>-package ).
IF lv_path <> <ls_res1>-path.
ii_log->add( iv_msg = |Package and path does not match for object, {
<ls_res1>-obj_type } { <ls_res1>-obj_name }|
iv_type = 'W'
iv_rc = '2' ) ##no_text.
ENDIF.
ENDLOOP.
" Check for multiple files with same filename
SORT lt_res_sort BY filename ASCENDING.
LOOP AT lt_res_sort ASSIGNING <ls_res1> WHERE obj_type <> 'DEVC' AND packmove = abap_false.
IF <ls_res1>-filename IS NOT INITIAL AND <ls_res1>-filename = ls_file-filename.
ii_log->add( iv_msg = |Multiple files with same filename, { <ls_res1>-filename }|
iv_type = 'W'
iv_rc = '3' ) ##no_text.
ENDIF.
IF <ls_res1>-filename IS INITIAL.
ii_log->add( iv_msg = |Filename is empty for object { <ls_res1>-obj_type } { <ls_res1>-obj_name }|
iv_type = 'W'
iv_rc = '4' ) ##no_text.
ENDIF.
MOVE-CORRESPONDING <ls_res1> TO ls_file.
ENDLOOP.
ENDMETHOD.
METHOD status.
DATA: lv_index LIKE sy-tabix,
lo_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit,
lt_local TYPE zif_abapgit_definitions=>ty_files_item_tt.
FIELD-SYMBOLS: <ls_result> LIKE LINE OF rt_results.
lt_local = io_repo->get_files_local( ii_log = ii_log ).
IF lines( lt_local ) <= 2.
" Less equal two means that we have only the .abapgit.xml and the package in
" our local repository. In this case we have to update our local .abapgit.xml
" from the remote one. Otherwise we get errors when e.g. the folder starting
" folder is different.
io_repo->find_remote_dot_abapgit( ).
ENDIF.
rt_results = calculate_status(
iv_devclass = io_repo->get_package( )
io_dot = io_repo->get_dot_abapgit( )
it_local = io_repo->get_files_local( ii_log = ii_log )
it_remote = io_repo->get_files_remote( )
it_cur_state = io_repo->get_local_checksums_per_file( ) ).
lo_dot_abapgit = io_repo->get_dot_abapgit( ).
" Remove ignored files, fix .abapgit
LOOP AT rt_results ASSIGNING <ls_result>.
lv_index = sy-tabix.
IF lo_dot_abapgit->is_ignored(
iv_path = <ls_result>-path
iv_filename = <ls_result>-filename ) = abap_true.
DELETE rt_results INDEX lv_index.
ENDIF.
ENDLOOP.
run_checks(
ii_log = ii_log
it_results = rt_results
io_dot = lo_dot_abapgit
iv_top = io_repo->get_package( ) ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
7753,
62,
13376,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
42715,
12,
49273,
50,
3722,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
33245,
62,
260,
7501,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
260,
7501,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21065,
62,
6404,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
39852,
2849,
1847,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
43420,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
43420,
62,
926,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
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,
42715,
12,
49273,
50,
25,
198,
220,
220,
220,
220,
220,
15284,
62,
13376,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
7959,
4871,
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,
33245,
62,
26518,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
12001,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
16624,
62,
9186,
62,
926,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
47960,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
16624,
62,
926,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
22019,
62,
5219,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
7753,
62,
12683,
6691,
62,
926,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
17034,
62,
43420,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
43420,
62,
926,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
1057,
62,
42116,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21065,
62,
6404,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
361,
62,
397,
499,
18300,
62,
6404,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
43420,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
43420,
62,
926,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
33245,
62,
26518,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
4852,
220,
220,
220,
220,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
11,
198,
220,
220,
220,
220,
220,
1382,
62,
25687,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
318,
62,
12001,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
7753,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
47960,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
7753,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
340,
62,
5219,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
7753,
62,
12683,
6691,
62,
912,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
3808,
62,
20274,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
20274,
11,
198,
220,
220,
220,
220,
220,
1382,
62,
3605,
62,
12001,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
318,
62,
12001,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
7753,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
3808,
62,
20274,
8,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
20274,
11,
198,
220,
220,
220,
220,
220,
1382,
62,
3605,
62,
47960,
198,
220,
220,
220,
220,
220,
220,
220,
30023,
9863,
2751,
21628,
62,
7959,
4871,
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,
33245,
62,
26518,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
397,
499,
18300,
62,
26518,
62,
397,
499,
18300,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
318,
62,
47960,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
7753,
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,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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
] |
*&---------------------------------------------------------------------*
*& Report ZDEMO_EXCEL22
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zdemo_excel22.
DATA: lo_excel TYPE REF TO zcl_excel,
lo_worksheet TYPE REF TO zcl_excel_worksheet,
lo_style TYPE REF TO zcl_excel_style,
lo_style_date TYPE REF TO zcl_excel_style,
lo_style_editable TYPE REF TO zcl_excel_style,
lo_data_validation TYPE REF TO zcl_excel_data_validation.
DATA: lt_field_catalog TYPE zexcel_t_fieldcatalog,
ls_table_settings TYPE zexcel_s_table_settings,
ls_table_settings_out TYPE zexcel_s_table_settings.
DATA: lv_style_guid TYPE zexcel_cell_style.
DATA: lv_row TYPE char10.
FIELD-SYMBOLS: <fs_field_catalog> TYPE zexcel_s_fieldcatalog.
CONSTANTS: gc_save_file_name TYPE string VALUE '22_itab_fieldcatalog.xlsx'.
INCLUDE zdemo_excel_outputopt_incl.
START-OF-SELECTION.
" Creates active sheet
CREATE OBJECT lo_excel.
" Get active sheet
lo_worksheet = lo_excel->get_active_worksheet( ).
lo_worksheet->set_title( ip_title = 'PN_MASSIVE').
DATA lt_test TYPE TABLE OF sflight.
SELECT * FROM sflight INTO TABLE lt_test. "#EC CI_NOWHERE
" sheet style (white background)
lo_style = lo_excel->add_new_style( ).
lo_style->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
lo_style->fill->fgcolor-rgb = zcl_excel_style_color=>c_white.
lv_style_guid = lo_style->get_guid( ).
" Get active sheet
lo_worksheet = lo_excel->get_active_worksheet( ).
lo_worksheet->zif_excel_sheet_properties~set_style( lv_style_guid ).
lo_worksheet->zif_excel_sheet_protection~protected = zif_excel_sheet_protection=>c_protected.
lo_worksheet->zif_excel_sheet_protection~password = zcl_excel_common=>encrypt_password( 'test' ).
lo_worksheet->zif_excel_sheet_protection~sheet = zif_excel_sheet_protection=>c_active.
lo_worksheet->zif_excel_sheet_protection~objects = zif_excel_sheet_protection=>c_active.
lo_worksheet->zif_excel_sheet_protection~scenarios = zif_excel_sheet_protection=>c_active.
" Create cell style for display only fields
lo_style = lo_excel->add_new_style( ).
lo_style->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
lo_style->fill->fgcolor-rgb = zcl_excel_style_color=>c_gray.
lo_style->number_format->format_code = zcl_excel_style_number_format=>c_format_text.
" Create cell style for display only date field
lo_style_date = lo_excel->add_new_style( ).
lo_style_date->fill->filltype = zcl_excel_style_fill=>c_fill_solid.
lo_style_date->fill->fgcolor-rgb = zcl_excel_style_color=>c_gray.
lo_style_date->number_format->format_code = zcl_excel_style_number_format=>c_format_date_ddmmyyyy.
" Create cell style for editable fields
lo_style_editable = lo_excel->add_new_style( ).
lo_style_editable->protection->locked = zcl_excel_style_protection=>c_protection_unlocked.
lt_field_catalog = zcl_excel_common=>get_fieldcatalog( ip_table = lt_test ).
LOOP AT lt_field_catalog ASSIGNING <fs_field_catalog>.
CASE <fs_field_catalog>-fieldname.
WHEN 'CARRID'.
<fs_field_catalog>-position = 3.
<fs_field_catalog>-dynpfld = abap_true.
<fs_field_catalog>-style = lo_style->get_guid( ).
WHEN 'CONNID'.
<fs_field_catalog>-position = 1.
<fs_field_catalog>-dynpfld = abap_true.
<fs_field_catalog>-style = lo_style->get_guid( ).
WHEN 'FLDATE'.
<fs_field_catalog>-position = 2.
<fs_field_catalog>-dynpfld = abap_true.
<fs_field_catalog>-style = lo_style_date->get_guid( ).
WHEN 'PRICE'.
<fs_field_catalog>-position = 4.
<fs_field_catalog>-dynpfld = abap_true.
<fs_field_catalog>-style = lo_style_editable->get_guid( ).
<fs_field_catalog>-totals_function = zcl_excel_table=>totals_function_sum.
WHEN OTHERS.
<fs_field_catalog>-dynpfld = abap_false.
ENDCASE.
ENDLOOP.
ls_table_settings-table_style = zcl_excel_table=>builtinstyle_medium2.
ls_table_settings-show_row_stripes = abap_true.
lo_worksheet->bind_table( EXPORTING
ip_table = lt_test
it_field_catalog = lt_field_catalog
is_table_settings = ls_table_settings
IMPORTING
es_table_settings = ls_table_settings_out ).
lo_worksheet->freeze_panes( ip_num_rows = 3 ). "freeze column headers when scrolling
lo_data_validation = lo_worksheet->add_new_data_validation( ).
lo_data_validation->type = zcl_excel_data_validation=>c_type_custom.
lv_row = ls_table_settings_out-top_left_row.
CONDENSE lv_row.
CONCATENATE 'ISNUMBER(' ls_table_settings_out-top_left_column lv_row ')' INTO lo_data_validation->formula1.
lo_data_validation->cell_row = ls_table_settings_out-top_left_row.
lo_data_validation->cell_column = ls_table_settings_out-top_left_column.
lo_data_validation->cell_row_to = ls_table_settings_out-bottom_right_row.
lo_data_validation->cell_column_to = ls_table_settings_out-bottom_right_column.
*** Create output
lcl_output=>output( lo_excel ).
| [
9,
5,
10097,
30934,
9,
198,
9,
5,
6358,
220,
1168,
39429,
46,
62,
6369,
34,
3698,
1828,
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,
1069,
5276,
1828,
13,
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,
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,
11,
198,
220,
220,
220,
220,
220,
2376,
62,
7635,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
7635,
11,
198,
220,
220,
220,
220,
220,
2376,
62,
7635,
62,
4475,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
7635,
11,
198,
220,
220,
220,
220,
220,
2376,
62,
7635,
62,
276,
4674,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
7635,
11,
198,
220,
220,
220,
220,
220,
2376,
62,
7890,
62,
12102,
341,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
1976,
565,
62,
1069,
5276,
62,
7890,
62,
12102,
341,
13,
198,
198,
26947,
25,
300,
83,
62,
3245,
62,
9246,
11794,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
1069,
5276,
62,
83,
62,
3245,
9246,
11794,
11,
198,
220,
220,
220,
220,
220,
43979,
62,
11487,
62,
33692,
220,
220,
220,
220,
220,
220,
41876,
1976,
1069,
5276,
62,
82,
62,
11487,
62,
33692,
11,
198,
220,
220,
220,
220,
220,
43979,
62,
11487,
62,
33692,
62,
448,
220,
220,
41876,
1976,
1069,
5276,
62,
82,
62,
11487,
62,
33692,
13,
198,
198,
26947,
25,
300,
85,
62,
7635,
62,
5162,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1976,
1069,
5276,
62,
3846,
62,
7635,
13,
198,
198,
26947,
25,
300,
85,
62,
808,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
1149,
940,
13,
198,
198,
44603,
12,
23060,
10744,
3535,
50,
25,
1279,
9501,
62,
3245,
62,
9246,
11794,
29,
41876,
1976,
1069,
5276,
62,
82,
62,
3245,
9246,
11794,
13,
198,
198,
10943,
2257,
1565,
4694,
25,
308,
66,
62,
21928,
62,
7753,
62,
3672,
41876,
4731,
26173,
8924,
705,
1828,
62,
270,
397,
62,
3245,
9246,
11794,
13,
87,
7278,
87,
4458,
198,
1268,
5097,
52,
7206,
1976,
9536,
78,
62,
1069,
5276,
62,
22915,
8738,
62,
259,
565,
13,
628,
198,
2257,
7227,
12,
19238,
12,
46506,
2849,
13,
628,
220,
366,
7921,
274,
4075,
9629,
198,
220,
29244,
6158,
25334,
23680,
2376,
62,
1069,
5276,
13,
628,
220,
366,
3497,
4075,
9629,
198,
220,
2376,
62,
5225,
25473,
796,
2376,
62,
1069,
5276,
3784,
1136,
62,
5275,
62,
5225,
25473,
7,
6739,
198,
220,
2376,
62,
5225,
25473,
3784,
2617,
62,
7839,
7,
20966,
62,
7839,
796,
705,
13137,
62,
44,
10705,
9306,
27691,
628,
220,
42865,
300,
83,
62,
9288,
41876,
43679,
3963,
264,
22560,
13,
198,
220,
33493,
1635,
16034,
264,
22560,
39319,
43679,
300,
83,
62,
9288,
13,
25113,
2943,
14514,
62,
45669,
39,
9338,
628,
220,
366,
9629,
3918,
357,
11186,
4469,
8,
198,
220,
2376,
62,
7635,
796,
2376,
62,
1069,
5276,
3784,
2860,
62,
3605,
62,
7635,
7,
6739,
198,
220,
2376,
62,
7635,
3784,
20797,
3784,
20797,
4906,
796,
1976,
565,
62,
1069,
5276,
62,
7635,
62,
20797,
14804,
66,
62,
20797,
62,
39390,
13,
198,
220,
2376,
62,
7635,
3784,
20797,
3784,
40616,
8043,
12,
81,
22296,
220,
796,
1976,
565,
62,
1069,
5276,
62,
7635,
62,
8043,
14804,
66,
62,
11186,
13,
198,
220,
300,
85,
62,
7635,
62,
5162,
312,
796,
2376,
62,
7635,
3784,
1136,
62,
5162,
312,
7,
6739,
628,
220,
366,
3497,
4075,
9629,
198,
220,
2376,
62,
5225,
25473,
796,
2376,
62,
1069,
5276,
3784,
1136,
62,
5275,
62,
5225,
25473,
7,
6739,
198,
220,
2376,
62,
5225,
25473,
3784,
89,
361,
62,
1069,
5276,
62,
21760,
62,
48310,
93,
2617,
62,
7635,
7,
300,
85,
62,
7635,
62,
5162,
312,
6739,
198,
220,
2376,
62,
5225,
25473,
3784,
89,
361,
62,
1069,
5276,
62,
21760,
62,
42846,
93,
24326,
220,
796,
1976,
361,
62,
1069,
5276,
62,
21760,
62,
42846,
14804,
66,
62,
24326,
13,
198,
220,
2376,
62,
5225,
25473,
3784,
89,
361,
62,
1069,
5276,
62,
21760,
62,
42846,
93,
28712,
220,
220,
796,
1976,
565,
62,
1069,
5276,
62,
11321,
14804,
12685,
6012,
62,
28712,
7,
705,
9288,
6,
6739,
198,
220,
2376,
62,
5225,
25473,
3784,
89,
361,
62,
1069,
5276,
62,
21760,
62,
42846,
93,
21760,
220,
220,
220,
220,
220,
796,
1976,
361,
62,
1069,
5276,
62,
21760,
62,
42846,
14804,
66,
62,
5275,
13,
198,
220,
2376,
62,
5225,
25473,
3784,
89,
361,
62,
1069,
5276,
62,
21760,
62,
42846,
93,
48205,
220,
220,
220,
796,
1976,
361,
62,
1069,
5276,
62,
21760,
62,
42846,
14804,
66,
62,
5275,
13,
198,
220,
2376,
62,
5225,
25473,
3784,
89,
361,
62,
1069,
5276,
62,
21760,
62,
42846,
93,
1416,
268,
13010,
220,
796,
1976,
361,
62,
1069,
5276,
62,
21760,
62,
42846,
14804,
66,
62,
5275,
13,
628,
220,
366,
13610,
2685,
3918,
329,
3359,
691,
7032,
198,
220,
2376,
62,
7635,
796,
2376,
62,
1069,
5276,
3784,
2860,
62,
3605,
62,
7635,
7,
6739,
198,
220,
2376,
62,
7635,
3784,
20797,
3784,
20797,
4906,
796,
1976,
565,
62,
1069,
5276,
62,
7635,
62,
20797,
14804,
66,
62,
20797,
62,
39390,
13,
198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
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
] |
CLASS zcl_abapgit_object_avar DEFINITION
PUBLIC
INHERITING FROM zcl_abapgit_objects_super
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_object .
PROTECTED SECTION.
PRIVATE SECTION.
METHODS: create_object
RETURNING VALUE(ro_aab_var) TYPE REF TO cl_aab_variant
RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_AVAR IMPLEMENTATION.
METHOD create_object.
DATA: lv_name TYPE aab_var_name.
lv_name = ms_item-obj_name.
CREATE OBJECT ro_aab_var
EXPORTING
im_name = lv_name
im_local = ''
EXCEPTIONS
name_not_allowed = 1
user_not_valid = 2
no_authorization = 3
OTHERS = 4.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
DATA: lo_aab TYPE REF TO cl_aab_variant.
lo_aab = create_object( ).
lo_aab->get_author( IMPORTING ex_author = rv_user ).
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lo_aab TYPE REF TO cl_aab_variant.
lo_aab = create_object( ).
lo_aab->enqueue( ).
lo_aab->delete(
EXCEPTIONS
var_not_found = 1
prop_error = 2
propt_error = 3
var_id_error = 4
no_authorization = 5
cts_error = 6
cts_devclass = 7
OTHERS = 8 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Error deleting AVAR { ms_item-obj_name }| ).
ENDIF.
lo_aab->dequeue( ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lv_possible TYPE abap_bool,
lv_description TYPE aab_var_descript,
ls_is TYPE aab_var_obj_act,
lt_ids TYPE aab_var_obj_act_tab,
lo_aab TYPE REF TO cl_aab_variant.
" AVAR can only be created in transportable packages
lv_possible = zcl_abapgit_factory=>get_sap_package( iv_package )->are_changes_recorded_in_tr_req( ).
IF lv_possible = abap_false.
zcx_abapgit_exception=>raise( |Global activation variants require a transportable package| ).
ENDIF.
" Create AVAR with description and object (id) list
io_xml->read( EXPORTING iv_name = 'DESCRIPTION'
CHANGING cg_data = lv_description ).
io_xml->read( EXPORTING iv_name = 'IDS'
CHANGING cg_data = lt_ids ).
lo_aab = create_object( ).
lo_aab->enqueue( ).
lo_aab->set_descript(
EXPORTING
im_descript = lv_description
EXCEPTIONS
no_authorization = 1 ).
IF sy-subrc <> 0.
lo_aab->dequeue( ).
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
LOOP AT lt_ids INTO ls_is.
lo_aab->set_id(
EXPORTING
im_name = ls_is-name
im_object = ls_is-object
im_actmode = ls_is-actmode
EXCEPTIONS
no_authorization = 1
id_not_exists = 2
id_not_transportable = 3
OTHERS = 4 ).
IF sy-subrc <> 0.
lo_aab->dequeue( ).
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDLOOP.
tadir_insert( iv_package ).
lo_aab->save(
EXCEPTIONS
no_descript_specified = 1
prop_error = 2
propt_error = 3
var_id_error = 4
no_changes_found = 5
cts_error = 6 ).
IF sy-subrc <> 0.
lo_aab->dequeue( ).
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
lo_aab->dequeue( ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_state TYPE abap_bool,
lo_aab TYPE REF TO cl_aab_variant.
lo_aab = create_object( ).
lo_aab->get_state( IMPORTING ex_state = lv_state ).
rv_bool = xsdbool( lv_state = abap_true ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-delete_tadir = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lo_aab TYPE REF TO cl_aab_variant,
lt_ids TYPE aab_var_obj_act_tab,
lv_description TYPE aab_var_descript.
IF zif_abapgit_object~exists( ) = abap_false.
RETURN.
ENDIF.
lo_aab = create_object( ).
lo_aab->get_descript(
IMPORTING
ex_descript = lv_description
EXCEPTIONS
no_descript_found = 1 ).
IF sy-subrc = 0.
io_xml->add( iv_name = 'DESCRIPTION'
ig_data = lv_description ).
ENDIF.
lo_aab->get_ids( IMPORTING ex_ids = lt_ids ).
io_xml->add( iv_name = 'IDS'
ig_data = lt_ids ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
615,
283,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
764,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
337,
36252,
50,
25,
2251,
62,
15252,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
26173,
8924,
7,
305,
62,
64,
397,
62,
7785,
8,
41876,
4526,
37,
5390,
537,
62,
64,
397,
62,
25641,
415,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
6242,
2969,
38,
2043,
62,
9864,
23680,
62,
10116,
1503,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
2251,
62,
15252,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
3672,
41876,
257,
397,
62,
7785,
62,
3672,
13,
628,
220,
220,
220,
300,
85,
62,
3672,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
628,
220,
220,
220,
29244,
6158,
25334,
23680,
686,
62,
64,
397,
62,
7785,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
545,
62,
3672,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
300,
85,
62,
3672,
198,
220,
220,
220,
220,
220,
220,
220,
545,
62,
12001,
220,
220,
220,
220,
220,
220,
220,
220,
796,
10148,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
1438,
62,
1662,
62,
40845,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2836,
62,
1662,
62,
12102,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
645,
62,
9800,
1634,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
604,
13,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
62,
83,
3064,
7,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
40985,
62,
1525,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
64,
397,
41876,
4526,
37,
5390,
537,
62,
64,
397,
62,
25641,
415,
13,
628,
220,
220,
220,
2376,
62,
64,
397,
796,
2251,
62,
15252,
7,
6739,
198,
220,
220,
220,
2376,
62,
64,
397,
3784,
1136,
62,
9800,
7,
30023,
9863,
2751,
409,
62,
9800,
796,
374,
85,
62,
7220,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
33678,
13,
628,
220,
220,
220,
42865,
25,
2376,
62,
64,
397,
41876,
4526,
37,
5390,
537,
62,
64,
397,
62,
25641,
415,
13,
628,
220,
220,
220,
2376,
62,
64,
397,
796,
2251,
62,
15252,
7,
6739,
198,
220,
220,
220,
2376,
62,
64,
397,
3784,
268,
36560,
7,
6739,
198,
220,
220,
220,
2376,
62,
64,
397,
3784,
33678,
7,
198,
220,
220,
220,
220,
220,
7788,
42006,
11053,
198,
220,
220,
220,
220,
220,
220,
220,
1401,
62,
1662,
62,
9275,
220,
220,
220,
796,
352,
198,
220,
220,
220,
220,
220,
220,
220,
2632,
62,
18224,
220,
220,
220,
220,
220,
220,
796,
362,
198,
220,
220,
220,
220,
220,
220,
220,
386,
457,
62,
18224,
220,
220,
220,
220,
220,
796,
513,
198,
220,
220,
220,
220,
220,
220,
220,
1401,
62,
312,
62,
18224,
220,
220,
220,
220,
796,
604,
198,
220,
220,
220,
220,
220,
220,
220,
645,
62,
9800,
1634,
796,
642,
198,
220,
220,
220,
220,
220,
220,
220,
269,
912,
62,
18224,
220,
220,
220,
220,
220,
220,
220,
796,
718,
198,
220,
220,
220,
220,
220,
220,
220,
269,
912,
62,
7959,
4871,
220,
220,
220,
220,
796,
767,
198,
220,
220,
220,
220,
220,
220,
220,
440,
4221,
4877,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
807,
6739,
198,
220,
220,
220,
16876,
827,
12,
7266,
6015,
1279,
29,
657,
13,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
14804,
40225,
7,
930,
12331,
34817,
14661,
1503,
1391,
13845,
62,
9186,
12,
26801,
62,
3672,
1782,
91,
6739,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
2376,
62,
64,
397,
3784,
2934,
36560,
7,
6739,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
8906,
48499,
1096,
13,
628,
220,
220,
220,
42865,
25,
300,
85,
62,
79,
4733,
220,
220,
220,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
85,
62,
11213,
41876,
257,
397,
62,
7785,
62,
20147,
1968,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
43979,
62,
271,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
257,
397,
62,
7785,
62,
26801,
62,
529,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
300,
83,
62,
2340,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
257,
397,
62,
7785,
62,
26801,
62,
529,
62,
8658,
11,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
2376,
62,
64,
397,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4526,
37,
5390,
537,
62,
64,
397,
62,
25641,
415,
13,
628,
220,
220,
220,
366,
14661,
1503,
460,
691,
307,
2727,
287,
4839,
540,
10392,
198,
220,
220,
220,
300,
85,
62,
79,
4733,
796,
1976,
565,
62,
397,
499,
18300,
62,
69,
9548,
14804,
1136,
62,
82,
499,
62,
26495,
7,
21628,
62,
26495,
1267,
3784,
533,
62,
36653,
62,
47398,
62,
259,
62,
2213,
62,
42180
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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
] |
CLASS zcl_excel_data_validation DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
*"* public components of class ZCL_EXCEL_DATA_VALIDATION
*"* do not include other source files here!!!
TYPE-POOLS abap .
DATA errorstyle TYPE zexcel_data_val_error_style .
DATA operator TYPE zexcel_data_val_operator .
DATA allowblank TYPE flag VALUE 'X'. "#EC NOTEXT . . . . . . . . . . " .
DATA cell_column TYPE zexcel_cell_column_alpha .
DATA cell_column_to TYPE zexcel_cell_column_alpha .
DATA cell_row TYPE zexcel_cell_row .
DATA cell_row_to TYPE zexcel_cell_row .
CONSTANTS c_type_custom TYPE zexcel_data_val_type VALUE 'custom'. "#EC NOTEXT
CONSTANTS c_type_list TYPE zexcel_data_val_type VALUE 'list'. "#EC NOTEXT
DATA showerrormessage TYPE flag VALUE 'X'. "#EC NOTEXT . . . . . . . . . . " .
DATA showinputmessage TYPE flag VALUE 'X'. "#EC NOTEXT . . . . . . . . . . " .
DATA type TYPE zexcel_data_val_type .
DATA formula1 TYPE zexcel_validation_formula1 .
DATA formula2 TYPE zexcel_validation_formula1 .
CONSTANTS c_type_none TYPE zexcel_data_val_type VALUE 'none'. "#EC NOTEXT
CONSTANTS c_type_date TYPE zexcel_data_val_type VALUE 'date'. "#EC NOTEXT
CONSTANTS c_type_decimal TYPE zexcel_data_val_type VALUE 'decimal'. "#EC NOTEXT
CONSTANTS c_type_textlength TYPE zexcel_data_val_type VALUE 'textLength'. "#EC NOTEXT
CONSTANTS c_type_time TYPE zexcel_data_val_type VALUE 'time'. "#EC NOTEXT
CONSTANTS c_type_whole TYPE zexcel_data_val_type VALUE 'whole'. "#EC NOTEXT
CONSTANTS c_style_stop TYPE zexcel_data_val_error_style VALUE 'stop'. "#EC NOTEXT
CONSTANTS c_style_warning TYPE zexcel_data_val_error_style VALUE 'warning'. "#EC NOTEXT
CONSTANTS c_style_information TYPE zexcel_data_val_error_style VALUE 'information'. "#EC NOTEXT
CONSTANTS c_operator_between TYPE zexcel_data_val_operator VALUE 'between'. "#EC NOTEXT
CONSTANTS c_operator_equal TYPE zexcel_data_val_operator VALUE 'equal'. "#EC NOTEXT
CONSTANTS c_operator_greaterthan TYPE zexcel_data_val_operator VALUE 'greaterThan'. "#EC NOTEXT
CONSTANTS c_operator_greaterthanorequal TYPE zexcel_data_val_operator VALUE 'greaterThanOrEqual'. "#EC NOTEXT
CONSTANTS c_operator_lessthan TYPE zexcel_data_val_operator VALUE 'lessThan'. "#EC NOTEXT
CONSTANTS c_operator_lessthanorequal TYPE zexcel_data_val_operator VALUE 'lessThanOrEqual'. "#EC NOTEXT
CONSTANTS c_operator_notbetween TYPE zexcel_data_val_operator VALUE 'notBetween'. "#EC NOTEXT
CONSTANTS c_operator_notequal TYPE zexcel_data_val_operator VALUE 'notEqual'. "#EC NOTEXT
DATA showdropdown TYPE flag .
DATA errortitle TYPE string .
DATA error TYPE string .
DATA prompttitle TYPE string .
DATA prompt TYPE string .
METHODS constructor .
*"* protected components of class ZCL_EXCEL_DATA_VALIDATION
*"* do not include other source files here!!!
*"* protected components of class ZCL_EXCEL_DATA_VALIDATION
*"* do not include other source files here!!!
PROTECTED SECTION.
PRIVATE SECTION.
*"* private components of class ZCL_EXCEL_DATA_VALIDATION
*"* do not include other source files here!!!
ENDCLASS.
CLASS zcl_excel_data_validation IMPLEMENTATION.
METHOD constructor.
" Initialise instance variables
formula1 = ''.
formula2 = ''.
type = me->c_type_none.
errorstyle = me->c_style_stop.
operator = ''.
allowblank = abap_false.
showdropdown = abap_false.
showinputmessage = abap_true.
showerrormessage = abap_true.
errortitle = ''.
error = ''.
prompttitle = ''.
prompt = ''.
* inizialize dimension range
cell_row = 1.
cell_column = 'A'.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
1069,
5276,
62,
7890,
62,
12102,
341,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
198,
9,
1,
9,
1171,
6805,
286,
1398,
1168,
5097,
62,
6369,
34,
3698,
62,
26947,
62,
23428,
2389,
6234,
198,
9,
1,
9,
466,
407,
2291,
584,
2723,
3696,
994,
10185,
198,
220,
220,
220,
41876,
12,
16402,
3535,
50,
450,
499,
764,
628,
220,
220,
220,
42865,
4049,
7635,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
18224,
62,
7635,
764,
198,
220,
220,
220,
42865,
10088,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
46616,
764,
198,
220,
220,
220,
42865,
1249,
27190,
41876,
6056,
26173,
8924,
705,
55,
4458,
25113,
2943,
5626,
13918,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
366,
764,
198,
220,
220,
220,
42865,
2685,
62,
28665,
41876,
1976,
1069,
5276,
62,
3846,
62,
28665,
62,
26591,
764,
198,
220,
220,
220,
42865,
2685,
62,
28665,
62,
1462,
41876,
1976,
1069,
5276,
62,
3846,
62,
28665,
62,
26591,
764,
198,
220,
220,
220,
42865,
2685,
62,
808,
41876,
1976,
1069,
5276,
62,
3846,
62,
808,
764,
198,
220,
220,
220,
42865,
2685,
62,
808,
62,
1462,
41876,
1976,
1069,
5276,
62,
3846,
62,
808,
764,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
4906,
62,
23144,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
4906,
26173,
8924,
705,
23144,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
4906,
62,
4868,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
4906,
26173,
8924,
705,
4868,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
42865,
14643,
81,
579,
7589,
41876,
6056,
26173,
8924,
705,
55,
4458,
25113,
2943,
5626,
13918,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
366,
764,
198,
220,
220,
220,
42865,
905,
15414,
20500,
41876,
6056,
26173,
8924,
705,
55,
4458,
25113,
2943,
5626,
13918,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
220,
764,
366,
764,
198,
220,
220,
220,
42865,
2099,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
4906,
764,
198,
220,
220,
220,
42865,
10451,
16,
41876,
1976,
1069,
5276,
62,
12102,
341,
62,
687,
4712,
16,
764,
198,
220,
220,
220,
42865,
10451,
17,
41876,
1976,
1069,
5276,
62,
12102,
341,
62,
687,
4712,
16,
764,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
4906,
62,
23108,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
4906,
26173,
8924,
705,
23108,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
4906,
62,
4475,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
4906,
26173,
8924,
705,
4475,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
4906,
62,
12501,
4402,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
4906,
26173,
8924,
705,
12501,
4402,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
4906,
62,
5239,
13664,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
4906,
26173,
8924,
705,
5239,
24539,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
4906,
62,
2435,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
4906,
26173,
8924,
705,
2435,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
4906,
62,
1929,
2305,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
4906,
26173,
8924,
705,
1929,
2305,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
7635,
62,
11338,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
18224,
62,
7635,
26173,
8924,
705,
11338,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
7635,
62,
43917,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
18224,
62,
7635,
26173,
8924,
705,
43917,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
7635,
62,
17018,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
18224,
62,
7635,
26173,
8924,
705,
17018,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
46616,
62,
23395,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
46616,
26173,
8924,
705,
23395,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
46616,
62,
40496,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
46616,
26173,
8924,
705,
40496,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
46616,
62,
18223,
263,
14813,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
46616,
26173,
8924,
705,
18223,
263,
817,
272,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
46616,
62,
18223,
263,
14813,
382,
13255,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
46616,
26173,
8924,
705,
18223,
263,
817,
272,
5574,
36,
13255,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
46616,
62,
829,
301,
7637,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
46616,
26173,
8924,
705,
1203,
817,
272,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
46616,
62,
829,
301,
7637,
382,
13255,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
46616,
26173,
8924,
705,
1203,
817,
272,
5574,
36,
13255,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
46616,
62,
1662,
23395,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
46616,
26173,
8924,
705,
1662,
25262,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
269,
62,
46616,
62,
11295,
13255,
41876,
1976,
1069,
5276,
62,
7890,
62,
2100,
62,
46616,
26173,
8924,
705,
1662,
36,
13255,
4458,
25113,
2943,
5626,
13918,
198,
220,
220,
220,
42865,
905,
14781,
2902
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
CLASS zcl_abapgit_object_shi3 DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
METHODS constructor
IMPORTING
is_item TYPE zif_abapgit_definitions=>ty_item
iv_language TYPE spras.
PROTECTED SECTION.
METHODS has_authorization
IMPORTING
!iv_devclass TYPE devclass
!iv_structure_id TYPE hier_guid
!iv_activity TYPE activ_auth
RAISING
zcx_abapgit_exception .
METHODS is_used
IMPORTING
!iv_structure_id TYPE hier_guid
RAISING
zcx_abapgit_exception .
METHODS delete_tree_structure
IMPORTING
!iv_structure_id TYPE hier_guid .
PRIVATE SECTION.
DATA: mv_tree_id TYPE ttree-id.
METHODS jump_se43
RAISING zcx_abapgit_exception.
METHODS jump_sbach04
RAISING zcx_abapgit_exception.
METHODS clear_fields
CHANGING cs_head TYPE ttree
ct_nodes TYPE hier_iface_t.
ENDCLASS.
CLASS zcl_abapgit_object_shi3 IMPLEMENTATION.
METHOD clear_fields.
FIELD-SYMBOLS <ls_node> LIKE LINE OF ct_nodes.
CLEAR: cs_head-luser, cs_head-ldate, cs_head-ltime.
CLEAR: cs_head-fuser, cs_head-fdate, cs_head-ftime.
CLEAR: cs_head-frelease, cs_head-lrelease.
CLEAR: cs_head-responsibl.
LOOP AT ct_nodes ASSIGNING <ls_node>.
CLEAR: <ls_node>-luser, <ls_node>-ldate, <ls_node>-ltime.
CLEAR: <ls_node>-fuser, <ls_node>-fdate, <ls_node>-ftime.
CLEAR: <ls_node>-frelease, <ls_node>-lrelease.
ENDLOOP.
ENDMETHOD.
METHOD constructor.
super->constructor( is_item = is_item
iv_language = iv_language ).
mv_tree_id = ms_item-obj_name.
ENDMETHOD.
METHOD delete_tree_structure.
CALL FUNCTION 'STREE_EXTERNAL_DELETE'
EXPORTING
structure_id = iv_structure_id
no_confirmation_popup = abap_true.
ENDMETHOD.
METHOD has_authorization.
AUTHORITY-CHECK OBJECT 'S_DEVELOP'
ID 'DEVCLASS' FIELD iv_devclass
ID 'OBJTYPE' FIELD 'MENU'
ID 'OBJNAME' FIELD iv_structure_id
ID 'P_GROUP' DUMMY
ID 'ACTVT' FIELD iv_activity.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( iv_msgid = 'S#'
iv_msgno = '203' ).
ENDIF.
ENDMETHOD.
METHOD is_used.
DATA: lt_used_in_structures TYPE STANDARD TABLE OF ttree WITH DEFAULT KEY.
CALL FUNCTION 'STREE_GET_STRUCTURE_USAGE'
EXPORTING
structure_id = iv_structure_id
TABLES
used_in_structures = lt_used_in_structures.
IF lt_used_in_structures IS NOT INITIAL.
zcx_abapgit_exception=>raise( |IMG structure ID { iv_structure_id } is still used| ).
ENDIF.
ENDMETHOD.
METHOD jump_sbach04.
DATA: ls_message TYPE hier_mess,
lv_structure_id TYPE hier_treeg.
lv_structure_id = ms_item-obj_name.
CALL FUNCTION 'STREE_EXTERNAL_EDIT'
EXPORTING
structure_id = lv_structure_id
language = mv_language
edit_structure = abap_false
no_commit_work = abap_false
activity = 'D'
IMPORTING
message = ls_message.
IF ls_message IS NOT INITIAL.
zcx_abapgit_exception=>raise_t100(
iv_msgid = ls_message-msgid
iv_msgno = ls_message-msgno
iv_msgv1 = ls_message-msgv1
iv_msgv2 = ls_message-msgv2
iv_msgv3 = ls_message-msgv3
iv_msgv4 = ls_message-msgv4 ).
ENDIF.
ENDMETHOD.
METHOD jump_se43.
DATA: lt_bdcdata TYPE TABLE OF bdcdata.
FIELD-SYMBOLS: <ls_bdcdata> LIKE LINE OF lt_bdcdata.
APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>.
<ls_bdcdata>-program = 'SAPLBMEN'.
<ls_bdcdata>-dynpro = '0200'.
<ls_bdcdata>-dynbegin = abap_true.
APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>.
<ls_bdcdata>-fnam = 'BDC_OKCODE'.
<ls_bdcdata>-fval = '=SHOW'.
APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>.
<ls_bdcdata>-fnam = 'BMENUNAME-ID'.
<ls_bdcdata>-fval = ms_item-obj_name.
CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
STARTING NEW TASK 'GIT'
EXPORTING
tcode = 'SE43'
mode_val = 'E'
TABLES
using_tab = lt_bdcdata
EXCEPTIONS
system_failure = 1
communication_failure = 2
resource_failure = 3
OTHERS = 4.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from ABAP4_CALL_TRANSACTION, SHI3' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
DATA: ls_head TYPE ttree.
CALL FUNCTION 'STREE_STRUCTURE_READ'
EXPORTING
structure_id = mv_tree_id
IMPORTING
structure_header = ls_head.
rv_user = ls_head-luser.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
CONSTANTS lc_activity_delete_06 TYPE activ_auth VALUE '06'.
TRY.
IF zif_abapgit_object~exists( ) = abap_false.
RETURN.
ENDIF.
CATCH zcx_abapgit_exception.
RETURN.
ENDTRY.
has_authorization( iv_structure_id = mv_tree_id
iv_devclass = ms_item-devclass
iv_activity = lc_activity_delete_06 ).
is_used( mv_tree_id ).
delete_tree_structure( mv_tree_id ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_msg TYPE hier_mess,
ls_head TYPE ttree,
lt_titles TYPE TABLE OF ttreet,
lt_nodes TYPE TABLE OF hier_iface,
lt_texts TYPE TABLE OF hier_texts,
lt_refs TYPE TABLE OF hier_ref.
io_xml->read( EXPORTING iv_name = 'TREE_HEAD'
CHANGING cg_data = ls_head ).
io_xml->read( EXPORTING iv_name = 'TREE_TITLES'
CHANGING cg_data = lt_titles ).
io_xml->read( EXPORTING iv_name = 'TREE_NODES'
CHANGING cg_data = lt_nodes ).
io_xml->read( EXPORTING iv_name = 'TREE_REFS'
CHANGING cg_data = lt_refs ).
io_xml->read( EXPORTING iv_name = 'TREE_TEXTS'
CHANGING cg_data = lt_texts ).
IF zif_abapgit_object~exists( ) = abap_true.
delete_tree_structure( mv_tree_id ).
ENDIF.
CALL FUNCTION 'STREE_HIERARCHY_SAVE'
EXPORTING
structure_id = mv_tree_id
structure_type = ls_head-type
structure_description = space
structure_masterlanguage = mv_language
structure_responsible = sy-uname
structure_buffermode = ls_head-buffermode
development_class = iv_package
IMPORTING
message = ls_msg
TABLES
list_of_nodes = lt_nodes
list_of_references = lt_refs
list_of_texts = lt_texts
structure_descriptions = lt_titles
EXCEPTIONS
no_nodes_given = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: ls_msg TYPE hier_mess,
ls_header TYPE ttree,
ls_tadir TYPE tadir.
CALL FUNCTION 'STREE_STRUCTURE_EXIST'
EXPORTING
structure_id = mv_tree_id
do_not_read_devclass = ''
IMPORTING
message = ls_msg
structure_header = ls_header
structure_tadir = ls_tadir.
rv_bool = boolc( ls_header-id IS NOT INITIAL ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
DATA: ls_head TYPE ttree.
CALL FUNCTION 'STREE_STRUCTURE_READ'
EXPORTING
structure_id = mv_tree_id
IMPORTING
structure_header = ls_head.
CASE ls_head-type.
WHEN 'BMENU'.
jump_se43( ).
WHEN 'GHIER'.
jump_sbach04( ).
WHEN OTHERS.
zcx_abapgit_exception=>raise( |Jump for type { ls_head-type } not implemented| ).
ENDCASE.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: ls_msg TYPE hier_mess,
ls_head TYPE ttree,
lt_titles TYPE TABLE OF ttreet,
lt_nodes TYPE TABLE OF hier_iface,
lt_texts TYPE TABLE OF hier_texts,
lt_refs TYPE TABLE OF hier_ref,
lv_language TYPE spras,
lv_all_languages TYPE abap_bool.
CALL FUNCTION 'STREE_STRUCTURE_READ'
EXPORTING
structure_id = mv_tree_id
IMPORTING
message = ls_msg
structure_header = ls_head
TABLES
description = lt_titles.
lv_all_languages = abap_false.
IF io_xml->i18n_params( )-main_language_only = abap_false.
lv_all_languages = abap_true.
ELSE.
lv_language = mv_language.
DELETE lt_titles WHERE spras <> lv_language.
ENDIF.
CALL FUNCTION 'STREE_HIERARCHY_READ'
EXPORTING
structure_id = mv_tree_id
read_also_texts = 'X'
all_languages = lv_all_languages
language = lv_language
IMPORTING
message = ls_msg
TABLES
list_of_nodes = lt_nodes
list_of_references = lt_refs
list_of_texts = lt_texts.
clear_fields( CHANGING cs_head = ls_head
ct_nodes = lt_nodes ).
SORT lt_titles BY id.
DELETE ADJACENT DUPLICATES FROM lt_titles COMPARING id.
SORT lt_texts BY spras.
DELETE ADJACENT DUPLICATES FROM lt_texts COMPARING spras node_id.
io_xml->add( iv_name = 'TREE_HEAD'
ig_data = ls_head ).
io_xml->add( iv_name = 'TREE_TITLES'
ig_data = lt_titles ).
io_xml->add( iv_name = 'TREE_NODES'
ig_data = lt_nodes ).
io_xml->add( iv_name = 'TREE_REFS'
ig_data = lt_refs ).
io_xml->add( iv_name = 'TREE_TEXTS'
ig_data = lt_texts ).
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
44019,
18,
5550,
20032,
17941,
44731,
3268,
16879,
2043,
2751,
16034,
1976,
565,
62,
397,
499,
18300,
62,
48205,
62,
16668,
25261,
13,
628,
220,
44731,
44513,
13,
198,
220,
220,
220,
23255,
37,
2246,
1546,
1976,
361,
62,
397,
499,
18300,
62,
15252,
13,
198,
220,
220,
220,
8355,
43429,
1546,
6941,
62,
16624,
7473,
1976,
361,
62,
397,
499,
18300,
62,
15252,
93,
5908,
62,
16624,
13,
628,
220,
220,
220,
337,
36252,
50,
23772,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
318,
62,
9186,
220,
220,
220,
220,
41876,
1976,
361,
62,
397,
499,
18300,
62,
4299,
50101,
14804,
774,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16129,
41876,
7500,
292,
13,
628,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
468,
62,
9800,
1634,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
7959,
4871,
220,
220,
220,
220,
41876,
1614,
4871,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
301,
5620,
62,
312,
41876,
13550,
62,
5162,
312,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
21797,
220,
220,
220,
220,
41876,
1753,
62,
18439,
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,
318,
62,
1484,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
301,
5620,
62,
312,
41876,
13550,
62,
5162,
312,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
764,
198,
220,
220,
220,
337,
36252,
50,
12233,
62,
21048,
62,
301,
5620,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
5145,
452,
62,
301,
5620,
62,
312,
41876,
13550,
62,
5162,
312,
764,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
42865,
25,
285,
85,
62,
21048,
62,
312,
41876,
256,
21048,
12,
312,
13,
628,
220,
220,
220,
337,
36252,
50,
4391,
62,
325,
3559,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
337,
36252,
50,
4391,
62,
82,
19496,
3023,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
220,
220,
337,
36252,
50,
1598,
62,
25747,
198,
220,
220,
220,
220,
220,
5870,
15567,
2751,
50115,
62,
2256,
220,
41876,
256,
21048,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
269,
83,
62,
77,
4147,
41876,
13550,
62,
361,
558,
62,
83,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
397,
499,
18300,
62,
15252,
62,
44019,
18,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
1598,
62,
25747,
13,
628,
220,
220,
220,
18930,
24639,
12,
23060,
10744,
3535,
50,
1279,
7278,
62,
17440,
29,
34178,
48920,
3963,
269,
83,
62,
77,
4147,
13,
628,
220,
220,
220,
30301,
1503,
25,
50115,
62,
2256,
12,
75,
7220,
11,
50115,
62,
2256,
12,
335,
378,
11,
50115,
62,
2256,
12,
75,
2435,
13,
198,
220,
220,
220,
30301,
1503,
25,
50115,
62,
2256,
12,
69,
7220,
11,
50115,
62,
2256,
12,
69,
4475,
11,
50115,
62,
2256,
12,
31387,
13,
198,
220,
220,
220,
30301,
1503,
25,
50115,
62,
2256,
12,
19503,
1274,
11,
50115,
62,
2256,
12,
75,
20979,
13,
198,
220,
220,
220,
30301,
1503,
25,
50115,
62,
2256,
12,
16733,
10506,
13,
628,
220,
220,
220,
17579,
3185,
5161,
269,
83,
62,
77,
4147,
24994,
3528,
15871,
1279,
7278,
62,
17440,
28401,
198,
220,
220,
220,
220,
220,
30301,
1503,
25,
1279,
7278,
62,
17440,
29,
12,
75,
7220,
11,
1279,
7278,
62,
17440,
29,
12,
335,
378,
11,
1279,
7278,
62,
17440,
29,
12,
75,
2435,
13,
198,
220,
220,
220,
220,
220,
30301,
1503,
25,
1279,
7278,
62,
17440,
29,
12,
69,
7220,
11,
1279,
7278,
62,
17440,
29,
12,
69,
4475,
11,
1279,
7278,
62,
17440,
29,
12,
31387,
13,
198,
220,
220,
220,
220,
220,
30301,
1503,
25,
1279,
7278,
62,
17440,
29,
12,
19503,
1274,
11,
1279,
7278,
62,
17440,
29,
12,
75,
20979,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
628,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
23772,
13,
198,
220,
220,
220,
2208,
3784,
41571,
273,
7,
318,
62,
9186,
796,
318,
62,
9186,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
21628,
62,
16129,
796,
21628,
62,
16129,
6739,
198,
220,
220,
220,
285,
85,
62,
21048,
62,
312,
796,
13845,
62,
9186,
12,
26801,
62,
3672,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
12233,
62,
21048,
62,
301,
5620,
13,
198,
220,
220,
220,
42815,
29397,
4177,
2849,
705,
2257,
11587,
62,
6369,
31800,
1847,
62,
7206,
2538,
9328,
6,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
4645,
62,
312,
220,
220,
220,
220,
220,
220,
220,
220,
220,
796,
21628,
62,
301,
5620,
62,
312,
198,
220,
220,
220,
220,
220,
220,
220,
645,
62,
10414,
36241,
62,
12924,
929,
796,
450,
499,
62,
7942,
13,
198,
220,
23578,
49273,
13,
628,
198,
220,
337,
36252,
468,
62,
9800,
1634,
13,
628,
220,
220,
220,
44746,
9050,
12,
50084,
25334,
23680,
705,
50,
62,
7206,
18697,
3185,
6,
198,
220,
220,
220,
220,
220,
4522,
705,
39345,
31631,
6,
220,
18930,
24639,
21628,
62,
7959,
4871,
198,
220,
220,
220,
220,
220,
4522,
705,
9864,
41,
25216,
6,
220,
220,
18930,
24639,
705,
49275,
52
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
*---------------------------------------------------------------------*
* view related FORM routines
* generation date: 02.03.2021 at 21:38:55
* view maintenance generator version: #001407#
*---------------------------------------------------------------------*
*...processing: ZAMPV_CONFIG_PRO................................*
FORM GET_DATA_ZAMPV_CONFIG_PRO.
PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
REFRESH TOTAL.
CLEAR TOTAL.
SELECT * FROM ZAMP_CONFIG_PROV WHERE
(VIM_WHERETAB) .
CLEAR ZAMPV_CONFIG_PRO .
ZAMPV_CONFIG_PRO-METRIC_SCENARIO =
ZAMP_CONFIG_PROV-METRIC_SCENARIO .
ZAMPV_CONFIG_PRO-METRIC_GROUP =
ZAMP_CONFIG_PROV-METRIC_GROUP .
ZAMPV_CONFIG_PRO-METRIC_CLASS =
ZAMP_CONFIG_PROV-METRIC_CLASS .
<VIM_TOTAL_STRUC> = ZAMPV_CONFIG_PRO.
APPEND TOTAL.
ENDSELECT.
SORT TOTAL BY <VIM_XTOTAL_KEY>.
<STATUS>-ALR_SORTED = 'R'.
*.check dynamic selectoptions (not in DDIC)...........................*
IF X_HEADER-SELECTION NE SPACE.
PERFORM CHECK_DYNAMIC_SELECT_OPTIONS.
ELSEIF X_HEADER-DELMDTFLAG NE SPACE.
PERFORM BUILD_MAINKEY_TAB.
ENDIF.
REFRESH EXTRACT.
ENDFORM.
*---------------------------------------------------------------------*
FORM DB_UPD_ZAMPV_CONFIG_PRO .
*.process data base updates/inserts/deletes.........................*
LOOP AT TOTAL.
CHECK <ACTION> NE ORIGINAL.
MOVE <VIM_TOTAL_STRUC> TO ZAMPV_CONFIG_PRO.
IF <ACTION> = UPDATE_GELOESCHT.
<ACTION> = GELOESCHT.
ENDIF.
CASE <ACTION>.
WHEN NEUER_GELOESCHT.
IF STATUS_ZAMPV_CONFIG_PRO-ST_DELETE EQ GELOESCHT.
READ TABLE EXTRACT WITH KEY <VIM_XTOTAL_KEY>.
IF SY-SUBRC EQ 0.
DELETE EXTRACT INDEX SY-TABIX.
ENDIF.
ENDIF.
DELETE TOTAL.
IF X_HEADER-DELMDTFLAG NE SPACE.
PERFORM DELETE_FROM_MAINKEY_TAB.
ENDIF.
WHEN GELOESCHT.
SELECT SINGLE FOR UPDATE * FROM ZAMP_CONFIG_PROV WHERE
METRIC_SCENARIO = ZAMPV_CONFIG_PRO-METRIC_SCENARIO AND
METRIC_GROUP = ZAMPV_CONFIG_PRO-METRIC_GROUP .
IF SY-SUBRC = 0.
DELETE ZAMP_CONFIG_PROV .
ENDIF.
IF STATUS-DELETE EQ GELOESCHT.
READ TABLE EXTRACT WITH KEY <VIM_XTOTAL_KEY> BINARY SEARCH.
DELETE EXTRACT INDEX SY-TABIX.
ENDIF.
DELETE TOTAL.
IF X_HEADER-DELMDTFLAG NE SPACE.
PERFORM DELETE_FROM_MAINKEY_TAB.
ENDIF.
WHEN OTHERS.
SELECT SINGLE FOR UPDATE * FROM ZAMP_CONFIG_PROV WHERE
METRIC_SCENARIO = ZAMPV_CONFIG_PRO-METRIC_SCENARIO AND
METRIC_GROUP = ZAMPV_CONFIG_PRO-METRIC_GROUP .
IF SY-SUBRC <> 0. "insert preprocessing: init WA
CLEAR ZAMP_CONFIG_PROV.
ENDIF.
ZAMP_CONFIG_PROV-METRIC_SCENARIO =
ZAMPV_CONFIG_PRO-METRIC_SCENARIO .
ZAMP_CONFIG_PROV-METRIC_GROUP =
ZAMPV_CONFIG_PRO-METRIC_GROUP .
ZAMP_CONFIG_PROV-METRIC_CLASS =
ZAMPV_CONFIG_PRO-METRIC_CLASS .
IF SY-SUBRC = 0.
UPDATE ZAMP_CONFIG_PROV ##WARN_OK.
ELSE.
INSERT ZAMP_CONFIG_PROV .
ENDIF.
READ TABLE EXTRACT WITH KEY <VIM_XTOTAL_KEY>.
IF SY-SUBRC EQ 0.
<XACT> = ORIGINAL.
MODIFY EXTRACT INDEX SY-TABIX.
ENDIF.
<ACTION> = ORIGINAL.
MODIFY TOTAL.
ENDCASE.
ENDLOOP.
CLEAR: STATUS_ZAMPV_CONFIG_PRO-UPD_FLAG,
STATUS_ZAMPV_CONFIG_PRO-UPD_CHECKD.
MESSAGE S018(SV).
ENDFORM.
*---------------------------------------------------------------------*
FORM READ_SINGLE_ZAMPV_CONFIG_PRO.
SELECT SINGLE * FROM ZAMP_CONFIG_PROV WHERE
METRIC_SCENARIO = ZAMPV_CONFIG_PRO-METRIC_SCENARIO AND
METRIC_GROUP = ZAMPV_CONFIG_PRO-METRIC_GROUP .
ZAMPV_CONFIG_PRO-METRIC_SCENARIO =
ZAMP_CONFIG_PROV-METRIC_SCENARIO .
ZAMPV_CONFIG_PRO-METRIC_GROUP =
ZAMP_CONFIG_PROV-METRIC_GROUP .
ZAMPV_CONFIG_PRO-METRIC_CLASS =
ZAMP_CONFIG_PROV-METRIC_CLASS .
ENDFORM.
*---------------------------------------------------------------------*
FORM CORR_MAINT_ZAMPV_CONFIG_PRO USING VALUE(CM_ACTION) RC.
DATA: RETCODE LIKE SY-SUBRC, COUNT TYPE I, TRSP_KEYLEN TYPE SYFLENG.
FIELD-SYMBOLS: <TAB_KEY_X> TYPE X.
CLEAR RC.
MOVE ZAMPV_CONFIG_PRO-METRIC_SCENARIO TO
ZAMP_CONFIG_PROV-METRIC_SCENARIO .
MOVE ZAMPV_CONFIG_PRO-METRIC_GROUP TO
ZAMP_CONFIG_PROV-METRIC_GROUP .
CORR_KEYTAB = E071K.
CORR_KEYTAB-OBJNAME = 'ZAMP_CONFIG_PROV'.
IF NOT <vim_corr_keyx> IS ASSIGNED.
ASSIGN CORR_KEYTAB-TABKEY TO <vim_corr_keyx> CASTING.
ENDIF.
ASSIGN ZAMP_CONFIG_PROV TO <TAB_KEY_X> CASTING.
PERFORM VIM_GET_TRSPKEYLEN
USING 'ZAMP_CONFIG_PROV'
CHANGING TRSP_KEYLEN.
<VIM_CORR_KEYX>(TRSP_KEYLEN) = <TAB_KEY_X>(TRSP_KEYLEN).
PERFORM UPDATE_CORR_KEYTAB USING CM_ACTION RETCODE.
ADD: RETCODE TO RC, 1 TO COUNT.
IF RC LT COUNT AND CM_ACTION NE PRUEFEN.
CLEAR RC.
ENDIF.
ENDFORM.
*---------------------------------------------------------------------*
*...processing: ZAMPV_CONFIG_SCE................................*
FORM GET_DATA_ZAMPV_CONFIG_SCE.
PERFORM VIM_FILL_WHERETAB.
*.read data from database.............................................*
REFRESH TOTAL.
CLEAR TOTAL.
SELECT * FROM ZAMP_CONFIG_SCEN WHERE
(VIM_WHERETAB) .
CLEAR ZAMPV_CONFIG_SCE .
ZAMPV_CONFIG_SCE-METRIC_SCENARIO =
ZAMP_CONFIG_SCEN-METRIC_SCENARIO .
ZAMPV_CONFIG_SCE-CONVERTER_CLASS =
ZAMP_CONFIG_SCEN-CONVERTER_CLASS .
<VIM_TOTAL_STRUC> = ZAMPV_CONFIG_SCE.
APPEND TOTAL.
ENDSELECT.
SORT TOTAL BY <VIM_XTOTAL_KEY>.
<STATUS>-ALR_SORTED = 'R'.
*.check dynamic selectoptions (not in DDIC)...........................*
IF X_HEADER-SELECTION NE SPACE.
PERFORM CHECK_DYNAMIC_SELECT_OPTIONS.
ELSEIF X_HEADER-DELMDTFLAG NE SPACE.
PERFORM BUILD_MAINKEY_TAB.
ENDIF.
REFRESH EXTRACT.
ENDFORM.
*---------------------------------------------------------------------*
FORM DB_UPD_ZAMPV_CONFIG_SCE .
*.process data base updates/inserts/deletes.........................*
LOOP AT TOTAL.
CHECK <ACTION> NE ORIGINAL.
MOVE <VIM_TOTAL_STRUC> TO ZAMPV_CONFIG_SCE.
IF <ACTION> = UPDATE_GELOESCHT.
<ACTION> = GELOESCHT.
ENDIF.
CASE <ACTION>.
WHEN NEUER_GELOESCHT.
IF STATUS_ZAMPV_CONFIG_SCE-ST_DELETE EQ GELOESCHT.
READ TABLE EXTRACT WITH KEY <VIM_XTOTAL_KEY>.
IF SY-SUBRC EQ 0.
DELETE EXTRACT INDEX SY-TABIX.
ENDIF.
ENDIF.
DELETE TOTAL.
IF X_HEADER-DELMDTFLAG NE SPACE.
PERFORM DELETE_FROM_MAINKEY_TAB.
ENDIF.
WHEN GELOESCHT.
SELECT SINGLE FOR UPDATE * FROM ZAMP_CONFIG_SCEN WHERE
METRIC_SCENARIO = ZAMPV_CONFIG_SCE-METRIC_SCENARIO .
IF SY-SUBRC = 0.
DELETE ZAMP_CONFIG_SCEN .
ENDIF.
IF STATUS-DELETE EQ GELOESCHT.
READ TABLE EXTRACT WITH KEY <VIM_XTOTAL_KEY> BINARY SEARCH.
DELETE EXTRACT INDEX SY-TABIX.
ENDIF.
DELETE TOTAL.
IF X_HEADER-DELMDTFLAG NE SPACE.
PERFORM DELETE_FROM_MAINKEY_TAB.
ENDIF.
WHEN OTHERS.
SELECT SINGLE FOR UPDATE * FROM ZAMP_CONFIG_SCEN WHERE
METRIC_SCENARIO = ZAMPV_CONFIG_SCE-METRIC_SCENARIO .
IF SY-SUBRC <> 0. "insert preprocessing: init WA
CLEAR ZAMP_CONFIG_SCEN.
ENDIF.
ZAMP_CONFIG_SCEN-METRIC_SCENARIO =
ZAMPV_CONFIG_SCE-METRIC_SCENARIO .
ZAMP_CONFIG_SCEN-CONVERTER_CLASS =
ZAMPV_CONFIG_SCE-CONVERTER_CLASS .
IF SY-SUBRC = 0.
UPDATE ZAMP_CONFIG_SCEN ##WARN_OK.
ELSE.
INSERT ZAMP_CONFIG_SCEN .
ENDIF.
READ TABLE EXTRACT WITH KEY <VIM_XTOTAL_KEY>.
IF SY-SUBRC EQ 0.
<XACT> = ORIGINAL.
MODIFY EXTRACT INDEX SY-TABIX.
ENDIF.
<ACTION> = ORIGINAL.
MODIFY TOTAL.
ENDCASE.
ENDLOOP.
CLEAR: STATUS_ZAMPV_CONFIG_SCE-UPD_FLAG,
STATUS_ZAMPV_CONFIG_SCE-UPD_CHECKD.
MESSAGE S018(SV).
ENDFORM.
*---------------------------------------------------------------------*
FORM READ_SINGLE_ZAMPV_CONFIG_SCE.
SELECT SINGLE * FROM ZAMP_CONFIG_SCEN WHERE
METRIC_SCENARIO = ZAMPV_CONFIG_SCE-METRIC_SCENARIO .
ZAMPV_CONFIG_SCE-METRIC_SCENARIO =
ZAMP_CONFIG_SCEN-METRIC_SCENARIO .
ZAMPV_CONFIG_SCE-CONVERTER_CLASS =
ZAMP_CONFIG_SCEN-CONVERTER_CLASS .
ENDFORM.
*---------------------------------------------------------------------*
FORM CORR_MAINT_ZAMPV_CONFIG_SCE USING VALUE(CM_ACTION) RC.
DATA: RETCODE LIKE SY-SUBRC, COUNT TYPE I, TRSP_KEYLEN TYPE SYFLENG.
FIELD-SYMBOLS: <TAB_KEY_X> TYPE X.
CLEAR RC.
MOVE ZAMPV_CONFIG_SCE-METRIC_SCENARIO TO
ZAMP_CONFIG_SCEN-METRIC_SCENARIO .
CORR_KEYTAB = E071K.
CORR_KEYTAB-OBJNAME = 'ZAMP_CONFIG_SCEN'.
IF NOT <vim_corr_keyx> IS ASSIGNED.
ASSIGN CORR_KEYTAB-TABKEY TO <vim_corr_keyx> CASTING.
ENDIF.
ASSIGN ZAMP_CONFIG_SCEN TO <TAB_KEY_X> CASTING.
PERFORM VIM_GET_TRSPKEYLEN
USING 'ZAMP_CONFIG_SCEN'
CHANGING TRSP_KEYLEN.
<VIM_CORR_KEYX>(TRSP_KEYLEN) = <TAB_KEY_X>(TRSP_KEYLEN).
PERFORM UPDATE_CORR_KEYTAB USING CM_ACTION RETCODE.
ADD: RETCODE TO RC, 1 TO COUNT.
IF RC LT COUNT AND CM_ACTION NE PRUEFEN.
CLEAR RC.
ENDIF.
ENDFORM.
*---------------------------------------------------------------------*
| [
9,
10097,
30934,
9,
198,
9,
220,
220,
220,
1570,
3519,
49144,
31878,
198,
9,
220,
220,
5270,
3128,
25,
7816,
13,
3070,
13,
1238,
2481,
379,
2310,
25,
2548,
25,
2816,
198,
9,
220,
220,
1570,
9262,
17301,
2196,
25,
1303,
405,
1415,
2998,
2,
198,
9,
10097,
30934,
9,
198,
9,
986,
36948,
25,
1168,
23518,
53,
62,
10943,
16254,
62,
31190,
8864,
9,
198,
21389,
17151,
62,
26947,
62,
57,
23518,
53,
62,
10943,
16254,
62,
31190,
13,
198,
220,
19878,
21389,
569,
3955,
62,
37,
8267,
62,
12418,
1137,
2767,
6242,
13,
198,
24620,
961,
1366,
422,
6831,
8864,
44274,
9,
198,
220,
4526,
10913,
44011,
36247,
13,
198,
220,
30301,
1503,
220,
220,
36247,
13,
198,
220,
33493,
1635,
16034,
1168,
23518,
62,
10943,
16254,
62,
41283,
33411,
198,
7,
53,
3955,
62,
12418,
1137,
2767,
6242,
8,
764,
198,
220,
220,
220,
30301,
1503,
1168,
23518,
53,
62,
10943,
16254,
62,
31190,
764,
198,
57,
23518,
53,
62,
10943,
16254,
62,
31190,
12,
47123,
41132,
62,
6173,
1677,
1503,
9399,
796,
198,
57,
23518,
62,
10943,
16254,
62,
41283,
12,
47123,
41132,
62,
6173,
1677,
1503,
9399,
764,
198,
57,
23518,
53,
62,
10943,
16254,
62,
31190,
12,
47123,
41132,
62,
46846,
796,
198,
57,
23518,
62,
10943,
16254,
62,
41283,
12,
47123,
41132,
62,
46846,
764,
198,
57,
23518,
53,
62,
10943,
16254,
62,
31190,
12,
47123,
41132,
62,
31631,
796,
198,
57,
23518,
62,
10943,
16254,
62,
41283,
12,
47123,
41132,
62,
31631,
764,
198,
27,
53,
3955,
62,
51,
27510,
62,
18601,
9598,
29,
796,
1168,
23518,
53,
62,
10943,
16254,
62,
31190,
13,
198,
220,
220,
220,
43504,
10619,
36247,
13,
198,
220,
23578,
46506,
13,
198,
220,
311,
9863,
36247,
11050,
1279,
53,
3955,
62,
25010,
27510,
62,
20373,
28401,
198,
220,
1279,
35744,
2937,
29,
12,
1847,
49,
62,
50,
9863,
1961,
796,
705,
49,
4458,
198,
24620,
9122,
8925,
2922,
25811,
357,
1662,
287,
20084,
2149,
8,
27754,
986,
9,
198,
220,
16876,
1395,
62,
37682,
1137,
12,
46506,
2849,
10635,
37253,
13,
198,
220,
220,
220,
19878,
21389,
5870,
25171,
62,
35,
40760,
2390,
2149,
62,
46506,
62,
3185,
51,
11053,
13,
198,
220,
17852,
5188,
5064,
1395,
62,
37682,
1137,
12,
35,
3698,
12740,
51,
38948,
10635,
37253,
13,
198,
220,
220,
220,
19878,
21389,
20571,
26761,
62,
5673,
1268,
20373,
62,
5603,
33,
13,
198,
220,
23578,
5064,
13,
198,
220,
4526,
10913,
44011,
7788,
5446,
10659,
13,
198,
1677,
8068,
1581,
44,
13,
198,
9,
10097,
30934,
9,
198,
21389,
20137,
62,
52,
5760,
62,
57,
23518,
53,
62,
10943,
16254,
62,
31190,
764,
198,
24620,
14681,
1366,
2779,
5992,
14,
28463,
82,
14,
2934,
40676,
4181,
34617,
9,
198,
21982,
3185,
5161,
36247,
13,
198,
220,
5870,
25171,
1279,
44710,
29,
10635,
43901,
17961,
13,
198,
11770,
6089,
1279,
53,
3955,
62,
51,
27510,
62,
18601,
9598,
29,
5390,
1168,
23518,
53,
62,
10943,
16254,
62,
31190,
13,
198,
220,
16876,
1279,
44710,
29,
796,
35717,
62,
38,
3698,
46,
1546,
3398,
51,
13,
198,
220,
220,
220,
1279,
44710,
29,
796,
402,
3698,
46,
1546,
3398,
51,
13,
198,
220,
23578,
5064,
13,
198,
220,
42001,
1279,
44710,
28401,
198,
220,
220,
42099,
10635,
52,
1137,
62,
38,
3698,
46,
1546,
3398,
51,
13,
198,
5064,
15486,
2937,
62,
57,
23518,
53,
62,
10943,
16254,
62,
31190,
12,
2257,
62,
7206,
2538,
9328,
36529,
402,
3698,
46,
1546,
3398,
51,
13,
198,
220,
220,
220,
220,
20832,
43679,
7788,
5446,
10659,
13315,
35374,
1279,
53,
3955,
62,
25010,
27510,
62,
20373,
28401,
198,
220,
220,
220,
220,
16876,
19704,
12,
50,
10526,
7397,
36529,
657,
13,
198,
220,
220,
220,
220,
220,
220,
5550,
2538,
9328,
7788,
5446,
10659,
24413,
6369,
19704,
12,
5603,
3483,
55,
13,
198,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
5550,
2538,
9328,
36247,
13,
198,
220,
220,
220,
16876,
1395,
62,
37682,
1137,
12,
35,
3698,
12740,
51,
38948,
10635,
37253,
13,
198,
220,
220,
220,
220,
220,
19878,
21389,
5550,
2538,
9328,
62,
10913,
2662,
62,
5673,
1268,
20373,
62,
5603,
33,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
42099,
402,
3698,
46,
1546,
3398,
51,
13,
198,
220,
33493,
311,
2751,
2538,
7473,
35717,
1635,
16034,
1168,
23518,
62,
10943,
16254,
62,
41283,
33411,
198,
220,
31243,
41132,
62,
6173,
1677,
1503,
9399,
796,
1168,
23518,
53,
62,
10943,
16254,
62,
31190,
12,
47123,
41132,
62,
6173,
1677,
1503,
9399,
5357,
198,
220,
31243,
41132,
62,
46846,
796,
1168,
23518,
53,
62,
10943,
16254,
62,
31190,
12,
47123,
41132,
62,
46846,
764,
198,
220,
220,
220,
16876,
19704,
12,
50,
10526,
7397,
796,
657,
13,
198,
220,
220,
220,
5550,
2538,
9328,
1168,
23518,
62,
10943,
16254,
62,
41283,
764,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
16876,
15486,
2937,
12,
7206,
2538,
9328,
36529,
402,
3698,
46,
1546,
3398,
51,
13,
198,
220,
220,
220,
220,
220,
20832,
43679,
7788,
5446,
10659,
13315,
35374,
1279,
53,
3955,
62,
25010,
27510,
62,
20373,
29,
347,
1268,
13153,
7946,
31315,
13,
198,
220,
220,
220,
220,
220,
5550,
2538,
9328,
7788,
5446,
10659,
24413,
6369,
19704,
12,
5603,
3483,
55,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
5550,
2538,
9328,
36247,
13,
198,
220,
220,
220,
16876,
1395,
62,
37682,
1137,
12,
35,
3698,
12740,
51,
38948,
10635,
37253,
13,
198,
220,
220,
220,
220,
220,
19878,
21389,
5550,
2538,
9328,
62,
10913,
2662,
62,
5673,
1268,
20373,
62,
5603,
33,
13,
198,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
42099,
440,
4221,
4877,
13,
198,
220,
33493,
311,
2751,
2538,
7473,
35717,
1635,
16034,
1168,
23518,
62,
10943,
16254,
62,
41283,
33411,
198,
220,
31243,
41132,
62,
6173,
1677,
1503,
9399,
796,
1168,
23518,
53,
62,
10943,
16254,
62,
31190,
12,
47123,
41132,
62,
6173,
1677,
1503,
9399,
5357,
198,
220,
31243,
41132,
62,
46846,
796,
1168,
23518,
53,
62,
10943,
16254,
62,
31190,
12,
47123,
41132,
62,
46846,
764,
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,
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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
] |
class ZCL_TE_FLIGHTOVP_MPC definition
public
inheriting from /IWBEP/CL_MGW_PUSH_ABS_MODEL
create public .
public section.
interfaces IF_SADL_GW_MODEL_EXPOSURE_DATA .
types:
begin of TS_ZC_TE_ABOOKINGTYPE.
include type ZVC_TE_ABOOKINGS.
types:
generated_id type string,
end of TS_ZC_TE_ABOOKINGTYPE .
types:
TT_ZC_TE_ABOOKINGTYPE type standard table of TS_ZC_TE_ABOOKINGTYPE .
types:
TS_ZC_TE_AGENCYTYPE type ZVC_TE_AGENCY .
types:
TT_ZC_TE_AGENCYTYPE type standard table of TS_ZC_TE_AGENCYTYPE .
types:
TS_ZC_TE_FLIGHT_FILTERTYPE type ZVC_TE_FFILTER .
types:
TT_ZC_TE_FLIGHT_FILTERTYPE type standard table of TS_ZC_TE_FLIGHT_FILTERTYPE .
types:
TS_ZI_TE_AIRPORTTYPE type ZVI_TE_AIRPORT .
types:
TT_ZI_TE_AIRPORTTYPE type standard table of TS_ZI_TE_AIRPORTTYPE .
types:
TS_ZI_TE_CARRIERTYPE type ZVI_TE_CARRIER .
types:
TT_ZI_TE_CARRIERTYPE type standard table of TS_ZI_TE_CARRIERTYPE .
types:
TS_ZI_TE_CONNECTIONTYPE type ZVI_TE_CONNECT .
types:
TT_ZI_TE_CONNECTIONTYPE type standard table of TS_ZI_TE_CONNECTIONTYPE .
constants GC_ZC_TE_ABOOKINGTYPE type /IWBEP/IF_MGW_MED_ODATA_TYPES=>TY_E_MED_ENTITY_NAME value 'Zc_Te_AbookingType' ##NO_TEXT.
constants GC_ZC_TE_AGENCYTYPE type /IWBEP/IF_MGW_MED_ODATA_TYPES=>TY_E_MED_ENTITY_NAME value 'Zc_Te_AgencyType' ##NO_TEXT.
constants GC_ZC_TE_FLIGHT_FILTERTYPE type /IWBEP/IF_MGW_MED_ODATA_TYPES=>TY_E_MED_ENTITY_NAME value 'Zc_Te_Flight_FilterType' ##NO_TEXT.
constants GC_ZI_TE_AIRPORTTYPE type /IWBEP/IF_MGW_MED_ODATA_TYPES=>TY_E_MED_ENTITY_NAME value 'Zi_Te_AirportType' ##NO_TEXT.
constants GC_ZI_TE_CARRIERTYPE type /IWBEP/IF_MGW_MED_ODATA_TYPES=>TY_E_MED_ENTITY_NAME value 'Zi_Te_CarrierType' ##NO_TEXT.
constants GC_ZI_TE_CONNECTIONTYPE type /IWBEP/IF_MGW_MED_ODATA_TYPES=>TY_E_MED_ENTITY_NAME value 'Zi_Te_ConnectionType' ##NO_TEXT.
methods DEFINE
redefinition .
methods GET_LAST_MODIFIED
redefinition .
protected section.
private section.
constants GC_INCL_NAME type STRING value 'ZCL_TE_FLIGHTOVP_MPC==========CP' ##NO_TEXT.
methods DEFINE_RDS_4
raising
/IWBEP/CX_MGW_MED_EXCEPTION .
methods GET_LAST_MODIFIED_RDS_4
returning
value(RV_LAST_MODIFIED_RDS) type TIMESTAMP .
ENDCLASS.
CLASS ZCL_TE_FLIGHTOVP_MPC IMPLEMENTATION.
method DEFINE.
*&---------------------------------------------------------------------*
*& Generated code for the MODEL PROVIDER BASE CLASS &*
*& &*
*& !!!NEVER MODIFY THIS CLASS. IN CASE YOU WANT TO CHANGE THE MODEL &*
*& DO THIS IN THE MODEL PROVIDER SUBCLASS!!! &*
*& &*
*&---------------------------------------------------------------------*
model->set_schema_namespace( 'ZTE_FLIGHTOVP_SRV' ).
define_rds_4( ).
get_last_modified_rds_4( ).
endmethod.
method DEFINE_RDS_4.
*&---------------------------------------------------------------------*
*& Generated code for the MODEL PROVIDER BASE CLASS &*
*& &*
*& !!!NEVER MODIFY THIS CLASS. IN CASE YOU WANT TO CHANGE THE MODEL &*
*& DO THIS IN THE MODEL PROVIDER SUBCLASS!!! &*
*& &*
*&---------------------------------------------------------------------*
* This code is generated for Reference Data Source
* 4
*&---------------------------------------------------------------------*
TRY.
if_sadl_gw_model_exposure_data~get_model_exposure( )->expose( model )->expose_vocabulary( vocab_anno_model ).
CATCH cx_sadl_exposure_error INTO DATA(lx_sadl_exposure_error).
RAISE EXCEPTION TYPE /iwbep/cx_mgw_med_exception
EXPORTING
previous = lx_sadl_exposure_error.
ENDTRY.
endmethod.
method GET_LAST_MODIFIED.
*&---------------------------------------------------------------------*
*& Generated code for the MODEL PROVIDER BASE CLASS &*
*& &*
*& !!!NEVER MODIFY THIS CLASS. IN CASE YOU WANT TO CHANGE THE MODEL &*
*& DO THIS IN THE MODEL PROVIDER SUBCLASS!!! &*
*& &*
*&---------------------------------------------------------------------*
CONSTANTS: lc_gen_date_time TYPE timestamp VALUE '20170816171648'. "#EC NOTEXT
DATA: lv_rds_last_modified TYPE timestamp .
rv_last_modified = super->get_last_modified( ).
IF rv_last_modified LT lc_gen_date_time.
rv_last_modified = lc_gen_date_time.
ENDIF.
lv_rds_last_modified = GET_LAST_MODIFIED_RDS_4( ).
IF rv_last_modified LT lv_rds_last_modified.
rv_last_modified = lv_rds_last_modified .
ENDIF .
endmethod.
method GET_LAST_MODIFIED_RDS_4.
*&---------------------------------------------------------------------*
*& Generated code for the MODEL PROVIDER BASE CLASS &*
*& &*
*& !!!NEVER MODIFY THIS CLASS. IN CASE YOU WANT TO CHANGE THE MODEL &*
*& DO THIS IN THE MODEL PROVIDER SUBCLASS!!! &*
*& &*
*&---------------------------------------------------------------------*
* This code is generated for Reference Data Source
* 4
*&---------------------------------------------------------------------*
CONSTANTS: co_gen_date_time TYPE timestamp VALUE '20170816091648'.
TRY.
rv_last_modified_rds = CAST cl_sadl_gw_model_exposure( if_sadl_gw_model_exposure_data~get_model_exposure( ) )->get_last_modified( ).
CATCH cx_root.
rv_last_modified_rds = co_gen_date_time.
ENDTRY.
IF rv_last_modified_rds < co_gen_date_time.
rv_last_modified_rds = co_gen_date_time.
ENDIF.
endmethod.
method IF_SADL_GW_MODEL_EXPOSURE_DATA~GET_MODEL_EXPOSURE.
DATA(lv_sadl_xml) =
|<?xml version="1.0" encoding="utf-16"?>| &
|<sadl:definition xmlns:sadl="http://sap.com/sap.nw.f.sadl" syntaxVersion="" >| &
| <sadl:dataSource type="CDS" name="ZC_TE_ABOOKING" binding="ZC_TE_ABOOKING" />| &
| <sadl:dataSource type="CDS" name="ZC_TE_AGENCY" binding="ZC_TE_AGENCY" />| &
| <sadl:dataSource type="CDS" name="ZC_TE_FLIGHT_FILTER" binding="ZC_TE_FLIGHT_FILTER" />| &
| <sadl:dataSource type="CDS" name="ZI_TE_AIRPORT" binding="ZI_TE_AIRPORT" />| &
| <sadl:dataSource type="CDS" name="ZI_TE_CARRIER" binding="ZI_TE_CARRIER" />| &
| <sadl:dataSource type="CDS" name="ZI_TE_CONNECTION" binding="ZI_TE_CONNECTION" />| &
|<sadl:resultSet>| &
|<sadl:structure name="Zc_Te_Abooking" dataSource="ZC_TE_ABOOKING" maxEditMode="RO" exposure="TRUE" >| &
| <sadl:query name="SADL_QUERY" >| &
| </sadl:query>| &
| <sadl:association name="TO_AGENCY" binding="_AGENCY" target="Zc_Te_Agency" cardinality="zeroToOne" />| &
| <sadl:association name="TO_CONNECTION" binding="_CONNECTION" target="Zi_Te_Connection" cardinality="zeroToOne" />| &
|</sadl:structure>| &
|<sadl:structure name="Zc_Te_Agency" dataSource="ZC_TE_AGENCY" maxEditMode="RO" exposure="TRUE" >| &
| <sadl:query name="SADL_QUERY" >| &
| </sadl:query>| &
|</sadl:structure>| &
|<sadl:structure name="Zc_Te_Flight_Filter" dataSource="ZC_TE_FLIGHT_FILTER" maxEditMode="RO" exposure="TRUE" >| &
| <sadl:query name="SADL_QUERY" >| &
| </sadl:query>| &
| <sadl:association name="TO_AIRPORTS" binding="_AIRPORTS" target="Zi_Te_Airport" cardinality="many" />| &
| <sadl:association name="TO_CARRIER" binding="_CARRIER" target="Zi_Te_Carrier" cardinality="zeroToOne" />| &
|</sadl:structure>| &
|<sadl:structure name="Zi_Te_Airport" dataSource="ZI_TE_AIRPORT" maxEditMode="RO" exposure="TRUE" >| &
| <sadl:query name="SADL_QUERY" >| &
| </sadl:query>| &
|</sadl:structure>| &
|<sadl:structure name="Zi_Te_Carrier" dataSource="ZI_TE_CARRIER" maxEditMode="RO" exposure="TRUE" >| &
| <sadl:query name="SADL_QUERY" >| &
| </sadl:query>| &
|</sadl:structure>| &
|<sadl:structure name="Zi_Te_Connection" dataSource="ZI_TE_CONNECTION" maxEditMode="RO" exposure="TRUE" >| &
| <sadl:query name="SADL_QUERY" >| &
| </sadl:query>| &
|</sadl:structure>| &
|</sadl:resultSet>| &
|</sadl:definition>| .
ro_model_exposure = cl_sadl_gw_model_exposure=>get_exposure_xml( iv_uuid = CONV #( 'ZTE_FLIGHTOVP' )
iv_timestamp = '20170816091648'
iv_sadl_xml = lv_sadl_xml ).
endmethod.
ENDCLASS.
| [
4871,
1168,
5097,
62,
9328,
62,
3697,
9947,
46,
8859,
62,
44,
5662,
6770,
198,
220,
1171,
198,
220,
10639,
1780,
422,
1220,
40,
45607,
8905,
14,
5097,
62,
20474,
54,
62,
47,
27143,
62,
32,
4462,
62,
33365,
3698,
198,
220,
2251,
1171,
764,
198,
198,
11377,
2665,
13,
628,
220,
20314,
16876,
62,
50,
2885,
43,
62,
33191,
62,
33365,
3698,
62,
6369,
37997,
11335,
62,
26947,
764,
628,
220,
3858,
25,
198,
220,
220,
220,
2221,
286,
26136,
62,
57,
34,
62,
9328,
62,
6242,
15308,
2751,
25216,
13,
198,
220,
220,
220,
220,
220,
2291,
2099,
1168,
15922,
62,
9328,
62,
6242,
15308,
20754,
13,
198,
220,
3858,
25,
198,
220,
220,
220,
220,
220,
7560,
62,
312,
2099,
4731,
11,
198,
220,
220,
220,
886,
286,
26136,
62,
57,
34,
62,
9328,
62,
6242,
15308,
2751,
25216,
764,
198,
220,
3858,
25,
198,
220,
220,
26653,
62,
57,
34,
62,
9328,
62,
6242,
15308,
2751,
25216,
2099,
3210,
3084,
286,
26136,
62,
57,
34,
62,
9328,
62,
6242,
15308,
2751,
25216,
764,
198,
220,
3858,
25,
198,
220,
220,
26136,
62,
57,
34,
62,
9328,
62,
4760,
45155,
25216,
2099,
1168,
15922,
62,
9328,
62,
4760,
45155,
764,
198,
220,
3858,
25,
198,
220,
220,
26653,
62,
57,
34,
62,
9328,
62,
4760,
45155,
25216,
2099,
3210,
3084,
286,
26136,
62,
57,
34,
62,
9328,
62,
4760,
45155,
25216,
764,
198,
220,
3858,
25,
198,
220,
220,
26136,
62,
57,
34,
62,
9328,
62,
3697,
9947,
62,
46700,
5781,
25216,
2099,
1168,
15922,
62,
9328,
62,
5777,
4146,
5781,
764,
198,
220,
3858,
25,
198,
220,
220,
26653,
62,
57,
34,
62,
9328,
62,
3697,
9947,
62,
46700,
5781,
25216,
2099,
3210,
3084,
286,
26136,
62,
57,
34,
62,
9328,
62,
3697,
9947,
62,
46700,
5781,
25216,
764,
198,
220,
3858,
25,
198,
220,
220,
26136,
62,
48926,
62,
9328,
62,
42149,
15490,
25216,
2099,
1168,
12861,
62,
9328,
62,
42149,
15490,
764,
198,
220,
3858,
25,
198,
220,
220,
26653,
62,
48926,
62,
9328,
62,
42149,
15490,
25216,
2099,
3210,
3084,
286,
26136,
62,
48926,
62,
9328,
62,
42149,
15490,
25216,
764,
198,
220,
3858,
25,
198,
220,
220,
26136,
62,
48926,
62,
9328,
62,
20034,
7112,
1137,
25216,
2099,
1168,
12861,
62,
9328,
62,
20034,
7112,
1137,
764,
198,
220,
3858,
25,
198,
220,
220,
26653,
62,
48926,
62,
9328,
62,
20034,
7112,
1137,
25216,
2099,
3210,
3084,
286,
26136,
62,
48926,
62,
9328,
62,
20034,
7112,
1137,
25216,
764,
198,
220,
3858,
25,
198,
220,
220,
26136,
62,
48926,
62,
9328,
62,
10943,
45,
24565,
25216,
2099,
1168,
12861,
62,
9328,
62,
10943,
48842,
764,
198,
220,
3858,
25,
198,
220,
220,
26653,
62,
48926,
62,
9328,
62,
10943,
45,
24565,
25216,
2099,
3210,
3084,
286,
26136,
62,
48926,
62,
9328,
62,
10943,
45,
24565,
25216,
764,
628,
220,
38491,
20145,
62,
57,
34,
62,
9328,
62,
6242,
15308,
2751,
25216,
2099,
1220,
40,
45607,
8905,
14,
5064,
62,
20474,
54,
62,
30733,
62,
3727,
13563,
62,
9936,
47,
1546,
14804,
9936,
62,
36,
62,
30733,
62,
3525,
9050,
62,
20608,
1988,
705,
57,
66,
62,
6767,
62,
32,
2070,
278,
6030,
6,
22492,
15285,
62,
32541,
13,
198,
220,
38491,
20145,
62,
57,
34,
62,
9328,
62,
4760,
45155,
25216,
2099,
1220,
40,
45607,
8905,
14,
5064,
62,
20474,
54,
62,
30733,
62,
3727,
13563,
62,
9936,
47,
1546,
14804,
9936,
62,
36,
62,
30733,
62,
3525,
9050,
62,
20608,
1988,
705,
57,
66,
62,
6767,
62,
32,
4949,
6030,
6,
22492,
15285,
62,
32541,
13,
198,
220,
38491,
20145,
62,
57,
34,
62,
9328,
62,
3697,
9947,
62,
46700,
5781,
25216,
2099,
1220,
40,
45607,
8905,
14,
5064,
62,
20474,
54,
62,
30733,
62,
3727,
13563,
62,
9936,
47,
1546,
14804,
9936,
62,
36,
62,
30733,
62,
3525,
9050,
62,
20608,
1988,
705,
57,
66,
62,
6767,
62,
43069,
62,
22417,
6030,
6,
22492,
15285,
62,
32541,
13,
198,
220,
38491,
20145,
62,
48926,
62,
9328,
62,
42149,
15490,
25216,
2099,
1220,
40,
45607,
8905,
14,
5064,
62,
20474,
54,
62,
30733,
62,
3727,
13563,
62,
9936,
47,
1546,
14804,
9936,
62,
36,
62,
30733,
62,
3525,
9050,
62,
20608,
1988,
705,
57,
72,
62,
6767,
62,
16170,
634,
6030,
6,
22492,
15285,
62,
32541,
13,
198,
220,
38491,
20145,
62,
48926,
62,
9328,
62,
20034,
7112,
1137,
25216,
2099,
1220,
40,
45607,
8905,
14,
5064,
62,
20474,
54,
62,
30733,
62,
3727,
13563,
62,
9936,
47,
1546,
14804,
9936,
62,
36,
62,
30733,
62,
3525,
9050,
62,
20608,
1988,
705,
57,
72,
62,
6767,
62,
9914,
5277,
6030,
6,
22492,
15285,
62,
32541,
13,
198,
220,
38491,
20145,
62,
48926,
62,
9328,
62,
10943,
45,
24565,
25216,
2099,
1220,
40,
45607,
8905,
14,
5064,
62,
20474,
54,
62,
30733,
62,
3727,
13563,
62,
9936,
47,
1546,
14804,
9936,
62,
36,
62,
30733,
62,
3525,
9050,
62,
20608,
1988,
705,
57,
72,
62,
6767,
62,
32048,
6030,
6,
22492,
15285,
62,
32541,
13,
628,
220,
5050,
23449,
8881,
198,
220,
220,
220,
34087,
17750,
764,
198,
220,
5050,
17151,
62,
43,
11262,
62,
33365,
28343,
198,
220,
220,
220,
34087,
17750,
764,
198,
24326,
2665,
13,
198,
19734,
2665,
13,
628,
220,
38491,
20145,
62,
1268,
5097,
62,
20608,
2099,
19269,
2751,
1988,
705,
57,
5097,
62,
9328,
62,
3697,
9947,
46,
8859,
62,
44,
5662,
2559,
855,
8697,
6,
22492,
15285,
62,
32541,
13,
628,
220,
5050,
23449,
8881,
62,
49,
5258,
62,
19,
198,
220,
220,
220,
8620,
198,
220,
220,
220,
220,
220,
1220,
40,
45607,
8905,
14,
34,
55,
62,
20474,
54,
62,
30733,
62,
6369,
42006,
2849,
764,
198,
220,
5050,
17151,
62,
43,
11262,
62,
33365,
28343,
62,
49,
5258,
62,
19,
198,
220,
220,
220,
8024,
198,
220,
220,
220,
220,
220,
1988,
7,
49,
53,
62,
43,
11262,
62,
33365,
28343,
62,
49,
5258,
8,
2099,
31742,
6465,
23518,
764,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1168,
5097,
62,
9328,
62,
3697,
9947,
46,
8859,
62,
44,
5662,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
2446,
23449,
8881,
13,
198,
9,
5,
10097
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
INTERFACE zif_abapgit_gui_asset_manager
PUBLIC .
TYPES:
BEGIN OF ty_web_asset,
url TYPE w3url,
type TYPE c LENGTH 50,
subtype TYPE c LENGTH 50,
content TYPE xstring,
is_cacheable TYPE abap_bool,
END OF ty_web_asset .
TYPES:
tt_web_assets TYPE STANDARD TABLE OF ty_web_asset WITH DEFAULT KEY .
METHODS get_all_assets
RETURNING
VALUE(rt_assets) TYPE tt_web_assets
RAISING
zcx_abapgit_exception.
METHODS get_asset
IMPORTING
iv_url TYPE string
RETURNING
VALUE(rs_asset) TYPE ty_web_asset
RAISING
zcx_abapgit_exception.
METHODS get_text_asset
IMPORTING
iv_url TYPE string
iv_assert_subtype TYPE string OPTIONAL
RETURNING
VALUE(rv_asset) TYPE string
RAISING
zcx_abapgit_exception.
ENDINTERFACE.
| [
41358,
49836,
1976,
361,
62,
397,
499,
18300,
62,
48317,
62,
562,
316,
62,
37153,
198,
220,
44731,
764,
628,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
347,
43312,
3963,
1259,
62,
12384,
62,
562,
316,
11,
198,
220,
220,
220,
220,
220,
19016,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
266,
18,
6371,
11,
198,
220,
220,
220,
220,
220,
2099,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
269,
406,
49494,
2026,
11,
198,
220,
220,
220,
220,
220,
850,
4906,
220,
220,
220,
220,
220,
41876,
269,
406,
49494,
2026,
11,
198,
220,
220,
220,
220,
220,
2695,
220,
220,
220,
220,
220,
41876,
2124,
8841,
11,
198,
220,
220,
220,
220,
220,
318,
62,
23870,
540,
41876,
450,
499,
62,
30388,
11,
198,
220,
220,
220,
23578,
3963,
1259,
62,
12384,
62,
562,
316,
764,
198,
220,
24412,
47,
1546,
25,
198,
220,
220,
220,
256,
83,
62,
12384,
62,
19668,
41876,
49053,
9795,
43679,
3963,
1259,
62,
12384,
62,
562,
316,
13315,
5550,
38865,
35374,
764,
628,
220,
337,
36252,
50,
651,
62,
439,
62,
19668,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
17034,
62,
19668,
8,
41876,
256,
83,
62,
12384,
62,
19668,
198,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
337,
36252,
50,
651,
62,
562,
316,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
21628,
62,
6371,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
3808,
62,
562,
316,
8,
41876,
1259,
62,
12384,
62,
562,
316,
198,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
13,
628,
220,
337,
36252,
50,
651,
62,
5239,
62,
562,
316,
198,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
21628,
62,
6371,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
41876,
4731,
198,
220,
220,
220,
220,
220,
21628,
62,
30493,
62,
7266,
4906,
41876,
4731,
39852,
2849,
1847,
198,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
26173,
8924,
7,
81,
85,
62,
562,
316,
8,
220,
220,
41876,
4731,
198,
220,
220,
220,
17926,
1797,
2751,
198,
220,
220,
220,
220,
220,
1976,
66,
87,
62,
397,
499,
18300,
62,
1069,
4516,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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 zh174_string_calc DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS add
IMPORTING
VALUE(numbers) TYPE string
RETURNING
VALUE(result) TYPE i
RAISING zcx_h174_str_calc.
PROTECTED SECTION.
PRIVATE SECTION.
CONSTANTS zh174_str_calc TYPE string VALUE 'ZH174_STR_CALC' ##NO_TEXT.
ENDCLASS.
CLASS zh174_string_calc IMPLEMENTATION.
METHOD add.
"Custom separators
DATA(separator) = |,|. "default
IF strlen( numbers ) > 2 AND substring( val = numbers len = 2 ) = '//'.
separator = substring_before( val = numbers sub = cl_abap_char_utilities=>newline ).
separator = substring_after( val = separator sub = '//' ).
numbers = substring_after( val = numbers sub = cl_abap_char_utilities=>newline ).
ENDIF.
"Missing number in last position
IF strlen( numbers ) > 0 AND
( substring( off = strlen( numbers ) - 1 len = 1 val = numbers ) = separator OR
substring( off = strlen( numbers ) - 1 len = 1 val = numbers ) = cl_abap_char_utilities=>newline ).
RAISE EXCEPTION TYPE zcx_h174_str_calc MESSAGE ID zh174_str_calc NUMBER '001'." WITH 'Number expected but EOF found.'.
ENDIF.
"Newline as separator
DATA result_tab TYPE STANDARD TABLE OF string.
SPLIT numbers AT cl_abap_char_utilities=>newline INTO TABLE DATA(number_tab).
LOOP AT number_tab ASSIGNING FIELD-SYMBOL(<num>).
IF <num> CS separator.
SPLIT <num> AT separator INTO TABLE DATA(separator_tab).
APPEND LINES OF separator_tab TO result_tab.
ELSE.
APPEND <num> TO result_tab.
ENDIF.
ENDLOOP.
* Negative numbers
* DATA neg_numbers TYPE STANDARD TABLE OF i.
DATA neg_numbers TYPE string.
* Runtime Error <CONVT_NO_NUMBER> - strange because did not used to happen here but in the REDUCE - check on S4 onPrem
LOOP AT result_tab ASSIGNING FIELD-SYMBOL(<neg_number>) WHERE table_line < 0.
neg_numbers = neg_numbers && ', ' && <neg_number>.
ENDLOOP.
IF neg_numbers IS NOT INITIAL.
neg_numbers = substring( val = neg_numbers len = strlen( neg_numbers ) ).
ENDIF.
"First step & Many numbers & Custom separators
TRY.
result = REDUCE #( INIT r = 0 FOR wa IN result_tab NEXT
r = r + wa ).
CATCH cx_sy_conversion_no_number INTO DATA(cx).
DATA(faulty_separator) = substring_from( val = cx->value regex = '\D+' ).
faulty_separator = substring_before( val = faulty_separator regex = '\d' ).
DATA(place) = find( val = numbers sub = faulty_separator ).
RAISE EXCEPTION TYPE zcx_h174_str_calc
MESSAGE ID zh174_str_calc
NUMBER '002'
WITH separator faulty_separator place.
ENDTRY.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
71,
22985,
62,
8841,
62,
9948,
66,
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,
751,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
77,
17024,
8,
41876,
4731,
198,
220,
220,
220,
220,
220,
30826,
4261,
15871,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
220,
26173,
8924,
7,
20274,
8,
220,
41876,
1312,
198,
220,
220,
220,
220,
220,
17926,
1797,
2751,
220,
220,
1976,
66,
87,
62,
71,
22985,
62,
2536,
62,
9948,
66,
13,
198,
220,
48006,
9782,
1961,
44513,
13,
198,
220,
4810,
3824,
6158,
44513,
13,
198,
220,
220,
220,
7102,
2257,
1565,
4694,
1976,
71,
22985,
62,
2536,
62,
9948,
66,
41876,
4731,
26173,
8924,
705,
57,
39,
22985,
62,
18601,
62,
34,
1847,
34,
6,
22492,
15285,
62,
32541,
13,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
71,
22985,
62,
8841,
62,
9948,
66,
30023,
2538,
10979,
6234,
13,
628,
220,
337,
36252,
751,
13,
628,
220,
220,
220,
366,
15022,
2880,
2024,
198,
220,
220,
220,
42865,
7,
25512,
1352,
8,
796,
930,
11,
91,
13,
366,
12286,
198,
220,
220,
220,
16876,
965,
11925,
7,
3146,
1267,
1875,
362,
5357,
3293,
1806,
7,
1188,
796,
3146,
18896,
796,
362,
1267,
796,
705,
1003,
4458,
198,
220,
220,
220,
220,
220,
2880,
1352,
796,
3293,
1806,
62,
19052,
7,
1188,
796,
3146,
850,
796,
537,
62,
397,
499,
62,
10641,
62,
315,
2410,
14804,
3605,
1370,
6739,
198,
220,
220,
220,
220,
220,
2880,
1352,
796,
3293,
1806,
62,
8499,
7,
1188,
796,
2880,
1352,
850,
796,
705,
1003,
6,
6739,
198,
220,
220,
220,
220,
220,
3146,
796,
3293,
1806,
62,
8499,
7,
1188,
796,
3146,
220,
850,
796,
537,
62,
397,
499,
62,
10641,
62,
315,
2410,
14804,
3605,
1370,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
366,
43730,
1271,
287,
938,
2292,
198,
220,
220,
220,
16876,
965,
11925,
7,
3146,
1267,
1875,
657,
5357,
198,
220,
220,
220,
220,
357,
3293,
1806,
7,
572,
796,
965,
11925,
7,
3146,
1267,
532,
352,
18896,
796,
352,
1188,
796,
3146,
1267,
796,
2880,
1352,
6375,
198,
220,
220,
220,
220,
220,
220,
3293,
1806,
7,
572,
796,
965,
11925,
7,
3146,
1267,
532,
352,
18896,
796,
352,
1188,
796,
3146,
1267,
796,
537,
62,
397,
499,
62,
10641,
62,
315,
2410,
14804,
3605,
1370,
6739,
198,
220,
220,
220,
220,
220,
17926,
24352,
7788,
42006,
2849,
41876,
1976,
66,
87,
62,
71,
22985,
62,
2536,
62,
9948,
66,
337,
1546,
4090,
8264,
4522,
1976,
71,
22985,
62,
2536,
62,
9948,
66,
36871,
13246,
705,
8298,
30827,
13315,
705,
15057,
2938,
475,
412,
19238,
1043,
2637,
13,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
366,
3791,
1370,
355,
2880,
1352,
198,
220,
220,
220,
42865,
1255,
62,
8658,
41876,
49053,
9795,
43679,
3963,
4731,
13,
198,
220,
220,
220,
46341,
2043,
3146,
5161,
537,
62,
397,
499,
62,
10641,
62,
315,
2410,
14804,
3605,
1370,
39319,
43679,
42865,
7,
17618,
62,
8658,
737,
198,
220,
220,
220,
17579,
3185,
5161,
1271,
62,
8658,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
22510,
29,
737,
198,
220,
220,
220,
220,
220,
16876,
220,
1279,
22510,
29,
9429,
2880,
1352,
13,
198,
220,
220,
220,
220,
220,
220,
220,
46341,
2043,
1279,
22510,
29,
5161,
2880,
1352,
39319,
43679,
42865,
7,
25512,
1352,
62,
8658,
737,
198,
220,
220,
220,
220,
220,
220,
220,
43504,
10619,
43277,
1546,
3963,
2880,
1352,
62,
8658,
5390,
1255,
62,
8658,
13,
198,
220,
220,
220,
220,
220,
17852,
5188,
13,
198,
220,
220,
220,
220,
220,
220,
220,
43504,
10619,
1279,
22510,
29,
5390,
1255,
62,
8658,
13,
198,
220,
220,
220,
220,
220,
23578,
5064,
13,
198,
220,
220,
220,
23578,
21982,
3185,
13,
198,
198,
9,
220,
220,
220,
36183,
3146,
198,
9,
220,
220,
220,
42865,
2469,
62,
77,
17024,
41876,
49053,
9795,
43679,
3963,
1312,
13,
198,
220,
220,
220,
42865,
2469,
62,
77,
17024,
41876,
4731,
13,
198,
9,
220,
220,
220,
43160,
13047,
1279,
10943,
36392,
62,
15285,
62,
41359,
13246,
29,
532,
6283,
780,
750,
407,
973,
284,
1645,
994,
475,
287,
262,
23848,
52,
5222,
532,
2198,
319,
311,
19,
319,
24914,
198,
220,
220,
220,
17579,
3185,
5161,
1255,
62,
8658,
24994,
3528,
15871,
18930,
24639,
12,
23060,
10744,
3535,
7,
27,
12480,
62,
17618,
43734,
33411,
3084,
62,
1370,
1279,
657,
13,
198,
220,
220,
220,
220,
220,
2469,
62,
77,
17024,
796,
2469,
62,
77,
17024,
11405,
46083,
705,
11405,
1279,
12480,
62,
17618,
28401,
198,
220,
220,
220,
23578,
21982,
3185,
13,
198,
220,
220,
220,
16876,
2469,
62,
77,
17024,
3180,
5626,
3268,
2043,
12576,
13,
198,
220,
220,
220,
220,
220,
2469,
62,
77,
17024,
796,
3293,
1806,
7,
1188,
796,
2469,
62,
77,
17024,
18896,
796,
965,
11925,
7,
2469,
62,
77,
17024,
1267,
6739,
198,
220,
220,
220,
23578,
5064,
13,
628,
220,
220,
220,
366,
5962,
2239,
1222,
4650,
3146,
1222,
8562,
2880,
2024,
198,
220,
220,
220,
7579,
56,
13,
198,
220,
220,
220,
220,
220,
220,
220,
1255,
796,
23848,
52,
5222,
1303,
7,
3268,
2043,
374,
796,
657,
7473,
2082,
3268,
1255,
62,
8658,
39726,
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,
374,
796,
374,
1343,
2082,
6739,
198,
220,
220,
220,
220,
220,
327,
11417,
43213,
62,
1837,
62,
1102,
9641,
62,
3919,
62,
17618,
39319,
42865,
7,
66,
87,
737,
198,
220,
220,
220,
220,
220,
220,
220,
42865,
7,
69,
1721,
88,
62,
25512,
1352,
8,
796,
3293,
1806,
62,
6738,
7,
1188,
796,
43213,
3784,
8367,
40364,
796,
705,
59,
35,
10,
6,
6739,
198,
220,
220,
220,
220,
220,
220,
220,
30954
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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
] |
method ZAS_EMPSET_GET_ENTITYSET.
RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc
EXPORTING
textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented
method = 'ZAS_EMPSET_GET_ENTITYSET'.
endmethod. | [
220,
2446,
1168,
1921,
62,
3620,
3705,
2767,
62,
18851,
62,
3525,
9050,
28480,
13,
198,
220,
17926,
24352,
7788,
42006,
2849,
41876,
1220,
14246,
65,
538,
14,
66,
87,
62,
11296,
86,
62,
1662,
62,
23928,
62,
41194,
198,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
2420,
312,
796,
1220,
14246,
65,
538,
14,
66,
87,
62,
11296,
86,
62,
1662,
62,
23928,
62,
41194,
14804,
24396,
62,
1662,
62,
320,
1154,
12061,
198,
220,
220,
220,
220,
220,
2446,
796,
705,
57,
1921,
62,
3620,
3705,
2767,
62,
18851,
62,
3525,
9050,
28480,
4458,
198,
220,
886,
24396,
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
] |
CLASS zcl_fi_glmast_api_extend DEFINITION
PUBLIC
INHERITING FROM /eby/cl_pdmdgl_bapi
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS get_detail REDEFINITION .
PROTECTED SECTION.
PRIVATE SECTION.
DATA:
lv_saknr TYPE saknr,
lv_ktopl TYPE ktopl,
lv_bukrs TYPE bukrs.
METHODS:
"! <p class="shorttext synchronized" lang="en">Get Additional Data for Chart of Account</p>
get_coa_additional_data CHANGING cs_bapi_data TYPE /eby/pdmdgl_sbapi_data,
"! <p class="shorttext synchronized" lang="en">Get Additional Data for Company Code</p>
get_ccode_additional_data CHANGING cs_bapi_data TYPE /eby/pdmdgl_sbapi_data,
"! <p class="shorttext synchronized" lang="en">Get GL Account</p>
get_saknr RETURNING VALUE(r_result) TYPE saknr,
"! <p class="shorttext synchronized" lang="en">Set GL Account</p>
set_saknr IMPORTING i_saknr TYPE saknr,
"! <p class="shorttext synchronized" lang="en">Get Chart of Account</p>
get_ktopl RETURNING VALUE(r_result) TYPE ktopl,
"! <p class="shorttext synchronized" lang="en">GSet Chart of Account</p>
set_ktopl IMPORTING i_ktopl TYPE ktopl,
"! <p class="shorttext synchronized" lang="en">Get Company Code</p>
get_bukrs RETURNING VALUE(r_result) TYPE bukrs,
"! <p class="shorttext synchronized" lang="en">Set Company Code</p>
set_bukrs IMPORTING i_bukrs TYPE bukrs.
ENDCLASS.
CLASS zcl_fi_glmast_api_extend IMPLEMENTATION.
METHOD get_detail.
*----------------------------------------------------------------------
* Author: Sougata Chatterjee (UserID 11034616)
* Date: August 2020
* Reason: TAFE_CIME 144 - GL Account Maintenance Form and Workflow
*----------------------------------------------------------------------
super->get_detail(
EXPORTING
ic_saknr = ic_saknr
ic_bukrs = ic_bukrs
ic_ktopl = ic_ktopl
IMPORTING
es_bapi_data = es_bapi_data
es_return = es_return
).
CHECK es_bapi_data IS NOT INITIAL AND
es_return-type NA zcl_com_bapireturn_services=>gc_error_msgtypes.
me->set_saknr( ic_saknr ).
me->set_bukrs( ic_bukrs ).
me->set_ktopl( ic_ktopl ).
me->get_coa_additional_data( CHANGING cs_bapi_data = es_bapi_data ).
me->get_ccode_additional_data( CHANGING cs_bapi_data = es_bapi_data ).
ENDMETHOD.
METHOD get_ccode_additional_data.
DATA text_lines TYPE STANDARD TABLE OF tline.
DATA(l_saknr) = me->get_saknr( ).
DATA(l_bukrs) = me->get_bukrs( ).
CHECK me->get_bukrs( ).
SELECT SINGLE plan_relv
FROM zfi_dec_skb1_pr
INTO cs_bapi_data-ccode_data-zz_plan_relv
WHERE bukrs = l_bukrs
AND saknr = l_saknr.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = CONV tdid( |0001| )
language = sy-langu
name = CONV tdobname( |{ l_saknr ALPHA = IN }{ l_bukrs }| )
object = CONV tdobject( |SKB1| )
TABLES
lines = text_lines
EXCEPTIONS
id = 1 " Text ID invalid
language = 2 " Invalid language
name = 3 " Invalid text name
not_found = 4 " Text not found
object = 5 " Invalid text object
reference_check = 6 " Reference chain interrupted
wrong_access_to_archive = 7 " Archive handle invalid for access
OTHERS = 8.
CHECK sy-subrc = 0.
cs_bapi_data-ccode_data-zz_glacct_ccode_text = VALUE #( text_lines[ 1 ]-tdline OPTIONAL ).
ENDMETHOD.
METHOD get_coa_additional_data.
DATA(l_saknr) = me->get_saknr( ).
DATA(l_ktopl) = me->get_ktopl( ).
CHECK me->get_ktopl( ).
SELECT SINGLE
toes_acct
finstat_code
finstat_note
cf_classf
fs_dsclsr
actvt_code
cflo_code
FROM zfi_dec_ska1_ncv
INTO cs_bapi_data-coa_data-zzs_ncver_toes
WHERE ktopl = l_ktopl
AND saknr = l_saknr.
ENDMETHOD.
METHOD get_saknr.
r_result = me->lv_saknr.
ENDMETHOD.
METHOD set_saknr.
me->lv_saknr = i_saknr.
ENDMETHOD.
METHOD get_ktopl.
r_result = me->lv_ktopl.
ENDMETHOD.
METHOD set_ktopl.
me->lv_ktopl = i_ktopl.
ENDMETHOD.
METHOD get_bukrs.
r_result = me->lv_bukrs.
ENDMETHOD.
METHOD set_bukrs.
me->lv_bukrs = i_bukrs.
ENDMETHOD.
ENDCLASS.
| [
31631,
1976,
565,
62,
12463,
62,
4743,
47616,
62,
15042,
62,
2302,
437,
5550,
20032,
17941,
198,
220,
44731,
198,
220,
3268,
16879,
2043,
2751,
16034,
1220,
68,
1525,
14,
565,
62,
30094,
9132,
4743,
62,
65,
15042,
198,
220,
25261,
198,
220,
29244,
6158,
44731,
764,
628,
220,
44731,
44513,
13,
628,
220,
220,
220,
337,
36252,
50,
651,
62,
49170,
23848,
36,
20032,
17941,
764,
628,
220,
48006,
9782,
1961,
44513,
13,
628,
220,
4810,
3824,
6158,
44513,
13,
628,
220,
220,
220,
42865,
25,
198,
220,
220,
220,
220,
220,
300,
85,
62,
82,
461,
48624,
41876,
264,
461,
48624,
11,
198,
220,
220,
220,
220,
220,
300,
85,
62,
16201,
75,
41876,
479,
4852,
75,
11,
198,
220,
220,
220,
220,
220,
300,
85,
62,
65,
2724,
3808,
41876,
809,
74,
3808,
13,
628,
220,
220,
220,
337,
36252,
50,
25,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
3855,
15891,
6060,
329,
22086,
286,
10781,
3556,
79,
29,
198,
220,
220,
220,
220,
220,
651,
62,
1073,
64,
62,
2860,
1859,
62,
7890,
220,
220,
5870,
15567,
2751,
50115,
62,
65,
15042,
62,
7890,
41876,
1220,
68,
1525,
14,
30094,
9132,
4743,
62,
36299,
15042,
62,
7890,
11,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
3855,
15891,
6060,
329,
5834,
6127,
3556,
79,
29,
198,
220,
220,
220,
220,
220,
651,
62,
535,
1098,
62,
2860,
1859,
62,
7890,
5870,
15567,
2751,
50115,
62,
65,
15042,
62,
7890,
41876,
1220,
68,
1525,
14,
30094,
9132,
4743,
62,
36299,
15042,
62,
7890,
11,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
3855,
10188,
10781,
3556,
79,
29,
198,
220,
220,
220,
220,
220,
651,
62,
82,
461,
48624,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
264,
461,
48624,
11,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
7248,
10188,
10781,
3556,
79,
29,
198,
220,
220,
220,
220,
220,
900,
62,
82,
461,
48624,
30023,
9863,
2751,
1312,
62,
82,
461,
48624,
41876,
264,
461,
48624,
11,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
3855,
22086,
286,
10781,
3556,
79,
29,
198,
220,
220,
220,
220,
220,
651,
62,
16201,
75,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
479,
4852,
75,
11,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
38,
7248,
22086,
286,
10781,
3556,
79,
29,
198,
220,
220,
220,
220,
220,
900,
62,
16201,
75,
30023,
9863,
2751,
1312,
62,
16201,
75,
41876,
479,
4852,
75,
11,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
3855,
5834,
6127,
3556,
79,
29,
198,
220,
220,
220,
220,
220,
651,
62,
65,
2724,
3808,
30826,
4261,
15871,
26173,
8924,
7,
81,
62,
20274,
8,
41876,
809,
74,
3808,
11,
198,
220,
220,
220,
366,
0,
1279,
79,
1398,
2625,
19509,
5239,
47192,
1,
42392,
2625,
268,
5320,
7248,
5834,
6127,
3556,
79,
29,
198,
220,
220,
220,
220,
220,
900,
62,
65,
2724,
3808,
30023,
9863,
2751,
1312,
62,
65,
2724,
3808,
41876,
809,
74,
3808,
13,
198,
198,
10619,
31631,
13,
628,
198,
198,
31631,
1976,
565,
62,
12463,
62,
4743,
47616,
62,
15042,
62,
2302,
437,
30023,
2538,
10979,
6234,
13,
628,
198,
220,
337,
36252,
651,
62,
49170,
13,
198,
198,
9,
10097,
23031,
198,
9,
6434,
25,
311,
20805,
1045,
609,
1436,
34589,
357,
12982,
2389,
9796,
30557,
1433,
8,
198,
9,
7536,
25,
220,
220,
2932,
12131,
198,
9,
23219,
25,
309,
8579,
36,
62,
34,
12789,
20224,
532,
10188,
10781,
34857,
5178,
290,
5521,
11125,
198,
9,
10097,
23031,
628,
220,
220,
220,
2208,
3784,
1136,
62,
49170,
7,
198,
220,
220,
220,
220,
220,
7788,
15490,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
14158,
62,
82,
461,
48624,
220,
220,
220,
220,
796,
14158,
62,
82,
461,
48624,
198,
220,
220,
220,
220,
220,
220,
220,
14158,
62,
65,
2724,
3808,
220,
220,
220,
220,
796,
14158,
62,
65,
2724,
3808,
198,
220,
220,
220,
220,
220,
220,
220,
14158,
62,
16201,
75,
220,
220,
220,
220,
796,
14158,
62,
16201,
75,
198,
220,
220,
220,
220,
220,
30023,
9863,
2751,
198,
220,
220,
220,
220,
220,
220,
220,
1658,
62,
65,
15042,
62,
7890,
796,
1658,
62,
65,
15042,
62,
7890,
198,
220,
220,
220,
220,
220,
220,
220,
1658,
62,
7783,
220,
220,
220,
796,
1658,
62,
7783,
198,
220,
220,
6739,
628,
220,
220,
220,
5870,
25171,
1658,
62,
65,
15042,
62,
7890,
3180,
5626,
3268,
2043,
12576,
5357,
198,
220,
220,
220,
220,
220,
220,
220,
220,
220,
1658,
62,
7783,
12,
4906,
11746,
1976,
565,
62,
785,
62,
65,
499,
557,
15344,
62,
30416,
14804,
36484,
62,
18224,
62,
19662,
19199,
13,
628,
220,
220,
220,
502,
3784,
2617,
62,
82,
461,
48624,
7,
14158,
62,
82,
461,
48624,
6739,
198,
220,
220,
220,
502,
3784,
2617,
62,
65,
2724,
3808,
7,
14158,
62,
65,
2724,
3808,
6739,
198,
220,
220,
220,
502,
3784,
2617,
62,
16201,
75,
7,
14158,
62,
16201,
75,
6739,
628,
220,
220,
220,
502,
3784,
1136,
62,
1073,
64,
62,
2860,
1859,
62,
7890,
7,
5870,
15567,
2751,
50115,
62,
65,
15042,
62,
7890,
796,
1658,
62,
65,
15042,
62,
7890,
6739,
628,
220,
220,
220,
502,
3784,
1136,
62,
535,
1098,
62,
2860,
1859,
62,
7890,
7,
5870,
15567,
2751,
50115,
62,
65,
15042,
62,
7890,
796,
1658,
62,
65,
15042,
62,
7890,
6739,
628,
198,
220,
23578,
49273,
13,
628,
220,
337,
36252,
651,
62,
535,
1098,
62,
2860,
1859,
62,
7890,
13,
628,
220,
220,
220,
42865,
2420,
62,
6615,
41876,
49053,
9795,
43679,
3963,
256,
1370,
13,
628,
220,
220,
220,
42865,
7,
75,
62,
82,
461,
48624,
8,
796,
502,
3784,
1136,
62,
82,
461
] | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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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