hexsha
stringlengths
40
40
size
int64
16
758k
ext
stringclasses
1 value
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
6
146
max_stars_repo_name
stringlengths
8
73
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
2
max_stars_count
int64
1
17.3k
max_stars_repo_stars_event_min_datetime
stringclasses
530 values
max_stars_repo_stars_event_max_datetime
stringclasses
529 values
max_issues_repo_path
stringlengths
6
146
max_issues_repo_name
stringlengths
8
73
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
2
max_issues_count
int64
1
3.24k
max_issues_repo_issues_event_min_datetime
stringclasses
350 values
max_issues_repo_issues_event_max_datetime
stringclasses
350 values
max_forks_repo_path
stringlengths
6
146
max_forks_repo_name
stringlengths
8
73
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
2
max_forks_count
int64
1
4.6k
max_forks_repo_forks_event_min_datetime
stringclasses
388 values
max_forks_repo_forks_event_max_datetime
stringclasses
388 values
content
stringlengths
16
758k
avg_line_length
float64
4.13
40.4k
max_line_length
int64
9
40.4k
alphanum_fraction
float64
0.04
0.97
121a25a389eccaec64e5cd480b8539d9702aec45
9,548
abap
ABAP
src/zcl_abapgit_code_inspector.clas.abap
timbolski/downport
c5fa01ed27c8265606d7a67832d64164d1769c79
[ "MIT" ]
3
2020-05-31T18:55:42.000Z
2021-01-08T21:36:09.000Z
src/zcl_abapgit_code_inspector.clas.abap
timbolski/downport
c5fa01ed27c8265606d7a67832d64164d1769c79
[ "MIT" ]
null
null
null
src/zcl_abapgit_code_inspector.clas.abap
timbolski/downport
c5fa01ed27c8265606d7a67832d64164d1769c79
[ "MIT" ]
2
2021-01-08T21:36:15.000Z
2022-03-29T05:40:00.000Z
CLASS zcl_abapgit_code_inspector DEFINITION PUBLIC CREATE PROTECTED GLOBAL FRIENDS zcl_abapgit_factory . PUBLIC SECTION. INTERFACES zif_abapgit_code_inspector . METHODS constructor IMPORTING !iv_package TYPE devclass RAISING zcx_abapgit_exception . CLASS-METHODS validate_check_variant IMPORTING !iv_check_variant_name TYPE sci_chkv RAISING zcx_abapgit_exception . PROTECTED SECTION. DATA mv_package TYPE devclass . METHODS create_variant IMPORTING !iv_variant TYPE sci_chkv RETURNING VALUE(ro_variant) TYPE REF TO cl_ci_checkvariant RAISING zcx_abapgit_exception . METHODS cleanup IMPORTING !io_set TYPE REF TO cl_ci_objectset RAISING zcx_abapgit_exception . METHODS skip_object IMPORTING !is_obj TYPE scir_objs RETURNING VALUE(rv_skip) TYPE abap_bool. PRIVATE SECTION. DATA mv_success TYPE abap_bool . TYPES: ty_run_mode TYPE c LENGTH 1. CONSTANTS: BEGIN OF co_run_mode, run_with_popup TYPE ty_run_mode VALUE 'P', run_after_popup TYPE ty_run_mode VALUE 'A', run_via_rfc TYPE ty_run_mode VALUE 'R', run_in_batch TYPE ty_run_mode VALUE 'B', run_loc_parallel TYPE ty_run_mode VALUE 'L', run_direct TYPE ty_run_mode VALUE 'L', END OF co_run_mode . DATA mo_inspection TYPE REF TO cl_ci_inspection . DATA mv_name TYPE sci_objs . DATA mv_run_mode TYPE c LENGTH 1 . METHODS create_objectset RETURNING VALUE(ro_set) TYPE REF TO cl_ci_objectset . METHODS run_inspection IMPORTING !io_inspection TYPE REF TO cl_ci_inspection RETURNING VALUE(rt_list) TYPE scit_alvlist RAISING zcx_abapgit_exception . METHODS create_inspection IMPORTING !io_set TYPE REF TO cl_ci_objectset !io_variant TYPE REF TO cl_ci_checkvariant RETURNING VALUE(ro_inspection) TYPE REF TO cl_ci_inspection RAISING zcx_abapgit_exception . METHODS decide_run_mode RETURNING VALUE(rv_run_mode) TYPE ty_run_mode . METHODS filter_inspection CHANGING !ct_list TYPE scit_alvlist . ENDCLASS. CLASS zcl_abapgit_code_inspector IMPLEMENTATION. METHOD cleanup. IF mo_inspection IS BOUND. mo_inspection->delete( EXCEPTIONS locked = 1 error_in_enqueue = 2 not_authorized = 3 exceptn_appl_exists = 4 OTHERS = 5 ). IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Couldn't delete inspection. Subrc = { sy-subrc }| ). ENDIF. ENDIF. io_set->delete( EXCEPTIONS exists_in_insp = 1 locked = 2 error_in_enqueue = 3 not_authorized = 4 exists_in_objs = 5 OTHERS = 6 ). IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Couldn't delete objectset. Subrc = { sy-subrc }| ). ENDIF. ENDMETHOD. METHOD constructor. IF iv_package IS INITIAL. zcx_abapgit_exception=>raise( |Please supply package| ). ENDIF. mv_package = iv_package. " We create the inspection and objectset with dummy names. " Because we want to persist them so we can run it in parallel. " Both are deleted afterwards. mv_name = |{ sy-uname }_{ sy-datum }_{ sy-uzeit }|. mv_run_mode = decide_run_mode( ). ENDMETHOD. METHOD create_inspection. cl_ci_inspection=>create( EXPORTING p_user = sy-uname p_name = mv_name RECEIVING p_ref = ro_inspection EXCEPTIONS locked = 1 error_in_enqueue = 2 not_authorized = 3 OTHERS = 4 ). IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Failed to create inspection. Subrc = { sy-subrc }| ). ENDIF. ro_inspection->set( p_chkv = io_variant p_objs = io_set ). ro_inspection->save( EXCEPTIONS missing_information = 1 insp_no_name = 2 not_enqueued = 3 OTHERS = 4 ). IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Failed to save inspection. Subrc = { sy-subrc }| ). ENDIF. ENDMETHOD. METHOD create_objectset. DATA: lt_objs TYPE scit_objs, ls_obj TYPE scir_objs, lt_objs_check TYPE scit_objs, ls_item TYPE zif_abapgit_definitions=>ty_item, lt_packages TYPE zif_abapgit_sap_package=>ty_devclass_tt. lt_packages = zcl_abapgit_factory=>get_sap_package( mv_package )->list_subpackages( ). INSERT mv_package INTO TABLE lt_packages. SELECT object AS objtype obj_name AS objname FROM tadir INTO CORRESPONDING FIELDS OF TABLE lt_objs FOR ALL ENTRIES IN lt_packages WHERE devclass = lt_packages-table_line AND delflag = abap_false AND pgmid = 'R3TR' ##TOO_MANY_ITAB_FIELDS. "#EC CI_GENBUFF LOOP AT lt_objs INTO ls_obj. IF skip_object( ls_obj ) = abap_true. CONTINUE. ENDIF. ls_item-obj_type = ls_obj-objtype. ls_item-obj_name = ls_obj-objname. IF zcl_abapgit_objects=>exists( ls_item ) = abap_false. CONTINUE. ENDIF. INSERT ls_obj INTO TABLE lt_objs_check. ENDLOOP. ro_set = cl_ci_objectset=>save_from_list( p_name = mv_name p_objects = lt_objs_check ). ENDMETHOD. METHOD create_variant. IF iv_variant IS INITIAL. zcx_abapgit_exception=>raise( |No check variant supplied.| ). ENDIF. cl_ci_checkvariant=>get_ref( EXPORTING p_user = '' p_name = iv_variant RECEIVING p_ref = ro_variant EXCEPTIONS chkv_not_exists = 1 missing_parameter = 2 OTHERS = 3 ). CASE sy-subrc. WHEN 1. zcx_abapgit_exception=>raise( |Check variant { iv_variant } doesn't exist| ). WHEN 2. zcx_abapgit_exception=>raise( |Parameter missing for check variant { iv_variant }| ). ENDCASE. ENDMETHOD. METHOD decide_run_mode. DATA lo_settings TYPE REF TO zcl_abapgit_settings. lo_settings = zcl_abapgit_persist_factory=>get_settings( )->read( ). IF sy-batch = abap_true. " We have to disable parallelization in batch because of lock errors. rv_run_mode = co_run_mode-run_via_rfc. ELSEIF lo_settings->get_parallel_proc_disabled( ) = abap_false. rv_run_mode = co_run_mode-run_loc_parallel. ELSE. rv_run_mode = co_run_mode-run_via_rfc. ENDIF. ENDMETHOD. METHOD filter_inspection. " Remove findings in LSVIM* includes which are part of generated maintenance screens DELETE ct_list WHERE sobjtype = 'PROG' AND sobjname CP 'LSVIM*'. ENDMETHOD. METHOD run_inspection. io_inspection->run( EXPORTING p_howtorun = mv_run_mode EXCEPTIONS invalid_check_version = 1 OTHERS = 2 ). IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Code inspector run failed. Subrc = { sy-subrc }| ). ENDIF. io_inspection->plain_list( IMPORTING p_list = rt_list ). filter_inspection( CHANGING ct_list = rt_list ). SORT rt_list BY objtype objname test code sobjtype sobjname line col. DELETE ADJACENT DUPLICATES FROM rt_list. ENDMETHOD. METHOD skip_object. DATA ls_program_type TYPE subc. CASE is_obj-objtype. WHEN 'PROG'. SELECT SINGLE subc INTO ls_program_type FROM trdir WHERE name = is_obj-objname. rv_skip = xsdbool( ls_program_type = 'I' ). " Include program. WHEN OTHERS. rv_skip = abap_false. ENDCASE. ENDMETHOD. METHOD validate_check_variant. cl_ci_checkvariant=>get_ref( EXPORTING p_user = '' p_name = iv_check_variant_name EXCEPTIONS chkv_not_exists = 1 missing_parameter = 2 OTHERS = 3 ). IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |No valid check variant { iv_check_variant_name }| ). ENDIF. ENDMETHOD. METHOD zif_abapgit_code_inspector~is_successful. rv_success = mv_success. ENDMETHOD. METHOD zif_abapgit_code_inspector~run. DATA: lo_set TYPE REF TO cl_ci_objectset, lo_variant TYPE REF TO cl_ci_checkvariant, lx_error TYPE REF TO zcx_abapgit_exception. TRY. lo_set = create_objectset( ). IF lines( lo_set->iobjlst-objects ) = 0. " no objects, nothing to check RETURN. ENDIF. lo_variant = create_variant( iv_variant ). mo_inspection = create_inspection( io_set = lo_set io_variant = lo_variant ). rt_list = run_inspection( mo_inspection ). cleanup( lo_set ). IF iv_save = abap_true. READ TABLE rt_list TRANSPORTING NO FIELDS WITH KEY kind = 'E'. mv_success = boolc( sy-subrc <> 0 ). ENDIF. CATCH zcx_abapgit_exception INTO lx_error. " ensure cleanup cleanup( lo_set ). zcx_abapgit_exception=>raise_with_text( lx_error ). ENDTRY. ENDMETHOD. ENDCLASS.
24.929504
93
0.622958
121b372855c9e5025e26a174c239e175d354ef5c
3,137
abap
ABAP
lbn-gtt-template-tso/ABAP/zsrc/zgtt_sof.fugr.zgtt_sof_ee_shp_load_end_rel.abap
DanHaer/logistics-business-network-gtt-samples
739978ac389da6f3530b26cd6402a3892f4b605a
[ "Apache-2.0" ]
12
2020-09-25T07:54:40.000Z
2021-09-27T12:29:34.000Z
lbn-gtt-template-tso/ABAP/zsrc/zgtt_sof.fugr.zgtt_sof_ee_shp_load_end_rel.abap
DanHaer/logistics-business-network-gtt-samples
739978ac389da6f3530b26cd6402a3892f4b605a
[ "Apache-2.0" ]
2
2020-10-15T05:20:41.000Z
2022-02-14T09:28:02.000Z
lbn-gtt-template-tso/ABAP/zsrc/zgtt_sof.fugr.zgtt_sof_ee_shp_load_end_rel.abap
DanHaer/logistics-business-network-gtt-samples
739978ac389da6f3530b26cd6402a3892f4b605a
[ "Apache-2.0" ]
50
2020-09-29T03:06:01.000Z
2022-03-28T16:04:45.000Z
FUNCTION zgtt_sof_ee_shp_load_end_rel . *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" REFERENCE(I_APPSYS) TYPE /SAPTRX/APPLSYSTEM *" REFERENCE(I_EVENT_TYPES) TYPE /SAPTRX/EVTYPES *" REFERENCE(I_ALL_APPL_TABLES) TYPE TRXAS_TABCONTAINER *" REFERENCE(I_EVENTTYPE_TAB) TYPE TRXAS_EVENTTYPE_TABS_WA *" REFERENCE(I_EVENT) TYPE TRXAS_EVT_CTAB_WA *" EXPORTING *" VALUE(E_RESULT) LIKE SY-BINPT *" TABLES *" C_LOGTABLE STRUCTURE BAPIRET2 OPTIONAL *" EXCEPTIONS *" PARAMETER_ERROR *" RELEVANCE_DETERM_ERROR *" STOP_PROCESSING *"---------------------------------------------------------------------- *----------------------------------------------------------------------* * Top Include * TYPE-POOLS:trxas. *----------------------------------------------------------------------* DATA: * Shipment Hearder new lt_xvttk TYPE STANDARD TABLE OF vttkvb, * Shipment Hearder old lt_yvttk TYPE STANDARD TABLE OF vttkvb, lv_aot_relevance TYPE boole_d. FIELD-SYMBOLS: <ls_xvttk> TYPE vttkvb, <ls_yvttk> TYPE vttkvb. * <1> Read necessary application tables from table reference PERFORM read_appl_tables_shipmt_header TABLES lt_xvttk lt_yvttk USING i_all_appl_tables. * <2> Check if Main table is Shipment or not. IF i_event-maintabdef <> gc_bpt_shipment_header_new. PERFORM create_logtable_et_rel TABLES c_logtable USING i_event-maintabdef space i_event_types-trrelfunc i_event-eventtype i_appsys. RAISE parameter_error. ELSE. * Read Main Object Table (Shipment - VTTK) ASSIGN i_event-maintabref->* TO <ls_xvttk>. ENDIF. * <3> Check Relevance of AOT: YN_OTE PERFORM check_aot_relevance_shp USING <ls_xvttk> CHANGING lv_aot_relevance. CHECK lv_aot_relevance IS NOT INITIAL. *<4> When shipment is newly created, check relevance of GTT: only when delivery has been assigned. IF <ls_xvttk>-updkz EQ gc_insert. PERFORM check_delivery_assignment USING i_all_appl_tables <ls_xvttk> CHANGING lv_aot_relevance. * If Shipment is NOT newly created, Check is Critical Changes Made ELSE. PERFORM check_for_header_changes_shp USING i_all_appl_tables <ls_xvttk> CHANGING lv_aot_relevance. ENDIF. CHECK lv_aot_relevance IS NOT INITIAL. * <5> Check actual event date and time changed. lv_aot_relevance = gc_false. IF <ls_xvttk>-updkz EQ gc_insert. IF <ls_xvttk>-dalen IS NOT INITIAL. lv_aot_relevance = gc_true. ENDIF. ELSE. READ TABLE lt_yvttk ASSIGNING <ls_yvttk> WITH KEY tknum = <ls_xvttk>-tknum BINARY SEARCH. IF sy-subrc IS INITIAL. IF <ls_xvttk>-dalen <> <ls_yvttk>-dalen OR <ls_xvttk>-ualen <> <ls_yvttk>-ualen. IF <ls_xvttk>-dalen IS NOT INITIAL. lv_aot_relevance = gc_true. ENDIF. ENDIF. ENDIF. ENDIF. IF lv_aot_relevance = gc_true. e_result = gc_true_condition. ELSE. e_result = gc_false_condition. ENDIF. ENDFUNCTION.
30.754902
98
0.632451
121e335a91cdce99899af38882c9013539c76b8f
24
abap
ABAP
Task/Empty-program/ABAP/empty-program.abap
LaudateCorpus1/RosettaCodeData
9ad63ea473a958506c041077f1d810c0c7c8c18d
[ "Info-ZIP" ]
1
2021-05-05T13:42:20.000Z
2021-05-05T13:42:20.000Z
Task/Empty-program/ABAP/empty-program.abap
seanwallawalla-forks/RosettaCodeData
9ad63ea473a958506c041077f1d810c0c7c8c18d
[ "Info-ZIP" ]
null
null
null
Task/Empty-program/ABAP/empty-program.abap
seanwallawalla-forks/RosettaCodeData
9ad63ea473a958506c041077f1d810c0c7c8c18d
[ "Info-ZIP" ]
null
null
null
report z_empty_program.
12
23
0.875
121f9e7afb066ea1aaad73d8b61b8d120674733c
22,805
abap
ABAP
src/zdemo_excel7.prog.abap
rotda/abap2xlsx
45e11a380943c425a5c8b350e2e506ec3fd46d9c
[ "Apache-2.0" ]
null
null
null
src/zdemo_excel7.prog.abap
rotda/abap2xlsx
45e11a380943c425a5c8b350e2e506ec3fd46d9c
[ "Apache-2.0" ]
null
null
null
src/zdemo_excel7.prog.abap
rotda/abap2xlsx
45e11a380943c425a5c8b350e2e506ec3fd46d9c
[ "Apache-2.0" ]
null
null
null
*&---------------------------------------------------------------------* *& Report ZDEMO_EXCEL7 *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT zdemo_excel7. DATA: lo_excel TYPE REF TO zcl_excel, lo_worksheet TYPE REF TO zcl_excel_worksheet, lo_style_cond TYPE REF TO zcl_excel_style_cond. DATA: ls_iconset3 TYPE zexcel_conditional_iconset, ls_iconset4 TYPE zexcel_conditional_iconset, ls_iconset5 TYPE zexcel_conditional_iconset, ls_databar TYPE zexcel_conditional_databar, ls_colorscale2 TYPE zexcel_conditional_colorscale, ls_colorscale3 TYPE zexcel_conditional_colorscale. CONSTANTS: gc_save_file_name TYPE string VALUE '07_ConditionalAll.xlsx'. INCLUDE zdemo_excel_outputopt_incl. START-OF-SELECTION. CREATE OBJECT lo_excel. ls_iconset3-cfvo1_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset3-cfvo1_value = '0'. ls_iconset3-cfvo2_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset3-cfvo2_value = '33'. ls_iconset3-cfvo3_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset3-cfvo3_value = '66'. ls_iconset3-showvalue = zcl_excel_style_cond=>c_showvalue_true. ls_iconset4-cfvo1_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset4-cfvo1_value = '0'. ls_iconset4-cfvo2_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset4-cfvo2_value = '25'. ls_iconset4-cfvo3_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset4-cfvo3_value = '50'. ls_iconset4-cfvo4_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset4-cfvo4_value = '75'. ls_iconset4-showvalue = zcl_excel_style_cond=>c_showvalue_true. ls_iconset5-cfvo1_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset5-cfvo1_value = '0'. ls_iconset5-cfvo2_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset5-cfvo2_value = '20'. ls_iconset5-cfvo3_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset5-cfvo3_value = '40'. ls_iconset5-cfvo4_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset5-cfvo4_value = '60'. ls_iconset5-cfvo5_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset5-cfvo5_value = '80'. ls_iconset5-showvalue = zcl_excel_style_cond=>c_showvalue_true. ls_databar-cfvo1_type = zcl_excel_style_cond=>c_cfvo_type_min. ls_databar-cfvo1_value = '0'. ls_databar-cfvo2_type = zcl_excel_style_cond=>c_cfvo_type_max. ls_databar-cfvo2_value = '0'. ls_databar-colorrgb = 'FF638EC6'. ls_colorscale2-cfvo1_type = zcl_excel_style_cond=>c_cfvo_type_min. ls_colorscale2-cfvo1_value = '0'. ls_colorscale2-cfvo2_type = zcl_excel_style_cond=>c_cfvo_type_percentile. ls_colorscale2-cfvo2_value = '50'. ls_colorscale2-colorrgb1 = 'FFF8696B'. ls_colorscale2-colorrgb2 = 'FF63BE7B'. ls_colorscale3-cfvo1_type = zcl_excel_style_cond=>c_cfvo_type_min. ls_colorscale3-cfvo1_value = '0'. ls_colorscale3-cfvo2_type = zcl_excel_style_cond=>c_cfvo_type_percentile. ls_colorscale3-cfvo2_value = '50'. ls_colorscale3-cfvo3_type = zcl_excel_style_cond=>c_cfvo_type_max. ls_colorscale3-cfvo3_value = '0'. ls_colorscale3-colorrgb1 = 'FFF8696B'. ls_colorscale3-colorrgb2 = 'FFFFEB84'. ls_colorscale3-colorrgb3 = 'FF63BE7B'. " Get active sheet lo_worksheet = lo_excel->get_active_worksheet( ). * ICONSET lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset3-iconset = zcl_excel_style_cond=>c_iconset_3arrows. lo_style_cond->mode_iconset = ls_iconset3. lo_style_cond->set_range( ip_start_column = 'B' ip_start_row = 5 ip_stop_column = 'B' ip_stop_row = 9 ). lo_worksheet->set_cell( ip_row = 4 ip_column = 'B' ip_value = 'C_ICONSET_3ARROWS' ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'B' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'B' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'B' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'B' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'B' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset3-iconset = zcl_excel_style_cond=>c_iconset_3arrowsgray. lo_style_cond->mode_iconset = ls_iconset3. lo_style_cond->set_range( ip_start_column = 'C' ip_start_row = 5 ip_stop_column = 'C' ip_stop_row = 9 ). lo_worksheet->set_cell( ip_row = 4 ip_column = 'C' ip_value = 'C_ICONSET_3ARROWSGRAY' ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'C' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'C' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'C' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'C' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'C' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset3-iconset = zcl_excel_style_cond=>c_iconset_3flags. lo_style_cond->mode_iconset = ls_iconset3. lo_style_cond->set_range( ip_start_column = 'D' ip_start_row = 5 ip_stop_column = 'D' ip_stop_row = 9 ). lo_worksheet->set_cell( ip_row = 4 ip_column = 'D' ip_value = 'C_ICONSET_3FLAGS' ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'D' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'D' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'D' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'D' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'D' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset3-iconset = zcl_excel_style_cond=>c_iconset_3trafficlights. lo_style_cond->mode_iconset = ls_iconset3. lo_style_cond->set_range( ip_start_column = 'E' ip_start_row = 5 ip_stop_column = 'E' ip_stop_row = 9 ). lo_worksheet->set_cell( ip_row = 4 ip_column = 'E' ip_value = 'C_ICONSET_3TRAFFICLIGHTS' ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'E' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'E' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'E' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'E' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'E' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset3-iconset = zcl_excel_style_cond=>c_iconset_3trafficlights2. lo_style_cond->mode_iconset = ls_iconset3. lo_style_cond->set_range( ip_start_column = 'F' ip_start_row = 5 ip_stop_column = 'F' ip_stop_row = 9 ). lo_worksheet->set_cell( ip_row = 4 ip_column = 'F' ip_value = 'C_ICONSET_3TRAFFICLIGHTS2' ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'F' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'F' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'F' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'F' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'F' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset3-iconset = zcl_excel_style_cond=>c_iconset_3signs. lo_style_cond->mode_iconset = ls_iconset3. lo_style_cond->set_range( ip_start_column = 'G' ip_start_row = 5 ip_stop_column = 'G' ip_stop_row = 9 ). lo_worksheet->set_cell( ip_row = 4 ip_column = 'G' ip_value = 'C_ICONSET_3SIGNS' ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'G' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'G' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'G' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'G' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'G' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset3-iconset = zcl_excel_style_cond=>c_iconset_3symbols. lo_style_cond->mode_iconset = ls_iconset3. lo_style_cond->set_range( ip_start_column = 'H' ip_start_row = 5 ip_stop_column = 'H' ip_stop_row = 9 ). lo_worksheet->set_cell( ip_row = 4 ip_column = 'H' ip_value = 'C_ICONSET_3SYMBOLS' ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'H' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'H' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'H' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'H' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'H' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset3-iconset = zcl_excel_style_cond=>c_iconset_3symbols2. lo_style_cond->mode_iconset = ls_iconset3. lo_style_cond->set_range( ip_start_column = 'I' ip_start_row = 5 ip_stop_column = 'I' ip_stop_row = 9 ). lo_worksheet->set_cell( ip_row = 4 ip_column = 'I' ip_value = 'C_ICONSET_3SYMBOLS2' ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'I' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'I' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'I' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'I' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 9 ip_column = 'I' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset4-iconset = zcl_excel_style_cond=>c_iconset_4arrows. lo_style_cond->mode_iconset = ls_iconset4. lo_style_cond->set_range( ip_start_column = 'B' ip_start_row = 12 ip_stop_column = 'B' ip_stop_row = 16 ). lo_worksheet->set_cell( ip_row = 11 ip_column = 'B' ip_value = 'C_ICONSET_4ARROWS' ). lo_worksheet->set_cell( ip_row = 12 ip_column = 'B' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 13 ip_column = 'B' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 14 ip_column = 'B' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 15 ip_column = 'B' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 16 ip_column = 'B' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset4-iconset = zcl_excel_style_cond=>c_iconset_4arrowsgray. lo_style_cond->mode_iconset = ls_iconset4. lo_style_cond->set_range( ip_start_column = 'C' ip_start_row = 12 ip_stop_column = 'C' ip_stop_row = 16 ). lo_worksheet->set_cell( ip_row = 11 ip_column = 'C' ip_value = 'C_ICONSET_4ARROWSGRAY' ). lo_worksheet->set_cell( ip_row = 12 ip_column = 'C' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 13 ip_column = 'C' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 14 ip_column = 'C' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 15 ip_column = 'C' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 16 ip_column = 'C' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset4-iconset = zcl_excel_style_cond=>c_iconset_4redtoblack. lo_style_cond->mode_iconset = ls_iconset4. lo_style_cond->set_range( ip_start_column = 'D' ip_start_row = 12 ip_stop_column = 'D' ip_stop_row = 16 ). lo_worksheet->set_cell( ip_row = 11 ip_column = 'D' ip_value = 'C_ICONSET_4REDTOBLACK' ). lo_worksheet->set_cell( ip_row = 12 ip_column = 'D' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 13 ip_column = 'D' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 14 ip_column = 'D' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 15 ip_column = 'D' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 16 ip_column = 'D' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset4-iconset = zcl_excel_style_cond=>c_iconset_4rating. lo_style_cond->mode_iconset = ls_iconset4. lo_style_cond->set_range( ip_start_column = 'E' ip_start_row = 12 ip_stop_column = 'E' ip_stop_row = 16 ). lo_worksheet->set_cell( ip_row = 11 ip_column = 'E' ip_value = 'C_ICONSET_4RATING' ). lo_worksheet->set_cell( ip_row = 12 ip_column = 'E' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 13 ip_column = 'E' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 14 ip_column = 'E' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 15 ip_column = 'E' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 16 ip_column = 'E' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset4-iconset = zcl_excel_style_cond=>c_iconset_4trafficlights. lo_style_cond->mode_iconset = ls_iconset4. lo_style_cond->set_range( ip_start_column = 'F' ip_start_row = 12 ip_stop_column = 'F' ip_stop_row = 16 ). lo_worksheet->set_cell( ip_row = 11 ip_column = 'F' ip_value = 'C_ICONSET_4TRAFFICLIGHTS' ). lo_worksheet->set_cell( ip_row = 12 ip_column = 'F' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 13 ip_column = 'F' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 14 ip_column = 'F' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 15 ip_column = 'F' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 16 ip_column = 'F' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset5-iconset = zcl_excel_style_cond=>c_iconset_5arrows. lo_style_cond->mode_iconset = ls_iconset5. lo_style_cond->set_range( ip_start_column = 'B' ip_start_row = 19 ip_stop_column = 'B' ip_stop_row = 23 ). lo_worksheet->set_cell( ip_row = 18 ip_column = 'B' ip_value = 'C_ICONSET_5ARROWS' ). lo_worksheet->set_cell( ip_row = 19 ip_column = 'B' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 20 ip_column = 'B' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 21 ip_column = 'B' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 22 ip_column = 'B' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 23 ip_column = 'B' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset5-iconset = zcl_excel_style_cond=>c_iconset_5arrowsgray. lo_style_cond->mode_iconset = ls_iconset5. lo_style_cond->set_range( ip_start_column = 'C' ip_start_row = 19 ip_stop_column = 'C' ip_stop_row = 23 ). lo_worksheet->set_cell( ip_row = 18 ip_column = 'C' ip_value = 'C_ICONSET_5ARROWSGRAY' ). lo_worksheet->set_cell( ip_row = 19 ip_column = 'C' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 20 ip_column = 'C' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 21 ip_column = 'C' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 22 ip_column = 'C' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 23 ip_column = 'C' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset5-iconset = zcl_excel_style_cond=>c_iconset_5rating. lo_style_cond->mode_iconset = ls_iconset5. lo_style_cond->set_range( ip_start_column = 'D' ip_start_row = 19 ip_stop_column = 'D' ip_stop_row = 23 ). lo_worksheet->set_cell( ip_row = 18 ip_column = 'D' ip_value = 'C_ICONSET_5RATING' ). lo_worksheet->set_cell( ip_row = 19 ip_column = 'D' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 20 ip_column = 'D' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 21 ip_column = 'D' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 22 ip_column = 'D' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 23 ip_column = 'D' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_iconset. lo_style_cond->priority = 1. ls_iconset5-iconset = zcl_excel_style_cond=>c_iconset_5quarters. lo_style_cond->mode_iconset = ls_iconset5. lo_style_cond->set_range( ip_start_column = 'E' ip_start_row = 19 ip_stop_column = 'E' ip_stop_row = 23 ). * DATABAR lo_worksheet->set_cell( ip_row = 25 ip_column = 'B' ip_value = 'DATABAR' ). lo_worksheet->set_cell( ip_row = 26 ip_column = 'B' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 27 ip_column = 'B' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 28 ip_column = 'B' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 29 ip_column = 'B' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 30 ip_column = 'B' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_databar. lo_style_cond->priority = 1. lo_style_cond->mode_databar = ls_databar. lo_style_cond->set_range( ip_start_column = 'B' ip_start_row = 26 ip_stop_column = 'B' ip_stop_row = 30 ). * COLORSCALE lo_worksheet->set_cell( ip_row = 25 ip_column = 'C' ip_value = 'COLORSCALE 2 COLORS' ). lo_worksheet->set_cell( ip_row = 26 ip_column = 'C' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 27 ip_column = 'C' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 28 ip_column = 'C' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 29 ip_column = 'C' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 30 ip_column = 'C' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_colorscale. lo_style_cond->priority = 1. lo_style_cond->mode_colorscale = ls_colorscale2. lo_style_cond->set_range( ip_start_column = 'C' ip_start_row = 26 ip_stop_column = 'C' ip_stop_row = 30 ). lo_worksheet->set_cell( ip_row = 25 ip_column = 'D' ip_value = 'COLORSCALE 3 COLORS' ). lo_worksheet->set_cell( ip_row = 26 ip_column = 'D' ip_value = 10 ). lo_worksheet->set_cell( ip_row = 27 ip_column = 'D' ip_value = 20 ). lo_worksheet->set_cell( ip_row = 28 ip_column = 'D' ip_value = 30 ). lo_worksheet->set_cell( ip_row = 29 ip_column = 'D' ip_value = 40 ). lo_worksheet->set_cell( ip_row = 30 ip_column = 'D' ip_value = 50 ). lo_style_cond = lo_worksheet->add_new_style_cond( ). lo_style_cond->rule = zcl_excel_style_cond=>c_rule_colorscale. lo_style_cond->priority = 1. lo_style_cond->mode_colorscale = ls_colorscale3. lo_style_cond->set_range( ip_start_column = 'D' ip_start_row = 26 ip_stop_column = 'D' ip_stop_row = 30 ). *** Create output lcl_output=>output( lo_excel ).
53.532864
94
0.612059
121fedf0b81eeb3a9fc3db977acdd7fafe613232
2,119
abap
ABAP
abap/zewm_robco_odata_functions.fugr.zconfirm_warehouse_task_step_1.abap
durairajrajkumar/ewm-cloud-robotics
4bac5d52c9d019b09352c916cb058212552592c3
[ "Apache-2.0" ]
null
null
null
abap/zewm_robco_odata_functions.fugr.zconfirm_warehouse_task_step_1.abap
durairajrajkumar/ewm-cloud-robotics
4bac5d52c9d019b09352c916cb058212552592c3
[ "Apache-2.0" ]
null
null
null
abap/zewm_robco_odata_functions.fugr.zconfirm_warehouse_task_step_1.abap
durairajrajkumar/ewm-cloud-robotics
4bac5d52c9d019b09352c916cb058212552592c3
[ "Apache-2.0" ]
null
null
null
** ** 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 zconfirm_warehouse_task_step_1. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" REFERENCE(IV_LGNUM) TYPE /SCWM/LGNUM *" REFERENCE(IV_TANUM) TYPE /SCWM/TANUM *" REFERENCE(IV_RSRC) TYPE /SCWM/DE_RSRC *" EXPORTING *" REFERENCE(ET_LTAP_VB) TYPE /SCWM/TT_LTAP_VB *" EXCEPTIONS *" WHT_NOT_CONFIRMED *" WHT_ALREADY_CONFIRMED *"---------------------------------------------------------------------- data: lv_severity type bapi_mtype, ls_to_conf type /scwm/to_conf, lt_bapiret type bapirettab, lt_ltap_vb type /scwm/tt_ltap_vb, lt_to_conf type /scwm/to_conf_tt. * Prepare input parameter for Warehouse Task confirmation ls_to_conf-tanum = iv_tanum. ls_to_conf-drsrc = iv_rsrc. append ls_to_conf to lt_to_conf. call function '/SCWM/TO_CONFIRM' exporting iv_lgnum = iv_lgnum iv_wtcode = wmegc_wtcode_rsrc iv_update_task = abap_false iv_commit_work = abap_false it_conf = lt_to_conf iv_processor_det = abap_true importing et_bapiret = lt_bapiret et_ltap_vb = lt_ltap_vb ev_severity = lv_severity. * commit work and wait to ensure next OData calls is getting actual data commit work and wait. * check errors if lv_severity ca 'EAX'. read table lt_bapiret with key type = 'E' id = '/SCWM/L3' number = 022 transporting no fields. if sy-subrc = 0. raise wht_already_confirmed. else. raise wht_not_confirmed. endif. else. et_ltap_vb = lt_ltap_vb. endif. endfunction.
32.106061
174
0.605474
12218683108201311d2f897306c0f33ef28d377b
34,013
abap
ABAP
src/zcl_abap_behv_conf_read_res.clas.abap
shubhamWaghmare-sap/BO_TDF_V2
ed0f75c9ec899b4507f12cbab019b1c4d8b2bc8a
[ "MIT" ]
null
null
null
src/zcl_abap_behv_conf_read_res.clas.abap
shubhamWaghmare-sap/BO_TDF_V2
ed0f75c9ec899b4507f12cbab019b1c4d8b2bc8a
[ "MIT" ]
null
null
null
src/zcl_abap_behv_conf_read_res.clas.abap
shubhamWaghmare-sap/BO_TDF_V2
ed0f75c9ec899b4507f12cbab019b1c4d8b2bc8a
[ "MIT" ]
null
null
null
class zcl_abap_behv_conf_read_res definition public final create public . public section. class-methods : find_reported_config_for_read importing entity type cl_abap_behv_load=>t_entity instance_to_check type any operation type if_abap_behv=>t_char01 changing buffer_4_entity type zif_abap_behv_test_trans_bufr6=>ty_double_transactional_buffer c_reported type data optional returning value(result) type abap_bool, find_reported_config_for_rba importing parent_entity type cl_abap_behv_load=>t_entity entity type cl_abap_behv_load=>t_entity instance_to_check type any operation type if_abap_behv=>t_char01 changing buffer_4_entity type zif_abap_behv_test_trans_bufr6=>ty_double_transactional_buffer c_reported type data optional returning value(result) type abap_bool, find_failed_config_for_read importing entity type cl_abap_behv_load=>t_entity instance_to_check type any operation type if_abap_behv=>t_char01 changing buffer_4_entity type zif_abap_behv_test_trans_bufr6=>ty_double_transactional_buffer c_failed type data optional returning value(result) type abap_bool, find_failed_config_for_rba importing parent_entity type cl_abap_behv_load=>t_entity entity type cl_abap_behv_load=>t_entity instance_to_check type any operation type if_abap_behv=>t_char01 changing buffer_4_entity type zif_abap_behv_test_trans_bufr6=>ty_double_transactional_buffer c_failed type data optional returning value(result) type abap_bool, find_result_config_for_read importing entity type cl_abap_behv_load=>t_entity instance_to_check type any operation type if_abap_behv=>t_char01 changing buffer_4_entity type zif_abap_behv_test_trans_bufr6=>ty_double_transactional_buffer c_result type standard table optional returning value(result) type abap_bool, find_result_config_for_rba importing parent_entity type cl_abap_behv_load=>t_entity entity type cl_abap_behv_load=>t_entity instance_to_check type any operation type if_abap_behv=>t_char01 changing buffer_4_entity type zif_abap_behv_test_trans_bufr6=>ty_double_transactional_buffer c_result type standard table optional returning value(result) type abap_bool . class-methods : configure_result_for_read importing entity type cl_abap_behv_load=>t_entity operation type if_abap_behv=>t_char01 result type standard table changing dbl_transactional_buffer_table type zif_abap_behv_test_trans_bufr6=>tt_double_transactional_buffer raising zcx_bo_tdf_failure . class-methods : configure_reported_for_read importing entity type cl_abap_behv_load=>t_entity operation type if_abap_behv=>t_char01 reported type data changing dbl_transactional_buffer_table type zif_abap_behv_test_trans_bufr6=>tt_double_transactional_buffer raising zcx_bo_tdf_failure . class-methods : configure_failed_for_read importing entity type cl_abap_behv_load=>t_entity operation type if_abap_behv=>t_char01 failed type data changing dbl_transactional_buffer_table type zif_abap_behv_test_trans_bufr6=>tt_double_transactional_buffer raising zcx_bo_tdf_failure . protected section. private section. endclass. class zcl_abap_behv_conf_read_res implementation. method configure_result_for_read. field-symbols: <buffer_4_entity> type zif_abap_behv_test_trans_bufr6=>ty_double_transactional_buffer. field-symbols: <entity_result> type standard table. field-symbols: <result_entity_to_be_filled> type standard table. field-symbols: <entity_buffer_instances> type standard table. field-symbols: <entity_buffer_instance> type any. field-symbols: <reported_for_entity> type standard table. data(alias) = zcl_abap_behv_buf_util=>get_entity_alias( entity = entity ). if result is not initial. loop at result assigning field-symbol(<entity_result_instance>). if line_exists( dbl_transactional_buffer_table[ entity_name = entity-name ] ). assign dbl_transactional_buffer_table[ entity_name = entity-name ] to <buffer_4_entity>. assign <buffer_4_entity>-entity_instances->* to <entity_buffer_instances>. data(entity_fields) = zcl_abap_behv_buf_util=>get_entity_fields( entity-name ). loop at <entity_buffer_instances> assigning <entity_buffer_instance>. data(equal) = zcl_abap_behv_buf_util=>check_instance_equal( exporting instance_1 = <entity_buffer_instance> instance_2 = <entity_result_instance> entity_fields = entity_fields ). if equal = abap_true. read table <buffer_4_entity>-read_response_config with key operation = operation assigning field-symbol(<response_config>). if <response_config> is not assigned . "create an entry for the read response config data result_config_for_op type zif_abap_behv_test_trans_bufr6=>ty_read_response_config. create data result_config_for_op-result like result. result_config_for_op-operation = operation. assign result_config_for_op-result->* to <result_entity_to_be_filled>. append <entity_result_instance> to <result_entity_to_be_filled>. append result_config_for_op to <buffer_4_entity>-read_response_config. else. "check if failed is configured for the operation and instance if <response_config>-failed is not initial. data(failed_already_configured) = find_failed_config_for_read( exporting entity = entity instance_to_check = <entity_result_instance> operation = operation changing buffer_4_entity = <buffer_4_entity> ). if failed_already_configured eq abap_true. "TODO: Exception failed is already configured. Configuring result for the same instance is undefined. raise exception type zcx_bo_tdf_failure exporting textid = zcx_bo_tdf_failure=>incorrect_response_config preconfigured = 'failed' new_configuration = 'result'. EXIT. endif. endif. "check if reported is configured for the operation and instance if <response_config>-reported is not initial. data(reported_already_configured) = find_reported_config_for_read( exporting entity = entity instance_to_check = <entity_result_instance> operation = operation changing buffer_4_entity = <buffer_4_entity> ). if reported_already_configured eq abap_true. "TODO: Exception reported is already configured. Configuring result for the same instance is undefined. raise exception type zcx_bo_tdf_failure exporting textid = zcx_bo_tdf_failure=>incorrect_response_config preconfigured = 'reported' new_configuration = 'result'. EXIT. endif. endif. "At this point it is clear that reported or failed is not configured. if <response_config>-result is not initial. assign <response_config>-result->* to <result_entity_to_be_filled>. append <entity_result_instance> to <result_entity_to_be_filled>. else. create data <response_config>-result like result. <response_config>-operation = operation. assign <response_config>-result->* to <result_entity_to_be_filled>. append <entity_result_instance> to <result_entity_to_be_filled>. endif. endif. else. "TODO: Throw exception with a reason that "no buffer entry exists for the entity instance" " Record the instance for which the response is to be configured. * raise exception type zcx_bo_tdf_failure * exporting * textid = zcx_bo_tdf_failure=>entity_not_recorded * new_configuration = 'result'. * EXIT. " A little issue with configuring result as it is not clear for which entity is the result configured for from the result structure endif. endloop. else. "TODO: Throw exception with a reason that "no buffer exists for the entity" " Record the instance for which the response is to be configured. * raise exception type zcx_bo_tdf_failure * exporting * textid = zcx_bo_tdf_failure=>entity_not_recorded * new_configuration = 'result'. * EXIT. " A little issue with configuring result as it is not clear for which entity is the result configured for from the result structure endif. endloop. endif. endmethod. method configure_reported_for_read. field-symbols: <buffer_4_entity> type zif_abap_behv_test_trans_bufr6=>ty_double_transactional_buffer. field-symbols: <entity_reported> type standard table. field-symbols: <reported_entity_to_be_filled> type standard table. field-symbols: <entity_buffer_instances> type standard table. field-symbols: <entity_buffer_instance> type any. field-symbols: <result_for_entity> type standard table. data(alias) = zcl_abap_behv_buf_util=>get_entity_alias( entity = entity ). assign component alias of structure reported to <entity_reported>. if <entity_reported> is assigned and <entity_reported> is not initial. loop at <entity_reported> assigning field-symbol(<entity_reported_instance>). if line_exists( dbl_transactional_buffer_table[ entity_name = entity-name ] ). assign dbl_transactional_buffer_table[ entity_name = entity-name ] to <buffer_4_entity>. assign <buffer_4_entity>-entity_instances->* to <entity_buffer_instances>. data(entity_fields) = zcl_abap_behv_buf_util=>get_entity_fields( entity-name ). loop at <entity_buffer_instances> assigning <entity_buffer_instance>. data(equal) = zcl_abap_behv_buf_util=>check_instance_equal( exporting instance_1 = <entity_buffer_instance> instance_2 = <entity_reported_instance> entity_fields = entity_fields ). if equal = abap_true. read table <buffer_4_entity>-read_response_config with key operation = operation assigning field-symbol(<response_config>). if <response_config> is not assigned. "create an entry for the read response config data reported_config_for_op type zif_abap_behv_test_trans_bufr6=>ty_read_response_config. create data reported_config_for_op-reported like reported. reported_config_for_op-operation = operation. assign reported_config_for_op-reported->* to field-symbol(<reported_to_be_filled>). assign component alias of structure <reported_to_be_filled> to <reported_entity_to_be_filled>. append <entity_reported_instance> to <reported_entity_to_be_filled>. append reported_config_for_op to <buffer_4_entity>-read_response_config. else. "check if result is configured for the operation and instance if <response_config>-result is not initial. data(result_already_configured) = find_result_config_for_read( exporting entity = entity instance_to_check = <entity_reported_instance> operation = operation changing buffer_4_entity = <buffer_4_entity> ). if result_already_configured eq abap_true. "TODO: Exception result is already configured. Configuring reported for the same instance is undefined. raise exception type zcx_bo_tdf_failure exporting textid = zcx_bo_tdf_failure=>incorrect_response_config preconfigured = 'result' new_configuration = 'reported'. EXIT. endif. endif. "At this point it is clear that result is not configured for the instance. if <response_config>-reported is initial. create data <response_config>-reported like reported. assign <response_config>-reported->* to <reported_to_be_filled>. assign component alias of structure <reported_to_be_filled> to <reported_entity_to_be_filled>. append <entity_reported_instance> to <reported_entity_to_be_filled>. else. "TODO: Handle duplicate entries assign <response_config>-reported->* to <reported_to_be_filled>. assign component alias of structure <reported_to_be_filled> to <reported_entity_to_be_filled>. append <entity_reported_instance> to <reported_entity_to_be_filled>. endif. endif. else. "TODO: Throw exception with a reason that "no buffer entry exists for the entity instance" " Record the instance for which the response is to be configured. raise exception type zcx_bo_tdf_failure exporting textid = zcx_bo_tdf_failure=>entity_not_recorded new_configuration = 'reported'. EXIT. endif. endloop. else. "TODO: Throw exception with a reason that "no buffer exists for the entity" " Record the instance for which the response is to be configured. raise exception type zcx_bo_tdf_failure exporting textid = zcx_bo_tdf_failure=>entity_not_recorded new_configuration = 'reported'. EXIT. endif. endloop. endif. endmethod. method configure_failed_for_read. field-symbols: <buffer_4_entity> type zif_abap_behv_test_trans_bufr6=>ty_double_transactional_buffer. field-symbols: <entity_failed> type standard table. field-symbols: <failed_entity_to_be_filled> type standard table. field-symbols: <entity_buffer_instances> type standard table. field-symbols: <entity_buffer_instance> type any. field-symbols: <result_for_entity> type standard table. data(alias) = zcl_abap_behv_buf_util=>get_entity_alias( entity = entity ). assign component alias of structure failed to <entity_failed>. if <entity_failed> is assigned and <entity_failed> is not initial. loop at <entity_failed> assigning field-symbol(<entity_failed_instance>). if line_exists( dbl_transactional_buffer_table[ entity_name = entity-name ] ). assign dbl_transactional_buffer_table[ entity_name = entity-name ] to <buffer_4_entity>. assign <buffer_4_entity>-entity_instances->* to <entity_buffer_instances>. data(entity_fields) = zcl_abap_behv_buf_util=>get_entity_fields( entity-name ). loop at <entity_buffer_instances> assigning <entity_buffer_instance>. data(equal) = zcl_abap_behv_buf_util=>check_instance_equal( exporting instance_1 = <entity_buffer_instance> instance_2 = <entity_failed_instance> entity_fields = entity_fields ). if equal = abap_true. read table <buffer_4_entity>-read_response_config with key operation = operation assigning field-symbol(<response_config>). if <response_config> is not assigned. "create an entry for the read response config data failed_config_for_op type zif_abap_behv_test_trans_bufr6=>ty_read_response_config. create data failed_config_for_op-failed like failed. failed_config_for_op-operation = operation. assign failed_config_for_op-failed->* to field-symbol(<failed_to_be_filled>). assign component alias of structure <failed_to_be_filled> to <failed_entity_to_be_filled>. append <entity_failed_instance> to <failed_entity_to_be_filled>. append failed_config_for_op to <buffer_4_entity>-read_response_config. else. "check if result is configured for the operation and instance if <response_config>-result is not initial. assign <response_config>-result->* to <result_for_entity>. loop at <result_for_entity> assigning field-symbol(<entity_result_instance>). data(result_already_configured) = zcl_abap_behv_buf_util=>check_instance_equal( exporting instance_1 = <entity_result_instance> instance_2 = <entity_failed_instance> entity_fields = entity_fields ). if result_already_configured eq abap_true. "TODO: Exception result is already configured. Configuring failed for the same instance is undefined. raise exception type zcx_bo_tdf_failure exporting textid = zcx_bo_tdf_failure=>incorrect_response_config preconfigured = 'result' new_configuration = 'failed'. EXIT. endif. endloop. if result_already_configured eq abap_true. "TODO: Exception result is already configured. Configuring failed for the same instance is undefined. raise exception type zcx_bo_tdf_failure exporting textid = zcx_bo_tdf_failure=>incorrect_response_config preconfigured = 'result' new_configuration = 'failed'. EXIT. endif. "At this point it is clear that result is not configured for the instance. if <response_config>-failed is initial. create data <response_config>-failed like failed. assign <response_config>-failed->* to <failed_to_be_filled>. assign component alias of structure <failed_to_be_filled> to <failed_entity_to_be_filled>. append <entity_failed_instance> to <failed_entity_to_be_filled>. else. "TODO: Handle duplicate entries assign <response_config>-failed->* to <failed_to_be_filled>. assign component alias of structure <failed_to_be_filled> to <failed_entity_to_be_filled>. append <entity_failed_instance> to <failed_entity_to_be_filled>. endif. else. "At this point it is clear that result is not configured for the instance. if <response_config>-failed is initial. create data <response_config>-failed like failed. assign <response_config>-failed->* to <failed_to_be_filled>. assign component alias of structure <failed_to_be_filled> to <failed_entity_to_be_filled>. append <entity_failed_instance> to <failed_entity_to_be_filled>. else. "TODO: Handle duplicate entries assign <response_config>-failed->* to <failed_to_be_filled>. assign component alias of structure <failed_to_be_filled> to <failed_entity_to_be_filled>. append <entity_failed_instance> to <failed_entity_to_be_filled>. endif. endif. endif. else. "TODO: Throw exception with a reason that "no buffer entry exists for the entity instance" " Record the instance for which the response is to be configured. raise exception type zcx_bo_tdf_failure exporting textid = zcx_bo_tdf_failure=>entity_not_recorded new_configuration = 'failed'. EXIT. endif. endloop. else. "TODO: Throw exception with a reason that "no buffer exists for the entity" " Record the instance for which the response is to be configured. raise exception type zcx_bo_tdf_failure exporting textid = zcx_bo_tdf_failure=>entity_not_recorded new_configuration = 'failed'. EXIT. endif. endloop. endif. endmethod. method find_reported_config_for_read. field-symbols: <configured_entity_reported> type standard table. field-symbols: <existing_buff_reported> type any. data(alias) = zcl_abap_behv_buf_util=>get_entity_alias( entity = entity ). alias = to_upper( alias ). data(entity_fields) = zcl_abap_behv_buf_util=>get_entity_fields( entity-name ). result = abap_false. read table buffer_4_entity-read_response_config with key operation = operation into data(response_config). if response_config is not initial and response_config-reported is not initial. assign response_config-reported->* to field-symbol(<configured_reported>). assign component alias of structure <configured_reported> to <configured_entity_reported>. endif. if <configured_entity_reported> is assigned and <configured_entity_reported> is not initial. loop at <configured_entity_reported> assigning field-symbol(<configured_reported_instance>). data(equal) = zcl_abap_behv_buf_util=>check_instance_equal( exporting instance_1 = instance_to_check instance_2 = <configured_reported_instance> entity_fields = entity_fields ). if equal = abap_true. if c_reported is supplied. field-symbols <fs_entry_reported_table> type standard table. assign component alias of structure c_reported to <fs_entry_reported_table>. append <configured_reported_instance> to <fs_entry_reported_table>. endif. result = abap_true. exit. endif. endloop. endif. endmethod. method find_reported_config_for_rba. field-symbols: <configured_entity_reported> type standard table. field-symbols: <existing_buff_reported> type any. data(alias) = zcl_abap_behv_buf_util=>get_entity_alias( entity = entity ). alias = to_upper( alias ). data(entity_fields) = zcl_abap_behv_buf_util=>get_entity_fields( entity-name ). result = abap_false. read table buffer_4_entity-read_response_config with key operation = operation into data(response_config). if response_config is not initial and response_config-reported is not initial. assign response_config-reported->* to field-symbol(<configured_reported>). assign component alias of structure <configured_reported> to <configured_entity_reported>. endif. if <configured_entity_reported> is assigned and <configured_entity_reported> is not initial. loop at <configured_entity_reported> assigning field-symbol(<configured_reported_instance>). data(equal) = zcl_abap_behv_buf_util=>check_instance_equal( exporting instance_1 = instance_to_check instance_2 = <configured_reported_instance> entity_fields = zcl_abap_behv_buf_util=>get_entity_fields( parent_entity-name ) ). if equal = abap_true. if c_reported is supplied. field-symbols <fs_entry_reported_table> type standard table. assign component alias of structure c_reported to <fs_entry_reported_table>. append <configured_reported_instance> to <fs_entry_reported_table>. endif. result = abap_true. exit. endif. endloop. endif. endmethod. method find_failed_config_for_read. field-symbols: <configured_entity_failed> type standard table. field-symbols: <existing_buff_failed> type any. data(alias) = zcl_abap_behv_buf_util=>get_entity_alias( entity = entity ). alias = to_upper( alias ). data(entity_fields) = zcl_abap_behv_buf_util=>get_entity_fields( entity-name ). result = abap_false. read table buffer_4_entity-read_response_config with key operation = operation into data(response_config). if response_config is not initial and response_config-failed is not initial. assign response_config-failed->* to field-symbol(<configured_failed>). assign component alias of structure <configured_failed> to <configured_entity_failed>. endif. if <configured_entity_failed> is assigned and <configured_entity_failed> is not initial. loop at <configured_entity_failed> assigning field-symbol(<configured_failed_instance>). data(equal) = zcl_abap_behv_buf_util=>check_instance_equal( exporting instance_1 = instance_to_check instance_2 = <configured_failed_instance> entity_fields = entity_fields ). if equal = abap_true. if c_failed is supplied. field-symbols <fs_entry_failed_table> type standard table. assign component alias of structure c_failed to <fs_entry_failed_table>. append <configured_failed_instance> to <fs_entry_failed_table>. endif. result = abap_true. exit. endif. endloop. endif. endmethod. method find_failed_config_for_rba. field-symbols: <configured_entity_failed> type standard table. field-symbols: <existing_buff_failed> type any. data(alias) = zcl_abap_behv_buf_util=>get_entity_alias( entity = entity ). alias = to_upper( alias ). data(entity_fields) = zcl_abap_behv_buf_util=>get_entity_fields( entity-name ). result = abap_false. read table buffer_4_entity-read_response_config with key operation = operation into data(response_config). if response_config is not initial and response_config-failed is not initial. assign response_config-failed->* to field-symbol(<configured_failed>). assign component alias of structure <configured_failed> to <configured_entity_failed>. endif. if <configured_entity_failed> is assigned and <configured_entity_failed> is not initial. loop at <configured_entity_failed> assigning field-symbol(<configured_failed_instance>). data(equal) = zcl_abap_behv_buf_util=>check_instance_equal( exporting instance_1 = instance_to_check instance_2 = <configured_failed_instance> entity_fields = zcl_abap_behv_buf_util=>get_entity_fields( parent_entity-name ) ). if equal = abap_true. if c_failed is supplied. field-symbols <fs_entry_failed_table> type standard table. assign component alias of structure c_failed to <fs_entry_failed_table>. append <configured_failed_instance> to <fs_entry_failed_table>. endif. result = abap_true. exit. endif. endloop. endif. endmethod. method find_result_config_for_read. field-symbols: <configured_entity_result> type standard table. field-symbols: <existing_buff_result> type any. data(alias) = zcl_abap_behv_buf_util=>get_entity_alias( entity = entity ). alias = to_upper( alias ). data(entity_fields) = zcl_abap_behv_buf_util=>get_entity_fields( entity-name ). result = abap_false. read table buffer_4_entity-read_response_config with key operation = operation into data(response_config). if response_config is not initial and response_config-result is not initial. assign response_config-result->* to <configured_entity_result>. endif. if <configured_entity_result> is assigned and <configured_entity_result> is not initial. loop at <configured_entity_result> assigning field-symbol(<configured_result_instance>). data(equal) = zcl_abap_behv_buf_util=>check_instance_equal( exporting instance_1 = instance_to_check instance_2 = <configured_result_instance> entity_fields = entity_fields ). if equal = abap_true. if c_result is supplied. " format data as per the control structures provided assign component '%control' of structure instance_to_check to field-symbol(<fs_control_fields>). zcl_abap_behv_buf_util=>format_res_as_per_cntrl_flds( exporting control_fields = <fs_control_fields> entity_fields = entity_fields changing entity_instance = <configured_result_instance> ). append <configured_result_instance> to c_result. endif. result = abap_true. exit. endif. endloop. endif. endmethod. method find_result_config_for_rba. field-symbols: <configured_entity_result> type standard table. field-symbols: <existing_buff_result> type any. data(alias) = zcl_abap_behv_buf_util=>get_entity_alias( entity = entity ). alias = to_upper( alias ). data(entity_fields) = zcl_abap_behv_buf_util=>get_entity_fields( entity-name ). result = abap_false. read table buffer_4_entity-read_response_config with key operation = operation into data(response_config). if response_config is not initial and response_config-result is not initial. assign response_config-result->* to <configured_entity_result>. endif. if <configured_entity_result> is assigned and <configured_entity_result> is not initial. loop at <configured_entity_result> assigning field-symbol(<configured_result_instance>). data(equal) = zcl_abap_behv_buf_util=>check_instance_equal( exporting instance_1 = instance_to_check instance_2 = <configured_result_instance> entity_fields = zcl_abap_behv_buf_util=>get_entity_fields( parent_entity-name ) ). if equal = abap_true. if c_result is supplied. " format data as per the control structures provided assign component '%control' of structure instance_to_check to field-symbol(<fs_control_fields>). zcl_abap_behv_buf_util=>format_res_as_per_cntrl_flds( exporting control_fields = <fs_control_fields> entity_fields = entity_fields changing entity_instance = <configured_result_instance> ). append <configured_result_instance> to c_result. endif. result = abap_true. exit. endif. endloop. endif. endmethod. endclass.
46.657064
137
0.620527
1224da1ab9e895d8951fbaa54b9cab90a6a889cd
4,486
abap
ABAP
src/ui/core/zcl_abapgit_gui_asset_manager.clas.abap
jeevanrajv1901/ABAPGIT
6d2deece76a481da75a04e4bbafae2d286b64834
[ "MIT" ]
1
2020-04-10T22:21:41.000Z
2020-04-10T22:21:41.000Z
src/ui/core/zcl_abapgit_gui_asset_manager.clas.abap
jeevanrajv1901/ABAPGIT
6d2deece76a481da75a04e4bbafae2d286b64834
[ "MIT" ]
1
2020-01-05T16:45:32.000Z
2020-01-05T16:45:32.000Z
src/ui/core/zcl_abapgit_gui_asset_manager.clas.abap
jeevanrajv1901/ABAPGIT
6d2deece76a481da75a04e4bbafae2d286b64834
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_gui_asset_manager DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES zif_abapgit_gui_asset_manager. TYPES: BEGIN OF ty_asset_entry. INCLUDE TYPE zif_abapgit_gui_asset_manager~ty_web_asset. TYPES: mime_name TYPE wwwdatatab-objid, END OF ty_asset_entry , tt_asset_register TYPE STANDARD TABLE OF ty_asset_entry WITH KEY url. METHODS register_asset IMPORTING !iv_url TYPE string !iv_type TYPE string !iv_cachable TYPE abap_bool DEFAULT abap_true !iv_mime_name TYPE wwwdatatab-objid OPTIONAL !iv_base64 TYPE string OPTIONAL !iv_inline TYPE string OPTIONAL . PROTECTED SECTION. PRIVATE SECTION. DATA mt_asset_register TYPE tt_asset_register. METHODS get_mime_asset IMPORTING iv_mime_name TYPE c RETURNING VALUE(rv_xdata) TYPE xstring RAISING zcx_abapgit_exception. METHODS load_asset IMPORTING is_asset_entry TYPE ty_asset_entry RETURNING VALUE(rs_asset) TYPE zif_abapgit_gui_asset_manager~ty_web_asset RAISING zcx_abapgit_exception. ENDCLASS. CLASS ZCL_ABAPGIT_GUI_ASSET_MANAGER IMPLEMENTATION. METHOD get_mime_asset. DATA: ls_key TYPE wwwdatatab, lv_size_c TYPE wwwparams-value, lv_size TYPE i, lt_w3mime TYPE STANDARD TABLE OF w3mime. ls_key-relid = 'MI'. ls_key-objid = iv_mime_name. " Get exact file size CALL FUNCTION 'WWWPARAMS_READ' EXPORTING relid = ls_key-relid objid = ls_key-objid name = 'filesize' IMPORTING value = lv_size_c EXCEPTIONS entry_not_exists = 1. IF sy-subrc IS NOT INITIAL. RETURN. ENDIF. lv_size = lv_size_c. " Get binary data CALL FUNCTION 'WWWDATA_IMPORT' EXPORTING key = ls_key TABLES mime = lt_w3mime EXCEPTIONS wrong_object_type = 1 import_error = 2. IF sy-subrc IS NOT INITIAL. RETURN. ENDIF. rv_xdata = zcl_abapgit_convert=>bintab_to_xstring( iv_size = lv_size it_bintab = lt_w3mime ). ENDMETHOD. METHOD load_asset. MOVE-CORRESPONDING is_asset_entry TO rs_asset. IF rs_asset-content IS INITIAL AND is_asset_entry-mime_name IS NOT INITIAL. " inline content has the priority rs_asset-content = get_mime_asset( is_asset_entry-mime_name ). ENDIF. IF rs_asset-content IS INITIAL. zcx_abapgit_exception=>raise( |failed to load GUI asset: { is_asset_entry-url }| ). ENDIF. ENDMETHOD. METHOD register_asset. DATA ls_asset LIKE LINE OF mt_asset_register. SPLIT iv_type AT '/' INTO ls_asset-type ls_asset-subtype. ls_asset-url = iv_url. ls_asset-mime_name = iv_mime_name. ls_asset-is_cacheable = iv_cachable. IF iv_base64 IS NOT INITIAL. ls_asset-content = zcl_abapgit_convert=>base64_to_xstring( iv_base64 ). ELSEIF iv_inline IS NOT INITIAL. ls_asset-content = zcl_abapgit_convert=>string_to_xstring( iv_inline ). ENDIF. APPEND ls_asset TO mt_asset_register. ENDMETHOD. METHOD zif_abapgit_gui_asset_manager~get_all_assets. FIELD-SYMBOLS <ls_a> LIKE LINE OF mt_asset_register. LOOP AT mt_asset_register ASSIGNING <ls_a>. APPEND load_asset( <ls_a> ) TO rt_assets. ENDLOOP. ENDMETHOD. METHOD zif_abapgit_gui_asset_manager~get_asset. FIELD-SYMBOLS <ls_a> LIKE LINE OF mt_asset_register. READ TABLE mt_asset_register WITH KEY url = iv_url ASSIGNING <ls_a>. IF <ls_a> IS NOT ASSIGNED. zcx_abapgit_exception=>raise( |Cannot find GUI asset: { iv_url }| ). ENDIF. rs_asset = load_asset( <ls_a> ). ENDMETHOD. METHOD zif_abapgit_gui_asset_manager~get_text_asset. DATA ls_asset TYPE zif_abapgit_gui_asset_manager~ty_web_asset. ls_asset = me->zif_abapgit_gui_asset_manager~get_asset( iv_url ). IF ls_asset-type <> 'text'. zcx_abapgit_exception=>raise( |Not a text asset: { iv_url }| ). ENDIF. IF iv_assert_subtype IS NOT INITIAL AND ls_asset-subtype <> iv_assert_subtype. zcx_abapgit_exception=>raise( |Wrong subtype ({ iv_assert_subtype }): { iv_url }| ). ENDIF. rv_asset = zcl_abapgit_convert=>xstring_to_string_utf8( ls_asset-content ). ENDMETHOD. ENDCLASS.
25.930636
90
0.678333
12272f42f2ca3b9524ea84c4642af820210514e2
696
abap
ABAP
src/zcl_io_db_x_writer.clas.testclasses.abap
sandraros/abap-io
8281d5631bed73c411c8e8296944bb98745f9cee
[ "MIT" ]
null
null
null
src/zcl_io_db_x_writer.clas.testclasses.abap
sandraros/abap-io
8281d5631bed73c411c8e8296944bb98745f9cee
[ "MIT" ]
null
null
null
src/zcl_io_db_x_writer.clas.testclasses.abap
sandraros/abap-io
8281d5631bed73c411c8e8296944bb98745f9cee
[ "MIT" ]
null
null
null
*"* 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. DATA: demo_lob_table TYPE demo_lob_table WRITER FOR COLUMNS blob1. demo_lob_table = VALUE #( idx = 1 ). INSERT INTO demo_lob_table VALUES demo_lob_table. cl_abap_unit_assert=>assert_subrc( msg = 'test cannot be executed' exp = 2 act = sy-subrc ). test_x_writer( NEW zcl_io_db_x_writer( demo_lob_table-blob1 ) ). ROLLBACK WORK. ENDMETHOD. ENDCLASS.
23.2
96
0.728448
122cc959f0170ae94b180df662da09b4d8dd6b85
2,839
abap
ABAP
lbn-gtt-template-tso/ABAP/zsrc/zgtt_sof.fugr.zgtt_sof_ote_de_itm_rel.abap
DanHaer/logistics-business-network-gtt-samples
739978ac389da6f3530b26cd6402a3892f4b605a
[ "Apache-2.0" ]
12
2020-09-25T07:54:40.000Z
2021-09-27T12:29:34.000Z
lbn-gtt-template-tso/ABAP/zsrc/zgtt_sof.fugr.zgtt_sof_ote_de_itm_rel.abap
DanHaer/logistics-business-network-gtt-samples
739978ac389da6f3530b26cd6402a3892f4b605a
[ "Apache-2.0" ]
2
2020-10-15T05:20:41.000Z
2022-02-14T09:28:02.000Z
lbn-gtt-template-tso/ABAP/zsrc/zgtt_sof.fugr.zgtt_sof_ote_de_itm_rel.abap
DanHaer/logistics-business-network-gtt-samples
739978ac389da6f3530b26cd6402a3892f4b605a
[ "Apache-2.0" ]
50
2020-09-29T03:06:01.000Z
2022-03-28T16:04:45.000Z
FUNCTION zgtt_sof_ote_de_itm_rel. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" REFERENCE(I_APPSYS) TYPE /SAPTRX/APPLSYSTEM *" REFERENCE(I_APP_OBJ_TYPES) TYPE /SAPTRX/AOTYPES *" REFERENCE(I_ALL_APPL_TABLES) TYPE TRXAS_TABCONTAINER *" REFERENCE(I_APPTYPE_TAB) TYPE TRXAS_APPTYPE_TABS_WA *" REFERENCE(I_APP_OBJECT) TYPE TRXAS_APPOBJ_CTAB_WA *" EXPORTING *" VALUE(E_RESULT) LIKE SY-BINPT *" TABLES *" C_LOGTABLE STRUCTURE BAPIRET2 OPTIONAL *" EXCEPTIONS *" PARAMETER_ERROR *" RELEVANCE_DETERM_ERROR *" STOP_PROCESSING *"---------------------------------------------------------------------- *----------------------------------------------------------------------* * Top Include * TYPE-POOLS:trxas. *----------------------------------------------------------------------* DATA: lv_aot_relevance TYPE boole_d. FIELD-SYMBOLS: <ls_xlikp> TYPE likpvb, <ls_xlips> TYPE lipsvb. * <1> Check if Main table is Delivery Order Item or not. IF i_app_object-maintabdef <> gc_bpt_delivery_item_new. PERFORM create_logtable_ao_rel TABLES c_logtable USING i_app_object-maintabdef space i_app_obj_types-trrelfunc i_app_object-appobjtype i_appsys. RAISE parameter_error. ELSE. * Read Main Object Table (Delivery Order Item - LIPS) ASSIGN i_app_object-maintabref->* TO <ls_xlips>. ENDIF. * <2> Check if Master table is Delivery Order Header or not. IF i_app_object-mastertabdef <> gc_bpt_delivery_header_new. PERFORM create_logtable_ao_rel TABLES c_logtable USING space i_app_object-mastertabdef i_app_obj_types-trrelfunc i_app_object-appobjtype i_appsys. RAISE parameter_error. ELSE. * Read Master Object Table (Delivery Order Header - LIKP) ASSIGN i_app_object-mastertabref->* TO <ls_xlikp>. ENDIF. * <3> Check Relevance of AOT: YN_OTE PERFORM check_aot_relevance_dlv USING <ls_xlikp> CHANGING lv_aot_relevance. CHECK lv_aot_relevance IS NOT INITIAL. * <4> If Subsequent Document is created, Do not update Sales Order * IF <ls_xvbak>-updkz <> gc_insert. * PERFORM check_subseq_doc_available * USING i_all_appl_tables * CHANGING lv_aot_relevance. * ENDIF. * CHECK lv_aot_relevance IS NOT INITIAL. * <5> If Delivery Order Item is NOT newly created, Check is Critical Changes Made IF <ls_xlips>-updkz <> gc_insert. PERFORM check_for_changes_dlv USING i_all_appl_tables <ls_xlips> <ls_xlikp> CHANGING lv_aot_relevance. ENDIF. IF lv_aot_relevance = gc_true. e_result = gc_true_condition. ELSE. e_result = gc_false_condition. ENDIF. ENDFUNCTION.
30.858696
81
0.625925
122cdd7a85aae74268bc18c3ca61e102f7fde9ca
5,091
abap
ABAP
src/objects/zcl_abapgit_object_doct.clas.abap
sb-sap/abapGit
8d1f1c312f5cf70b97fb6f00530be53a5e968a5b
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_doct.clas.abap
sb-sap/abapGit
8d1f1c312f5cf70b97fb6f00530be53a5e968a5b
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_doct.clas.abap
sb-sap/abapGit
8d1f1c312f5cf70b97fb6f00530be53a5e968a5b
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_object_doct DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL. PUBLIC SECTION. INTERFACES zif_abapgit_object. ALIASES mo_files FOR zif_abapgit_object~mo_files. PRIVATE SECTION. CONSTANTS: c_id TYPE dokhl-id VALUE 'TX', c_typ TYPE dokhl-typ VALUE 'E', c_version TYPE dokhl-dokversion VALUE '0001', c_name TYPE string VALUE 'DOC'. TYPES: BEGIN OF ty_data, doctitle TYPE dsyst-doktitle, head TYPE thead, lines TYPE tline_tab, END OF ty_data. METHODS: read RETURNING VALUE(rs_data) TYPE ty_data. ENDCLASS. CLASS zcl_abapgit_object_doct IMPLEMENTATION. METHOD zif_abapgit_object~has_changed_since. rv_changed = abap_true. ENDMETHOD. "zif_abapgit_object~has_changed_since METHOD zif_abapgit_object~get_metadata. rs_metadata = get_metadata( ). ENDMETHOD. "zif_abapgit_object~get_metadata METHOD read. DATA: lv_object TYPE dokhl-object. lv_object = ms_item-obj_name. CALL FUNCTION 'DOCU_READ' EXPORTING id = c_id langu = mv_language object = lv_object typ = c_typ version = c_version IMPORTING doktitle = rs_data-doctitle head = rs_data-head TABLES line = rs_data-lines. ENDMETHOD. "read METHOD zif_abapgit_object~changed_by. rv_user = read( )-head-tdluser. IF rv_user IS INITIAL. rv_user = c_user_unknown. ENDIF. ENDMETHOD. "zif_abapgit_object~changed_by METHOD zif_abapgit_object~exists. DATA: lv_id TYPE dokil-id, lv_object TYPE dokhl-object. lv_object = ms_item-obj_name. SELECT SINGLE id FROM dokil INTO lv_id WHERE id = c_id AND object = lv_object. "#EC CI_GENBUFF rv_bool = boolc( sy-subrc = 0 ). ENDMETHOD. "zif_abapgit_object~exists METHOD zif_abapgit_object~jump. DATA: ls_dokentry TYPE dokentry, ls_bcdata TYPE bdcdata, lt_bcdata TYPE STANDARD TABLE OF bdcdata. " We need to modify dokentry directly, otherwise " Batch Input on SE61 wouldn't work because it stores " the last seen Document Class in this table. There's " no standard function to do this. SE61 does this " directly in its dialog modules ls_dokentry-username = sy-uname. ls_dokentry-langu = sy-langu. ls_dokentry-class = c_id. MODIFY dokentry FROM ls_dokentry. ls_bcdata-program = 'SAPMSDCU'. ls_bcdata-dynpro = '0100'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO lt_bcdata. CLEAR ls_bcdata. ls_bcdata-fnam = 'RSDCU-OBJECT7'. ls_bcdata-fval = ms_item-obj_name. APPEND ls_bcdata TO lt_bcdata. CLEAR ls_bcdata. ls_bcdata-fnam = 'BDC_OKCODE'. ls_bcdata-fval = '=SHOW'. APPEND ls_bcdata TO lt_bcdata. CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'GIT' EXPORTING tcode = 'SE61' mode_val = 'E' TABLES using_tab = lt_bcdata EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'error from ABAP4_CALL_TRANSACTION, DOCT' ). ENDIF. ENDMETHOD. "jump METHOD zif_abapgit_object~delete. DATA: lv_object TYPE dokhl-object. lv_object = ms_item-obj_name. CALL FUNCTION 'DOCU_DEL' EXPORTING id = c_id langu = mv_language object = lv_object typ = c_typ EXCEPTIONS ret_code = 1 OTHERS = 2. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'error from DOCU_DEL' ). ENDIF. ENDMETHOD. "delete METHOD zif_abapgit_object~deserialize. DATA: ls_data TYPE ty_data. io_xml->read( EXPORTING iv_name = c_name CHANGING cg_data = ls_data ). CALL FUNCTION 'DOCU_UPDATE' EXPORTING head = ls_data-head state = 'A' typ = c_typ version = c_version TABLES line = ls_data-lines. tadir_insert( iv_package ). ENDMETHOD. "deserialize METHOD zif_abapgit_object~serialize. DATA: ls_data TYPE ty_data. ls_data = read( ). CLEAR: ls_data-head-tdfuser, ls_data-head-tdfreles, ls_data-head-tdfdate, ls_data-head-tdftime, ls_data-head-tdluser, ls_data-head-tdlreles, ls_data-head-tdldate, ls_data-head-tdltime. io_xml->add( iv_name = c_name ig_data = ls_data ). ENDMETHOD. "serialize METHOD zif_abapgit_object~compare_to_remote_version. CREATE OBJECT ro_comparison_result TYPE zcl_abapgit_comparison_null. ENDMETHOD. METHOD zif_abapgit_object~is_locked. rv_is_locked = abap_false. ENDMETHOD. ENDCLASS. "zcl_abapgit_object_msag IMPLEMENTATION
25.328358
96
0.618935
1230f1fe42a3b8736d9dc58f3bd7c27de41215c2
706
abap
ABAP
src/zssf_con/zssf_fg.fugr.lzssf_fgo01.abap
hobru/ABAP-SDK-for-Azure
7e0f2dbf484a87deacae3fe62e2d8fd6357a1d05
[ "MIT" ]
null
null
null
src/zssf_con/zssf_fg.fugr.lzssf_fgo01.abap
hobru/ABAP-SDK-for-Azure
7e0f2dbf484a87deacae3fe62e2d8fd6357a1d05
[ "MIT" ]
null
null
null
src/zssf_con/zssf_fg.fugr.lzssf_fgo01.abap
hobru/ABAP-SDK-for-Azure
7e0f2dbf484a87deacae3fe62e2d8fd6357a1d05
[ "MIT" ]
1
2018-12-10T10:55:02.000Z
2018-12-10T10:55:02.000Z
*----------------------------------------------------------------------* ***INCLUDE LZSSF_FGO01. *----------------------------------------------------------------------* *{ INSERT DGDK908495 1 *&---------------------------------------------------------------------* *& Module SCREEN_CHANGE_PWD OUTPUT *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* MODULE screen_change_pwd OUTPUT. LOOP AT SCREEN. IF screen-name EQ 'ZSSF_DATA-ZKEY'. screen-invisible = '1'. MODIFY SCREEN. ENDIF. ENDLOOP. ENDMODULE. *} INSERT
33.619048
72
0.270538
12325bc1f7156360896b3755f255aa0b6137dcf1
6,251
abap
ABAP
src/objects/zcl_abapgit_object_para.clas.abap
mkulawik-pacg/abapGit
faef85ad389bb9dc411b62ffa05bf5cfa1680d93
[ "MIT" ]
1
2020-01-27T08:55:52.000Z
2020-01-27T08:55:52.000Z
src/objects/zcl_abapgit_object_para.clas.abap
mkulawik-pacg/abapGit
faef85ad389bb9dc411b62ffa05bf5cfa1680d93
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_para.clas.abap
mkulawik-pacg/abapGit
faef85ad389bb9dc411b62ffa05bf5cfa1680d93
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_object_para 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. ENDCLASS. CLASS ZCL_ABAPGIT_OBJECT_PARA IMPLEMENTATION. METHOD zif_abapgit_object~changed_by. * looks like "changed by user" is not stored in the database rv_user = c_user_unknown. ENDMETHOD. METHOD zif_abapgit_object~delete. " We can't use FM RS_PARAMETER_DELETE because of the popup to confirm "Therefore we have to reimplement most of the FMs logic DATA: lv_paramid TYPE tpara-paramid, ls_transpkey TYPE trkey. lv_paramid = ms_item-obj_name. CALL FUNCTION 'RS_ACCESS_PERMISSION' EXPORTING global_lock = abap_true language_upd_exit = 'RS_PARAMETER_LANGUAGE_EXIT' " Name FuBa for maintenance language change object = lv_paramid object_class = ms_item-obj_type suppress_language_check = space EXCEPTIONS canceled_in_corr = 1 enqueued_by_user = 2 enqueue_system_failure = 3 illegal_parameter_values = 4 locked_by_author = 5 no_modify_permission = 6 no_show_permission = 7 permission_failure = 8 request_language_denied = 9 OTHERS = 10. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. SELECT COUNT(*) FROM cross WHERE ( type = 'P' OR type = 'Q' ) AND name = lv_paramid. IF sy-subrc = 0. zcx_abapgit_exception=>raise( 'PARA: Parameter is still used' ). ELSE. SELECT COUNT(*) FROM dd04l BYPASSING BUFFER WHERE memoryid = lv_paramid AND as4local IN ('A', 'L', 'N'). IF sy-subrc = 0. zcx_abapgit_exception=>raise( 'PARA: Parameter is still used' ). ENDIF. ENDIF. CALL FUNCTION 'RS_CORR_INSERT' EXPORTING global_lock = abap_true object = lv_paramid object_class = 'PARA' mode = 'D' suppress_dialog = abap_true IMPORTING transport_key = ls_transpkey EXCEPTIONS cancelled = 01 permission_failure = 02 unknown_objectclass = 03. IF sy-subrc = 0. DELETE FROM tpara WHERE paramid = lv_paramid. DELETE FROM tparat WHERE paramid = lv_paramid. IF sy-subrc = 0. CALL FUNCTION 'RS_TREE_OBJECT_PLACEMENT' EXPORTING object = lv_paramid operation = 'DELETE' type = 'CR'. ENDIF. ELSE. zcx_abapgit_exception=>raise( 'error from RS_CORR_INSERT' ). ENDIF. ENDMETHOD. METHOD zif_abapgit_object~deserialize. * see fm RS_PARAMETER_ADD and RS_PARAMETER_EDIT DATA: lv_mode TYPE c LENGTH 1, ls_tpara TYPE tpara, ls_tparat TYPE tparat. SELECT SINGLE * FROM tpara INTO ls_tpara WHERE paramid = ms_item-obj_name. "#EC CI_GENBUFF IF sy-subrc = 0. lv_mode = 'M'. ELSE. lv_mode = 'I'. ENDIF. io_xml->read( EXPORTING iv_name = 'TPARA' CHANGING cg_data = ls_tpara ). io_xml->read( EXPORTING iv_name = 'TPARAT' CHANGING cg_data = ls_tparat ). CALL FUNCTION 'RS_CORR_INSERT' EXPORTING object = ms_item-obj_name object_class = 'PARA' mode = lv_mode global_lock = abap_true devclass = iv_package master_language = mv_language suppress_dialog = abap_true EXCEPTIONS cancelled = 1 permission_failure = 2 unknown_objectclass = 3 OTHERS = 4. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'error from RS_CORR_INSERT, PARA' ). ENDIF. MODIFY tpara FROM ls_tpara. "#EC CI_SUBRC ASSERT sy-subrc = 0. MODIFY tparat FROM ls_tparat. "#EC CI_SUBRC ASSERT sy-subrc = 0. ENDMETHOD. METHOD zif_abapgit_object~exists. DATA: lv_paramid TYPE tpara-paramid. SELECT SINGLE paramid FROM tpara INTO lv_paramid WHERE paramid = ms_item-obj_name. "#EC CI_GENBUFF rv_bool = boolc( sy-subrc = 0 ). ENDMETHOD. METHOD zif_abapgit_object~get_comparator. RETURN. ENDMETHOD. METHOD zif_abapgit_object~get_deserialize_steps. APPEND zif_abapgit_object=>gc_step_id-ddic TO rt_steps. ENDMETHOD. METHOD zif_abapgit_object~get_metadata. rs_metadata = get_metadata( ). * Data elements can refer to PARA objects rs_metadata-ddic = abap_true. ENDMETHOD. METHOD zif_abapgit_object~is_active. rv_active = is_active( ). ENDMETHOD. METHOD zif_abapgit_object~is_locked. DATA: lv_argument TYPE seqg3-garg. lv_argument = |PA{ ms_item-obj_name }|. OVERLAY lv_argument WITH ' '. lv_argument = lv_argument && '*'. rv_is_locked = exists_a_lock_entry_for( iv_lock_object = 'EEUDB' iv_argument = lv_argument ). ENDMETHOD. METHOD zif_abapgit_object~jump. CALL FUNCTION 'RS_TOOL_ACCESS' EXPORTING operation = 'SHOW' object_name = ms_item-obj_name object_type = 'PARA' in_new_window = abap_true. ENDMETHOD. METHOD zif_abapgit_object~serialize. DATA: ls_tpara TYPE tpara, ls_tparat TYPE tparat. SELECT SINGLE * FROM tpara INTO ls_tpara WHERE paramid = ms_item-obj_name. "#EC CI_GENBUFF IF sy-subrc <> 0. RETURN. ENDIF. SELECT SINGLE * FROM tparat INTO ls_tparat WHERE paramid = ms_item-obj_name AND sprache = mv_language. "#EC CI_GENBUFF "#EC CI_SUBRC io_xml->add( iv_name = 'TPARA' ig_data = ls_tpara ). io_xml->add( iv_name = 'TPARAT' ig_data = ls_tparat ). ENDMETHOD. ENDCLASS.
27.178261
110
0.599904
12376f08658253f6dd7bc824667fbe764e634614
3,680
abap
ABAP
src/background/zcl_abapgit_background.clas.abap
qinhanguyun/abapGit
272925fff7625a65a22825b546790948769f1556
[ "MIT" ]
1
2019-05-27T18:50:14.000Z
2019-05-27T18:50:14.000Z
src/background/zcl_abapgit_background.clas.abap
qinhanguyun/abapGit
272925fff7625a65a22825b546790948769f1556
[ "MIT" ]
null
null
null
src/background/zcl_abapgit_background.clas.abap
qinhanguyun/abapGit
272925fff7625a65a22825b546790948769f1556
[ "MIT" ]
1
2019-12-31T11:44:14.000Z
2019-12-31T11:44:14.000Z
CLASS zcl_abapgit_background DEFINITION PUBLIC CREATE PUBLIC . PUBLIC SECTION. TYPES: BEGIN OF ty_methods, class TYPE seoclsname, description TYPE string, END OF ty_methods. TYPES: ty_methods_tt TYPE SORTED TABLE OF ty_methods WITH UNIQUE KEY class. CLASS-METHODS run RAISING zcx_abapgit_exception . CLASS-METHODS list_methods RETURNING VALUE(rt_methods) TYPE ty_methods_tt. PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS ZCL_ABAPGIT_BACKGROUND IMPLEMENTATION. METHOD list_methods. DATA: ls_method LIKE LINE OF rt_methods, ls_key TYPE seoclskey, lt_implementing TYPE seor_implementing_keys, ls_implementing LIKE LINE OF lt_implementing. FIELD-SYMBOLS: <ls_method> LIKE LINE OF rt_methods. * in order to handle local classes in the compiled report ls_method-class = 'ZCL_ABAPGIT_BACKGROUND_PULL'. INSERT ls_method INTO TABLE rt_methods. ls_method-class = 'ZCL_ABAPGIT_BACKGROUND_PUSH_AU'. INSERT ls_method INTO TABLE rt_methods. ls_method-class = 'ZCL_ABAPGIT_BACKGROUND_PUSH_FI'. INSERT ls_method INTO TABLE rt_methods. ls_key-clsname = 'ZIF_ABAPGIT_BACKGROUND'. CALL FUNCTION 'SEO_INTERFACE_IMPLEM_GET_ALL' EXPORTING intkey = ls_key IMPORTING impkeys = lt_implementing EXCEPTIONS not_existing = 1 OTHERS = 2 ##FM_SUBRC_OK. LOOP AT lt_implementing INTO ls_implementing. ls_method-class = ls_implementing-clsname. INSERT ls_method INTO TABLE rt_methods. ENDLOOP. LOOP AT rt_methods ASSIGNING <ls_method>. CALL METHOD (<ls_method>-class)=>zif_abapgit_background~get_description RECEIVING rv_description = <ls_method>-description. ENDLOOP. ENDMETHOD. METHOD run. CONSTANTS: lc_enq_type TYPE c LENGTH 12 VALUE 'BACKGROUND'. DATA: lo_per TYPE REF TO zcl_abapgit_persist_background, lo_repo TYPE REF TO zcl_abapgit_repo_online, lt_list TYPE zcl_abapgit_persist_background=>tt_background, li_background TYPE REF TO zif_abapgit_background, li_log TYPE REF TO zif_abapgit_log, lv_repo_name TYPE string. FIELD-SYMBOLS: <ls_list> LIKE LINE OF lt_list. CALL FUNCTION 'ENQUEUE_EZABAPGIT' EXPORTING mode_zabapgit = 'E' type = lc_enq_type _scope = '3' EXCEPTIONS foreign_lock = 1 system_failure = 2 OTHERS = 3. IF sy-subrc <> 0. WRITE: / 'Another intance of the program is already running' ##NO_TEXT. RETURN. ENDIF. CREATE OBJECT lo_per. lt_list = lo_per->list( ). WRITE: / 'Background mode' ##NO_TEXT. LOOP AT lt_list ASSIGNING <ls_list>. lo_repo ?= zcl_abapgit_repo_srv=>get_instance( )->get( <ls_list>-key ). lv_repo_name = lo_repo->get_name( ). WRITE: / <ls_list>-method, lv_repo_name. zcl_abapgit_login_manager=>set( iv_uri = lo_repo->get_url( ) iv_username = <ls_list>-username iv_password = <ls_list>-password ). CREATE OBJECT li_log TYPE zcl_abapgit_log. CREATE OBJECT li_background TYPE (<ls_list>-method). li_background->run( io_repo = lo_repo ii_log = li_log it_settings = <ls_list>-settings ). li_log->write( ). ENDLOOP. IF lines( lt_list ) = 0. WRITE: / 'Nothing configured' ##NO_TEXT. ENDIF. CALL FUNCTION 'DEQUEUE_EZABAPGIT' EXPORTING type = lc_enq_type. ENDMETHOD. ENDCLASS.
27.462687
79
0.655163
1239b73828fa6911655d22168db15a446a7f1a5f
292
abap
ABAP
src/zcl_fi_commitment_api.clas.macros.abap
sougatach/zfi_glmaster
a758b297ae7061c9d2d5ca7108e70015fc76861c
[ "MIT" ]
1
2021-01-09T00:24:37.000Z
2021-01-09T00:24:37.000Z
src/zcl_fi_commitment_api.clas.macros.abap
sougatach/zfi_glmaster
a758b297ae7061c9d2d5ca7108e70015fc76861c
[ "MIT" ]
null
null
null
src/zcl_fi_commitment_api.clas.macros.abap
sougatach/zfi_glmaster
a758b297ae7061c9d2d5ca7108e70015fc76861c
[ "MIT" ]
null
null
null
*"* use this source file for any macro definitions you need *"* in the implementation part of the class DEFINE _mac_raise. me->lo_exception = NEW #( gv_symsg = CORRESPONDING #( sy ) ). me->lo_exception->add_sy_message( ). RAISE RESUMABLE EXCEPTION me->lo_exception. END-OF-DEFINITION.
32.444444
63
0.736301
123b1b2c447008071b65a9dc73b9d375258ce10b
5,978
abap
ABAP
src/zdemo_teched6.prog.abap
bizhuka/abap2xlsx
d69d4d6fdfb4090c50991b56b16809cf1c092001
[ "Apache-2.0" ]
1
2022-01-20T23:59:28.000Z
2022-01-20T23:59:28.000Z
src/demos/zdemo_teched6.prog.abap
gregorwolf/abap2xlsx
5110f924b435e23f4474381d0e43f0686b9d0421
[ "Apache-2.0" ]
null
null
null
src/demos/zdemo_teched6.prog.abap
gregorwolf/abap2xlsx
5110f924b435e23f4474381d0e43f0686b9d0421
[ "Apache-2.0" ]
1
2021-07-09T02:06:21.000Z
2021-07-09T02:06:21.000Z
*&---------------------------------------------------------------------* *& Report ZDEMO_TECHED3 *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT zdemo_teched6. ******************************* * Data Object declaration * ******************************* DATA: lo_excel TYPE REF TO zcl_excel, lo_excel_writer TYPE REF TO zif_excel_writer, lo_worksheet TYPE REF TO zcl_excel_worksheet. DATA: lo_style_title TYPE REF TO zcl_excel_style, lo_drawing TYPE REF TO zcl_excel_drawing, lo_range TYPE REF TO zcl_excel_range, lo_data_validation TYPE REF TO zcl_excel_data_validation, lo_column TYPE REF TO zcl_excel_column, lv_style_title_guid TYPE zexcel_cell_style, ls_key TYPE wwwdatatab. DATA: lv_file TYPE xstring, lv_bytecount TYPE i, lt_file_tab TYPE solix_tab. DATA: lv_full_path TYPE string, lv_workdir TYPE string, lv_file_separator TYPE c. CONSTANTS: lv_default_file_name TYPE string VALUE 'TechEd01.xlsx'. ******************************* * Selection screen management * ******************************* PARAMETERS: p_path TYPE zexcel_export_dir. AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path. lv_workdir = p_path. cl_gui_frontend_services=>directory_browse( EXPORTING initial_folder = lv_workdir CHANGING selected_folder = lv_workdir ). p_path = lv_workdir. INITIALIZATION. cl_gui_frontend_services=>get_sapgui_workdir( CHANGING sapworkdir = lv_workdir ). cl_gui_cfw=>flush( ). p_path = lv_workdir. START-OF-SELECTION. IF p_path IS INITIAL. p_path = lv_workdir. ENDIF. cl_gui_frontend_services=>get_file_separator( CHANGING file_separator = lv_file_separator ). CONCATENATE p_path lv_file_separator lv_default_file_name INTO lv_full_path. ******************************* * abap2xlsx create XLSX * ******************************* " Create excel instance CREATE OBJECT lo_excel. " Styles lo_style_title = lo_excel->add_new_style( ). lo_style_title->font->bold = abap_true. lo_style_title->font->color-rgb = zcl_excel_style_color=>c_blue. lv_style_title_guid = lo_style_title->get_guid( ). " Get active sheet lo_worksheet = lo_excel->get_active_worksheet( ). lo_worksheet->set_title( ip_title = 'Demo TechEd' ). lo_worksheet->set_cell( ip_column = 'B' ip_row = 5 ip_value = 'TechEd demo' ip_style = lv_style_title_guid ). lo_worksheet->set_cell( ip_column = 'B' ip_row = 7 ip_value = 'Is abap2xlsx simple' ). lo_worksheet->set_cell( ip_column = 'B' ip_row = 8 ip_value = 'Is abap2xlsx CooL' ). " add logo from SMWO lo_drawing = lo_excel->add_new_drawing( ). lo_drawing->set_position( ip_from_row = 2 ip_from_col = 'B' ). ls_key-relid = 'MI'. ls_key-objid = 'WBLOGO'. lo_drawing->set_media_www( ip_key = ls_key ip_width = 140 ip_height = 64 ). " assign drawing to the worksheet lo_worksheet->add_drawing( lo_drawing ). " Add new sheet lo_worksheet = lo_excel->add_new_worksheet( ). lo_worksheet->set_title( ip_title = 'Values' ). " Set values for range lo_worksheet->set_cell( ip_row = 4 ip_column = 'A' ip_value = 1 ). lo_worksheet->set_cell( ip_row = 5 ip_column = 'A' ip_value = 2 ). lo_worksheet->set_cell( ip_row = 6 ip_column = 'A' ip_value = 3 ). lo_worksheet->set_cell( ip_row = 7 ip_column = 'A' ip_value = 4 ). lo_worksheet->set_cell( ip_row = 8 ip_column = 'A' ip_value = 5 ). lo_range = lo_excel->add_new_range( ). lo_range->name = 'Values'. lo_range->set_value( ip_sheet_name = 'Values' ip_start_column = 'A' ip_start_row = 4 ip_stop_column = 'A' ip_stop_row = 8 ). lo_excel->set_active_sheet_index( 1 ). " add data validation lo_worksheet = lo_excel->get_active_worksheet( ). lo_data_validation = lo_worksheet->add_new_data_validation( ). lo_data_validation->type = zcl_excel_data_validation=>c_type_list. lo_data_validation->formula1 = 'Values'. lo_data_validation->cell_row = 7. lo_data_validation->cell_column = 'C'. lo_worksheet->set_cell( ip_row = 7 ip_column = 'C' ip_value = 'Select a value' ). lo_data_validation = lo_worksheet->add_new_data_validation( ). lo_data_validation->type = zcl_excel_data_validation=>c_type_list. lo_data_validation->formula1 = 'Values'. lo_data_validation->cell_row = 8. lo_data_validation->cell_column = 'C'. lo_worksheet->set_cell( ip_row = 8 ip_column = 'C' ip_value = 'Select a value' ). " add autosize (column width) lo_column = lo_worksheet->get_column( ip_column = 'B' ). lo_column->set_auto_size( ip_auto_size = abap_true ). lo_column = lo_worksheet->get_column( ip_column = 'C' ). lo_column->set_auto_size( ip_auto_size = abap_true ). " Create xlsx stream CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. lv_file = lo_excel_writer->write_file( lo_excel ). ******************************* * Output * ******************************* " Convert to binary lt_file_tab = cl_bcs_convert=>xstring_to_solix( iv_xstring = lv_file ). lv_bytecount = xstrlen( lv_file ). " Save the file cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = lv_bytecount filename = lv_full_path filetype = 'BIN' CHANGING data_tab = lt_file_tab ).
37.835443
111
0.593175
123c9b4b4a628b8726b9f5bde182c9bf113e5219
1,479
abap
ABAP
src/srv/zcl_qdrt_vh_data_res.clas.abap
stockbal/abap-qdrt
34c2ee4bb9141534db87f5e1f3c7545ea19d705a
[ "MIT" ]
4
2021-08-30T14:42:31.000Z
2022-01-10T18:19:47.000Z
src/srv/zcl_qdrt_vh_data_res.clas.abap
stockbal/abap-qdrt
34c2ee4bb9141534db87f5e1f3c7545ea19d705a
[ "MIT" ]
null
null
null
src/srv/zcl_qdrt_vh_data_res.clas.abap
stockbal/abap-qdrt
34c2ee4bb9141534db87f5e1f3c7545ea19d705a
[ "MIT" ]
1
2021-10-02T13:19:13.000Z
2021-10-02T13:19:13.000Z
"! <p class="shorttext synchronized" lang="en">Resource for retrieving data of VH request</p> CLASS zcl_qdrt_vh_data_res DEFINITION PUBLIC INHERITING FROM cl_rest_resource FINAL CREATE PUBLIC. PUBLIC SECTION. METHODS: if_rest_resource~post REDEFINITION. PROTECTED SECTION. PRIVATE SECTION. DATA: vh_request TYPE zif_qdrt_vh_data_provider=>ty_vh_request. ENDCLASS. CLASS zcl_qdrt_vh_data_res IMPLEMENTATION. METHOD if_rest_resource~post. DATA(json_body) = mo_request->get_entity( )->get_string_data( ). IF json_body IS NOT INITIAL. zcl_qdrt_json=>to_abap( EXPORTING json = json_body pretty_name = zcl_qdrt_json=>pretty_mode-camel_case CHANGING data = vh_request ). ENDIF. IF vh_request-type IS INITIAL OR vh_request-value_help_name IS INITIAL. RETURN. ENDIF. TRANSLATE vh_request-value_help_name TO UPPER CASE. TRY. DATA(vh_provider) = zcl_qdrt_provider_factory=>create_vh_data_provider( vh_request ). DATA(vh_selection_result) = vh_provider->get_data( ). mo_response->create_entity( )->set_string_data( COND #( WHEN vh_selection_result IS NOT INITIAL THEN vh_selection_result ELSE '[]' ) ). CATCH zcx_qdrt_appl_error INTO DATA(appl_error). zcl_qdrt_rest_error_response=>create( mo_response )->set_status( )->set_body_from_exc( appl_error ). ENDTRY. ENDMETHOD. ENDCLASS.
28.442308
108
0.703854
124122922e4cb1516942c046daf2b809666caded
8,690
abap
ABAP
src/zdemo_excel35.prog.abap
AndreaBorgia-Abo/demos
2f89e63babc3590ea44773873b7b78db549f4c7b
[ "MIT" ]
4
2022-03-06T12:05:48.000Z
2022-03-11T13:46:58.000Z
src/zdemo_excel35.prog.abap
AndreaBorgia-Abo/demos
2f89e63babc3590ea44773873b7b78db549f4c7b
[ "MIT" ]
2
2022-03-26T11:49:46.000Z
2022-03-27T11:49:30.000Z
src/zdemo_excel35.prog.abap
AndreaBorgia-Abo/demos
2f89e63babc3590ea44773873b7b78db549f4c7b
[ "MIT" ]
1
2022-03-12T11:50:30.000Z
2022-03-12T11:50:30.000Z
*&---------------------------------------------------------------------* *& Report ZDEMO_EXCEL2 *& Test Styles for ABAP2XLSX *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT zdemo_excel35. DATA: lo_excel TYPE REF TO zcl_excel, lo_excel_writer TYPE REF TO zif_excel_writer, lo_worksheet TYPE REF TO zcl_excel_worksheet, lo_style_bold TYPE REF TO zcl_excel_style, lo_style_underline TYPE REF TO zcl_excel_style, lo_style_filled TYPE REF TO zcl_excel_style, lo_style_border TYPE REF TO zcl_excel_style, lo_style_button TYPE REF TO zcl_excel_style, lo_border_dark TYPE REF TO zcl_excel_style_border, lo_border_light TYPE REF TO zcl_excel_style_border. DATA: lv_style_bold_guid TYPE zexcel_cell_style, lv_style_underline_guid TYPE zexcel_cell_style, lv_style_filled_guid TYPE zexcel_cell_style, lv_style_filled_green_guid TYPE zexcel_cell_style, lv_style_border_guid TYPE zexcel_cell_style, lv_style_button_guid TYPE zexcel_cell_style, lv_style_filled_turquoise_guid TYPE zexcel_cell_style. DATA: lv_file TYPE xstring, lv_bytecount TYPE i, lt_file_tab TYPE solix_tab. DATA: lv_full_path TYPE string, lv_workdir TYPE string, lv_file_separator TYPE c. CONSTANTS: lv_default_file_name TYPE string VALUE '35_Static_Styles.xlsx'. PARAMETERS: p_path TYPE zexcel_export_dir. AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_path. lv_workdir = p_path. cl_gui_frontend_services=>directory_browse( EXPORTING initial_folder = lv_workdir CHANGING selected_folder = lv_workdir ). p_path = lv_workdir. INITIALIZATION. cl_gui_frontend_services=>get_desktop_directory( CHANGING desktop_directory = lv_workdir ). cl_gui_cfw=>flush( ). p_path = lv_workdir. START-OF-SELECTION. IF p_path IS INITIAL. p_path = lv_workdir. ENDIF. cl_gui_frontend_services=>get_file_separator( CHANGING file_separator = lv_file_separator ). CONCATENATE p_path lv_file_separator lv_default_file_name INTO lv_full_path. " Creates active sheet CREATE OBJECT lo_excel. " Create border object CREATE OBJECT lo_border_dark. lo_border_dark->border_color-rgb = zcl_excel_style_color=>c_black. lo_border_dark->border_style = zcl_excel_style_border=>c_border_thin. CREATE OBJECT lo_border_light. lo_border_light->border_color-rgb = zcl_excel_style_color=>c_gray. lo_border_light->border_style = zcl_excel_style_border=>c_border_thin. " Create a bold / italic style lo_style_bold = lo_excel->add_new_style( ). lo_style_bold->font->bold = abap_true. lo_style_bold->font->italic = abap_true. lo_style_bold->font->name = zcl_excel_style_font=>c_name_arial. lo_style_bold->font->scheme = zcl_excel_style_font=>c_scheme_none. lo_style_bold->font->color-rgb = zcl_excel_style_color=>c_red. lv_style_bold_guid = lo_style_bold->get_guid( ). " Create an underline double style lo_style_underline = lo_excel->add_new_style( ). lo_style_underline->font->underline = abap_true. lo_style_underline->font->underline_mode = zcl_excel_style_font=>c_underline_double. lo_style_underline->font->name = zcl_excel_style_font=>c_name_roman. lo_style_underline->font->scheme = zcl_excel_style_font=>c_scheme_none. lo_style_underline->font->family = zcl_excel_style_font=>c_family_roman. lv_style_underline_guid = lo_style_underline->get_guid( ). " Create filled style yellow lo_style_filled = lo_excel->add_new_style( ). lo_style_filled->fill->filltype = zcl_excel_style_fill=>c_fill_solid. lo_style_filled->fill->fgcolor-theme = zcl_excel_style_color=>c_theme_accent6. lv_style_filled_guid = lo_style_filled->get_guid( ). " Create border with button effects lo_style_button = lo_excel->add_new_style( ). lo_style_button->borders->right = lo_border_dark. lo_style_button->borders->down = lo_border_dark. lo_style_button->borders->left = lo_border_light. lo_style_button->borders->top = lo_border_light. lv_style_button_guid = lo_style_button->get_guid( ). "Create style with border lo_style_border = lo_excel->add_new_style( ). lo_style_border->borders->allborders = lo_border_dark. lo_style_border->borders->diagonal = lo_border_dark. lo_style_border->borders->diagonal_mode = zcl_excel_style_borders=>c_diagonal_both. lv_style_border_guid = lo_style_border->get_guid( ). " Create filled style green lo_style_filled = lo_excel->add_new_style( ). lo_style_filled->fill->filltype = zcl_excel_style_fill=>c_fill_solid. lo_style_filled->fill->fgcolor-rgb = zcl_excel_style_color=>c_green. lo_style_filled->font->name = zcl_excel_style_font=>c_name_cambria. lo_style_filled->font->scheme = zcl_excel_style_font=>c_scheme_major. lv_style_filled_green_guid = lo_style_filled->get_guid( ). " Create filled style turquoise using legacy excel ver <= 2003 palette. (https://code.sdn.sap.com/spaces/abap2xlsx/tickets/92) lo_style_filled = lo_excel->add_new_style( ). lo_excel->legacy_palette->set_color( "replace built-in color from palette with out custom RGB turquoise ip_index = 16 ip_color = '0040E0D0' ). lo_style_filled->fill->filltype = zcl_excel_style_fill=>c_fill_solid. lo_style_filled->fill->fgcolor-indexed = 16. lv_style_filled_turquoise_guid = lo_style_filled->get_guid( ). " Get active sheet lo_worksheet = lo_excel->get_active_worksheet( ). lo_worksheet->set_title( ip_title = 'Styles' ). lo_worksheet->set_cell( ip_columnrow = 'B2' ip_value = 'Hello world' ). lo_worksheet->set_cell( ip_column = 'C' ip_row = 3 ip_value = 'Bold text' ip_style = lv_style_bold_guid ). lo_worksheet->set_cell( ip_column = 'D' ip_row = 4 ip_value = 'Underlined text' ip_style = lv_style_underline_guid ). lo_worksheet->set_cell( ip_column = 'B' ip_row = 5 ip_value = 'Filled text' ip_style = lv_style_filled_guid ). lo_worksheet->set_cell( ip_column = 'C' ip_row = 6 ip_value = 'Borders' ip_style = lv_style_border_guid ). lo_worksheet->set_cell( ip_column = 'D' ip_row = 7 ip_value = 'I''m not a button :)' ip_style = lv_style_button_guid ). lo_worksheet->set_cell( ip_column = 'B' ip_row = 9 ip_value = 'Modified color for Excel 2003' ip_style = lv_style_filled_turquoise_guid ). " Fill the cell and apply one style lo_worksheet->set_cell( ip_column = 'B' ip_row = 6 ip_value = 'Filled text' ip_style = lv_style_filled_guid ). " Change the style lo_worksheet->set_cell_style( ip_columnrow = 'B6' ip_style = lv_style_filled_green_guid ). " Add Style to an empty cell to test Fix for Issue "#44 Exception ZCX_EXCEL thrown when style is set for an empty cell " https://code.sdn.sap.com/spaces/abap2xlsx/tickets/44-exception-zcx_excel-thrown-when-style-is-set-for-an-empty-cell lo_worksheet->set_cell_style( ip_column = 'E' ip_row = 6 ip_style = lv_style_filled_green_guid ). * Demonstrate how to retroactivly change the cellstyle *Filled text and underlinded text lo_worksheet->change_cell_style( ip_columnrow = 'B5' ip_font_bold = abap_true ip_font_italic = abap_true ). lo_worksheet->change_cell_style( ip_column = 'D' ip_row = 4 ip_font_bold = abap_true ip_font_italic = abap_true ). CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. lv_file = lo_excel_writer->write_file( lo_excel ). " Convert to binary CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' EXPORTING buffer = lv_file IMPORTING output_length = lv_bytecount TABLES binary_tab = lt_file_tab. " Save the file cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = lv_bytecount filename = lv_full_path filetype = 'BIN' CHANGING data_tab = lt_file_tab ).
50.818713
140
0.6687
1249da9b1e8026a760967aa1f1eeacc150c51c84
19,610
abap
ABAP
org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.shallowparser/abap/ZSAPLINK_SMARTFORM.abap
assessorgeneral/ConQAT
2a462f23f22c22aa9d01a7a204453d1be670ba60
[ "Apache-2.0" ]
4
2016-06-26T01:13:39.000Z
2022-03-04T16:42:35.000Z
org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.shallowparser/abap/ZSAPLINK_SMARTFORM.abap
brynary/conqat
52172907ec76c4b0915091343f0975dc0cf4891c
[ "Apache-2.0" ]
null
null
null
org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.shallowparser/abap/ZSAPLINK_SMARTFORM.abap
brynary/conqat
52172907ec76c4b0915091343f0975dc0cf4891c
[ "Apache-2.0" ]
7
2015-04-01T03:50:54.000Z
2021-11-11T05:19:48.000Z
class ZSAPLINK_SMARTFORM definition public inheriting from ZSAPLINK final create public . public section. *"* public components of class ZSAPLINK_SMARTFORM *"* do not include other source files here!!! methods CHECKEXISTS redefinition . methods CREATEIXMLDOCFROMOBJECT redefinition . methods CREATEOBJECTFROMIXMLDOC redefinition . protected section. *"* protected components of class ZSAPLINK_SMARTFORM *"* do not include other source files here!!! methods DELETEOBJECT redefinition . methods GETOBJECTTYPE redefinition . private section. *"* private components of class ZSAPLINK_SMARTFORM *"* do not include other source files here!!! ENDCLASS. CLASS ZSAPLINK_SMARTFORM IMPLEMENTATION. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Public Method ZSAPLINK_SMARTFORM->CHECKEXISTS * +-------------------------------------------------------------------------------------------------+ * | [<-()] EXISTS TYPE FLAG * +--------------------------------------------------------------------------------------</SIGNATURE> METHOD checkexists . */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ SELECT SINGLE formname FROM stxfadm INTO objname WHERE formname = objname. IF sy-subrc = 0. exists = 'X'. ENDIF. ENDMETHOD. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Public Method ZSAPLINK_SMARTFORM->CREATEIXMLDOCFROMOBJECT * +-------------------------------------------------------------------------------------------------+ * | [<-()] IXMLDOCUMENT TYPE REF TO IF_IXML_DOCUMENT * | [!CX!] ZCX_SAPLINK * +--------------------------------------------------------------------------------------</SIGNATURE> METHOD createixmldocfromobject . */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ DATA rootnode TYPE REF TO if_ixml_element. DATA sourcenode TYPE REF TO if_ixml_element. DATA rc TYPE sysubrc. DATA sourcestring TYPE string. DATA _objtype TYPE string. DATA: l_filename TYPE string, l_file_filter TYPE string, l_user_action TYPE i. DATA: wa_node type ssfgnode, l_element TYPE REF TO if_ixml_element. DATA: l_language_str TYPE string, l_language(2) TYPE c. DATA: l_lines TYPE i, l_splitted_name_tab TYPE TABLE OF string. DATA: l_stylename TYPE tdssname, l_stylevari TYPE tdvariant, l_save_style TYPE tdssname. TYPES: t_raw(250) TYPE x. CONSTANTS: c_xml_ns_uri_sf(255) TYPE c VALUE 'urn:sap-com:SmartForms:2000:internal-structure',"#EC NOTEXT c_xml_ns_uri_ifr(255) TYPE c VALUE 'urn:sap-com:sdixml-ifr:2000'. "#EC NOTEXT DATA: g_ixml TYPE REF TO if_ixml, xml_macro_rc TYPE i, xml_document TYPE REF TO if_ixml_document, xml_ns_prefix_sf TYPE string, xml_ns_uri_sf TYPE string, xml_ns_uri_ifr TYPE string, xml_document_size TYPE i, xml_xtable TYPE TABLE OF t_raw, xml_xtable2 TYPE TABLE OF string, sform_name TYPE tdsfname. DATA ref_ssf TYPE REF TO cl_ssf_fb_smart_form. sform_name = objname. IF g_ixml IS INITIAL. g_ixml = cl_ixml=>create( ). ENDIF. xml_document = g_ixml->create_document( ). xml_ns_prefix_sf = 'sf'. xml_ns_uri_sf = c_xml_ns_uri_sf. xml_ns_uri_ifr = c_xml_ns_uri_ifr. CLEAR: xml_document_size, xml_xtable[], xml_xtable2[]. CREATE OBJECT ref_ssf. TRY. CALL METHOD ref_ssf->load EXPORTING im_formname = sform_name. ref_ssf->xml_init( ). CALL METHOD ref_ssf->xml_download EXPORTING parent = xml_document CHANGING document = xml_document. * namespace l_element = xml_document->get_root_element( ). l_element->set_attribute( name = xml_ns_prefix_sf namespace = 'xmlns' value = xml_ns_uri_sf ). l_element->set_attribute( name = 'xmlns' value = xml_ns_uri_ifr ). * language WRITE sy-langu TO l_language. l_language_str = l_language. xml_macro_rc = l_element->set_attribute( name = 'language' namespace = xml_ns_prefix_sf value = l_language_str ). * convert DOM to xml CALL FUNCTION 'SDIXML_DOM_TO_XML' EXPORTING document = xml_document IMPORTING size = xml_document_size TABLES xml_as_table = xml_xtable EXCEPTIONS OTHERS = 1. CHECK sy-subrc EQ 0. _objtype = getobjecttype( ). rootnode = xmldoc->create_element( _objtype ). DATA: wa_stxfadm TYPE stxfadm. SELECT SINGLE * FROM stxfadm INTO wa_stxfadm WHERE formname = objname. setattributesfromstructure( node = rootnode structure = wa_stxfadm ). sourcenode = xmldoc->create_element( 'smartform' ). xml_xtable2 = xml_xtable[]. sourcestring = buildsourcestring( sourcetable = xml_xtable2[] ). rc = sourcenode->if_ixml_node~set_value( sourcestring ). rc = rootnode->append_child( sourcenode ). rc = xmldoc->append_child( rootnode ). ixmldocument = xmldoc. FREE: xml_document, xml_xtable[], xml_document_size. CATCH cx_ssf_fb . CLEAR ixmldocument. RAISE EXCEPTION TYPE zcx_saplink EXPORTING textid = zcx_saplink=>not_found. ENDTRY. ENDMETHOD. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Public Method ZSAPLINK_SMARTFORM->CREATEOBJECTFROMIXMLDOC * +-------------------------------------------------------------------------------------------------+ * | [--->] IXMLDOCUMENT TYPE REF TO IF_IXML_DOCUMENT * | [--->] DEVCLASS TYPE DEVCLASS (default ='$TMP') * | [--->] OVERWRITE TYPE FLAG(optional) * | [<-()] NAME TYPE STRING * | [!CX!] ZCX_SAPLINK * +--------------------------------------------------------------------------------------</SIGNATURE> METHOD createobjectfromixmldoc . */---------------------------------------------------------------------\ *| This file is part of SAPlink. | *| | *| SAPlink is free software; you can redistribute it and/or modify | *| it under the terms of the GNU General Public License as published | *| by the Free Software Foundation; either version 2 of the License, | *| or (at your option) any later version. | *| | *| SAPlink is distributed in the hope that it will be useful, | *| but WITHOUT ANY WARRANTY; without even the implied warranty of | *| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | *| GNU General Public License for more details. | *| | *| You should have received a copy of the GNU General Public License | *| along with SAPlink; if not, write to the | *| Free Software Foundation, Inc., | *| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | *\---------------------------------------------------------------------/ TYPES: t_raw(250) TYPE x. DATA rootnode TYPE REF TO if_ixml_element. DATA progattribs TYPE trdir. DATA sourcenode TYPE REF TO if_ixml_element. DATA l_xml_node TYPE REF TO if_ixml_element. DATA source TYPE string. DATA sourcetable TYPE table_of_strings. DATA _objtype TYPE string. DATA checkexists TYPE flag. DATA: wa_stxfadm TYPE stxfadm, formname TYPE tdsfname, master_language TYPE sylangu, lv_devclass TYPE devclass, korrnum TYPE trkorr, modif_language TYPE sylangu. DATA: g_ixml TYPE REF TO if_ixml, xml_macro_rc TYPE i, xml_document TYPE REF TO if_ixml_document, l_element TYPE REF TO if_ixml_element, xml_ns_prefix_sf TYPE string, xml_ns_uri_sf TYPE string, xml_ns_uri_ifr TYPE string, xml_document_size TYPE i, xml_xtable TYPE TABLE OF t_raw, l_ns_uri TYPE string, l_name TYPE string, l_language TYPE string, p_dequeue TYPE tdbool, l_cancel TYPE tdsfflag, sf_exception TYPE REF TO cx_ssf_fb. DATA: ref_ssf TYPE REF TO cl_ssf_fb_smart_form, l_upload_smartform TYPE REF TO cl_ssf_fb_smart_form. _objtype = getobjecttype( ). xmldoc = ixmldocument. rootnode = xmldoc->find_from_name( _objtype ). CALL METHOD getstructurefromattributes EXPORTING node = rootnode CHANGING structure = wa_stxfadm. objname = wa_stxfadm-formname. checkexists = checkexists( ). IF checkexists IS NOT INITIAL. IF overwrite IS INITIAL. RAISE EXCEPTION TYPE zcx_saplink EXPORTING textid = zcx_saplink=>existing. ELSE. * delete object for new install deleteobject( ). ENDIF. ENDIF. sourcenode = rootnode->find_from_name( 'smartform' ). source = sourcenode->get_value( ). sourcetable = buildtablefromstring( source ). xml_xtable = sourcetable. xml_document_size = STRLEN( source ). CREATE OBJECT ref_ssf. formname = objname. * Check access permission and enqueue smart form master_language = sy-langu. TRY. CALL METHOD ref_ssf->enqueue EXPORTING suppress_corr_check = space language_upd_exit = ' ' master_language = master_language mode = 'INSERT' formname = formname IMPORTING devclass = lv_devclass new_master_language = master_language korrnum = korrnum modification_language = modif_language. CATCH cx_ssf_fb INTO sf_exception. CASE sf_exception->textid. WHEN cx_ssf_fb=>enqueued_by_user OR cx_ssf_fb=>enqueue_system_failure. RAISE EXCEPTION TYPE zcx_saplink EXPORTING msg = 'Enqueued by user'. WHEN cx_ssf_fb=>no_modify_permission OR cx_ssf_fb=>no_show_permission. RAISE EXCEPTION TYPE zcx_saplink EXPORTING msg = 'Permission Error'. WHEN cx_ssf_fb=>permission_failure. EXIT. WHEN cx_ssf_fb=>request_language_denied. RAISE EXCEPTION TYPE zcx_saplink EXPORTING msg = 'Language request denied'. WHEN OTHERS. EXIT. ENDCASE. ENDTRY. CALL FUNCTION 'SDIXML_XML_TO_DOM' EXPORTING xml = xml_xtable[] size = xml_document_size IMPORTING document = xml_document EXCEPTIONS OTHERS = 1. l_xml_node = xml_document->get_root_element( ). l_ns_uri = l_xml_node->get_namespace_uri( ). l_name = l_xml_node->get_name( ). l_element ?= l_xml_node->query_interface( ixml_iid_element ). l_language = l_element->get_attribute( name = 'language' namespace = xml_ns_prefix_sf ). CREATE OBJECT l_upload_smartform. CALL METHOD l_upload_smartform->xml_upload EXPORTING dom = l_xml_node formname = formname language = master_language CHANGING sform = ref_ssf. ref_ssf = l_upload_smartform. PERFORM save_form IN PROGRAM saplstxb USING ' ' 'X' CHANGING ref_ssf l_cancel. FREE: xml_document. * dequeue form ref_ssf->dequeue( formname = formname ). * successful install name = objname. ENDMETHOD. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Protected Method ZSAPLINK_SMARTFORM->DELETEOBJECT * +-------------------------------------------------------------------------------------------------+ * | [!CX!] ZCX_SAPLINK * +--------------------------------------------------------------------------------------</SIGNATURE> METHOD deleteobject . */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ CALL FUNCTION 'FB_DELETE_FORM' EXPORTING I_FORMNAME = OBJNAME * I_FORMTYPE = ' ' * I_WITH_DIALOG = 'X' * I_WITH_CONFIRM_DIALOG = 'X' * IMPORTING * O_FORMNAME = EXCEPTIONS NO_NAME = 1 NO_FORM = 2 FORM_LOCKED = 3 NO_ACCESS_PERMISSION = 4 ILLEGAL_LANGUAGE = 5 ILLEGAL_FORMTYPE = 6 OTHERS = 7 . IF sy-subrc <> 0. ENDIF. ENDMETHOD. "createobjectfromixmldoc * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Protected Method ZSAPLINK_SMARTFORM->GETOBJECTTYPE * +-------------------------------------------------------------------------------------------------+ * | [<-()] OBJECTTYPE TYPE STRING * +--------------------------------------------------------------------------------------</SIGNATURE> method GETOBJECTTYPE . */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ objectType = 'SSFO'. "SAP Smartforms endmethod. ENDCLASS.
41.812367
102
0.48669
124a7df9ab49d04a4b74fbf97656a29159362bcf
31,773
abap
ABAP
src/objects/zcl_abapgit_object_tabl.clas.abap
amit3kumar/ABAP_ALL
67822ae13ffda6597a91bb5b39e428c39bc445a3
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_tabl.clas.abap
amit3kumar/ABAP_ALL
67822ae13ffda6597a91bb5b39e428c39bc445a3
[ "MIT" ]
18
2019-11-05T16:18:55.000Z
2021-02-25T22:56:06.000Z
src/objects/zcl_abapgit_object_tabl.clas.abap
amit3kumar/ABAP_ALL
67822ae13ffda6597a91bb5b39e428c39bc445a3
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_object_tabl DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES zif_abapgit_object . ALIASES mo_files FOR zif_abapgit_object~mo_files . PROTECTED SECTION. TYPES: BEGIN OF ty_segment_definition, segmentheader TYPE edisegmhd, segmentdefinition TYPE edisegmdef, segmentstructures TYPE STANDARD TABLE OF edisegstru WITH DEFAULT KEY, END OF ty_segment_definition. TYPES: ty_segment_definitions TYPE STANDARD TABLE OF ty_segment_definition WITH DEFAULT KEY. TYPES: BEGIN OF ty_tabl_extras, tddat TYPE tddat, END OF ty_tabl_extras. "! get additional data like table authorization group "! @parameter iv_tabname | name of the table METHODS read_extras IMPORTING iv_tabname TYPE ddobjname RETURNING VALUE(rs_tabl_extras) TYPE ty_tabl_extras. "! Update additional data "! @parameter iv_tabname | name of the table "! @parameter is_tabl_extras | additional table data METHODS update_extras IMPORTING iv_tabname TYPE ddobjname is_tabl_extras TYPE ty_tabl_extras. "! Delete additional data "! @parameter iv_tabname | name of the table METHODS delete_extras IMPORTING iv_tabname TYPE ddobjname. "! Serialize IDoc Segment type/definition if exits "! @parameter io_xml | XML writer "! @raising zcx_abapgit_exception | Exceptions METHODS serialize_idoc_segment IMPORTING io_xml TYPE REF TO zif_abapgit_xml_output RAISING zcx_abapgit_exception. "! Deserialize IDoc Segment type/definition if exits "! @parameter io_xml | XML writer "! @parameter iv_package | Target package "! @parameter rv_deserialized | It's a segment and was desserialized "! @raising zcx_abapgit_exception | Exceptions METHODS deserialize_idoc_segment IMPORTING io_xml TYPE REF TO zif_abapgit_xml_input iv_package TYPE devclass RETURNING VALUE(rv_deserialized) TYPE abap_bool RAISING zcx_abapgit_exception. "! Delete the IDoc Segment type if exists "! @parameter rv_deleted | It's a segment and was deleted "! @raising zcx_abapgit_exception | Exceptions METHODS delete_idoc_segment RETURNING VALUE(rv_deleted) TYPE abap_bool RAISING zcx_abapgit_exception. PRIVATE SECTION. TYPES: ty_dd03p_tt TYPE STANDARD TABLE OF dd03p . TYPES: BEGIN OF ty_dd02_text, ddlanguage TYPE dd02t-ddlanguage, ddtext TYPE dd02t-ddtext, END OF ty_dd02_text . TYPES: ty_dd02_texts TYPE STANDARD TABLE OF ty_dd02_text . CONSTANTS c_longtext_id_tabl TYPE dokil-id VALUE 'TB' ##NO_TEXT. CONSTANTS: BEGIN OF c_s_dataname, segment_definition TYPE string VALUE 'SEGMENT_DEFINITION', tabl_extras TYPE string VALUE 'TABL_EXTRAS', END OF c_s_dataname . METHODS deserialize_indexes IMPORTING !io_xml TYPE REF TO zif_abapgit_xml_input RAISING zcx_abapgit_exception . METHODS clear_dd03p_fields CHANGING !ct_dd03p TYPE ty_dd03p_tt . "! Check if structure is an IDoc segment "! @parameter rv_is_idoc_segment | It's an IDoc segment or not METHODS is_idoc_segment RETURNING VALUE(rv_is_idoc_segment) TYPE abap_bool . METHODS clear_dd03p_fields_common CHANGING !cs_dd03p TYPE dd03p . METHODS clear_dd03p_fields_dataelement CHANGING !cs_dd03p TYPE dd03p . METHODS serialize_texts IMPORTING !io_xml TYPE REF TO zif_abapgit_xml_output RAISING zcx_abapgit_exception . METHODS deserialize_texts IMPORTING !io_xml TYPE REF TO zif_abapgit_xml_input !is_dd02v TYPE dd02v RAISING zcx_abapgit_exception . METHODS is_db_table_category IMPORTING !iv_tabclass TYPE dd02l-tabclass RETURNING VALUE(rv_is_db_table_type) TYPE dd02l-tabclass . ENDCLASS. CLASS zcl_abapgit_object_tabl IMPLEMENTATION. METHOD clear_dd03p_fields. CONSTANTS lc_comptype_dataelement TYPE comptype VALUE 'E'. DATA: lv_masklen TYPE c LENGTH 4. FIELD-SYMBOLS: <ls_dd03p> TYPE dd03p. * remove nested structures DELETE ct_dd03p WHERE depth <> '00'. * remove fields from .INCLUDEs DELETE ct_dd03p WHERE adminfield <> '0'. LOOP AT ct_dd03p ASSIGNING <ls_dd03p> WHERE NOT rollname IS INITIAL. clear_dd03p_fields_common( CHANGING cs_dd03p = <ls_dd03p> ). lv_masklen = <ls_dd03p>-masklen. IF lv_masklen = '' OR NOT lv_masklen CO '0123456789'. * make sure the field contains valid data, or the XML will dump CLEAR <ls_dd03p>-masklen. ENDIF. IF <ls_dd03p>-comptype = lc_comptype_dataelement. clear_dd03p_fields_dataelement( CHANGING cs_dd03p = <ls_dd03p> ). ENDIF. IF <ls_dd03p>-shlporigin = 'D'. * search help from domain CLEAR: <ls_dd03p>-shlpfield, <ls_dd03p>-shlpname. ENDIF. * XML output assumes correct field content IF <ls_dd03p>-routputlen = ' '. CLEAR <ls_dd03p>-routputlen. ENDIF. ENDLOOP. " Clear position to avoid issues with include structures that contain different number of fields LOOP AT ct_dd03p ASSIGNING <ls_dd03p>. CLEAR: <ls_dd03p>-position, <ls_dd03p>-tabname, <ls_dd03p>-ddlanguage. ENDLOOP. ENDMETHOD. METHOD clear_dd03p_fields_common. CLEAR: cs_dd03p-ddlanguage, cs_dd03p-dtelmaster, cs_dd03p-logflag, cs_dd03p-ddtext, cs_dd03p-reservedte, cs_dd03p-reptext, cs_dd03p-scrtext_s, cs_dd03p-scrtext_m, cs_dd03p-scrtext_l. ENDMETHOD. METHOD clear_dd03p_fields_dataelement. * type specified via data element CLEAR: cs_dd03p-domname, cs_dd03p-inttype, cs_dd03p-intlen, cs_dd03p-mask, cs_dd03p-memoryid, cs_dd03p-headlen, cs_dd03p-scrlen1, cs_dd03p-scrlen2, cs_dd03p-scrlen3, cs_dd03p-datatype, cs_dd03p-leng, cs_dd03p-outputlen, cs_dd03p-deffdname, cs_dd03p-convexit, cs_dd03p-entitytab, cs_dd03p-dommaster, cs_dd03p-domname3l, cs_dd03p-decimals, cs_dd03p-lowercase, cs_dd03p-signflag. ENDMETHOD. METHOD delete_extras. DELETE FROM tddat WHERE tabname = iv_tabname. ENDMETHOD. METHOD delete_idoc_segment. DATA lv_segment_type TYPE edilsegtyp. DATA lv_result LIKE sy-subrc. IF is_idoc_segment( ) = abap_false. rv_deleted = abap_false. RETURN. "previous XML version or no IDoc segment ENDIF. rv_deleted = abap_true. lv_segment_type = ms_item-obj_name. CALL FUNCTION 'SEGMENT_DELETE' EXPORTING segmenttyp = lv_segment_type IMPORTING result = lv_result EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0 OR lv_result <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDMETHOD. METHOD deserialize_idoc_segment. DATA lv_result LIKE sy-subrc. DATA lt_segment_definitions TYPE ty_segment_definitions. DATA lv_package TYPE devclass. DATA lv_uname TYPE sy-uname. FIELD-SYMBOLS <ls_segment_definition> TYPE ty_segment_definition. rv_deserialized = abap_false. TRY. io_xml->read( EXPORTING iv_name = c_s_dataname-segment_definition CHANGING cg_data = lt_segment_definitions ). CATCH zcx_abapgit_exception. RETURN. "previous XML version or no IDoc segment ENDTRY. IF lines( lt_segment_definitions ) = 0. RETURN. "no IDoc segment ENDIF. rv_deserialized = abap_true. lv_package = iv_package. LOOP AT lt_segment_definitions ASSIGNING <ls_segment_definition>. <ls_segment_definition>-segmentheader-presp = <ls_segment_definition>-segmentheader-pwork = cl_abap_syst=>get_user_name( ). CALL FUNCTION 'SEGMENT_READ' EXPORTING segmenttyp = <ls_segment_definition>-segmentheader-segtyp IMPORTING result = lv_result EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0 OR lv_result <> 0. CALL FUNCTION 'SEGMENT_CREATE' IMPORTING segmentdefinition = <ls_segment_definition>-segmentdefinition TABLES segmentstructure = <ls_segment_definition>-segmentstructures CHANGING segmentheader = <ls_segment_definition>-segmentheader devclass = lv_package EXCEPTIONS OTHERS = 1. ELSE. CALL FUNCTION 'SEGMENT_MODIFY' CHANGING segmentheader = <ls_segment_definition>-segmentheader devclass = lv_package EXCEPTIONS OTHERS = 1. IF sy-subrc = 0. CALL FUNCTION 'SEGMENTDEFINITION_MODIFY' TABLES segmentstructure = <ls_segment_definition>-segmentstructures CHANGING segmentdefinition = <ls_segment_definition>-segmentdefinition EXCEPTIONS OTHERS = 1. ENDIF. ENDIF. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDLOOP. lv_uname = cl_abap_syst=>get_user_name( ). CALL FUNCTION 'TR_TADIR_INTERFACE' EXPORTING wi_test_modus = abap_false wi_tadir_pgmid = 'R3TR' wi_tadir_object = ms_item-obj_type wi_tadir_obj_name = ms_item-obj_name wi_tadir_author = lv_uname wi_tadir_devclass = iv_package wi_tadir_masterlang = mv_language iv_set_edtflag = abap_true iv_delflag = abap_false EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDMETHOD. METHOD deserialize_indexes. DATA: lv_tname TYPE trobj_name, lt_dd12v TYPE dd12vtab, ls_dd12v LIKE LINE OF lt_dd12v, lt_dd17v TYPE dd17vtab, ls_dd17v LIKE LINE OF lt_dd17v, lt_secondary LIKE lt_dd17v. io_xml->read( EXPORTING iv_name = 'DD12V' CHANGING cg_data = lt_dd12v ). io_xml->read( EXPORTING iv_name = 'DD17V' CHANGING cg_data = lt_dd17v ). LOOP AT lt_dd12v INTO ls_dd12v. * todo, call corr_insert? CLEAR lt_secondary. LOOP AT lt_dd17v INTO ls_dd17v WHERE sqltab = ls_dd12v-sqltab AND indexname = ls_dd12v-indexname. APPEND ls_dd17v TO lt_secondary. ENDLOOP. CALL FUNCTION 'DDIF_INDX_PUT' EXPORTING name = ls_dd12v-sqltab id = ls_dd12v-indexname dd12v_wa = ls_dd12v TABLES dd17v_tab = lt_secondary EXCEPTIONS indx_not_found = 1 name_inconsistent = 2 indx_inconsistent = 3 put_failure = 4 put_refused = 5 OTHERS = 6. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. CALL FUNCTION 'DD_DD_TO_E071' EXPORTING type = 'INDX' name = ls_dd12v-sqltab id = ls_dd12v-indexname IMPORTING obj_name = lv_tname. zcl_abapgit_objects_activation=>add( iv_type = 'INDX' iv_name = lv_tname ). ENDLOOP. ENDMETHOD. METHOD deserialize_texts. DATA: lv_name TYPE ddobjname, ls_dd02v_tmp TYPE dd02v, lt_i18n_langs TYPE TABLE OF langu, lt_dd02_texts TYPE ty_dd02_texts. FIELD-SYMBOLS: <lv_lang> LIKE LINE OF lt_i18n_langs, <ls_dd02_text> LIKE LINE OF lt_dd02_texts. lv_name = ms_item-obj_name. io_xml->read( EXPORTING iv_name = 'I18N_LANGS' CHANGING cg_data = lt_i18n_langs ). io_xml->read( EXPORTING iv_name = 'DD02_TEXTS' CHANGING cg_data = lt_dd02_texts ). SORT lt_i18n_langs. SORT lt_dd02_texts BY ddlanguage. " Optimization LOOP AT lt_i18n_langs ASSIGNING <lv_lang>. " Table description ls_dd02v_tmp = is_dd02v. READ TABLE lt_dd02_texts ASSIGNING <ls_dd02_text> WITH KEY ddlanguage = <lv_lang>. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |DD02_TEXTS cannot find lang { <lv_lang> } in XML| ). ENDIF. MOVE-CORRESPONDING <ls_dd02_text> TO ls_dd02v_tmp. CALL FUNCTION 'DDIF_TABL_PUT' EXPORTING name = lv_name dd02v_wa = ls_dd02v_tmp EXCEPTIONS tabl_not_found = 1 name_inconsistent = 2 tabl_inconsistent = 3 put_failure = 4 put_refused = 5 OTHERS = 6. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDLOOP. ENDMETHOD. METHOD is_db_table_category. " values from domain TABCLASS rv_is_db_table_type = boolc( iv_tabclass = 'TRANSP' OR iv_tabclass = 'CLUSTER' OR iv_tabclass = 'POOL' ). ENDMETHOD. METHOD is_idoc_segment. DATA lv_segment_type TYPE edilsegtyp. lv_segment_type = ms_item-obj_name. SELECT SINGLE segtyp FROM edisegment INTO lv_segment_type WHERE segtyp = lv_segment_type. rv_is_idoc_segment = boolc( sy-subrc = 0 ). ENDMETHOD. METHOD read_extras. SELECT SINGLE * FROM tddat INTO rs_tabl_extras-tddat WHERE tabname = iv_tabname. ENDMETHOD. METHOD serialize_idoc_segment. DATA lv_segment_type TYPE edilsegtyp. DATA lv_result LIKE sy-subrc. DATA lv_devclass TYPE devclass. DATA lt_segmentdefinitions TYPE STANDARD TABLE OF edisegmdef. DATA ls_segment_definition TYPE ty_segment_definition. DATA lt_segment_definitions TYPE ty_segment_definitions. FIELD-SYMBOLS: <ls_segemtndefinition> TYPE edisegmdef. IF is_idoc_segment( ) = abap_false. RETURN. ENDIF. lv_segment_type = ms_item-obj_name. CALL FUNCTION 'SEGMENT_READ' EXPORTING segmenttyp = lv_segment_type IMPORTING result = lv_result TABLES segmentdefinition = lt_segmentdefinitions EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0 OR lv_result <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. LOOP AT lt_segmentdefinitions ASSIGNING <ls_segemtndefinition>. CLEAR ls_segment_definition. CALL FUNCTION 'SEGMENTDEFINITION_READ' EXPORTING segmenttyp = <ls_segemtndefinition>-segtyp IMPORTING result = lv_result devclass = lv_devclass segmentheader = ls_segment_definition-segmentheader segmentdefinition = ls_segment_definition-segmentdefinition TABLES segmentstructure = ls_segment_definition-segmentstructures CHANGING version = <ls_segemtndefinition>-version EXCEPTIONS no_authority = 1 segment_not_existing = 2 OTHERS = 3. IF sy-subrc <> 0 OR lv_result <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. zcl_abapgit_object_idoc=>clear_idoc_segement_fields( CHANGING cg_structure = ls_segment_definition-segmentdefinition ). zcl_abapgit_object_idoc=>clear_idoc_segement_fields( CHANGING cg_structure = ls_segment_definition-segmentheader ). APPEND ls_segment_definition TO lt_segment_definitions. ENDLOOP. io_xml->add( iv_name = c_s_dataname-segment_definition ig_data = lt_segment_definitions ). ENDMETHOD. METHOD serialize_texts. DATA: lv_name TYPE ddobjname, lv_index TYPE i, ls_dd02v TYPE dd02v, lt_dd02_texts TYPE ty_dd02_texts, lt_i18n_langs TYPE TABLE OF langu. FIELD-SYMBOLS: <lv_lang> LIKE LINE OF lt_i18n_langs, <ls_dd02_text> LIKE LINE OF lt_dd02_texts. IF io_xml->i18n_params( )-main_language_only = abap_true. RETURN. ENDIF. lv_name = ms_item-obj_name. " Collect additional languages, skip main lang - it was serialized already SELECT DISTINCT ddlanguage AS langu INTO TABLE lt_i18n_langs FROM dd02v WHERE tabname = lv_name AND ddlanguage <> mv_language. "#EC CI_SUBRC LOOP AT lt_i18n_langs ASSIGNING <lv_lang>. lv_index = sy-tabix. CALL FUNCTION 'DDIF_TABL_GET' EXPORTING name = lv_name langu = <lv_lang> IMPORTING dd02v_wa = ls_dd02v EXCEPTIONS illegal_input = 1 OTHERS = 2. IF sy-subrc <> 0 OR ls_dd02v-ddlanguage IS INITIAL. DELETE lt_i18n_langs INDEX lv_index. " Don't save this lang CONTINUE. ENDIF. APPEND INITIAL LINE TO lt_dd02_texts ASSIGNING <ls_dd02_text>. MOVE-CORRESPONDING ls_dd02v TO <ls_dd02_text>. ENDLOOP. SORT lt_i18n_langs ASCENDING. SORT lt_dd02_texts BY ddlanguage ASCENDING. IF lines( lt_i18n_langs ) > 0. io_xml->add( iv_name = 'I18N_LANGS' ig_data = lt_i18n_langs ). io_xml->add( iv_name = 'DD02_TEXTS' ig_data = lt_dd02_texts ). ENDIF. ENDMETHOD. METHOD update_extras. IF is_tabl_extras-tddat IS INITIAL. delete_extras( iv_tabname ). ELSE. MODIFY tddat FROM is_tabl_extras-tddat. ENDIF. ENDMETHOD. METHOD zif_abapgit_object~changed_by. TYPES: BEGIN OF ty_data, as4user TYPE dd02l-as4user, as4date TYPE dd02l-as4date, as4time TYPE dd02l-as4time, END OF ty_data. DATA: lt_data TYPE STANDARD TABLE OF ty_data WITH DEFAULT KEY, ls_data LIKE LINE OF lt_data. SELECT as4user as4date as4time FROM dd02l INTO TABLE lt_data WHERE tabname = ms_item-obj_name AND as4local = 'A' AND as4vers = '0000'. SELECT as4user as4date as4time APPENDING TABLE lt_data FROM dd09l WHERE tabname = ms_item-obj_name AND as4local = 'A' AND as4vers = '0000'. SELECT as4user as4date as4time APPENDING TABLE lt_data FROM dd12l WHERE sqltab = ms_item-obj_name AND as4local = 'A' AND as4vers = '0000'. SORT lt_data BY as4date DESCENDING as4time DESCENDING. READ TABLE lt_data INDEX 1 INTO ls_data. IF sy-subrc = 0. rv_user = ls_data-as4user. ELSE. rv_user = c_user_unknown. ENDIF. ENDMETHOD. METHOD zif_abapgit_object~delete. DATA: lv_objname TYPE rsedd0-ddobjname, lv_no_ask TYPE abap_bool, lv_subrc TYPE sy-subrc, BEGIN OF ls_dd02l, tabname TYPE dd02l-tabname, tabclass TYPE dd02l-tabclass, sqltab TYPE dd02l-sqltab, END OF ls_dd02l. IF zif_abapgit_object~exists( ) = abap_false. " Proxies e.g. delete on its own, nothing todo here then. RETURN. ENDIF. lv_objname = ms_item-obj_name. IF delete_idoc_segment( ) = abap_false. lv_no_ask = abap_true. SELECT SINGLE tabname tabclass sqltab FROM dd02l INTO CORRESPONDING FIELDS OF ls_dd02l WHERE tabname = ms_item-obj_name AND as4local = 'A' AND as4vers = '0000'. IF sy-subrc = 0 AND is_db_table_category( ls_dd02l-tabclass ) = abap_true. CALL FUNCTION 'DD_EXISTS_DATA' EXPORTING reftab = ls_dd02l-sqltab tabclass = ls_dd02l-tabclass tabname = ls_dd02l-tabname IMPORTING subrc = lv_subrc EXCEPTIONS missing_reftab = 1 sql_error = 2 buffer_overflow = 3 unknown_error = 4 OTHERS = 5. IF sy-subrc = 0 AND lv_subrc = 0. lv_no_ask = abap_false. ENDIF. ENDIF. delete_ddic( iv_objtype = 'T' iv_no_ask = lv_no_ask ). delete_longtexts( c_longtext_id_tabl ). delete_extras( lv_objname ). ENDIF. ENDMETHOD. METHOD zif_abapgit_object~deserialize. DATA: lv_name TYPE ddobjname, ls_dd02v TYPE dd02v, ls_dd09l TYPE dd09l, lt_dd03p TYPE TABLE OF dd03p, lt_dd05m TYPE TABLE OF dd05m, lt_dd08v TYPE TABLE OF dd08v, lt_dd35v TYPE TABLE OF dd35v, lt_dd36m TYPE dd36mttyp, lv_refs TYPE abap_bool, ls_extras TYPE ty_tabl_extras. FIELD-SYMBOLS: <ls_dd03p> TYPE dd03p, <ls_dd05m> TYPE dd05m, <ls_dd08v> TYPE dd08v, <ls_dd35v> TYPE dd35v, <ls_dd36m> TYPE dd36m, <lg_roworcolst> TYPE any. lv_name = ms_item-obj_name. " type conversion IF deserialize_idoc_segment( io_xml = io_xml iv_package = iv_package ) = abap_false. io_xml->read( EXPORTING iv_name = 'DD02V' CHANGING cg_data = ls_dd02v ). io_xml->read( EXPORTING iv_name = 'DD09L' CHANGING cg_data = ls_dd09l ). io_xml->read( EXPORTING iv_name = 'DD03P_TABLE' CHANGING cg_data = lt_dd03p ). ASSIGN COMPONENT 'ROWORCOLST' OF STRUCTURE ls_dd09l TO <lg_roworcolst>. IF sy-subrc = 0 AND <lg_roworcolst> IS INITIAL. <lg_roworcolst> = 'C'. "Reverse fix from serialize ENDIF. " DDIC Step: Replace REF TO class/interface with generic reference to avoid cyclic dependency LOOP AT lt_dd03p ASSIGNING <ls_dd03p> WHERE datatype = 'REF'. IF iv_step = zif_abapgit_object=>gc_step_id-ddic. <ls_dd03p>-rollname = 'OBJECT'. ELSE. lv_refs = abap_true. ENDIF. ENDLOOP. " Number fields sequentially and fill table name LOOP AT lt_dd03p ASSIGNING <ls_dd03p>. <ls_dd03p>-position = sy-tabix. <ls_dd03p>-tabname = lv_name. <ls_dd03p>-ddlanguage = mv_language. ENDLOOP. io_xml->read( EXPORTING iv_name = 'DD05M_TABLE' CHANGING cg_data = lt_dd05m ). io_xml->read( EXPORTING iv_name = 'DD08V_TABLE' CHANGING cg_data = lt_dd08v ). io_xml->read( EXPORTING iv_name = 'DD35V_TALE' CHANGING cg_data = lt_dd35v ). io_xml->read( EXPORTING iv_name = 'DD36M' CHANGING cg_data = lt_dd36m ). LOOP AT lt_dd05m ASSIGNING <ls_dd05m>. <ls_dd05m>-tabname = lv_name. ENDLOOP. LOOP AT lt_dd08v ASSIGNING <ls_dd08v>. <ls_dd08v>-tabname = lv_name. <ls_dd08v>-ddlanguage = mv_language. ENDLOOP. LOOP AT lt_dd35v ASSIGNING <ls_dd35v>. <ls_dd35v>-tabname = lv_name. ENDLOOP. LOOP AT lt_dd36m ASSIGNING <ls_dd36m>. <ls_dd36m>-tabname = lv_name. ENDLOOP. " DDIC Step: Remove references to search helps and foreign keys IF iv_step = zif_abapgit_object=>gc_step_id-ddic. CLEAR: lt_dd08v, lt_dd35v, lt_dd36m. ENDIF. IF iv_step = zif_abapgit_object=>gc_step_id-late AND lv_refs = abap_false AND lines( lt_dd35v ) = 0 AND lines( lt_dd08v ) = 0. RETURN. " already active ENDIF. corr_insert( iv_package = iv_package ig_object_class = 'DICT' ). CALL FUNCTION 'DDIF_TABL_PUT' EXPORTING name = lv_name dd02v_wa = ls_dd02v dd09l_wa = ls_dd09l TABLES dd03p_tab = lt_dd03p dd05m_tab = lt_dd05m dd08v_tab = lt_dd08v dd35v_tab = lt_dd35v dd36m_tab = lt_dd36m EXCEPTIONS tabl_not_found = 1 name_inconsistent = 2 tabl_inconsistent = 3 put_failure = 4 put_refused = 5 OTHERS = 6. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. zcl_abapgit_objects_activation=>add_item( ms_item ). deserialize_indexes( io_xml ). deserialize_texts( io_xml = io_xml is_dd02v = ls_dd02v ). deserialize_longtexts( io_xml ). io_xml->read( EXPORTING iv_name = c_s_dataname-tabl_extras CHANGING cg_data = ls_extras ). update_extras( iv_tabname = lv_name is_tabl_extras = ls_extras ). ENDIF. ENDMETHOD. METHOD zif_abapgit_object~exists. DATA: lv_tabname TYPE dd02l-tabname. lv_tabname = ms_item-obj_name. " Check nametab because it's fast CALL FUNCTION 'DD_GET_NAMETAB_HEADER' EXPORTING tabname = lv_tabname EXCEPTIONS not_found = 1 OTHERS = 2. IF sy-subrc <> 0. " Check for new, inactive, or modified versions that might not be in nametab SELECT SINGLE tabname FROM dd02l INTO lv_tabname WHERE tabname = lv_tabname. ENDIF. rv_bool = boolc( sy-subrc = 0 ). ENDMETHOD. METHOD zif_abapgit_object~get_comparator. DATA: li_local_version_output TYPE REF TO zif_abapgit_xml_output, li_local_version_input TYPE REF TO zif_abapgit_xml_input. CREATE OBJECT li_local_version_output TYPE zcl_abapgit_xml_output. zif_abapgit_object~serialize( li_local_version_output ). CREATE OBJECT li_local_version_input TYPE zcl_abapgit_xml_input EXPORTING iv_xml = li_local_version_output->render( ). CREATE OBJECT ri_comparator TYPE zcl_abapgit_object_tabl_compar EXPORTING ii_local = li_local_version_input. ENDMETHOD. METHOD zif_abapgit_object~get_deserialize_steps. APPEND zif_abapgit_object=>gc_step_id-ddic TO rt_steps. APPEND zif_abapgit_object=>gc_step_id-late TO rt_steps. ENDMETHOD. METHOD zif_abapgit_object~get_metadata. rs_metadata = get_metadata( ). rs_metadata-ddic = abap_true. ENDMETHOD. METHOD zif_abapgit_object~is_active. rv_active = is_active( ). ENDMETHOD. METHOD zif_abapgit_object~is_locked. rv_is_locked = exists_a_lock_entry_for( iv_lock_object = 'ESDICT' iv_argument = |{ ms_item-obj_type }{ ms_item-obj_name }| ). ENDMETHOD. METHOD zif_abapgit_object~jump. jump_se11( ). ENDMETHOD. METHOD zif_abapgit_object~serialize. DATA: lv_name TYPE ddobjname, ls_dd02v TYPE dd02v, ls_dd09l TYPE dd09l, lt_dd03p TYPE ty_dd03p_tt, lt_dd05m TYPE TABLE OF dd05m, lt_dd08v TYPE TABLE OF dd08v, lt_dd12v TYPE dd12vtab, lt_dd17v TYPE dd17vtab, lt_dd35v TYPE TABLE OF dd35v, lv_index LIKE sy-index, lt_dd36m TYPE dd36mttyp, ls_extras TYPE ty_tabl_extras. FIELD-SYMBOLS: <ls_dd12v> LIKE LINE OF lt_dd12v, <ls_dd05m> LIKE LINE OF lt_dd05m, <ls_dd08v> LIKE LINE OF lt_dd08v, <ls_dd35v> LIKE LINE OF lt_dd35v, <ls_dd36m> LIKE LINE OF lt_dd36m, <lg_roworcolst> TYPE any. lv_name = ms_item-obj_name. CALL FUNCTION 'DDIF_TABL_GET' EXPORTING name = lv_name langu = mv_language IMPORTING dd02v_wa = ls_dd02v dd09l_wa = ls_dd09l TABLES dd03p_tab = lt_dd03p dd05m_tab = lt_dd05m dd08v_tab = lt_dd08v dd12v_tab = lt_dd12v dd17v_tab = lt_dd17v dd35v_tab = lt_dd35v dd36m_tab = lt_dd36m EXCEPTIONS illegal_input = 1 OTHERS = 2. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'error from DDIF_TABL_GET' ). ENDIF. IF ls_dd02v IS INITIAL. RETURN. " object does not exits ENDIF. CLEAR: ls_dd02v-as4user, ls_dd02v-as4date, ls_dd02v-as4time. * reset numeric field, so XML does not crash IF ls_dd02v-prozpuff = ''. CLEAR ls_dd02v-prozpuff. ENDIF. IF ls_dd02v-datmin = ''. CLEAR ls_dd02v-datmin. ENDIF. IF ls_dd02v-datmax = ''. CLEAR ls_dd02v-datmax. ENDIF. IF ls_dd02v-datavg = ''. CLEAR ls_dd02v-datavg. ENDIF. CLEAR: ls_dd09l-as4user, ls_dd09l-as4date, ls_dd09l-as4time. ASSIGN COMPONENT 'ROWORCOLST' OF STRUCTURE ls_dd09l TO <lg_roworcolst>. IF sy-subrc = 0 AND <lg_roworcolst> = 'C'. CLEAR <lg_roworcolst>. "To avoid diff errors. This field doesn't exists in all releases ENDIF. LOOP AT lt_dd12v ASSIGNING <ls_dd12v>. CLEAR: <ls_dd12v>-as4user, <ls_dd12v>-as4date, <ls_dd12v>-as4time. ENDLOOP. clear_dd03p_fields( CHANGING ct_dd03p = lt_dd03p ). * remove foreign keys inherited from .INCLUDEs DELETE lt_dd08v WHERE noinherit = 'N'. LOOP AT lt_dd05m ASSIGNING <ls_dd05m>. 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.
29.694393
106
0.615869
12546fe37d2f6cb502ced8dcf25539045a317111
5,537
abap
ABAP
src/objects/core/zcl_abapgit_objects_check.clas.testclasses.abap
Manny27nyc/abapGit
dc51247e9b8c0c792193aba857ec31df3a82db4a
[ "MIT" ]
797
2015-02-06T15:38:41.000Z
2020-09-23T02:57:02.000Z
src/objects/core/zcl_abapgit_objects_check.clas.testclasses.abap
Manny27nyc/abapGit
dc51247e9b8c0c792193aba857ec31df3a82db4a
[ "MIT" ]
2,776
2015-01-13T03:59:55.000Z
2020-09-23T21:46:34.000Z
src/objects/core/zcl_abapgit_objects_check.clas.testclasses.abap
Manny27nyc/abapGit
dc51247e9b8c0c792193aba857ec31df3a82db4a
[ "MIT" ]
499
2015-01-13T03:41:36.000Z
2020-09-22T11:50:54.000Z
CLASS ltcl_warning_overwrite_find DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS. PRIVATE SECTION. DATA: mo_objects TYPE REF TO zcl_abapgit_objects_check, mt_result TYPE zif_abapgit_definitions=>ty_results_tt, ms_overwrite TYPE zif_abapgit_definitions=>ty_overwrite, mt_overwrite TYPE zif_abapgit_definitions=>ty_overwrite_tt. METHODS: setup, warning_overwrite_find_00 FOR TESTING RAISING cx_static_check, warning_overwrite_find_01 FOR TESTING RAISING cx_static_check, warning_overwrite_find_02 FOR TESTING RAISING cx_static_check, warning_overwrite_find_03 FOR TESTING RAISING cx_static_check, warning_overwrite_find_04 FOR TESTING RAISING cx_static_check, warning_overwrite_find_05 FOR TESTING RAISING cx_static_check, warning_overwrite_find_06 FOR TESTING RAISING cx_static_check, given_result IMPORTING iv_result_line TYPE string, when_warning_overwrite_find. ENDCLASS. CLASS zcl_abapgit_objects_check DEFINITION LOCAL FRIENDS ltcl_warning_overwrite_find. CLASS ltcl_warning_overwrite_find IMPLEMENTATION. METHOD setup. CREATE OBJECT mo_objects. ENDMETHOD. METHOD warning_overwrite_find_00. " no changes -> nothing to do given_result( |CLAS;ZAG_UNIT_TEST;;/src/;zag_unit_test.clas.abap;;;;| ). when_warning_overwrite_find( ). cl_abap_unit_assert=>assert_equals( exp = 0 act = lines( mt_overwrite ) ). ENDMETHOD. METHOD warning_overwrite_find_01. " change remote but not local -> update given_result( |CLAS;ZAG_UNIT_TEST;;/src/;zag_unit_test.clas.abap;;;;M| ). when_warning_overwrite_find( ). cl_abap_unit_assert=>assert_equals( exp = 1 act = lines( mt_overwrite ) ). READ TABLE mt_overwrite INTO ms_overwrite INDEX 1. ASSERT sy-subrc = 0. cl_abap_unit_assert=>assert_equals( exp = zif_abapgit_objects=>c_deserialize_action-update act = ms_overwrite-action ). ENDMETHOD. METHOD warning_overwrite_find_02. " change remote and local -> overwrite given_result( |CLAS;ZAG_UNIT_TEST;;/src/;zag_unit_test.clas.abap;;;M;M| ). when_warning_overwrite_find( ). cl_abap_unit_assert=>assert_equals( exp = 1 act = lines( mt_overwrite ) ). READ TABLE mt_overwrite INTO ms_overwrite INDEX 1. ASSERT sy-subrc = 0. cl_abap_unit_assert=>assert_equals( exp = zif_abapgit_objects=>c_deserialize_action-overwrite act = ms_overwrite-action ). ENDMETHOD. METHOD warning_overwrite_find_03. " delete local -> add (since object will be created again from remote) given_result( |CLAS;ZAG_UNIT_TEST;;/src/;zag_unit_test.clas.abap;;;D;| ). when_warning_overwrite_find( ). cl_abap_unit_assert=>assert_equals( exp = 1 act = lines( mt_overwrite ) ). READ TABLE mt_overwrite INTO ms_overwrite INDEX 1. ASSERT sy-subrc = 0. cl_abap_unit_assert=>assert_equals( exp = zif_abapgit_objects=>c_deserialize_action-add act = ms_overwrite-action ). ENDMETHOD. METHOD warning_overwrite_find_04. " exists local but not remote -> delete " (object will be in confirmation popup: see zcl_abapgit_services_repo=>gui_deserialize) given_result( |CLAS;ZAG_UNIT_TEST;;/src/;zag_unit_test.clas.abap;;;A;| ). when_warning_overwrite_find( ). cl_abap_unit_assert=>assert_equals( exp = 1 act = lines( mt_overwrite ) ). READ TABLE mt_overwrite INTO ms_overwrite INDEX 1. ASSERT sy-subrc = 0. cl_abap_unit_assert=>assert_equals( exp = zif_abapgit_objects=>c_deserialize_action-delete act = ms_overwrite-action ). ENDMETHOD. METHOD warning_overwrite_find_05. " some part of object deleted remotely -> delete and recreate given_result( |CLAS;ZAG_UNIT_TEST;;/src/;zag_unit_test.clas.abap;;;;| ). given_result( |CLAS;ZAG_UNIT_TEST;;/src/;zag_unit_test.testclass.clas.abap;;;;D| ). when_warning_overwrite_find( ). cl_abap_unit_assert=>assert_equals( exp = 1 act = lines( mt_overwrite ) ). READ TABLE mt_overwrite INTO ms_overwrite INDEX 1. ASSERT sy-subrc = 0. cl_abap_unit_assert=>assert_equals( exp = zif_abapgit_objects=>c_deserialize_action-delete_add act = ms_overwrite-action ). ENDMETHOD. METHOD warning_overwrite_find_06. " changed package assignment given_result( |CLAS;ZAG_UNIT_TEST;;/src/;zag_unit_test.clas.abap;;;D;;X| ). given_result( |CLAS;ZAG_UNIT_TEST;;/src/sub;zag_unit_test.clas.abap;;;A;;X| ). when_warning_overwrite_find( ). cl_abap_unit_assert=>assert_equals( exp = 1 act = lines( mt_overwrite ) ). READ TABLE mt_overwrite INTO ms_overwrite INDEX 1. ASSERT sy-subrc = 0. cl_abap_unit_assert=>assert_equals( exp = zif_abapgit_objects=>c_deserialize_action-packmove act = ms_overwrite-action ). ENDMETHOD. METHOD given_result. DATA: ls_result LIKE LINE OF mt_result. SPLIT iv_result_line AT ';' INTO ls_result-obj_type ls_result-obj_name ls_result-inactive ls_result-path ls_result-filename ls_result-package ls_result-match ls_result-lstate ls_result-rstate ls_result-packmove. INSERT ls_result INTO TABLE mt_result. ENDMETHOD. METHOD when_warning_overwrite_find. mt_overwrite = mo_objects->warning_overwrite_find( mt_result ). ENDMETHOD. ENDCLASS.
27.009756
92
0.715008
1255fe685189d702e9673e966e684106a0541c8d
1,842
abap
ABAP
src/syntax/zcl_abapgit_syntax_xml.clas.testclasses.abap
DiscoveryConsulting/abapGit
437052cd6a32ddbd9a808730284c7f9f4ee100e7
[ "MIT" ]
null
null
null
src/syntax/zcl_abapgit_syntax_xml.clas.testclasses.abap
DiscoveryConsulting/abapGit
437052cd6a32ddbd9a808730284c7f9f4ee100e7
[ "MIT" ]
null
null
null
src/syntax/zcl_abapgit_syntax_xml.clas.testclasses.abap
DiscoveryConsulting/abapGit
437052cd6a32ddbd9a808730284c7f9f4ee100e7
[ "MIT" ]
null
null
null
CLASS abapgit_syntax_xml DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS. PRIVATE SECTION. DATA: mo_cut TYPE REF TO zcl_abapgit_syntax_xml. METHODS: setup, sole_closing_xml_tag FOR TESTING RAISING cx_static_check, complete_xml_tag FOR TESTING RAISING cx_static_check, complete_xml_tag_with_closing FOR TESTING RAISING cx_static_check, empty_attributes FOR TESTING RAISING cx_static_check. ENDCLASS. CLASS abapgit_syntax_xml IMPLEMENTATION. METHOD setup. CREATE OBJECT mo_cut. ENDMETHOD. METHOD sole_closing_xml_tag. cl_abap_unit_assert=>assert_equals( exp = |<span class="xml_tag">&gt;</span>| act = mo_cut->process_line( |>| ) ). ENDMETHOD. METHOD complete_xml_tag. cl_abap_unit_assert=>assert_equals( exp = |<span class="xml_tag">&lt;tag&gt;</span>| act = mo_cut->process_line( |<tag>| ) ). ENDMETHOD. METHOD complete_xml_tag_with_closing. cl_abap_unit_assert=>assert_equals( exp = |<span class="xml_tag">&lt;tag/&gt;</span>| act = mo_cut->process_line( |<tag/>| ) ). ENDMETHOD. METHOD empty_attributes. cl_abap_unit_assert=>assert_equals( exp = |<span class="xml_tag">&lt;ECTD</span>| && |<span class="attr"> SAPRL</span>=| && |<span class="attr_val">&quot;751&quot;</span>| && |<span class="attr"> VERSION</span>=| && |<span class="attr_val">&quot;1.5&quot;</span>| && |<span class="attr"> DOWNLOADDATE</span>=<span class="attr_val">&quot;&quot;</span>| && |<span class="attr"> DOWNLOADTIME</span>=<span class="attr_val">&quot;&quot;</span>| && |<span class="xml_tag">&gt;</span>| act = mo_cut->process_line( |<ECTD SAPRL="751" VERSION="1.5" DOWNLOADDATE="" DOWNLOADTIME="">| ) ). ENDMETHOD. ENDCLASS.
27.492537
105
0.656895
12562da71c153a23cb708b2dfdd889c6f93bd040
11,285
abap
ABAP
src/zcl_excel_style_cond.clas.abap
gabrielros/abap2xlsx_ES
3f913357547d18a28f09aae122e5464079458ff7
[ "Apache-2.0" ]
null
null
null
src/zcl_excel_style_cond.clas.abap
gabrielros/abap2xlsx_ES
3f913357547d18a28f09aae122e5464079458ff7
[ "Apache-2.0" ]
null
null
null
src/zcl_excel_style_cond.clas.abap
gabrielros/abap2xlsx_ES
3f913357547d18a28f09aae122e5464079458ff7
[ "Apache-2.0" ]
null
null
null
class ZCL_EXCEL_STYLE_COND definition public final create public . public section. class ZCL_EXCEL_STYLE_CONDITIONAL definition load . *"* public components of class ZCL_EXCEL_STYLE_COND *"* do not include other source files here!!! constants C_CFVO_TYPE_FORMULA type ZEXCEL_CONDITIONAL_TYPE value 'formula'. "#EC NOTEXT constants C_CFVO_TYPE_MAX type ZEXCEL_CONDITIONAL_TYPE value 'max'. "#EC NOTEXT constants C_CFVO_TYPE_MIN type ZEXCEL_CONDITIONAL_TYPE value 'min'. "#EC NOTEXT constants C_CFVO_TYPE_NUMBER type ZEXCEL_CONDITIONAL_TYPE value 'num'. "#EC NOTEXT constants C_CFVO_TYPE_PERCENT type ZEXCEL_CONDITIONAL_TYPE value 'percent'. "#EC NOTEXT constants C_CFVO_TYPE_PERCENTILE type ZEXCEL_CONDITIONAL_TYPE value 'percentile'. "#EC NOTEXT constants C_ICONSET_3ARROWS type ZEXCEL_CONDITION_RULE_ICONSET value '3Arrows'. "#EC NOTEXT constants C_ICONSET_3ARROWSGRAY type ZEXCEL_CONDITION_RULE_ICONSET value '3ArrowsGray'. "#EC NOTEXT constants C_ICONSET_3FLAGS type ZEXCEL_CONDITION_RULE_ICONSET value '3Flags'. "#EC NOTEXT constants C_ICONSET_3SIGNS type ZEXCEL_CONDITION_RULE_ICONSET value '3Signs'. "#EC NOTEXT constants C_ICONSET_3SYMBOLS type ZEXCEL_CONDITION_RULE_ICONSET value '3Symbols'. "#EC NOTEXT constants C_ICONSET_3SYMBOLS2 type ZEXCEL_CONDITION_RULE_ICONSET value '3Symbols2'. "#EC NOTEXT constants C_ICONSET_3TRAFFICLIGHTS type ZEXCEL_CONDITION_RULE_ICONSET value ''. "#EC NOTEXT constants C_ICONSET_3TRAFFICLIGHTS2 type ZEXCEL_CONDITION_RULE_ICONSET value '3TrafficLights2'. "#EC NOTEXT constants C_ICONSET_4ARROWS type ZEXCEL_CONDITION_RULE_ICONSET value '4Arrows'. "#EC NOTEXT constants C_ICONSET_4ARROWSGRAY type ZEXCEL_CONDITION_RULE_ICONSET value '4ArrowsGray'. "#EC NOTEXT constants C_ICONSET_4RATING type ZEXCEL_CONDITION_RULE_ICONSET value '4Rating'. "#EC NOTEXT constants C_ICONSET_4REDTOBLACK type ZEXCEL_CONDITION_RULE_ICONSET value '4RedToBlack'. "#EC NOTEXT constants C_ICONSET_4TRAFFICLIGHTS type ZEXCEL_CONDITION_RULE_ICONSET value '4TrafficLights'. "#EC NOTEXT constants C_ICONSET_5ARROWS type ZEXCEL_CONDITION_RULE_ICONSET value '5Arrows'. "#EC NOTEXT constants C_ICONSET_5ARROWSGRAY type ZEXCEL_CONDITION_RULE_ICONSET value '5ArrowsGray'. "#EC NOTEXT constants C_ICONSET_5QUARTERS type ZEXCEL_CONDITION_RULE_ICONSET value '5Quarters'. "#EC NOTEXT constants C_ICONSET_5RATING type ZEXCEL_CONDITION_RULE_ICONSET value '5Rating'. "#EC NOTEXT constants C_OPERATOR_BEGINSWITH type ZEXCEL_CONDITION_OPERATOR value 'beginsWith'. "#EC NOTEXT constants C_OPERATOR_BETWEEN type ZEXCEL_CONDITION_OPERATOR value 'between'. "#EC NOTEXT constants C_OPERATOR_CONTAINSTEXT type ZEXCEL_CONDITION_OPERATOR value 'containsText'. "#EC NOTEXT constants C_OPERATOR_ENDSWITH type ZEXCEL_CONDITION_OPERATOR value 'endsWith'. "#EC NOTEXT constants C_OPERATOR_EQUAL type ZEXCEL_CONDITION_OPERATOR value 'equal'. "#EC NOTEXT constants C_OPERATOR_GREATERTHAN type ZEXCEL_CONDITION_OPERATOR value 'greaterThan'. "#EC NOTEXT constants C_OPERATOR_GREATERTHANOREQUAL type ZEXCEL_CONDITION_OPERATOR value 'greaterThanOrEqual'. "#EC NOTEXT constants C_OPERATOR_LESSTHAN type ZEXCEL_CONDITION_OPERATOR value 'lessThan'. "#EC NOTEXT constants C_OPERATOR_LESSTHANOREQUAL type ZEXCEL_CONDITION_OPERATOR value 'lessThanOrEqual'. "#EC NOTEXT constants C_OPERATOR_NONE type ZEXCEL_CONDITION_OPERATOR value ''. "#EC NOTEXT constants C_OPERATOR_NOTCONTAINS type ZEXCEL_CONDITION_OPERATOR value 'notContains'. "#EC NOTEXT constants C_OPERATOR_NOTEQUAL type ZEXCEL_CONDITION_OPERATOR value 'notEqual'. "#EC NOTEXT constants C_RULE_CELLIS type ZEXCEL_CONDITION_RULE value 'cellIs'. "#EC NOTEXT constants C_RULE_CONTAINSTEXT type ZEXCEL_CONDITION_RULE value 'containsText'. "#EC NOTEXT constants C_RULE_DATABAR type ZEXCEL_CONDITION_RULE value 'dataBar'. "#EC NOTEXT constants C_RULE_EXPRESSION type ZEXCEL_CONDITION_RULE value 'expression'. "#EC NOTEXT constants C_RULE_ICONSET type ZEXCEL_CONDITION_RULE value 'iconSet'. "#EC NOTEXT constants C_RULE_COLORSCALE type ZEXCEL_CONDITION_RULE value 'colorScale'. "#EC NOTEXT constants C_RULE_NONE type ZEXCEL_CONDITION_RULE value 'none'. "#EC NOTEXT constants C_RULE_TOP10 type ZEXCEL_CONDITION_RULE value 'top10'. "#EC NOTEXT constants C_RULE_ABOVE_AVERAGE type ZEXCEL_CONDITION_RULE value 'aboveAverage'. "#EC NOTEXT constants C_SHOWVALUE_FALSE type ZEXCEL_CONDITIONAL_SHOW_VALUE value 0. "#EC NOTEXT constants C_SHOWVALUE_TRUE type ZEXCEL_CONDITIONAL_SHOW_VALUE value 1. "#EC NOTEXT data MODE_CELLIS type ZEXCEL_CONDITIONAL_CELLIS . data MODE_COLORSCALE type ZEXCEL_CONDITIONAL_COLORSCALE . data MODE_DATABAR type ZEXCEL_CONDITIONAL_DATABAR . data MODE_EXPRESSION type ZEXCEL_CONDITIONAL_EXPRESSION . data MODE_ICONSET type ZEXCEL_CONDITIONAL_ICONSET . data MODE_TOP10 type ZEXCEL_CONDITIONAL_TOP10 . data MODE_ABOVE_AVERAGE type ZEXCEL_CONDITIONAL_ABOVE_AVG . data PRIORITY type ZEXCEL_STYLE_PRIORITY value 1. "#EC NOTEXT . . . . . . . . . . . . . . . . . . . . " . data RULE type ZEXCEL_CONDITION_RULE . methods CONSTRUCTOR importing !IP_GUID type ZEXCEL_CELL_STYLE optional . methods GET_DIMENSION_RANGE returning value(EP_DIMENSION_RANGE) type STRING . methods SET_RANGE importing !IP_START_ROW type ZEXCEL_CELL_ROW !IP_START_COLUMN type ZEXCEL_CELL_COLUMN_ALPHA !IP_STOP_ROW type ZEXCEL_CELL_ROW !IP_STOP_COLUMN type ZEXCEL_CELL_COLUMN_ALPHA . methods ADD_RANGE importing !IP_START_ROW type ZEXCEL_CELL_ROW !IP_START_COLUMN type ZEXCEL_CELL_COLUMN_ALPHA !IP_STOP_ROW type ZEXCEL_CELL_ROW !IP_STOP_COLUMN type ZEXCEL_CELL_COLUMN_ALPHA . class-methods FACTORY_COND_STYLE_ICONSET importing !IO_WORKSHEET type ref to ZCL_EXCEL_WORKSHEET !IV_ICON_TYPE type ZEXCEL_CONDITION_RULE_ICONSET default C_ICONSET_3TRAFFICLIGHTS2 !IV_CFVO1_TYPE type ZEXCEL_CONDITIONAL_TYPE default C_CFVO_TYPE_PERCENT !IV_CFVO1_VALUE type ZEXCEL_CONDITIONAL_VALUE optional !IV_CFVO2_TYPE type ZEXCEL_CONDITIONAL_TYPE default C_CFVO_TYPE_PERCENT !IV_CFVO2_VALUE type ZEXCEL_CONDITIONAL_VALUE optional !IV_CFVO3_TYPE type ZEXCEL_CONDITIONAL_TYPE default C_CFVO_TYPE_PERCENT !IV_CFVO3_VALUE type ZEXCEL_CONDITIONAL_VALUE optional !IV_CFVO4_TYPE type ZEXCEL_CONDITIONAL_TYPE default C_CFVO_TYPE_PERCENT !IV_CFVO4_VALUE type ZEXCEL_CONDITIONAL_VALUE optional !IV_CFVO5_TYPE type ZEXCEL_CONDITIONAL_TYPE default C_CFVO_TYPE_PERCENT !IV_CFVO5_VALUE type ZEXCEL_CONDITIONAL_VALUE optional !IV_SHOWVALUE type ZEXCEL_CONDITIONAL_SHOW_VALUE default ZCL_EXCEL_STYLE_COND=>C_SHOWVALUE_TRUE returning value(EO_STYLE_COND) type ref to ZCL_EXCEL_STYLE_COND . methods GET_GUID returning value(EP_GUID) type ZEXCEL_CELL_STYLE . *"* protected components of class ZABAP_EXCEL_STYLE_FONT *"* do not include other source files here!!! protected section. private section. data MV_RULE_RANGE type STRING . data GUID type ZEXCEL_CELL_STYLE . ENDCLASS. CLASS ZCL_EXCEL_STYLE_COND IMPLEMENTATION. METHOD ADD_RANGE. DATA: lv_column TYPE zexcel_cell_column, lv_row_alpha TYPE string, lv_col_alpha TYPE string, lv_coords1 TYPE string, lv_coords2 TYPE string. lv_column = zcl_excel_common=>convert_column2int( ip_start_column ). * me->mv_cell_data-cell_row = 1. * me->mv_cell_data-cell_column = lv_column. * lv_col_alpha = ip_start_column. lv_row_alpha = ip_start_row. SHIFT lv_row_alpha RIGHT DELETING TRAILING space. SHIFT lv_row_alpha LEFT DELETING LEADING space. CONCATENATE lv_col_alpha lv_row_alpha INTO lv_coords1. IF ip_stop_column IS NOT INITIAL. lv_column = zcl_excel_common=>convert_column2int( ip_stop_column ). ELSE. lv_column = zcl_excel_common=>convert_column2int( ip_start_column ). ENDIF. IF ip_stop_row IS NOT INITIAL. " If we don't get explicitly a stop column use start column lv_row_alpha = ip_stop_row. ELSE. lv_row_alpha = ip_start_row. ENDIF. IF ip_stop_column IS NOT INITIAL. " If we don't get explicitly a stop column use start column lv_col_alpha = ip_stop_column. ELSE. lv_col_alpha = ip_start_column. ENDIF. SHIFT lv_row_alpha RIGHT DELETING TRAILING space. SHIFT lv_row_alpha LEFT DELETING LEADING space. CONCATENATE lv_col_alpha lv_row_alpha INTO lv_coords2. IF lv_coords2 IS NOT INITIAL AND lv_coords2 <> lv_coords1. CONCATENATE me->mv_rule_range ` ` lv_coords1 ':' lv_coords2 INTO me->mv_rule_range. ELSE. CONCATENATE me->mv_rule_range ` ` lv_coords1 INTO me->mv_rule_range. ENDIF. SHIFT me->mv_rule_range LEFT DELETING LEADING space. ENDMETHOD. METHOD constructor. DATA: ls_iconset TYPE zexcel_conditional_iconset. ls_iconset-iconset = zcl_excel_style_cond=>c_iconset_3trafficlights. ls_iconset-cfvo1_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset-cfvo1_value = '0'. ls_iconset-cfvo2_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset-cfvo2_value = '20'. ls_iconset-cfvo3_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset-cfvo3_value = '40'. ls_iconset-cfvo4_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset-cfvo4_value = '60'. ls_iconset-cfvo5_type = zcl_excel_style_cond=>c_cfvo_type_percent. ls_iconset-cfvo5_value = '80'. me->rule = zcl_excel_style_cond=>c_rule_none. * me->iconset->operator = zcl_excel_style_conditional=>c_operator_none. me->mode_iconset = ls_iconset. me->priority = 1. * inizialize dimension range me->mv_rule_range = 'A1'. IF ip_guid IS NOT INITIAL. me->guid = ip_guid. ELSE. me->guid = zcl_excel_obsolete_func_wrap=>guid_create( ). ENDIF. ENDMETHOD. METHOD FACTORY_COND_STYLE_ICONSET. *--------------------------------------------------------------------* * Work in progress * Missing: LE or LT may be specified --> extend structure ZEXCEL_CONDITIONAL_ICONSET to hold this information as well *--------------------------------------------------------------------* * DATA: lv_needed_values TYPE i. * CASE icon_type. * * WHEN 'C_ICONSET_3ARROWS' * OR 'C_ICONSET_3ARROWSGRAY' * OR 'C_ICONSET_3FLAGS' * OR 'C_ICONSET_3SIGNS' * OR 'C_ICONSET_3SYMBOLS' * OR 'C_ICONSET_3SYMBOLS2' * OR 'C_ICONSET_3TRAFFICLIGHTS' * OR 'C_ICONSET_3TRAFFICLIGHTS2'. * lv_needed_values = 3. * * WHEN 'C_ICONSET_4ARROWS' * OR 'C_ICONSET_4ARROWSGRAY' * OR 'C_ICONSET_4RATING' * OR 'C_ICONSET_4REDTOBLACK' * OR 'C_ICONSET_4TRAFFICLIGHTS'. * lv_needed_values = 4. * * WHEN 'C_ICONSET_5ARROWS' * OR 'C_ICONSET_5ARROWSGRAY' * OR 'C_ICONSET_5QUARTERS' * OR 'C_ICONSET_5RATING'. * lv_needed_values = 5. * * WHEN OTHERS. * RETURN. * ENDCASE. ENDMETHOD. METHOD GET_DIMENSION_RANGE. ep_dimension_range = me->mv_rule_range. ENDMETHOD. METHOD GET_GUID. ep_guid = me->guid. ENDMETHOD. METHOD SET_RANGE. CLEAR: me->mv_rule_range. me->add_range( ip_start_row = ip_start_row ip_start_column = ip_start_column ip_stop_row = ip_stop_row ip_stop_column = ip_stop_column ). ENDMETHOD. ENDCLASS.
43.072519
126
0.775631
125925c044eb2e498802132531d5d393a310562b
2,790
abap
ABAP
src/objects/ycl_abapgit_object_enho_wdyc.clas.abap
abapGit/y-version
2c3a7e7d0f5abb860e34f8eb44e0c2170a0ccdfc
[ "MIT" ]
null
null
null
src/objects/ycl_abapgit_object_enho_wdyc.clas.abap
abapGit/y-version
2c3a7e7d0f5abb860e34f8eb44e0c2170a0ccdfc
[ "MIT" ]
null
null
null
src/objects/ycl_abapgit_object_enho_wdyc.clas.abap
abapGit/y-version
2c3a7e7d0f5abb860e34f8eb44e0c2170a0ccdfc
[ "MIT" ]
2
2019-11-24T20:35:16.000Z
2020-04-16T07:29:33.000Z
CLASS ycl_abapgit_object_enho_wdyc DEFINITION PUBLIC. PUBLIC SECTION. METHODS: constructor IMPORTING is_item TYPE yif_abapgit_definitions=>ty_item io_files TYPE REF TO ycl_abapgit_objects_files. INTERFACES: yif_abapgit_object_enho. PRIVATE SECTION. DATA: ms_item TYPE yif_abapgit_definitions=>ty_item. ENDCLASS. CLASS ycl_abapgit_object_enho_wdyc IMPLEMENTATION. METHOD constructor. ms_item = is_item. ENDMETHOD. METHOD yif_abapgit_object_enho~deserialize. DATA: lv_enhname TYPE enhname, lo_wdyconf TYPE REF TO cl_wdr_cfg_enhancement, li_tool TYPE REF TO if_enh_tool, ls_obj TYPE wdy_config_key, lv_package TYPE devclass. io_xml->read( EXPORTING iv_name = 'ORIGINAL_OBJECT' CHANGING cg_data = ls_obj ). lv_enhname = ms_item-obj_name. lv_package = iv_package. TRY. cl_enh_factory=>create_enhancement( EXPORTING enhname = lv_enhname enhtype = '' enhtooltype = cl_wdr_cfg_enhancement=>tooltype IMPORTING enhancement = li_tool CHANGING devclass = lv_package ). lo_wdyconf ?= li_tool. * todo * io_xml->read_xml() * CL_WDR_CFG_PERSISTENCE_UTILS=>COMP_XML_TO_TABLES( ) * lo_wdyconf->set_enhancement_data( ) ASSERT 0 = 1. lo_wdyconf->if_enh_object~save( ). lo_wdyconf->if_enh_object~unlock( ). CATCH cx_enh_root. ycx_abapgit_exception=>raise( 'error deserializing ENHO wdyconf' ). ENDTRY. ENDMETHOD. METHOD yif_abapgit_object_enho~serialize. DATA: lo_wdyconf TYPE REF TO cl_wdr_cfg_enhancement, lt_data TYPE wdy_cfg_expl_data_tab, ls_outline TYPE wdy_cfg_outline_data, ls_obj TYPE wdy_config_key, li_document TYPE REF TO if_ixml_document, li_element TYPE REF TO if_ixml_element. lo_wdyconf ?= ii_enh_tool. ls_obj = lo_wdyconf->get_original_object( ). io_xml->add( iv_name = 'TOOL' ig_data = ii_enh_tool->get_tool( ) ). io_xml->add( iv_name = 'ORIGINAL_OBJECT' ig_data = ls_obj ). * only works on new ABAP versions, parameters differ between versions CALL METHOD lo_wdyconf->('GET_ENHANCEMENT_DATA') EXPORTING p_scope = 1 IMPORTING p_enh_data = lt_data. CALL METHOD cl_wdr_cfg_persistence_utils=>('COMP_TABLES_TO_XML') EXPORTING outline_data = ls_outline expl_data_tab = lt_data IMPORTING element = li_element CHANGING document = li_document. io_xml->add_xml( iv_name = 'ENHANCEMENT_DATA' ii_xml = li_element ). ENDMETHOD. ENDCLASS.
27.623762
75
0.65448
12593150e61ce50cd1e2afa43aa13e22618400f7
3,558
abap
ABAP
abap/zewm_robco_order.fugr.zmove_who_to_error_queue.abap
durairajrajkumar/ewm-cloud-robotics
4bac5d52c9d019b09352c916cb058212552592c3
[ "Apache-2.0" ]
null
null
null
abap/zewm_robco_order.fugr.zmove_who_to_error_queue.abap
durairajrajkumar/ewm-cloud-robotics
4bac5d52c9d019b09352c916cb058212552592c3
[ "Apache-2.0" ]
null
null
null
abap/zewm_robco_order.fugr.zmove_who_to_error_queue.abap
durairajrajkumar/ewm-cloud-robotics
4bac5d52c9d019b09352c916cb058212552592c3
[ "Apache-2.0" ]
null
null
null
** ** 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 zmove_who_to_error_queue . *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" REFERENCE(IV_LGNUM) TYPE /SCWM/LGNUM *" REFERENCE(IS_RSRC) TYPE /SCWM/RSRC *" REFERENCE(IV_WHO) TYPE /SCWM/DE_WHO *" EXPORTING *" REFERENCE(EV_QUEUE) TYPE /SCWM/RSRC-QUEUE *" EXCEPTIONS *" ROBOT_NOT_FOUND *" WHO_NOT_FOUND *" WHO_LOCKED *" NO_ERROR_QUEUE *" QUEUE_NOT_CHANGED *"---------------------------------------------------------------------- data: ls_who type /scwm/s_who_int, lt_wo_rsrc_ty type /scwm/tt_wo_rsrc_ty, ls_wo_rsrc_ty type /scwm/wo_rsrc_ty, ls_attributes type /scwm/s_who_att, ls_t346 type /scwm/t346, lv_queue type /scwm/rsrc-queue, lc_x type xfeld value 'X'. * Check if warehouse order exists try. call function '/SCWM/WHO_SELECT' exporting iv_lgnum = iv_lgnum iv_who = iv_who iv_lock_who = abap_true importing es_who = ls_who. catch /scwm/cx_core. call function 'DEQUEUE_ALL'. raise who_locked. endtry. * Check if the warehouse order was found if ls_who is initial. raise who_not_found. endif. * Get error queue select single error_queue from zewm_trsrc_typ into @lv_queue where lgnum = @iv_lgnum and rsrc_type = @is_rsrc-rsrc_type. if sy-subrc <> 0. raise robot_not_found. endif. if lv_queue is initial. raise no_error_queue. endif. * Check queue call function '/SCWM/T346_READ_SINGLE' exporting iv_lgnum = iv_lgnum iv_queue = lv_queue importing es_t346 = ls_t346 exceptions not_found = 1 others = 2. if sy-subrc <> 0. raise queue_not_changed. endif. * Aggregate warehouse orders ls_wo_rsrc_ty-who = ls_who-who. append ls_wo_rsrc_ty to lt_wo_rsrc_ty. * Get index records for all WOs call function '/SCWM/RSRC_WHO_RSTYP_GET' exporting iv_lgnum = iv_lgnum iv_rfind = lc_x changing ct_wo_rsrc_ty = lt_wo_rsrc_ty. * Check whether each WHO has index records * If not raise an exception read table lt_wo_rsrc_ty into ls_wo_rsrc_ty with key who = ls_who-who. if ( ( sy-subrc ne 0 ) and ( ls_t346-rfrsrc = wmegc_rfrsrc_rs or ls_t346-rfrsrc = wmegc_rfrsrc_rf or ls_t346-rfrsrc = wmegc_rfrsrc_mfs_with_rsrc ) ). * No index records found. Queue cannot be changed raise queue_not_changed. endif. * Prepare warehouse order update move-corresponding ls_who to ls_attributes. ls_attributes-queue = lv_queue. ls_attributes-lsd = ls_who-lsd. call function '/SCWM/WHO_UPDATE' exporting iv_lgnum = iv_lgnum iv_db_update = 'X' iv_who = ls_who-who iv_queue = 'X' is_attributes = ls_attributes exceptions read_error = 1 attributes = 2 others = 3. * If error occurs raise exception if sy-subrc <> 0. rollback work. raise queue_not_changed. else. commit work. ev_queue = lv_queue. endif. endfunction.
26.75188
174
0.626757
125d342e0fdc1069fdf25cad0598ddb20d41b601
3,591
abap
ABAP
src/objects/enh/zcl_abapgit_object_enho_badi.clas.abap
Manny27nyc/abapGit
dc51247e9b8c0c792193aba857ec31df3a82db4a
[ "MIT" ]
797
2015-02-06T15:38:41.000Z
2020-09-23T02:57:02.000Z
src/objects/enh/zcl_abapgit_object_enho_badi.clas.abap
Manny27nyc/abapGit
dc51247e9b8c0c792193aba857ec31df3a82db4a
[ "MIT" ]
2,776
2015-01-13T03:59:55.000Z
2020-09-23T21:46:34.000Z
src/objects/enh/zcl_abapgit_object_enho_badi.clas.abap
Manny27nyc/abapGit
dc51247e9b8c0c792193aba857ec31df3a82db4a
[ "MIT" ]
499
2015-01-13T03:41:36.000Z
2020-09-22T11:50:54.000Z
CLASS zcl_abapgit_object_enho_badi DEFINITION PUBLIC. PUBLIC SECTION. METHODS: constructor IMPORTING is_item TYPE zif_abapgit_definitions=>ty_item. INTERFACES: zif_abapgit_object_enho. PROTECTED SECTION. PRIVATE SECTION. DATA: ms_item TYPE zif_abapgit_definitions=>ty_item. ENDCLASS. CLASS zcl_abapgit_object_enho_badi IMPLEMENTATION. METHOD constructor. ms_item = is_item. ENDMETHOD. METHOD zif_abapgit_object_enho~deserialize. DATA: lv_spot_name TYPE enhspotname, lv_shorttext TYPE string, lv_enhname TYPE enhname, lo_badi TYPE REF TO cl_enh_tool_badi_impl, li_tool TYPE REF TO if_enh_tool, lv_package TYPE devclass, lt_impl TYPE enh_badi_impl_data_it, lx_enh_root TYPE REF TO cx_enh_root. FIELD-SYMBOLS: <ls_impl> LIKE LINE OF lt_impl. ii_xml->read( EXPORTING iv_name = 'SHORTTEXT' CHANGING cg_data = lv_shorttext ). ii_xml->read( EXPORTING iv_name = 'SPOT_NAME' CHANGING cg_data = lv_spot_name ). ii_xml->read( EXPORTING iv_name = 'IMPL' CHANGING cg_data = lt_impl ). lv_enhname = ms_item-obj_name. lv_package = iv_package. TRY. cl_enh_factory=>create_enhancement( EXPORTING enhname = lv_enhname enhtype = cl_abstract_enh_tool_redef=>credefinition enhtooltype = cl_enh_tool_badi_impl=>tooltype IMPORTING enhancement = li_tool CHANGING devclass = lv_package ). lo_badi ?= li_tool. lo_badi->set_spot_name( lv_spot_name ). lo_badi->if_enh_object_docu~set_shorttext( lv_shorttext ). LOOP AT lt_impl ASSIGNING <ls_impl>. lo_badi->add_implementation( <ls_impl> ). ENDLOOP. lo_badi->if_enh_object~save( run_dark = abap_true ). lo_badi->if_enh_object~unlock( ). CATCH cx_enh_root INTO lx_enh_root. zcx_abapgit_exception=>raise_with_text( lx_enh_root ). ENDTRY. ENDMETHOD. METHOD zif_abapgit_object_enho~serialize. DATA: lo_badi_impl TYPE REF TO cl_enh_tool_badi_impl, lv_spot_name TYPE enhspotname, lv_shorttext TYPE string, lt_impl TYPE enh_badi_impl_data_it. FIELD-SYMBOLS: <ls_impl> LIKE LINE OF lt_impl, <ls_values> LIKE LINE OF <ls_impl>-filter_values, <ls_filter> LIKE LINE OF <ls_impl>-filters. lo_badi_impl ?= ii_enh_tool. lv_shorttext = lo_badi_impl->if_enh_object_docu~get_shorttext( ). lv_spot_name = lo_badi_impl->get_spot_name( ). lt_impl = lo_badi_impl->get_implementations( ). LOOP AT lt_impl ASSIGNING <ls_impl>. * make sure the XML serialization does not dump, field type = N LOOP AT <ls_impl>-filter_values ASSIGNING <ls_values>. IF <ls_values>-filter_numeric_value1 CA space. CLEAR <ls_values>-filter_numeric_value1. ENDIF. ENDLOOP. LOOP AT <ls_impl>-filters ASSIGNING <ls_filter>. IF <ls_filter>-filter_numeric_value1 CA space. CLEAR <ls_filter>-filter_numeric_value1. ENDIF. ENDLOOP. ENDLOOP. ii_xml->add( iv_name = 'TOOL' ig_data = ii_enh_tool->get_tool( ) ). ii_xml->add( ig_data = lv_shorttext iv_name = 'SHORTTEXT' ). ii_xml->add( iv_name = 'SPOT_NAME' ig_data = lv_spot_name ). ii_xml->add( iv_name = 'IMPL' ig_data = lt_impl ). ENDMETHOD. ENDCLASS.
30.956897
69
0.64773
125dc3af9271ae1de2154b2b983f420e31ffde5c
1,859
abap
ABAP
src/persist/zcl_abapgit_persist_settings.clas.abap
Manny27nyc/abapGit
dc51247e9b8c0c792193aba857ec31df3a82db4a
[ "MIT" ]
797
2015-02-06T15:38:41.000Z
2020-09-23T02:57:02.000Z
src/persist/zcl_abapgit_persist_settings.clas.abap
Manny27nyc/abapGit
dc51247e9b8c0c792193aba857ec31df3a82db4a
[ "MIT" ]
2,776
2015-01-13T03:59:55.000Z
2020-09-23T21:46:34.000Z
src/persist/zcl_abapgit_persist_settings.clas.abap
Manny27nyc/abapGit
dc51247e9b8c0c792193aba857ec31df3a82db4a
[ "MIT" ]
499
2015-01-13T03:41:36.000Z
2020-09-22T11:50:54.000Z
CLASS zcl_abapgit_persist_settings DEFINITION PUBLIC CREATE PRIVATE GLOBAL FRIENDS zcl_abapgit_persist_factory . PUBLIC SECTION. INTERFACES zif_abapgit_persist_settings . PROTECTED SECTION. PRIVATE SECTION. DATA mo_settings TYPE REF TO zcl_abapgit_settings . ENDCLASS. CLASS ZCL_ABAPGIT_PERSIST_SETTINGS IMPLEMENTATION. METHOD zif_abapgit_persist_settings~modify. DATA: lv_settings TYPE string, ls_user_settings TYPE zif_abapgit_definitions=>ty_s_user_settings. lv_settings = io_settings->get_settings_xml( ). zcl_abapgit_persistence_db=>get_instance( )->modify( iv_type = zcl_abapgit_persistence_db=>c_type_settings iv_value = '' iv_data = lv_settings ). ls_user_settings = io_settings->get_user_settings( ). zcl_abapgit_persistence_user=>get_instance( )->set_settings( ls_user_settings ). " Settings have been modified: Update Buffered Settings IF mo_settings IS BOUND. mo_settings->set_xml_settings( lv_settings ). mo_settings->set_user_settings( ls_user_settings ). ENDIF. ENDMETHOD. METHOD zif_abapgit_persist_settings~read. IF mo_settings IS BOUND. " Return Buffered Settings ro_settings = mo_settings. RETURN. ENDIF. " Settings have changed or have not yet been loaded CREATE OBJECT ro_settings. TRY. ro_settings->set_xml_settings( zcl_abapgit_persistence_db=>get_instance( )->read( iv_type = zcl_abapgit_persistence_db=>c_type_settings iv_value = '' ) ). ro_settings->set_user_settings( zcl_abapgit_persistence_user=>get_instance( )->get_settings( ) ). CATCH zcx_abapgit_not_found zcx_abapgit_exception. ro_settings->set_defaults( ). ENDTRY. mo_settings = ro_settings. ENDMETHOD. ENDCLASS.
24.460526
105
0.719742
125f1217ba4be227ba430a944def6639c27e260a
45,853
abap
ABAP
src/ui/zcl_abapgit_popups.clas.abap
g-back/abapGit
af15cbf73a6b04a95b3fc7f2eef0c4b4851c4371
[ "MIT" ]
null
null
null
src/ui/zcl_abapgit_popups.clas.abap
g-back/abapGit
af15cbf73a6b04a95b3fc7f2eef0c4b4851c4371
[ "MIT" ]
null
null
null
src/ui/zcl_abapgit_popups.clas.abap
g-back/abapGit
af15cbf73a6b04a95b3fc7f2eef0c4b4851c4371
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_popups DEFINITION PUBLIC FINAL CREATE PRIVATE GLOBAL FRIENDS zcl_abapgit_ui_factory. PUBLIC SECTION. INTERFACES: zif_abapgit_popups. ALIASES: popup_package_export FOR zif_abapgit_popups~popup_package_export, popup_folder_logic FOR zif_abapgit_popups~popup_folder_logic, popup_object FOR zif_abapgit_popups~popup_object, create_branch_popup FOR zif_abapgit_popups~create_branch_popup, repo_new_offline FOR zif_abapgit_popups~repo_new_offline, branch_list_popup FOR zif_abapgit_popups~branch_list_popup, repo_popup FOR zif_abapgit_popups~repo_popup, popup_to_confirm FOR zif_abapgit_popups~popup_to_confirm, popup_to_inform FOR zif_abapgit_popups~popup_to_inform, popup_to_create_package FOR zif_abapgit_popups~popup_to_create_package, popup_to_create_transp_branch FOR zif_abapgit_popups~popup_to_create_transp_branch, popup_to_select_transports FOR zif_abapgit_popups~popup_to_select_transports, popup_to_select_from_list FOR zif_abapgit_popups~popup_to_select_from_list, branch_popup_callback FOR zif_abapgit_popups~branch_popup_callback, package_popup_callback FOR zif_abapgit_popups~package_popup_callback, popup_transport_request FOR zif_abapgit_popups~popup_transport_request, popup_proxy_bypass FOR zif_abapgit_popups~popup_proxy_bypass. PROTECTED SECTION. PRIVATE SECTION. TYPES: ty_sval_tt TYPE STANDARD TABLE OF sval WITH DEFAULT KEY. CONSTANTS c_fieldname_selected TYPE lvc_fname VALUE `SELECTED` ##NO_TEXT. CONSTANTS c_answer_cancel TYPE c LENGTH 1 VALUE 'A' ##NO_TEXT. DATA mo_select_list_popup TYPE REF TO cl_salv_table . DATA mr_table TYPE REF TO data . DATA mv_cancel TYPE abap_bool VALUE abap_false. DATA mo_table_descr TYPE REF TO cl_abap_tabledescr . METHODS add_field IMPORTING !iv_tabname TYPE sval-tabname !iv_fieldname TYPE sval-fieldname !iv_fieldtext TYPE sval-fieldtext !iv_value TYPE clike DEFAULT '' !iv_field_attr TYPE sval-field_attr DEFAULT '' !iv_obligatory TYPE spo_obl OPTIONAL CHANGING !ct_fields TYPE ty_sval_tt . METHODS create_new_table IMPORTING !it_list TYPE STANDARD TABLE . METHODS get_selected_rows EXPORTING !et_list TYPE INDEX TABLE . METHODS on_select_list_link_click FOR EVENT link_click OF cl_salv_events_table IMPORTING !row !column . METHODS on_select_list_function_click FOR EVENT added_function OF cl_salv_events_table IMPORTING !e_salv_function . METHODS on_double_click FOR EVENT double_click OF cl_salv_events_table IMPORTING !row !column . METHODS extract_field_values IMPORTING it_fields TYPE ty_sval_tt EXPORTING ev_url TYPE abaptxt255-line ev_package TYPE tdevc-devclass ev_branch TYPE textl-line ev_display_name TYPE trm255-text ev_folder_logic TYPE string ev_ign_subpkg TYPE abap_bool ev_master_lang_only TYPE abap_bool. TYPES: ty_lt_fields TYPE STANDARD TABLE OF sval WITH DEFAULT KEY. METHODS _popup_3_get_values IMPORTING iv_popup_title TYPE string iv_no_value_check TYPE abap_bool DEFAULT abap_false EXPORTING ev_value_1 TYPE spo_value ev_value_2 TYPE spo_value ev_value_3 TYPE spo_value CHANGING ct_fields TYPE ty_lt_fields RAISING zcx_abapgit_exception. METHODS validate_folder_logic IMPORTING iv_folder_logic TYPE string RAISING zcx_abapgit_exception. ENDCLASS. CLASS zcl_abapgit_popups IMPLEMENTATION. METHOD add_field. FIELD-SYMBOLS: <ls_field> LIKE LINE OF ct_fields. APPEND INITIAL LINE TO ct_fields ASSIGNING <ls_field>. <ls_field>-tabname = iv_tabname. <ls_field>-fieldname = iv_fieldname. <ls_field>-fieldtext = iv_fieldtext. <ls_field>-value = iv_value. <ls_field>-field_attr = iv_field_attr. <ls_field>-field_obl = iv_obligatory. ENDMETHOD. METHOD create_new_table. " create and populate a table on the fly derived from " it_data with a select column DATA: lr_struct TYPE REF TO data, lt_components TYPE cl_abap_structdescr=>component_table, lo_struct_descr TYPE REF TO cl_abap_structdescr, lo_struct_descr2 TYPE REF TO cl_abap_structdescr. FIELD-SYMBOLS: <lt_table> TYPE STANDARD TABLE, <ls_component> TYPE abap_componentdescr, <lg_line> TYPE data, <lg_data> TYPE any. mo_table_descr ?= cl_abap_tabledescr=>describe_by_data( it_list ). lo_struct_descr ?= mo_table_descr->get_table_line_type( ). lt_components = lo_struct_descr->get_components( ). INSERT INITIAL LINE INTO lt_components ASSIGNING <ls_component> INDEX 1. ASSERT sy-subrc = 0. <ls_component>-name = c_fieldname_selected. <ls_component>-type ?= cl_abap_datadescr=>describe_by_name( 'FLAG' ). lo_struct_descr2 = cl_abap_structdescr=>create( lt_components ). mo_table_descr = cl_abap_tabledescr=>create( lo_struct_descr2 ). CREATE DATA mr_table TYPE HANDLE mo_table_descr. ASSIGN mr_table->* TO <lt_table>. ASSERT sy-subrc = 0. CREATE DATA lr_struct TYPE HANDLE lo_struct_descr2. ASSIGN lr_struct->* TO <lg_line>. ASSERT sy-subrc = 0. LOOP AT it_list ASSIGNING <lg_data>. CLEAR <lg_line>. MOVE-CORRESPONDING <lg_data> TO <lg_line>. INSERT <lg_line> INTO TABLE <lt_table>. ENDLOOP. ENDMETHOD. METHOD extract_field_values. FIELD-SYMBOLS: <ls_field> LIKE LINE OF it_fields. CLEAR: ev_url, ev_package, ev_branch, ev_display_name, ev_folder_logic, ev_ign_subpkg. READ TABLE it_fields INDEX 1 ASSIGNING <ls_field>. ASSERT sy-subrc = 0. ev_url = <ls_field>-value. READ TABLE it_fields INDEX 2 ASSIGNING <ls_field>. ASSERT sy-subrc = 0. ev_package = <ls_field>-value. TRANSLATE ev_package TO UPPER CASE. READ TABLE it_fields INDEX 3 ASSIGNING <ls_field>. ASSERT sy-subrc = 0. ev_branch = <ls_field>-value. READ TABLE it_fields INDEX 4 ASSIGNING <ls_field>. ASSERT sy-subrc = 0. ev_display_name = <ls_field>-value. READ TABLE it_fields INDEX 5 ASSIGNING <ls_field>. ASSERT sy-subrc = 0. ev_folder_logic = <ls_field>-value. TRANSLATE ev_folder_logic TO UPPER CASE. READ TABLE it_fields INDEX 6 ASSIGNING <ls_field>. ASSERT sy-subrc = 0. ev_ign_subpkg = <ls_field>-value. TRANSLATE ev_ign_subpkg TO UPPER CASE. READ TABLE it_fields INDEX 7 ASSIGNING <ls_field>. ASSERT sy-subrc = 0. ev_master_lang_only = <ls_field>-value. ENDMETHOD. METHOD get_selected_rows. DATA: lv_condition TYPE string, lr_exporting TYPE REF TO data. FIELD-SYMBOLS: <lg_exporting> TYPE any, <lt_table> TYPE STANDARD TABLE, <lg_line> TYPE any, <lv_selected> TYPE abap_bool, <lv_selected_row> TYPE LINE OF salv_t_row. DATA: lo_selections TYPE REF TO cl_salv_selections, lt_selected_rows TYPE salv_t_row. ASSIGN mr_table->* TO <lt_table>. ASSERT sy-subrc = 0. lo_selections = mo_select_list_popup->get_selections( ). IF lo_selections->get_selection_mode( ) = if_salv_c_selection_mode=>single. lt_selected_rows = lo_selections->get_selected_rows( ). LOOP AT lt_selected_rows ASSIGNING <lv_selected_row>. READ TABLE <lt_table> ASSIGNING <lg_line> INDEX <lv_selected_row>. CHECK <lv_selected_row> IS ASSIGNED. ASSIGN COMPONENT c_fieldname_selected OF STRUCTURE <lg_line> TO <lv_selected>. CHECK <lv_selected> IS ASSIGNED. <lv_selected> = abap_true. ENDLOOP. ENDIF. lv_condition = |{ c_fieldname_selected } = ABAP_TRUE|. CREATE DATA lr_exporting LIKE LINE OF et_list. ASSIGN lr_exporting->* TO <lg_exporting>. LOOP AT <lt_table> ASSIGNING <lg_line> WHERE (lv_condition). CLEAR <lg_exporting>. MOVE-CORRESPONDING <lg_line> TO <lg_exporting>. APPEND <lg_exporting> TO et_list. ENDLOOP. ENDMETHOD. METHOD on_double_click. DATA: lo_selections TYPE REF TO cl_salv_selections. lo_selections = mo_select_list_popup->get_selections( ). IF lo_selections->get_selection_mode( ) = if_salv_c_selection_mode=>single. mo_select_list_popup->close_screen( ). ENDIF. ENDMETHOD. METHOD on_select_list_function_click. FIELD-SYMBOLS: <lt_table> TYPE STANDARD TABLE, <lg_line> TYPE any, <lv_selected> TYPE abap_bool. ASSIGN mr_table->* TO <lt_table>. ASSERT sy-subrc = 0. CASE e_salv_function. WHEN 'O.K.'. mv_cancel = abap_false. mo_select_list_popup->close_screen( ). WHEN 'ABR'. "Canceled: clear list to overwrite nothing CLEAR <lt_table>. mv_cancel = abap_true. mo_select_list_popup->close_screen( ). WHEN 'SALL'. LOOP AT <lt_table> ASSIGNING <lg_line>. ASSIGN COMPONENT c_fieldname_selected OF STRUCTURE <lg_line> TO <lv_selected>. ASSERT sy-subrc = 0. <lv_selected> = abap_true. ENDLOOP. mo_select_list_popup->refresh( ). WHEN 'DSEL'. LOOP AT <lt_table> ASSIGNING <lg_line>. ASSIGN COMPONENT c_fieldname_selected OF STRUCTURE <lg_line> TO <lv_selected>. ASSERT sy-subrc = 0. <lv_selected> = abap_false. ENDLOOP. mo_select_list_popup->refresh( ). WHEN OTHERS. CLEAR <lt_table>. mo_select_list_popup->close_screen( ). ENDCASE. ENDMETHOD. METHOD on_select_list_link_click. FIELD-SYMBOLS: <lt_table> TYPE STANDARD TABLE, <lg_line> TYPE any, <lv_selected> TYPE abap_bool. ASSIGN mr_table->* TO <lt_table>. ASSERT sy-subrc = 0. READ TABLE <lt_table> ASSIGNING <lg_line> INDEX row. IF sy-subrc = 0. ASSIGN COMPONENT c_fieldname_selected OF STRUCTURE <lg_line> TO <lv_selected>. ASSERT sy-subrc = 0. IF <lv_selected> = abap_true. <lv_selected> = abap_false. ELSE. <lv_selected> = abap_true. ENDIF. ENDIF. mo_select_list_popup->refresh( ). ENDMETHOD. METHOD validate_folder_logic. IF iv_folder_logic <> zif_abapgit_dot_abapgit=>c_folder_logic-prefix AND iv_folder_logic <> zif_abapgit_dot_abapgit=>c_folder_logic-full. zcx_abapgit_exception=>raise( |Invalid folder logic { iv_folder_logic }. | && |Choose either { zif_abapgit_dot_abapgit=>c_folder_logic-prefix } | && |or { zif_abapgit_dot_abapgit=>c_folder_logic-full } | ). ENDIF. ENDMETHOD. METHOD zif_abapgit_popups~branch_list_popup. DATA: lo_branches TYPE REF TO zcl_abapgit_git_branch_list, lt_branches TYPE zif_abapgit_definitions=>ty_git_branch_list_tt, lv_answer TYPE c LENGTH 1, lv_default TYPE i, lv_head_suffix TYPE string, lv_head_symref TYPE string, lv_text TYPE string, lt_selection TYPE TABLE OF spopli. FIELD-SYMBOLS: <ls_sel> LIKE LINE OF lt_selection, <ls_branch> LIKE LINE OF lt_branches. lo_branches = zcl_abapgit_git_transport=>branches( iv_url ). lt_branches = lo_branches->get_branches_only( ). lv_head_suffix = | ({ zif_abapgit_definitions=>c_head_name })|. lv_head_symref = lo_branches->get_head_symref( ). IF iv_hide_branch IS NOT INITIAL. DELETE lt_branches WHERE name = iv_hide_branch. ENDIF. IF iv_hide_head IS NOT INITIAL. DELETE lt_branches WHERE name = zif_abapgit_definitions=>c_head_name OR is_head = abap_true. ENDIF. IF lt_branches IS INITIAL. IF iv_hide_head IS NOT INITIAL. lv_text = 'master'. ENDIF. IF iv_hide_branch IS NOT INITIAL AND iv_hide_branch <> 'refs/heads/master'. IF lv_text IS INITIAL. lv_text = iv_hide_branch && ' is'. ELSE. CONCATENATE lv_text 'and' iv_hide_branch 'are' INTO lv_text SEPARATED BY space. ENDIF. ELSE. lv_text = lv_text && ' is'. ENDIF. IF lv_text IS NOT INITIAL. zcx_abapgit_exception=>raise( 'No branches available to select (' && lv_text && ' hidden)' ). ELSE. zcx_abapgit_exception=>raise( 'No branches are available to select' ). ENDIF. ENDIF. LOOP AT lt_branches ASSIGNING <ls_branch>. CHECK <ls_branch>-name IS NOT INITIAL. " To ensure some below ifs IF <ls_branch>-is_head = abap_true. IF <ls_branch>-name = zif_abapgit_definitions=>c_head_name. " HEAD IF <ls_branch>-name <> lv_head_symref AND lv_head_symref IS NOT INITIAL. " HEAD but other HEAD symref exists - ignore CONTINUE. ELSE. INSERT INITIAL LINE INTO lt_selection INDEX 1 ASSIGNING <ls_sel>. <ls_sel>-varoption = <ls_branch>-name. ENDIF. ELSE. INSERT INITIAL LINE INTO lt_selection INDEX 1 ASSIGNING <ls_sel>. <ls_sel>-varoption = <ls_branch>-display_name && lv_head_suffix. ENDIF. IF lv_default > 0. " Shift down default if set lv_default = lv_default + 1. ENDIF. ELSE. APPEND INITIAL LINE TO lt_selection ASSIGNING <ls_sel>. <ls_sel>-varoption = <ls_branch>-display_name. ENDIF. IF <ls_branch>-name = iv_default_branch. IF <ls_branch>-is_head = abap_true. lv_default = 1. ELSE. lv_default = sy-tabix. ENDIF. ENDIF. ENDLOOP. IF iv_show_new_option = abap_true. APPEND INITIAL LINE TO lt_selection ASSIGNING <ls_sel>. <ls_sel>-varoption = zif_abapgit_popups=>c_new_branch_label. ENDIF. CALL FUNCTION 'POPUP_TO_DECIDE_LIST' EXPORTING textline1 = 'Select branch' titel = 'Select branch' start_col = 30 start_row = 5 cursorline = lv_default IMPORTING answer = lv_answer TABLES t_spopli = lt_selection EXCEPTIONS OTHERS = 1. "#EC NOTEXT IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'Error from POPUP_TO_DECIDE_LIST' ). ENDIF. IF lv_answer = c_answer_cancel. RETURN. ENDIF. READ TABLE lt_selection ASSIGNING <ls_sel> WITH KEY selflag = abap_true. ASSERT sy-subrc = 0. IF iv_show_new_option = abap_true AND <ls_sel>-varoption = zif_abapgit_popups=>c_new_branch_label. rs_branch-name = zif_abapgit_popups=>c_new_branch_label. ELSE. REPLACE FIRST OCCURRENCE OF lv_head_suffix IN <ls_sel>-varoption WITH ''. READ TABLE lt_branches WITH KEY display_name = <ls_sel>-varoption ASSIGNING <ls_branch>. IF sy-subrc <> 0. * branch name longer than 65 characters LOOP AT lt_branches ASSIGNING <ls_branch> WHERE display_name CS <ls_sel>-varoption. EXIT. " current loop ENDLOOP. ENDIF. ASSERT <ls_branch> IS ASSIGNED. rs_branch = lo_branches->find_by_name( <ls_branch>-name ). MESSAGE |Branch switched from { zcl_abapgit_git_branch_list=>get_display_name( iv_default_branch ) } to { zcl_abapgit_git_branch_list=>get_display_name( rs_branch-name ) } | TYPE 'S'. ENDIF. ENDMETHOD. METHOD zif_abapgit_popups~branch_popup_callback. DATA: lv_url TYPE string, ls_package_data TYPE scompkdtln, ls_branch TYPE zif_abapgit_definitions=>ty_git_branch, lv_create TYPE abap_bool, lv_text TYPE string. FIELD-SYMBOLS: <ls_furl> LIKE LINE OF ct_fields, <ls_fbranch> LIKE LINE OF ct_fields, <ls_fpackage> LIKE LINE OF ct_fields. CLEAR cs_error. IF iv_code = 'COD1'. cv_show_popup = abap_true. READ TABLE ct_fields ASSIGNING <ls_furl> WITH KEY tabname = 'ABAPTXT255'. IF sy-subrc <> 0 OR <ls_furl>-value IS INITIAL. MESSAGE 'Fill URL' TYPE 'S' DISPLAY LIKE 'E'. "#EC NOTEXT RETURN. ENDIF. lv_url = <ls_furl>-value. ls_branch = branch_list_popup( lv_url ). IF ls_branch IS INITIAL. RETURN. ENDIF. READ TABLE ct_fields ASSIGNING <ls_fbranch> WITH KEY tabname = 'TEXTL'. ASSERT sy-subrc = 0. <ls_fbranch>-value = ls_branch-name. ELSEIF iv_code = 'COD2'. cv_show_popup = abap_true. READ TABLE ct_fields ASSIGNING <ls_fpackage> WITH KEY fieldname = 'DEVCLASS'. ASSERT sy-subrc = 0. ls_package_data-devclass = <ls_fpackage>-value. IF zcl_abapgit_factory=>get_sap_package( ls_package_data-devclass )->exists( ) = abap_true. lv_text = |Package { ls_package_data-devclass } already exists|. MESSAGE lv_text TYPE 'I' DISPLAY LIKE 'E'. RETURN. ENDIF. popup_to_create_package( IMPORTING es_package_data = ls_package_data ev_create = lv_create ). IF lv_create = abap_false. RETURN. ENDIF. zcl_abapgit_factory=>get_sap_package( ls_package_data-devclass )->create( ls_package_data ). COMMIT WORK. <ls_fpackage>-value = ls_package_data-devclass. ENDIF. ENDMETHOD. METHOD zif_abapgit_popups~create_branch_popup. DATA: lt_fields TYPE TABLE OF sval. DATA: lv_name TYPE spo_value. CLEAR: ev_name, ev_cancel. add_field( EXPORTING iv_tabname = 'TEXTL' iv_fieldname = 'LINE' iv_fieldtext = 'Name' iv_value = 'new-branch-name' CHANGING ct_fields = lt_fields ). TRY. _popup_3_get_values( EXPORTING iv_popup_title = |Create branch from { zcl_abapgit_git_branch_list=>get_display_name( iv_source_branch_name ) }| IMPORTING ev_value_1 = lv_name CHANGING ct_fields = lt_fields ). ev_name = zcl_abapgit_git_branch_list=>complete_heads_branch_name( zcl_abapgit_git_branch_list=>normalize_branch_name( lv_name ) ). CATCH zcx_abapgit_cancel. ev_cancel = abap_true. ENDTRY. ENDMETHOD. METHOD zif_abapgit_popups~package_popup_callback. DATA: ls_package_data TYPE scompkdtln, lv_create TYPE abap_bool. FIELD-SYMBOLS: <ls_fpackage> LIKE LINE OF ct_fields. CLEAR cs_error. IF iv_code = 'COD1'. cv_show_popup = abap_true. READ TABLE ct_fields ASSIGNING <ls_fpackage> WITH KEY fieldname = 'DEVCLASS'. ASSERT sy-subrc = 0. ls_package_data-devclass = <ls_fpackage>-value. popup_to_create_package( IMPORTING es_package_data = ls_package_data ev_create = lv_create ). IF lv_create = abap_false. RETURN. ENDIF. zcl_abapgit_factory=>get_sap_package( ls_package_data-devclass )->create( ls_package_data ). COMMIT WORK. <ls_fpackage>-value = ls_package_data-devclass. ENDIF. ENDMETHOD. METHOD zif_abapgit_popups~popup_folder_logic. DATA: lt_fields TYPE TABLE OF sval. DATA: lv_folder_logic TYPE spo_value. CLEAR: rv_folder_logic. add_field( EXPORTING iv_tabname = 'TDEVC' iv_fieldname = 'INTSYS' iv_fieldtext = 'Folder logic' iv_value = 'PREFIX' CHANGING ct_fields = lt_fields ). TRY. _popup_3_get_values( EXPORTING iv_popup_title = 'Export package' "#EC NOTEXT iv_no_value_check = abap_true IMPORTING ev_value_1 = lv_folder_logic CHANGING ct_fields = lt_fields ). rv_folder_logic = to_upper( lv_folder_logic ). CATCH zcx_abapgit_cancel. ENDTRY. ENDMETHOD. METHOD zif_abapgit_popups~popup_object. DATA: lt_fields TYPE TABLE OF sval. DATA: lv_object_type TYPE spo_value. DATA: lv_object_name TYPE spo_value. CLEAR: rs_tadir-object, rs_tadir-obj_name. add_field( EXPORTING iv_tabname = 'TADIR' iv_fieldname = 'OBJECT' iv_fieldtext = 'Type' CHANGING ct_fields = lt_fields ). add_field( EXPORTING iv_tabname = 'TADIR' iv_fieldname = 'OBJ_NAME' iv_fieldtext = 'Name' CHANGING ct_fields = lt_fields ). _popup_3_get_values( EXPORTING iv_popup_title = 'Object' "#EC NOTEXT iv_no_value_check = abap_true IMPORTING ev_value_1 = lv_object_type ev_value_2 = lv_object_name CHANGING ct_fields = lt_fields ). rs_tadir = zcl_abapgit_factory=>get_tadir( )->read_single( iv_object = to_upper( lv_object_type ) iv_obj_name = to_upper( lv_object_name ) ). ENDMETHOD. METHOD zif_abapgit_popups~popup_package_export. DATA: lt_fields TYPE TABLE OF sval. DATA: lv_package TYPE spo_value. DATA: lv_folder_logic TYPE spo_value. DATA: lv_serialize_master_lang_only TYPE spo_value. add_field( EXPORTING iv_tabname = 'TDEVC' iv_fieldname = 'DEVCLASS' iv_fieldtext = 'Package' CHANGING ct_fields = lt_fields ). add_field( EXPORTING iv_tabname = 'TDEVC' iv_fieldname = 'INTSYS' iv_fieldtext = 'Folder logic' iv_value = 'PREFIX' CHANGING ct_fields = lt_fields ). add_field( EXPORTING iv_tabname = 'TVDIR' iv_fieldname = 'FLAG' iv_fieldtext = 'Master lang only' CHANGING ct_fields = lt_fields ). TRY. _popup_3_get_values( EXPORTING iv_popup_title = 'Export package' "#EC NOTEXT iv_no_value_check = abap_true IMPORTING ev_value_1 = lv_package ev_value_2 = lv_folder_logic ev_value_3 = lv_serialize_master_lang_only CHANGING ct_fields = lt_fields ). ev_package = to_upper( lv_package ). ev_folder_logic = to_upper( lv_folder_logic ). ev_serialize_master_lang_only = boolc( lv_serialize_master_lang_only IS NOT INITIAL ). CATCH zcx_abapgit_cancel. ENDTRY. ENDMETHOD. METHOD zif_abapgit_popups~popup_proxy_bypass. rt_proxy_bypass = it_proxy_bypass. CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG' EXPORTING title = 'Bypass proxy settings for these Hosts & Domains' signed = abap_false lower_case = abap_true no_interval_check = abap_true TABLES range = rt_proxy_bypass EXCEPTIONS no_range_tab = 1 cancelled = 2 internal_error = 3 invalid_fieldname = 4 OTHERS = 5. CASE sy-subrc. WHEN 0. WHEN 2. RAISE EXCEPTION TYPE zcx_abapgit_cancel. WHEN OTHERS. zcx_abapgit_exception=>raise( 'Error from COMPLEX_SELECTIONS_DIALOG' ). ENDCASE. ENDMETHOD. METHOD zif_abapgit_popups~popup_search_help. DATA lt_ret TYPE TABLE OF ddshretval. DATA ls_ret LIKE LINE OF lt_ret. DATA lv_tabname TYPE dfies-tabname. DATA lv_fieldname TYPE dfies-fieldname. SPLIT iv_tab_field AT '-' INTO lv_tabname lv_fieldname. lv_tabname = to_upper( lv_tabname ). lv_fieldname = to_upper( lv_fieldname ). CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST' EXPORTING tabname = lv_tabname fieldname = lv_fieldname TABLES return_tab = lt_ret EXCEPTIONS OTHERS = 5. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |F4IF_FIELD_VALUE_REQUEST error [{ iv_tab_field }]| ). ENDIF. IF lines( lt_ret ) > 0. READ TABLE lt_ret INDEX 1 INTO ls_ret. ASSERT sy-subrc = 0. rv_value = ls_ret-fieldval. ENDIF. ENDMETHOD. METHOD zif_abapgit_popups~popup_to_confirm. CALL FUNCTION 'POPUP_TO_CONFIRM' EXPORTING titlebar = iv_titlebar text_question = iv_text_question text_button_1 = iv_text_button_1 icon_button_1 = iv_icon_button_1 text_button_2 = iv_text_button_2 icon_button_2 = iv_icon_button_2 default_button = iv_default_button display_cancel_button = iv_display_cancel_button IMPORTING answer = rv_answer EXCEPTIONS text_not_found = 1 OTHERS = 2. "#EC NOTEXT IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'error from POPUP_TO_CONFIRM' ). ENDIF. ENDMETHOD. METHOD zif_abapgit_popups~popup_to_create_package. CALL FUNCTION 'FUNCTION_EXISTS' EXPORTING funcname = 'PB_POPUP_PACKAGE_CREATE' EXCEPTIONS function_not_exist = 1 OTHERS = 2. IF sy-subrc = 1. * looks like the function module used does not exist on all * versions since 702, so show an error zcx_abapgit_exception=>raise( 'Your system does not support automatic creation of packages.' && 'Please, create the package manually.' ). ENDIF. CALL FUNCTION 'PB_POPUP_PACKAGE_CREATE' CHANGING p_object_data = es_package_data EXCEPTIONS action_cancelled = 1. IF sy-subrc = 0. ev_create = abap_true. ELSE. ev_create = abap_false. ENDIF. ENDMETHOD. METHOD zif_abapgit_popups~popup_to_create_transp_branch. DATA: lt_fields TYPE TABLE OF sval, lv_transports_as_text TYPE string, lv_desc_as_text TYPE string, ls_transport_header LIKE LINE OF it_transport_headers. DATA: lv_branch_name TYPE spo_value. DATA: lv_commit_text TYPE spo_value. CLEAR: rs_transport_branch-branch_name, rs_transport_branch-commit_text. " If we only have one transport selected set branch name to Transport " name and commit description to transport description. IF lines( it_transport_headers ) = 1. READ TABLE it_transport_headers INDEX 1 INTO ls_transport_header. lv_transports_as_text = ls_transport_header-trkorr. SELECT SINGLE as4text FROM e07t INTO lv_desc_as_text WHERE trkorr = ls_transport_header-trkorr AND langu = sy-langu. ELSE. " Else set branch name and commit message to 'Transport(s)_TRXXXXXX_TRXXXXX' lv_transports_as_text = 'Transport(s)'. LOOP AT it_transport_headers INTO ls_transport_header. CONCATENATE lv_transports_as_text '_' ls_transport_header-trkorr INTO lv_transports_as_text. ENDLOOP. lv_desc_as_text = lv_transports_as_text. ENDIF. add_field( EXPORTING iv_tabname = 'TEXTL' iv_fieldname = 'LINE' iv_fieldtext = 'Branch name' iv_value = lv_transports_as_text CHANGING ct_fields = lt_fields ). add_field( EXPORTING iv_tabname = 'ABAPTXT255' iv_fieldname = 'LINE' iv_fieldtext = 'Commit text' iv_value = lv_desc_as_text CHANGING ct_fields = lt_fields ). _popup_3_get_values( EXPORTING iv_popup_title = 'Transport to new Branch' "#EC NOTEXT IMPORTING ev_value_1 = lv_branch_name ev_value_2 = lv_commit_text CHANGING ct_fields = lt_fields ). rs_transport_branch-branch_name = lv_branch_name. rs_transport_branch-commit_text = lv_commit_text. ENDMETHOD. METHOD zif_abapgit_popups~popup_to_inform. DATA: lv_line1 TYPE c LENGTH 70, lv_line2 TYPE c LENGTH 70. lv_line1 = iv_text_message. IF strlen( iv_text_message ) > 70. lv_line2 = iv_text_message+70. ENDIF. CALL FUNCTION 'POPUP_TO_INFORM' EXPORTING titel = iv_titlebar txt1 = lv_line1 txt2 = lv_line2. ENDMETHOD. METHOD zif_abapgit_popups~popup_to_select_from_list. DATA: lv_pfstatus TYPE sypfkey, lo_events TYPE REF TO cl_salv_events_table, lo_columns TYPE REF TO cl_salv_columns_table, lt_columns TYPE salv_t_column_ref, ls_column TYPE salv_s_column_ref, lo_column TYPE REF TO cl_salv_column_list, lo_table_header TYPE REF TO cl_salv_form_text. FIELD-SYMBOLS: <lt_table> TYPE STANDARD TABLE, <ls_column_to_display> TYPE zif_abapgit_definitions=>ty_alv_column. CLEAR: et_list. create_new_table( it_list ). ASSIGN mr_table->* TO <lt_table>. ASSERT sy-subrc = 0. TRY. cl_salv_table=>factory( IMPORTING r_salv_table = mo_select_list_popup CHANGING t_table = <lt_table> ). CASE iv_selection_mode. WHEN if_salv_c_selection_mode=>single. lv_pfstatus = '110'. WHEN OTHERS. lv_pfstatus = '102'. ENDCASE. mo_select_list_popup->set_screen_status( pfstatus = lv_pfstatus report = 'SAPMSVIM' ). mo_select_list_popup->set_screen_popup( start_column = iv_start_column end_column = iv_end_column start_line = iv_start_line end_line = iv_end_line ). lo_events = mo_select_list_popup->get_event( ). SET HANDLER on_select_list_link_click FOR lo_events. SET HANDLER on_select_list_function_click FOR lo_events. SET HANDLER on_double_click FOR lo_events. IF iv_title CN ' _0'. mo_select_list_popup->get_display_settings( )->set_list_header( iv_title ). ENDIF. IF iv_header_text CN ' _0'. CREATE OBJECT lo_table_header EXPORTING text = iv_header_text. mo_select_list_popup->set_top_of_list( lo_table_header ). ENDIF. mo_select_list_popup->get_display_settings( )->set_striped_pattern( iv_striped_pattern ). mo_select_list_popup->get_selections( )->set_selection_mode( iv_selection_mode ). lo_columns = mo_select_list_popup->get_columns( ). lt_columns = lo_columns->get( ). lo_columns->set_optimize( iv_optimize_col_width ). LOOP AT lt_columns INTO ls_column. lo_column ?= ls_column-r_column. IF iv_selection_mode = if_salv_c_selection_mode=>multiple AND ls_column-columnname = c_fieldname_selected. lo_column->set_cell_type( if_salv_c_cell_type=>checkbox_hotspot ). lo_column->set_output_length( 20 ). lo_column->set_short_text( |{ iv_select_column_text }| ). lo_column->set_medium_text( |{ iv_select_column_text }| ). lo_column->set_long_text( |{ iv_select_column_text }| ). CONTINUE. ENDIF. READ TABLE it_columns_to_display ASSIGNING <ls_column_to_display> WITH KEY name = ls_column-columnname. CASE sy-subrc. WHEN 0. IF <ls_column_to_display>-text CN ' _0'. lo_column->set_short_text( |{ <ls_column_to_display>-text }| ). lo_column->set_medium_text( |{ <ls_column_to_display>-text }| ). lo_column->set_long_text( |{ <ls_column_to_display>-text }| ). ENDIF. IF <ls_column_to_display>-length > 0. lo_column->set_output_length( <ls_column_to_display>-length ). ENDIF. WHEN OTHERS. " Hide column lo_column->set_technical( abap_true ). ENDCASE. ENDLOOP. mo_select_list_popup->display( ). CATCH cx_salv_msg. zcx_abapgit_exception=>raise( 'Error from POPUP_TO_SELECT_FROM_LIST' ). ENDTRY. IF mv_cancel = abap_true. mv_cancel = abap_false. RAISE EXCEPTION TYPE zcx_abapgit_cancel. ENDIF. get_selected_rows( IMPORTING et_list = et_list ). CLEAR: mo_select_list_popup, mr_table, mo_table_descr. ENDMETHOD. METHOD zif_abapgit_popups~popup_to_select_transports. * todo, method to be renamed, it only returns one transport DATA: lv_trkorr TYPE e070-trkorr, ls_trkorr LIKE LINE OF rt_trkorr. CALL FUNCTION 'TR_F4_REQUESTS' IMPORTING ev_selected_request = lv_trkorr. IF NOT lv_trkorr IS INITIAL. ls_trkorr-trkorr = lv_trkorr. APPEND ls_trkorr TO rt_trkorr. ENDIF. ENDMETHOD. METHOD zif_abapgit_popups~popup_transport_request. DATA: lt_e071 TYPE STANDARD TABLE OF e071, lt_e071k TYPE STANDARD TABLE OF e071k. CALL FUNCTION 'TRINT_ORDER_CHOICE' EXPORTING wi_order_type = is_transport_type-request wi_task_type = is_transport_type-task IMPORTING we_order = rv_transport TABLES wt_e071 = lt_e071 wt_e071k = lt_e071k EXCEPTIONS no_correction_selected = 1 display_mode = 2 object_append_error = 3 recursive_call = 4 wrong_order_type = 5 OTHERS = 6. IF sy-subrc = 1. RAISE EXCEPTION TYPE zcx_abapgit_cancel. ELSEIF sy-subrc > 1. zcx_abapgit_exception=>raise( |Error from TRINT_ORDER_CHOICE { sy-subrc }| ). ENDIF. ENDMETHOD. METHOD zif_abapgit_popups~repo_new_offline. DATA: lv_returncode TYPE c, lt_fields TYPE TABLE OF sval, lv_icon_ok TYPE icon-name, lv_button1 TYPE svalbutton-buttontext, lv_icon1 TYPE icon-name, lv_finished TYPE abap_bool, lx_error TYPE REF TO zcx_abapgit_exception. FIELD-SYMBOLS: <ls_field> LIKE LINE OF lt_fields. add_field( EXPORTING iv_tabname = 'ABAPTXT255' iv_fieldname = 'LINE' iv_fieldtext = 'Name' iv_obligatory = abap_true CHANGING ct_fields = lt_fields ). add_field( EXPORTING iv_tabname = 'TDEVC' iv_fieldname = 'DEVCLASS' iv_fieldtext = 'Package' iv_obligatory = abap_true CHANGING ct_fields = lt_fields ). add_field( EXPORTING iv_tabname = 'ZABAPGIT' iv_fieldname = 'VALUE' iv_fieldtext = 'Folder logic' iv_obligatory = abap_true iv_value = zif_abapgit_dot_abapgit=>c_folder_logic-prefix CHANGING ct_fields = lt_fields ). add_field( EXPORTING iv_tabname = 'DOKIL' iv_fieldname = 'MASTERLANG' iv_fieldtext = 'Master language only' iv_value = abap_true CHANGING ct_fields = lt_fields ). WHILE lv_finished = abap_false. lv_icon_ok = icon_okay. lv_button1 = 'Create package' ##NO_TEXT. lv_icon1 = icon_folder. CALL FUNCTION 'POPUP_GET_VALUES_USER_BUTTONS' EXPORTING popup_title = 'New Offline Project' programname = sy-cprog formname = 'PACKAGE_POPUP' ok_pushbuttontext = 'OK' icon_ok_push = lv_icon_ok first_pushbutton = lv_button1 icon_button_1 = lv_icon1 second_pushbutton = '' icon_button_2 = '' IMPORTING returncode = lv_returncode TABLES fields = lt_fields EXCEPTIONS error_in_fields = 1 OTHERS = 2. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'Error from POPUP_GET_VALUES' ). ENDIF. IF lv_returncode = c_answer_cancel. rs_popup-cancel = abap_true. RETURN. ENDIF. READ TABLE lt_fields INDEX 1 ASSIGNING <ls_field>. ASSERT sy-subrc = 0. rs_popup-url = <ls_field>-value. READ TABLE lt_fields INDEX 2 ASSIGNING <ls_field>. ASSERT sy-subrc = 0. TRANSLATE <ls_field>-value TO UPPER CASE. rs_popup-package = <ls_field>-value. READ TABLE lt_fields INDEX 3 ASSIGNING <ls_field>. ASSERT sy-subrc = 0. TRANSLATE <ls_field>-value TO UPPER CASE. rs_popup-folder_logic = <ls_field>-value. READ TABLE lt_fields INDEX 4 ASSIGNING <ls_field>. ASSERT sy-subrc = 0. rs_popup-master_lang_only = <ls_field>-value. lv_finished = abap_true. TRY. zcl_abapgit_repo_srv=>get_instance( )->validate_package( iv_package = rs_popup-package iv_chk_exists = abap_false ). validate_folder_logic( rs_popup-folder_logic ). CATCH zcx_abapgit_exception INTO lx_error. " in case of validation errors we display the popup again MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'. CLEAR lv_finished. ENDTRY. ENDWHILE. ENDMETHOD. METHOD zif_abapgit_popups~repo_popup. DATA: lv_returncode TYPE c, lv_icon_ok TYPE icon-name, lv_icon_br TYPE icon-name, lt_fields TYPE TABLE OF sval, lv_uattr TYPE spo_fattr, lv_pattr TYPE spo_fattr, lv_button2 TYPE svalbutton-buttontext, lv_icon2 TYPE icon-name, lv_package TYPE tdevc-devclass, lv_url TYPE abaptxt255-line, lv_branch TYPE textl-line, lv_display_name TYPE trm255-text, lv_folder_logic TYPE string, lv_ign_subpkg TYPE abap_bool, lv_finished TYPE abap_bool, lv_master_lang_only TYPE abap_bool, lx_error TYPE REF TO zcx_abapgit_exception. IF iv_freeze_url = abap_true. lv_uattr = '05'. ENDIF. IF iv_freeze_package = abap_true. lv_pattr = '05'. ENDIF. IF iv_package IS INITIAL. " Empty package -> can be created lv_button2 = 'Create package' ##NO_TEXT. lv_icon2 = icon_folder. ENDIF. lv_display_name = iv_display_name. lv_package = iv_package. lv_url = iv_url. lv_branch = iv_branch. WHILE lv_finished = abap_false. CLEAR: lt_fields. add_field( EXPORTING iv_tabname = 'ABAPTXT255' iv_fieldname = 'LINE' iv_fieldtext = 'Git clone URL' iv_value = lv_url iv_field_attr = lv_uattr CHANGING ct_fields = lt_fields ). add_field( EXPORTING iv_tabname = 'TDEVC' iv_fieldname = 'DEVCLASS' iv_fieldtext = 'Package' iv_value = lv_package iv_field_attr = lv_pattr CHANGING ct_fields = lt_fields ). add_field( EXPORTING iv_tabname = 'TEXTL' iv_fieldname = 'LINE' iv_fieldtext = 'Branch' iv_value = lv_branch iv_field_attr = '05' CHANGING ct_fields = lt_fields ). add_field( EXPORTING iv_tabname = 'TRM255' iv_fieldname = 'TEXT' iv_fieldtext = 'Display name (opt.)' iv_value = lv_display_name CHANGING ct_fields = lt_fields ). add_field( EXPORTING iv_tabname = 'TADIR' iv_fieldname = 'AUTHOR' iv_fieldtext = 'Folder logic' iv_obligatory = abap_true iv_value = zif_abapgit_dot_abapgit=>c_folder_logic-prefix CHANGING ct_fields = lt_fields ). add_field( EXPORTING iv_tabname = 'TDEVC' iv_fieldname = 'IS_ENHANCEABLE' iv_fieldtext = 'Ignore subpackages' iv_value = abap_false CHANGING ct_fields = lt_fields ). add_field( EXPORTING iv_tabname = 'DOKIL' iv_fieldname = 'MASTERLANG' iv_fieldtext = 'Master language only' iv_value = abap_true CHANGING ct_fields = lt_fields ). lv_icon_ok = icon_okay. lv_icon_br = icon_workflow_fork. CALL FUNCTION 'POPUP_GET_VALUES_USER_BUTTONS' EXPORTING popup_title = iv_title programname = sy-cprog formname = 'BRANCH_POPUP' ok_pushbuttontext = 'OK' icon_ok_push = lv_icon_ok first_pushbutton = 'Select branch' icon_button_1 = lv_icon_br second_pushbutton = lv_button2 icon_button_2 = lv_icon2 IMPORTING returncode = lv_returncode TABLES fields = lt_fields EXCEPTIONS error_in_fields = 1 OTHERS = 2. "#EC NOTEXT IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'Error from POPUP_GET_VALUES' ). ENDIF. IF lv_returncode = c_answer_cancel. rs_popup-cancel = abap_true. RETURN. ENDIF. extract_field_values( EXPORTING it_fields = lt_fields IMPORTING ev_url = lv_url ev_package = lv_package ev_branch = lv_branch ev_display_name = lv_display_name ev_folder_logic = lv_folder_logic ev_ign_subpkg = lv_ign_subpkg ev_master_lang_only = lv_master_lang_only ). lv_finished = abap_true. TRY. IF iv_freeze_url = abap_false. zcl_abapgit_url=>validate( |{ lv_url }| ). ENDIF. IF iv_freeze_package = abap_false. zcl_abapgit_repo_srv=>get_instance( )->validate_package( iv_package = lv_package iv_ign_subpkg = lv_ign_subpkg iv_chk_exists = abap_false ). ENDIF. validate_folder_logic( lv_folder_logic ). CATCH zcx_abapgit_exception INTO lx_error. MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'. " in case of validation errors we display the popup again CLEAR lv_finished. ENDTRY. ENDWHILE. rs_popup-url = lv_url. rs_popup-package = lv_package. rs_popup-branch_name = lv_branch. rs_popup-display_name = lv_display_name. rs_popup-folder_logic = lv_folder_logic. rs_popup-ign_subpkg = lv_ign_subpkg. rs_popup-master_lang_only = lv_master_lang_only. ENDMETHOD. METHOD _popup_3_get_values. DATA lv_answer TYPE c LENGTH 1. FIELD-SYMBOLS: <ls_field> TYPE sval. CALL FUNCTION 'POPUP_GET_VALUES' EXPORTING no_value_check = iv_no_value_check popup_title = iv_popup_title IMPORTING returncode = lv_answer TABLES fields = ct_fields EXCEPTIONS OTHERS = 1 ##NO_TEXT. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'Error from POPUP_GET_VALUES' ). ENDIF. IF lv_answer = c_answer_cancel. RAISE EXCEPTION TYPE zcx_abapgit_cancel. ENDIF. IF ev_value_1 IS SUPPLIED. READ TABLE ct_fields INDEX 1 ASSIGNING <ls_field>. ASSERT sy-subrc = 0. ev_value_1 = <ls_field>-value. ENDIF. IF ev_value_2 IS SUPPLIED. READ TABLE ct_fields INDEX 2 ASSIGNING <ls_field>. ASSERT sy-subrc = 0. ev_value_2 = <ls_field>-value. ENDIF. IF ev_value_3 IS SUPPLIED. READ TABLE ct_fields INDEX 3 ASSIGNING <ls_field>. ASSERT sy-subrc = 0. ev_value_3 = <ls_field>-value. ENDIF. ENDMETHOD. ENDCLASS.
32.658832
111
0.608532
1262b6575588c67cc1e9c86c21eda3a6d13de6b1
3,679
abap
ABAP
lbn-gtt-standard-app/abap/zsrc/zgtt_sts/zgtt_sts.fugr.zgtt_sts_ee_fo_load_end.abap
rakshitha-1234/logistics-business-network-gtt-standardapps-samples
3d1e3249046c0112ff33f524d30cde2ac9f38b4c
[ "Apache-2.0" ]
3
2021-07-08T07:16:53.000Z
2021-10-18T07:56:18.000Z
lbn-gtt-standard-app/abap/zsrc/zgtt_sts/zgtt_sts.fugr.zgtt_sts_ee_fo_load_end.abap
rakshitha-1234/logistics-business-network-gtt-standardapps-samples
3d1e3249046c0112ff33f524d30cde2ac9f38b4c
[ "Apache-2.0" ]
null
null
null
lbn-gtt-standard-app/abap/zsrc/zgtt_sts/zgtt_sts.fugr.zgtt_sts_ee_fo_load_end.abap
rakshitha-1234/logistics-business-network-gtt-standardapps-samples
3d1e3249046c0112ff33f524d30cde2ac9f38b4c
[ "Apache-2.0" ]
7
2021-06-03T09:47:37.000Z
2022-03-25T12:20:07.000Z
FUNCTION zgtt_sts_ee_fo_load_end ##EXCEPT_OK. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" REFERENCE(I_APPSYS) TYPE /SAPTRX/APPLSYSTEM *" REFERENCE(I_EVENT_TYPE) TYPE /SAPTRX/EVTYPES *" REFERENCE(I_ALL_APPL_TABLES) TYPE TRXAS_TABCONTAINER *" REFERENCE(I_EVENT_TYPE_CNTL_TABS) TYPE TRXAS_EVENTTYPE_TABS *" REFERENCE(I_EVENTS) TYPE TRXAS_EVT_CTABS *" TABLES *" CT_TRACKINGHEADER STRUCTURE /SAPTRX/BAPI_EVM_HEADER *" CT_TRACKLOCATION STRUCTURE /SAPTRX/BAPI_EVM_LOCATIONID *" OPTIONAL *" CT_TRACKADDRESS STRUCTURE /SAPTRX/BAPI_EVM_ADDRESS OPTIONAL *" CT_TRACKLOCATIONDESCR STRUCTURE /SAPTRX/BAPI_EVM_LOCDESCR *" OPTIONAL *" CT_TRACKLOCADDITIONALID STRUCTURE /SAPTRX/BAPI_EVM_LOCADDID *" OPTIONAL *" CT_TRACKPARTNERID STRUCTURE /SAPTRX/BAPI_EVM_PARTNERID *" OPTIONAL *" CT_TRACKPARTNERADDID STRUCTURE /SAPTRX/BAPI_EVM_PARTNERADDID *" OPTIONAL *" CT_TRACKESTIMDEADLINE STRUCTURE /SAPTRX/BAPI_EVM_ESTIMDEADL *" OPTIONAL *" CT_TRACKCONFIRMSTATUS STRUCTURE /SAPTRX/BAPI_EVM_CONFSTAT *" OPTIONAL *" CT_TRACKNEXTEVENT STRUCTURE /SAPTRX/BAPI_EVM_NEXTEVENT *" OPTIONAL *" CT_TRACKNEXTEVDEADLINES STRUCTURE /SAPTRX/BAPI_EVM_NEXTEVDEADL *" OPTIONAL *" CT_TRACKREFERENCES STRUCTURE /SAPTRX/BAPI_EVM_REFERENCE *" OPTIONAL *" CT_TRACKMEASURESULTS STRUCTURE /SAPTRX/BAPI_EVM_MEASRESULT *" OPTIONAL *" CT_TRACKSTATUSATTRIB STRUCTURE /SAPTRX/BAPI_EVM_STATUSATTR *" OPTIONAL *" CT_TRACKPARAMETERS STRUCTURE /SAPTRX/BAPI_EVM_PARAMETERS *" OPTIONAL *" CT_TRACKFILEHEADER STRUCTURE /SAPTRX/BAPI_EVM_FILEHEADER *" OPTIONAL *" CT_TRACKFILEREF STRUCTURE /SAPTRX/BAPI_EVM_FILEREF OPTIONAL *" CT_TRACKFILEBIN STRUCTURE /SAPTRX/BAPI_EVM_FILEBIN OPTIONAL *" CT_TRACKFILECHAR STRUCTURE /SAPTRX/BAPI_EVM_FILECHAR OPTIONAL *" CT_TRACKTEXTHEADER STRUCTURE /SAPTRX/BAPI_EVM_TEXTHEADER *" OPTIONAL *" CT_TRACKTEXTLINES STRUCTURE /SAPTRX/BAPI_EVM_TEXTLINES *" OPTIONAL *" CT_TRACKEEMODIFY STRUCTURE /SAPTRX/BAPI_EVM_EE_MODIFY OPTIONAL *" CT_EXTENSIONIN STRUCTURE BAPIPAREX OPTIONAL *" CT_EXTENSIONOUT STRUCTURE BAPIPAREX OPTIONAL *" CT_LOGTABLE STRUCTURE BAPIRET2 OPTIONAL *" CHANGING *" REFERENCE(C_EVENTID_MAP) TYPE TRXAS_EVTID_EVTCNT_MAP *" EXCEPTIONS *" PARAMETER_ERROR *" EVENT_DATA_ERROR *" STOP_PROCESSING *"---------------------------------------------------------------------- TRY. DATA(lo_actual_event) = NEW zcl_gtt_sts_actual_event( ). lo_actual_event->zif_gtt_sts_actual_event~process_actual_event( EXPORTING iv_appsys = i_appsys it_event_type = i_event_type it_all_appl_tables = i_all_appl_tables it_event_type_cntl_tabs = i_event_type_cntl_tabs it_events = i_events iv_event_code = /scmtms/if_tor_const=>sc_tor_event-load_end CHANGING ct_trackingheader = ct_trackingheader[] ct_tracklocation = ct_tracklocation[] ct_trackparameters = ct_trackparameters[] ct_eventid_map = c_eventid_map ). CATCH cx_udm_message INTO DATA(lo_udm_message). zcl_gtt_sts_tools=>get_errors_log( EXPORTING io_umd_message = lo_udm_message iv_appsys = i_appsys IMPORTING es_bapiret = DATA(ls_bapiret) ). APPEND ls_bapiret TO ct_logtable. RAISE stop_processing. ENDTRY. ENDFUNCTION.
42.287356
79
0.673009
126606da2d8bc641957f86510896184fc64315f1
15,880
abap
ABAP
src/zcl_sapdev_gw_tool.clas.abap
attilaberencsi/gwtools
2d6967f8072e0e5f743516aa6efa105f23d02918
[ "MIT" ]
8
2022-01-03T20:46:56.000Z
2022-01-18T16:51:45.000Z
src/zcl_sapdev_gw_tool.clas.abap
attilaberencsi/gwtools
2d6967f8072e0e5f743516aa6efa105f23d02918
[ "MIT" ]
null
null
null
src/zcl_sapdev_gw_tool.clas.abap
attilaberencsi/gwtools
2d6967f8072e0e5f743516aa6efa105f23d02918
[ "MIT" ]
2
2022-01-21T17:09:51.000Z
2022-01-31T23:29:01.000Z
"! <p class="shorttext synchronized" lang="en">GateWay Tools</p> "! <p>Version Info (YYMMDD): <strong>v220611</strong><p> "! <p>https://github.com/attilaberencsi/gwtools<p> "! <p>Licence: MIT<p> CLASS zcl_sapdev_gw_tool DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES zif_sapdev_gw_tool. ALIASES: wipe_client_cache FOR zif_sapdev_gw_tool~wipe_client_cache. ALIASES: wipe_global_cache FOR zif_sapdev_gw_tool~wipe_global_cache. ALIASES: wipe_odata_meta_cache FOR zif_sapdev_gw_tool~wipe_odata_meta_cache. ALIASES: wipe_odata_meta_cache_token FOR zif_sapdev_gw_tool~wipe_odata_meta_cache_token. ALIASES: calc_app_index FOR zif_sapdev_gw_tool~calc_app_index. ALIASES: get_show_icf_active FOR zif_sapdev_gw_tool~get_show_icf_active. ALIASES: get_show_icf_inactive FOR zif_sapdev_gw_tool~get_show_icf_inactive. ALIASES gc_output_mode FOR zif_sapdev_gw_tool~gc_output_mode. DATA: output_mode TYPE zif_sapdev_gw_tool=>ty_output_mode READ-ONLY. "! <p class="shorttext synchronized" lang="en">Setup</p> "! "! @parameter i_output_mode | <p class="shorttext synchronized" lang="en">Output mode (GUI/string_table)</p> METHODS constructor IMPORTING i_output_mode TYPE zif_sapdev_gw_tool=>ty_output_mode DEFAULT zif_sapdev_gw_tool=>gc_output_mode-gui_output. PROTECTED SECTION. METHODS: build_icfservice_fcat RETURNING VALUE(result) TYPE slis_t_fieldcat_alv, retrieve_list_output IMPORTING i_free TYPE abap_bool DEFAULT abap_true RETURNING VALUE(result) TYPE list_string_table, itab_to_csv IMPORTING i_tab TYPE INDEX TABLE i_separator TYPE clike DEFAULT ';' RETURNING VALUE(result) TYPE list_string_table. PRIVATE SECTION. ENDCLASS. CLASS zcl_sapdev_gw_tool IMPLEMENTATION. METHOD constructor. me->output_mode = i_output_mode. ENDMETHOD. METHOD zif_sapdev_gw_tool~wipe_client_cache. "Do we have this ? SELECT SINGLE @abap_true FROM tadir INTO @DATA(exists) WHERE pgmid = 'R3TR' AND object = 'PROG' AND obj_name = '/UI2/INVALIDATE_CLIENT_CACHES'. IF sy-subrc NE 0. IF me->output_mode = gc_output_mode-gui_output. MESSAGE 'Report /UI2/INVALIDATE_CLIENT_CACHES does not exist'(001) TYPE 'I' DISPLAY LIKE 'E'. ELSE. APPEND TEXT-001 TO result. ENDIF. RETURN. ENDIF. IF i_just_for_username IS INITIAL. IF me->output_mode = gc_output_mode-gui_output. SUBMIT /ui2/invalidate_client_caches WITH gv_all = abap_true AND RETURN. "#EC CI_SUBMIT ELSE. SUBMIT /ui2/invalidate_client_caches WITH gv_all = abap_true EXPORTING LIST TO MEMORY AND RETURN. "#EC CI_SUBMIT result = retrieve_list_output( ). ENDIF. ELSE. IF me->output_mode = gc_output_mode-gui_output. SUBMIT /ui2/invalidate_client_caches WITH gv_all = abap_false WITH gv_user = abap_true WITH g_uname = i_just_for_username AND RETURN. "#EC CI_SUBMIT ELSE. SUBMIT /ui2/invalidate_client_caches WITH gv_all = abap_false WITH gv_user = abap_true WITH g_uname = i_just_for_username EXPORTING LIST TO MEMORY AND RETURN. "#EC CI_SUBMIT result = retrieve_list_output( ). ENDIF. ENDIF. ENDMETHOD. METHOD zif_sapdev_gw_tool~wipe_global_cache. "Do we have this ? SELECT SINGLE @abap_true FROM tadir INTO @DATA(exists) WHERE pgmid = 'R3TR' AND object = 'PROG' AND obj_name = '/UI2/INVALIDATE_GLOBAL_CACHES'. IF sy-subrc NE 0. IF me->output_mode = gc_output_mode-gui_output. MESSAGE 'Report /UI2/INVALIDATE_GLOBAL_CACHES does not exist'(002) TYPE 'I' DISPLAY LIKE 'E'. ELSE. APPEND TEXT-002 TO result. ENDIF. RETURN. ENDIF. IF me->output_mode = gc_output_mode-gui_output. SUBMIT /ui2/invalidate_global_caches "#EC CI_SUBMIT WITH gv_test = abap_false WITH gv_exe = abap_true AND RETURN. ELSE. SUBMIT /ui2/invalidate_global_caches "#EC CI_SUBMIT WITH gv_test = abap_false WITH gv_exe = abap_true EXPORTING LIST TO MEMORY AND RETURN. result = retrieve_list_output( ). ENDIF. ENDMETHOD. METHOD zif_sapdev_gw_tool~wipe_odata_meta_cache. IF lines( i_service_ranges ) = 0. IF me->output_mode = gc_output_mode-gui_output. MESSAGE 'Please select at least one service'(003) TYPE 'I' DISPLAY LIKE 'E'. ELSE. APPEND TEXT-003 TO result. ENDIF. RETURN. ENDIF. SELECT * FROM /iwfnd/i_med_srh INTO TABLE @DATA(services) WHERE srv_identifier IN @i_service_ranges. LOOP AT services INTO DATA(service). /iwfnd/cl_sutil_moni=>cleanup_metadata_cache( EXPORTING iv_mode = 'A' iv_multi_origin = abap_true iv_namespace = service-namespace "'/SAP/' iv_service_name = service-service_name iv_service_version = service-service_version IMPORTING ev_error_text = DATA(error_text) ). IF error_text IS NOT INITIAL. IF me->output_mode = gc_output_mode-gui_output. WRITE: / icon_error_protocol AS ICON, service-srv_identifier. WRITE: / ' ', error_text. ELSE. APPEND |ERROR: { service-srv_identifier } | TO result. APPEND | { service-srv_identifier }| TO result. ENDIF. CONTINUE. ELSE. IF me->output_mode = gc_output_mode-gui_output. WRITE: / icon_okay AS ICON, service-srv_identifier. ELSE. APPEND |Wiped: { service-srv_identifier }| TO result ##NO_TEXT. ENDIF. ENDIF. ENDLOOP. IF sy-subrc <> 0. DATA(no_hits) = '! NO SERVICES FOUND FOR YOUR SELECTION !'. IF me->output_mode = gc_output_mode-gui_output. WRITE no_hits. ELSE. APPEND |{ no_hits }| TO result. ENDIF. ENDIF. ENDMETHOD. METHOD zif_sapdev_gw_tool~get_show_icf_active. cl_icf_service_publication=>get_activate_nodes( IMPORTING it_icf_exchg_pub = DATA(active_services) ). IF me->output_mode = gc_output_mode-gui_output. "Setup and Display List IF i_show_ui5_odata_only = abap_true. "Filter on UI5 and OData services by default DATA(list_filter) = VALUE slis_t_filter_alv( ( tabname = 'ICF_EXCHG_PUB' fieldname = 'PATH' sign0 = 'I' optio = 'CP' valuf_int = '/sap/bc/ui5_ui5/*') ( tabname = 'ICF_EXCHG_PUB' fieldname = 'PATH' sign0 = 'I' optio = 'CP' valuf_int = '/sap/opu/*') ). ENDIF. DATA(field_catalog) = build_icfservice_fcat( ). CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' "#EC SCOPE_OF_VAR EXPORTING i_structure_name = 'ICF_EXCHG_PUB' i_grid_title = CONV lvc_title( 'Active Services' ) ##NO_TEXT is_layout = VALUE slis_layout_alv( zebra = abap_true colwidth_optimize = abap_true cell_merge = 'N' ) it_filter = list_filter it_fieldcat = field_catalog TABLES t_outtab = active_services EXCEPTIONS program_error = 1 OTHERS = 2. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ELSE. IF i_show_ui5_odata_only = abap_true. "Filter on UI5 and OData services by default LOOP AT active_services TRANSPORTING NO FIELDS WHERE ( path NP '/sap/bc/ui5_ui5/*' AND path NP '/sap/opu/*' ). "#EC PREF_LINE_EX DELETE active_services. ENDLOOP. ENDIF. IF e_services IS REQUESTED. e_services = active_services. ENDIF. IF e_output IS REQUESTED. e_output = itab_to_csv( i_tab = active_services ). ENDIF. ENDIF. ENDMETHOD. METHOD zif_sapdev_gw_tool~get_show_icf_inactive. cl_icf_service_publication=>get_inactive_nodes( IMPORTING et_icf_exchg_pub = DATA(inactive_services) ). IF me->output_mode = gc_output_mode-gui_output. "Setup and Display List IF i_show_ui5_odata_only = abap_true. "Filter on UI5 and OData services by default DATA(list_filter) = VALUE slis_t_filter_alv( ( tabname = 'ICF_EXCHG_PUB' fieldname = 'PATH' sign0 = 'I' optio = 'CP' valuf_int = '/sap/bc/ui5_ui5/*') ( tabname = 'ICF_EXCHG_PUB' fieldname = 'PATH' sign0 = 'I' optio = 'CP' valuf_int = '/sap/opu/*') ). ENDIF. DATA(field_catalog) = build_icfservice_fcat( ). CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY' "#EC SCOPE_OF_VAR EXPORTING i_structure_name = 'ICF_EXCHG_PUB' ##NO_TEXT i_grid_title = CONV lvc_title( 'Inactive Services' ) ##NO_TEXT is_layout = VALUE slis_layout_alv( zebra = abap_true colwidth_optimize = abap_true cell_merge = 'N' ) it_filter = list_filter it_fieldcat = field_catalog TABLES t_outtab = inactive_services EXCEPTIONS program_error = 1 OTHERS = 2. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ELSE. IF i_show_ui5_odata_only = abap_true. "Filter on UI5 and OData services by default LOOP AT inactive_services TRANSPORTING NO FIELDS WHERE ( path NP '/sap/bc/ui5_ui5/*' AND path NP '/sap/opu/*' ). "#EC PREF_LINE_EX DELETE inactive_services. ENDLOOP. ENDIF. IF e_services IS REQUESTED. e_services = inactive_services. ENDIF. IF e_output IS REQUESTED. e_output = itab_to_csv( i_tab = inactive_services ). ENDIF. ENDIF. ENDMETHOD. METHOD build_icfservice_fcat. CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE' EXPORTING i_program_name = sy-cprog i_structure_name = 'ICF_EXCHG_PUB' CHANGING ct_fieldcat = result EXCEPTIONS inconsistent_interface = 1 program_error = 2 OTHERS = 3. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. LOOP AT result ASSIGNING FIELD-SYMBOL(<field_meta>). CASE <field_meta>-fieldname. WHEN 'VHOST' OR 'REF_VHOST' OR 'CREATION_DATE' OR 'CREATION_TIME' OR 'COUNTER'. <field_meta>-no_out = abap_true. WHEN 'PATH'. <field_meta>-seltext_s = 'Serv/Alias'. <field_meta>-seltext_m = <field_meta>-seltext_l = <field_meta>-reptext_ddic = 'Service/Alias'(004). "#EC EQUALS_CHAINING WHEN 'REF_PATH'. <field_meta>-seltext_s = 'AliasedSrv' . <field_meta>-seltext_m = <field_meta>-seltext_l = <field_meta>-reptext_ddic = 'Aliased Service'(005). "#EC EQUALS_CHAINING WHEN 'PUBLIC_SERVICE'. <field_meta>-seltext_s = <field_meta>-seltext_m = <field_meta>-seltext_l = <field_meta>-reptext_ddic = 'Public'(006). "#EC EQUALS_CHAINING ENDCASE. ENDLOOP. ENDMETHOD. METHOD retrieve_list_output. DATA: listobject TYPE STANDARD TABLE OF abaplist. CALL FUNCTION 'LIST_FROM_MEMORY' TABLES listobject = listobject EXCEPTIONS not_found = 1 OTHERS = 2. IF sy-subrc <> 0. RETURN. ENDIF. CALL FUNCTION 'LIST_TO_ASCI' IMPORTING list_string_ascii = result TABLES listobject = listobject EXCEPTIONS empty_list = 1 list_index_invalid = 2 OTHERS = 3. IF sy-subrc <> 0. RETURN. ENDIF. IF i_free = abap_true. CALL FUNCTION 'LIST_FREE_MEMORY'. ENDIF. ENDMETHOD. METHOD itab_to_csv. DATA: csv_line TYPE string. FIELD-SYMBOLS: <value> TYPE any. LOOP AT i_tab ASSIGNING FIELD-SYMBOL(<structure>). CLEAR csv_line. DO. ASSIGN COMPONENT sy-index OF STRUCTURE <structure> TO <value>. IF sy-subrc <> 0. EXIT. ENDIF. IF sy-index = 1. csv_line = |{ <value> ALPHA = OUT } |. ELSE. csv_line = |{ csv_line }{ i_separator }{ <value> ALPHA = OUT } |. ENDIF. ENDDO. APPEND csv_line TO result. ENDLOOP. ENDMETHOD. METHOD zif_sapdev_gw_tool~calc_app_index. "Do we have this ? SELECT SINGLE @abap_true FROM tadir INTO @DATA(exists) WHERE pgmid = 'R3TR' AND object = 'PROG' AND obj_name = '/UI5/APP_INDEX_CALCULATE'. IF sy-subrc NE 0. IF me->output_mode = gc_output_mode-gui_output. MESSAGE 'Report /UI5/APP_INDEX_CALCULATE does not exist'(007) TYPE 'I' DISPLAY LIKE 'E'. ELSE. APPEND TEXT-007 TO result. ENDIF. RETURN. ENDIF. IF me->output_mode = gc_output_mode-gui_output. IF i_repo IS INITIAL. SUBMIT /ui5/app_index_calculate "#EC CI_SUBMIT WITH p_all_a = abap_true WITH p_all_d = abap_false AND RETURN. ELSE. SUBMIT /ui5/app_index_calculate "#EC CI_SUBMIT WITH p_all = abap_false WITH p_distl = abap_false WITH p_repo = i_repo AND RETURN. ENDIF. ELSE. IF i_repo IS INITIAL. SUBMIT /ui5/app_index_calculate "#EC CI_SUBMIT WITH p_all_a = abap_true WITH p_all_d = abap_false EXPORTING LIST TO MEMORY AND RETURN. ELSE. SUBMIT /ui5/app_index_calculate "#EC CI_SUBMIT WITH p_all = abap_false WITH p_distl = abap_false WITH p_repo = i_repo EXPORTING LIST TO MEMORY AND RETURN. ENDIF. result = retrieve_list_output( ). ENDIF. ENDMETHOD. METHOD zif_sapdev_gw_tool~wipe_odata_meta_cache_token. "This method is the adjusted copy of report /ui5/del_odata_metadata_cache "without the final message statement, which would dump in HTTP Plugin Mode. "Omitting the naming conventions is on purpose, because tracking the changes of "the standard is more easier. TRY. IF sy-batch <> abap_true. AUTHORITY-CHECK OBJECT 'S_SUISUPRT' ID 'ACTVT' FIELD '02' ID 'SUI_AREA' FIELD 'UI5'. IF sy-subrc <> 0. AUTHORITY-CHECK OBJECT 'S_DEVELOP' ID 'DEVCLASS' DUMMY ID 'OBJTYPE' DUMMY ID 'OBJNAME' DUMMY ID 'P_GROUP' DUMMY ID 'ACTVT' FIELD '02'. IF sy-subrc <> 0. MESSAGE i001(/ui5/check_appidx). * Missing authority to change application index or metadata cache RETURN. ENDIF. ENDIF. ENDIF. DATA: lo_app_index TYPE REF TO /ui5/cl_ui5_app_index. lo_app_index ?= /ui5/cl_ui5_app_api_factory=>get_app_index_instance( ). lo_app_index->invalidate_backend_contexts( ). "SAPDEV: Custom Code - BEGIN IF me->output_mode = gc_output_mode-gui_output. MESSAGE 'Backend context tokens have been invalidated successfully'(008) TYPE 'S'. ELSE. APPEND TEXT-008 TO result. ENDIF. CATCH cx_root INTO DATA(ex_root). "#EC NEED_CX_ROOT IF me->output_mode = gc_output_mode-gui_output. MESSAGE ex_root->get_text( ) TYPE 'I' DISPLAY LIKE 'E' ##NO_TEXT. ELSE. APPEND ex_root->get_text( ) TO result ##NO_TEXT. ENDIF. ENDTRY. "SAPDEV: Custom Code - END ENDMETHOD. ENDCLASS.
32.540984
148
0.630164
126b388cc376e6c46f98c9cbe1e95c01c7303779
1,927
abap
ABAP
src/data/zcl_abapgit_data_deserializer.clas.abap
amit3kumar/ABAP_ALL
67822ae13ffda6597a91bb5b39e428c39bc445a3
[ "MIT" ]
2
2021-03-20T20:27:04.000Z
2021-03-20T20:34:58.000Z
src/data/zcl_abapgit_data_deserializer.clas.abap
amit3kumar/ABAP_ALL
67822ae13ffda6597a91bb5b39e428c39bc445a3
[ "MIT" ]
18
2019-11-05T16:18:55.000Z
2021-02-25T22:56:06.000Z
src/data/zcl_abapgit_data_deserializer.clas.abap
amit3kumar/ABAP_ALL
67822ae13ffda6597a91bb5b39e428c39bc445a3
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_data_deserializer DEFINITION PUBLIC CREATE PRIVATE GLOBAL FRIENDS zcl_abapgit_data_factory . PUBLIC SECTION. INTERFACES zif_abapgit_data_deserializer . PROTECTED SECTION. PRIVATE SECTION. METHODS read_json IMPORTING !is_file TYPE zif_abapgit_definitions=>ty_file !ir_data TYPE REF TO data RAISING zcx_abapgit_exception . ENDCLASS. CLASS ZCL_ABAPGIT_DATA_DESERIALIZER IMPLEMENTATION. METHOD read_json. DATA lo_ajson TYPE REF TO zcl_abapgit_ajson. DATA lx_ajson TYPE REF TO zcx_abapgit_ajson_error. FIELD-SYMBOLS <lg_tab> TYPE ANY TABLE. ASSIGN ir_data->* TO <lg_tab>. TRY. lo_ajson = zcl_abapgit_ajson=>parse( zcl_abapgit_convert=>xstring_to_string_utf8( is_file-data ) ). lo_ajson->zif_abapgit_ajson_reader~to_abap( IMPORTING ev_container = <lg_tab> ). CATCH zcx_abapgit_ajson_error INTO lx_ajson. zcx_abapgit_exception=>raise( lx_ajson->get_text( ) ). ENDTRY. ENDMETHOD. METHOD zif_abapgit_data_deserializer~actualize. * todo, this method will update the database ENDMETHOD. METHOD zif_abapgit_data_deserializer~deserialize. * this method does not persist any changes to the database DATA lt_configs TYPE zif_abapgit_data_config=>ty_config_tt. DATA ls_config LIKE LINE OF lt_configs. DATA lr_data TYPE REF TO data. DATA ls_file LIKE LINE OF it_files. lt_configs = ii_config->get_configs( ). LOOP AT lt_configs INTO ls_config. lr_data = zcl_abapgit_data_utils=>build_table_itab( ls_config-name ). READ TABLE it_files INTO ls_file WITH KEY path = zif_abapgit_data_config=>c_default_path filename = zcl_abapgit_data_utils=>build_filename( ls_config ). IF sy-subrc = 0. read_json( ir_data = lr_data is_file = ls_file ). ENDIF. * todo ENDLOOP. ENDMETHOD. ENDCLASS.
23.5
107
0.723404
126c4d658b927c7296e9febe5abbd9dc5ae9e8e0
16,581
abap
ABAP
src/checks/zcl_aoc_super.clas.abap
pacheco7/abapOpenChecks
57bbed6a922550c65754bde8f7fe6a385a6bc92a
[ "MIT" ]
1
2018-04-22T04:47:28.000Z
2018-04-22T04:47:28.000Z
src/checks/zcl_aoc_super.clas.abap
pacheco7/abapOpenChecks
57bbed6a922550c65754bde8f7fe6a385a6bc92a
[ "MIT" ]
null
null
null
src/checks/zcl_aoc_super.clas.abap
pacheco7/abapOpenChecks
57bbed6a922550c65754bde8f7fe6a385a6bc92a
[ "MIT" ]
null
null
null
CLASS zcl_aoc_super DEFINITION PUBLIC INHERITING FROM cl_ci_test_scan ABSTRACT CREATE PUBLIC GLOBAL FRIENDS zcl_aoc_unit_test. PUBLIC SECTION. TYPE-POOLS zzaoc. TYPES: ty_structures_tt TYPE STANDARD TABLE OF sstruc WITH NON-UNIQUE DEFAULT KEY. METHODS check IMPORTING !it_tokens TYPE stokesx_tab !it_statements TYPE sstmnt_tab !it_levels TYPE slevel_tab !it_structures TYPE ty_structures_tt. METHODS set_source IMPORTING !iv_name TYPE level_name !it_code TYPE string_table. METHODS get_compiler RETURNING VALUE(rt_result) TYPE scr_refs. METHODS get_attributes REDEFINITION. METHODS if_ci_test~display_documentation REDEFINITION. METHODS if_ci_test~query_attributes REDEFINITION. METHODS put_attributes REDEFINITION. METHODS run REDEFINITION. PROTECTED SECTION. TYPES: BEGIN OF ty_position, row TYPE token_row, col TYPE token_col, END OF ty_position . TYPES: BEGIN OF ty_statement, str TYPE string, start TYPE ty_position, end TYPE ty_position, include TYPE programm, count TYPE i, terminator TYPE stmnt_term, index TYPE i, END OF ty_statement . TYPES: ty_statements TYPE STANDARD TABLE OF ty_statement WITH DEFAULT KEY . DATA mv_errty TYPE sci_errty . METHODS enable_rfc . CLASS-METHODS statement_keyword IMPORTING !iv_number TYPE stmnt_nr !it_statements TYPE sstmnt_tab !it_tokens TYPE stokesx_tab RETURNING VALUE(rv_result) TYPE string . CLASS-METHODS statement_row IMPORTING !iv_number TYPE stmnt_nr !it_statements TYPE sstmnt_tab !it_tokens TYPE stokesx_tab RETURNING VALUE(rv_result) TYPE token_row . METHODS get_source IMPORTING !is_level TYPE slevel RETURNING VALUE(rt_code) TYPE string_table . METHODS build_statements IMPORTING !it_tokens TYPE stokesx_tab !it_statements TYPE sstmnt_tab !it_levels TYPE slevel_tab RETURNING VALUE(rt_statements) TYPE ty_statements . METHODS is_class_pool IMPORTING !iv_include TYPE level_name RETURNING VALUE(rv_bool) TYPE abap_bool . METHODS is_class_definition IMPORTING !iv_include TYPE level_name RETURNING VALUE(rv_bool) TYPE abap_bool . METHODS get_include REDEFINITION . METHODS inform REDEFINITION . PRIVATE SECTION. TYPES: BEGIN OF ty_source, name TYPE level_name, code TYPE string_table, END OF ty_source. TYPES: ty_source_tt TYPE SORTED TABLE OF ty_source WITH UNIQUE KEY name. DATA mt_cache_result TYPE scr_refs. DATA mv_cache_program TYPE program. DATA mt_source TYPE ty_source_tt. CLASS-METHODS token_position IMPORTING !is_token TYPE stokesx RETURNING VALUE(rs_position) TYPE ty_position. METHODS check_class IMPORTING !iv_sub_obj_name TYPE sobj_name RETURNING VALUE(rv_skip) TYPE abap_bool. METHODS check_wdy IMPORTING !iv_sub_obj_type TYPE trobjtype !iv_sub_obj_name TYPE sobj_name !iv_line TYPE token_row RETURNING VALUE(rv_skip) TYPE abap_bool. ENDCLASS. CLASS ZCL_AOC_SUPER IMPLEMENTATION. METHOD build_statements. DATA: lv_str TYPE string, ls_start TYPE ty_position, ls_end TYPE ty_position, lv_index TYPE i, lv_count TYPE i. FIELD-SYMBOLS: <ls_statement> LIKE LINE OF it_statements, <ls_token> LIKE LINE OF it_tokens, <ls_add> LIKE LINE OF rt_statements. LOOP AT it_statements ASSIGNING <ls_statement> WHERE type <> scan_stmnt_type-empty AND type <> scan_stmnt_type-comment AND type <> scan_stmnt_type-comment_in_stmnt AND type <> scan_stmnt_type-pragma. lv_index = sy-tabix. CLEAR lv_str. lv_count = 0. LOOP AT it_tokens ASSIGNING <ls_token> FROM <ls_statement>-from TO <ls_statement>-to. IF lv_str IS INITIAL. lv_str = <ls_token>-str. ls_start = token_position( <ls_token> ). ELSE. CONCATENATE lv_str <ls_token>-str INTO lv_str SEPARATED BY space. ENDIF. lv_count = lv_count + 1. ls_end = token_position( <ls_token> ). ENDLOOP. IF sy-subrc = 0. APPEND INITIAL LINE TO rt_statements ASSIGNING <ls_add>. <ls_add>-str = lv_str. <ls_add>-include = get_include( p_level = <ls_statement>-level ). <ls_add>-start = ls_start. <ls_add>-end = ls_end. <ls_add>-count = lv_count. <ls_add>-index = lv_index. <ls_add>-terminator = <ls_statement>-terminator. ENDIF. ENDLOOP. ENDMETHOD. METHOD check. * add code here ASSERT 0 = 1. ENDMETHOD. METHOD check_class. DATA: lv_category TYPE seoclassdf-category, lv_proxy TYPE seoclassdf-clsproxy, lv_abstract TYPE seoclassdf-clsabstrct, lv_super TYPE seometarel-refclsname, ls_mtdkey TYPE seocpdkey. IF object_type <> 'CLAS' AND object_type <> 'INTF'. RETURN. ENDIF. SELECT SINGLE category clsproxy clsabstrct FROM seoclassdf INTO (lv_category, lv_proxy, lv_abstract) WHERE clsname = object_name AND version = '1'. IF sy-subrc <> 0. RETURN. ENDIF. * skip persistent co-classes and web dynpro runtime obects IF lv_category = seoc_category_p_agent OR lv_category = seoc_category_webdynpro_class OR lv_proxy = abap_true. rv_skip = abap_true. RETURN. ENDIF. * skip constructor in exception classes IF lv_category = seoc_category_exception. cl_oo_classname_service=>get_method_by_include( EXPORTING incname = iv_sub_obj_name RECEIVING mtdkey = ls_mtdkey EXCEPTIONS class_not_existing = 1 method_not_existing = 2 OTHERS = 3 ). IF sy-subrc = 0 AND ls_mtdkey-cpdname = 'CONSTRUCTOR'. rv_skip = abap_true. RETURN. ENDIF. ENDIF. SELECT SINGLE refclsname FROM seometarel INTO lv_super WHERE clsname = object_name AND reltype = '2'. * skip classes generated by Gateway Builder/SEGW IF ( lv_abstract = abap_true AND object_name CP '*_DPC' ) OR object_name CP '*_MPC'. IF sy-subrc = 0 AND ( lv_super = '/IWBEP/CL_MGW_PUSH_ABS_MODEL' OR lv_super = '/IWBEP/CL_MGW_PUSH_ABS_DATA' ). rv_skip = abap_true. RETURN. ENDIF. ENDIF. * skip objects generated by SADL toolkit IF lv_super = 'CL_SADL_GTK_EXPOSURE_MPC'. rv_skip = abap_true. RETURN. ENDIF. ENDMETHOD. METHOD check_wdy. DATA: ls_map_header TYPE wdy_wb_sourcemap, lo_tool_state TYPE REF TO cl_wdy_wb_vc_state, lv_inclname TYPE program, ls_controller TYPE wdy_controller_key, lt_map TYPE wdyrt_line_info_tab_type, lv_no_codepos TYPE seu_bool. IF iv_sub_obj_type <> 'PROG' OR iv_sub_obj_name(8) <> '/1BCWDY/'. RETURN. ENDIF. lv_inclname = iv_sub_obj_name. CALL FUNCTION 'WDY_WB_GET_SOURCECODE_MAPPING' EXPORTING p_include = lv_inclname IMPORTING p_map = lt_map p_header = ls_map_header EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0. RETURN. ENDIF. ls_controller-component_name = ls_map_header-component_name. ls_controller-controller_name = ls_map_header-controller_name. cl_wdy_wb_error_handling=>create_tool_state_for_codepos( EXPORTING p_controller_key = ls_controller p_controller_type = ls_map_header-ctrl_type p_line = iv_line p_lineinfo = lt_map IMPORTING p_no_corresponding_codepos = lv_no_codepos p_tool_state = lo_tool_state ). IF lv_no_codepos = abap_true OR lo_tool_state IS INITIAL. rv_skip = abap_true. ENDIF. ENDMETHOD. METHOD enable_rfc. * RFC enable the check, new feature for central ATC on 7.51 FIELD-SYMBOLS: <lv_rfc> TYPE abap_bool. ASSIGN ('REMOTE_RFC_ENABLED') TO <lv_rfc>. IF sy-subrc = 0. <lv_rfc> = abap_true. ENDIF. ENDMETHOD. METHOD get_attributes. EXPORT mv_errty = mv_errty TO DATA BUFFER p_attributes. ENDMETHOD. METHOD get_compiler. DATA: lv_class TYPE seoclsname, lo_compiler TYPE REF TO cl_abap_compiler, lv_name TYPE program. CASE object_type. WHEN 'PROG'. lv_name = object_name. WHEN 'CLAS'. lv_class = object_name. lv_name = cl_oo_classname_service=>get_classpool_name( lv_class ). WHEN 'FUGR'. CONCATENATE 'SAPL' object_name INTO lv_name. WHEN OTHERS. RETURN. ENDCASE. IF lv_name = mv_cache_program. rt_result = mt_cache_result. RETURN. ENDIF. lo_compiler = cl_abap_compiler=>create( p_name = lv_name p_no_package_check = abap_true ). IF lo_compiler IS INITIAL. RETURN. ENDIF. lo_compiler->get_all( IMPORTING p_result = rt_result ). mt_cache_result = rt_result. mv_cache_program = lv_name. ENDMETHOD. METHOD get_include. IF p_level = 0. * in case INCLUDE doesnt exist in the system RETURN. ENDIF. IF ref_scan IS BOUND. * not bound during unit testing p_result = super->get_include( p_ref_scan = p_ref_scan p_level = p_level ). ENDIF. ENDMETHOD. METHOD get_source. DATA: ls_source LIKE LINE OF mt_source. FIELD-SYMBOLS: <ls_source> LIKE LINE OF mt_source. IF is_level-type = scan_level_type-macro_define OR is_level-type = scan_level_type-macro_trmac. RETURN. ENDIF. READ TABLE mt_source ASSIGNING <ls_source> WITH KEY name = is_level-name. IF sy-subrc = 0. rt_code = <ls_source>-code. ELSE. READ REPORT is_level-name INTO rt_code. "#EC CI_READ_REP ASSERT sy-subrc = 0. ls_source-name = is_level-name. ls_source-code = rt_code. INSERT ls_source INTO TABLE mt_source. ENDIF. ENDMETHOD. METHOD if_ci_test~display_documentation. DATA: lv_url TYPE string VALUE 'http://docs.abapopenchecks.org/checks/', lv_len TYPE i. lv_len = strlen( myname ) - 2. CONCATENATE lv_url myname+lv_len(2) INTO lv_url. cl_gui_frontend_services=>execute( EXPORTING document = lv_url EXCEPTIONS cntl_error = 1 error_no_gui = 2 bad_parameter = 3 file_not_found = 4 path_not_found = 5 file_extension_unknown = 6 error_execute_failed = 7 synchronous_failed = 8 not_supported_by_gui = 9 OTHERS = 10 ). "#EC CI_SUBRC ENDMETHOD. METHOD if_ci_test~query_attributes. zzaoc_top. zzaoc_fill_att mv_errty 'Error Type' ''. "#EC NOTEXT zzaoc_popup. ENDMETHOD. METHOD inform. DATA: lv_cnam TYPE reposrc-cnam, lv_area TYPE tvdir-area, lv_skip TYPE abap_bool. FIELD-SYMBOLS: <ls_message> LIKE LINE OF scimessages. IF p_sub_obj_type = 'PROG' AND p_sub_obj_name <> ''. SELECT SINGLE cnam FROM reposrc INTO lv_cnam WHERE progname = p_sub_obj_name AND r3state = 'A'. IF sy-subrc = 0 AND ( lv_cnam = 'SAP' OR lv_cnam = 'SAP*' OR lv_cnam = 'DDIC' ). RETURN. ENDIF. ENDIF. IF object_type = 'FUGR'. IF p_sub_obj_name CP 'LY*UXX' OR p_sub_obj_name CP 'LZ*UXX'. RETURN. ENDIF. SELECT SINGLE area FROM tvdir INTO lv_area WHERE area = object_name ##WARN_OK. "#EC CI_GENBUFF IF sy-subrc = 0. RETURN. ENDIF. ENDIF. lv_skip = check_class( p_sub_obj_name ). IF lv_skip = abap_true. RETURN. ENDIF. lv_skip = check_wdy( iv_sub_obj_type = p_sub_obj_type iv_sub_obj_name = p_sub_obj_name iv_line = p_line ). IF lv_skip = abap_true. RETURN. ENDIF. READ TABLE scimessages ASSIGNING <ls_message> WITH KEY test = myname code = p_code. IF sy-subrc = 0. <ls_message>-kind = p_kind. ENDIF. IF sy-subrc = 0 AND NOT mt_source IS INITIAL. READ TABLE mt_source WITH KEY name = '----------------------------------------' TRANSPORTING NO FIELDS. IF sy-subrc = 0 AND lines( mt_source ) = 1. * fix failing unit tests CLEAR <ls_message>-pcom. ENDIF. ENDIF. super->inform( p_sub_obj_type = p_sub_obj_type p_sub_obj_name = p_sub_obj_name p_position = p_position p_line = p_line p_column = p_column p_errcnt = p_errcnt p_kind = p_kind p_test = p_test p_code = p_code p_suppress = p_suppress p_param_1 = p_param_1 p_param_2 = p_param_2 p_param_3 = p_param_3 p_param_4 = p_param_4 p_inclspec = p_inclspec ). * parameters p_detail and p_checksum_1 does not exist in 730 ENDMETHOD. METHOD is_class_definition. IF strlen( iv_include ) = 32 AND ( object_type = 'CLAS' OR object_type = 'INTF' ) AND ( iv_include+30(2) = 'CO' OR iv_include+30(2) = 'CI' OR iv_include+30(2) = 'CU' OR iv_include+30(2) = 'IU' ). rv_bool = abap_true. ELSE. rv_bool = abap_false. ENDIF. ENDMETHOD. METHOD is_class_pool. IF strlen( iv_include ) = 32 AND ( ( object_type = 'CLAS' AND iv_include+30(2) = 'CP' ) OR ( object_type = 'INTF' AND iv_include+30(2) = 'IP' ) ). rv_bool = abap_true. ELSE. rv_bool = abap_false. ENDIF. ENDMETHOD. METHOD put_attributes. IMPORT mv_errty = mv_errty FROM DATA BUFFER p_attributes. "#EC CI_USE_WANTED ASSERT sy-subrc = 0. ENDMETHOD. METHOD run. * abapOpenChecks * https://github.com/larshp/abapOpenChecks * MIT License CLEAR mt_source[]. " limit memory use IF program_name IS INITIAL. RETURN. ENDIF. IF ref_scan IS INITIAL AND get( ) <> abap_true. RETURN. ENDIF. IF ref_include IS BOUND. * ref_include is not set when running checks via RFC set_source( iv_name = ref_include->trdir-name it_code = ref_include->lines ). ENDIF. check( it_tokens = ref_scan->tokens it_statements = ref_scan->statements it_levels = ref_scan->levels it_structures = ref_scan->structures ). ENDMETHOD. METHOD set_source. * used for unit testing DATA: ls_source LIKE LINE OF mt_source. ls_source-name = iv_name. ls_source-code = it_code. INSERT ls_source INTO TABLE mt_source. ENDMETHOD. METHOD statement_keyword. FIELD-SYMBOLS: <ls_statement> LIKE LINE OF it_statements, <ls_token> LIKE LINE OF it_tokens. READ TABLE it_statements ASSIGNING <ls_statement> INDEX iv_number. ASSERT sy-subrc = 0. IF <ls_statement>-from <= <ls_statement>-to. READ TABLE it_tokens ASSIGNING <ls_token> INDEX <ls_statement>-from. ASSERT sy-subrc = 0. rv_result = <ls_token>-str. ENDIF. ENDMETHOD. METHOD statement_row. FIELD-SYMBOLS: <ls_statement> LIKE LINE OF it_statements, <ls_token> LIKE LINE OF it_tokens. READ TABLE it_statements ASSIGNING <ls_statement> INDEX iv_number. ASSERT sy-subrc = 0. READ TABLE it_tokens ASSIGNING <ls_token> INDEX <ls_statement>-from. ASSERT sy-subrc = 0. rv_result = <ls_token>-row. ENDMETHOD. METHOD token_position. rs_position-col = is_token-col. rs_position-row = is_token-row. ENDMETHOD. ENDCLASS.
24.971386
81
0.61673
126cb29f7b7cda65013339593c90575e5ffbb98f
9,377
abap
ABAP
zbugtracker_core/zbugtracker_persistence/zcl_bug_tag_persist.clas.abap
rayatus/sapbugtracker
c94439c3bb21908f7945fc5bf3bd88868903e8e8
[ "MIT" ]
3
2019-02-10T22:03:43.000Z
2021-05-26T06:49:55.000Z
zbugtracker_core/zbugtracker_persistence/zcl_bug_tag_persist.clas.abap
rayatus/sapbugtracker
c94439c3bb21908f7945fc5bf3bd88868903e8e8
[ "MIT" ]
2
2020-05-06T14:25:17.000Z
2022-01-13T10:06:40.000Z
zbugtracker_core/zbugtracker_persistence/zcl_bug_tag_persist.clas.abap
rayatus/sapbugtracker
c94439c3bb21908f7945fc5bf3bd88868903e8e8
[ "MIT" ]
1
2021-05-26T06:49:56.000Z
2021-05-26T06:49:56.000Z
class ZCL_BUG_TAG_PERSIST definition public final create protected global friends ZCB_BUG_TAG_PERSIST . public section. *"* public components of class ZCL_BUG_TAG_PERSIST *"* do not include other source files here!!! interfaces IF_OS_STATE . methods GET_BUG returning value(RESULT) type ZBT_ID_BUG raising CX_OS_OBJECT_NOT_FOUND . methods GET_PRODUCTO returning value(RESULT) type ZBT_ID_PRODUCTO raising CX_OS_OBJECT_NOT_FOUND . methods GET_TAG returning value(RESULT) type ZBT_ID_TAG raising CX_OS_OBJECT_NOT_FOUND . methods GET_TAGVAL returning value(RESULT) type ZBT_TAG_VALUE raising CX_OS_OBJECT_NOT_FOUND . methods SET_TAGVAL importing !I_TAGVAL type ZBT_TAG_VALUE raising CX_OS_OBJECT_NOT_FOUND . class CL_OS_SYSTEM definition load . protected section. *"* protected components of class ZCL_BUG_TAG_PERSIST *"* do not include other source files here!!! data PRODUCTO type ZBT_ID_PRODUCTO . data BUG type ZBT_ID_BUG . data TAG type ZBT_ID_TAG . data TAGVAL type ZBT_TAG_VALUE . private section. *"* private components of class ZCL_BUG_TAG_PERSIST *"* do not include other source files here!!! ENDCLASS. CLASS ZCL_BUG_TAG_PERSIST IMPLEMENTATION. method GET_BUG. ***BUILD 090501 " returning RESULT " raising CX_OS_OBJECT_NOT_FOUND ************************************************************************ * Purpose : Get Attribute BUG * * Version : 2.0 * * Precondition : - * * Postcondition : The object state is loaded, result is set * * OO Exceptions : CX_OS_OBJECT_NOT_FOUND * * Implementation : - * ************************************************************************ * Changelog: * - 2000-03-14 : (BGR) Version 2.0 * - 2000-07-28 : (SB) OO Exceptions ************************************************************************ * * Inform class agent and handle exceptions state_read_access. result = BUG. " GET_BUG endmethod. method GET_PRODUCTO. ***BUILD 090501 " returning RESULT " raising CX_OS_OBJECT_NOT_FOUND ************************************************************************ * Purpose : Get Attribute PRODUCTO * * Version : 2.0 * * Precondition : - * * Postcondition : The object state is loaded, result is set * * OO Exceptions : CX_OS_OBJECT_NOT_FOUND * * Implementation : - * ************************************************************************ * Changelog: * - 2000-03-14 : (BGR) Version 2.0 * - 2000-07-28 : (SB) OO Exceptions ************************************************************************ * * Inform class agent and handle exceptions state_read_access. result = PRODUCTO. " GET_PRODUCTO endmethod. method GET_TAG. ***BUILD 090501 " returning RESULT " raising CX_OS_OBJECT_NOT_FOUND ************************************************************************ * Purpose : Get Attribute TAG * * Version : 2.0 * * Precondition : - * * Postcondition : The object state is loaded, result is set * * OO Exceptions : CX_OS_OBJECT_NOT_FOUND * * Implementation : - * ************************************************************************ * Changelog: * - 2000-03-14 : (BGR) Version 2.0 * - 2000-07-28 : (SB) OO Exceptions ************************************************************************ * * Inform class agent and handle exceptions state_read_access. result = TAG. " GET_TAG endmethod. method GET_TAGVAL. ***BUILD 090501 " returning RESULT " raising CX_OS_OBJECT_NOT_FOUND ************************************************************************ * Purpose : Get Attribute TAGVAL * * Version : 2.0 * * Precondition : - * * Postcondition : The object state is loaded, result is set * * OO Exceptions : CX_OS_OBJECT_NOT_FOUND * * Implementation : - * ************************************************************************ * Changelog: * - 2000-03-14 : (BGR) Version 2.0 * - 2000-07-28 : (SB) OO Exceptions ************************************************************************ * * Inform class agent and handle exceptions state_read_access. result = TAGVAL. " GET_TAGVAL endmethod. method IF_OS_STATE~GET. ***BUILD 090501 " returning result type ref to object ************************************************************************ * Purpose : Get state. * * Version : 2.0 * * Precondition : - * * Postcondition : - * * OO Exceptions : - * * Implementation : - * ************************************************************************ * Changelog: * - 2000-03-07 : (BGR) Initial Version 2.0 ************************************************************************ * GENERATED: Do not modify ************************************************************************ data: STATE_OBJECT type ref to CL_OS_STATE. create object STATE_OBJECT. call method STATE_OBJECT->SET_STATE_FROM_OBJECT( ME ). result = STATE_OBJECT. endmethod. method IF_OS_STATE~HANDLE_EXCEPTION. ***BUILD 090501 " importing I_EXCEPTION type ref to IF_OS_EXCEPTION_INFO optional " importing I_EX_OS type ref to CX_OS_OBJECT_NOT_FOUND optional ************************************************************************ * Purpose : Handles exceptions during attribute access. * * Version : 2.0 * * Precondition : - * * Postcondition : - * * OO Exceptions : CX_OS_OBJECT_NOT_FOUND * * Implementation : If an exception is raised during attribut access, * this method is called and the exception is passed * as a paramater. The default is to raise the exception * again, so that the caller can handle the exception. * But it is also possible to handle the exception * here in the callee. * ************************************************************************ * Changelog: * - 2000-03-07 : (BGR) Initial Version 2.0 * - 2000-08-02 : (SB) OO Exceptions ************************************************************************ * Modify if you like ************************************************************************ if i_ex_os is not initial. raise exception i_ex_os. endif. endmethod. method IF_OS_STATE~INIT. ***BUILD 090501 "#EC NEEDED ************************************************************************ * Purpose : Initialisation of the transient state partition. * * Version : 2.0 * * Precondition : - * * Postcondition : Transient state is initial. * * OO Exceptions : - * * Implementation : Caution!: Avoid Throwing ACCESS Events. * ************************************************************************ * Changelog: * - 2000-03-07 : (BGR) Initial Version 2.0 ************************************************************************ * Modify if you like ************************************************************************ endmethod. method IF_OS_STATE~INVALIDATE. ***BUILD 090501 "#EC NEEDED ************************************************************************ * Purpose : Do something before all persistent attributes are * cleared. * * Version : 2.0 * * Precondition : - * * Postcondition : - * * OO Exceptions : - * * Implementation : Whatever you like to do. * ************************************************************************ * Changelog: * - 2000-03-07 : (BGR) Initial Version 2.0 ************************************************************************ * Modify if you like ************************************************************************ endmethod. method IF_OS_STATE~SET. ***BUILD 090501 " importing I_STATE type ref to object ************************************************************************ * Purpose : Set state. * * Version : 2.0 * * Precondition : - * * Postcondition : - * * OO Exceptions : - * * Implementation : - * ************************************************************************ * Changelog: * - 2000-03-07 : (BGR) Initial Version 2.0 ************************************************************************ * GENERATED: Do not modify ************************************************************************ data: STATE_OBJECT type ref to CL_OS_STATE. STATE_OBJECT ?= I_STATE. call method STATE_OBJECT->SET_OBJECT_FROM_STATE( ME ). endmethod. method SET_TAGVAL. ***BUILD 090501 " importing I_TAGVAL " raising CX_OS_OBJECT_NOT_FOUND ************************************************************************ * Purpose : Set attribute TAGVAL * * Version : 2.0 * * Precondition : - * * Postcondition : The object state is loaded, attribute is set * * OO Exceptions : CX_OS_OBJECT_NOT_FOUND * * Implementation : - * ************************************************************************ * Changelog: * - 2000-03-14 : (BGR) Version 2.0 * - 2000-07-28 : (SB) OO Exceptions * - 2000-10-04 : (SB) Namespaces ************************************************************************ * * Inform class agent and handle exceptions state_write_access. if ( I_TAGVAL <> TAGVAL ). TAGVAL = I_TAGVAL. * * Inform class agent and handle exceptions state_changed. endif. "( I_TAGVAL <> TAGVAL ) " GET_TAGVAL endmethod. ENDCLASS.
24.806878
72
0.485763
12701f18a69a7ade300ca5d4956a8de2894e9a71
1,935
abap
ABAP
org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.dataflow.heuristics/abap/ZSAPLINK_ADT_INSTALLER.abap
assessorgeneral/ConQAT
2a462f23f22c22aa9d01a7a204453d1be670ba60
[ "Apache-2.0" ]
null
null
null
org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.dataflow.heuristics/abap/ZSAPLINK_ADT_INSTALLER.abap
assessorgeneral/ConQAT
2a462f23f22c22aa9d01a7a204453d1be670ba60
[ "Apache-2.0" ]
null
null
null
org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.dataflow.heuristics/abap/ZSAPLINK_ADT_INSTALLER.abap
assessorgeneral/ConQAT
2a462f23f22c22aa9d01a7a204453d1be670ba60
[ "Apache-2.0" ]
null
null
null
*&---------------------------------------------------------------------* *& Report ZSAPLINK_ADT_INSTALLER *& SAPlink ADT Installer *&---------------------------------------------------------------------* */---------------------------------------------------------------------\ *| This file is part of SAPlink for ABAP in Eclipse. | *| | *| The code of this project is provided to you under the current | *| version of the SAP Code Exchange Terms of Use. You can find the | *| text on the SAP Code Exchange webpage at http://www.sdn.sap.com | *| | *| SAPlink is provided to you AS IS with no guarantee, warranty or | *| support. | *\---------------------------------------------------------------------/ REPORT zsaplink_adt_installer. TYPE-POOLS: abap. " For testing without AiE we set this variable DATA: lv_nugget_path(300) TYPE c VALUE 'C:\Projects\SAPlinkADT\trunk\org.saplink.install\files\SAPlinkADT-SAPlink-ZAKE-SAPlink-Plugins.nugg'. " When we run in AiE then the placeholder was replaced IF cl_adt_gui_event_dispatcher=>is_adt_environment( ) = abap_true. lv_nugget_path = 'C:\Users\ladmin\.eclipse\org.eclipse.platform_3.7.0_118372976\plugins\org.saplink.install_1.0.27\files\SAPlinkADT-SAPlink-ZAKE-SAPlink-Plugins.nugg'. ENDIF. " Export result to memory to avoid an additional screen the user must close manually SUBMIT zsaplink_installer WITH nuggfil = lv_nugget_path EXPORTING LIST TO MEMORY AND RETURN. " Trigger the Nugget IF cl_adt_gui_event_dispatcher=>is_adt_environment( ) = abap_true. cl_adt_gui_event_dispatcher=>send_test_event( EXPORTING value = 'org.saplink.saplinkadt.installation.finished' ). ENDIF.
48.375
170
0.542636
12715beecde5c219726d33f55d20b8b4ff2dfbd4
591
abap
ABAP
src/zcl_rest_handler.clas.testclasses.abap
githubteamuser2/abap-rest-api
0294af81320a1574b9cbb3550cb8058e6e290334
[ "MIT" ]
null
null
null
src/zcl_rest_handler.clas.testclasses.abap
githubteamuser2/abap-rest-api
0294af81320a1574b9cbb3550cb8058e6e290334
[ "MIT" ]
null
null
null
src/zcl_rest_handler.clas.testclasses.abap
githubteamuser2/abap-rest-api
0294af81320a1574b9cbb3550cb8058e6e290334
[ "MIT" ]
null
null
null
* Production classes CLASS myclass DEFINITION. PUBLIC SECTION. CLASS-DATA text TYPE string READ-ONLY. CLASS-METHODS set_text_to_x. ENDCLASS. CLASS myclass IMPLEMENTATION. METHOD set_text_to_x. text = 'U'. ENDMETHOD. ENDCLASS. * Test classes CLASS mytest DEFINITION FOR TESTING. PRIVATE SECTION. METHODS mytest FOR TESTING. ENDCLASS. CLASS mytest IMPLEMENTATION. METHOD mytest. myclass=>set_text_to_x( ). cl_abap_unit_assert=>assert_equals( act = myclass=>text exp = 'X' ). ENDMETHOD. ENDCLASS.
21.888889
62
0.666667
127e9dd660b0b0c84d89eb5ed96ba6cf1c8badb2
98,662
abap
ABAP
org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.dataflow.heuristics/abap/ZSAPLINK_FUNCTIONGROUP.abap
SvenPeldszus/conqat
28fe004a49453894922aeb27ee3467b1748d23e9
[ "Apache-2.0" ]
1
2020-04-28T20:06:30.000Z
2020-04-28T20:06:30.000Z
org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.dataflow.heuristics/abap/ZSAPLINK_FUNCTIONGROUP.abap
SvenPeldszus/conqat
28fe004a49453894922aeb27ee3467b1748d23e9
[ "Apache-2.0" ]
null
null
null
org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.dataflow.heuristics/abap/ZSAPLINK_FUNCTIONGROUP.abap
SvenPeldszus/conqat
28fe004a49453894922aeb27ee3467b1748d23e9
[ "Apache-2.0" ]
null
null
null
class ZSAPLINK_FUNCTIONGROUP 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. methods ACTUALIZE_OBJECT_TREE . methods CREATE_TEXTPOOL importing !TEXTPOOLNODE type ref to IF_IXML_ELEMENT . methods CREATE_FUNCTION_MODULES importing !FM_NODE type ref to IF_IXML_ELEMENT !FCT_GROUP type TLIBG-AREA . methods CREATE_DOCUMENTATION importing !DOCNODE type ref to IF_IXML_ELEMENT . methods CREATE_FM_DOCUMENTATION importing !DOCNODE type ref to IF_IXML_ELEMENT . methods DEQUEUE_ABAP raising ZCX_SAPLINK . methods CREATE_INCLUDES importing !INCL_NODE type ref to IF_IXML_ELEMENT !DEVCLASS type DEVCLASS default '$TMP' . methods GET_TEXTPOOL returning value(TEXTNODE) type ref to IF_IXML_ELEMENT . methods GET_DOCUMENTATION returning value(DOCNODE) type ref to IF_IXML_ELEMENT . methods GET_FM_DOCUMENTATION importing !FM_NAME type ANY returning value(DOCNODE) type ref to IF_IXML_ELEMENT . methods GET_INCLUDES importing !MAIN_PROG type SY-REPID !FCT_GROUP type TLIBT-AREA returning value(INCL_NODE) type ref to IF_IXML_ELEMENT . methods CREATE_SOURCE importing !SOURCE type TABLE_OF_STRINGS !ATTRIBS type TRDIR . methods ENQUEUE_ABAP raising ZCX_SAPLINK . methods GET_FUNCTION_MODULES importing !FCT_GROUP type TLIBG-AREA returning value(FM_NODE) type ref to IF_IXML_ELEMENT . methods TRANSPORT_COPY importing !AUTHOR type SYUNAME !DEVCLASS type DEVCLASS raising ZCX_SAPLINK . methods GET_DYNPRO returning value(DYNP_NODE) type ref to IF_IXML_ELEMENT . methods CREATE_DYNPRO importing !DYNP_NODE type ref to IF_IXML_ELEMENT . methods GET_PFSTATUS returning value(PFSTAT_NODE) type ref to IF_IXML_ELEMENT . methods CREATE_PFSTATUS importing !PFSTAT_NODE type ref to IF_IXML_ELEMENT . endclass. "ZSAPLINK_FUNCTIONGROUP definition *----------------------------------------------------------------------* * class ZSAPLINK_FUNCTIONGROUP implementation. *----------------------------------------------------------------------* * *----------------------------------------------------------------------* class ZSAPLINK_FUNCTIONGROUP implementation. method ACTUALIZE_OBJECT_TREE. DATA: l_offset TYPE i. DATA: l_tree_string TYPE string. CONCATENATE 'PG_' 'SAPL' objname INTO l_tree_string. * If we supported namespaces, the following code would be required * FIND ALL OCCURRENCES OF '/' IN objname MATCH OFFSET l_offset. * IF sy-subrc = 0. * l_tree_string = objname. * REPLACE SECTION OFFSET l_offset LENGTH 1 OF l_tree_string WITH '/SAPL'. * CONCATENATE 'PG_' l_tree_string INTO l_tree_string. * ELSE. * CONCATENATE 'PG_' 'SAPL' objname INTO l_tree_string. * ENDIF. CALL FUNCTION 'WB_TREE_ACTUALIZE' EXPORTING tree_name = l_tree_string. endmethod. method CHECKEXISTS. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ select single area from tlibg into objname where area = objname. if sy-subrc = 0. exists = 'X'. endif. endmethod. method CREATEIXMLDOCFROMOBJECT. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ * Plugin created by: * Rich Heilman * [email protected] types: begin of t_tlibt, area type tlibt-area, spras type tlibt-spras, areat type tlibt-areat, end of t_tlibt. data rootnode type ref to if_ixml_element. data mainprognode type ref to if_ixml_element. data includesnode type ref to if_ixml_element. data functgroupnode type ref to if_ixml_element. data functionmodulesnode type ref to if_ixml_element. data docNode type ref to if_ixml_element. data textpoolnode type ref to if_ixml_element. data dynpronode type ref to if_ixml_element. data statusnode type ref to if_ixml_element. data sourcenode type ref to if_ixml_element. data fmdocumenation type ref to if_ixml_element. data rc type sysubrc. data progattribs type trdir. data progsource type rswsourcet. data _objname(30) type c. data sourcestring type string. data _objtype type string. data functiongroupname type tlibg-area. data mainfgprogname type sy-repid. DATA l_offset TYPE i. data xtlibt type t_tlibt. _objtype = getobjecttype( ). rootnode = xmldoc->create_element( _objtype ). * function groups in reserved namespace, not supported. IF objname(1) = '/'. RAISE EXCEPTION TYPE zcx_saplink EXPORTING textid = zcx_saplink=>error_message msg = 'Function Groups in / namespace are not supported'. ENDIF. * create main program name. Other namespaces are not supported CONCATENATE 'SAPL' objname INTO mainfgprogname. * If we did support namespaces, this is how we would * build the main program name * FIND ALL OCCURRENCES OF '/' IN objname MATCH OFFSET l_offset. * IF sy-subrc = 0. * mainfgprogname = objname. * REPLACE SECTION OFFSET l_offset LENGTH 1 OF mainfgprogname WITH '/SAPL'. * ELSE. * CONCATENATE 'SAPL' objname INTO mainfgprogname. * ENDIF. * Set function group name functiongroupname = objname. * Get main program attributes select single * from trdir into progattribs where name = mainfgprogname. if sy-subrc <> 0. clear ixmldocument. RAISE EXCEPTION type zcx_saplink EXPORTING textid = zcx_saplink=>not_found. endif. * Get Function group attributes clear xtlibt. select single * from tlibt into corresponding fields of xtlibt where spras = sy-langu and area = functiongroupname. if sy-subrc <> 0. RAISE EXCEPTION type zcx_saplink EXPORTING textid = zcx_saplink=>not_found. endif. setattributesfromstructure( node = rootnode structure = xtlibt ). _objname = objname. objname = mainfgprogname. " Main program is object * Write main program for function group. mainprognode = xmldoc->create_element( 'mainprogram' ). setattributesfromstructure( node = mainprognode structure = progattribs ). sourcenode = xmldoc->create_element( 'source' ). read report mainfgprogname into progsource. sourcestring = buildsourcestring( sourcetable = progsource ). rc = sourcenode->if_ixml_node~set_value( sourcestring ). textpoolnode = get_textpool( ). rc = mainprognode->append_child( textpoolnode ). docNode = get_documentation( ). rc = rootNOde->append_child( docNode ). dynpronode = get_dynpro( ). rc = mainprognode->append_child( dynpronode ). statusnode = get_pfstatus( ). rc = mainprognode->append_child( statusnode ). rc = mainprognode->append_child( sourcenode ). rc = rootnode->append_child( mainprognode ). * Get the includes includesnode = get_includes( main_prog = mainfgprogname fct_group = functiongroupname ). rc = rootnode->append_child( includesnode ). * Get function modules data. functionmodulesnode = get_function_modules( functiongroupname ). rc = rootnode->append_child( functionmodulesnode ). rc = xmldoc->append_child( rootnode ). ixmldocument = xmldoc. objname = _objname. endmethod. method CREATEOBJECTFROMIXMLDOC. */---------------------------------------------------------------------\ *| This file is part of SAPlink. | *| | *| SAPlink is free software; you can redistribute it and/or modify | *| it under the terms of the GNU General Public License as published | *| by the Free Software Foundation; either version 2 of the License, | *| or (at your option) any later version. | *| | *| SAPlink is distributed in the hope that it will be useful, | *| but WITHOUT ANY WARRANTY; without even the implied warranty of | *| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | *| GNU General Public License for more details. | *| | *| You should have received a copy of the GNU General Public License | *| along with SAPlink; if not, write to the | *| Free Software Foundation, Inc., | *| 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | *\---------------------------------------------------------------------/ * Plugin created by: * Rich Heilman * [email protected] TYPES: BEGIN OF t_tlibt, area TYPE tlibt-area, spras TYPE tlibt-spras, areat TYPE tlibt-areat, END OF t_tlibt. DATA rootnode TYPE REF TO if_ixml_element. DATA sourcenode TYPE REF TO if_ixml_element. DATA textnode TYPE REF TO if_ixml_element. DATA docnode TYPE REF TO if_ixml_element. DATA dynpnode TYPE REF TO if_ixml_element. DATA statnode TYPE REF TO if_ixml_element. DATA mainprog_node TYPE REF TO if_ixml_element. DATA functionmodule_node TYPE REF TO if_ixml_element. DATA functionmodules_node TYPE REF TO if_ixml_element. DATA includes_node TYPE REF TO if_ixml_element. DATA fmdoc_node TYPE REF TO if_ixml_element. DATA progattribs TYPE trdir. DATA source TYPE string. DATA sourcetable TYPE table_of_strings. DATA _objname(30) TYPE c. DATA _objtype TYPE string. DATA checkexists TYPE flag. DATA xtlibt TYPE t_tlibt. DATA xstext TYPE tftit-stext. DATA functiongroupname TYPE tlibg-area. _objtype = getobjecttype( ). xmldoc = ixmldocument. rootnode = xmldoc->find_from_name( _objtype ). _objname = objname. getstructurefromattributes( EXPORTING node = rootnode CHANGING structure = xtlibt ). functiongroupname = xtlibt-area. * function groups in reserved namespace, not supported. IF functiongroupname(1) = '/'. RAISE EXCEPTION TYPE zcx_saplink EXPORTING textid = zcx_saplink=>error_message msg = 'Function Groups in / namespace are not supported'. ENDIF. objname = functiongroupname. 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. * Insert the function group xstext = xtlibt-areat. CALL FUNCTION 'RS_FUNCTION_POOL_INSERT' EXPORTING function_pool = xtlibt-area short_text = xstext devclass = devclass EXCEPTIONS name_already_exists = 1 name_not_correct = 2 function_already_exists = 3 invalid_function_pool = 4 invalid_name = 5 too_many_functions = 6 no_modify_permission = 7 no_show_permission = 8 enqueue_system_failure = 9 canceled_in_corr = 10 undefined_error = 11 OTHERS = 12. * Create the function modules functionmodules_node = rootnode->find_from_name( 'functionmodules' ). create_function_modules( fm_node = functionmodules_node fct_group = functiongroupname ). * Create Includes includes_node = rootnode->find_from_name( 'includeprograms' ). create_includes( devclass = devclass incl_node = includes_node ). * Update main program..... with include statements, dynpros, gui status mainprog_node = rootnode->find_from_name( 'mainprogram' ). getstructurefromattributes( EXPORTING node = mainprog_node CHANGING structure = progattribs ). objname = progattribs-name. " Main Program Name is now the object * Update the main program enqueue_abap( ). transport_copy( author = progattribs-cnam devclass = devclass ). * Source sourcenode = mainprog_node->find_from_name( 'source' ). source = sourcenode->get_value( ). sourcetable = buildtablefromstring( source ). create_source( source = sourcetable attribs = progattribs ). * Documentation docnode = rootnode->find_from_name( 'functionGroupDocumentation' ). create_documentation( docnode ). * text pool textnode = mainprog_node->find_from_name( 'textPool' ). create_textpool( textnode ). * Dynpros dynpnode = mainprog_node->find_from_name( 'dynpros' ). create_dynpro( dynpnode ). * Gui status, titles statnode = mainprog_node->find_from_name( 'pfstatus' ). create_pfstatus( statnode ). dequeue_abap( ). * Rebuild tree structure for SE80 actualize_object_tree( ). * successful install objname = functiongroupname. name = objname. endmethod. method CREATE_DOCUMENTATION. DATA txtline_node TYPE REF TO if_ixml_element. DATA txtline_filter TYPE REF TO if_ixml_node_filter. DATA txtline_iterator TYPE REF TO if_ixml_node_iterator. DATA lang_node TYPE REF TO if_ixml_element. DATA lang_filter TYPE REF TO if_ixml_node_filter. DATA lang_iterator TYPE REF TO if_ixml_node_iterator. data obj_name type DOKHL-OBJECT. data prog_name type string. data language type string. data obj_langu type DOKHL-LANGU. data lv_str type string. data rc type sy-subrc. DATA lt_lines TYPE TABLE OF tline. FIELD-SYMBOLS: <ls_lines> LIKE LINE OF lt_lines. if docnode is not bound. return. endif. prog_name = docNode->get_attribute( name = 'OBJECT' ). obj_name = prog_name. * If no prog name, then there was no program documenation, just return. if prog_name is initial. return. endif. * Get languages from XML FREE: lang_filter, lang_iterator, lang_node. lang_filter = docNode->create_filter_name( `language` ). lang_iterator = docNode->create_iterator_filtered( lang_filter ). lang_node ?= lang_iterator->get_next( ). WHILE lang_node IS NOT INITIAL. refresh lt_lines. language = lang_node->get_attribute( name = 'SPRAS' ). obj_langu = language. * Get TextLines from XML FREE: txtline_filter, txtline_iterator, txtline_node. txtline_filter = lang_node->create_filter_name( `textLine` ). txtline_iterator = lang_node->create_iterator_filtered( txtline_filter ). txtline_node ?= txtline_iterator->get_next( ). WHILE txtline_node IS NOT INITIAL. APPEND INITIAL LINE TO lt_lines ASSIGNING <ls_lines>. me->getstructurefromattributes( EXPORTING node = txtline_node CHANGING structure = <ls_lines> ). txtline_node ?= txtline_iterator->get_next( ). ENDWHILE. * Delete any documentation that may currently exist. CALL FUNCTION 'DOCU_DEL' EXPORTING id = 'RE' "<-- Report/program documentation langu = obj_langu object = obj_name typ = 'E' EXCEPTIONS ret_code = 1 OTHERS = 2. * Now update with new documentation text CALL FUNCTION 'DOCU_UPD' EXPORTING id = 'RE' langu = obj_langu object = obj_name typ = 'E' TABLES line = lt_lines EXCEPTIONS ret_code = 1 OTHERS = 2. IF sy-subrc <> 0. RAISE EXCEPTION TYPE zcx_saplink EXPORTING textid = zcx_saplink=>error_message msg = `Program Documentation object import failed`. ENDIF. lang_node ?= lang_iterator->get_next( ). ENDWHILE. endmethod. method CREATE_DYNPRO. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ types: begin of tdyn_head_temp. include type d020s. types: dtext type d020t-dtxt. types: end of tdyn_head_temp. data: idyn_fldl type table of d021s, idyn_flow type table of d022s, idyn_mcod type table of d023s. data: xdyn_head type d020s, xdyn_fldl type d021s, xdyn_flow type d022s, xdyn_mcod type d023s. data: xdyn_text_string type string. data: xdyn_text type d020t-dtxt . data: xdyn_head_temp type tdyn_head_temp. data _objname type trobj_name. data dynpros_node type ref to if_ixml_element. data dynpros_filter type ref to if_ixml_node_filter. data dynpros_iterator type ref to if_ixml_node_iterator. data dynpro_node type ref to if_ixml_element. data dynpro_filter type ref to if_ixml_node_filter. data dynpro_iterator type ref to if_ixml_node_iterator. data dynfldl_node type ref to if_ixml_element. data dynfldl_filter type ref to if_ixml_node_filter. data dynfldl_iterator type ref to if_ixml_node_iterator. data dynmcod_node type ref to if_ixml_element. data dynmcod_filter type ref to if_ixml_node_filter. data dynmcod_iterator type ref to if_ixml_node_iterator. data dynflow_node type ref to if_ixml_element. data xdynpro_flow_source type string. data idynpro_flow_source type table_of_strings. _objname = objname. dynpros_node = dynp_node. check dynpros_node is not initial. free: dynpro_filter, dynpro_iterator, dynpro_node. dynpro_filter = dynpros_node->create_filter_name( 'dynpro' ). dynpro_iterator = dynpros_node->create_iterator_filtered( dynpro_filter ). dynpro_node ?= dynpro_iterator->get_next( ). while dynpro_node is not initial. clear: xdyn_head, xdyn_fldl, xdyn_flow, xdyn_mcod. refresh: idyn_fldl, idyn_flow, idyn_mcod. * Get the header data for the screen. call method getstructurefromattributes exporting node = dynpro_node changing structure = xdyn_head_temp. xdyn_head = xdyn_head_temp. xdyn_text = xdyn_head_temp-dtext. * Retrieve field list free: dynfldl_filter, dynfldl_iterator, dynfldl_node. dynfldl_filter = dynpro_node->create_filter_name( 'dynprofield' ). dynfldl_iterator = dynpro_node->create_iterator_filtered( dynfldl_filter ). dynfldl_node ?= dynfldl_iterator->get_next( ). while dynfldl_node is not initial. call method getstructurefromattributes exporting node = dynfldl_node changing structure = xdyn_fldl. append xdyn_fldl to idyn_fldl. dynfldl_node ?= dynfldl_iterator->get_next( ). endwhile. * Retrieve matchcode data. free: dynmcod_filter, dynmcod_iterator, dynmcod_node. dynmcod_filter = dynpro_node->create_filter_name( 'dynprofield' ). dynmcod_iterator = dynpro_node->create_iterator_filtered( dynmcod_filter ). dynmcod_node ?= dynmcod_iterator->get_next( ). while dynmcod_node is not initial. call method getstructurefromattributes exporting node = dynmcod_node changing structure = xdyn_mcod. append xdyn_mcod to idyn_mcod. dynmcod_node ?= dynmcod_iterator->get_next( ). endwhile. * retieve flow logic source. clear xdynpro_flow_source. refresh idynpro_flow_source. clear xdyn_flow. refresh idyn_flow. free dynflow_node. dynflow_node = dynpro_node->find_from_name( 'dynproflowsource' ). xdynpro_flow_source = dynflow_node->get_value( ). idynpro_flow_source = buildtablefromstring( xdynpro_flow_source ). loop at idynpro_flow_source into xdyn_flow. append xdyn_flow to idyn_flow. endloop. * Build dynpro from data call function 'RPY_DYNPRO_INSERT_NATIVE' exporting * suppress_corr_checks = ' ' * CORRNUM = ' ' header = xdyn_head dynprotext = xdyn_text * SUPPRESS_EXIST_CHECKS = ' ' * USE_CORRNUM_IMMEDIATEDLY = ' ' * SUPPRESS_COMMIT_WORK = ' ' tables fieldlist = idyn_fldl flowlogic = idyn_flow params = idyn_mcod exceptions cancelled = 1 already_exists = 2 program_not_exists = 3 not_executed = 4 others = 5. if sy-subrc <> 0. raise exception type zcx_saplink exporting textid = zcx_saplink=>system_error. endif. dynpro_node ?= dynpro_iterator->get_next( ). endwhile. endmethod. method CREATE_FM_DOCUMENTATION. DATA txtline_node TYPE REF TO if_ixml_element. DATA txtline_filter TYPE REF TO if_ixml_node_filter. DATA txtline_iterator TYPE REF TO if_ixml_node_iterator. DATA lang_node TYPE REF TO if_ixml_element. DATA lang_filter TYPE REF TO if_ixml_node_filter. DATA lang_iterator TYPE REF TO if_ixml_node_iterator. data obj_name type DOKHL-OBJECT. data fm_parm_name type string. data language type string. data obj_langu type DOKHL-LANGU. data lv_str type string. data rc type sy-subrc. DATA lt_lines TYPE TABLE OF tline. FIELD-SYMBOLS: <ls_lines> LIKE LINE OF lt_lines. if docnode is not bound. return. endif. fm_parm_name = docNode->get_attribute( name = 'OBJECT' ). obj_name = fm_parm_name. * If no fm_parm_name, then there was no documenation, just return. if fm_parm_name is initial. return. endif. * Get languages from XML FREE: lang_filter, lang_iterator, lang_node. lang_filter = docNode->create_filter_name( `language` ). lang_iterator = docNode->create_iterator_filtered( lang_filter ). lang_node ?= lang_iterator->get_next( ). WHILE lang_node IS NOT INITIAL. refresh lt_lines. language = lang_node->get_attribute( name = 'SPRAS' ). obj_langu = language. * Get TextLines from XML FREE: txtline_filter, txtline_iterator, txtline_node. txtline_filter = lang_node->create_filter_name( `textLine` ). txtline_iterator = lang_node->create_iterator_filtered( txtline_filter ). txtline_node ?= txtline_iterator->get_next( ). WHILE txtline_node IS NOT INITIAL. APPEND INITIAL LINE TO lt_lines ASSIGNING <ls_lines>. me->getstructurefromattributes( EXPORTING node = txtline_node CHANGING structure = <ls_lines> ). txtline_node ?= txtline_iterator->get_next( ). ENDWHILE. * Delete any documentation that may currently exist. CALL FUNCTION 'DOCU_DEL' EXPORTING id = 'FU' "<-- function module documentation langu = obj_langu object = obj_name typ = 'T' EXCEPTIONS ret_code = 1 OTHERS = 2. * Now update with new documentation text CALL FUNCTION 'DOCU_UPD' EXPORTING id = 'FU' langu = obj_langu object = obj_name typ = 'T' TABLES line = lt_lines EXCEPTIONS ret_code = 1 OTHERS = 2. IF sy-subrc <> 0. RAISE EXCEPTION TYPE zcx_saplink EXPORTING textid = zcx_saplink=>error_message msg = `Program Documentation object import failed`. ENDIF. lang_node ?= lang_iterator->get_next( ). ENDWHILE. endmethod. method CREATE_FUNCTION_MODULES. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ TYPES: BEGIN OF tfunct_head, name TYPE rs38l-name, global TYPE rs38l-global, remote TYPE rs38l-remote, utask TYPE rs38l-utask, stext TYPE tftit-stext, area TYPE rs38l-area, END OF tfunct_head. DATA functionmodules_node TYPE REF TO if_ixml_element. DATA source TYPE string. DATA sourcetable TYPE table_of_strings. DATA functiongroupname TYPE tlibg-area. DATA mainfgprogname TYPE trdir-name. DATA xfunct_head TYPE tfunct_head. DATA iimport TYPE TABLE OF rsimp. DATA ichange TYPE TABLE OF rscha. DATA iexport TYPE TABLE OF rsexp. DATA itables TYPE TABLE OF rstbl. DATA iexcepl TYPE TABLE OF rsexc. DATA idocume TYPE TABLE OF rsfdo. DATA isource TYPE TABLE OF rssource. DATA isource_new TYPE rsfb_source. DATA ximport TYPE rsimp. DATA xchange TYPE rscha. DATA xexport TYPE rsexp. DATA xtables TYPE rstbl. DATA xexcepl TYPE rsexc. DATA xdocume TYPE rsfdo. DATA xsource TYPE rssource. DATA xsource_new LIKE LINE OF isource_new. 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 im_node TYPE REF TO if_ixml_element. DATA im_filter TYPE REF TO if_ixml_node_filter. DATA im_iterator TYPE REF TO if_ixml_node_iterator. DATA ex_node TYPE REF TO if_ixml_element. DATA ex_filter TYPE REF TO if_ixml_node_filter. DATA ex_iterator TYPE REF TO if_ixml_node_iterator. DATA ch_node TYPE REF TO if_ixml_element. DATA ch_filter TYPE REF TO if_ixml_node_filter. DATA ch_iterator TYPE REF TO if_ixml_node_iterator. DATA ta_node TYPE REF TO if_ixml_element. DATA ta_filter TYPE REF TO if_ixml_node_filter. DATA ta_iterator TYPE REF TO if_ixml_node_iterator. DATA el_node TYPE REF TO if_ixml_element. DATA el_filter TYPE REF TO if_ixml_node_filter. DATA el_iterator TYPE REF TO if_ixml_node_iterator. DATA dm_node TYPE REF TO if_ixml_element. DATA dm_filter TYPE REF TO if_ixml_node_filter. DATA dm_iterator TYPE REF TO if_ixml_node_iterator. DATA sc_node TYPE REF TO if_ixml_element. DATA sc_filter TYPE REF TO if_ixml_node_filter. DATA sc_iterator TYPE REF TO if_ixml_node_iterator. DATA scn_node TYPE REF TO if_ixml_element. DATA scn_filter TYPE REF TO if_ixml_node_filter. DATA scn_iterator TYPE REF TO if_ixml_node_iterator. DATA fmdoc_node TYPE REF TO if_ixml_element. functionmodules_node = fm_node. functiongroupname = fct_group. IF functionmodules_node IS NOT INITIAL. FREE: filter, iterator, node. filter = functionmodules_node->create_filter_name( 'functionmodule' ). iterator = functionmodules_node->create_iterator_filtered( filter ). node ?= iterator->get_next( ). WHILE node IS NOT INITIAL. CALL METHOD getstructurefromattributes EXPORTING node = node CHANGING structure = xfunct_head. REFRESH: iimport, ichange, iexport, itables, iexcepl, idocume, isource, isource_new. * Get importing FREE: im_filter, im_iterator, im_node. im_filter = node->create_filter_name( 'importing' ). im_iterator = node->create_iterator_filtered( im_filter ). im_node ?= im_iterator->get_next( ). WHILE im_node IS NOT INITIAL. CALL METHOD getstructurefromattributes EXPORTING node = im_node CHANGING structure = ximport. APPEND ximport TO iimport. im_node ?= im_iterator->get_next( ). ENDWHILE. * Get exporting FREE: ex_filter, ex_iterator, ex_node. ex_filter = node->create_filter_name( 'exporting' ). ex_iterator = node->create_iterator_filtered( ex_filter ). ex_node ?= ex_iterator->get_next( ). WHILE ex_node IS NOT INITIAL. CALL METHOD getstructurefromattributes EXPORTING node = ex_node CHANGING structure = xexport. APPEND xexport TO iexport. ex_node ?= ex_iterator->get_next( ). ENDWHILE. * Get changing FREE: ch_filter, ch_iterator, ch_node. ch_filter = node->create_filter_name( 'changing' ). ch_iterator = node->create_iterator_filtered( ch_filter ). ch_node ?= ch_iterator->get_next( ). WHILE ch_node IS NOT INITIAL. CALL METHOD getstructurefromattributes EXPORTING node = ch_node CHANGING structure = xchange. APPEND xchange TO ichange. ch_node ?= ch_iterator->get_next( ). ENDWHILE. * Get tables FREE: ta_filter, ta_iterator, ta_node. ta_filter = node->create_filter_name( 'tables' ). ta_iterator = node->create_iterator_filtered( ta_filter ). ta_node ?= ta_iterator->get_next( ). WHILE ta_node IS NOT INITIAL. CALL METHOD getstructurefromattributes EXPORTING node = ta_node CHANGING structure = xtables. APPEND xtables TO itables. ta_node ?= ta_iterator->get_next( ). ENDWHILE. * Get exception list FREE: el_filter, el_iterator, el_node. el_filter = node->create_filter_name( 'exceptions' ). el_iterator = node->create_iterator_filtered( el_filter ). el_node ?= el_iterator->get_next( ). WHILE el_node IS NOT INITIAL. CALL METHOD getstructurefromattributes EXPORTING node = el_node CHANGING structure = xexcepl. APPEND xexcepl TO iexcepl. el_node ?= el_iterator->get_next( ). ENDWHILE. * Get documentation FREE: dm_filter, dm_iterator, dm_node. dm_filter = node->create_filter_name( 'documentation' ). dm_iterator = node->create_iterator_filtered( dm_filter ). dm_node ?= dm_iterator->get_next( ). WHILE dm_node IS NOT INITIAL. CALL METHOD getstructurefromattributes EXPORTING node = dm_node CHANGING structure = xdocume. APPEND xdocume TO idocume. dm_node ?= dm_iterator->get_next( ). ENDWHILE. * Get fm source FREE: sc_filter, sc_iterator, sc_node. sc_filter = node->create_filter_name( 'fm_source' ). sc_iterator = node->create_iterator_filtered( sc_filter ). sc_node ?= sc_iterator->get_next( ). WHILE sc_node IS NOT INITIAL. source = sc_node->get_value( ). sourcetable = buildtablefromstring( source ). LOOP AT sourcetable INTO xsource. APPEND xsource TO isource. ENDLOOP. sc_node ?= sc_iterator->get_next( ). ENDWHILE. * Get fm source new FREE: scn_filter, scn_iterator, scn_node. scn_filter = node->create_filter_name( 'fm_source_new' ). scn_iterator = node->create_iterator_filtered( scn_filter ). scn_node ?= scn_iterator->get_next( ). WHILE scn_node IS NOT INITIAL. source = scn_node->get_value( ). sourcetable = buildtablefromstring( source ). LOOP AT sourcetable INTO xsource_new. APPEND xsource_new TO isource_new. ENDLOOP. scn_node ?= scn_iterator->get_next( ). ENDWHILE. * INsert the function module CALL FUNCTION 'RS_FUNCTIONMODULE_INSERT' EXPORTING funcname = xfunct_head-name function_pool = functiongroupname interface_global = xfunct_head-global remote_call = xfunct_head-remote update_task = xfunct_head-utask short_text = xfunct_head-stext save_active = ' ' "<-- Need to set inactive new_source = isource_new TABLES import_parameter = iimport export_parameter = iexport tables_parameter = itables changing_parameter = ichange exception_list = iexcepl parameter_docu = idocume source = isource EXCEPTIONS double_task = 1 error_message = 2 function_already_exists = 3 invalid_function_pool = 4 invalid_name = 5 too_many_functions = 6 no_modify_permission = 7 no_show_permission = 8 enqueue_system_failure = 9 canceled_in_corr = 10 OTHERS = 11. * Create function module documentation fmdoc_node = node->find_from_name( 'functionModuleDocumentation' ). create_fm_documentation( fmdoc_node ). node ?= iterator->get_next( ). ENDWHILE. ENDIF. endmethod. method CREATE_INCLUDES. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ types: begin of tinclude, name(40), end of tinclude. data iinclude type table of tinclude. data xinclude type tinclude. data inc_node type ref to if_ixml_element. data inc_filter type ref to if_ixml_node_filter. data inc_iterator type ref to if_ixml_node_iterator. data progattribs type trdir. data includes_node type ref to if_ixml_element. data includesourcenode type ref to if_ixml_element. data source type string. data sourcetable type table_of_strings. includes_node = incl_node. check includes_node is not initial. free: inc_filter, inc_iterator, inc_node. inc_filter = includes_node->create_filter_name( 'include' ). inc_iterator = includes_node->create_iterator_filtered( inc_filter ). inc_node ?= inc_iterator->get_next( ). while inc_node is not initial. getstructurefromattributes( exporting node = inc_node changing structure = progattribs ). includesourcenode = inc_node->find_from_name( 'include_source' ). source = includesourcenode->get_value( ). sourcetable = buildtablefromstring( source ). objname = progattribs-name. " Include Program Name is the object enqueue_abap( ). transport_copy( author = progattribs-cnam devclass = devclass ). create_source( source = sourcetable attribs = progattribs ). dequeue_abap( ). inc_node ?= inc_iterator->get_next( ). endwhile. endmethod. method CREATE_PFSTATUS. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ data: ista type table of rsmpe_stat, ifun type table of rsmpe_funt, imen type table of rsmpe_men, imtx type table of rsmpe_mnlt, iact type table of rsmpe_act, ibut type table of rsmpe_but, ipfk type table of rsmpe_pfk, iset type table of rsmpe_staf, idoc type table of rsmpe_atrt, itit type table of rsmpe_titt, ibiv type table of rsmpe_buts. data: xsta type rsmpe_stat, xfun type rsmpe_funt, xmen type rsmpe_men, xmtx type rsmpe_mnlt, xact type rsmpe_act, xbut type rsmpe_but, xpfk type rsmpe_pfk, xset type rsmpe_staf, xdoc type rsmpe_atrt, xtit type rsmpe_titt, xbiv type rsmpe_buts. data xtrkey type trkey. data xadm type rsmpe_adm. data _program type trdir-name. data _objname type trobj_name. data stat_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. _objname = objname. stat_node = pfstat_node. check stat_node is not initial. * read pfstatus_sta node free: filter, iterator, node. filter = stat_node->create_filter_name( 'pfstatus_sta' ). iterator = stat_node->create_iterator_filtered( filter ). node ?= iterator->get_next( ). while node is not initial. call method getstructurefromattributes exporting node = node changing structure = xsta. append xsta to ista. node ?= iterator->get_next( ). endwhile. * read pfstatus_fun node free: filter, iterator, node. filter = stat_node->create_filter_name( 'pfstatus_fun' ). iterator = stat_node->create_iterator_filtered( filter ). node ?= iterator->get_next( ). while node is not initial. call method getstructurefromattributes exporting node = node changing structure = xfun. append xfun to ifun. node ?= iterator->get_next( ). endwhile. * read pfstatus_men node free: filter, iterator, node. filter = stat_node->create_filter_name( 'pfstatus_men' ). iterator = stat_node->create_iterator_filtered( filter ). node ?= iterator->get_next( ). while node is not initial. call method getstructurefromattributes exporting node = node changing structure = xmen. append xmen to imen. node ?= iterator->get_next( ). endwhile. * read pfstatus_mtx node free: filter, iterator, node. filter = stat_node->create_filter_name( 'pfstatus_mtx' ). iterator = stat_node->create_iterator_filtered( filter ). node ?= iterator->get_next( ). while node is not initial. call method getstructurefromattributes exporting node = node changing structure = xmtx. append xmtx to imtx. node ?= iterator->get_next( ). endwhile. * read pfstatus_act node free: filter, iterator, node. filter = stat_node->create_filter_name( 'pfstatus_act' ). iterator = stat_node->create_iterator_filtered( filter ). node ?= iterator->get_next( ). while node is not initial. call method getstructurefromattributes exporting node = node changing structure = xact. append xact to iact. node ?= iterator->get_next( ). endwhile. * read pfstatus_but node free: filter, iterator, node. filter = stat_node->create_filter_name( 'pfstatus_but' ). iterator = stat_node->create_iterator_filtered( filter ). node ?= iterator->get_next( ). while node is not initial. call method getstructurefromattributes exporting node = node changing structure = xbut. append xbut to ibut. node ?= iterator->get_next( ). endwhile. * read pfstatus_pfk node free: filter, iterator, node. filter = stat_node->create_filter_name( 'pfstatus_pfk' ). iterator = stat_node->create_iterator_filtered( filter ). node ?= iterator->get_next( ). while node is not initial. call method getstructurefromattributes exporting node = node changing structure = xpfk. append xpfk to ipfk. node ?= iterator->get_next( ). endwhile. * read pfstatus_set node free: filter, iterator, node. filter = stat_node->create_filter_name( 'pfstatus_set' ). iterator = stat_node->create_iterator_filtered( filter ). node ?= iterator->get_next( ). while node is not initial. call method getstructurefromattributes exporting node = node changing structure = xset. append xset to iset. node ?= iterator->get_next( ). endwhile. * read pfstatus_doc node free: filter, iterator, node. filter = stat_node->create_filter_name( 'pfstatus_doc' ). iterator = stat_node->create_iterator_filtered( filter ). node ?= iterator->get_next( ). while node is not initial. call method getstructurefromattributes exporting node = node changing structure = xdoc. append xdoc to idoc. node ?= iterator->get_next( ). endwhile. * read pfstatus_tit node free: filter, iterator, node. filter = stat_node->create_filter_name( 'pfstatus_tit' ). iterator = stat_node->create_iterator_filtered( filter ). node ?= iterator->get_next( ). while node is not initial. call method getstructurefromattributes exporting node = node changing structure = xtit. append xtit to itit. node ?= iterator->get_next( ). endwhile. * read pfstatus_biv node free: filter, iterator, node. filter = stat_node->create_filter_name( 'pfstatus_biv' ). iterator = stat_node->create_iterator_filtered( filter ). node ?= iterator->get_next( ). while node is not initial. call method getstructurefromattributes exporting node = node changing structure = xbiv. append xbiv to ibiv. node ?= iterator->get_next( ). endwhile. * Update the gui status _program = _objname. xtrkey-obj_type = 'PROG'. xtrkey-obj_name = _program. xtrkey-sub_type = 'CUAD'. xtrkey-sub_name = _program. call function 'RS_CUA_INTERNAL_WRITE' exporting program = _program language = sy-langu tr_key = xtrkey adm = xadm state = 'I' tables sta = ista fun = ifun men = imen mtx = imtx act = iact but = ibut pfk = ipfk set = iset doc = idoc tit = itit biv = ibiv exceptions not_found = 1 others = 2. if sy-subrc <> 0. raise exception type zcx_saplink exporting textid = zcx_saplink=>system_error. endif. endmethod. method CREATE_SOURCE. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ data _objName type TROBJ_NAME. data progLine type PROGDIR. data titleInfo type trdirti. data reportLine type string. data miniReport type table_of_strings. _objName = objName. call function 'RS_INSERT_INTO_WORKING_AREA' exporting OBJECT = 'REPS' OBJ_NAME = _objName exceptions WRONG_OBJECT_NAME = 1. INSERT REPORT _objName FROM source STATE 'I' program type attribs-subc. "added to handle includes, etc. MOVE 'I' TO progline-STATE. move-corresponding attribs to progline. modify progdir from progline. * Are you kidding me?!? No idea why you need to do this!! CONCATENATE 'REPORT' _objName '.' INTO reportLine SEPARATED BY SPACE. append reportline to miniReport. INSERT REPORT _objName FROM miniReport STATE 'A' program type attribs-subc. "added to handle includes, etc. MOVE 'A' TO progline-STATE. modify progdir from progline. endmethod. method CREATE_TEXTPOOL. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ data textPoolTable type standard table of textPool. data textPoolRow type textPool. data langIterator type ref to if_ixml_node_iterator. data filter type ref to if_ixml_node_filter. data textFilter type ref to if_ixml_node_filter. data textIterator type ref to if_ixml_node_iterator. data langNode type ref to if_ixml_element. data aTextNode type ref to if_ixml_element. data _objName type TROBJ_NAME. data lang type spras. data langNodeExists type flag. data logonLanguageExists type flag. data _state(1) type c. _objName = objName. filter = textPoolNode->create_filter_name( 'language' ). langIterator = textPoolNode->create_iterator_filtered( filter ). langNode ?= langIterator->get_next( ). while langNode is not initial. langNodeExists = 'X'. CALL FUNCTION 'RS_INSERT_INTO_WORKING_AREA' EXPORTING OBJECT = 'REPT' OBJ_NAME = _objName EXCEPTIONS OTHERS = 0. refresh textPoolTable. textIterator = langNode->create_iterator( ). aTextNode ?= textIterator->get_next( ). *For some reason the 1st one is blank... not sure why. aTextNode ?= textIterator->get_next( ). while aTextNode is not initial. call method GETSTRUCTUREFROMATTRIBUTES exporting node = aTextNode changing structure = textPoolRow. append textPoolRow to textPoolTable. aTextNode ?= textIterator->get_next( ). endwhile. if textPoolTable is not initial. lang = langNode->get_attribute( 'SPRAS' ). if lang = sy-langu. logonLanguageExists = 'X'. _state = 'I'. else. * seems that if a textpool is inserted as inactive for language * other than the logon language, it is lost upon activation * not sure inserting as active is best solution,but seems to work _state = 'A'. endif. endif. insert textpool _objName from textPooltable language lang state _state. langNode ?= langIterator->get_next( ). endwhile. endmethod. method DELETEOBJECT. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ data area type RS38L-AREA. area = objName. call function 'RS_FUNCTION_POOL_DELETE' EXPORTING AREA = area * CORRNUM = ' ' * TEXT = ' ' * UNAME = ' ' WITH_KORR = ' ' * WB_FB_MANAGER = SUPPRESS_POPUPS = 'X' * SKIP_PROGRESS_IND = ' ' * IMPORTING * E_CORRNUM = EXCEPTIONS CANCELED_IN_CORR = 1 ENQUEUE_SYSTEM_FAILURE = 2 FUNCTION_EXIST = 3 NOT_EXECUTED = 4 NO_MODIFY_PERMISSION = 5 NO_SHOW_PERMISSION = 6 PERMISSION_FAILURE = 7 POOL_NOT_EXIST = 8 CANCELLED = 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. endmethod. method DEQUEUE_ABAP. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ call function 'RS_ACCESS_PERMISSION' exporting global_lock = 'X' mode = 'FREE' object = objName object_class = 'ABAP' exceptions canceled_in_corr = 1 enqueued_by_user = 3 enqueue_system_failure = 4 locked_by_author = 5 illegal_parameter_values = 6 no_modify_permission = 7 no_show_permission = 8 permission_failure = 9. if sy-subrc <> 0. case sy-subrc. when 7 or 8 or 9. raise exception type zcx_saplink exporting textid = zcx_saplink=>not_authorized. when 5. raise exception type zcx_saplink exporting textid = zcx_saplink=>error_message msg = 'object locked'. when others. raise exception type zcx_saplink exporting textid = zcx_saplink=>system_error. endcase. endif. endmethod. method ENQUEUE_ABAP. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ call function 'RS_ACCESS_PERMISSION' exporting * authority_check = authority_check global_lock = 'X' mode = 'INSERT' * master_language = trdir-rload object = objName object_class = 'ABAP' * importing * transport_key = trkey_global * new_master_language = trdir-rload * devclass = devclass_local exceptions canceled_in_corr = 1 enqueued_by_user = 3 enqueue_system_failure = 4 locked_by_author = 5 illegal_parameter_values = 6 no_modify_permission = 7 no_show_permission = 8 permission_failure = 9. if sy-subrc <> 0. case sy-subrc. when 7 or 8 or 9. raise exception type zcx_saplink exporting textid = zcx_saplink=>not_authorized. when 5. raise exception type zcx_saplink exporting textid = zcx_saplink=>error_message msg = 'object locked'. when others. raise exception type zcx_saplink exporting textid = zcx_saplink=>system_error. endcase. endif. endmethod. method GETOBJECTTYPE. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ objectType = 'FUGR'. " Function Group endmethod. method GET_DOCUMENTATION. data languageNode type ref to if_ixml_element. DATA txtlines_node TYPE REF TO if_ixml_element. DATA rc TYPE sysubrc. DATA _objtype TYPE string. Types: BEGIN OF t_dokhl, id TYPE dokhl-id, object TYPE dokhl-object, langu type dokhl-langu, typ TYPE dokhl-typ, dokversion TYPE dokhl-dokversion, END OF t_dokhl. data lt_dokhl type table of t_dokhl. data ls_dokhl like line of lt_dokhl. DATA lt_lines TYPE TABLE OF tline. DATA ls_lines LIKE LINE OF lt_lines. data lv_str type string. DATA _objname TYPE e071-obj_name. _objname = objname. * Check against database SELECT id object langu typ dokversion INTO corresponding fields of table lt_dokhl FROM dokhl WHERE id = 'RE' AND object = _objname. * Use only most recent version. sort lt_dokhl by id object langu typ ascending dokversion descending. delete adjacent duplicates from lt_dokhl comparing id object typ langu. docNode = xmlDoc->create_element( 'functionGroupDocumentation' ). * Make sure there is at least one record here. clear ls_dokhl. read table lt_dokhl into ls_dokhl index 1. if sy-subrc <> 0. return. endif. * Set docNode object attribute lv_str = ls_dokhl-object. rc = docNode->set_attribute( name = 'OBJECT' value = lv_Str ). Loop at lt_dokhl into ls_dokhl. * Create language node, and set attribute languageNode = xmlDoc->create_element( 'language' ). lv_str = ls_dokhl-langu. rc = languageNode->set_attribute( name = 'SPRAS' value = lv_Str ). * Read the documentation text CALL FUNCTION 'DOCU_READ' EXPORTING id = ls_dokhl-id langu = ls_dokhl-langu object = ls_dokhl-object typ = ls_dokhl-typ version = ls_dokhl-dokversion TABLES line = lt_lines. * Write records to XML node LOOP AT lt_lines INTO ls_lines. txtlines_node = xmlDoc->create_element( `textLine` ). me->setattributesfromstructure( node = txtlines_node structure = ls_lines ). rc = languageNode->append_child( txtlines_node ). ENDLOOP. rc = docNode->append_child( languageNode ) . Endloop. endmethod. method GET_DYNPRO. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ types: begin of tdynp, prog type d020s-prog, dnum type d020s-dnum, end of tdynp. data: idyn_fldl type table of d021s, idyn_flow type table of d022s, idyn_mcod type table of d023s. data: xdyn_head type d020s, xdyn_fldl type d021s, xdyn_flow type d022s, xdyn_mcod type d023s. data idynp type table of tdynp. data xdynp type tdynp. data xdyn_text type d020t-dtxt. data xdyn_text_string type string. data _objname type trobj_name. data rc type sy-subrc . data iflowsource type rswsourcet. data xflowsource like line of iflowsource. data flowsourcestring type string. data dynnr_node type ref to if_ixml_element. data dynpromatchnode type ref to if_ixml_element. data dynprofieldsnode type ref to if_ixml_element. data dynproflownode type ref to if_ixml_element. _objname = objname. * Get all dynpros for program object clear xdynp. refresh idynp. select prog dnum into table idynp from d020s where prog = _objname and type <> 'S' " No Selection Screens and type <> 'J'. " No selection subscreens check sy-subrc = 0 . dynp_node = xmldoc->create_element( 'dynpros' ). loop at idynp into xdynp. * Retrieve dynpro imformation dynnr_node = xmldoc->create_element( 'dynpro' ). clear: xdyn_head, xdyn_fldl, xdyn_flow, xdyn_mcod. refresh: idyn_fldl, idyn_flow, idyn_mcod. call function 'RPY_DYNPRO_READ_NATIVE' exporting progname = xdynp-prog dynnr = xdynp-dnum * SUPPRESS_EXIST_CHECKS = ' ' * SUPPRESS_CORR_CHECKS = ' ' importing HEADER = xdyn_head dynprotext = xdyn_text tables fieldlist = idyn_fldl flowlogic = idyn_flow params = idyn_mcod * FIELDTEXTS = exceptions cancelled = 1 not_found = 2 permission_error = 3 others = 4. check sy-subrc = 0. * Add heading information for screen. setattributesfromstructure( node = dynnr_node structure = xdyn_head ). * Add the dynpro text also. xdyn_text_string = xdyn_text. rc = dynnr_node->set_attribute( name = 'DTEXT' value = xdyn_text_string ). rc = dynp_node->append_child( dynnr_node ). * Add fields information for screen. if not idyn_fldl[] is initial. loop at idyn_fldl into xdyn_fldl. dynprofieldsnode = xmldoc->create_element( 'dynprofield' ). setattributesfromstructure( node = dynprofieldsnode structure = xdyn_fldl ). rc = dynnr_node->append_child( dynprofieldsnode ). endloop. endif. * Add flow logic of screen if not idyn_flow[] is initial. clear xflowsource. refresh iflowsource. loop at idyn_flow into xdyn_flow. xflowsource = xdyn_flow. append xflowsource to iflowsource. endloop. dynproflownode = xmldoc->create_element( 'dynproflowsource' ). flowsourcestring = buildsourcestring( sourcetable = iflowsource ). rc = dynproflownode->if_ixml_node~set_value( flowsourcestring ). rc = dynnr_node->append_child( dynproflownode ). endif. * Add matchcode information for screen. if not idyn_mcod[] is initial. loop at idyn_mcod into xdyn_mcod. check not xdyn_mcod-type is initial and not xdyn_mcod-content is initial. dynpromatchnode = xmldoc->create_element( 'dynpromatchcode' ). setattributesfromstructure( node = dynpromatchnode structure = xdyn_mcod ). rc = dynnr_node->append_child( dynpromatchnode ). endloop. endif. endloop. endmethod. method GET_FM_DOCUMENTATION. DATA languagenode TYPE REF TO if_ixml_element. DATA txtlines_node TYPE REF TO if_ixml_element. DATA rc TYPE sysubrc. DATA _objtype TYPE string. TYPES: BEGIN OF t_dokhl, id TYPE dokhl-id, object TYPE dokhl-object, langu TYPE dokhl-langu, typ TYPE dokhl-typ, dokversion TYPE dokhl-dokversion, END OF t_dokhl. DATA lt_dokhl TYPE TABLE OF t_dokhl. DATA ls_dokhl LIKE LINE OF lt_dokhl. DATA lt_lines TYPE TABLE OF tline. DATA ls_lines LIKE LINE OF lt_lines. DATA lv_str TYPE string. DATA _objname TYPE e071-obj_name. _objname = fm_name. * Check against database SELECT id object langu typ dokversion INTO CORRESPONDING FIELDS OF TABLE lt_dokhl FROM dokhl WHERE id = 'FU' AND object = _objname. * Use only most recent version. SORT lt_dokhl BY id object langu typ ASCENDING dokversion DESCENDING. DELETE ADJACENT DUPLICATES FROM lt_dokhl COMPARING id object typ langu. docnode = xmldoc->create_element( 'functionModuleDocumentation' ). * Make sure there is at least one record here. CLEAR ls_dokhl. READ TABLE lt_dokhl INTO ls_dokhl INDEX 1. IF sy-subrc <> 0. RETURN. ENDIF. * Set docNode object attribute lv_str = ls_dokhl-object. rc = docnode->set_attribute( name = 'OBJECT' value = lv_str ). LOOP AT lt_dokhl INTO ls_dokhl. * Create language node, and set attribute languagenode = xmldoc->create_element( 'language' ). lv_str = ls_dokhl-langu. rc = languagenode->set_attribute( name = 'SPRAS' value = lv_str ). * Read the documentation text CALL FUNCTION 'DOCU_READ' EXPORTING id = ls_dokhl-id langu = ls_dokhl-langu object = ls_dokhl-object typ = ls_dokhl-typ version = ls_dokhl-dokversion TABLES line = lt_lines. * Write records to XML node LOOP AT lt_lines INTO ls_lines. txtlines_node = xmldoc->create_element( `textLine` ). me->setattributesfromstructure( node = txtlines_node structure = ls_lines ). rc = languagenode->append_child( txtlines_node ). ENDLOOP. rc = docnode->append_child( languagenode ) . ENDLOOP. endmethod. method GET_FUNCTION_MODULES. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ TYPES: BEGIN OF tfunct_head, name TYPE rs38l-name, global TYPE rs38l-global, remote TYPE rs38l-remote, utask TYPE rs38l-utask, stext TYPE tftit-stext, area TYPE rs38l-area, END OF tfunct_head. DATA xfunct_head TYPE tfunct_head. DATA iimport TYPE TABLE OF rsimp. DATA ichange TYPE TABLE OF rscha. DATA iexport TYPE TABLE OF rsexp. DATA itables TYPE TABLE OF rstbl. DATA iexcepl TYPE TABLE OF rsexc. DATA idocume TYPE TABLE OF rsfdo. DATA isource TYPE TABLE OF rssource. DATA isource_new TYPE rsfb_source . DATA ximport TYPE rsimp. DATA xchange TYPE rscha. DATA xexport TYPE rsexp. DATA xtables TYPE rstbl. DATA xexcepl TYPE rsexc. DATA xdocume TYPE rsfdo. DATA xsource TYPE rssource. DATA xsource_new LIKE LINE OF isource_new. DATA functionmodulesnode TYPE REF TO if_ixml_element. DATA functionmodulenode TYPE REF TO if_ixml_element. DATA importsnode TYPE REF TO if_ixml_element. DATA changesnode TYPE REF TO if_ixml_element. DATA exportsnode TYPE REF TO if_ixml_element. DATA tablesnode TYPE REF TO if_ixml_element. DATA exceplnode TYPE REF TO if_ixml_element. DATA documsnode TYPE REF TO if_ixml_element. DATA fmsrcenode TYPE REF TO if_ixml_element. DATA fmsrcenewnode TYPE REF TO if_ixml_element. DATA fmdocumenation TYPE REF TO if_ixml_element. DATA fmparmdocumenation TYPE REF TO if_ixml_element. DATA functiongroupname TYPE tlibg-area. DATA ifunct TYPE TABLE OF rs38l_incl. DATA xfunct TYPE rs38l_incl. DATA rc TYPE sysubrc. DATA progattribs TYPE trdir. DATA progsource TYPE rswsourcet. DATA _objname(30) TYPE c. DATA sourcestring TYPE string. DATA function_deleted TYPE c. DATA endfunction_deleted TYPE c. DATA lv_len TYPE i. functiongroupname = fct_group. * Now get the function pool contents CALL FUNCTION 'RS_FUNCTION_POOL_CONTENTS' EXPORTING function_pool = functiongroupname TABLES functab = ifunct EXCEPTIONS function_pool_not_found = 1 OTHERS = 2. * Now write out function modules data. functionmodulesnode = xmldoc->create_element( 'functionmodules' ). LOOP AT ifunct INTO xfunct. functionmodulenode = xmldoc->create_element( 'functionmodule' ). xfunct_head-name = xfunct-funcname. REFRESH: iimport, ichange, iexport, itables, iexcepl, idocume, isource, isource_new. * Read the function module data CALL FUNCTION 'RPY_FUNCTIONMODULE_READ_NEW' EXPORTING functionname = xfunct_head-name IMPORTING global_flag = xfunct_head-global remote_call = xfunct_head-remote update_task = xfunct_head-utask short_text = xfunct_head-stext * FUNCTION_POOL = TABLES import_parameter = iimport changing_parameter = ichange export_parameter = iexport tables_parameter = itables exception_list = iexcepl documentation = idocume source = isource CHANGING new_source = isource_new EXCEPTIONS error_message = 1 function_not_found = 2 invalid_name = 3 OTHERS = 4. * Set the header attributes setattributesfromstructure( node = functionmodulenode structure = xfunct_head ). * IMports IF NOT iimport[] IS INITIAL. LOOP AT iimport INTO ximport. importsnode = xmldoc->create_element( 'importing' ). setattributesfromstructure( node = importsnode structure = ximport ). rc = functionmodulenode->append_child( importsnode ). ENDLOOP. ENDIF. * Exports IF NOT iexport[] IS INITIAL. LOOP AT iexport INTO xexport. exportsnode = xmldoc->create_element( 'exporting' ). setattributesfromstructure( node = exportsnode structure = xexport ). rc = functionmodulenode->append_child( exportsnode ). ENDLOOP. ENDIF. * Changing IF NOT ichange[] IS INITIAL. LOOP AT ichange INTO xchange. changesnode = xmldoc->create_element( 'changing' ). setattributesfromstructure( node = changesnode structure = xchange ). rc = functionmodulenode->append_child( changesnode ). ENDLOOP. ENDIF. * Tables IF NOT itables[] IS INITIAL. LOOP AT itables INTO xtables. tablesnode = xmldoc->create_element( 'tables' ). setattributesfromstructure( node = tablesnode structure = xtables ). rc = functionmodulenode->append_child( tablesnode ). ENDLOOP. ENDIF. * Exception list IF NOT iexcepl[] IS INITIAL. LOOP AT iexcepl INTO xexcepl. exceplnode = xmldoc->create_element( 'exceptions' ). setattributesfromstructure( node = exceplnode structure = xexcepl ). rc = functionmodulenode->append_child( exceplnode ). ENDLOOP. ENDIF. * Documentation - this is short text IF NOT idocume[] IS INITIAL. LOOP AT idocume INTO xdocume . documsnode = xmldoc->create_element( 'documentation' ). setattributesfromstructure( node = documsnode structure = xdocume ). rc = functionmodulenode->append_child( documsnode ). ENDLOOP. ENDIF. * Source code for function module IF NOT isource[] IS INITIAL. * Get rid of the FUNCTION and ENDFUNCTION statements. * And the signature comments * All of this will be inserted automatically, when imported. CLEAR: function_deleted, endfunction_deleted. LOOP AT isource INTO xsource. IF xsource+0(2) = '*"'. DELETE isource INDEX sy-tabix. CONTINUE. ENDIF. SEARCH xsource FOR 'FUNCTION'. "Got it and not a comment? IF sy-subrc = 0 AND xsource+0(1) <> '*' AND function_deleted NE 'X'. DELETE isource INDEX sy-tabix. function_deleted = 'X'. CONTINUE. ENDIF. SEARCH xsource FOR 'ENDFUNCTION'. IF sy-subrc = 0. DELETE isource INDEX sy-tabix. endfunction_deleted = 'X'. CONTINUE. ENDIF. ENDLOOP. fmsrcenode = xmldoc->create_element( 'fm_source' ). REFRESH progsource. LOOP AT isource INTO xsource. APPEND xsource TO progsource. ENDLOOP. sourcestring = buildsourcestring( sourcetable = progsource ). rc = fmsrcenode->if_ixml_node~set_value( sourcestring ). rc = functionmodulenode->append_child( fmsrcenode ). ENDIF. * Source code for function module IF NOT isource_new[] IS INITIAL. * Get rid of the FUNCTION and ENDFUNCTION statements. * And the signature comments * All of this will be inserted automatically, when imported. CLEAR: function_deleted, endfunction_deleted. LOOP AT isource_new INTO xsource_new. CHECK xsource_new IS NOT INITIAL. CLEAR lv_len. lv_len = strlen( xsource_new ). IF lv_len GE 2. IF xsource_new+0(2) = '*"'. DELETE isource_new INDEX sy-tabix. CONTINUE. ENDIF. ENDIF. SEARCH xsource_new FOR 'FUNCTION'. "Got it and not a comment? IF sy-subrc = 0 AND xsource_new+0(1) <> '*' AND function_deleted NE 'X'. DELETE isource_new INDEX sy-tabix. function_deleted = 'X'. CONTINUE. ENDIF. SEARCH xsource_new FOR 'ENDFUNCTION'. IF sy-subrc = 0. DELETE isource_new INDEX sy-tabix. endfunction_deleted = 'X'. CONTINUE. ENDIF. ENDLOOP. fmsrcenewnode = xmldoc->create_element( 'fm_source_new' ). REFRESH progsource. LOOP AT isource_new INTO xsource_new. APPEND xsource_new TO progsource. ENDLOOP. sourcestring = buildsourcestring( sourcetable = progsource ). rc = fmsrcenewnode->if_ixml_node~set_value( sourcestring ). rc = functionmodulenode->append_child( fmsrcenewnode ). ENDIF. * Get function module documentation fmdocumenation = get_fm_documentation( xfunct-funcname ). rc = functionmodulenode->append_child( fmdocumenation ). * Add to functionmodules node rc = functionmodulesnode->append_child( functionmodulenode ). ENDLOOP. fm_node = functionmodulesnode. endmethod. method GET_INCLUDES. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ types: begin of tinclude, name(40), end of tinclude. data iinclude type table of tinclude. data xinclude type tinclude. data ifunct type table of rs38l_incl. data xfunct type rs38l_incl. data functiongroupname type tlibg-area. data mainfgprogname type sy-repid. data includenode type ref to if_ixml_element. data includesnode type ref to if_ixml_element. data includesourcenode type ref to if_ixml_element. data progattribs type trdir. data rc type sysubrc. data progsource type rswsourcet. data _objname(30) type c. data sourcestring type string. functiongroupname = fct_group. mainfgprogname = main_prog. CALL FUNCTION 'RS_FUNCTION_POOL_CONTENTS' EXPORTING function_pool = functiongroupname TABLES functab = ifunct EXCEPTIONS function_pool_not_found = 1 others = 2. * Get all includes CALL FUNCTION 'RS_GET_ALL_INCLUDES' EXPORTING program = mainfgprogname TABLES includetab = iinclude EXCEPTIONS not_existent = 1 no_program = 2 others = 3. * Get rid of any includes that are for the function modules * and any includes that are in SAP namespace loop at iinclude into xinclude. read table ifunct into xfunct with key include = xinclude-name. if sy-subrc = 0. delete iinclude where name = xinclude-name. continue. endif. select single * from trdir into progattribs where name = xinclude-name. if progattribs-cnam = 'SAP'. delete iinclude where name = xinclude-name. continue. endif. if xinclude-name(2) <> 'LZ' and xinclude-name(2) <> 'LY' and xinclude-name(1) <> 'Z' and xinclude-name(1) <> 'Y'. delete iinclude where name = xinclude-name. continue. endif. endloop. * Write out include programs..... includesnode = xmldoc->create_element( 'includeprograms' ). loop at iinclude into xinclude. includenode = xmldoc->create_element( 'include' ). select single * from trdir into progattribs where name = xinclude-name. setattributesfromstructure( node = includenode structure = progattribs ). includesourcenode = xmldoc->create_element( 'include_source' ). read report xinclude-name into progsource. sourcestring = buildsourcestring( sourcetable = progsource ). rc = includesourcenode->if_ixml_node~set_value( sourcestring ). rc = includenode->append_child( includesourcenode ). rc = includesnode->append_child( includenode ). endloop. incl_node = includesnode. endmethod. method GET_PFSTATUS. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ data: ista type table of rsmpe_stat, ifun type table of rsmpe_funt, imen type table of rsmpe_men, imtx type table of rsmpe_mnlt, iact type table of rsmpe_act, ibut type table of rsmpe_but, ipfk type table of rsmpe_pfk, iset type table of rsmpe_staf, idoc type table of rsmpe_atrt, itit type table of rsmpe_titt, ibiv type table of rsmpe_buts. data: xsta type rsmpe_stat, xfun type rsmpe_funt, xmen type rsmpe_men, xmtx type rsmpe_mnlt, xact type rsmpe_act, xbut type rsmpe_but, xpfk type rsmpe_pfk, xset type rsmpe_staf, xdoc type rsmpe_atrt, xtit type rsmpe_titt, xbiv type rsmpe_buts. data sta_node type ref to if_ixml_element. data fun_node type ref to if_ixml_element. data men_node type ref to if_ixml_element. data mtx_node type ref to if_ixml_element. data act_node type ref to if_ixml_element. data but_node type ref to if_ixml_element. data pfk_node type ref to if_ixml_element. data set_node type ref to if_ixml_element. data doc_node type ref to if_ixml_element. data tit_node type ref to if_ixml_element. data biv_node type ref to if_ixml_element. data _objname type trobj_name. data _program type trdir-name. data rc type sy-subrc. _objname = objname. _program = objname. call function 'RS_CUA_INTERNAL_FETCH' exporting program = _program language = sy-langu tables sta = ista fun = ifun men = imen mtx = imtx act = iact but = ibut pfk = ipfk set = iset doc = idoc tit = itit biv = ibiv exceptions not_found = 1 unknown_version = 2 others = 3. check sy-subrc = 0. * if there is a gui status or gui title present, then * create pfstatus node. if ista[] is not initial or itit[] is not initial. pfstat_node = xmldoc->create_element( 'pfstatus' ). endif. * if ista is filled, assume there are one or more * gui statuses if ista[] is not initial. loop at ista into xsta. sta_node = xmldoc->create_element( 'pfstatus_sta' ). setattributesfromstructure( node = sta_node structure = xsta ). rc = pfstat_node->append_child( sta_node ). endloop. loop at ifun into xfun. fun_node = xmldoc->create_element( 'pfstatus_fun' ). setattributesfromstructure( node = fun_node structure = xfun ). rc = pfstat_node->append_child( fun_node ). endloop. loop at imen into xmen. men_node = xmldoc->create_element( 'pfstatus_men' ). setattributesfromstructure( node = men_node structure = xmen ). rc = pfstat_node->append_child( men_node ). endloop. loop at imtx into xmtx. mtx_node = xmldoc->create_element( 'pfstatus_mtx' ). setattributesfromstructure( node = mtx_node structure = xmtx ). rc = pfstat_node->append_child( mtx_node ). endloop. loop at iact into xact. act_node = xmldoc->create_element( 'pfstatus_act' ). setattributesfromstructure( node = act_node structure = xact ). rc = pfstat_node->append_child( act_node ). endloop. loop at ibut into xbut. but_node = xmldoc->create_element( 'pfstatus_but' ). setattributesfromstructure( node = but_node structure = xbut ). rc = pfstat_node->append_child( but_node ). endloop. loop at ipfk into xpfk. pfk_node = xmldoc->create_element( 'pfstatus_pfk' ). setattributesfromstructure( node = pfk_node structure = xpfk ). rc = pfstat_node->append_child( pfk_node ). endloop. loop at iset into xset. set_node = xmldoc->create_element( 'pfstatus_set' ). setattributesfromstructure( node = set_node structure = xset ). rc = pfstat_node->append_child( set_node ). endloop. loop at idoc into xdoc. doc_node = xmldoc->create_element( 'pfstatus_doc' ). setattributesfromstructure( node = doc_node structure = xdoc ). rc = pfstat_node->append_child( doc_node ). endloop. loop at ibiv into xbiv. biv_node = xmldoc->create_element( 'pfstatus_biv' ). setattributesfromstructure( node = biv_node structure = xbiv ). rc = pfstat_node->append_child( biv_node ). endloop. endif. * It itit is filled, assume one or more titles if itit[] is not initial. loop at itit into xtit. tit_node = xmldoc->create_element( 'pfstatus_tit' ). setattributesfromstructure( node = tit_node structure = xtit ). rc = pfstat_node->append_child( tit_node ). endloop. endif. endmethod. method GET_TEXTPOOL. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ data aText type ref to if_ixml_element. data textPoolTable type standard table of TEXTPOOL. data textPoolRow type textPool. data languageList type instLang. data aLanguage type SPRAS. data _objName(30) type c. data rc type i. data sTemp type string. data languageNode type ref to if_ixml_element. _objName = objName. textNode = xmlDoc->create_element( 'textPool' ). CALL FUNCTION 'RS_TEXTLOG_GET_PARAMETERS' changing INSTALLED_LANGUAGES = languageList. loop at languageList into aLanguage. read textpool _objName into textPoolTable language aLanguage. if sy-subrc = 0. languageNode = xmlDoc->create_Element( 'language' ). sTemp = aLanguage. rc = languageNode->set_attribute( name = 'SPRAS' value = sTemp ). loop at textPoolTable into textPoolRow. aText = xmlDoc->create_element( 'textElement' ). setAttributesFromStructure( node = aText structure = textPoolRow ). rc = languageNode->append_child( aText ). endloop. rc = textNode->append_child( languageNode ). endif. endloop. endmethod. method TRANSPORT_COPY. */---------------------------------------------------------------------\ *| 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 | *\---------------------------------------------------------------------/ CALL FUNCTION 'RS_CORR_INSERT' EXPORTING AUTHOR = author GLOBAL_LOCK = 'X' OBJECT = objName OBJECT_CLASS = 'ABAP' DEVCLASS = devClass * KORRNUM = CORRNUMBER_LOCAL MASTER_LANGUAGE = sy-langu * PROGRAM = PROGRAM_LOCAL MODE = 'INSERT' * IMPORTING * AUTHOR = UNAME * KORRNUM = CORRNUMBER_LOCAL * DEVCLASS = DEVCLASS_LOCAL EXCEPTIONS CANCELLED = 1 PERMISSION_FAILURE = 2 UNKNOWN_OBJECTCLASS = 3. if sy-subrc <> 0. case sy-subrc. when 2. raise exception type zcx_saplink exporting textid = zcx_saplink=>not_authorized. when others. raise exception type zcx_saplink exporting textid = zcx_saplink=>system_error. endcase. endif. endmethod. endclass. "ZSAPLINK_FUNCTIONGROUP implementation
35.299463
82
0.587258
1280dfed203d5170f3efc604aa546d2e70ae9738
986
abap
ABAP
src/zlib/zcl_abapgit_zlib_convert.clas.testclasses.abap
abapGit/upport
322935c225756b5107d7c835e6ccc13ba3dcbe4a
[ "MIT" ]
2
2021-01-08T21:38:32.000Z
2021-11-17T19:37:14.000Z
src/zlib/zcl_abapgit_zlib_convert.clas.testclasses.abap
abapGit/upport
322935c225756b5107d7c835e6ccc13ba3dcbe4a
[ "MIT" ]
null
null
null
src/zlib/zcl_abapgit_zlib_convert.clas.testclasses.abap
abapGit/upport
322935c225756b5107d7c835e6ccc13ba3dcbe4a
[ "MIT" ]
null
null
null
CLASS ltcl_test DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL. PRIVATE SECTION. DATA: mo_cut TYPE REF TO zcl_abapgit_zlib_convert. METHODS: setup, bits_to_int FOR TESTING, hex_to_bits FOR TESTING, int_to_hex FOR TESTING. ENDCLASS. CLASS ltcl_test IMPLEMENTATION. METHOD setup. mo_cut = NEW #( ). ENDMETHOD. METHOD bits_to_int. DATA: lv_result TYPE i. lv_result = mo_cut->bits_to_int( '111' ). cl_abap_unit_assert=>assert_equals( act = lv_result exp = 7 ). ENDMETHOD. METHOD hex_to_bits. DATA: lv_bits TYPE string. lv_bits = mo_cut->hex_to_bits( '0101' ). cl_abap_unit_assert=>assert_equals( act = lv_bits exp = '0000000100000001' ). ENDMETHOD. METHOD int_to_hex. DATA: lv_hex TYPE xstring. lv_hex = mo_cut->int_to_hex( 64 ). cl_abap_unit_assert=>assert_equals( act = lv_hex exp = '40' ). ENDMETHOD. ENDCLASS.
15.903226
50
0.655172
128420e46960b4918cfa62fe1bb7d6b49b5beb32
65,931
abap
ABAP
src/zcl_excel_converter.clas.abap
kvtorp/abap2xlsx
e72e4ea6a9fa6aa9c17162b9e88db65d3902af90
[ "Apache-2.0" ]
null
null
null
src/zcl_excel_converter.clas.abap
kvtorp/abap2xlsx
e72e4ea6a9fa6aa9c17162b9e88db65d3902af90
[ "Apache-2.0" ]
null
null
null
src/zcl_excel_converter.clas.abap
kvtorp/abap2xlsx
e72e4ea6a9fa6aa9c17162b9e88db65d3902af90
[ "Apache-2.0" ]
null
null
null
CLASS zcl_excel_converter DEFINITION PUBLIC CREATE PUBLIC . *"* public components of class ZCL_EXCEL_CONVERTER *"* do not include other source files here!!! PUBLIC SECTION. TYPE-POOLS abap . CLASS-METHODS class_constructor . METHODS ask_option RETURNING VALUE(rs_option) TYPE zexcel_s_converter_option RAISING zcx_excel . METHODS convert IMPORTING !is_option TYPE zexcel_s_converter_option OPTIONAL !io_alv TYPE REF TO object OPTIONAL !it_table TYPE STANDARD TABLE OPTIONAL !i_row_int TYPE i DEFAULT 1 !i_column_int TYPE i DEFAULT 1 !i_table TYPE flag OPTIONAL !i_style_table TYPE zexcel_table_style OPTIONAL !io_worksheet TYPE REF TO zcl_excel_worksheet OPTIONAL CHANGING !co_excel TYPE REF TO zcl_excel OPTIONAL RAISING zcx_excel . METHODS create_path RETURNING VALUE(r_path) TYPE string . METHODS get_file EXPORTING !e_bytecount TYPE i !et_file TYPE solix_tab !e_file TYPE xstring . METHODS get_option RETURNING VALUE(rs_option) TYPE zexcel_s_converter_option . METHODS open_file . METHODS set_option IMPORTING !is_option TYPE zexcel_s_converter_option . METHODS write_file IMPORTING !i_path TYPE string OPTIONAL . *"* protected components of class ZCL_EXCEL_CONVERTER *"* do not include other source files here!!! PROTECTED SECTION. TYPES: BEGIN OF t_relationship, id TYPE string, type TYPE string, target 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, 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 . DATA w_row_int TYPE zexcel_cell_row VALUE 1. "#EC NOTEXT . . . . . . . . . . " . DATA w_col_int TYPE zexcel_cell_column VALUE 1. "#EC NOTEXT . . . . . . . . . . " . *"* private components of class ZCL_EXCEL_CONVERTER *"* do not include other source files here!!! PRIVATE SECTION. CLASS-METHODS get_subclasses IMPORTING is_clskey TYPE seoclskey CHANGING ct_classes TYPE seor_implementing_keys. DATA wo_excel TYPE REF TO zcl_excel . DATA wo_worksheet TYPE REF TO zcl_excel_worksheet . DATA wo_autofilter TYPE REF TO zcl_excel_autofilter . DATA wo_table TYPE REF TO data . DATA wo_data TYPE REF TO data . DATA wt_fieldcatalog TYPE zexcel_t_converter_fcat . DATA ws_layout TYPE zexcel_s_converter_layo . DATA wt_colors TYPE zexcel_t_converter_col . DATA wt_filter TYPE zexcel_t_converter_fil . CLASS-DATA wt_objects TYPE tt_alv_types . CLASS-DATA w_fcount TYPE numc3 . DATA wt_sort_values TYPE tt_sort_values . DATA wt_subtotal_rows TYPE tt_subtotal_rows . DATA wt_styles TYPE tt_styles . CONSTANTS c_type_hdr TYPE char1 VALUE 'H'. "#EC NOTEXT CONSTANTS c_type_str TYPE char1 VALUE 'P'. "#EC NOTEXT CONSTANTS c_type_nor TYPE char1 VALUE 'N'. "#EC NOTEXT CONSTANTS c_type_sub TYPE char1 VALUE 'S'. "#EC NOTEXT CONSTANTS c_type_tot TYPE char1 VALUE 'T'. "#EC NOTEXT DATA wt_color_styles TYPE tt_color_styles . CLASS-DATA ws_option TYPE zexcel_s_converter_option . CLASS-DATA ws_indx TYPE indx . CLASS-METHODS init_option . CLASS-METHODS get_alv_converters. METHODS bind_table IMPORTING !i_style_table TYPE zexcel_table_style RETURNING VALUE(r_freeze_col) TYPE int1 RAISING zcx_excel . METHODS bind_cells RETURNING VALUE(r_freeze_col) TYPE int1 RAISING zcx_excel . METHODS clean_fieldcatalog . METHODS create_color_style IMPORTING !i_style TYPE zexcel_cell_style !is_colors TYPE zexcel_s_converter_col RETURNING VALUE(ro_style) TYPE REF TO zcl_excel_style . METHODS create_formular_subtotal IMPORTING !i_row_int_start TYPE zexcel_cell_row !i_row_int_end TYPE zexcel_cell_row !i_column TYPE zexcel_cell_column_alpha !i_totals_function TYPE zexcel_table_totals_function RETURNING VALUE(r_formula) TYPE string . METHODS create_formular_total IMPORTING !i_row_int TYPE zexcel_cell_row !i_column TYPE zexcel_cell_column_alpha !i_totals_function TYPE zexcel_table_totals_function RETURNING VALUE(r_formula) TYPE string . METHODS create_style_hdr IMPORTING !i_alignment TYPE zexcel_alignment OPTIONAL RETURNING VALUE(ro_style) TYPE REF TO zcl_excel_style . METHODS create_style_normal IMPORTING !i_alignment TYPE zexcel_alignment OPTIONAL !i_inttype TYPE inttype OPTIONAL !i_decimals TYPE int1 OPTIONAL RETURNING VALUE(ro_style) TYPE REF TO zcl_excel_style . METHODS create_style_stripped IMPORTING !i_alignment TYPE zexcel_alignment OPTIONAL !i_inttype TYPE inttype OPTIONAL !i_decimals TYPE int1 OPTIONAL RETURNING VALUE(ro_style) TYPE REF TO zcl_excel_style . METHODS create_style_subtotal IMPORTING !i_alignment TYPE zexcel_alignment OPTIONAL !i_inttype TYPE inttype OPTIONAL !i_decimals TYPE int1 OPTIONAL RETURNING VALUE(ro_style) TYPE REF TO zcl_excel_style . METHODS create_style_total IMPORTING !i_alignment TYPE zexcel_alignment OPTIONAL !i_inttype TYPE inttype OPTIONAL !i_decimals TYPE int1 OPTIONAL RETURNING VALUE(ro_style) TYPE REF TO zcl_excel_style . METHODS create_table . METHODS create_text_subtotal IMPORTING !i_value TYPE any !i_totals_function TYPE zexcel_table_totals_function RETURNING VALUE(r_text) TYPE string . METHODS create_worksheet IMPORTING !i_table TYPE flag DEFAULT 'X' !i_style_table TYPE zexcel_table_style RAISING zcx_excel . METHODS execute_converter IMPORTING !io_object TYPE REF TO object !it_table TYPE STANDARD TABLE RAISING zcx_excel . METHODS get_color_style IMPORTING !i_row TYPE zexcel_cell_row !i_fieldname TYPE fieldname !i_style TYPE zexcel_cell_style RETURNING VALUE(r_style) TYPE zexcel_cell_style . METHODS get_function_number IMPORTING !i_totals_function TYPE zexcel_table_totals_function RETURNING VALUE(r_function_number) TYPE int1 . METHODS get_style IMPORTING !i_type TYPE char1 !i_alignment TYPE zexcel_alignment DEFAULT space !i_inttype TYPE inttype DEFAULT space !i_decimals TYPE int1 DEFAULT 0 RETURNING VALUE(r_style) TYPE zexcel_cell_style . METHODS loop_normal IMPORTING !i_row_int TYPE zexcel_cell_row !i_col_int TYPE zexcel_cell_column RETURNING VALUE(r_freeze_col) TYPE int1 RAISING zcx_excel . METHODS loop_subtotal IMPORTING !i_row_int TYPE zexcel_cell_row !i_col_int TYPE zexcel_cell_column RETURNING VALUE(r_freeze_col) TYPE int1 RAISING zcx_excel . METHODS set_autofilter_area . METHODS set_cell_format IMPORTING !i_inttype TYPE inttype !i_decimals TYPE int1 RETURNING VALUE(r_format) TYPE zexcel_number_format . METHODS set_fieldcatalog . ENDCLASS. CLASS zcl_excel_converter IMPLEMENTATION. METHOD ask_option. DATA: ls_sval TYPE sval, lt_sval TYPE STANDARD TABLE OF sval, l_returncode TYPE string, lt_fields TYPE ddfields, ls_fields TYPE dfies. FIELD-SYMBOLS: <fs> TYPE any. rs_option = ws_option. CALL FUNCTION 'DDIF_FIELDINFO_GET' EXPORTING tabname = 'ZEXCEL_S_CONVERTER_OPTION' TABLES dfies_tab = lt_fields EXCEPTIONS not_found = 1 internal_error = 2 OTHERS = 3. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. LOOP AT lt_fields INTO ls_fields. ASSIGN COMPONENT ls_fields-fieldname OF STRUCTURE ws_option TO <fs>. IF sy-subrc = 0. CLEAR ls_sval. ls_sval-tabname = ls_fields-tabname. ls_sval-fieldname = ls_fields-fieldname. ls_sval-value = <fs>. ls_sval-field_attr = space. ls_sval-field_obl = space. ls_sval-comp_code = space. ls_sval-fieldtext = ls_fields-scrtext_m. ls_sval-comp_tab = space. ls_sval-comp_field = space. ls_sval-novaluehlp = space. INSERT ls_sval INTO TABLE lt_sval. ENDIF. ENDLOOP. CALL FUNCTION 'POPUP_GET_VALUES' EXPORTING popup_title = 'Excel creation options'(008) IMPORTING returncode = l_returncode TABLES fields = lt_sval EXCEPTIONS error_in_fields = 1 OTHERS = 2. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSEIF l_returncode = 'A'. RAISE EXCEPTION TYPE zcx_excel. ELSE. LOOP AT lt_sval INTO ls_sval. ASSIGN COMPONENT ls_sval-fieldname OF STRUCTURE ws_option TO <fs>. IF sy-subrc = 0. <fs> = ls_sval-value. ENDIF. ENDLOOP. set_option( is_option = ws_option ) . rs_option = ws_option. ENDIF. ENDMETHOD. METHOD bind_cells. * Do we need subtotals with grouping READ TABLE wt_fieldcatalog TRANSPORTING NO FIELDS WITH KEY is_subtotalled = abap_true. IF sy-subrc = 0 . r_freeze_col = loop_subtotal( i_row_int = w_row_int i_col_int = w_col_int ) . ELSE. r_freeze_col = loop_normal( i_row_int = w_row_int i_col_int = w_col_int ) . ENDIF. ENDMETHOD. METHOD bind_table. DATA: lt_field_catalog TYPE zexcel_t_fieldcatalog, ls_field_catalog TYPE zexcel_s_fieldcatalog, ls_fcat TYPE zexcel_s_converter_fcat, lo_column TYPE REF TO zcl_excel_column, lv_col_int TYPE zexcel_cell_column, lv_col_alpha TYPE zexcel_cell_column_alpha, ls_settings TYPE zexcel_s_table_settings, lv_line TYPE i. FIELD-SYMBOLS: <fs_tab> TYPE ANY TABLE. ASSIGN wo_data->* TO <fs_tab> . ls_settings-table_style = i_style_table. ls_settings-top_left_column = zcl_excel_common=>convert_column2alpha( ip_column = w_col_int ). ls_settings-top_left_row = w_row_int. ls_settings-show_row_stripes = ws_layout-is_stripped. DESCRIBE TABLE wt_fieldcatalog LINES lv_line. lv_line = lv_line + 1 + w_col_int. ls_settings-bottom_right_column = zcl_excel_common=>convert_column2alpha( ip_column = lv_line ). DESCRIBE TABLE <fs_tab> LINES lv_line. ls_settings-bottom_right_row = lv_line + 1 + w_row_int. SORT wt_fieldcatalog BY position. LOOP AT wt_fieldcatalog INTO ls_fcat. MOVE-CORRESPONDING ls_fcat TO ls_field_catalog. ls_field_catalog-dynpfld = abap_true. INSERT ls_field_catalog INTO TABLE lt_field_catalog. ENDLOOP. wo_worksheet->bind_table( EXPORTING ip_table = <fs_tab> it_field_catalog = lt_field_catalog is_table_settings = ls_settings IMPORTING es_table_settings = ls_settings ). LOOP AT wt_fieldcatalog INTO ls_fcat. lv_col_int = w_col_int + ls_fcat-position - 1. lv_col_alpha = zcl_excel_common=>convert_column2alpha( lv_col_int ). * Freeze panes IF ls_fcat-fix_column = abap_true. ADD 1 TO r_freeze_col. ENDIF. * Now let's check for optimized IF ls_fcat-is_optimized = abap_true. lo_column = wo_worksheet->get_column( ip_column = lv_col_alpha ). lo_column->set_auto_size( ip_auto_size = abap_true ) . ENDIF. * Now let's check for visible IF ls_fcat-is_hidden = abap_true. lo_column = wo_worksheet->get_column( ip_column = lv_col_alpha ). lo_column->set_visible( ip_visible = abap_false ) . ENDIF. ENDLOOP. ENDMETHOD. METHOD class_constructor. DATA: ls_objects TYPE ts_alv_types. DATA: ls_option TYPE zexcel_s_converter_option, l_uname TYPE sy-uname. GET PARAMETER ID 'ZUS' FIELD l_uname. IF l_uname IS INITIAL OR l_uname = space. l_uname = sy-uname. ENDIF. get_alv_converters( ). CONCATENATE 'EXCEL_' sy-uname INTO ws_indx-srtfd. IMPORT p1 = ls_option FROM DATABASE indx(xl) TO ws_indx ID ws_indx-srtfd. IF sy-subrc = 0. ws_option = ls_option. ELSE. init_option( ) . ENDIF. ENDMETHOD. METHOD clean_fieldcatalog. DATA: l_position TYPE tabfdpos. FIELD-SYMBOLS: <fs_sfcat> TYPE zexcel_s_converter_fcat. SORT wt_fieldcatalog BY position col_id. CLEAR l_position. LOOP AT wt_fieldcatalog ASSIGNING <fs_sfcat>. ADD 1 TO l_position. <fs_sfcat>-position = l_position. * Default stype with alignment and format <fs_sfcat>-style_hdr = get_style( i_type = c_type_hdr i_alignment = <fs_sfcat>-alignment ). IF ws_layout-is_stripped = abap_true. <fs_sfcat>-style_stripped = get_style( i_type = c_type_str i_alignment = <fs_sfcat>-alignment i_inttype = <fs_sfcat>-inttype i_decimals = <fs_sfcat>-decimals ). ENDIF. <fs_sfcat>-style_normal = get_style( i_type = c_type_nor i_alignment = <fs_sfcat>-alignment i_inttype = <fs_sfcat>-inttype i_decimals = <fs_sfcat>-decimals ). <fs_sfcat>-style_subtotal = get_style( i_type = c_type_sub i_alignment = <fs_sfcat>-alignment i_inttype = <fs_sfcat>-inttype i_decimals = <fs_sfcat>-decimals ). <fs_sfcat>-style_total = get_style( i_type = c_type_tot i_alignment = <fs_sfcat>-alignment i_inttype = <fs_sfcat>-inttype i_decimals = <fs_sfcat>-decimals ). ENDLOOP. ENDMETHOD. METHOD convert. IF is_option IS SUPPLIED. ws_option = is_option. ENDIF. execute_converter( EXPORTING io_object = io_alv it_table = it_table ) . IF io_worksheet IS SUPPLIED AND io_worksheet IS BOUND. wo_worksheet = io_worksheet. ENDIF. IF co_excel IS SUPPLIED. IF co_excel IS NOT BOUND. CREATE OBJECT co_excel. co_excel->zif_excel_book_properties~creator = sy-uname. ENDIF. wo_excel = co_excel. ENDIF. * Move table to data object and clean it up IF wt_fieldcatalog IS NOT INITIAL. create_table( ). ELSE. wo_data = wo_table . ENDIF. IF wo_excel IS NOT BOUND. CREATE OBJECT wo_excel. wo_excel->zif_excel_book_properties~creator = sy-uname. ENDIF. IF wo_worksheet IS NOT BOUND. " Get active sheet wo_worksheet = wo_excel->get_active_worksheet( ). wo_worksheet->set_title( ip_title = 'Sheet1'(001) ). ENDIF. IF i_row_int <= 0. w_row_int = 1. ELSE. w_row_int = i_row_int. ENDIF. IF i_column_int <= 0. w_col_int = 1. ELSE. w_col_int = i_column_int. ENDIF. create_worksheet( i_table = i_table i_style_table = i_style_table ) . ENDMETHOD. METHOD create_color_style. DATA: ls_styles TYPE ts_styles. DATA: lo_style TYPE REF TO zcl_excel_style. READ TABLE wt_styles INTO ls_styles WITH KEY guid = i_style. IF sy-subrc = 0. lo_style = wo_excel->add_new_style( ). * lo_style->borders = ls_styles-style->borders. * lo_style->protection = ls_styles-style->protection. lo_style->font->bold = ls_styles-style->font->bold. lo_style->alignment->horizontal = ls_styles-style->alignment->horizontal. lo_style->number_format->format_code = ls_styles-style->number_format->format_code. lo_style->font->color-rgb = is_colors-fontcolor. lo_style->fill->filltype = zcl_excel_style_fill=>c_fill_solid. lo_style->fill->fgcolor-rgb = is_colors-fillcolor. ro_style = lo_style. ENDIF. ENDMETHOD. METHOD create_formular_subtotal. DATA: l_row_alpha_start TYPE string, l_row_alpha_end TYPE string, l_func_num TYPE string. l_row_alpha_start = i_row_int_start. l_row_alpha_end = i_row_int_end. l_func_num = get_function_number( i_totals_function = i_totals_function ). CONCATENATE 'SUBTOTAL(' l_func_num ',' i_column l_row_alpha_start ':' i_column l_row_alpha_end ')' INTO r_formula. ENDMETHOD. METHOD create_formular_total. DATA: l_row_alpha TYPE string, l_row_e_alpha TYPE string. l_row_alpha = w_row_int + 1. l_row_e_alpha = i_row_int. CONCATENATE i_totals_function '(' i_column l_row_alpha ':' i_column l_row_e_alpha ')' INTO r_formula. ENDMETHOD. METHOD create_path. DATA: l_sep TYPE c, l_path TYPE string, l_return TYPE i. CLEAR r_path. " Save the file cl_gui_frontend_services=>get_sapgui_workdir( CHANGING sapworkdir = l_path EXCEPTIONS get_sapworkdir_failed = 1 cntl_error = 2 error_no_gui = 3 not_supported_by_gui = 4 ). IF sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. CONCATENATE 'Excel_' w_fcount '.xlsx' INTO r_path. ELSE. DO. ADD 1 TO w_fcount. *-obtain file separator character--------------------------------------- CALL METHOD cl_gui_frontend_services=>get_file_separator CHANGING file_separator = l_sep EXCEPTIONS cntl_error = 1 error_no_gui = 2 not_supported_by_gui = 3 OTHERS = 4. IF sy-subrc <> 0. l_sep = ''. ENDIF. CONCATENATE l_path l_sep 'Excel_' w_fcount '.xlsx' INTO r_path. IF cl_gui_frontend_services=>file_exist( file = r_path ) = abap_true. cl_gui_frontend_services=>file_delete( EXPORTING filename = r_path CHANGING rc = l_return EXCEPTIONS OTHERS = 1 ). IF sy-subrc = 0 . RETURN. ENDIF. ELSE. RETURN. ENDIF. ENDDO. ENDIF. ENDMETHOD. METHOD create_style_hdr. DATA: lo_style TYPE REF TO zcl_excel_style. lo_style = wo_excel->add_new_style( ). lo_style->font->bold = abap_true. lo_style->font->color-rgb = zcl_excel_style_color=>c_white. lo_style->fill->filltype = zcl_excel_style_fill=>c_fill_solid. lo_style->fill->fgcolor-rgb = 'FF4F81BD'. IF i_alignment IS SUPPLIED AND i_alignment IS NOT INITIAL. lo_style->alignment->horizontal = i_alignment. ENDIF. ro_style = lo_style . ENDMETHOD. METHOD create_style_normal. DATA: lo_style TYPE REF TO zcl_excel_style, l_format TYPE zexcel_number_format. IF i_inttype IS SUPPLIED AND i_inttype IS NOT INITIAL. l_format = set_cell_format( i_inttype = i_inttype i_decimals = i_decimals ) . ENDIF. IF l_format IS NOT INITIAL OR ( i_alignment IS SUPPLIED AND i_alignment IS NOT INITIAL ) . lo_style = wo_excel->add_new_style( ). IF i_alignment IS SUPPLIED AND i_alignment IS NOT INITIAL. lo_style->alignment->horizontal = i_alignment. ENDIF. IF l_format IS NOT INITIAL. lo_style->number_format->format_code = l_format. ENDIF. ro_style = lo_style . ENDIF. ENDMETHOD. METHOD create_style_stripped. DATA: lo_style TYPE REF TO zcl_excel_style. DATA: l_format TYPE zexcel_number_format. lo_style = wo_excel->add_new_style( ). lo_style->fill->filltype = zcl_excel_style_fill=>c_fill_solid. lo_style->fill->fgcolor-rgb = 'FFDBE5F1'. IF i_alignment IS SUPPLIED AND i_alignment IS NOT INITIAL. lo_style->alignment->horizontal = i_alignment. ENDIF. IF i_inttype IS SUPPLIED AND i_inttype IS NOT INITIAL. l_format = set_cell_format( i_inttype = i_inttype i_decimals = i_decimals ) . IF l_format IS NOT INITIAL. lo_style->number_format->format_code = l_format. ENDIF. ENDIF. ro_style = lo_style. ENDMETHOD. METHOD create_style_subtotal. DATA: lo_style TYPE REF TO zcl_excel_style. DATA: l_format TYPE zexcel_number_format. lo_style = wo_excel->add_new_style( ). lo_style->font->bold = abap_true. IF i_alignment IS SUPPLIED AND i_alignment IS NOT INITIAL. lo_style->alignment->horizontal = i_alignment. ENDIF. IF i_inttype IS SUPPLIED AND i_inttype IS NOT INITIAL. l_format = set_cell_format( i_inttype = i_inttype i_decimals = i_decimals ) . IF l_format IS NOT INITIAL. lo_style->number_format->format_code = l_format. ENDIF. ENDIF. ro_style = lo_style . ENDMETHOD. METHOD create_style_total. DATA: lo_style TYPE REF TO zcl_excel_style. DATA: l_format TYPE zexcel_number_format. lo_style = wo_excel->add_new_style( ). lo_style->font->bold = abap_true. CREATE OBJECT lo_style->borders->top. lo_style->borders->top->border_style = zcl_excel_style_border=>c_border_thin. lo_style->borders->top->border_color-rgb = zcl_excel_style_color=>c_black. CREATE OBJECT lo_style->borders->right. lo_style->borders->right->border_style = zcl_excel_style_border=>c_border_none. lo_style->borders->right->border_color-rgb = zcl_excel_style_color=>c_black. CREATE OBJECT lo_style->borders->down. lo_style->borders->down->border_style = zcl_excel_style_border=>c_border_double. lo_style->borders->down->border_color-rgb = zcl_excel_style_color=>c_black. CREATE OBJECT lo_style->borders->left. lo_style->borders->left->border_style = zcl_excel_style_border=>c_border_none. lo_style->borders->left->border_color-rgb = zcl_excel_style_color=>c_black. IF i_alignment IS SUPPLIED AND i_alignment IS NOT INITIAL. lo_style->alignment->horizontal = i_alignment. ENDIF. IF i_inttype IS SUPPLIED AND i_inttype IS NOT INITIAL. l_format = set_cell_format( i_inttype = i_inttype i_decimals = i_decimals ) . IF l_format IS NOT INITIAL. lo_style->number_format->format_code = l_format. ENDIF. ENDIF. ro_style = lo_style . ENDMETHOD. METHOD create_table. TYPES: BEGIN OF ts_output, fieldname TYPE fieldname, function TYPE funcname, END OF ts_output. DATA: lo_data TYPE REF TO data. DATA: lo_addit TYPE REF TO cl_abap_elemdescr, lt_components_tab TYPE cl_abap_structdescr=>component_table, ls_components TYPE abap_componentdescr, lo_table TYPE REF TO cl_abap_tabledescr, lo_struc TYPE REF TO cl_abap_structdescr. FIELD-SYMBOLS: <fs_scat> TYPE zexcel_s_converter_fcat, <fs_stab> TYPE any, <fs_ttab> TYPE STANDARD TABLE, <fs> TYPE any, <fs_table> TYPE STANDARD TABLE. SORT wt_fieldcatalog BY position. ASSIGN wo_table->* TO <fs_table>. READ TABLE <fs_table> ASSIGNING <fs_stab> INDEX 1. IF sy-subrc EQ 0 . LOOP AT wt_fieldcatalog ASSIGNING <fs_scat>. ASSIGN COMPONENT <fs_scat>-columnname OF STRUCTURE <fs_stab> TO <fs>. IF sy-subrc = 0. ls_components-name = <fs_scat>-columnname. TRY. lo_addit ?= cl_abap_typedescr=>describe_by_data( <fs> ). CATCH cx_sy_move_cast_error. CLEAR lo_addit. DELETE TABLE wt_fieldcatalog FROM <fs_scat>. ENDTRY. IF lo_addit IS BOUND. ls_components-type = lo_addit . INSERT ls_components INTO TABLE lt_components_tab. ENDIF. ENDIF. ENDLOOP. IF lt_components_tab IS NOT INITIAL. "create new line type TRY. lo_struc = cl_abap_structdescr=>create( p_components = lt_components_tab p_strict = abap_false ). CATCH cx_sy_struct_creation. RETURN. " We can not do anything in this case. ENDTRY. lo_table = cl_abap_tabledescr=>create( lo_struc ). CREATE DATA wo_data TYPE HANDLE lo_table. CREATE DATA lo_data TYPE HANDLE lo_struc. ASSIGN wo_data->* TO <fs_ttab>. ASSIGN lo_data->* TO <fs_stab>. LOOP AT <fs_table> ASSIGNING <fs>. CLEAR <fs_stab>. MOVE-CORRESPONDING <fs> TO <fs_stab>. APPEND <fs_stab> TO <fs_ttab>. ENDLOOP. ENDIF. ENDIF. ENDMETHOD. METHOD create_text_subtotal. DATA: l_string(256) TYPE c, l_func TYPE string. CASE i_totals_function. WHEN zcl_excel_table=>totals_function_sum. " Total l_func = 'Total'(003). WHEN zcl_excel_table=>totals_function_min. " Minimum l_func = 'Minimum'(004). WHEN zcl_excel_table=>totals_function_max. " Maximum l_func = 'Maximum'(005). WHEN zcl_excel_table=>totals_function_average. " Mean Value l_func = 'Average'(006). WHEN zcl_excel_table=>totals_function_count. " Count l_func = 'Count'(007). WHEN OTHERS. CLEAR l_func. ENDCASE. MOVE i_value TO l_string. CONCATENATE l_string l_func INTO r_text SEPARATED BY space. ENDMETHOD. METHOD create_worksheet. DATA: l_freeze_col TYPE i. IF wo_data IS BOUND AND wo_worksheet IS BOUND. wo_worksheet->zif_excel_sheet_properties~summarybelow = zif_excel_sheet_properties=>c_below_on. " By default is on IF wt_fieldcatalog IS INITIAL. set_fieldcatalog( ) . ELSE. clean_fieldcatalog( ) . ENDIF. IF i_table = abap_true. l_freeze_col = bind_table( i_style_table = i_style_table ) . ELSEIF wt_filter IS NOT INITIAL. * Let's check for filter. wo_autofilter = wo_excel->add_new_autofilter( io_sheet = wo_worksheet ). l_freeze_col = bind_cells( ) . set_autofilter_area( ) . ELSE. l_freeze_col = bind_cells( ) . ENDIF. * Check for freeze panes IF ws_layout-is_fixed = abap_true. IF l_freeze_col = 0. l_freeze_col = w_col_int. ENDIF. wo_worksheet->freeze_panes( EXPORTING ip_num_columns = l_freeze_col ip_num_rows = w_row_int ) . ENDIF. ENDIF. ENDMETHOD. METHOD execute_converter. DATA: lo_if TYPE REF TO zif_excel_converter, ls_types TYPE ts_alv_types, lo_addit TYPE REF TO cl_abap_classdescr, lo_addit_superclass TYPE REF TO cl_abap_classdescr. IF io_object IS BOUND. TRY. lo_addit ?= cl_abap_typedescr=>describe_by_object_ref( io_object ). CATCH cx_sy_move_cast_error. RAISE EXCEPTION TYPE zcx_excel. ENDTRY. ls_types-seoclass = lo_addit->get_relative_name( ). READ TABLE wt_objects INTO ls_types WITH TABLE KEY seoclass = ls_types-seoclass. IF sy-subrc NE 0. DO. FREE lo_addit_superclass. lo_addit_superclass = lo_addit->get_super_class_type( ). IF lo_addit_superclass IS INITIAL. CLEAR ls_types-clsname. EXIT. ENDIF. lo_addit = lo_addit_superclass. ls_types-seoclass = lo_addit->get_relative_name( ). READ TABLE wt_objects INTO ls_types WITH TABLE KEY seoclass = ls_types-seoclass. IF sy-subrc EQ 0. EXIT. ENDIF. ENDDO. ENDIF. IF ls_types-clsname IS NOT INITIAL. CREATE OBJECT lo_if TYPE (ls_types-clsname). lo_if->create_fieldcatalog( EXPORTING is_option = ws_option io_object = io_object it_table = it_table IMPORTING es_layout = ws_layout et_fieldcatalog = wt_fieldcatalog eo_table = wo_table et_colors = wt_colors et_filter = wt_filter ). * data lines of highest level. IF ws_layout-max_subtotal_level > 0. ADD 1 TO ws_layout-max_subtotal_level. ENDIF. ELSE. RAISE EXCEPTION TYPE zcx_excel. ENDIF. ELSE. REFRESH wt_fieldcatalog. GET REFERENCE OF it_table INTO wo_table. ENDIF. ENDMETHOD. METHOD get_alv_converters. DATA: lt_direct_implementations TYPE seor_implementing_keys, lt_all_implementations TYPE seor_implementing_keys, ls_impkey TYPE seor_implementing_key, ls_classkey TYPE seoclskey, lr_implementation TYPE REF TO zif_excel_converter, ls_object TYPE ts_alv_types, lr_classdescr TYPE REF TO cl_abap_classdescr. ls_classkey-clsname = 'ZIF_EXCEL_CONVERTER'. CALL FUNCTION 'SEO_INTERFACE_IMPLEM_GET_ALL' EXPORTING intkey = ls_classkey IMPORTING impkeys = lt_direct_implementations EXCEPTIONS OTHERS = 2. CHECK sy-subrc = 0. LOOP AT lt_direct_implementations INTO ls_impkey. lr_classdescr ?= cl_abap_classdescr=>describe_by_name( ls_impkey-clsname ). IF lr_classdescr->is_instantiatable( ) = abap_true. APPEND ls_impkey TO lt_all_implementations. ENDIF. ls_classkey-clsname = ls_impkey-clsname. get_subclasses( EXPORTING is_clskey = ls_classkey CHANGING ct_classes = lt_all_implementations ). ENDLOOP. SORT lt_all_implementations BY clsname. DELETE ADJACENT DUPLICATES FROM lt_all_implementations COMPARING clsname. LOOP AT lt_all_implementations INTO ls_impkey. CLEAR ls_object. CREATE OBJECT lr_implementation TYPE (ls_impkey-clsname). ls_object-seoclass = lr_implementation->get_supported_class( ). IF ls_object-seoclass IS NOT INITIAL. ls_object-clsname = ls_impkey-clsname. INSERT ls_object INTO TABLE wt_objects. ENDIF. ENDLOOP. ENDMETHOD. METHOD get_color_style. DATA: ls_colors TYPE zexcel_s_converter_col, ls_color_styles TYPE ts_color_styles, lo_style TYPE REF TO zcl_excel_style. r_style = i_style. " Default we change nothing IF wt_colors IS NOT INITIAL. * Full line has color READ TABLE wt_colors INTO ls_colors WITH KEY rownumber = i_row columnname = space. IF sy-subrc = 0. READ TABLE wt_color_styles INTO ls_color_styles WITH KEY guid_old = i_style fontcolor = ls_colors-fontcolor fillcolor = ls_colors-fillcolor. IF sy-subrc = 0. r_style = ls_color_styles-style_new->get_guid( ). ELSE. lo_style = create_color_style( i_style = i_style is_colors = ls_colors ) . r_style = lo_style->get_guid( ) . ls_color_styles-guid_old = i_style. ls_color_styles-fontcolor = ls_colors-fontcolor. ls_color_styles-fillcolor = ls_colors-fillcolor. ls_color_styles-style_new = lo_style. INSERT ls_color_styles INTO TABLE wt_color_styles. ENDIF. ELSE. * Only field has color READ TABLE wt_colors INTO ls_colors WITH KEY rownumber = i_row columnname = i_fieldname. IF sy-subrc = 0. READ TABLE wt_color_styles INTO ls_color_styles WITH KEY guid_old = i_style fontcolor = ls_colors-fontcolor fillcolor = ls_colors-fillcolor. IF sy-subrc = 0. r_style = ls_color_styles-style_new->get_guid( ). ELSE. lo_style = create_color_style( i_style = i_style is_colors = ls_colors ) . ls_color_styles-guid_old = i_style. ls_color_styles-fontcolor = ls_colors-fontcolor. ls_color_styles-fillcolor = ls_colors-fillcolor. ls_color_styles-style_new = lo_style. INSERT ls_color_styles INTO TABLE wt_color_styles. r_style = ls_color_styles-style_new->get_guid( ). ENDIF. ELSE. r_style = i_style. ENDIF. ENDIF. ELSE. r_style = i_style. ENDIF. ENDMETHOD. METHOD get_file. DATA: lo_excel_writer TYPE REF TO zif_excel_writer. DATA: ls_seoclass TYPE seoclass. IF wo_excel IS BOUND. CREATE OBJECT lo_excel_writer TYPE zcl_excel_writer_2007. e_file = lo_excel_writer->write_file( wo_excel ). SELECT SINGLE * INTO ls_seoclass FROM seoclass WHERE clsname = 'CL_BCS_CONVERT'. IF sy-subrc = 0. CALL METHOD (ls_seoclass-clsname)=>xstring_to_solix EXPORTING iv_xstring = e_file RECEIVING et_solix = et_file. e_bytecount = xstrlen( e_file ). ELSE. " Convert to binary CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' EXPORTING buffer = e_file IMPORTING output_length = e_bytecount TABLES binary_tab = et_file. ENDIF. ENDIF. ENDMETHOD. METHOD get_function_number. *Number Function *1 AVERAGE *2 COUNT *3 COUNTA *4 MAX *5 MIN *6 PRODUCT *7 STDEV *8 STDEVP *9 SUM *10 VAR *11 VARP CASE i_totals_function. WHEN zcl_excel_table=>totals_function_sum. " Total r_function_number = 9. WHEN zcl_excel_table=>totals_function_min. " Minimum r_function_number = 5. WHEN zcl_excel_table=>totals_function_max. " Maximum r_function_number = 4. WHEN zcl_excel_table=>totals_function_average. " Mean Value r_function_number = 1. WHEN zcl_excel_table=>totals_function_count. " Count r_function_number = 2. WHEN OTHERS. CLEAR r_function_number. ENDCASE. ENDMETHOD. METHOD get_option. rs_option = ws_option. ENDMETHOD. METHOD get_style. DATA: ls_styles TYPE ts_styles, lo_style TYPE REF TO zcl_excel_style. CLEAR r_style. READ TABLE wt_styles INTO ls_styles WITH TABLE KEY type = i_type alignment = i_alignment inttype = i_inttype decimals = i_decimals. IF sy-subrc = 0. r_style = ls_styles-guid. ELSE. CASE i_type. WHEN c_type_hdr. " Header lo_style = create_style_hdr( i_alignment = i_alignment ). WHEN c_type_str. "Stripped lo_style = create_style_stripped( i_alignment = i_alignment i_inttype = i_inttype i_decimals = i_decimals ). WHEN c_type_nor. "Normal lo_style = create_style_normal( i_alignment = i_alignment i_inttype = i_inttype i_decimals = i_decimals ). WHEN c_type_sub. "Subtotals lo_style = create_style_subtotal( i_alignment = i_alignment i_inttype = i_inttype i_decimals = i_decimals ). WHEN c_type_tot. "Totals lo_style = create_style_total( i_alignment = i_alignment i_inttype = i_inttype i_decimals = i_decimals ). ENDCASE. IF lo_style IS NOT INITIAL. r_style = lo_style->get_guid( ). ls_styles-type = i_type. ls_styles-alignment = i_alignment. ls_styles-inttype = i_inttype. ls_styles-decimals = i_decimals. ls_styles-guid = r_style. ls_styles-style = lo_style. INSERT ls_styles INTO TABLE wt_styles. ENDIF. ENDIF. ENDMETHOD. METHOD get_subclasses. DATA: lt_subclasses TYPE seor_inheritance_keys, ls_subclass TYPE seor_inheritance_key, lr_classdescr TYPE REF TO cl_abap_classdescr. CALL FUNCTION 'SEO_CLASS_GET_ALL_SUBS' EXPORTING clskey = is_clskey IMPORTING inhkeys = lt_subclasses EXCEPTIONS class_not_existing = 1 OTHERS = 2. CHECK sy-subrc = 0. LOOP AT lt_subclasses INTO ls_subclass. lr_classdescr ?= cl_abap_classdescr=>describe_by_name( ls_subclass-clsname ). IF lr_classdescr->is_instantiatable( ) = abap_true. APPEND ls_subclass TO ct_classes. ENDIF. ENDLOOP. ENDMETHOD. METHOD init_option. ws_option-filter = abap_true. ws_option-hidenc = abap_true. ws_option-subtot = abap_true. ENDMETHOD. METHOD loop_normal. DATA: l_row_int_end TYPE zexcel_cell_row, l_row_int TYPE zexcel_cell_row, l_col_int TYPE zexcel_cell_column, l_col_alpha TYPE zexcel_cell_column_alpha, l_cell_value TYPE zexcel_cell_value, l_s_color TYPE abap_bool, lo_column TYPE REF TO zcl_excel_column, l_formula TYPE zexcel_cell_formula, l_style TYPE zexcel_cell_style, l_cells TYPE i, l_count TYPE i, l_table_row TYPE i. FIELD-SYMBOLS: <fs_stab> TYPE any, <fs_tab> TYPE STANDARD TABLE, <fs_sfcat> TYPE zexcel_s_converter_fcat, <fs_fldval> TYPE any. ASSIGN wo_data->* TO <fs_tab> . DESCRIBE TABLE wt_fieldcatalog LINES l_cells. DESCRIBE TABLE <fs_tab> LINES l_count. l_cells = l_cells * l_count. * It is better to loop column by column LOOP AT wt_fieldcatalog ASSIGNING <fs_sfcat>. l_row_int = i_row_int. l_col_int = i_col_int + <fs_sfcat>-position - 1. * Freeze panes IF <fs_sfcat>-fix_column = abap_true. ADD 1 TO r_freeze_col. ENDIF. l_s_color = abap_true. l_col_alpha = zcl_excel_common=>convert_column2alpha( l_col_int ). * Only if the Header is required create it. IF ws_option-hidehd IS INITIAL. " First of all write column header l_cell_value = <fs_sfcat>-scrtext_m. wo_worksheet->set_cell( ip_column = l_col_alpha ip_row = l_row_int ip_value = l_cell_value ip_style = <fs_sfcat>-style_hdr ). ADD 1 TO l_row_int. ENDIF. LOOP AT <fs_tab> ASSIGNING <fs_stab>. l_table_row = sy-tabix. * Now the cell values ASSIGN COMPONENT <fs_sfcat>-columnname OF STRUCTURE <fs_stab> TO <fs_fldval>. * Now let's write the cell values IF ws_layout-is_stripped = abap_true AND l_s_color = abap_true. l_style = get_color_style( i_row = l_table_row i_fieldname = <fs_sfcat>-columnname i_style = <fs_sfcat>-style_stripped ). wo_worksheet->set_cell( ip_column = l_col_alpha ip_row = l_row_int ip_value = <fs_fldval> ip_style = l_style ). CLEAR l_s_color. ELSE. l_style = get_color_style( i_row = l_table_row i_fieldname = <fs_sfcat>-columnname i_style = <fs_sfcat>-style_normal ). wo_worksheet->set_cell( ip_column = l_col_alpha ip_row = l_row_int ip_value = <fs_fldval> ip_style = l_style ). l_s_color = abap_true. ENDIF. READ TABLE wt_filter TRANSPORTING NO FIELDS WITH TABLE KEY rownumber = l_table_row columnname = <fs_sfcat>-columnname. IF sy-subrc = 0. wo_worksheet->get_cell( EXPORTING ip_column = l_col_alpha ip_row = l_row_int IMPORTING ep_value = l_cell_value ). wo_autofilter->set_value( i_column = l_col_int i_value = l_cell_value ). ENDIF. ADD 1 TO l_row_int. ENDLOOP. * Now let's check for optimized IF <fs_sfcat>-is_optimized = abap_true . lo_column = wo_worksheet->get_column( ip_column = l_col_alpha ). lo_column->set_auto_size( ip_auto_size = abap_true ) . ENDIF. * Now let's check for visible IF <fs_sfcat>-is_hidden = abap_true. lo_column = wo_worksheet->get_column( ip_column = l_col_alpha ). lo_column->set_visible( ip_visible = abap_false ) . ENDIF. * Now let's check for total versus subtotal. IF <fs_sfcat>-totals_function IS NOT INITIAL. l_row_int_end = l_row_int - 1. l_formula = create_formular_total( i_row_int = l_row_int_end i_column = l_col_alpha i_totals_function = <fs_sfcat>-totals_function ). wo_worksheet->set_cell( ip_column = l_col_alpha ip_row = l_row_int ip_formula = l_formula ip_style = <fs_sfcat>-style_total ). ENDIF. ENDLOOP. ENDMETHOD. METHOD loop_subtotal. DATA: l_row_int_start TYPE zexcel_cell_row, l_row_int_end TYPE zexcel_cell_row, l_row_int TYPE zexcel_cell_row, l_col_int TYPE zexcel_cell_column, l_col_alpha TYPE zexcel_cell_column_alpha, l_col_alpha_start TYPE zexcel_cell_column_alpha, l_cell_value TYPE zexcel_cell_value, l_s_color TYPE abap_bool, lo_column TYPE REF TO zcl_excel_column, lo_row TYPE REF TO zcl_excel_row, l_formula TYPE zexcel_cell_formula, l_style TYPE zexcel_cell_style, l_text TYPE string, ls_sort_values TYPE ts_sort_values, ls_subtotal_rows TYPE ts_subtotal_rows, l_sort_level TYPE int4, l_hidden TYPE int4, l_line TYPE i, l_cells TYPE i, l_count TYPE i, l_table_row TYPE i, lt_fcat TYPE zexcel_t_converter_fcat. FIELD-SYMBOLS: <fs_stab> TYPE any, <fs_tab> TYPE STANDARD TABLE, <fs_sfcat> TYPE zexcel_s_converter_fcat, <fs_fldval> TYPE any, <fs_sortval> TYPE any, <fs_sortv> TYPE ts_sort_values. ASSIGN wo_data->* TO <fs_tab> . REFRESH: wt_sort_values, wt_subtotal_rows. DESCRIBE TABLE wt_fieldcatalog LINES l_cells. DESCRIBE TABLE <fs_tab> LINES l_count. l_cells = l_cells * l_count. READ TABLE <fs_tab> ASSIGNING <fs_stab> INDEX 1. IF sy-subrc = 0. l_row_int = i_row_int + 1. lt_fcat = wt_fieldcatalog. SORT lt_fcat BY sort_level DESCENDING. LOOP AT lt_fcat ASSIGNING <fs_sfcat> WHERE is_subtotalled = abap_true. ASSIGN COMPONENT <fs_sfcat>-columnname OF STRUCTURE <fs_stab> TO <fs_fldval>. ls_sort_values-fieldname = <fs_sfcat>-columnname. ls_sort_values-row_int = l_row_int. ls_sort_values-sort_level = <fs_sfcat>-sort_level. ls_sort_values-is_collapsed = <fs_sfcat>-is_collapsed. CREATE DATA ls_sort_values-value LIKE <fs_fldval>. ASSIGN ls_sort_values-value->* TO <fs_sortval>. <fs_sortval> = <fs_fldval>. INSERT ls_sort_values INTO TABLE wt_sort_values. ENDLOOP. ENDIF. l_row_int = i_row_int. * Let's check if we need to hide a sort level. DESCRIBE TABLE wt_sort_values LINES l_line. IF l_line <= 1. CLEAR l_hidden. ELSE. LOOP AT wt_sort_values INTO ls_sort_values WHERE is_collapsed = abap_false. IF l_hidden < ls_sort_values-sort_level. l_hidden = ls_sort_values-sort_level. ENDIF. ENDLOOP. ENDIF. ADD 1 TO l_hidden. " As this is the first level we show. * First loop without formular only addtional rows with subtotal text. LOOP AT <fs_tab> ASSIGNING <fs_stab>. ADD 1 TO l_row_int. " 1 is for header row. l_row_int_start = l_row_int. SORT lt_fcat BY sort_level DESCENDING. LOOP AT lt_fcat ASSIGNING <fs_sfcat> WHERE is_subtotalled = abap_true. l_col_int = i_col_int + <fs_sfcat>-position - 1. l_col_alpha = zcl_excel_common=>convert_column2alpha( l_col_int ). * Now the cell values ASSIGN COMPONENT <fs_sfcat>-columnname OF STRUCTURE <fs_stab> TO <fs_fldval>. IF sy-subrc = 0. READ TABLE wt_sort_values ASSIGNING <fs_sortv> WITH TABLE KEY fieldname = <fs_sfcat>-columnname. IF sy-subrc = 0. ASSIGN <fs_sortv>-value->* TO <fs_sortval>. IF <fs_sortval> <> <fs_fldval> OR <fs_sortv>-new = abap_true. * First let's remmember the subtotal values as it has to appear later. ls_subtotal_rows-row_int = l_row_int. ls_subtotal_rows-row_int_start = <fs_sortv>-row_int. ls_subtotal_rows-columnname = <fs_sfcat>-columnname. INSERT ls_subtotal_rows INTO TABLE wt_subtotal_rows. * Now let's write the subtotal line l_cell_value = create_text_subtotal( i_value = <fs_sortval> i_totals_function = <fs_sfcat>-totals_function ). wo_worksheet->set_cell( ip_column = l_col_alpha ip_row = l_row_int ip_value = l_cell_value ip_abap_type = cl_abap_typedescr=>typekind_string ip_style = <fs_sfcat>-style_subtotal ). lo_row = wo_worksheet->get_row( ip_row = l_row_int ). lo_row->set_outline_level( ip_outline_level = <fs_sfcat>-sort_level ) . IF <fs_sfcat>-is_collapsed = abap_true. IF <fs_sfcat>-sort_level > l_hidden. lo_row->set_visible( ip_visible = abap_false ) . ENDIF. lo_row->set_collapsed( ip_collapsed = <fs_sfcat>-is_collapsed ) . ENDIF. * Now let's change the key ADD 1 TO l_row_int. <fs_sortval> = <fs_fldval>. <fs_sortv>-new = abap_false. l_line = <fs_sortv>-sort_level. LOOP AT wt_sort_values ASSIGNING <fs_sortv> WHERE sort_level >= l_line. <fs_sortv>-row_int = l_row_int. ENDLOOP. ENDIF. ENDIF. ENDIF. ENDLOOP. ENDLOOP. ADD 1 TO l_row_int. l_row_int_start = l_row_int. SORT lt_fcat BY sort_level DESCENDING. LOOP AT lt_fcat ASSIGNING <fs_sfcat> WHERE is_subtotalled = abap_true. l_col_int = i_col_int + <fs_sfcat>-position - 1. l_col_alpha = zcl_excel_common=>convert_column2alpha( l_col_int ). READ TABLE wt_sort_values ASSIGNING <fs_sortv> WITH TABLE KEY fieldname = <fs_sfcat>-columnname. IF sy-subrc = 0. ASSIGN <fs_sortv>-value->* TO <fs_sortval>. ls_subtotal_rows-row_int = l_row_int. ls_subtotal_rows-row_int_start = <fs_sortv>-row_int. ls_subtotal_rows-columnname = <fs_sfcat>-columnname. INSERT ls_subtotal_rows INTO TABLE wt_subtotal_rows. * First let's write the value as it has to appear. l_cell_value = create_text_subtotal( i_value = <fs_sortval> i_totals_function = <fs_sfcat>-totals_function ). wo_worksheet->set_cell( ip_column = l_col_alpha ip_row = l_row_int ip_value = l_cell_value ip_abap_type = cl_abap_typedescr=>typekind_string ip_style = <fs_sfcat>-style_subtotal ). l_sort_level = <fs_sfcat>-sort_level. lo_row = wo_worksheet->get_row( ip_row = l_row_int ). lo_row->set_outline_level( ip_outline_level = l_sort_level ) . IF <fs_sfcat>-is_collapsed = abap_true. IF <fs_sfcat>-sort_level > l_hidden. lo_row->set_visible( ip_visible = abap_false ) . ENDIF. lo_row->set_collapsed( ip_collapsed = <fs_sfcat>-is_collapsed ) . ENDIF. ADD 1 TO l_row_int. ENDIF. ENDLOOP. * Let's write the Grand total l_sort_level = 0. lo_row = wo_worksheet->get_row( ip_row = l_row_int ). lo_row->set_outline_level( ip_outline_level = l_sort_level ) . * lo_row_dim->set_collapsed( ip_collapsed = <fs_sfcat>-is_collapsed ) . Not on grand total l_text = create_text_subtotal( i_value = 'Grand'(002) i_totals_function = <fs_sfcat>-totals_function ). l_col_alpha_start = zcl_excel_common=>convert_column2alpha( i_col_int ). wo_worksheet->set_cell( ip_column = l_col_alpha_start ip_row = l_row_int ip_value = l_text ip_abap_type = cl_abap_typedescr=>typekind_string ip_style = <fs_sfcat>-style_subtotal ). * It is better to loop column by column second time around * Second loop with formular and data. LOOP AT wt_fieldcatalog ASSIGNING <fs_sfcat>. l_row_int = i_row_int. l_col_int = i_col_int + <fs_sfcat>-position - 1. * Freeze panes IF <fs_sfcat>-fix_column = abap_true. ADD 1 TO r_freeze_col. ENDIF. l_s_color = abap_true. l_col_alpha = zcl_excel_common=>convert_column2alpha( l_col_int ). " First of all write column header l_cell_value = <fs_sfcat>-scrtext_m. wo_worksheet->set_cell( ip_column = l_col_alpha ip_row = l_row_int ip_value = l_cell_value ip_abap_type = cl_abap_typedescr=>typekind_string ip_style = <fs_sfcat>-style_hdr ). ADD 1 TO l_row_int. LOOP AT <fs_tab> ASSIGNING <fs_stab>. l_table_row = sy-tabix. * Now the cell values ASSIGN COMPONENT <fs_sfcat>-columnname OF STRUCTURE <fs_stab> TO <fs_fldval>. * Let's check for subtotal lines DO. READ TABLE wt_subtotal_rows TRANSPORTING NO FIELDS WITH TABLE KEY row_int = l_row_int. IF sy-subrc = 0. IF <fs_sfcat>-is_subtotalled = abap_false AND <fs_sfcat>-totals_function IS NOT INITIAL. DO. READ TABLE wt_subtotal_rows INTO ls_subtotal_rows WITH TABLE KEY row_int = l_row_int. IF sy-subrc = 0. l_row_int_start = ls_subtotal_rows-row_int_start. l_row_int_end = l_row_int - 1. l_formula = create_formular_subtotal( i_row_int_start = l_row_int_start i_row_int_end = l_row_int_end i_column = l_col_alpha i_totals_function = <fs_sfcat>-totals_function ). wo_worksheet->set_cell( ip_column = l_col_alpha ip_row = l_row_int ip_formula = l_formula ip_style = <fs_sfcat>-style_subtotal ). IF <fs_sfcat>-is_collapsed = abap_true. lo_row = wo_worksheet->get_row( ip_row = l_row_int ). lo_row->set_collapsed( ip_collapsed = <fs_sfcat>-is_collapsed ). IF <fs_sfcat>-sort_level > l_hidden. lo_row->set_visible( ip_visible = abap_false ) . ENDIF. ENDIF. ADD 1 TO l_row_int. ELSE. EXIT. ENDIF. ENDDO. ELSE. ADD 1 TO l_row_int. ENDIF. ELSE. EXIT. ENDIF. ENDDO. * Let's set the row dimension values lo_row = wo_worksheet->get_row( ip_row = l_row_int ). lo_row->set_outline_level( ip_outline_level = ws_layout-max_subtotal_level ) . IF <fs_sfcat>-is_collapsed = abap_true. lo_row->set_visible( ip_visible = abap_false ) . lo_row->set_collapsed( ip_collapsed = <fs_sfcat>-is_collapsed ) . ENDIF. * Now let's write the cell values IF ws_layout-is_stripped = abap_true AND l_s_color = abap_true. l_style = get_color_style( i_row = l_table_row i_fieldname = <fs_sfcat>-columnname i_style = <fs_sfcat>-style_stripped ). wo_worksheet->set_cell( ip_column = l_col_alpha ip_row = l_row_int ip_value = <fs_fldval> ip_style = l_style ). CLEAR l_s_color. ELSE. l_style = get_color_style( i_row = l_table_row i_fieldname = <fs_sfcat>-columnname i_style = <fs_sfcat>-style_normal ). wo_worksheet->set_cell( ip_column = l_col_alpha ip_row = l_row_int ip_value = <fs_fldval> ip_style = l_style ). l_s_color = abap_true. ENDIF. READ TABLE wt_filter TRANSPORTING NO FIELDS WITH TABLE KEY rownumber = l_table_row columnname = <fs_sfcat>-columnname. IF sy-subrc = 0. wo_worksheet->get_cell( EXPORTING ip_column = l_col_alpha ip_row = l_row_int IMPORTING ep_value = l_cell_value ). wo_autofilter->set_value( i_column = l_col_int i_value = l_cell_value ). ENDIF. ADD 1 TO l_row_int. ENDLOOP. * Let's check for subtotal lines DO. READ TABLE wt_subtotal_rows TRANSPORTING NO FIELDS WITH TABLE KEY row_int = l_row_int. IF sy-subrc = 0. IF <fs_sfcat>-is_subtotalled = abap_false AND <fs_sfcat>-totals_function IS NOT INITIAL. DO. READ TABLE wt_subtotal_rows INTO ls_subtotal_rows WITH TABLE KEY row_int = l_row_int. IF sy-subrc = 0. l_row_int_start = ls_subtotal_rows-row_int_start. l_row_int_end = l_row_int - 1. l_formula = create_formular_subtotal( i_row_int_start = l_row_int_start i_row_int_end = l_row_int_end i_column = l_col_alpha i_totals_function = <fs_sfcat>-totals_function ). wo_worksheet->set_cell( ip_column = l_col_alpha ip_row = l_row_int ip_formula = l_formula ip_style = <fs_sfcat>-style_subtotal ). IF <fs_sfcat>-is_collapsed = abap_true. lo_row = wo_worksheet->get_row( ip_row = l_row_int ). lo_row->set_collapsed( ip_collapsed = <fs_sfcat>-is_collapsed ). ENDIF. ADD 1 TO l_row_int. ELSE. EXIT. ENDIF. ENDDO. ELSE. ADD 1 TO l_row_int. ENDIF. ELSE. EXIT. ENDIF. ENDDO. * Now let's check for Grand total IF <fs_sfcat>-is_subtotalled = abap_false AND <fs_sfcat>-totals_function IS NOT INITIAL. l_row_int_start = i_row_int + 1. l_row_int_end = l_row_int - 1. l_formula = create_formular_subtotal( i_row_int_start = l_row_int_start i_row_int_end = l_row_int_end i_column = l_col_alpha i_totals_function = <fs_sfcat>-totals_function ). wo_worksheet->set_cell( ip_column = l_col_alpha ip_row = l_row_int ip_formula = l_formula ip_style = <fs_sfcat>-style_subtotal ). ENDIF. * Now let's check for optimized IF <fs_sfcat>-is_optimized = abap_true. lo_column = wo_worksheet->get_column( ip_column = l_col_alpha ). lo_column->set_auto_size( ip_auto_size = abap_true ) . ENDIF. * Now let's check for visible IF <fs_sfcat>-is_hidden = abap_true. lo_column = wo_worksheet->get_column( ip_column = l_col_alpha ). lo_column->set_visible( ip_visible = abap_false ) . ENDIF. ENDLOOP. ENDMETHOD. METHOD open_file. DATA: l_bytecount TYPE i, lt_file TYPE solix_tab, l_dir TYPE string. FIELD-SYMBOLS: <fs_data> TYPE ANY TABLE. ASSIGN wo_data->* TO <fs_data>. * catch zcx_excel . *endtry. IF wo_excel IS BOUND. get_file( IMPORTING e_bytecount = l_bytecount et_file = lt_file ) . l_dir = create_path( ) . cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = l_bytecount filename = l_dir filetype = 'BIN' CHANGING data_tab = lt_file ). cl_gui_frontend_services=>execute( EXPORTING document = l_dir * application = * parameter = * default_directory = * maximized = * minimized = * synchronous = * operation = 'OPEN' EXCEPTIONS cntl_error = 1 error_no_gui = 2 bad_parameter = 3 file_not_found = 4 path_not_found = 5 file_extension_unknown = 6 error_execute_failed = 7 synchronous_failed = 8 not_supported_by_gui = 9 ). IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDIF. ENDMETHOD. METHOD set_autofilter_area. DATA: ls_area TYPE zexcel_s_autofilter_area, l_lines TYPE i, lt_values TYPE zexcel_t_autofilter_values, ls_values TYPE zexcel_s_autofilter_values. * Let's check for filter. IF wo_autofilter IS BOUND. ls_area-row_start = 1. lt_values = wo_autofilter->get_values( ) . SORT lt_values BY column ASCENDING. DESCRIBE TABLE lt_values LINES l_lines. READ TABLE lt_values INTO ls_values INDEX 1. IF sy-subrc = 0. ls_area-col_start = ls_values-column. ENDIF. READ TABLE lt_values INTO ls_values INDEX l_lines. IF sy-subrc = 0. ls_area-col_end = ls_values-column. ENDIF. wo_autofilter->set_filter_area( is_area = ls_area ) . ENDIF. ENDMETHOD. METHOD set_cell_format. DATA: l_format TYPE zexcel_number_format. CLEAR r_format. CASE i_inttype. WHEN cl_abap_typedescr=>typekind_date. r_format = wo_worksheet->get_default_excel_date_format( ). WHEN cl_abap_typedescr=>typekind_time. r_format = wo_worksheet->get_default_excel_time_format( ). WHEN cl_abap_typedescr=>typekind_float OR cl_abap_typedescr=>typekind_packed. IF i_decimals > 0 . l_format = '#,##0.'. DO i_decimals TIMES. CONCATENATE l_format '0' INTO l_format. ENDDO. r_format = l_format. ENDIF. WHEN cl_abap_typedescr=>typekind_int OR cl_abap_typedescr=>typekind_int1 OR cl_abap_typedescr=>typekind_int2. r_format = '#,##0'. ENDCASE. ENDMETHOD. METHOD set_fieldcatalog. DATA: lr_data TYPE REF TO data, lo_structdescr TYPE REF TO cl_abap_structdescr, lt_dfies TYPE ddfields, ls_dfies TYPE dfies. DATA: ls_fcat TYPE zexcel_s_converter_fcat. FIELD-SYMBOLS: <fs_tab> TYPE ANY TABLE. ASSIGN wo_data->* TO <fs_tab> . CREATE DATA lr_data LIKE LINE OF <fs_tab>. lo_structdescr ?= cl_abap_structdescr=>describe_by_data_ref( lr_data ). lt_dfies = zcl_excel_common=>describe_structure( io_struct = lo_structdescr ). LOOP AT lt_dfies INTO ls_dfies. MOVE-CORRESPONDING ls_dfies TO ls_fcat. ls_fcat-columnname = ls_dfies-fieldname. INSERT ls_fcat INTO TABLE wt_fieldcatalog. ENDLOOP. clean_fieldcatalog( ). ENDMETHOD. METHOD set_option. IF ws_indx-begdt IS INITIAL. ws_indx-begdt = sy-datum. ENDIF. ws_indx-aedat = sy-datum. ws_indx-usera = sy-uname. ws_indx-pgmid = sy-cprog. EXPORT p1 = is_option TO DATABASE indx(xl) FROM ws_indx ID ws_indx-srtfd. IF sy-subrc = 0. ws_option = is_option. ENDIF. ENDMETHOD. METHOD write_file. DATA: l_bytecount TYPE i, lt_file TYPE solix_tab, l_dir TYPE string. FIELD-SYMBOLS: <fs_data> TYPE ANY TABLE. ASSIGN wo_data->* TO <fs_data>. * catch zcx_excel . *endtry. IF wo_excel IS BOUND. get_file( IMPORTING e_bytecount = l_bytecount et_file = lt_file ) . IF i_path IS INITIAL. l_dir = create_path( ) . ELSE. l_dir = i_path. ENDIF. cl_gui_frontend_services=>gui_download( EXPORTING bin_filesize = l_bytecount filename = l_dir filetype = 'BIN' CHANGING data_tab = lt_file ). ENDIF. ENDMETHOD. ENDCLASS.
36.205931
120
0.587463
1284cf8e9711f88ec85529fd0ca2a43cf8fec44c
36,706
abap
ABAP
src/zcl_ibmc_nat_lang_undrstnd_v1.clas.abap
khajafareed/Test01
930aee008c984b2d55b4375646c8f459d653eb3c
[ "Apache-2.0" ]
null
null
null
src/zcl_ibmc_nat_lang_undrstnd_v1.clas.abap
khajafareed/Test01
930aee008c984b2d55b4375646c8f459d653eb3c
[ "Apache-2.0" ]
null
null
null
src/zcl_ibmc_nat_lang_undrstnd_v1.clas.abap
khajafareed/Test01
930aee008c984b2d55b4375646c8f459d653eb3c
[ "Apache-2.0" ]
null
null
null
* Copyright 2019 IBM Corp. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. "! <h1>Natural Language Understanding</h1> "! Analyze various features of text content at scale. Provide text, raw HTML, or a "! public URL and IBM Watson Natural Language Understanding will give you results "! for the features you request. The service cleans HTML content before analysis "! by default, so the results can ignore most advertisements and other unwanted "! content. "! "! You can create [custom "! models](https://cloud.ibm.com/docs/services/natural-language-understanding?topi "! c=natural-language-understanding-customizing) with Watson Knowledge Studio to "! detect custom entities, relations, and categories in Natural Language "! Understanding. <br/> class ZCL_IBMC_NAT_LANG_UNDRSTND_V1 DEFINITION public inheriting from ZCL_IBMC_SERVICE_EXT create public . public section. types: "! begin of T_SEMANTIC_ROLES_ENTITY, TYPE type STRING, TEXT type STRING, end of T_SEMANTIC_ROLES_ENTITY. types: "! begin of T_SEMANTIC_ROLES_KEYWORD, TEXT type STRING, end of T_SEMANTIC_ROLES_KEYWORD. types: "! The extracted subject from the sentence. begin of T_SMNTC_ROLES_RESULT_SUBJECT, TEXT type STRING, ENTITIES type STANDARD TABLE OF T_SEMANTIC_ROLES_ENTITY WITH NON-UNIQUE DEFAULT KEY, KEYWORDS type STANDARD TABLE OF T_SEMANTIC_ROLES_KEYWORD WITH NON-UNIQUE DEFAULT KEY, end of T_SMNTC_ROLES_RESULT_SUBJECT. types: "! The extracted object from the sentence. begin of T_SEMANTIC_ROLES_RESULT_OBJECT, TEXT type STRING, KEYWORDS type STANDARD TABLE OF T_SEMANTIC_ROLES_KEYWORD WITH NON-UNIQUE DEFAULT KEY, end of T_SEMANTIC_ROLES_RESULT_OBJECT. types: "! begin of T_SEMANTIC_ROLES_VERB, TEXT type STRING, TENSE type STRING, end of T_SEMANTIC_ROLES_VERB. types: "! The extracted action from the sentence. begin of T_SEMANTIC_ROLES_RESULT_ACTION, TEXT type STRING, NORMALIZED type STRING, VERB type T_SEMANTIC_ROLES_VERB, end of T_SEMANTIC_ROLES_RESULT_ACTION. types: "! The object containing the actions and the objects the actions act upon. begin of T_SEMANTIC_ROLES_RESULT, SENTENCE type STRING, SUBJECT type T_SMNTC_ROLES_RESULT_SUBJECT, ACTION type T_SEMANTIC_ROLES_RESULT_ACTION, OBJECT type T_SEMANTIC_ROLES_RESULT_OBJECT, end of T_SEMANTIC_ROLES_RESULT. types: "! Parses sentences into subject, action, and object form. "! "! Supported languages: English, German, Japanese, Korean, Spanish. begin of T_SEMANTIC_ROLES_OPTIONS, LIMIT type INTEGER, KEYWORDS type BOOLEAN, ENTITIES type BOOLEAN, end of T_SEMANTIC_ROLES_OPTIONS. types: "! An entity that corresponds with an argument in a relation. begin of T_RELATION_ENTITY, TEXT type STRING, TYPE type STRING, end of T_RELATION_ENTITY. types: "! begin of T_RELATION_ARGUMENT, ENTITIES type STANDARD TABLE OF T_RELATION_ENTITY WITH NON-UNIQUE DEFAULT KEY, LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY, TEXT type STRING, end of T_RELATION_ARGUMENT. types: "! The relations between entities found in the content. begin of T_RELATIONS_RESULT, SCORE type DOUBLE, SENTENCE type STRING, TYPE type STRING, ARGUMENTS type STANDARD TABLE OF T_RELATION_ARGUMENT WITH NON-UNIQUE DEFAULT KEY, end of T_RELATIONS_RESULT. types: "! begin of T_MODEL, STATUS type STRING, MODEL_ID type STRING, LANGUAGE type STRING, DESCRIPTION type STRING, WORKSPACE_ID type STRING, VERSION type STRING, VERSION_DESCRIPTION type STRING, CREATED type DATETIME, end of T_MODEL. types: "! begin of T_FEATURE_SENTIMENT_RESULTS, SCORE type DOUBLE, end of T_FEATURE_SENTIMENT_RESULTS. types: "! begin of T_EMOTION_SCORES, ANGER type DOUBLE, DISGUST type DOUBLE, FEAR type DOUBLE, JOY type DOUBLE, SADNESS type DOUBLE, end of T_EMOTION_SCORES. types: "! The author of the analyzed content. begin of T_AUTHOR, NAME type STRING, end of T_AUTHOR. types: "! RSS or ATOM feed found on the webpage. begin of T_FEED, LINK type STRING, end of T_FEED. types: "! Webpage metadata, such as the author and the title of the page. begin of T_FEATURES_RESULTS_METADATA, AUTHORS type STANDARD TABLE OF T_AUTHOR WITH NON-UNIQUE DEFAULT KEY, PUBLICATION_DATE type STRING, TITLE type STRING, IMAGE type STRING, FEEDS type STANDARD TABLE OF T_FEED WITH NON-UNIQUE DEFAULT KEY, end of T_FEATURES_RESULTS_METADATA. types: "! begin of T_ENTITY_MENTION, TEXT type STRING, LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY, CONFIDENCE type DOUBLE, end of T_ENTITY_MENTION. types: "! Disambiguation information for the entity. begin of T_DISAMBIGUATION_RESULT, NAME type STRING, DBPEDIA_RESOURCE type STRING, SUBTYPE type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, end of T_DISAMBIGUATION_RESULT. types: "! The important people, places, geopolitical entities and other types of entities "! in your content. begin of T_ENTITIES_RESULT, TYPE type STRING, TEXT type STRING, RELEVANCE type DOUBLE, CONFIDENCE type DOUBLE, MENTIONS type STANDARD TABLE OF T_ENTITY_MENTION WITH NON-UNIQUE DEFAULT KEY, COUNT type INTEGER, EMOTION type T_EMOTION_SCORES, SENTIMENT type T_FEATURE_SENTIMENT_RESULTS, DISAMBIGUATION type T_DISAMBIGUATION_RESULT, end of T_ENTITIES_RESULT. types: "! Emotion results for a specified target. begin of T_TARGETED_EMOTION_RESULTS, TEXT type STRING, EMOTION type T_EMOTION_SCORES, end of T_TARGETED_EMOTION_RESULTS. types: "! The important keywords in the content, organized by relevance. begin of T_KEYWORDS_RESULT, COUNT type INTEGER, RELEVANCE type DOUBLE, TEXT type STRING, EMOTION type T_EMOTION_SCORES, SENTIMENT type T_FEATURE_SENTIMENT_RESULTS, end of T_KEYWORDS_RESULT. types: "! begin of T_TARGETED_SENTIMENT_RESULTS, TEXT type STRING, SCORE type DOUBLE, end of T_TARGETED_SENTIMENT_RESULTS. types: "! Relevant text that contributed to the categorization. begin of T_CATEGORIES_RELEVANT_TEXT, TEXT type STRING, end of T_CATEGORIES_RELEVANT_TEXT. types: "! Emotion results for the document as a whole. begin of T_DOCUMENT_EMOTION_RESULTS, EMOTION type T_EMOTION_SCORES, end of T_DOCUMENT_EMOTION_RESULTS. types: "! begin of T_DOCUMENT_SENTIMENT_RESULTS, LABEL type STRING, SCORE type DOUBLE, end of T_DOCUMENT_SENTIMENT_RESULTS. types: "! The sentiment of the content. begin of T_SENTIMENT_RESULT, DOCUMENT type T_DOCUMENT_SENTIMENT_RESULTS, TARGETS type STANDARD TABLE OF T_TARGETED_SENTIMENT_RESULTS WITH NON-UNIQUE DEFAULT KEY, end of T_SENTIMENT_RESULT. types: "! begin of T_TOKEN_RESULT, TEXT type STRING, PART_OF_SPEECH type STRING, LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY, LEMMA type STRING, end of T_TOKEN_RESULT. types: "! begin of T_SENTENCE_RESULT, TEXT type STRING, LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY, end of T_SENTENCE_RESULT. types: "! Tokens and sentences returned from syntax analysis. begin of T_SYNTAX_RESULT, TOKENS type STANDARD TABLE OF T_TOKEN_RESULT WITH NON-UNIQUE DEFAULT KEY, SENTENCES type STANDARD TABLE OF T_SENTENCE_RESULT WITH NON-UNIQUE DEFAULT KEY, end of T_SYNTAX_RESULT. types: "! The general concepts referenced or alluded to in the analyzed text. begin of T_CONCEPTS_RESULT, TEXT type STRING, RELEVANCE type DOUBLE, DBPEDIA_RESOURCE type STRING, end of T_CONCEPTS_RESULT. types: "! Information that helps to explain what contributed to the categories result. begin of T_CTGRS_RESULT_EXPLANATION, RELEVANT_TEXT type STANDARD TABLE OF T_CATEGORIES_RELEVANT_TEXT WITH NON-UNIQUE DEFAULT KEY, end of T_CTGRS_RESULT_EXPLANATION. types: "! A categorization of the analyzed text. begin of T_CATEGORIES_RESULT, LABEL type STRING, SCORE type DOUBLE, EXPLANATION type T_CTGRS_RESULT_EXPLANATION, end of T_CATEGORIES_RESULT. types: "! The detected anger, disgust, fear, joy, or sadness that is conveyed by the "! content. Emotion information can be returned for detected entities, keywords, "! or user-specified target phrases found in the text. begin of T_EMOTION_RESULT, DOCUMENT type T_DOCUMENT_EMOTION_RESULTS, TARGETS type STANDARD TABLE OF T_TARGETED_EMOTION_RESULTS WITH NON-UNIQUE DEFAULT KEY, end of T_EMOTION_RESULT. types: "! Analysis results for each requested feature. begin of T_FEATURES_RESULTS, CONCEPTS type STANDARD TABLE OF T_CONCEPTS_RESULT WITH NON-UNIQUE DEFAULT KEY, ENTITIES type STANDARD TABLE OF T_ENTITIES_RESULT WITH NON-UNIQUE DEFAULT KEY, KEYWORDS type STANDARD TABLE OF T_KEYWORDS_RESULT WITH NON-UNIQUE DEFAULT KEY, CATEGORIES type STANDARD TABLE OF T_CATEGORIES_RESULT WITH NON-UNIQUE DEFAULT KEY, EMOTION type T_EMOTION_RESULT, METADATA type T_FEATURES_RESULTS_METADATA, RELATIONS type STANDARD TABLE OF T_RELATIONS_RESULT WITH NON-UNIQUE DEFAULT KEY, SEMANTIC_ROLES type STANDARD TABLE OF T_SEMANTIC_ROLES_RESULT WITH NON-UNIQUE DEFAULT KEY, SENTIMENT type T_SENTIMENT_RESULT, SYNTAX type T_SYNTAX_RESULT, end of T_FEATURES_RESULTS. types: "! The authors, publication date, title, prominent page image, and RSS/ATOM feeds "! of the webpage. Supports URL and HTML input types. begin of T_METADATA_RESULT, AUTHORS type STANDARD TABLE OF T_AUTHOR WITH NON-UNIQUE DEFAULT KEY, PUBLICATION_DATE type STRING, TITLE type STRING, IMAGE type STRING, FEEDS type STANDARD TABLE OF T_FEED WITH NON-UNIQUE DEFAULT KEY, end of T_METADATA_RESULT. types: "! begin of T_ERROR_RESPONSE, CODE type INTEGER, ERROR type STRING, end of T_ERROR_RESPONSE. types: "! Detects anger, disgust, fear, joy, or sadness that is conveyed in the content or "! by the context around target phrases specified in the targets parameter. You "! can analyze emotion for detected entities with `entities.emotion` and for "! keywords with `keywords.emotion`. "! "! Supported languages: English. begin of T_EMOTION_OPTIONS, DOCUMENT type BOOLEAN, TARGETS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, end of T_EMOTION_OPTIONS. types: "! Usage information. begin of T_USAGE, FEATURES type INTEGER, TEXT_CHARACTERS type INTEGER, TEXT_UNITS type INTEGER, end of T_USAGE. types: "! Analyzes the general sentiment of your content or the sentiment toward specific "! target phrases. You can analyze sentiment for detected entities with "! `entities.sentiment` and for keywords with `keywords.sentiment`. "! "! Supported languages: Arabic, English, French, German, Italian, Japanese, "! Korean, Portuguese, Russian, Spanish. begin of T_SENTIMENT_OPTIONS, DOCUMENT type BOOLEAN, TARGETS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, end of T_SENTIMENT_OPTIONS. types: "! begin of T_SEMANTIC_ROLES_ACTION, TEXT type STRING, NORMALIZED type STRING, VERB type T_SEMANTIC_ROLES_VERB, end of T_SEMANTIC_ROLES_ACTION. types: "! Tokenization options. begin of T_SYNTAX_OPTIONS_TOKENS, LEMMA type BOOLEAN, PART_OF_SPEECH type BOOLEAN, end of T_SYNTAX_OPTIONS_TOKENS. types: "! Returns important keywords in the content. "! "! Supported languages: English, French, German, Italian, Japanese, Korean, "! Portuguese, Russian, Spanish, Swedish. begin of T_KEYWORDS_OPTIONS, LIMIT type INTEGER, SENTIMENT type BOOLEAN, EMOTION type BOOLEAN, end of T_KEYWORDS_OPTIONS. types: "! Recognizes when two entities are related and identifies the type of relation. "! For example, an `awardedTo` relation might connect the entities "Nobel Prize" "! and "Albert Einstein". See [Relation "! types](https://cloud.ibm.com/docs/services/natural-language-understanding?topic "! =natural-language-understanding-relations). "! "! Supported languages: Arabic, English, German, Japanese, Korean, Spanish. "! Chinese, Dutch, French, Italian, and Portuguese custom models are also "! supported. begin of T_RELATIONS_OPTIONS, MODEL type STRING, end of T_RELATIONS_OPTIONS. types: "! Identifies people, cities, organizations, and other entities in the content. See "! [Entity types and "! subtypes](https://cloud.ibm.com/docs/services/natural-language-understanding?to "! pic=natural-language-understanding-entity-types). "! "! Supported languages: English, French, German, Italian, Japanese, Korean, "! Portuguese, Russian, Spanish, Swedish. Arabic, Chinese, and Dutch are supported "! only through custom models. begin of T_ENTITIES_OPTIONS, LIMIT type INTEGER, MENTIONS type BOOLEAN, MODEL type STRING, SENTIMENT type BOOLEAN, EMOTION type BOOLEAN, end of T_ENTITIES_OPTIONS. types: "! Returns high-level concepts in the content. For example, a research paper about "! deep learning might return the concept, "Artificial Intelligence" although the "! term is not mentioned. "! "! Supported languages: English, French, German, Italian, Japanese, Korean, "! Portuguese, Spanish. begin of T_CONCEPTS_OPTIONS, LIMIT type INTEGER, end of T_CONCEPTS_OPTIONS. types: "! Returns information from the document, including author name, title, RSS/ATOM "! feeds, prominent page image, and publication date. Supports URL and HTML input "! types only. T_METADATA_OPTIONS type JSONOBJECT. types: "! Returns tokens and sentences from the input text. begin of T_SYNTAX_OPTIONS, TOKENS type T_SYNTAX_OPTIONS_TOKENS, SENTENCES type BOOLEAN, end of T_SYNTAX_OPTIONS. types: "! Returns a five-level taxonomy of the content. The top three categories are "! returned. "! "! Supported languages: Arabic, English, French, German, Italian, Japanese, Korean, "! Portuguese, Spanish. begin of T_CATEGORIES_OPTIONS, EXPLANATION type BOOLEAN, LIMIT type INTEGER, MODEL type STRING, end of T_CATEGORIES_OPTIONS. types: "! Analysis features and options. begin of T_FEATURES, CONCEPTS type T_CONCEPTS_OPTIONS, EMOTION type T_EMOTION_OPTIONS, ENTITIES type T_ENTITIES_OPTIONS, KEYWORDS type T_KEYWORDS_OPTIONS, METADATA type T_METADATA_OPTIONS, RELATIONS type T_RELATIONS_OPTIONS, SEMANTIC_ROLES type T_SEMANTIC_ROLES_OPTIONS, SENTIMENT type T_SENTIMENT_OPTIONS, CATEGORIES type T_CATEGORIES_OPTIONS, SYNTAX type T_SYNTAX_OPTIONS, end of T_FEATURES. types: "! Webpage metadata, such as the author and the title of the page. begin of T_ANALYSIS_RESULTS_METADATA, AUTHORS type STANDARD TABLE OF T_AUTHOR WITH NON-UNIQUE DEFAULT KEY, PUBLICATION_DATE type STRING, TITLE type STRING, IMAGE type STRING, FEEDS type STANDARD TABLE OF T_FEED WITH NON-UNIQUE DEFAULT KEY, end of T_ANALYSIS_RESULTS_METADATA. types: "! API usage information for the request. begin of T_ANALYSIS_RESULTS_USAGE, FEATURES type INTEGER, TEXT_CHARACTERS type INTEGER, TEXT_UNITS type INTEGER, end of T_ANALYSIS_RESULTS_USAGE. types: "! Results of the analysis, organized by feature. begin of T_ANALYSIS_RESULTS, LANGUAGE type STRING, ANALYZED_TEXT type STRING, RETRIEVED_URL type STRING, USAGE type T_ANALYSIS_RESULTS_USAGE, CONCEPTS type STANDARD TABLE OF T_CONCEPTS_RESULT WITH NON-UNIQUE DEFAULT KEY, ENTITIES type STANDARD TABLE OF T_ENTITIES_RESULT WITH NON-UNIQUE DEFAULT KEY, KEYWORDS type STANDARD TABLE OF T_KEYWORDS_RESULT WITH NON-UNIQUE DEFAULT KEY, CATEGORIES type STANDARD TABLE OF T_CATEGORIES_RESULT WITH NON-UNIQUE DEFAULT KEY, EMOTION type T_EMOTION_RESULT, METADATA type T_ANALYSIS_RESULTS_METADATA, RELATIONS type STANDARD TABLE OF T_RELATIONS_RESULT WITH NON-UNIQUE DEFAULT KEY, SEMANTIC_ROLES type STANDARD TABLE OF T_SEMANTIC_ROLES_RESULT WITH NON-UNIQUE DEFAULT KEY, SENTIMENT type T_SENTIMENT_RESULT, SYNTAX type T_SYNTAX_RESULT, end of T_ANALYSIS_RESULTS. types: "! begin of T_SEMANTIC_ROLES_SUBJECT, TEXT type STRING, ENTITIES type STANDARD TABLE OF T_SEMANTIC_ROLES_ENTITY WITH NON-UNIQUE DEFAULT KEY, KEYWORDS type STANDARD TABLE OF T_SEMANTIC_ROLES_KEYWORD WITH NON-UNIQUE DEFAULT KEY, end of T_SEMANTIC_ROLES_SUBJECT. types: "! Custom models that are available for entities and relations. begin of T_LIST_MODELS_RESULTS, MODELS type STANDARD TABLE OF T_MODEL WITH NON-UNIQUE DEFAULT KEY, end of T_LIST_MODELS_RESULTS. types: "! begin of T_SEMANTIC_ROLES_OBJECT, TEXT type STRING, KEYWORDS type STANDARD TABLE OF T_SEMANTIC_ROLES_KEYWORD WITH NON-UNIQUE DEFAULT KEY, end of T_SEMANTIC_ROLES_OBJECT. types: "! An object containing request parameters. begin of T_PARAMETERS, TEXT type STRING, HTML type STRING, URL type STRING, FEATURES type T_FEATURES, CLEAN type BOOLEAN, XPATH type STRING, FALLBACK_TO_RAW type BOOLEAN, RETURN_ANALYZED_TEXT type BOOLEAN, LANGUAGE type STRING, LIMIT_TEXT_CHARACTERS type INTEGER, end of T_PARAMETERS. types: "! Link to the corresponding DBpedia resource. T_DBPEDIA_RESOURCE type String. types: "! Delete model results. begin of T_DELETE_MODEL_RESULTS, DELETED type STRING, end of T_DELETE_MODEL_RESULTS. constants: begin of C_REQUIRED_FIELDS, T_SEMANTIC_ROLES_ENTITY type string value '|', T_SEMANTIC_ROLES_KEYWORD type string value '|', T_SMNTC_ROLES_RESULT_SUBJECT type string value '|', T_SEMANTIC_ROLES_RESULT_OBJECT type string value '|', T_SEMANTIC_ROLES_VERB type string value '|', T_SEMANTIC_ROLES_RESULT_ACTION type string value '|', T_SEMANTIC_ROLES_RESULT type string value '|', T_SEMANTIC_ROLES_OPTIONS type string value '|', T_RELATION_ENTITY type string value '|', T_RELATION_ARGUMENT type string value '|', T_RELATIONS_RESULT type string value '|', T_MODEL type string value '|', T_FEATURE_SENTIMENT_RESULTS type string value '|', T_EMOTION_SCORES type string value '|', T_AUTHOR type string value '|', T_FEED type string value '|', T_FEATURES_RESULTS_METADATA type string value '|', T_ENTITY_MENTION type string value '|', T_DISAMBIGUATION_RESULT type string value '|', T_ENTITIES_RESULT type string value '|', T_TARGETED_EMOTION_RESULTS type string value '|', T_KEYWORDS_RESULT type string value '|', T_TARGETED_SENTIMENT_RESULTS type string value '|', T_CATEGORIES_RELEVANT_TEXT type string value '|', T_DOCUMENT_EMOTION_RESULTS type string value '|', T_DOCUMENT_SENTIMENT_RESULTS type string value '|', T_SENTIMENT_RESULT type string value '|', T_TOKEN_RESULT type string value '|', T_SENTENCE_RESULT type string value '|', T_SYNTAX_RESULT type string value '|', T_CONCEPTS_RESULT type string value '|', T_CTGRS_RESULT_EXPLANATION type string value '|', T_CATEGORIES_RESULT type string value '|', T_EMOTION_RESULT type string value '|', T_FEATURES_RESULTS type string value '|', T_METADATA_RESULT type string value '|', T_ERROR_RESPONSE type string value '|CODE|ERROR|', T_EMOTION_OPTIONS type string value '|', T_USAGE type string value '|', T_SENTIMENT_OPTIONS type string value '|', T_SEMANTIC_ROLES_ACTION type string value '|', T_SYNTAX_OPTIONS_TOKENS type string value '|', T_KEYWORDS_OPTIONS type string value '|', T_RELATIONS_OPTIONS type string value '|', T_ENTITIES_OPTIONS type string value '|', T_CONCEPTS_OPTIONS type string value '|', T_SYNTAX_OPTIONS type string value '|', T_CATEGORIES_OPTIONS type string value '|', T_FEATURES type string value '|', T_ANALYSIS_RESULTS_METADATA type string value '|', T_ANALYSIS_RESULTS_USAGE type string value '|', T_ANALYSIS_RESULTS type string value '|', T_SEMANTIC_ROLES_SUBJECT type string value '|', T_LIST_MODELS_RESULTS type string value '|', T_SEMANTIC_ROLES_OBJECT type string value '|', T_PARAMETERS type string value '|FEATURES|', T_DELETE_MODEL_RESULTS type string value '|', __DUMMY type string value SPACE, end of C_REQUIRED_FIELDS . constants: begin of C_ABAPNAME_DICTIONARY, TEXT type string value 'text', HTML type string value 'html', URL type string value 'url', FEATURES type string value 'features', CLEAN type string value 'clean', XPATH type string value 'xpath', FALLBACK_TO_RAW type string value 'fallback_to_raw', RETURN_ANALYZED_TEXT type string value 'return_analyzed_text', LANGUAGE type string value 'language', LIMIT_TEXT_CHARACTERS type string value 'limit_text_characters', CONCEPTS type string value 'concepts', EMOTION type string value 'emotion', ENTITIES type string value 'entities', KEYWORDS type string value 'keywords', METADATA type string value 'metadata', RELATIONS type string value 'relations', SEMANTIC_ROLES type string value 'semantic_roles', SENTIMENT type string value 'sentiment', CATEGORIES type string value 'categories', SYNTAX type string value 'syntax', MODELS type string value 'models', DELETED type string value 'deleted', STATUS type string value 'status', MODEL_ID type string value 'model_id', DESCRIPTION type string value 'description', WORKSPACE_ID type string value 'workspace_id', VERSION type string value 'version', VERSION_DESCRIPTION type string value 'version_description', CREATED type string value 'created', ANALYZED_TEXT type string value 'analyzed_text', RETRIEVED_URL type string value 'retrieved_url', USAGE type string value 'usage', SEMANTICROLES type string value 'semanticRoles', TEXT_CHARACTERS type string value 'text_characters', TEXT_UNITS type string value 'text_units', RELEVANCE type string value 'relevance', DBPEDIA_RESOURCE type string value 'dbpedia_resource', NAME type string value 'name', SUBTYPE type string value 'subtype', TYPE type string value 'type', CONFIDENCE type string value 'confidence', MENTIONS type string value 'mentions', COUNT type string value 'count', DISAMBIGUATION type string value 'disambiguation', LOCATION type string value 'location', LABEL type string value 'label', SCORE type string value 'score', EXPLANATION type string value 'explanation', DOCUMENT type string value 'document', TARGETS type string value 'targets', ANGER type string value 'anger', DISGUST type string value 'disgust', FEAR type string value 'fear', JOY type string value 'joy', SADNESS type string value 'sadness', AUTHORS type string value 'authors', PUBLICATION_DATE type string value 'publication_date', TITLE type string value 'title', IMAGE type string value 'image', FEEDS type string value 'feeds', LINK type string value 'link', SENTENCE type string value 'sentence', ARGUMENTS type string value 'arguments', SUBJECT type string value 'subject', ACTION type string value 'action', OBJECT type string value 'object', NORMALIZED type string value 'normalized', VERB type string value 'verb', TENSE type string value 'tense', TOKENS type string value 'tokens', SENTENCES type string value 'sentences', PART_OF_SPEECH type string value 'part_of_speech', LEMMA type string value 'lemma', LIMIT type string value 'limit', MODEL type string value 'model', CODE type string value 'code', ERROR type string value 'error', RELEVANT_TEXT type string value 'relevant_text', RELEVANTTEXT type string value 'relevantText', end of C_ABAPNAME_DICTIONARY . methods GET_APPNAME redefinition . methods GET_REQUEST_PROP redefinition . methods GET_SDK_VERSION_DATE redefinition . "! Analyze text. "! "! @parameter I_parameters | "! An object containing request parameters. The `features` object and one of the "! `text`, `html`, or `url` attributes are required. "! @parameter E_RESPONSE | "! Service return value of type T_ANALYSIS_RESULTS "! methods ANALYZE importing !I_parameters type T_PARAMETERS !I_contenttype type string default 'application/json' !I_accept type string default 'application/json' exporting !E_RESPONSE type T_ANALYSIS_RESULTS raising ZCX_IBMC_SERVICE_EXCEPTION . "! List models. "! "! @parameter E_RESPONSE | "! Service return value of type T_LIST_MODELS_RESULTS "! methods LIST_MODELS importing !I_accept type string default 'application/json' exporting !E_RESPONSE type T_LIST_MODELS_RESULTS raising ZCX_IBMC_SERVICE_EXCEPTION . "! Delete model. "! "! @parameter I_model_id | "! Model ID of the model to delete. "! @parameter E_RESPONSE | "! Service return value of type T_DELETE_MODEL_RESULTS "! methods DELETE_MODEL importing !I_model_id type STRING !I_accept type string default 'application/json' exporting !E_RESPONSE type T_DELETE_MODEL_RESULTS raising ZCX_IBMC_SERVICE_EXCEPTION . protected section. private section. methods SET_DEFAULT_QUERY_PARAMETERS changing !C_URL type TS_URL . ENDCLASS. class ZCL_IBMC_NAT_LANG_UNDRSTND_V1 IMPLEMENTATION. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->GET_APPNAME * +-------------------------------------------------------------------------------------------------+ * | [<-()] E_APPNAME TYPE STRING * +--------------------------------------------------------------------------------------</SIGNATURE> method GET_APPNAME. e_appname = 'Natural Language Understanding'. endmethod. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Protected Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->GET_REQUEST_PROP * +-------------------------------------------------------------------------------------------------+ * | [--->] I_AUTH_METHOD TYPE STRING (default =C_DEFAULT) * | [<-()] E_REQUEST_PROP TYPE TS_REQUEST_PROP * +--------------------------------------------------------------------------------------</SIGNATURE> method GET_REQUEST_PROP. data: lv_auth_method type string ##NEEDED. e_request_prop = super->get_request_prop( ). lv_auth_method = i_auth_method. if lv_auth_method eq c_default. lv_auth_method = 'IAM'. endif. if lv_auth_method is initial. e_request_prop-auth_basic = c_boolean_false. e_request_prop-auth_oauth = c_boolean_false. e_request_prop-auth_apikey = c_boolean_false. elseif lv_auth_method eq 'IAM'. e_request_prop-auth_name = 'IAM'. e_request_prop-auth_type = 'apiKey'. e_request_prop-auth_headername = 'Authorization'. e_request_prop-auth_header = c_boolean_true. elseif lv_auth_method eq 'ICP4D'. e_request_prop-auth_name = 'ICP4D'. e_request_prop-auth_type = 'apiKey'. e_request_prop-auth_headername = 'Authorization'. e_request_prop-auth_header = c_boolean_true. elseif lv_auth_method eq 'basicAuth'. e_request_prop-auth_name = 'basicAuth'. e_request_prop-auth_type = 'http'. e_request_prop-auth_basic = c_boolean_true. else. endif. e_request_prop-url-protocol = 'http'. e_request_prop-url-host = 'localhost'. e_request_prop-url-path_base = '/natural-language-understanding/api'. endmethod. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->GET_SDK_VERSION_DATE * +-------------------------------------------------------------------------------------------------+ * | [<-()] E_SDK_VERSION_DATE TYPE STRING * +--------------------------------------------------------------------------------------</SIGNATURE> method get_sdk_version_date. e_sdk_version_date = '20191002122846'. endmethod. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->ANALYZE * +-------------------------------------------------------------------------------------------------+ * | [--->] I_parameters TYPE T_PARAMETERS * | [--->] I_contenttype TYPE string (default ='application/json') * | [--->] I_accept TYPE string (default ='application/json') * | [<---] E_RESPONSE TYPE T_ANALYSIS_RESULTS * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +--------------------------------------------------------------------------------------</SIGNATURE> method ANALYZE. data: ls_request_prop type ts_request_prop, lv_separator(1) type c ##NEEDED, lv_sep(1) type c ##NEEDED, lo_response type to_rest_response, lv_json type string ##NEEDED. ls_request_prop-url-path = '/v1/analyze'. " standard headers ls_request_prop-header_content_type = I_contenttype. ls_request_prop-header_accept = I_accept. set_default_query_parameters( changing c_url = ls_request_prop-url ). " process body parameters data: lv_body type string, lv_bodyparam type string, lv_datatype type char. field-symbols: <lv_text> type any. lv_separator = ''. lv_datatype = get_datatype( i_parameters ). if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep or ls_request_prop-header_content_type cp '*json*'. if lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct or lv_datatype eq ZIF_IBMC_SERVICE_ARCH~c_datatype-struct_deep. lv_bodyparam = abap_to_json( i_value = i_parameters i_dictionary = c_abapname_dictionary i_required_fields = c_required_fields ). else. lv_bodyparam = abap_to_json( i_name = 'parameters' i_value = i_parameters ). endif. lv_body = lv_body && lv_separator && lv_bodyparam. else. assign i_parameters to <lv_text>. lv_bodyparam = <lv_text>. concatenate lv_body lv_bodyparam into lv_body. endif. if ls_request_prop-header_content_type cp '*json*' and lv_body(1) ne '{'. lv_body = `{` && lv_body && `}`. endif. if ls_request_prop-header_content_type cp '*charset=utf-8*'. ls_request_prop-body_bin = convert_string_to_utf8( i_string = lv_body ). replace all occurrences of regex ';\s*charset=utf-8' in ls_request_prop-header_content_type with '' ignoring case. else. ls_request_prop-body = lv_body. endif. " execute HTTP POST request lo_response = HTTP_POST( i_request_prop = ls_request_prop ). " retrieve JSON data lv_json = get_response_string( lo_response ). parse_json( exporting i_json = lv_json i_dictionary = c_abapname_dictionary changing c_abap = e_response ). endmethod. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->LIST_MODELS * +-------------------------------------------------------------------------------------------------+ * | [--->] I_accept TYPE string (default ='application/json') * | [<---] E_RESPONSE TYPE T_LIST_MODELS_RESULTS * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +--------------------------------------------------------------------------------------</SIGNATURE> method LIST_MODELS. data: ls_request_prop type ts_request_prop, lv_separator(1) type c ##NEEDED, lv_sep(1) type c ##NEEDED, lo_response type to_rest_response, lv_json type string ##NEEDED. ls_request_prop-url-path = '/v1/models'. " standard headers ls_request_prop-header_accept = I_accept. set_default_query_parameters( changing c_url = ls_request_prop-url ). " execute HTTP GET request lo_response = HTTP_GET( i_request_prop = ls_request_prop ). " retrieve JSON data lv_json = get_response_string( lo_response ). parse_json( exporting i_json = lv_json i_dictionary = c_abapname_dictionary changing c_abap = e_response ). endmethod. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Public Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->DELETE_MODEL * +-------------------------------------------------------------------------------------------------+ * | [--->] I_model_id TYPE STRING * | [--->] I_accept TYPE string (default ='application/json') * | [<---] E_RESPONSE TYPE T_DELETE_MODEL_RESULTS * | [!CX!] ZCX_IBMC_SERVICE_EXCEPTION * +--------------------------------------------------------------------------------------</SIGNATURE> method DELETE_MODEL. data: ls_request_prop type ts_request_prop, lv_separator(1) type c ##NEEDED, lv_sep(1) type c ##NEEDED, lo_response type to_rest_response, lv_json type string ##NEEDED. ls_request_prop-url-path = '/v1/models/{model_id}'. replace all occurrences of `{model_id}` in ls_request_prop-url-path with i_model_id ignoring case. " standard headers ls_request_prop-header_accept = I_accept. set_default_query_parameters( changing c_url = ls_request_prop-url ). " execute HTTP DELETE request lo_response = HTTP_DELETE( i_request_prop = ls_request_prop ). " retrieve JSON data lv_json = get_response_string( lo_response ). parse_json( exporting i_json = lv_json i_dictionary = c_abapname_dictionary changing c_abap = e_response ). endmethod. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Private Method ZCL_IBMC_NAT_LANG_UNDRSTND_V1->SET_DEFAULT_QUERY_PARAMETERS * +-------------------------------------------------------------------------------------------------+ * | [<-->] C_URL TYPE TS_URL * +--------------------------------------------------------------------------------------</SIGNATURE> method set_default_query_parameters. if not p_version is initial. add_query_parameter( exporting i_parameter = `version` i_value = p_version changing c_url = c_url ). endif. endmethod. ENDCLASS.
37.302846
137
0.666458
128c5f12af05e3b87cba210ce2b59f8e0600fae3
665
abap
ABAP
src/ixml/if_ixml.intf.abap
sbcgua/open-abap
98d939658ec0db2a1ff2bd6979d7c9b52dc9dc5e
[ "MIT" ]
20
2020-10-02T09:37:08.000Z
2022-03-26T15:29:11.000Z
src/ixml/if_ixml.intf.abap
sbcgua/open-abap
98d939658ec0db2a1ff2bd6979d7c9b52dc9dc5e
[ "MIT" ]
28
2020-12-02T15:19:10.000Z
2022-03-24T06:12:47.000Z
src/ixml/if_ixml.intf.abap
sbcgua/open-abap
98d939658ec0db2a1ff2bd6979d7c9b52dc9dc5e
[ "MIT" ]
2
2020-11-17T13:21:38.000Z
2021-11-07T14:35:54.000Z
INTERFACE if_ixml PUBLIC. METHODS create_document RETURNING VALUE(doc) TYPE REF TO if_ixml_document. METHODS create_stream_factory RETURNING VALUE(stream) TYPE REF TO if_ixml_stream_factory. METHODS create_renderer IMPORTING ostream TYPE REF TO if_ixml_ostream document TYPE REF TO if_ixml_document RETURNING VALUE(renderer) TYPE REF TO if_ixml_renderer. METHODS create_parser IMPORTING stream_factory TYPE REF TO if_ixml_stream_factory istream TYPE REF TO if_ixml_istream document TYPE REF TO if_ixml_document RETURNING VALUE(parser) TYPE REF TO if_ixml_parser. ENDINTERFACE.
31.666667
56
0.75188
128c60354036d16ee9c7ef4377e33ccd75b311e0
3,951
abap
ABAP
src/legacy/#dmo#flight_travel_api08.fugr.#dmo#flight_travel_update08.abap
SAP-Cloud-Platform/flight08
1cf83833e737b8a8572854d94889740f8e5de0c9
[ "BSD-Source-Code" ]
null
null
null
src/legacy/#dmo#flight_travel_api08.fugr.#dmo#flight_travel_update08.abap
SAP-Cloud-Platform/flight08
1cf83833e737b8a8572854d94889740f8e5de0c9
[ "BSD-Source-Code" ]
null
null
null
src/legacy/#dmo#flight_travel_api08.fugr.#dmo#flight_travel_update08.abap
SAP-Cloud-Platform/flight08
1cf83833e737b8a8572854d94889740f8e5de0c9
[ "BSD-Source-Code" ]
null
null
null
"! <h1>API for Updating a Travel</h1> "! "! <p> "! Function module to update a single Travel instance with the possibility to update related Bookings and "! Booking Supplements in the same call. "! </p> "! "! <p> "! For an operation only on a Booking or Booking Supplement the Travel Data Change Flag structure still must be applied. "! It then contains only the <em>travel_id</em> and all flags set to <em>false</em> respectively left <em>initial</em>. "! </p> "! "! "! @parameter is_travel | Travel Data "! @parameter is_travelx | Travel Data Change Flags "! @parameter it_booking | Table of predefined Booking Key <em>booking_id</em> and Booking Data "! @parameter it_bookingx | Change Flag Table of Booking Data with predefined Booking Key <em>booking_id</em> "! @parameter it_booking_supplement | Table of predefined Booking Supplement Key <em>booking_id</em>, <em>booking_supplement_id</em> and Booking Supplement Data "! @parameter it_booking_supplementx | Change Flag Table of Booking Supplement Data with predefined Booking Supplement Key <em>booking_id</em>, <em>booking_supplement_id</em> "! @parameter es_travel | Evaluated Travel Data like /DMO/TRAVEL08 "! @parameter et_booking | Table of evaluated Bookings like /DMO/BOOKING08 "! @parameter et_booking_supplement | Table of evaluated Booking Supplements like /DMO/BOOK_SUP_08 "! @parameter et_messages | Table of occurred messages "! FUNCTION /DMO/FLIGHT_TRAVEL_UPDATE08. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" REFERENCE(IS_TRAVEL) TYPE /DMO/IF_FLIGHT_LEGACY08=>TS_TRAVEL_IN *" REFERENCE(IS_TRAVELX) TYPE /DMO/IF_FLIGHT_LEGACY08=>TS_TRAVEL_INX *" REFERENCE(IT_BOOKING) TYPE /DMO/IF_FLIGHT_LEGACY08=>TT_BOOKING_IN *" OPTIONAL *" REFERENCE(IT_BOOKINGX) TYPE *" /DMO/IF_FLIGHT_LEGACY08=>TT_BOOKING_INX OPTIONAL *" REFERENCE(IT_BOOKING_SUPPLEMENT) TYPE *" /DMO/IF_FLIGHT_LEGACY08=>TT_BOOKING_SUPPLEMENT_IN OPTIONAL *" REFERENCE(IT_BOOKING_SUPPLEMENTX) TYPE *" /DMO/IF_FLIGHT_LEGACY08=>TT_BOOKING_SUPPLEMENT_INX OPTIONAL *" EXPORTING *" REFERENCE(ES_TRAVEL) TYPE /DMO/TRAVEL08 *" REFERENCE(ET_BOOKING) TYPE /DMO/IF_FLIGHT_LEGACY08=>TT_BOOKING *" REFERENCE(ET_BOOKING_SUPPLEMENT) TYPE *" /DMO/IF_FLIGHT_LEGACY08=>TT_BOOKING_SUPPLEMENT *" REFERENCE(ET_MESSAGES) TYPE /DMO/IF_FLIGHT_LEGACY08=>TT_MESSAGE *"---------------------------------------------------------------------- CLEAR es_travel. CLEAR et_booking. CLEAR et_booking_supplement. CLEAR et_messages. /dmo/cl_flight_legacy08=>get_instance( )->update_travel( EXPORTING is_travel = is_travel it_booking = it_booking it_booking_supplement = it_booking_supplement is_travelx = is_travelx it_bookingx = it_bookingx it_booking_supplementx = it_booking_supplementx IMPORTING es_travel = es_travel et_booking = et_booking et_booking_supplement = et_booking_supplement et_messages = DATA(lt_messages) ). /dmo/cl_flight_legacy08=>get_instance( )->convert_messages( EXPORTING it_messages = lt_messages IMPORTING et_messages = et_messages ). ENDFUNCTION.
60.784615
174
0.581625
1292b5c455738d2a8dd7323caaa7286f9b4335b7
775
abap
ABAP
src/zcl_io_db_x_reader.clas.testclasses.abap
sandraros/abap-io
8281d5631bed73c411c8e8296944bb98745f9cee
[ "MIT" ]
null
null
null
src/zcl_io_db_x_reader.clas.testclasses.abap
sandraros/abap-io
8281d5631bed73c411c8e8296944bb98745f9cee
[ "MIT" ]
null
null
null
src/zcl_io_db_x_reader.clas.testclasses.abap
sandraros/abap-io
8281d5631bed73c411c8e8296944bb98745f9cee
[ "MIT" ]
null
null
null
*"* 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. DATA(demo_lob_table) = VALUE demo_lob_table( idx = 1 blob1 = _01_to_1a ). INSERT INTO demo_lob_table VALUES demo_lob_table. cl_abap_unit_assert=>assert_subrc( msg = 'test cannot be executed' exp = 0 act = sy-subrc ). DATA std_reader TYPE REF TO cl_abap_db_x_reader. SELECT SINGLE blob1 FROM demo_lob_table INTO std_reader WHERE idx = 1. test_x_reader( NEW zcl_io_db_x_reader( std_reader ) ). ROLLBACK WORK. ENDMETHOD. ENDCLASS.
29.807692
96
0.739355
1294dd36d32586eee43658227f76b68570dbe978
48,270
abap
ABAP
src/zabapgit_object_clas.prog.abap
christian102094/abapGit
b8df5f1e80c3f944f745bdfae61d37931e037e09
[ "MIT" ]
null
null
null
src/zabapgit_object_clas.prog.abap
christian102094/abapGit
b8df5f1e80c3f944f745bdfae61d37931e037e09
[ "MIT" ]
null
null
null
src/zabapgit_object_clas.prog.abap
christian102094/abapGit
b8df5f1e80c3f944f745bdfae61d37931e037e09
[ "MIT" ]
null
null
null
*&---------------------------------------------------------------------* *& Include ZABAPGIT_OBJECT_CLAS *&---------------------------------------------------------------------* *----------------------------------------------------------------------* * CLASS lcl_object_clas DEFINITION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* "This interface contains SAP object oriented functions that can't be put under test "(i.e. creating a Class in the system) INTERFACE lif_object_oriented_object_fnc. TYPES: BEGIN OF ty_includes, programm TYPE programm, END OF ty_includes, ty_includes_tt TYPE STANDARD TABLE OF ty_includes WITH DEFAULT KEY. METHODS: create IMPORTING iv_package TYPE devclass iv_overwrite TYPE seox_boolean DEFAULT seox_true CHANGING is_properties TYPE any RAISING lcx_exception, generate_locals IMPORTING is_key TYPE seoclskey iv_force TYPE seox_boolean DEFAULT seox_true it_local_definitions TYPE seop_source_string OPTIONAL it_local_implementations TYPE seop_source_string OPTIONAL it_local_macros TYPE seop_source_string OPTIONAL it_local_test_classes TYPE seop_source_string OPTIONAL RAISING lcx_exception, deserialize_source IMPORTING is_key TYPE seoclskey it_source TYPE ty_string_tt RAISING lcx_exception cx_sy_dyn_call_error, insert_text_pool IMPORTING iv_class_name TYPE seoclsname it_text_pool TYPE textpool_table iv_language TYPE spras RAISING lcx_exception, update_descriptions IMPORTING is_key TYPE seoclskey it_descriptions TYPE ty_seocompotx_tt, add_to_activation_list IMPORTING is_item TYPE ty_item RAISING lcx_exception, create_sotr IMPORTING iv_package TYPE devclass it_sotr TYPE ty_sotr_tt RAISING lcx_exception, create_documentation IMPORTING it_lines TYPE tlinetab iv_object_name TYPE dokhl-object iv_language TYPE spras RAISING lcx_exception, get_includes IMPORTING iv_object_name TYPE sobj_name RETURNING VALUE(rt_includes) TYPE ty_includes_tt, exists IMPORTING iv_object_name TYPE seoclskey RETURNING VALUE(rv_exists) TYPE abap_bool, serialize_abap IMPORTING is_class_key TYPE seoclskey iv_type TYPE seop_include_ext_app OPTIONAL RETURNING VALUE(rt_source) TYPE ty_string_tt RAISING lcx_exception cx_sy_dyn_call_error, get_skip_test_classes RETURNING VALUE(rv_skip) TYPE abap_bool, get_class_properties IMPORTING is_class_key TYPE seoclskey RETURNING VALUE(rs_class_properties) TYPE vseoclass RAISING lcx_exception, get_interface_properties IMPORTING is_interface_key TYPE seoclskey RETURNING VALUE(rs_interface_properties) TYPE vseointerf RAISING lcx_exception, read_text_pool IMPORTING iv_class_name TYPE seoclsname iv_language TYPE spras RETURNING VALUE(rt_text_pool) TYPE textpool_table, read_documentation IMPORTING iv_class_name TYPE seoclsname iv_language TYPE spras RETURNING VALUE(rt_lines) TYPE tlinetab, read_sotr IMPORTING iv_object_name TYPE sobj_name RETURNING VALUE(rt_sotr) TYPE ty_sotr_tt RAISING lcx_exception, read_descriptions IMPORTING iv_obejct_name TYPE seoclsname RETURNING VALUE(rt_descriptions) TYPE ty_seocompotx_tt, delete IMPORTING is_deletion_key TYPE seoclskey RAISING lcx_exception. ENDINTERFACE. CLASS lcl_oo_object_serializer DEFINITION. PUBLIC SECTION. METHODS: serialize_abap_clif_source IMPORTING is_class_key TYPE seoclskey iv_type TYPE seop_include_ext_app OPTIONAL RETURNING VALUE(rt_source) TYPE ty_string_tt RAISING lcx_exception cx_sy_dyn_call_error, are_test_classes_skipped RETURNING VALUE(rv_return) TYPE abap_bool. METHODS serialize_locals_imp IMPORTING is_clskey TYPE seoclskey RETURNING VALUE(rt_source) TYPE ty_string_tt RAISING lcx_exception. METHODS serialize_locals_def IMPORTING is_clskey TYPE seoclskey RETURNING VALUE(rt_source) TYPE ty_string_tt RAISING lcx_exception. METHODS serialize_testclasses IMPORTING is_clskey TYPE seoclskey RETURNING VALUE(rt_source) TYPE ty_string_tt RAISING lcx_exception. METHODS serialize_macros IMPORTING is_clskey TYPE seoclskey RETURNING VALUE(rt_source) TYPE ty_string_tt RAISING lcx_exception. PRIVATE SECTION. DATA mv_skip_testclass TYPE abap_bool. METHODS serialize_abap_old IMPORTING is_clskey TYPE seoclskey RETURNING VALUE(rt_source) TYPE ty_string_tt RAISING lcx_exception. METHODS serialize_abap_new IMPORTING is_clskey TYPE seoclskey RETURNING VALUE(rt_source) TYPE ty_string_tt RAISING lcx_exception cx_sy_dyn_call_error. METHODS remove_signatures CHANGING ct_source TYPE ty_string_tt. METHODS read_include IMPORTING is_clskey TYPE seoclskey iv_type TYPE seop_include_ext_app RETURNING VALUE(rt_source) TYPE seop_source_string. METHODS reduce CHANGING ct_source TYPE ty_string_tt. ENDCLASS. CLASS lcl_oo_object_serializer IMPLEMENTATION. METHOD serialize_abap_clif_source. TRY. rt_source = serialize_abap_new( is_class_key ). CATCH cx_sy_dyn_call_error. rt_source = serialize_abap_old( is_class_key ). ENDTRY. ENDMETHOD. METHOD serialize_abap_old. * for old ABAP AS versions DATA: lo_source TYPE REF TO cl_oo_source. CREATE OBJECT lo_source EXPORTING clskey = is_clskey EXCEPTIONS class_not_existing = 1 OTHERS = 2. IF sy-subrc <> 0. lcx_exception=>raise( 'error from CL_OO_SOURCE' ). ENDIF. lo_source->read( 'A' ). rt_source = lo_source->get_old_source( ). remove_signatures( CHANGING ct_source = rt_source ). ENDMETHOD. "serialize_abap METHOD serialize_abap_new. DATA: lo_source TYPE REF TO object, lo_instance TYPE REF TO object. * do not call the class/methods statically, as it will * give syntax errors on old versions CALL METHOD ('CL_OO_FACTORY')=>('CREATE_INSTANCE') RECEIVING result = lo_instance. CALL METHOD lo_instance->('CREATE_CLIF_SOURCE') EXPORTING clif_name = is_clskey-clsname version = 'A' RECEIVING result = lo_source. CALL METHOD lo_source->('GET_SOURCE') IMPORTING source = rt_source. ENDMETHOD. METHOD remove_signatures. * signatures messes up in CL_OO_SOURCE when deserializing and serializing * within same session DATA: lv_begin TYPE string, lv_end TYPE string, lv_remove TYPE sap_bool, lv_source LIKE LINE OF ct_source. "@TODO: Put under test CONCATENATE '* <SIGNATURE>------------------------------------' '---------------------------------------------------+' INTO lv_begin. CONCATENATE '* +------------------------------------------------' '--------------------------------------</SIGNATURE>' INTO lv_end. lv_remove = abap_false. LOOP AT ct_source INTO lv_source. IF lv_source = lv_begin. lv_remove = abap_true. ENDIF. IF lv_remove = abap_true. DELETE ct_source INDEX sy-tabix. ENDIF. IF lv_source = lv_end. lv_remove = abap_false. ENDIF. ENDLOOP. ENDMETHOD. "remove_signatures METHOD reduce. DATA: lv_source LIKE LINE OF ct_source, lv_found TYPE sap_bool. * skip files that only contain the standard comments lv_found = abap_false. LOOP AT ct_source INTO lv_source. IF strlen( lv_source ) >= 3 AND lv_source(3) <> '*"*'. lv_found = abap_true. ENDIF. ENDLOOP. IF lv_found = abap_false. CLEAR ct_source[]. ENDIF. ENDMETHOD. "reduce METHOD serialize_locals_imp. rt_source = read_include( is_clskey = is_clskey iv_type = seop_ext_class_locals_imp ). reduce( CHANGING ct_source = rt_source ). ENDMETHOD. "serialize_local METHOD serialize_locals_def. rt_source = read_include( is_clskey = is_clskey iv_type = seop_ext_class_locals_def ). reduce( CHANGING ct_source = rt_source ). ENDMETHOD. "serialize_locals_def METHOD read_include. DATA: ls_include TYPE progstruc. ASSERT iv_type = seop_ext_class_locals_def OR iv_type = seop_ext_class_locals_imp OR iv_type = seop_ext_class_macros OR iv_type = seop_ext_class_testclasses. ls_include-rootname = is_clskey-clsname. TRANSLATE ls_include-rootname USING ' ='. ls_include-categorya = iv_type(1). ls_include-codea = iv_type+1(4). * it looks like there is an issue in function module SEO_CLASS_GET_INCLUDE_SOURCE * on 750 kernels, where the READ REPORT without STATE addition does not * return the active version, this method is a workaround for this issue READ REPORT ls_include INTO rt_source STATE 'A'. ENDMETHOD. METHOD serialize_testclasses. DATA: lv_line1 LIKE LINE OF rt_source, lv_line2 LIKE LINE OF rt_source. rt_source = read_include( is_clskey = is_clskey iv_type = seop_ext_class_testclasses ). * when creating classes in Eclipse it automatically generates the * testclass include, but it is not needed, so skip to avoid * creating an extra file in the repository. * Also remove it if the content is manually removed, but * the class still thinks it contains tests "@TODO: Put under test mv_skip_testclass = abap_false. IF lines( rt_source ) = 2. READ TABLE rt_source INDEX 1 INTO lv_line1. ASSERT sy-subrc = 0. READ TABLE rt_source INDEX 2 INTO lv_line2. ASSERT sy-subrc = 0. IF lv_line1(3) = '*"*' AND lv_line2 IS INITIAL. mv_skip_testclass = abap_true. ENDIF. ELSEIF lines( rt_source ) = 1. READ TABLE rt_source INDEX 1 INTO lv_line1. ASSERT sy-subrc = 0. IF lv_line1 IS INITIAL OR ( strlen( lv_line1 ) >= 3 AND lv_line1(3) = '*"*' ) OR ( strlen( lv_line1 ) = 1 AND lv_line1(1) = '*' ). mv_skip_testclass = abap_true. ENDIF. ELSEIF lines( rt_source ) = 0. mv_skip_testclass = abap_true. ENDIF. ENDMETHOD. "serialize_test METHOD serialize_macros. rt_source = read_include( is_clskey = is_clskey iv_type = seop_ext_class_macros ). reduce( CHANGING ct_source = rt_source ). ENDMETHOD. "serialize_macro METHOD are_test_classes_skipped. rv_return = mv_skip_testclass. ENDMETHOD. ENDCLASS. CLASS lcl_object_oriented_base DEFINITION ABSTRACT. PUBLIC SECTION. INTERFACES: lif_object_oriented_object_fnc. PRIVATE SECTION. DATA mv_skip_test_classes TYPE abap_bool. METHODS deserialize_abap_source_old IMPORTING is_clskey TYPE seoclskey it_source TYPE ty_string_tt RAISING lcx_exception. METHODS deserialize_abap_source_new IMPORTING is_clskey TYPE seoclskey it_source TYPE ty_string_tt RAISING lcx_exception cx_sy_dyn_call_error. ENDCLASS. CLASS lcl_object_oriented_base IMPLEMENTATION. METHOD lif_object_oriented_object_fnc~create. ASSERT 0 = 1. "Subclass responsibility ENDMETHOD. METHOD lif_object_oriented_object_fnc~deserialize_source. TRY. deserialize_abap_source_new( is_clskey = is_key it_source = it_source ). CATCH cx_sy_dyn_call_error. deserialize_abap_source_old( is_clskey = is_key it_source = it_source ). ENDTRY. ENDMETHOD. METHOD lif_object_oriented_object_fnc~generate_locals. ASSERT 0 = 1. "Subclass responsibility ENDMETHOD. METHOD deserialize_abap_source_old. "for backwards compatability down to 702 DATA: lo_source TYPE REF TO cl_oo_source. CREATE OBJECT lo_source EXPORTING clskey = is_clskey EXCEPTIONS class_not_existing = 1 OTHERS = 2. IF sy-subrc <> 0. lcx_exception=>raise( 'error from CL_OO_SOURCE' ). ENDIF. TRY. lo_source->access_permission( seok_access_modify ). lo_source->set_source( it_source ). lo_source->save( ). lo_source->access_permission( seok_access_free ). CATCH cx_oo_access_permission. lcx_exception=>raise( 'permission error' ). CATCH cx_oo_source_save_failure. lcx_exception=>raise( 'save failure' ). ENDTRY. ENDMETHOD. METHOD deserialize_abap_source_new. DATA: lo_factory TYPE REF TO object, lo_source TYPE REF TO object. CALL METHOD ('CL_OO_FACTORY')=>('CREATE_INSTANCE') RECEIVING result = lo_factory. CALL METHOD lo_factory->('CREATE_CLIF_SOURCE') EXPORTING clif_name = is_clskey-clsname RECEIVING result = lo_source. TRY. CALL METHOD lo_source->('IF_OO_CLIF_SOURCE~LOCK'). CATCH cx_oo_access_permission. lcx_exception=>raise( 'source_new, access permission exception' ). ENDTRY. CALL METHOD lo_source->('IF_OO_CLIF_SOURCE~SET_SOURCE') EXPORTING source = it_source. CALL METHOD lo_source->('IF_OO_CLIF_SOURCE~SAVE'). CALL METHOD lo_source->('IF_OO_CLIF_SOURCE~UNLOCK'). ENDMETHOD. METHOD lif_object_oriented_object_fnc~add_to_activation_list. lcl_objects_activation=>add_item( is_item ). ENDMETHOD. METHOD lif_object_oriented_object_fnc~update_descriptions. DELETE FROM seocompotx WHERE clsname = is_key-clsname. INSERT seocompotx FROM TABLE it_descriptions. ENDMETHOD. METHOD lif_object_oriented_object_fnc~insert_text_pool. ASSERT 0 = 1. "Subclass responsibility ENDMETHOD. METHOD lif_object_oriented_object_fnc~create_sotr. ASSERT 0 = 1. "Subclass responsibility ENDMETHOD. METHOD lif_object_oriented_object_fnc~create_documentation. CALL FUNCTION 'DOCU_UPD' EXPORTING id = 'CL' langu = iv_language object = iv_object_name TABLES line = it_lines EXCEPTIONS ret_code = 1 OTHERS = 2. IF sy-subrc <> 0. lcx_exception=>raise( 'error from DOCU_UPD' ). ENDIF. ENDMETHOD. METHOD lif_object_oriented_object_fnc~get_includes. ASSERT 0 = 1. "Subclass responsibility ENDMETHOD. METHOD lif_object_oriented_object_fnc~exists. CALL FUNCTION 'SEO_CLASS_EXISTENCE_CHECK' EXPORTING clskey = iv_object_name EXCEPTIONS not_specified = 1 not_existing = 2 is_interface = 3 no_text = 4 inconsistent = 5 OTHERS = 6. rv_exists = boolc( sy-subrc <> 2 ). ENDMETHOD. METHOD lif_object_oriented_object_fnc~serialize_abap. DATA lo_oo_serializer TYPE REF TO lcl_oo_object_serializer. CREATE OBJECT lo_oo_serializer. CASE iv_type. WHEN seop_ext_class_locals_def. rt_source = lo_oo_serializer->serialize_locals_def( is_class_key ). WHEN seop_ext_class_locals_imp. rt_source = lo_oo_serializer->serialize_locals_imp( is_class_key ). WHEN seop_ext_class_macros. rt_source = lo_oo_serializer->serialize_macros( is_class_key ). WHEN seop_ext_class_testclasses. rt_source = lo_oo_serializer->serialize_testclasses( is_class_key ). mv_skip_test_classes = lo_oo_serializer->are_test_classes_skipped( ). WHEN OTHERS. rt_source = lo_oo_serializer->serialize_abap_clif_source( is_class_key ). ENDCASE. ENDMETHOD. METHOD lif_object_oriented_object_fnc~get_skip_test_classes. rv_skip = mv_skip_test_classes. ENDMETHOD. METHOD lif_object_oriented_object_fnc~get_class_properties. ASSERT 0 = 1. "Subclass responsibility ENDMETHOD. METHOD lif_object_oriented_object_fnc~get_interface_properties. ASSERT 0 = 1. "Subclass responsibility ENDMETHOD. METHOD lif_object_oriented_object_fnc~read_text_pool. ASSERT 0 = 1. "Subclass responsibility ENDMETHOD. METHOD lif_object_oriented_object_fnc~read_sotr. ASSERT 0 = 1. "Subclass responsibility ENDMETHOD. METHOD lif_object_oriented_object_fnc~read_documentation. DATA: lv_state TYPE dokstate, lv_object TYPE dokhl-object, lt_lines TYPE tlinetab. lv_object = iv_class_name. CALL FUNCTION 'DOCU_GET' EXPORTING id = 'CL' langu = iv_language object = lv_object IMPORTING dokstate = lv_state TABLES line = lt_lines EXCEPTIONS no_docu_on_screen = 1 no_docu_self_def = 2 no_docu_temp = 3 ret_code = 4 OTHERS = 5. IF sy-subrc = 0 AND lv_state = 'R'. rt_lines = lt_lines. ELSE. CLEAR rt_lines. ENDIF. ENDMETHOD. METHOD lif_object_oriented_object_fnc~read_descriptions. SELECT * FROM seocompotx INTO TABLE rt_descriptions WHERE clsname = iv_obejct_name. DELETE rt_descriptions WHERE descript IS INITIAL. ENDMETHOD. METHOD lif_object_oriented_object_fnc~delete. ASSERT 0 = 1. "Subclass responsibility ENDMETHOD. ENDCLASS. CLASS lcl_object_oriented_class DEFINITION INHERITING FROM lcl_object_oriented_base. PUBLIC SECTION. METHODS: lif_object_oriented_object_fnc~create REDEFINITION, lif_object_oriented_object_fnc~generate_locals REDEFINITION, lif_object_oriented_object_fnc~insert_text_pool REDEFINITION, lif_object_oriented_object_fnc~create_sotr REDEFINITION, lif_object_oriented_object_fnc~get_includes REDEFINITION, lif_object_oriented_object_fnc~get_class_properties REDEFINITION, lif_object_oriented_object_fnc~read_text_pool REDEFINITION, lif_object_oriented_object_fnc~read_sotr REDEFINITION, lif_object_oriented_object_fnc~delete REDEFINITION. ENDCLASS. CLASS lcl_object_oriented_class IMPLEMENTATION. METHOD lif_object_oriented_object_fnc~create. CALL FUNCTION 'SEO_CLASS_CREATE_COMPLETE' EXPORTING devclass = iv_package overwrite = iv_overwrite CHANGING class = is_properties EXCEPTIONS existing = 1 is_interface = 2 db_error = 3 component_error = 4 no_access = 5 other = 6 OTHERS = 7. IF sy-subrc <> 0. lcx_exception=>raise( 'error from SEO_CLASS_CREATE_COMPLETE' ). ENDIF. ENDMETHOD. METHOD lif_object_oriented_object_fnc~generate_locals. CALL FUNCTION 'SEO_CLASS_GENERATE_LOCALS' EXPORTING clskey = is_key force = iv_force locals_def = it_local_definitions locals_imp = it_local_implementations locals_mac = it_local_macros locals_testclasses = it_local_test_classes EXCEPTIONS not_existing = 1 model_only = 2 locals_not_generated = 3 locals_not_initialised = 4 OTHERS = 5. IF sy-subrc <> 0. lcx_exception=>raise( 'error from generate_locals' ). ENDIF. ENDMETHOD. METHOD lif_object_oriented_object_fnc~insert_text_pool. DATA: lv_cp TYPE program. lv_cp = cl_oo_classname_service=>get_classpool_name( iv_class_name ). INSERT TEXTPOOL lv_cp FROM it_text_pool LANGUAGE iv_language STATE 'I'. IF sy-subrc <> 0. lcx_exception=>raise( 'error from INSERT TEXTPOOL' ). ENDIF. lcl_objects_activation=>add( iv_type = 'REPT' iv_name = lv_cp ). ENDMETHOD. METHOD lif_object_oriented_object_fnc~create_sotr. DATA: lt_sotr TYPE ty_sotr_tt, lt_objects TYPE sotr_objects, ls_paket TYPE sotr_pack, lv_object LIKE LINE OF lt_objects. FIELD-SYMBOLS: <ls_sotr> LIKE LINE OF lt_sotr. LOOP AT it_sotr ASSIGNING <ls_sotr>. CALL FUNCTION 'SOTR_OBJECT_GET_OBJECTS' EXPORTING object_vector = <ls_sotr>-header-objid_vec IMPORTING objects = lt_objects EXCEPTIONS object_not_found = 1 OTHERS = 2. IF sy-subrc <> 0. lcx_exception=>raise( 'error from SOTR_OBJECT_GET_OBJECTS' ). ENDIF. READ TABLE lt_objects INDEX 1 INTO lv_object. ASSERT sy-subrc = 0. ls_paket-paket = iv_package. CALL FUNCTION 'SOTR_CREATE_CONCEPT' EXPORTING paket = ls_paket crea_lan = <ls_sotr>-header-crea_lan alias_name = <ls_sotr>-header-alias_name object = lv_object entries = <ls_sotr>-entries concept_default = <ls_sotr>-header-concept EXCEPTIONS package_missing = 1 crea_lan_missing = 2 object_missing = 3 paket_does_not_exist = 4 alias_already_exist = 5 object_type_not_found = 6 langu_missing = 7 identical_context_not_allowed = 8 text_too_long = 9 error_in_update = 10 no_master_langu = 11 error_in_concept_id = 12 alias_not_allowed = 13 tadir_entry_creation_failed = 14 internal_error = 15 error_in_correction = 16 user_cancelled = 17 no_entry_found = 18 OTHERS = 19. IF sy-subrc <> 0. lcx_exception=>raise( 'error from SOTR_CREATE_CONCEPT' ). ENDIF. ENDLOOP. ENDMETHOD. METHOD lif_object_oriented_object_fnc~get_includes. * note: includes returned might not exist * method cl_oo_classname_service=>GET_ALL_CLASS_INCLUDES does not exist in 702 DATA: lv_class_name TYPE seoclsname, lt_methods TYPE seop_methods_w_include. FIELD-SYMBOLS: <ls_method> LIKE LINE OF lt_methods. lv_class_name = iv_object_name. APPEND cl_oo_classname_service=>get_ccdef_name( lv_class_name ) TO rt_includes. APPEND cl_oo_classname_service=>get_ccmac_name( lv_class_name ) TO rt_includes. APPEND cl_oo_classname_service=>get_ccimp_name( lv_class_name ) TO rt_includes. APPEND cl_oo_classname_service=>get_cl_name( lv_class_name ) TO rt_includes. APPEND cl_oo_classname_service=>get_ccau_name( lv_class_name ) TO rt_includes. APPEND cl_oo_classname_service=>get_pubsec_name( lv_class_name ) TO rt_includes. APPEND cl_oo_classname_service=>get_prosec_name( lv_class_name ) TO rt_includes. APPEND cl_oo_classname_service=>get_prisec_name( lv_class_name ) TO rt_includes. APPEND cl_oo_classname_service=>get_classpool_name( lv_class_name ) TO rt_includes. APPEND cl_oo_classname_service=>get_ct_name( lv_class_name ) TO rt_includes. APPEND cl_oo_classname_service=>get_cs_name( lv_class_name ) TO rt_includes. lt_methods = cl_oo_classname_service=>get_all_method_includes( lv_class_name ). LOOP AT lt_methods ASSIGNING <ls_method>. APPEND <ls_method>-incname TO rt_includes. ENDLOOP. ENDMETHOD. METHOD lif_object_oriented_object_fnc~get_class_properties. CALL FUNCTION 'SEO_CLIF_GET' EXPORTING cifkey = is_class_key version = seoc_version_active IMPORTING class = rs_class_properties EXCEPTIONS not_existing = 1 deleted = 2 model_only = 3 OTHERS = 4. IF sy-subrc = 1. RETURN. " in case only inactive version exists ELSEIF sy-subrc <> 0. lcx_exception=>raise( 'error from seo_clif_get' ). ENDIF. ENDMETHOD. METHOD lif_object_oriented_object_fnc~read_text_pool. DATA: lv_cp TYPE program. lv_cp = cl_oo_classname_service=>get_classpool_name( iv_class_name ). READ TEXTPOOL lv_cp INTO rt_text_pool LANGUAGE iv_language. "#EC CI_READ_REP ENDMETHOD. METHOD lif_object_oriented_object_fnc~read_sotr. DATA: lv_concept TYPE sotr_head-concept, lt_seocompodf TYPE STANDARD TABLE OF seocompodf WITH DEFAULT KEY, ls_header TYPE sotr_head, lt_entries TYPE sotr_text_tt. FIELD-SYMBOLS: <ls_sotr> LIKE LINE OF rt_sotr, <ls_seocompodf> LIKE LINE OF lt_seocompodf, <ls_entry> LIKE LINE OF lt_entries. SELECT * FROM seocompodf INTO TABLE lt_seocompodf WHERE clsname = iv_object_name AND version = '1' AND exposure = '2' AND attdecltyp = '2' AND type = 'SOTR_CONC' ORDER BY PRIMARY KEY. LOOP AT lt_seocompodf ASSIGNING <ls_seocompodf>. lv_concept = translate( val = <ls_seocompodf>-attvalue from = '''' to = '' ). CALL FUNCTION 'SOTR_GET_CONCEPT' EXPORTING concept = lv_concept IMPORTING header = ls_header TABLES entries = lt_entries EXCEPTIONS no_entry_found = 1 OTHERS = 2. IF sy-subrc <> 0. CONTINUE. ENDIF. CLEAR: ls_header-paket, ls_header-crea_name, ls_header-crea_tstut, ls_header-chan_name, ls_header-chan_tstut. LOOP AT lt_entries ASSIGNING <ls_entry>. CLEAR: <ls_entry>-version, <ls_entry>-crea_name, <ls_entry>-crea_tstut, <ls_entry>-chan_name, <ls_entry>-chan_tstut. ENDLOOP. APPEND INITIAL LINE TO rt_sotr ASSIGNING <ls_sotr>. <ls_sotr>-header = ls_header. <ls_sotr>-entries = lt_entries. ENDLOOP. ENDMETHOD. METHOD lif_object_oriented_object_fnc~delete. CALL FUNCTION 'SEO_CLASS_DELETE_COMPLETE' EXPORTING clskey = is_deletion_key EXCEPTIONS not_existing = 1 is_interface = 2 db_error = 3 no_access = 4 other = 5 OTHERS = 6. IF sy-subrc <> 0. lcx_exception=>raise( 'Error from SEO_CLASS_DELETE_COMPLETE' ). ENDIF. ENDMETHOD. ENDCLASS. CLASS lcl_object_oriented_interface DEFINITION INHERITING FROM lcl_object_oriented_base. PUBLIC SECTION. METHODS: lif_object_oriented_object_fnc~create REDEFINITION, lif_object_oriented_object_fnc~get_includes REDEFINITION, lif_object_oriented_object_fnc~get_interface_properties REDEFINITION, lif_object_oriented_object_fnc~delete REDEFINITION. ENDCLASS. CLASS lcl_object_oriented_interface IMPLEMENTATION. METHOD lif_object_oriented_object_fnc~create. CALL FUNCTION 'SEO_INTERFACE_CREATE_COMPLETE' EXPORTING devclass = iv_package overwrite = iv_overwrite CHANGING interface = is_properties EXCEPTIONS existing = 1 is_class = 2 db_error = 3 component_error = 4 no_access = 5 other = 6 OTHERS = 7. IF sy-subrc <> 0. lcx_exception=>raise( 'Error from SEO_INTERFACE_CREATE_COMPLETE' ). ENDIF. ENDMETHOD. METHOD lif_object_oriented_object_fnc~get_includes. DATA lv_interface_name TYPE seoclsname. lv_interface_name = iv_object_name. APPEND cl_oo_classname_service=>get_interfacepool_name( lv_interface_name ) TO rt_includes. ENDMETHOD. METHOD lif_object_oriented_object_fnc~get_interface_properties. CALL FUNCTION 'SEO_CLIF_GET' EXPORTING cifkey = is_interface_key version = seoc_version_active IMPORTING interface = rs_interface_properties EXCEPTIONS not_existing = 1 deleted = 2 model_only = 3 OTHERS = 4. IF sy-subrc = 1. RETURN. " in case only inactive version exists ELSEIF sy-subrc <> 0. lcx_exception=>raise( 'error from seo_clif_get' ). ENDIF. ENDMETHOD. METHOD lif_object_oriented_object_fnc~delete. CALL FUNCTION 'SEO_INTERFACE_DELETE_COMPLETE' EXPORTING intkey = is_deletion_key EXCEPTIONS not_existing = 1 is_class = 2 db_error = 3 no_access = 4 other = 5 OTHERS = 6. IF sy-subrc <> 0. lcx_exception=>raise( 'Error from SEO_INTERFACE_DELETE_COMPLETE' ). ENDIF. ENDMETHOD. ENDCLASS. CLASS lth_oo_factory_injector DEFINITION DEFERRED. CLASS lcl_object_oriented_factory DEFINITION FRIENDS lth_oo_factory_injector. PUBLIC SECTION. CLASS-METHODS: make IMPORTING iv_object_type TYPE tadir-object RETURNING VALUE(ro_object_oriented_object) TYPE REF TO lif_object_oriented_object_fnc. PRIVATE SECTION. CLASS-DATA: go_object_oriented_object TYPE REF TO lif_object_oriented_object_fnc. ENDCLASS. CLASS lcl_object_oriented_factory IMPLEMENTATION. METHOD make. IF go_object_oriented_object IS BOUND. ro_object_oriented_object = go_object_oriented_object. RETURN. ENDIF. IF iv_object_type = 'CLAS'. CREATE OBJECT ro_object_oriented_object TYPE lcl_object_oriented_class. ELSEIF iv_object_type = 'INTF'. CREATE OBJECT ro_object_oriented_object TYPE lcl_object_oriented_interface. ENDIF. ENDMETHOD. ENDCLASS. CLASS lth_oo_factory_injector DEFINITION FOR TESTING. PUBLIC SECTION. CLASS-METHODS: inject IMPORTING io_object_oriented_object TYPE REF TO lif_object_oriented_object_fnc. ENDCLASS. CLASS lth_oo_factory_injector IMPLEMENTATION. METHOD inject. lcl_object_oriented_factory=>go_object_oriented_object = io_object_oriented_object. ENDMETHOD. ENDCLASS. CLASS lcl_object_clas DEFINITION INHERITING FROM lcl_objects_program. PUBLIC SECTION. INTERFACES lif_object. ALIASES mo_files FOR lif_object~mo_files. METHODS constructor IMPORTING is_item TYPE ty_item iv_language TYPE spras. PROTECTED SECTION. METHODS deserialize_abap IMPORTING io_xml TYPE REF TO lcl_xml_input iv_package TYPE devclass RAISING lcx_exception. METHODS deserialize_docu IMPORTING io_xml TYPE REF TO lcl_xml_input RAISING lcx_exception. DATA mo_object_oriented_object_fct TYPE REF TO lif_object_oriented_object_fnc. PRIVATE SECTION. DATA mv_skip_testclass TYPE abap_bool. METHODS deserialize_tpool IMPORTING io_xml TYPE REF TO lcl_xml_input RAISING lcx_exception. METHODS deserialize_sotr IMPORTING io_xml TYPE REF TO lcl_xml_input iv_package TYPE devclass RAISING lcx_exception. METHODS serialize_xml IMPORTING io_xml TYPE REF TO lcl_xml_output RAISING lcx_exception. ENDCLASS. "lcl_object_dtel DEFINITION *----------------------------------------------------------------------* * CLASS lcl_object_clas IMPLEMENTATION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* CLASS lcl_object_clas IMPLEMENTATION. METHOD lif_object~has_changed_since. DATA: lt_includes TYPE seoincl_t. FIELD-SYMBOLS <incl> LIKE LINE OF lt_includes. lt_includes = mo_object_oriented_object_fct->get_includes( ms_item-obj_name ). LOOP AT lt_includes ASSIGNING <incl>. rv_changed = check_prog_changed_since( iv_program = <incl> iv_timestamp = iv_timestamp iv_skip_gui = abap_true ). IF rv_changed = abap_true. RETURN. ENDIF. ENDLOOP. ENDMETHOD. "lif_object~has_changed_since METHOD lif_object~get_metadata. rs_metadata = get_metadata( ). ENDMETHOD. "lif_object~get_metadata METHOD lif_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 = mo_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 lif_object~exists. DATA: ls_class_key TYPE seoclskey. ls_class_key-clsname = ms_item-obj_name. rv_bool = mo_object_oriented_object_fct->exists( iv_object_name = ls_class_key ). ENDMETHOD. "lif_object~exists METHOD lif_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. "jump METHOD lif_object~delete. DATA: ls_clskey TYPE seoclskey. ls_clskey-clsname = ms_item-obj_name. mo_object_oriented_object_fct->delete( ls_clskey ). ENDMETHOD. "delete METHOD lif_object~serialize. DATA: lt_source TYPE seop_source_string, ls_class_key TYPE seoclskey. ls_class_key-clsname = ms_item-obj_name. IF lif_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 = mo_object_oriented_object_fct->serialize_abap( ls_class_key ). mo_files->add_abap( lt_source ). lt_source = mo_object_oriented_object_fct->serialize_abap( is_class_key = ls_class_key iv_type = seop_ext_class_locals_def ). IF NOT lt_source[] IS INITIAL. mo_files->add_abap( iv_extra = 'locals_def' it_abap = lt_source ). "#EC NOTEXT ENDIF. lt_source = mo_object_oriented_object_fct->serialize_abap( is_class_key = ls_class_key iv_type = seop_ext_class_locals_imp ). IF NOT lt_source[] IS INITIAL. mo_files->add_abap( iv_extra = 'locals_imp' it_abap = lt_source ). "#EC NOTEXT ENDIF. lt_source = mo_object_oriented_object_fct->serialize_abap( is_class_key = ls_class_key iv_type = seop_ext_class_testclasses ). mv_skip_testclass = mo_object_oriented_object_fct->get_skip_test_classes( ). IF NOT lt_source[] IS INITIAL AND mv_skip_testclass = abap_false. mo_files->add_abap( iv_extra = 'testclasses' it_abap = lt_source ). "#EC NOTEXT ENDIF. lt_source = mo_object_oriented_object_fct->serialize_abap( is_class_key = ls_class_key iv_type = seop_ext_class_macros ). IF NOT lt_source[] IS INITIAL. mo_files->add_abap( iv_extra = 'macros' it_abap = lt_source ). "#EC NOTEXT ENDIF. serialize_xml( io_xml ). ENDMETHOD. "serialize METHOD serialize_xml. DATA: ls_vseoclass TYPE vseoclass, lt_tpool TYPE textpool_table, lv_object TYPE dokhl-object, lv_state TYPE dokhl-dokstate, lt_descriptions TYPE ty_seocompotx_tt, ls_clskey TYPE seoclskey, lt_sotr TYPE ty_sotr_tt, lt_lines TYPE tlinetab. ls_clskey-clsname = ms_item-obj_name. ls_vseoclass = mo_object_oriented_object_fct->get_class_properties( is_class_key = ls_clskey ). 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 = mo_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 = mo_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 = mo_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 = mo_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. "serialize_xml METHOD lif_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. "deserialize METHOD deserialize_sotr. "OTR stands for Online Text Repository DATA: lt_sotr TYPE ty_sotr_tt, lt_objects TYPE sotr_objects. io_xml->read( EXPORTING iv_name = 'SOTR' CHANGING cg_data = lt_sotr ). IF lines( lt_sotr ) = 0. RETURN. ENDIF. mo_object_oriented_object_fct->create_sotr( iv_package = iv_package it_sotr = lt_sotr ). 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 lt_lines[] IS INITIAL. RETURN. ENDIF. lv_object = ms_item-obj_name. mo_object_oriented_object_fct->create_documentation( it_lines = lt_lines iv_object_name = lv_object iv_language = mv_language ). ENDMETHOD. "deserialize_doku METHOD deserialize_tpool. DATA: lv_clsname TYPE seoclsname, lt_tpool_ext TYPE 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 lt_tpool[] IS INITIAL. RETURN. ENDIF. lv_clsname = ms_item-obj_name. mo_object_oriented_object_fct->insert_text_pool( iv_class_name = lv_clsname it_text_pool = lt_tpool iv_language = mv_language ). ENDMETHOD. "deserialize_textpool 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 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 ). mo_object_oriented_object_fct->create( EXPORTING iv_package = iv_package CHANGING is_properties = ls_vseoclass ). mo_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 ). mo_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 ). mo_object_oriented_object_fct->update_descriptions( is_key = ls_class_key it_descriptions = lt_descriptions ). mo_object_oriented_object_fct->add_to_activation_list( is_item = ms_item ). ENDMETHOD. "deserialize METHOD lif_object~compare_to_remote_version. CREATE OBJECT ro_comparison_result TYPE lcl_null_comparison_result. ENDMETHOD. METHOD constructor. super->constructor( is_item = is_item iv_language = iv_language ). mo_object_oriented_object_fct = lcl_object_oriented_factory=>make( iv_object_type = ms_item-obj_type ). ENDMETHOD. ENDCLASS. "lcl_object_CLAS IMPLEMENTATION *----------------------------------------------------------------------* * CLASS lcl_object_intf DEFINITION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* CLASS lcl_object_intf DEFINITION INHERITING FROM lcl_object_clas FINAL. * @TODO, CLAS + INTF to be refactored, see: * https://github.com/larshp/abapGit/issues/21 PUBLIC SECTION. METHODS: lif_object~deserialize REDEFINITION, lif_object~has_changed_since REDEFINITION, lif_object~serialize REDEFINITION. PROTECTED SECTION. METHODS: deserialize_abap REDEFINITION. PRIVATE SECTION. METHODS serialize_xml IMPORTING io_xml TYPE REF TO lcl_xml_output RAISING lcx_exception. ENDCLASS. "lcl_object_intf DEFINITION CLASS lcl_object_intf IMPLEMENTATION. METHOD lif_object~deserialize. deserialize_abap( io_xml = io_xml iv_package = iv_package ). deserialize_docu( io_xml ). ENDMETHOD. METHOD deserialize_abap. DATA: ls_vseointerf TYPE vseointerf, lt_source TYPE seop_source_string, lt_descriptions TYPE ty_seocompotx_tt, ls_clskey TYPE seoclskey. ls_clskey-clsname = ms_item-obj_name. lt_source = mo_files->read_abap( ). io_xml->read( EXPORTING iv_name = 'VSEOINTERF' CHANGING cg_data = ls_vseointerf ). mo_object_oriented_object_fct->create( EXPORTING iv_package = iv_package CHANGING is_properties = ls_vseointerf ). mo_object_oriented_object_fct->deserialize_source( is_key = ls_clskey it_source = lt_source ). io_xml->read( EXPORTING iv_name = 'DESCRIPTIONS' CHANGING cg_data = lt_descriptions ). mo_object_oriented_object_fct->update_descriptions( is_key = ls_clskey it_descriptions = lt_descriptions ). mo_object_oriented_object_fct->add_to_activation_list( is_item = ms_item ). ENDMETHOD. METHOD lif_object~has_changed_since. DATA: lv_program TYPE program, lt_includes TYPE seoincl_t. lt_includes = mo_object_oriented_object_fct->get_includes( ms_item-obj_name ). READ TABLE lt_includes INDEX 1 INTO lv_program. "lv_program = cl_oo_classname_service=>get_interfacepool_name( lv_clsname ). rv_changed = check_prog_changed_since( iv_program = lv_program iv_timestamp = iv_timestamp iv_skip_gui = abap_true ). ENDMETHOD. METHOD lif_object~serialize. DATA: lt_source TYPE seop_source_string, ls_interface_key TYPE seoclskey. ls_interface_key-clsname = ms_item-obj_name. IF lif_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 = mo_object_oriented_object_fct->serialize_abap( ls_interface_key ). mo_files->add_abap( lt_source ). serialize_xml( io_xml ). ENDMETHOD. METHOD serialize_xml. DATA: lt_tpool TYPE textpool_table, lv_object TYPE dokhl-object, lv_state TYPE dokhl-dokstate, lt_descriptions TYPE ty_seocompotx_tt, ls_vseointerf TYPE vseointerf, ls_clskey TYPE seoclskey, lt_sotr TYPE ty_sotr_tt, lt_lines TYPE tlinetab. ls_clskey-clsname = ms_item-obj_name. ls_vseointerf = mo_object_oriented_object_fct->get_interface_properties( is_interface_key = ls_clskey ). CLEAR: ls_vseointerf-uuid, ls_vseointerf-author, ls_vseointerf-createdon, ls_vseointerf-changedby, ls_vseointerf-changedon, ls_vseointerf-r3release. io_xml->add( iv_name = 'VSEOINTERF' ig_data = ls_vseointerf ). lt_lines = mo_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 = mo_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. ENDCLASS.
31.283215
108
0.642283
12958b8648e0ea90e36fea2767b570fdd9cfed51
6,577
abap
ABAP
src/ui/zcl_abapgit_gui_page_merge.clas.abap
joymike/abapGit
e06f22bb22a3c0a3c66eec4da698124c1ec98d65
[ "MIT" ]
1
2019-11-29T05:30:57.000Z
2019-11-29T05:30:57.000Z
src/ui/zcl_abapgit_gui_page_merge.clas.abap
joymike/abapGit
e06f22bb22a3c0a3c66eec4da698124c1ec98d65
[ "MIT" ]
null
null
null
src/ui/zcl_abapgit_gui_page_merge.clas.abap
joymike/abapGit
e06f22bb22a3c0a3c66eec4da698124c1ec98d65
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_gui_page_merge DEFINITION PUBLIC INHERITING FROM zcl_abapgit_gui_page FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES: zif_abapgit_gui_page_hotkey. METHODS constructor IMPORTING io_repo TYPE REF TO zcl_abapgit_repo_online iv_source TYPE string iv_target TYPE string RAISING zcx_abapgit_exception . METHODS zif_abapgit_gui_event_handler~on_event REDEFINITION. PROTECTED SECTION. METHODS render_content REDEFINITION. PRIVATE SECTION. DATA mo_repo TYPE REF TO zcl_abapgit_repo_online . DATA mo_merge TYPE REF TO zcl_abapgit_merge . CONSTANTS: BEGIN OF c_actions, merge TYPE string VALUE 'merge' ##NO_TEXT, res_conflicts TYPE string VALUE 'res_conflicts' ##NO_TEXT, END OF c_actions . METHODS build_menu IMPORTING VALUE(iv_with_conflict) TYPE abap_bool OPTIONAL RETURNING VALUE(ro_menu) TYPE REF TO zcl_abapgit_html_toolbar . ENDCLASS. CLASS ZCL_ABAPGIT_GUI_PAGE_MERGE IMPLEMENTATION. METHOD build_menu. CREATE OBJECT ro_menu. ro_menu->add( iv_txt = 'Merge' iv_act = c_actions-merge iv_cur = abap_false ) ##NO_TEXT. IF iv_with_conflict = abap_true. ro_menu->add( iv_txt = 'Resolve Conflicts' iv_act = c_actions-res_conflicts ) ##NO_TEXT. ENDIF. ENDMETHOD. METHOD constructor. super->constructor( ). mo_repo = io_repo. io_repo->set_branch_name( |refs/heads/{ iv_target }| ). CREATE OBJECT mo_merge EXPORTING io_repo = io_repo iv_source_branch = iv_source. mo_merge->run( ). ms_control-page_title = 'MERGE'. ms_control-page_menu = build_menu( mo_merge->has_conflicts( ) ). ENDMETHOD. METHOD render_content. DEFINE _show_file. READ TABLE &1 ASSIGNING <ls_show> WITH KEY path = <ls_file>-path name = <ls_file>-name. IF sy-subrc = 0. IF <ls_show>-sha1 = ls_result-sha1. ro_html->add( |<td>{ <ls_show>-path }{ <ls_show>-name }</td><td><b>{ <ls_show>-sha1(7) }</b></td>| ). ELSE. ro_html->add( |<td>{ <ls_show>-path }{ <ls_show>-name }</td><td>{ <ls_show>-sha1(7) }</td>| ). ENDIF. ELSE. ro_html->add( '<td></td><td></td>' ). ENDIF. END-OF-DEFINITION. DATA: ls_merge TYPE zif_abapgit_definitions=>ty_merge, lt_files LIKE ls_merge-stree, ls_result LIKE LINE OF ls_merge-result. FIELD-SYMBOLS: <ls_show> LIKE LINE OF lt_files, <ls_file> LIKE LINE OF lt_files. ls_merge = mo_merge->get_result( ). "If now exists no conflicts anymore, conflicts button should disappear ms_control-page_menu = build_menu( mo_merge->has_conflicts( ) ). CREATE OBJECT ro_html. ro_html->add( '<div id="toc">' ). ro_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top( io_repo = mo_repo iv_show_package = abap_false iv_show_branch = abap_false ) ). ro_html->add( '<table>' ). ro_html->add( '<tr>' ). ro_html->add( '<td>Source</td>' ). ro_html->add( '<td>' ). ro_html->add( ls_merge-source-name ). ro_html->add( '</td></tr>' ). ro_html->add( '<tr>' ). ro_html->add( '<td>Target</td>' ). ro_html->add( '<td>' ). ro_html->add( ls_merge-target-name ). ro_html->add( '</td></tr>' ). ro_html->add( '<tr>' ). ro_html->add( '<td>Ancestor</td>' ). ro_html->add( '<td>' ). ro_html->add( ls_merge-common-commit ). ro_html->add( '</td></tr>' ). ro_html->add( '</table>' ). ro_html->add( '<br>' ). APPEND LINES OF ls_merge-stree TO lt_files. APPEND LINES OF ls_merge-ttree TO lt_files. APPEND LINES OF ls_merge-ctree TO lt_files. SORT lt_files BY path DESCENDING name ASCENDING. DELETE ADJACENT DUPLICATES FROM lt_files COMPARING path name. ro_html->add( '<table>' ). ro_html->add( '<tr>' ). ro_html->add( '<td><u>Source</u></td>' ). ro_html->add( '<td></td>' ). ro_html->add( '<td><u>Target</u></td>' ). ro_html->add( '<td></td>' ). ro_html->add( '<td><u>Ancestor</u></td>' ). ro_html->add( '<td></td>' ). ro_html->add( '<td><u>Result</u></td>' ). ro_html->add( '<td></td>' ). ro_html->add( '</tr>' ). LOOP AT lt_files ASSIGNING <ls_file>. CLEAR ls_result. READ TABLE ls_merge-result INTO ls_result WITH KEY path = <ls_file>-path name = <ls_file>-name. ro_html->add( '<tr>' ). _show_file ls_merge-stree. _show_file ls_merge-ttree. _show_file ls_merge-ctree. _show_file ls_merge-result. ro_html->add( '</tr>' ). ENDLOOP. ro_html->add( '</table>' ). ro_html->add( '<br>' ). ro_html->add( '<b>' ). ro_html->add( ls_merge-conflict ). ro_html->add( '</b>' ). ro_html->add( '</div>' ). ENDMETHOD. METHOD zif_abapgit_gui_event_handler~on_event. CASE iv_action. WHEN c_actions-merge. IF mo_merge->has_conflicts( ) = abap_true. zcx_abapgit_exception=>raise( 'conflicts exists' ). ENDIF. IF mo_merge->get_result( )-stage->count( ) = 0. zcx_abapgit_exception=>raise( 'nothing to merge' ). ENDIF. IF mo_repo->get_local_settings( )-code_inspector_check_variant IS NOT INITIAL. CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_code_insp EXPORTING io_repo = mo_repo io_stage = mo_merge->get_result( )-stage. ELSE. CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_commit EXPORTING io_repo = mo_repo io_stage = mo_merge->get_result( )-stage. ENDIF. ev_state = zcl_abapgit_gui=>c_event_state-new_page. WHEN c_actions-res_conflicts. CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_merge_res EXPORTING io_repo = mo_repo io_merge_page = me io_merge = mo_merge. ev_state = zcl_abapgit_gui=>c_event_state-new_page. WHEN OTHERS. super->zif_abapgit_gui_event_handler~on_event( EXPORTING iv_action = iv_action iv_prev_page = iv_prev_page iv_getdata = iv_getdata it_postdata = it_postdata IMPORTING ei_page = ei_page ev_state = ev_state ). ENDCASE. ENDMETHOD. METHOD zif_abapgit_gui_page_hotkey~get_hotkey_actions. ENDMETHOD. ENDCLASS.
27.868644
94
0.609396
1296f6929dd5306807cb2804f892d8362c46c16f
4,164
abap
ABAP
src/sql/zcl_dbbr_sql_query_exec.clas.abap
reichr-dev/abap-db-browser
d513d49692f1f0ee613c8eab2c99e325ef5b78fe
[ "MIT" ]
null
null
null
src/sql/zcl_dbbr_sql_query_exec.clas.abap
reichr-dev/abap-db-browser
d513d49692f1f0ee613c8eab2c99e325ef5b78fe
[ "MIT" ]
null
null
null
src/sql/zcl_dbbr_sql_query_exec.clas.abap
reichr-dev/abap-db-browser
d513d49692f1f0ee613c8eab2c99e325ef5b78fe
[ "MIT" ]
null
null
null
CLASS zcl_dbbr_sql_query_exec DEFINITION PUBLIC FINAL CREATE PUBLIC. PUBLIC SECTION. CLASS-EVENTS: "! <p class="shorttext synchronized" lang="en">Is called after asynchronous query finishes</p> query_finished EXPORTING VALUE(et_data_info) TYPE zdbbr_dp_col_metadata_t VALUE(ev_execution_time) TYPE string VALUE(ev_message) TYPE string VALUE(ev_message_type) TYPE sy-msgty VALUE(ev_line_count) TYPE zdbbr_no_of_lines VALUE(er_data) TYPE REF TO data. CLASS-METHODS: "! <p class="shorttext synchronized" lang="en">Execute the entered query and display the results</p> execute_query IMPORTING io_query TYPE REF TO zcl_dbbr_sql_query iv_row_count TYPE i DEFAULT 100 if_count_only TYPE abap_bool OPTIONAL EXPORTING et_data_info TYPE zdbbr_dp_col_metadata_t ev_execution_time TYPE string ev_message TYPE string ev_message_type TYPE sy-msgty ev_line_count TYPE zdbbr_no_of_lines er_data TYPE REF TO data, "! <p class="shorttext synchronized" lang="en">Execute the entered query asynchronoulsy</p> execute_query_async IMPORTING io_query TYPE REF TO zcl_dbbr_sql_query iv_row_count TYPE i DEFAULT 100 if_count_only TYPE abap_bool OPTIONAL, "! <p class="shorttext synchronized" lang="en">Retrieves single column value from result</p> get_single_value_from_result IMPORTING it_result_info TYPE zdbbr_dp_col_metadata_t ir_t_data TYPE REF TO data EXPORTING ev_value TYPE any. PROTECTED SECTION. CLASS-METHODS: raise_query_finished IMPORTING it_data_info TYPE zdbbr_dp_col_metadata_t iv_execution_time TYPE string iv_message TYPE string iv_message_type TYPE sy-msgty iv_line_count TYPE zdbbr_no_of_lines ir_data TYPE REF TO data. PRIVATE SECTION. ENDCLASS. CLASS zcl_dbbr_sql_query_exec IMPLEMENTATION. METHOD execute_query. DATA: lt_table TYPE STANDARD TABLE OF string, ls_check_result TYPE zdbbr_dp_check_result. DATA(lo_executor) = NEW lcl_query_executor( io_query = io_query iv_row_count = iv_row_count if_count_only = if_count_only ). lo_executor->execute_query( IMPORTING et_data_info = et_data_info ev_message = ev_message ev_message_type = ev_message_type ev_execution_time = ev_execution_time ev_line_count = ev_line_count er_data = er_data ). ENDMETHOD. METHOD execute_query_async. DATA(lo_executor) = NEW lcl_query_async_executor( io_query = io_query iv_row_count = iv_row_count if_count_only = if_count_only ). lo_executor->execute_query( ). ENDMETHOD. METHOD get_single_value_from_result. FIELD-SYMBOLS: <lt_result> TYPE table, <la_result_line> TYPE any. ASSIGN ir_t_data->* TO <lt_result>. IF sy-subrc <> 0 OR lines( <lt_result> ) > 1. RETURN. ENDIF. ASSIGN <lt_result>[ 1 ] TO <la_result_line>. IF sy-subrc <> 0. RETURN. ENDIF. DESCRIBE FIELD <la_result_line> TYPE DATA(lv_line_type) COMPONENTS DATA(lv_comp_count). IF lv_line_type = 'u' AND lv_comp_count = 1. ASSIGN COMPONENT 1 OF STRUCTURE <la_result_line> TO FIELD-SYMBOL(<lv_value>). TRY. ev_value = CONV #( <lv_value> ). CATCH cx_conversion_failed. ENDTRY. ELSEIF lv_line_type NA 'vh'. ev_value = CONV #( <la_result_line> ). ENDIF. ENDMETHOD. METHOD raise_query_finished. RAISE EVENT query_finished EXPORTING et_data_info = it_data_info ev_execution_time = iv_execution_time ev_message = iv_message ev_message_type = iv_message_type ev_line_count = iv_line_count er_data = ir_data. ENDMETHOD. ENDCLASS.
31.78626
106
0.647454
129d0893e3bd89f43455fcf0cffc7b9c94b6b27d
4,270
abap
ABAP
src/zcl_abapgit_environment.clas.abap
Manny27nyc/abapGit
dc51247e9b8c0c792193aba857ec31df3a82db4a
[ "MIT" ]
317
2020-09-25T19:50:59.000Z
2022-03-29T22:59:01.000Z
src/zcl_abapgit_environment.clas.abap
Manny27nyc/abapGit
dc51247e9b8c0c792193aba857ec31df3a82db4a
[ "MIT" ]
1,114
2020-09-24T07:44:36.000Z
2022-03-31T18:01:19.000Z
src/zcl_abapgit_environment.clas.abap
wangdongcheng/abapGit
7cf4e4b5fe718cb95d12d0a439aa9f2cfb128eab
[ "MIT" ]
167
2020-09-24T18:31:37.000Z
2022-03-24T10:07:04.000Z
CLASS zcl_abapgit_environment DEFINITION PUBLIC FINAL CREATE PRIVATE GLOBAL FRIENDS zcl_abapgit_factory . PUBLIC SECTION. INTERFACES zif_abapgit_environment . PROTECTED SECTION. PRIVATE SECTION. DATA mv_cloud TYPE abap_bool VALUE abap_undefined ##NO_TEXT. DATA mv_is_merged TYPE abap_bool VALUE abap_undefined ##NO_TEXT. DATA mv_modifiable TYPE abap_bool VALUE abap_undefined ##NO_TEXT. METHODS is_system_changes_allowed RETURNING VALUE(rv_result) TYPE abap_bool . ENDCLASS. CLASS zcl_abapgit_environment IMPLEMENTATION. METHOD is_system_changes_allowed. DATA: lv_systemedit TYPE tadir-edtflag, lv_sys_cliinddep_edit TYPE t000-ccnocliind, lv_is_shadow TYPE abap_bool, ls_upginfo TYPE uvers, lv_is_upgrade TYPE abap_bool. CALL FUNCTION 'TR_SYS_PARAMS' IMPORTING systemedit = lv_systemedit sys_cliinddep_edit = lv_sys_cliinddep_edit EXCEPTIONS no_systemname = 1 no_systemtype = 2 OTHERS = 3. IF sy-subrc <> 0. " Assume system can't be changed RETURN. ENDIF. CALL FUNCTION 'UPG_IS_SHADOW_SYSTEM' IMPORTING ev_shadow = lv_is_shadow. CALL FUNCTION 'UPG_GET_ACTIVE_COMP_UPGRADE' EXPORTING iv_component = 'SAP_BASIS' iv_upgtype = 'A' iv_buffered = abap_false IMPORTING ev_upginfo = ls_upginfo EXCEPTIONS OTHERS = 4. IF sy-subrc = 0 AND ls_upginfo-putstatus NA 'ITU'. lv_is_upgrade = abap_true. ENDIF. " SAP system has status 'not modifiable' (TK 102) " Changes to repository objects are not permitted in this client (TK 729) " Shadow system " Running upgrade rv_result = boolc( lv_systemedit <> 'N' AND lv_sys_cliinddep_edit NA '23' AND lv_is_shadow <> abap_true AND lv_is_upgrade <> abap_true ). ENDMETHOD. METHOD zif_abapgit_environment~compare_with_inactive. rv_result = zif_abapgit_environment~is_sap_cloud_platform( ). ENDMETHOD. METHOD zif_abapgit_environment~get_basis_release. SELECT SINGLE release extrelease FROM cvers INTO (rs_result-release, rs_result-sp) WHERE component = 'SAP_BASIS' ##SUBRC_OK. ENDMETHOD. METHOD zif_abapgit_environment~is_merged. DATA lr_marker TYPE REF TO data ##NEEDED. IF mv_is_merged = abap_undefined. TRY. CREATE DATA lr_marker TYPE REF TO ('LIF_ABAPMERGE_MARKER'). "No exception --> marker found mv_is_merged = abap_true. CATCH cx_sy_create_data_error. mv_is_merged = abap_false. ENDTRY. ENDIF. rv_result = mv_is_merged. ENDMETHOD. METHOD zif_abapgit_environment~is_repo_object_changes_allowed. IF mv_modifiable = abap_undefined. mv_modifiable = is_system_changes_allowed( ). ENDIF. rv_result = mv_modifiable. ENDMETHOD. METHOD zif_abapgit_environment~is_restart_required. " This method will be used in the context of SAP Cloud Platform: " Pull/Push operations are executed in background jobs. " In case of the respective application server needs to be restarted, " it is required to terminae the background job and reschedule again. rv_result = abap_false. TRY. CALL METHOD ('CL_APJ_SCP_TOOLS')=>('IS_RESTART_REQUIRED') RECEIVING restart_required = rv_result. CATCH cx_sy_dyn_call_illegal_method cx_sy_dyn_call_illegal_class. rv_result = abap_false. ENDTRY. ENDMETHOD. METHOD zif_abapgit_environment~is_sap_cloud_platform. IF mv_cloud = abap_undefined. TRY. CALL METHOD ('CL_COS_UTILITIES')=>('IS_SAP_CLOUD_PLATFORM') RECEIVING rv_is_sap_cloud_platform = mv_cloud. CATCH cx_sy_dyn_call_illegal_method. mv_cloud = abap_false. ENDTRY. ENDIF. rv_result = mv_cloud. ENDMETHOD. METHOD zif_abapgit_environment~is_sap_object_allowed. rv_allowed = cl_enh_badi_def_utility=>is_sap_system( ). IF rv_allowed = abap_true. RETURN. ENDIF. rv_allowed = zcl_abapgit_exit=>get_instance( )->allow_sap_objects( ). ENDMETHOD. ENDCLASS.
27.025316
86
0.687354
129d742ed18bd6f5b682dca39f89ec84475c12b6
196
abap
ABAP
zcl_bug_reset_local.clas.abap
marcfbe/TEST_RESET_LOCAL
592b7bcbc24cc223203c67e15dd99312d1d37fe4
[ "MIT" ]
null
null
null
zcl_bug_reset_local.clas.abap
marcfbe/TEST_RESET_LOCAL
592b7bcbc24cc223203c67e15dd99312d1d37fe4
[ "MIT" ]
null
null
null
zcl_bug_reset_local.clas.abap
marcfbe/TEST_RESET_LOCAL
592b7bcbc24cc223203c67e15dd99312d1d37fe4
[ "MIT" ]
null
null
null
CLASS zcl_bug_reset_local DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS zcl_bug_reset_local IMPLEMENTATION. ENDCLASS.
13.066667
41
0.785714
129df0e6e4a7f1526aecb8c71cbd15981529550d
8,132
abap
ABAP
src/zcl_abapgit_tadir.clas.abap
ravishankarojha/abapGit
4bc4b63e0fcf5389457db5a36de643fe75977c2a
[ "MIT" ]
1
2019-09-11T20:57:34.000Z
2019-09-11T20:57:34.000Z
src/zcl_abapgit_tadir.clas.abap
ravishankarojha/abapGit
4bc4b63e0fcf5389457db5a36de643fe75977c2a
[ "MIT" ]
null
null
null
src/zcl_abapgit_tadir.clas.abap
ravishankarojha/abapGit
4bc4b63e0fcf5389457db5a36de643fe75977c2a
[ "MIT" ]
null
null
null
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 exists IMPORTING !is_item TYPE zif_abapgit_definitions=>ty_item RETURNING VALUE(rv_exists) TYPE abap_bool . 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 !iv_top 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 !io_log TYPE REF TO zcl_abapgit_log OPTIONAL RETURNING VALUE(rt_tadir) TYPE zif_abapgit_definitions=>ty_tadir_tt RAISING zcx_abapgit_exception . ENDCLASS. CLASS ZCL_ABAPGIT_TADIR IMPLEMENTATION. METHOD build. DATA: lv_path TYPE string, lo_skip_objects TYPE REF TO zcl_abapgit_skip_objects, lt_excludes TYPE RANGE OF trobjtype, lt_srcsystem TYPE RANGE OF tadir-srcsystem, ls_srcsystem LIKE LINE OF lt_srcsystem, ls_exclude LIKE LINE OF lt_excludes, lo_folder_logic TYPE REF TO zcl_abapgit_folder_logic, lv_last_package TYPE devclass VALUE cl_abap_char_utilities=>horizontal_tab, lt_packages TYPE zif_abapgit_sap_package=>ty_devclass_tt. FIELD-SYMBOLS: <ls_tadir> LIKE LINE OF rt_tadir, <lv_package> LIKE LINE OF lt_packages. "Determine Packages to Read IF iv_ignore_subpackages = abap_false. lt_packages = zcl_abapgit_factory=>get_sap_package( iv_package )->list_subpackages( ). ENDIF. INSERT iv_package INTO lt_packages INDEX 1. ls_exclude-sign = 'I'. ls_exclude-option = 'EQ'. ls_exclude-low = 'SOTR'. APPEND ls_exclude TO lt_excludes. ls_exclude-low = 'SFB1'. APPEND ls_exclude TO lt_excludes. ls_exclude-low = 'SFB2'. APPEND ls_exclude TO lt_excludes. ls_exclude-low = 'STOB'. " auto generated by core data services APPEND ls_exclude TO lt_excludes. 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 lt_packages IS NOT INITIAL. SELECT * FROM tadir INTO CORRESPONDING FIELDS OF TABLE rt_tadir FOR ALL ENTRIES IN lt_packages WHERE devclass = lt_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 rt_tadir BY devclass pgmid object obj_name. CREATE OBJECT lo_skip_objects. rt_tadir = lo_skip_objects->skip_sadl_generated_objects( it_tadir = rt_tadir io_log = io_log ). LOOP AT lt_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 rt_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. LOOP AT rt_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. "Reuse given Folder Logic Instance IF lo_folder_logic IS NOT BOUND. "Get Folder Logic Instance lo_folder_logic = zcl_abapgit_folder_logic=>get_instance( ). ENDIF. lv_path = lo_folder_logic->package_to_path( iv_top = iv_top io_dot = io_dot iv_package = <ls_tadir>-devclass ). ENDIF. ENDIF. <ls_tadir>-path = lv_path. 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. ENDLOOP. 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 exists( ls_item ) = abap_true. APPEND <ls_tadir> TO rt_tadir. ENDIF. ENDLOOP. ENDMETHOD. METHOD exists. IF is_item IS INITIAL. RETURN. ENDIF. IF zcl_abapgit_objects=>is_supported( is_item ) = abap_false. rv_exists = abap_true. RETURN. ENDIF. rv_exists = zcl_abapgit_objects=>exists( is_item ). 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 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 iv_top = iv_package io_dot = io_dot iv_ignore_subpackages = iv_ignore_subpackages iv_only_local_objects = iv_only_local_objects io_log = io_log ). li_exit = zcl_abapgit_exit=>get_instance( ). li_exit->change_tadir( EXPORTING iv_package = iv_package io_log = io_log CHANGING ct_tadir = rt_tadir ). rt_tadir = check_exists( rt_tadir ). ENDMETHOD. METHOD zif_abapgit_tadir~read_single. IF iv_object = 'SICF'. TRY. CALL METHOD ('ZCL_ABAPGIT_OBJECT_SICF')=>read_tadir EXPORTING iv_pgmid = iv_pgmid iv_obj_name = iv_obj_name RECEIVING rs_tadir = rs_tadir. CATCH cx_sy_dyn_call_illegal_method ##NO_HANDLER. * SICF might not be supported in some systems, assume this code is not called ENDTRY. ELSE. 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 ENDIF. ENDMETHOD. ENDCLASS.
29.678832
93
0.640802
129fe0a1d494d54ee299e12c80c5da8ed0b9ae75
4,874
abap
ABAP
src/objects/zcl_abapgit_object_dsys.clas.abap
g-back/abapGit
af15cbf73a6b04a95b3fc7f2eef0c4b4851c4371
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_dsys.clas.abap
g-back/abapGit
af15cbf73a6b04a95b3fc7f2eef0c4b4851c4371
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_dsys.clas.abap
g-back/abapGit
af15cbf73a6b04a95b3fc7f2eef0c4b4851c4371
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_object_dsys DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL. PUBLIC SECTION. INTERFACES zif_abapgit_object. METHODS constructor IMPORTING is_item TYPE zif_abapgit_definitions=>ty_item iv_language TYPE spras. PROTECTED SECTION. PRIVATE SECTION. CONSTANTS: c_typ TYPE dokhl-typ VALUE 'E', c_id TYPE dokhl-id VALUE 'HY'. DATA: mv_doc_object TYPE sobj_name. TYPES: BEGIN OF ty_data, doctitle TYPE dsyst-doktitle, head TYPE thead, lines TYPE tline_tab, END OF ty_data. METHODS deserialize_dsys IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_input RAISING zcx_abapgit_exception. METHODS get_master_lang RETURNING VALUE(rv_language) TYPE spras. ENDCLASS. CLASS ZCL_ABAPGIT_OBJECT_DSYS IMPLEMENTATION. METHOD constructor. DATA: lv_prefix TYPE namespace, lv_bare_name TYPE progname. super->constructor( is_item = is_item iv_language = iv_language ). CALL FUNCTION 'RS_NAME_SPLIT_NAMESPACE' EXPORTING name_with_namespace = ms_item-obj_name IMPORTING namespace = lv_prefix name_without_namespace = lv_bare_name. mv_doc_object = |{ lv_bare_name+0(4) }{ lv_prefix }{ lv_bare_name+4(*) }|. ENDMETHOD. METHOD deserialize_dsys. DATA: ls_data TYPE ty_data, ls_docu_info TYPE dokil, lv_version TYPE dokvers, lv_doku_obj TYPE doku_obj. lv_doku_obj = mv_doc_object. io_xml->read( EXPORTING iv_name = 'DSYS' CHANGING cg_data = ls_data ). CALL FUNCTION 'DOCU_INIT' EXPORTING id = c_id langu = mv_language object = lv_doku_obj typ = c_typ IMPORTING xdokil = ls_docu_info. lv_version = ls_docu_info-version. CALL FUNCTION 'DOCU_UPDATE' EXPORTING head = ls_data-head state = 'A' typ = c_typ version = lv_version TABLES line = ls_data-lines. ENDMETHOD. METHOD get_master_lang. SELECT SINGLE langu FROM dokil INTO rv_language WHERE id = c_id AND object = mv_doc_object AND masterlang = abap_true. IF sy-subrc <> 0. rv_language = mv_language. ENDIF. ENDMETHOD. METHOD zif_abapgit_object~changed_by. rv_user = zcl_abapgit_factory=>get_longtexts( )->changed_by( iv_object_name = mv_doc_object iv_longtext_id = c_id ). ENDMETHOD. METHOD zif_abapgit_object~delete. zcl_abapgit_factory=>get_longtexts( )->delete( iv_object_name = mv_doc_object iv_longtext_id = c_id ). ENDMETHOD. METHOD zif_abapgit_object~deserialize. DATA: ls_metadata TYPE zif_abapgit_definitions=>ty_metadata. ls_metadata = io_xml->get_metadata( ). CASE ls_metadata-version. WHEN 'v1.0.0'. deserialize_dsys( io_xml ). WHEN 'v2.0.0'. zcl_abapgit_factory=>get_longtexts( )->deserialize( io_xml = io_xml iv_master_language = mv_language ). WHEN OTHERS. zcx_abapgit_exception=>raise( 'unsupported DSYS version' ). ENDCASE. tadir_insert( iv_package ). ENDMETHOD. METHOD zif_abapgit_object~exists. DATA: lv_count TYPE i. SELECT SINGLE COUNT( * ) FROM dokil INTO lv_count WHERE id = c_id AND object = mv_doc_object. "#EC CI_GENBUFF rv_bool = boolc( lv_count > 0 ). ENDMETHOD. METHOD zif_abapgit_object~get_comparator. RETURN. ENDMETHOD. METHOD zif_abapgit_object~get_deserialize_steps. APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps. ENDMETHOD. METHOD zif_abapgit_object~get_metadata. rs_metadata = get_metadata( ). rs_metadata-delete_tadir = abap_true. rs_metadata-version = 'v2.0.0'. 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_lang TYPE sy-langu. lv_lang = get_master_lang( ). CALL FUNCTION 'DSYS_EDIT' EXPORTING dokclass = mv_doc_object+0(4) dokname = mv_doc_object+4(*) doklangu = lv_lang EXCEPTIONS class_unknown = 1 object_not_found = 2 OTHERS = 3. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'error from DSYS_EDIT' ). ENDIF. ENDMETHOD. METHOD zif_abapgit_object~serialize. zcl_abapgit_factory=>get_longtexts( )->serialize( iv_object_name = mv_doc_object iv_longtext_id = c_id io_xml = io_xml ). ENDMETHOD. ENDCLASS.
21.377193
96
0.641773
12a09aff1a799c929b31b19ccdcc6365a51e6bfa
9,843
abap
ABAP
src/zwfe_tbl.fugr.viewframe_zwfe_v003.abap
irodrigob/ABAP_Workflow-Engine
c4e7249df0d7436f8ea0caba15ac71b44ebc769e
[ "Apache-2.0" ]
1
2021-12-17T06:33:10.000Z
2021-12-17T06:33:10.000Z
src/zwfe_tbl.fugr.viewframe_zwfe_v003.abap
irodrigob/ABAP_Workflow-Engine
c4e7249df0d7436f8ea0caba15ac71b44ebc769e
[ "Apache-2.0" ]
null
null
null
src/zwfe_tbl.fugr.viewframe_zwfe_v003.abap
irodrigob/ABAP_Workflow-Engine
c4e7249df0d7436f8ea0caba15ac71b44ebc769e
[ "Apache-2.0" ]
null
null
null
*---------------------------------------------------------------------* * program for: VIEWFRAME_ZWFE_V003 * generation date: 02.06.2021 at 16:50:16 * view maintenance generator version: #001407# *---------------------------------------------------------------------* FUNCTION VIEWFRAME_ZWFE_V003 . 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_ZWFE_V003' EXPORTING FCODE = READ VIEW_ACTION = VIEW_ACTION VIEW_NAME = VIEW_NAME TABLES EXCL_CUA_FUNCT = EXCL_CUA_FUNCT EXTRACT = ZWFE_V003_EXTRACT TOTAL = ZWFE_V003_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_ZWFE_V003' EXPORTING FCODE = EDIT VIEW_ACTION = MAINT_MODE VIEW_NAME = VIEW_NAME CORR_NUMBER = CORR_NUMBER IMPORTING UCOMM = FUNCTION UPDATE_REQUIRED = STATUS_ZWFE_V003-UPD_FLAG TABLES EXCL_CUA_FUNCT = EXCL_CUA_FUNCT EXTRACT = ZWFE_V003_EXTRACT TOTAL = ZWFE_V003_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_ZWFE_V003-UPD_FLAG NE SPACE. PERFORM BEENDEN. CASE SY-SUBRC. WHEN 0. CALL FUNCTION 'VIEWPROC_ZWFE_V003' EXPORTING FCODE = SAVE VIEW_ACTION = MAINT_MODE VIEW_NAME = VIEW_NAME CORR_NUMBER = CORR_NUMBER IMPORTING UPDATE_REQUIRED = STATUS_ZWFE_V003-UPD_FLAG TABLES EXCL_CUA_FUNCT = EXCL_CUA_FUNCT EXTRACT = ZWFE_V003_EXTRACT TOTAL = ZWFE_V003_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_ZWFE_V003-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_ZWFE_V003-UPD_FLAG NE SPACE. PERFORM TRANSPORTIEREN. CASE SY-SUBRC. WHEN 0. CALL FUNCTION 'VIEWPROC_ZWFE_V003' EXPORTING FCODE = SAVE VIEW_ACTION = MAINT_MODE VIEW_NAME = VIEW_NAME CORR_NUMBER = CORR_NUMBER IMPORTING UPDATE_REQUIRED = STATUS_ZWFE_V003-UPD_FLAG TABLES EXCL_CUA_FUNCT = EXCL_CUA_FUNCT EXTRACT = ZWFE_V003_EXTRACT TOTAL = ZWFE_V003_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_ZWFE_V003' EXPORTING FCODE = FUNCTION VIEW_ACTION = MAINT_MODE VIEW_NAME = VIEW_NAME CORR_NUMBER = CORR_NUMBER IMPORTING UPDATE_REQUIRED = STATUS_ZWFE_V003-UPD_FLAG TABLES EXCL_CUA_FUNCT = EXCL_CUA_FUNCT EXTRACT = ZWFE_V003_EXTRACT TOTAL = ZWFE_V003_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.
40.673554
72
0.435843
12a78f4adaac1cb5e49d08f49eec85c24d30e0ac
628
abap
ABAP
src/http/zif_abapgit_http_response.intf.abap
absap/abapGit
5468985b5760da157ee4089bbf872ed5700a74e2
[ "MIT" ]
null
null
null
src/http/zif_abapgit_http_response.intf.abap
absap/abapGit
5468985b5760da157ee4089bbf872ed5700a74e2
[ "MIT" ]
null
null
null
src/http/zif_abapgit_http_response.intf.abap
absap/abapGit
5468985b5760da157ee4089bbf872ed5700a74e2
[ "MIT" ]
null
null
null
INTERFACE zif_abapgit_http_response PUBLIC . METHODS data RETURNING VALUE(rv_data) TYPE xstring . METHODS cdata RETURNING VALUE(rv_data) TYPE string . METHODS json RETURNING VALUE(ri_json) TYPE REF TO zif_abapgit_ajson_reader RAISING zcx_abapgit_ajson_error. METHODS is_ok RETURNING VALUE(rv_yes) TYPE abap_bool . METHODS code RETURNING VALUE(rv_code) TYPE i . METHODS error RETURNING VALUE(rv_message) TYPE string . METHODS headers RETURNING VALUE(ro_headers) TYPE REF TO zcl_abapgit_string_map . METHODS close . ENDINTERFACE.
20.933333
60
0.703822
12ab14d13da513701d99cafc9bdd8c9c13782d79
2,301
abap
ABAP
src/2018/zcl_aoc2018_d1.clas.testclasses.abap
rayatus/abap-aoc
498c89f6c590a377950a91e3e113710a9aedd750
[ "MIT" ]
null
null
null
src/2018/zcl_aoc2018_d1.clas.testclasses.abap
rayatus/abap-aoc
498c89f6c590a377950a91e3e113710a9aedd750
[ "MIT" ]
null
null
null
src/2018/zcl_aoc2018_d1.clas.testclasses.abap
rayatus/abap-aoc
498c89f6c590a377950a91e3e113710a9aedd750
[ "MIT" ]
null
null
null
*"* use this source file for your ABAP unit test classes CLASS ltcl_aoc2018_d1_1_ DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS. PRIVATE SECTION. DATA: mo_cut TYPE REF TO zcl_aoc2018_d1, mo_input TYPE REF TO zcl_aoc2018_input_helper. METHODS: setup, teardown, test_1 FOR TESTING RAISING cx_static_check, test_2 FOR TESTING RAISING cx_static_check, test_3 FOR TESTING RAISING cx_static_check, test_4 FOR TESTING RAISING cx_static_check, test_5 FOR TESTING RAISING cx_static_check. ENDCLASS. CLASS ltcl_aoc2018_d1_1_ IMPLEMENTATION. METHOD setup. mo_cut = NEW zcl_aoc2018_d1( ). mo_input = NEW zcl_aoc2018_input_helper( ). ENDMETHOD. METHOD teardown. CLEAR: mo_cut, mo_input. ENDMETHOD. METHOD test_1. mo_input->add( '+1' ). mo_input->add( '-2' ). mo_input->add( '+3' ). mo_input->add( '+1' ). mo_cut->set_input( mo_input ). mo_cut->calculate_first_part( ). cl_abap_unit_assert=>assert_equals( act = mo_cut->get_first_result( ) exp = 3 ). ENDMETHOD. METHOD test_2. mo_input->add( '+1' ). mo_input->add( '+1' ). mo_input->add( '+1' ). mo_cut->set_input( mo_input ). mo_cut->calculate_first_part( ). cl_abap_unit_assert=>assert_equals( act = mo_cut->get_first_result( ) exp = 3 ). ENDMETHOD. METHOD test_3. mo_input->add( '+1' ). mo_input->add( '+1' ). mo_input->add( '-2' ). mo_cut->set_input( mo_input ). mo_cut->calculate_first_part( ). cl_abap_unit_assert=>assert_equals( act = mo_cut->get_first_result( ) exp = 0 ). ENDMETHOD. METHOD test_4. mo_input->add( '-1' ). mo_input->add( '-2' ). mo_input->add( '-3' ). mo_cut->set_input( mo_input ). mo_cut->calculate_first_part( ). cl_abap_unit_assert=>assert_equals( act = mo_cut->get_first_result( ) exp = -6 ). ENDMETHOD. METHOD test_5. mo_input->add( '+1' ). mo_input->add( '-2' ). mo_input->add( '+3' ). mo_input->add( '+1' ). mo_input->add( '+1' ). mo_input->add( '-2' ). mo_cut->set_input( mo_input ). mo_cut->calculate_second_part( ). cl_abap_unit_assert=>assert_equals( act = mo_cut->get_second_result( ) exp = 2 ). ENDMETHOD. ENDCLASS.
22.782178
86
0.641895
12ac7bd4280f8de2404f883026c7067d24c85d3b
227
abap
ABAP
src/unmanaged/#dmo#bp_booking_u16.clas.abap
SAP-Cloud-Platform/flight16
dae08b592cf288780e1f746baf184d2bed4b0b9f
[ "BSD-Source-Code" ]
null
null
null
src/unmanaged/#dmo#bp_booking_u16.clas.abap
SAP-Cloud-Platform/flight16
dae08b592cf288780e1f746baf184d2bed4b0b9f
[ "BSD-Source-Code" ]
null
null
null
src/unmanaged/#dmo#bp_booking_u16.clas.abap
SAP-Cloud-Platform/flight16
dae08b592cf288780e1f746baf184d2bed4b0b9f
[ "BSD-Source-Code" ]
null
null
null
CLASS /dmo/bp_booking_u16 DEFINITION PUBLIC ABSTRACT FINAL FOR BEHAVIOR OF /dmo/i_travel_u16 . PUBLIC SECTION. PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS /dmo/bp_booking_u16 IMPLEMENTATION. ENDCLASS.
14.1875
41
0.76652
12bd5349235f5230ceccbd120c8ed4b1e77f0ccf
1,800
abap
ABAP
src/zamp_collector/zcl_amp_c_batch_input.clas.abap
MikeSidorochkin/abap-metrics-provider
bb4b4a2c01046b3cd017f723f112dfb11781f51d
[ "MIT" ]
1
2021-12-02T15:12:49.000Z
2021-12-02T15:12:49.000Z
src/zamp_collector/zcl_amp_c_batch_input.clas.abap
MikeSidorochkin/abap-metrics-provider
bb4b4a2c01046b3cd017f723f112dfb11781f51d
[ "MIT" ]
null
null
null
src/zamp_collector/zcl_amp_c_batch_input.clas.abap
MikeSidorochkin/abap-metrics-provider
bb4b4a2c01046b3cd017f723f112dfb11781f51d
[ "MIT" ]
null
null
null
CLASS zcl_amp_c_batch_input DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES zif_amp_collector. PROTECTED SECTION. PRIVATE SECTION. TYPES: BEGIN OF batch_input, count TYPE i, groupid TYPE apq_grpn, progid TYPE apq_prog, state TYPE apq_stat, END OF batch_input. TYPES batch_inputs TYPE SORTED TABLE OF batch_input WITH UNIQUE KEY groupid progid state. METHODS map_batch_state IMPORTING state TYPE apq_stat RETURNING VALUE(type) TYPE string. ENDCLASS. CLASS zcl_amp_c_batch_input IMPLEMENTATION. METHOD zif_amp_collector~get_metrics. DATA batch_inputs TYPE batch_inputs. metrics_current_run = zcl_amp_collector_utils=>initialize_metrics( metrics_last_run = metrics_last_run ). SELECT COUNT(*) AS count, groupid AS groupid, progid AS progid, qstate AS state FROM apqi WHERE ( datatyp = 'BDC' OR datatyp = 'BDCE' OR datatyp = 'RODC' ) GROUP BY groupid, progid, qstate INTO TABLE @batch_inputs. LOOP AT batch_inputs ASSIGNING FIELD-SYMBOL(<batch>). DATA(metric) = VALUE zif_amp_collector=>metric( metric_key = |{ <batch>-groupid }_{ <batch>-progid }_{ me->map_batch_state( state = <batch>-state ) }| metric_value = <batch>-count ). COLLECT metric INTO metrics_current_run. ENDLOOP. ENDMETHOD. METHOD map_batch_state. type = SWITCH #( state WHEN 'R' THEN 'running' WHEN 'C' THEN 'creating' WHEN 'E' THEN 'error' WHEN 'F' THEN 'finished' WHEN '' THEN 'unprocessed' ELSE state ). ENDMETHOD. ENDCLASS.
26.470588
156
0.618889
12bd589ab9778dad7ebda0fa395a98ab2db65e13
1,397
abap
ABAP
src/zif_excel_sheet_protection.intf.abap
chrisaasan/abap2xlsx
cb315c557225928baacbbcfd42087c3a8ed34a12
[ "Apache-2.0" ]
251
2019-02-23T03:36:38.000Z
2021-12-10T21:39:23.000Z
src/zif_excel_sheet_protection.intf.abap
gregorwolf/abap2xlsx
5110f924b435e23f4474381d0e43f0686b9d0421
[ "Apache-2.0" ]
278
2019-02-17T10:42:59.000Z
2021-12-10T20:24:56.000Z
src/zif_excel_sheet_protection.intf.abap
gregorwolf/abap2xlsx
5110f924b435e23f4474381d0e43f0686b9d0421
[ "Apache-2.0" ]
130
2019-02-20T13:25:30.000Z
2021-12-09T03:20:31.000Z
INTERFACE zif_excel_sheet_protection PUBLIC . TYPES tv_sheet_protection TYPE c LENGTH 1. TYPES tv_sheet_protection_bool TYPE c LENGTH 1. DATA auto_filter TYPE tv_sheet_protection_bool . CONSTANTS c_active TYPE tv_sheet_protection_bool VALUE '1'. "#EC NOTEXT CONSTANTS c_noactive TYPE tv_sheet_protection_bool VALUE '0'. "#EC NOTEXT CONSTANTS c_protected TYPE tv_sheet_protection VALUE 'X'. "#EC NOTEXT CONSTANTS c_unprotected TYPE tv_sheet_protection VALUE ''. "#EC NOTEXT DATA delete_columns TYPE tv_sheet_protection_bool . DATA delete_rows TYPE tv_sheet_protection_bool . DATA format_cells TYPE tv_sheet_protection_bool . DATA format_columns TYPE tv_sheet_protection_bool . DATA format_rows TYPE tv_sheet_protection_bool . DATA insert_columns TYPE tv_sheet_protection_bool . DATA insert_hyperlinks TYPE tv_sheet_protection_bool . DATA insert_rows TYPE tv_sheet_protection_bool . DATA objects TYPE tv_sheet_protection_bool . DATA password TYPE zexcel_aes_password . DATA pivot_tables TYPE tv_sheet_protection_bool . DATA protected TYPE tv_sheet_protection . DATA scenarios TYPE tv_sheet_protection_bool . DATA select_locked_cells TYPE tv_sheet_protection_bool . DATA select_unlocked_cells TYPE tv_sheet_protection_bool . DATA sheet TYPE tv_sheet_protection_bool . DATA sort TYPE tv_sheet_protection_bool . METHODS initialize . ENDINTERFACE.
43.65625
75
0.828203
12cc3acd1c54fce1b86b4bf7a5f68f877ea32968
2,792
abap
ABAP
src/ydk_placement_editor_test.prog.abap
DKiyanov/YDK_CL_PLACEMENT
23981fc3c9c3e9c431f615e4c2d12043c3a11ced
[ "MIT" ]
null
null
null
src/ydk_placement_editor_test.prog.abap
DKiyanov/YDK_CL_PLACEMENT
23981fc3c9c3e9c431f615e4c2d12043c3a11ced
[ "MIT" ]
null
null
null
src/ydk_placement_editor_test.prog.abap
DKiyanov/YDK_CL_PLACEMENT
23981fc3c9c3e9c431f615e4c2d12043c3a11ced
[ "MIT" ]
null
null
null
*&---------------------------------------------------------------------* *& Report Z_PLACEMENT_EDITOR_TEST *& ydk_cl_placement test and demo *&---------------------------------------------------------------------* REPORT ydk_placement_editor_test. PARAMETERS: pplacvar TYPE ydk_placement_vr-variant. DATA: go_placment TYPE REF TO ydk_cl_placement. DATA: go_root TYPE REF TO cl_gui_docking_container. AT SELECTION-SCREEN ON VALUE-REQUEST FOR pplacvar. PERFORM select_variant CHANGING pplacvar. START-OF-SELECTION. IF pplacvar IS INITIAL. PERFORM select_variant CHANGING pplacvar. ENDIF. IF pplacvar IS INITIAL. MESSAGE 'Placement variant not selected' TYPE 'S' DISPLAY LIKE 'E'. STOP. ENDIF. CALL SCREEN 100. MODULE status_0100 OUTPUT. SET PF-STATUS 'MAIN'. PERFORM create_objects. ENDMODULE. " STATUS_0100 OUTPUT MODULE user_command_0100 INPUT. CASE sy-ucomm. WHEN 'BACK'. LEAVE TO SCREEN 0. WHEN 'SAVE'. go_placment->save_sizes( ). ENDCASE. ENDMODULE. " USER_COMMAND_0100 INPUT FORM create_objects. CHECK go_root IS INITIAL. CREATE OBJECT go_root EXPORTING side = cl_gui_docking_container=>dock_at_bottom extension = cl_gui_docking_container=>ws_maximizebox. CREATE OBJECT go_placment. CALL METHOD go_placment->load_placement EXPORTING root = go_root variant = pplacvar. LOOP AT go_placment->itcont ASSIGNING FIELD-SYMBOL(<cont>). CASE <cont>-cname. WHEN 'AR1'. PERFORM create_object USING <cont>-container 'First object'. WHEN 'AR2'. PERFORM create_object USING <cont>-container 'Second object'. WHEN 'AR3'. PERFORM create_object USING <cont>-container 'Third object'. ENDCASE. ENDLOOP. ENDFORM. FORM create_object USING container text. DATA: lo_textedit TYPE REF TO cl_gui_textedit. CREATE OBJECT lo_textedit EXPORTING parent = container EXCEPTIONS OTHERS = 1. lo_textedit->set_textstream( text = text ). ENDFORM. FORM select_variant CHANGING variant TYPE ydk_placement_vr-variant. DATA: lt_areas TYPE sdydo_option_tab. lt_areas = VALUE #( ( value = 'AR1' text = 'First container' ) ( value = 'AR2' text = 'Second container' ) ( value = 'AR3' text = 'Third container' ) ). CALL METHOD ydk_cl_placement=>variants_dialog EXPORTING areas_tab = lt_areas left = 5 top = 3 can_select = abap_true can_create = abap_true can_edit = abap_true can_delete = abap_true can_set_default_var = abap_true RECEIVING variant = variant EXCEPTIONS cancel = 1 OTHERS = 2. ENDFORM.
26.846154
79
0.633954
12cc4490762fe24f0066468b29e160a5360cb498
5,744
abap
ABAP
kapitel_03/zcl_book_docu.clas.abap
abapkochbuch/Sources
159775b787fcbc4c6b7eff01e505144b7c33a437
[ "MIT" ]
12
2018-06-22T10:55:06.000Z
2022-03-22T12:10:48.000Z
kapitel_03/zcl_book_docu.clas.abap
abapkochbuch/Sources
159775b787fcbc4c6b7eff01e505144b7c33a437
[ "MIT" ]
5
2018-06-25T11:45:26.000Z
2019-09-04T19:41:55.000Z
kapitel_03/zcl_book_docu.clas.abap
abapkochbuch/Sources
159775b787fcbc4c6b7eff01e505144b7c33a437
[ "MIT" ]
7
2018-07-02T14:20:28.000Z
2022-03-25T19:33:33.000Z
class ZCL_BOOK_DOCU definition public final create public . *"* public components of class ZCL_BOOK_DOCU *"* do not include other source files here!!! public section. class-methods DISPLAY importing !ID type DOKU_ID !OBJECT type C !SIDE type I default CL_GUI_DOCKING_CONTAINER=>DOCK_AT_RIGHT !AUTODEF type C optional !CONTAINER type ref to CL_GUI_CONTAINER optional . class-methods DISPLAY2 importing !ID type DOKU_ID !OBJECT type C !SIDE type I default CL_GUI_DOCKING_CONTAINER=>DOCK_AT_RIGHT !AUTODEF type C optional !CONTAINER type ref to CL_GUI_CONTAINER optional . protected section. *"* protected components of class ZCL_BOOK_DOCU *"* do not include other source files here!!! private section. *"* private components of class ZCL_BOOK_DOCU *"* do not include other source files here!!! ENDCLASS. CLASS ZCL_BOOK_DOCU IMPLEMENTATION. METHOD display. DATA lt_lines TYPE STANDARD TABLE OF tline. DATA ls_header TYPE thead. DATA lt_html TYPE STANDARD TABLE OF htmlline. DATA lv_url TYPE c LENGTH 500. DATA lv_spras TYPE sylangu. STATICS sv_object TYPE doku_obj. STATICS sr_dock TYPE REF TO cl_gui_docking_container. STATICS sr_container TYPE REF TO cl_gui_container. STATICS sr_html TYPE REF TO cl_gui_html_viewer. CHECK sv_object <> object. sv_object = object. *== Dokumentation lesen CALL FUNCTION 'DOCU_GET' EXPORTING id = id langu = sy-langu object = sv_object IMPORTING head = ls_header TABLES line = lt_lines EXCEPTIONS OTHERS = 5. IF sr_dock IS INITIAL. *== Docking-Container erzeugen CREATE OBJECT sr_dock EXPORTING Side = side extension = 400 no_autodef_progid_dynnr = 'X'. ENDIF. IF lt_lines IS INITIAL. *== Keine Dokumentation vorhanden: *== Docking-Container ausblenden IF sr_html IS BOUND. sr_html->set_visible( ' ' ). ENDIF. IF sr_dock IS BOUND. sr_dock->set_visible( ' ' ). ENDIF. ELSE. *== Dokumentation ist vorhanden: *== Docking-Container einblenden IF sr_html IS BOUND. sr_html->set_visible( 'X' ). ENDIF. IF sr_dock IS BOUND. sr_dock->set_visible( 'X' ). ENDIF. ENDIF. IF lt_lines IS NOT INITIAL. IF sr_html IS INITIAL. CREATE OBJECT sr_html EXPORTING parent = sr_dock. ENDIF. CALL FUNCTION 'CONVERT_ITF_TO_HTML' EXPORTING i_header = ls_header TABLES t_itf_text = lt_lines t_html_text = lt_html EXCEPTIONS OTHERS = 4. IF sy-subrc = 0. CALL METHOD sr_html->load_data IMPORTING assigned_url = lv_url CHANGING data_table = lt_html EXCEPTIONS OTHERS = 4. IF sy-subrc = 0. sr_html->show_url( lv_url ). ENDIF. ENDIF. ENDIF. ENDMETHOD. METHOD DISPLAY2. DATA lt_lines TYPE STANDARD TABLE OF tline. DATA ls_header TYPE thead. DATA lt_html TYPE STANDARD TABLE OF htmlline. DATA lv_url TYPE c LENGTH 500. DATA lv_spras TYPE sylangu. STATICS sv_object TYPE doku_obj. STATICS sr_dock TYPE REF TO cl_gui_docking_container. STATICS sr_container TYPE REF TO cl_gui_container. STATICS sr_html TYPE REF TO cl_gui_html_viewer. DATA lv_id TYPE doku_id. DATA lv_tabclass TYPE tabclass. IF object IS INITIAL. sv_object = object. IF sr_dock IS BOUND. sr_dock->set_visible( space ). EXIT. ENDIF. ELSE. sv_object = object. ENDIF. IF id = 'Z'. SELECT SINGLE tabclass FROM dd02l INTO lv_tabclass WHERE tabname = sv_object AND as4local = 'A' AND as4vers = 0. CASE lv_tabclass. WHEN 'VIEW'. lv_id = 'TB'. SELECT SINGLE roottab FROM dd25l INTO sv_object WHERE viewname = sv_object AND as4local = 'A' AND as4vers = 0. WHEN 'TRANSP'. lv_id = 'TB'. WHEN OTHERS. EXIT. ENDCASE. ELSE. lv_id = id. ENDIF. CALL FUNCTION 'DOCU_GET' EXPORTING id = lv_id langu = sy-langu object = sv_object typ = 'E' IMPORTING head = ls_header TABLES line = lt_lines EXCEPTIONS OTHERS = 1. IF sr_dock IS INITIAL. *== Docking Container erzeugen CREATE OBJECT sr_dock EXPORTING side = side extension = 400 no_autodef_progid_dynnr = 'X'. ENDIF. *== Sichtbarkeit IF lt_lines IS INITIAL. IF sr_html IS BOUND. sr_html->set_visible( space ). ENDIF. IF sr_dock IS BOUND. sr_dock->set_visible( space ). ENDIF. ELSE. IF sr_html IS BOUND. sr_html->set_visible( 'X' ). ENDIF. IF sr_dock IS BOUND. sr_dock->set_visible( 'X' ). ENDIF. ENDIF. IF lt_lines IS NOT INITIAL. IF sr_html IS INITIAL. *== HTML-Control erzeugen CREATE OBJECT sr_html EXPORTING parent = sr_dock. ENDIF. *== Dokumentation in HTML umwandeln CALL FUNCTION 'CONVERT_ITF_TO_HTML' EXPORTING i_header = ls_header TABLES t_itf_text = lt_lines t_html_text = lt_html EXCEPTIONS OTHERS = 4. IF sy-subrc = 0. *== Dokumentation im HTML-Format ins HTML-Control laden CALL METHOD sr_html->load_data IMPORTING assigned_url = lv_url CHANGING data_table = lt_html EXCEPTIONS OTHERS = 4. IF sy-subrc = 0. *== Dokumentation anzeigen sr_html->show_url( lv_url ). ENDIF. ENDIF. ENDIF. ENDMETHOD. ENDCLASS.
24.865801
66
0.626393
12d0229e98b6ca01b4fae53198f9c86950396b77
636
abap
ABAP
src/gui/zif_uitb_gui_screen.intf.abap
stockbal/abap-ui-toolbox
93ee48975deab71aa16e3c898c9863b0c4e6ee19
[ "MIT" ]
3
2021-03-08T13:02:46.000Z
2021-11-30T20:04:44.000Z
src/gui/zif_uitb_gui_screen.intf.abap
stockbal/abap-ui-toolbox
93ee48975deab71aa16e3c898c9863b0c4e6ee19
[ "MIT" ]
1
2021-03-31T17:13:50.000Z
2021-03-31T20:05:02.000Z
src/gui/zif_uitb_gui_screen.intf.abap
stockbal/abap-ui-toolbox
93ee48975deab71aa16e3c898c9863b0c4e6ee19
[ "MIT" ]
null
null
null
"! <p class="shorttext synchronized" lang="en">GUI Screen</p> INTERFACE zif_uitb_gui_screen PUBLIC . * INTERFACES zif_uitb_gui_events. DATA mf_visible TYPE abap_bool read-only. "! <p class="shorttext synchronized" lang="en">Displays the screen</p> "! METHODS show IMPORTING iv_top TYPE i OPTIONAL iv_left TYPE i OPTIONAL iv_width TYPE i OPTIONAL iv_height TYPE i OPTIONAL. "! <p class="shorttext synchronized" lang="en">Leaves the current screen</p> "! METHODS leave_screen DEFAULT IGNORE IMPORTING !if_prevent_exit_event TYPE abap_bool DEFAULT abap_true . ENDINTERFACE.
26.5
78
0.712264
12d221f95a3a95cd24a71c92b14205452bf9f500
4,258
abap
ABAP
src/objects/zcl_abapgit_longtexts.clas.abap
sharifgool/abapGit
f02ae98504a988802e6a1f8438a97f05f14f81e5
[ "MIT" ]
1
2019-11-29T05:30:57.000Z
2019-11-29T05:30:57.000Z
src/objects/zcl_abapgit_longtexts.clas.abap
saurabh-bcone/abapGit
0b5b1b60df883d5291c060c349810127e52bcac1
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_longtexts.clas.abap
saurabh-bcone/abapGit
0b5b1b60df883d5291c060c349810127e52bcac1
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_longtexts DEFINITION PUBLIC FINAL CREATE PUBLIC. PUBLIC SECTION. CLASS-METHODS: serialize IMPORTING iv_object_name TYPE sobj_name iv_longtext_id TYPE dokil-id it_dokil TYPE zif_abapgit_definitions=>tty_dokil io_xml TYPE REF TO zcl_abapgit_xml_output RAISING zcx_abapgit_exception, deserialize IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_input iv_master_language TYPE langu RAISING zcx_abapgit_exception, delete IMPORTING iv_object_name TYPE sobj_name iv_longtext_id TYPE dokil-id RAISING zcx_abapgit_exception. PRIVATE SECTION. TYPES: BEGIN OF ty_longtext, dokil TYPE dokil, head TYPE thead, lines TYPE tline_tab, END OF ty_longtext, tty_longtexts TYPE STANDARD TABLE OF ty_longtext WITH NON-UNIQUE DEFAULT KEY. CONSTANTS: c_longtexts_name TYPE string VALUE 'LONGTEXTS' ##NO_TEXT, c_docu_state_active TYPE dokstate VALUE 'A' ##NO_TEXT. ENDCLASS. CLASS ZCL_ABAPGIT_LONGTEXTS IMPLEMENTATION. METHOD delete. DATA: lt_dokil TYPE zif_abapgit_definitions=>tty_dokil. FIELD-SYMBOLS: <ls_dokil> TYPE dokil. SELECT * FROM dokil INTO TABLE lt_dokil WHERE id = iv_longtext_id AND object = iv_longtext_id. LOOP AT lt_dokil ASSIGNING <ls_dokil>. CALL FUNCTION 'DOCU_DEL' EXPORTING id = <ls_dokil>-id langu = <ls_dokil>-langu object = <ls_dokil>-object typ = <ls_dokil>-typ EXCEPTIONS ret_code = 1 OTHERS = 2. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDLOOP. ENDMETHOD. METHOD deserialize. DATA: lt_longtexts TYPE tty_longtexts, lv_no_masterlang TYPE dokil-masterlang. FIELD-SYMBOLS: <ls_longtext> TYPE ty_longtext. io_xml->read( EXPORTING iv_name = c_longtexts_name CHANGING cg_data = lt_longtexts ). LOOP AT lt_longtexts ASSIGNING <ls_longtext>. lv_no_masterlang = boolc( iv_master_language <> <ls_longtext>-dokil-langu ). CALL FUNCTION 'DOCU_UPDATE' EXPORTING head = <ls_longtext>-head state = c_docu_state_active typ = <ls_longtext>-dokil-typ version = <ls_longtext>-dokil-version no_masterlang = lv_no_masterlang TABLES line = <ls_longtext>-lines. ENDLOOP. ENDMETHOD. METHOD serialize. DATA: ls_longtext TYPE ty_longtext, lt_longtexts TYPE tty_longtexts, lt_dokil TYPE zif_abapgit_definitions=>tty_dokil. FIELD-SYMBOLS: <ls_dokil> LIKE LINE OF lt_dokil. IF lines( it_dokil ) > 0. lt_dokil = it_dokil. ELSEIF iv_longtext_id IS NOT INITIAL. SELECT * FROM dokil INTO TABLE lt_dokil WHERE id = iv_longtext_id AND object = iv_object_name. ELSE. zcx_abapgit_exception=>raise( |serialize_longtexts parameter error| ). ENDIF. LOOP AT lt_dokil ASSIGNING <ls_dokil> WHERE txtlines > 0. CLEAR: ls_longtext. ls_longtext-dokil = <ls_dokil>. CALL FUNCTION 'DOCU_READ' EXPORTING id = <ls_dokil>-id langu = <ls_dokil>-langu object = <ls_dokil>-object typ = <ls_dokil>-typ version = <ls_dokil>-version IMPORTING head = ls_longtext-head TABLES line = ls_longtext-lines. CLEAR: ls_longtext-head-tdfuser, ls_longtext-head-tdfreles, ls_longtext-head-tdfdate, ls_longtext-head-tdftime, ls_longtext-head-tdluser, ls_longtext-head-tdlreles, ls_longtext-head-tdldate, ls_longtext-head-tdltime. INSERT ls_longtext INTO TABLE lt_longtexts. ENDLOOP. io_xml->add( iv_name = c_longtexts_name ig_data = lt_longtexts ). ENDMETHOD. ENDCLASS.
24.193182
82
0.601456
12d255f0bc760bc04bf3b3318897bedf605a3287
551
abap
ABAP
src/formula/zcl_dbbr_fe_icon_tt_fld_extr.clas.abap
reichr-dev/abap-db-browser
d513d49692f1f0ee613c8eab2c99e325ef5b78fe
[ "MIT" ]
15
2020-02-05T10:38:12.000Z
2022-02-11T18:06:17.000Z
src/formula/zcl_dbbr_fe_icon_tt_fld_extr.clas.abap
reichr-dev/abap-db-browser
d513d49692f1f0ee613c8eab2c99e325ef5b78fe
[ "MIT" ]
10
2021-01-19T07:45:37.000Z
2021-07-15T19:08:54.000Z
src/formula/zcl_dbbr_fe_icon_tt_fld_extr.clas.abap
reichr-dev/abap-db-browser
d513d49692f1f0ee613c8eab2c99e325ef5b78fe
[ "MIT" ]
9
2020-04-08T19:13:18.000Z
2021-10-02T12:53:39.000Z
class ZCL_DBBR_FE_ICON_TT_FLD_EXTR definition public create public . public section. interfaces ZIF_DBBR_FE_FIELD_EXTRACTOR . protected section. private section. ENDCLASS. CLASS ZCL_DBBR_FE_ICON_TT_FLD_EXTR IMPLEMENTATION. method ZIF_DBBR_FE_FIELD_EXTRACTOR~EXTRACT_FIELD. ASSIGN is_statement-tokens TO FIELD-SYMBOL(<lt_tokens>). rs_field = VALUE ZIF_DBBR_fe_types=>ty_form_field( field = <lt_tokens>[ 2 ]-str type_name = zif_dbbr_c_fe_global=>c_icon_tt_type ). endmethod. ENDCLASS.
19.678571
64
0.742287
12d357f2436868e69d68a896348a4f11f7fad725
129
abap
ABAP
zaim_dummy_remote.fugr.lzaim_dummy_remotetop.abap
mrsimpson/aim
ae8a7763839c8a1d1ed7d57fdb187f5c4ce4b3bc
[ "MIT" ]
null
null
null
zaim_dummy_remote.fugr.lzaim_dummy_remotetop.abap
mrsimpson/aim
ae8a7763839c8a1d1ed7d57fdb187f5c4ce4b3bc
[ "MIT" ]
null
null
null
zaim_dummy_remote.fugr.lzaim_dummy_remotetop.abap
mrsimpson/aim
ae8a7763839c8a1d1ed7d57fdb187f5c4ce4b3bc
[ "MIT" ]
null
null
null
FUNCTION-POOL ZAIM_DUMMY_REMOTE. "MESSAGE-ID .. * INCLUDE LZAIM_DUMMY_REMOTED... " Local class definition
43
69
0.651163
12d5e020fd38434b61c625a01da563cc43210116
6,207
abap
ABAP
src/checks/y_check_comment_usage.clas.abap
steve192/code-pal-for-abap
5f701f5239036cbb724756a86e805fdbae377ab7
[ "Apache-2.0" ]
null
null
null
src/checks/y_check_comment_usage.clas.abap
steve192/code-pal-for-abap
5f701f5239036cbb724756a86e805fdbae377ab7
[ "Apache-2.0" ]
1
2022-02-27T18:48:26.000Z
2022-02-27T18:48:26.000Z
src/checks/y_check_comment_usage.clas.abap
steve192/code-pal-for-abap
5f701f5239036cbb724756a86e805fdbae377ab7
[ "Apache-2.0" ]
null
null
null
CLASS y_check_comment_usage DEFINITION PUBLIC INHERITING FROM y_check_base CREATE PUBLIC. PUBLIC SECTION. METHODS constructor. PROTECTED SECTION. METHODS execute_check REDEFINITION. METHODS inspect_statements REDEFINITION. METHODS inspect_tokens REDEFINITION. PRIVATE SECTION. DATA abs_statement_number TYPE i VALUE 0. DATA comment_number TYPE i VALUE 0. DATA is_function_module TYPE abap_bool. METHODS get_percentage_of_comments RETURNING VALUE(result) TYPE int4. METHODS check_result IMPORTING structure TYPE sstruc. METHODS is_code_disabled IMPORTING structure TYPE sstruc statement TYPE sstmnt RETURNING VALUE(result) TYPE abap_bool. METHODS is_comment_excluded IMPORTING token TYPE string RETURNING VALUE(result) TYPE abap_bool. METHODS has_token_started_with IMPORTING token TYPE string start_with TYPE string RETURNING VALUE(result) TYPE abap_bool RAISING cx_sy_range_out_of_bounds. METHODS is_badi_example_class RETURNING VALUE(result) TYPE abap_bool. ENDCLASS. CLASS y_check_comment_usage IMPLEMENTATION. METHOD constructor. super->constructor( ). settings-threshold = 10. settings-documentation = |{ c_docs_path-checks }comment-usage.md|. settings-ignore_pseudo_comments = abap_true. relevant_statement_types = VALUE #( ( scan_struc_stmnt_type-class_definition ) ( scan_struc_stmnt_type-class_implementation ) ( scan_struc_stmnt_type-interface ) ( scan_struc_stmnt_type-form ) ( scan_struc_stmnt_type-function ) ( scan_struc_stmnt_type-module ) ). set_check_message( 'Percentage of comments must be lower than &3% of the productive code! (&2%>=&3%) (&1 lines found)' ). ENDMETHOD. METHOD execute_check. CHECK is_badi_example_class( ) = abap_false. super->execute_check( ). ENDMETHOD. METHOD inspect_statements. abs_statement_number = 0. comment_number = 0. super->inspect_statements( structure ). check_result( structure ). ENDMETHOD. METHOD inspect_tokens. DATA(code_disabled) = is_code_disabled( statement = statement structure = structure ). IF code_disabled = abap_true. RETURN. ENDIF. IF statement-to = statement-from. abs_statement_number = abs_statement_number + 1. ELSE. abs_statement_number = abs_statement_number + ( statement-to - statement-from ). ENDIF. LOOP AT ref_scan->tokens ASSIGNING FIELD-SYMBOL(<token>) FROM statement-from TO statement-to WHERE type = scan_token_type-comment. IF is_comment_excluded( <token>-str ) = abap_false. comment_number = comment_number + 1. ENDIF. ENDLOOP. ENDMETHOD. METHOD is_comment_excluded. TRY. IF has_token_started_with( token = token start_with = |*"| ) OR has_token_started_with( token = token start_with = |"!| ) OR has_token_started_with( token = token start_with = |##| ) OR has_token_started_with( token = token start_with = |*?| ) OR has_token_started_with( token = token start_with = |"?| ) OR has_token_started_with( token = token start_with = |*&| ) OR has_token_started_with( token = token start_with = |"#EC| ) OR has_token_started_with( token = token start_with = |* INCLUDE| ) OR token CP |"{ object_name }*.| OR token CO |*|. result = abap_true. ENDIF. CATCH cx_sy_range_out_of_bounds. result = abap_false. ENDTRY. ENDMETHOD. METHOD has_token_started_with. DATA(token_length) = strlen( start_with ). IF substring( val = token off = 0 len = token_length ) = start_with. result = abap_true. ENDIF. ENDMETHOD. METHOD check_result. DATA(percentage_of_comments) = get_percentage_of_comments( ). DATA(statement_for_message) = ref_scan->statements[ structure-stmnt_from ]. DATA(check_configuration) = detect_check_configuration( error_count = percentage_of_comments statement = statement_for_message ). raise_error( statement_level = statement_for_message-level statement_index = structure-stmnt_from statement_from = statement_for_message-from check_configuration = check_configuration parameter_01 = |{ comment_number }| parameter_02 = |{ percentage_of_comments }| parameter_03 = |{ check_configuration-threshold }| ). ENDMETHOD. METHOD get_percentage_of_comments. DATA(percentage) = CONV decfloat16( comment_number / abs_statement_number ) * 100. result = round( val = percentage dec = 0 mode = cl_abap_math=>round_down ). ENDMETHOD. METHOD is_code_disabled. CHECK structure-stmnt_type = scan_struc_stmnt_type-function. IF get_token_abs( statement-from ) = if_kaizen_keywords_c=>gc_function. is_function_module = abap_true. ELSEIF get_token_abs( statement-from ) = if_kaizen_keywords_c=>gc_endfunction. is_function_module = abap_false. ENDIF. result = xsdbool( is_function_module = abap_false ). ENDMETHOD. METHOD is_badi_example_class. CHECK object_type = 'CLAS'. SELECT SINGLE enhspot FROM enhspotobj INTO @DATA(enhancement) WHERE obj_type = @object_type AND obj_name = @object_name AND VERSION = 'A'. result = xsdbool( enhancement IS NOT INITIAL ). ENDMETHOD. ENDCLASS.
33.015957
125
0.617367
12d8b311efd3882002a1079c579b2b6ae66b4b0a
1,005
abap
ABAP
src/zaps_tasks/zcx_aps_job_creation_error.clas.abap
BiberM/ABAPParallelizationService
d0fca92dfe05456e73fadafd8763b7953e49eb57
[ "MIT" ]
7
2021-09-13T20:09:13.000Z
2022-02-11T18:22:07.000Z
src/zaps_tasks/zcx_aps_job_creation_error.clas.abap
BiberM/ABAPParallelizationService
d0fca92dfe05456e73fadafd8763b7953e49eb57
[ "MIT" ]
8
2021-10-03T16:40:59.000Z
2022-01-23T21:06:37.000Z
src/zaps_tasks/zcx_aps_job_creation_error.clas.abap
BiberM/ABAPParallelizationService
d0fca92dfe05456e73fadafd8763b7953e49eb57
[ "MIT" ]
1
2021-12-22T16:56:37.000Z
2021-12-22T16:56:37.000Z
class zcx_aps_job_creation_error definition public inheriting from cx_static_check final create public. public section. interfaces: if_t100_dyn_msg, if_t100_message. constants: begin of zcx_aps_job_creation_error, msgid type symsgid value 'ZAPS_TASK', msgno type symsgno value '009', attr1 type scx_attrname value '', attr2 type scx_attrname value '', attr3 type scx_attrname value '', attr4 type scx_attrname value '', end of zcx_aps_job_creation_error. methods: constructor importing i_textid type scx_t100key default zcx_aps_job_creation_error i_previous type ref to cx_root optional. protected section. private section. endclass. class zcx_aps_job_creation_error implementation. method constructor ##ADT_SUPPRESS_GENERATION. super->constructor( previous = i_previous ). clear textid. if_t100_message~t100key = i_textid. endmethod. endclass.
22.840909
72
0.705473
12d8fb7ee07469f3b849bd2d734863485fe119c7
3,823
abap
ABAP
src/02/zcl_tttt_demo_02_node_heroes.clas.abap
tricktresor/tree_template
32f9e378efab7306a79fa518a2018987a1b367b5
[ "MIT" ]
1
2020-10-25T18:36:53.000Z
2020-10-25T18:36:53.000Z
src/02/zcl_tttt_demo_02_node_heroes.clas.abap
tricktresor/tree_template
32f9e378efab7306a79fa518a2018987a1b367b5
[ "MIT" ]
null
null
null
src/02/zcl_tttt_demo_02_node_heroes.clas.abap
tricktresor/tree_template
32f9e378efab7306a79fa518a2018987a1b367b5
[ "MIT" ]
1
2020-10-25T18:04:19.000Z
2020-10-25T18:04:19.000Z
class ZCL_TTTT_DEMO_02_NODE_HEROES definition public create public . public section. interfaces ZIF_TTTT_NODE . methods CONSTRUCTOR importing !DESCRIPTION type STRING . PROTECTED SECTION. private section. types: BEGIN OF _hero, name TYPE string, alias TYPE string, END OF _hero . types: _heroes TYPE STANDARD TABLE OF _hero . data HERO_GRID type ref to CL_GUI_ALV_GRID . data HEROES type _HEROES . methods GET_FCAT returning value(FIELDCATALOG) type LVC_T_FCAT . methods CREATE_GRID . methods READ_HEROES . ENDCLASS. CLASS ZCL_TTTT_DEMO_02_NODE_HEROES IMPLEMENTATION. METHOD constructor. zif_tttt_node~description = description. read_heroes( ). ENDMETHOD. METHOD create_grid. CHECK hero_grid IS INITIAL. hero_grid = NEW #( i_parent = zif_tttt_node~container ). DATA(fcat) = get_fcat( ). hero_grid->set_table_for_first_display( CHANGING it_outtab = heroes it_fieldcatalog = fcat EXCEPTIONS invalid_parameter_combination = 1 " Wrong Parameter program_error = 2 " Program Errors too_many_lines = 3 " Too many Rows in Ready for Input Grid OTHERS = 4 ). IF sy-subrc <> 0. RETURN. ENDIF. ENDMETHOD. METHOD get_fcat. fieldcatalog = VALUE #( ( fieldname = 'NAME' reptext = 'Hero name' outputlen = 40 datatype = 'C' ) ( fieldname = 'ALIAS' reptext = 'Hero Alias' outputlen = 40 datatype = 'C' ) ). ENDMETHOD. METHOD read_heroes. heroes = VALUE #( ( name = 'Captain Marvel' alias = 'Carol Danvers' ) ( name = 'Thanos' ) ( name = 'Black Panther' alias = 'T''Challa' ) ( name = 'Spider-Man' alias = 'Peter Parker' ) ( name = 'Iron Man' alias = 'Tony Stark' ) ). ENDMETHOD. METHOD ZIF_TTTT_NODE~ACTIONZIF_TTTT_NODE_DOUBLE_CLICK. ENDMETHOD. METHOD ZIF_TTTT_NODE~ACTION_ITEM_CXT_MENU_REQUEST. menu->add_function( EXPORTING fcode = 'Demo' text = 'Demo function' ). ENDMETHOD. METHOD ZIF_TTTT_NODE~ACTION_ITEM_CXT_MENU_SELECTED. CASE fcode. WHEN 'Demo'. MESSAGE |demo function| TYPE 'I'. ENDCASE. ENDMETHOD. METHOD ZIF_TTTT_NODE~ACTION_ITEM_DOUBLE_CLICK. CASE item_name. WHEN 'xxx'. WHEN OTHERS. MESSAGE |item { item_name }| TYPE 'S'. ENDCASE. ENDMETHOD. METHOD ZIF_TTTT_NODE~ACTION_LINK_CLICK. MESSAGE |Link click on node { node_key } item { item_name }| TYPE 'S'. ENDMETHOD. METHOD zif_tttt_node~action_node_double_click. ENDMETHOD. METHOD ZIF_TTTT_NODE~GETZIF_TTTT_NODE_ICON. icon = icon_dummy. ENDMETHOD. METHOD zif_tttt_node~get_control. create_grid( ). control = hero_grid. ENDMETHOD. METHOD ZIF_TTTT_NODE~GET_ITEMS. items = VALUE #( ( item_name = zif_tttt_node=>item_name-description class = cl_item_tree_model=>item_class_text style = cl_item_tree_model=>style_default font = cl_item_tree_model=>item_font_prop text = zif_tttt_node~description length = 40 ) ). ENDMETHOD. METHOD zif_tttt_node~get_node_icon. icon = icon_customer. ENDMETHOD. METHOD zif_tttt_node~is_disabled. disabled = abap_false. ENDMETHOD. METHOD zif_tttt_node~is_folder. folder = abap_false. ENDMETHOD. METHOD ZIF_TTTT_NODE~SET_CONTAINER. zif_tttt_node~container = cont. ENDMETHOD. METHOD ZIF_TTTT_NODE~SET_MARK. zif_tttt_node~chosen = chosen. ENDMETHOD. ENDCLASS.
18.468599
100
0.622809
12dd2d19787024b618058a756cdfab74e1c61f65
9,067
abap
ABAP
src/zcl_graphql_test_model_handler.clas.abap
Allam76/abapGraphql2
650fa13d408da974ee2699eb4af59be914912fb5
[ "MIT" ]
5
2019-11-19T21:14:06.000Z
2022-02-05T10:57:39.000Z
src/zcl_graphql_test_model_handler.clas.abap
Allam76/abapGraphql2
650fa13d408da974ee2699eb4af59be914912fb5
[ "MIT" ]
null
null
null
src/zcl_graphql_test_model_handler.clas.abap
Allam76/abapGraphql2
650fa13d408da974ee2699eb4af59be914912fb5
[ "MIT" ]
null
null
null
class zcl_graphql_test_model_handler definition public inheriting from zcl_graphql_abs_handler create public . public section. types: begin of flight_type, carrier_name type string, end of flight_type, flight_type_tab type table of flight_type with key carrier_name. types: begin of join_cond_type, source type string, source_type type string, operator type string, target type string, target_type type string, end of join_cond_type, join_cond_type_tab type table of join_cond_type with key source target. types: begin of rel_out_type, name type string, number type string, label type string, source type string, target type string, cardinality1 type string, cardinality2 type string, conditions type join_cond_type_tab, end of rel_out_type, rel_out_type_tab type table of rel_out_type with key name. types: begin of attribute_out_type, name type string, type type string, label type string, domname type string, checktable type string, decimals type i, length type i, rollname type string, end of attribute_out_type, attribute_out_type_tab type table of attribute_out_type with key name. types: begin of action_out_type, name type string, type type string, arguments type attribute_out_type_tab, method_name type string, end of action_out_type, action_out_tab type table of action_out_type with key name. types: begin of entity_out_type, id type string, label type string, attributes type attribute_out_type_tab, relations type rel_out_type_tab, tables type stringtab, actions type action_out_tab, views type stringtab, end of entity_out_type, entity_out_type_tab type table of entity_out_type with key id. methods load redefinition. methods get_metadata redefinition. methods set_resolvers redefinition. class-methods class_constructor. methods constructor. methods get_flights importing token type ref to zcl_graphql_token parent_token type ref to zcl_graphql_token parent type any optional returning value(result) type ref to data. protected section. methods get_field_list importing type type any path type string returning value(result) type stringtab. private section. methods is_relation importing token type ref to zcl_graphql_token parent_token type ref to zcl_graphql_token returning value(result) type boolean. endclass. class zcl_graphql_test_model_handler implementation. method constructor. super->constructor( ). me->internal_model-data-__schema-query_type = value #( name = 'Query' ). me->external_model = load( 'test-model' ). data(metadata) = get_metadata( '' ). append lines of metadata-data-__schema-types to me->internal_model-data-__schema-types. endmethod. method load. data entities type entity_out_type_tab. cl_mime_repository_api=>get_api( )->get( exporting i_url = |/SAP/PUBLIC/TEST/{ name }.json| importing e_content = data(content) ). data(json_string) = cl_abap_codepage=>convert_from( source = content codepage = `UTF-8` ). /ui2/cl_json=>deserialize( exporting json = json_string changing data = entities ). create data result type entity_out_type_tab. assign result->* to field-symbol(<result>). <result> = entities. endmethod. method class_constructor. path = '/test'. model_name = 'test-model'. endmethod. method get_metadata. field-symbols <model> type entity_out_type_tab. assign me->external_model->* to <model>. result = value #( data = value #( __schema = value #( query_type = value #( name = 'Query' ) mutation_type = value #( name = 'Mutation' ) types = value #( ( name = 'Query' kind = 'OBJECT' fields = value #( for ent in <model> ( name = ent-label type = value #( kind = 'OBJECT' name = ent-label ) args = value #( for att in ent-attributes ( name = att-label type = value #( name = to_upper_first( att-type ) kind = 'SCALAR' ) ) ) ) ) ) ( name = 'Mutation' kind = 'OBJECT' fields = value #( for ent in <model> for action in ent-actions ( name = action-name type = value #( name = 'flights' kind = 'OBJECT' ) args = value #( for arg in action-arguments ( name = arg-name type = value #( name = to_upper_first( arg-type ) kind = 'SCALAR' ) ) ) ) ) ) ) ) ) ). append lines of value zgrql_type_type_tab( for entity in <model> ( name = entity-label kind = 'OBJECT' resolver = value #( method_name = 'GET_FLIGHTS' ) fields = value #( for att in entity-attributes ( name = att-label type = value #( name = to_upper_first( att-type ) kind = 'SCALAR' ) ) ) ) ) to result-data-__schema-types. loop at result-data-__schema-types assigning field-symbol(<type>). loop at <model> into data(model) where label = <type>-name. loop at model-relations into data(rel). data(target) = <model>[ id = rel-target ]. append value #( name = rel-name type = value #( kind = 'OBJECT' name = target-label ) ) to <type>-fields. endloop. endloop. endloop. endmethod. method set_resolvers. super->set_resolvers( resolvers = resolvers ). endmethod. method get_flights. field-symbols <model> type entity_out_type_tab. field-symbols <token_value> type ref to zcl_graphql_token. assign me->external_model->* to <model>. data(type) = me->internal_model-data-__schema-types[ name = token->name ]. data(ext_type) = <model>[ label = type-name ]. data(table_name) = ext_type-id. data(struc_handle) = get_type( type ). data(table_handle) = cl_abap_tabledescr=>create( struc_handle ). field-symbols <flight_tab> type any table. create data result type handle table_handle. assign result->* to <flight_tab>. data(db_fld_names) = get_field_list( type = ext_type path = 'ATTRIBUTES/NAME'). data(alias_fld_names) = get_field_list( type = type path = 'FIELDS/NAME'). data(statement) = cl_sadl_sql_statement=>create_for_open_sql( ). statement->select( ). loop at db_fld_names into data(db_fld). data(inx) = sy-tabix. statement->element( iv_element = db_fld iv_entity_alias = table_name )->as( iv_alias = from_mixed( val = alias_fld_names[ inx ] case = 'a' ) ). endloop. statement->from( )->element( iv_element = table_name ). if is_relation( token = token parent_token = parent_token ) = abap_true or lines( token->arguments ) > 0. statement->where( ). endif. loop at token->arguments into data(argument). inx = sy-tabix. assign argument->value->* to <token_value>. assign <token_value>->value->* to field-symbol(<end_value>). statement->compare_element_to_value( iv_element = ext_type-attributes[ label = argument->name ]-name iv_entity_alias = table_name iv_operator = 'EQ' iv_low = <end_value> ). if lines( token->arguments ) <> inx. statement->and( ). endif. endloop. if is_relation( token = token parent_token = parent_token ). data(relation) = <model>[ label = parent_token->name ]-relations[ name = token->name ]. loop at relation-conditions into data(condition). data(comp_name) = from_mixed( val = <model>[ label = parent_token->name ]-attributes[ name = condition-source ]-label case = 'a' ). assign component comp_name of structure parent to field-symbol(<source>). statement->compare_element_to_value( iv_element = condition-target iv_operator = 'EQ' iv_low = <source> ). endloop. endif. statement->execute_on_current_client( importing et_data = <flight_tab> ). endmethod. method get_field_list. field-symbols <table> type any table. split path at '/' into data(table) data(field). assign component table of structure type to <table>. loop at <table> assigning field-symbol(<line>). append initial line to result assigning field-symbol(<target>). assign component field of structure <line> to field-symbol(<source>). <target> = <source>. endloop. endmethod. method is_relation. field-symbols <model> type entity_out_type_tab. assign me->external_model->* to <model>. if line_exists( <model>[ label = parent_token->name ] ). if line_exists( <model>[ label = parent_token->name ]-relations[ name = token->name ] ). result = abap_true. endif. endif. endmethod. endclass.
39.081897
148
0.646079
12dfbca4646f29c57ebcb449b65b7674964ef5c6
4,865
abap
ABAP
src/objects/zcl_abapgit_object_iarp.clas.abap
joymike/abapGit
e06f22bb22a3c0a3c66eec4da698124c1ec98d65
[ "MIT" ]
1
2019-05-27T18:50:14.000Z
2019-05-27T18:50:14.000Z
src/objects/zcl_abapgit_object_iarp.clas.abap
joymike/abapGit
e06f22bb22a3c0a3c66eec4da698124c1ec98d65
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_iarp.clas.abap
joymike/abapGit
e06f22bb22a3c0a3c66eec4da698124c1ec98d65
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_object_iarp DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL. PUBLIC SECTION. INTERFACES zif_abapgit_object. ALIASES mo_files FOR zif_abapgit_object~mo_files. PROTECTED SECTION. PRIVATE SECTION. METHODS: read EXPORTING es_attr TYPE w3resoattr et_parameters TYPE w3resopara_tabletype RAISING zcx_abapgit_exception, save IMPORTING is_attr TYPE w3resoattr it_parameters TYPE w3resopara_tabletype RAISING zcx_abapgit_exception. ENDCLASS. CLASS ZCL_ABAPGIT_OBJECT_IARP IMPLEMENTATION. METHOD read. DATA: li_resource TYPE REF TO if_w3_api_resource, ls_name TYPE w3resokey. ls_name = ms_item-obj_name. cl_w3_api_resource=>if_w3_api_resource~load( EXPORTING p_resource_name = ls_name IMPORTING p_resource = li_resource EXCEPTIONS object_not_existing = 1 permission_failure = 2 error_occured = 3 OTHERS = 4 ). IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'error from w3api_resource~load' ). ENDIF. li_resource->get_attributes( IMPORTING p_attributes = es_attr ). CLEAR: es_attr-chname, es_attr-tdate, es_attr-ttime, es_attr-devclass. li_resource->get_parameters( IMPORTING p_parameters = et_parameters ). ENDMETHOD. METHOD save. DATA: li_resource TYPE REF TO if_w3_api_resource. cl_w3_api_resource=>if_w3_api_resource~create_new( EXPORTING p_resource_data = is_attr IMPORTING p_resource = li_resource ). li_resource->set_attributes( is_attr ). li_resource->set_parameters( it_parameters ). li_resource->if_w3_api_object~save( ). ENDMETHOD. METHOD zif_abapgit_object~changed_by. rv_user = c_user_unknown. " todo ENDMETHOD. METHOD zif_abapgit_object~delete. DATA: li_resource TYPE REF TO if_w3_api_resource, ls_name TYPE w3resokey. ls_name = ms_item-obj_name. cl_w3_api_resource=>if_w3_api_resource~load( EXPORTING p_resource_name = ls_name IMPORTING p_resource = li_resource EXCEPTIONS object_not_existing = 1 permission_failure = 2 error_occured = 3 OTHERS = 4 ). IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'error from if_w3_api_resource~load' ). ENDIF. li_resource->if_w3_api_object~set_changeable( abap_true ). li_resource->if_w3_api_object~delete( ). li_resource->if_w3_api_object~save( ). ENDMETHOD. METHOD zif_abapgit_object~deserialize. DATA: ls_attr TYPE w3resoattr, lt_parameters TYPE w3resopara_tabletype. io_xml->read( EXPORTING iv_name = 'ATTR' CHANGING cg_data = ls_attr ). io_xml->read( EXPORTING iv_name = 'PARAMETERS' CHANGING cg_data = lt_parameters ). ls_attr-devclass = iv_package. save( is_attr = ls_attr it_parameters = lt_parameters ). ENDMETHOD. METHOD zif_abapgit_object~exists. DATA: ls_name TYPE w3resokey. ls_name = ms_item-obj_name. cl_w3_api_resource=>if_w3_api_resource~load( EXPORTING p_resource_name = ls_name EXCEPTIONS object_not_existing = 1 permission_failure = 2 error_occured = 3 OTHERS = 4 ). IF sy-subrc = 1. rv_bool = abap_false. ELSEIF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'error from w3_api_resource~load' ). ELSE. rv_bool = abap_true. ENDIF. ENDMETHOD. METHOD zif_abapgit_object~get_comparator. RETURN. ENDMETHOD. METHOD zif_abapgit_object~get_deserialize_steps. APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps. ENDMETHOD. METHOD zif_abapgit_object~get_metadata. rs_metadata = get_metadata( ). ENDMETHOD. METHOD zif_abapgit_object~is_active. rv_active = is_active( ). ENDMETHOD. METHOD zif_abapgit_object~is_locked. rv_is_locked = abap_false. ENDMETHOD. METHOD zif_abapgit_object~jump. CALL FUNCTION 'RS_TOOL_ACCESS' EXPORTING operation = 'SHOW' object_name = ms_item-obj_name object_type = ms_item-obj_type. ENDMETHOD. METHOD zif_abapgit_object~serialize. DATA: ls_attr TYPE w3resoattr, lt_parameters TYPE w3resopara_tabletype. IF zif_abapgit_object~exists( ) = abap_false. RETURN. ENDIF. read( IMPORTING es_attr = ls_attr et_parameters = lt_parameters ). io_xml->add( iv_name = 'ATTR' ig_data = ls_attr ). io_xml->add( iv_name = 'PARAMETERS' ig_data = lt_parameters ). ENDMETHOD. ENDCLASS.
22.840376
96
0.657554
12e1cdae671246212e5dd8ffee7ef1082b35de97
1,754
abap
ABAP
src/main/famix/z2mse_famix_sourced_entity.clas.abap
sabatale/SAP2Moose
59553fab013de732e2b7c9e67b6a4de799617b6a
[ "MIT" ]
25
2017-09-05T12:57:46.000Z
2021-12-18T21:47:13.000Z
src/main/famix/z2mse_famix_sourced_entity.clas.abap
sabatale/SAP2Moose
59553fab013de732e2b7c9e67b6a4de799617b6a
[ "MIT" ]
72
2017-09-18T15:16:20.000Z
2021-12-10T20:09:32.000Z
src/main/famix/z2mse_famix_sourced_entity.clas.abap
sabatale/SAP2Moose
59553fab013de732e2b7c9e67b6a4de799617b6a
[ "MIT" ]
6
2017-11-05T19:23:19.000Z
2020-02-01T20:02:51.000Z
CLASS z2mse_famix_sourced_entity DEFINITION ABSTRACT INHERITING FROM z2mse_famix_entity PUBLIC CREATE PUBLIC. PUBLIC SECTION. "! Declare source language "! Provide either ID or type and name of element "! @parameter element_id | the ID of the element where the ID shall be added "! @parameter elemenent_type | the element type of the element (not needed if ID is provided) "! @parameter element_name_group | the name group of the element where the ID shall be added "! @parameter element_name | the name of the element "! @parameter source_language_element | the FAMIX element of the source language "! @parameter source_language_name | the name of the source language METHODS set_declared_source_language IMPORTING element_id TYPE i element_type TYPE clike OPTIONAL element_name_group TYPE clike OPTIONAL element_name TYPE clike OPTIONAL source_language_element TYPE clike source_language_name TYPE clike. ENDCLASS. CLASS Z2MSE_FAMIX_SOURCED_ENTITY IMPLEMENTATION. METHOD set_declared_source_language. g_model->add_reference_by_name( EXPORTING element_id = element_id element_type = element_type element_name_group = element_name_group element_name = element_name attribute_name = 'declaredSourceLanguage' type_of_reference = source_language_element name_of_reference = source_language_name ). ENDMETHOD. ENDCLASS.
44.974359
97
0.629989
12e1e0d69c92de91f2a2cb7b8c25c086083eef0d
8,631
abap
ABAP
src/objects/oo/zcl_abapgit_oo_serializer.clas.abap
amit3kumar/ABAP_ALL
67822ae13ffda6597a91bb5b39e428c39bc445a3
[ "MIT" ]
2
2021-03-20T20:27:04.000Z
2021-03-20T20:34:58.000Z
src/objects/oo/zcl_abapgit_oo_serializer.clas.abap
amit3kumar/ABAP_ALL
67822ae13ffda6597a91bb5b39e428c39bc445a3
[ "MIT" ]
37
2021-06-01T05:57:18.000Z
2022-03-01T05:02:10.000Z
src/objects/oo/zcl_abapgit_oo_serializer.clas.abap
amit3kumar/ABAP_ALL
67822ae13ffda6597a91bb5b39e428c39bc445a3
[ "MIT" ]
1
2021-08-18T07:58:26.000Z
2021-08-18T07:58:26.000Z
CLASS zcl_abapgit_oo_serializer DEFINITION PUBLIC CREATE PUBLIC . PUBLIC SECTION. METHODS serialize_abap_clif_source IMPORTING !is_class_key TYPE seoclskey RETURNING VALUE(rt_source) TYPE zif_abapgit_definitions=>ty_string_tt RAISING zcx_abapgit_exception cx_sy_dyn_call_error . METHODS are_test_classes_skipped RETURNING VALUE(rv_return) TYPE abap_bool . METHODS serialize_locals_imp IMPORTING !is_clskey TYPE seoclskey RETURNING VALUE(rt_source) TYPE zif_abapgit_definitions=>ty_string_tt RAISING zcx_abapgit_exception . METHODS serialize_locals_def IMPORTING !is_clskey TYPE seoclskey RETURNING VALUE(rt_source) TYPE zif_abapgit_definitions=>ty_string_tt RAISING zcx_abapgit_exception . METHODS serialize_testclasses IMPORTING !is_clskey TYPE seoclskey RETURNING VALUE(rt_source) TYPE zif_abapgit_definitions=>ty_string_tt RAISING zcx_abapgit_exception . METHODS serialize_macros IMPORTING !is_clskey TYPE seoclskey RETURNING VALUE(rt_source) TYPE zif_abapgit_definitions=>ty_string_tt RAISING zcx_abapgit_exception . PROTECTED SECTION. PRIVATE SECTION. DATA mv_skip_testclass TYPE abap_bool . METHODS calculate_skip_testclass IMPORTING !it_source TYPE zif_abapgit_definitions=>ty_string_tt RETURNING VALUE(rv_skip_testclass) TYPE abap_bool . METHODS serialize_abap_old IMPORTING !is_clskey TYPE seoclskey RETURNING VALUE(rt_source) TYPE zif_abapgit_definitions=>ty_string_tt RAISING zcx_abapgit_exception . METHODS serialize_abap_new IMPORTING !is_clskey TYPE seoclskey RETURNING VALUE(rt_source) TYPE zif_abapgit_definitions=>ty_string_tt RAISING zcx_abapgit_exception cx_sy_dyn_call_error . METHODS remove_signatures CHANGING !ct_source TYPE zif_abapgit_definitions=>ty_string_tt . METHODS read_include IMPORTING !is_clskey TYPE seoclskey !iv_type TYPE seop_include_ext_app RETURNING VALUE(rt_source) TYPE seop_source_string . METHODS reduce CHANGING !ct_source TYPE zif_abapgit_definitions=>ty_string_tt . ENDCLASS. CLASS zcl_abapgit_oo_serializer IMPLEMENTATION. METHOD are_test_classes_skipped. rv_return = mv_skip_testclass. ENDMETHOD. METHOD calculate_skip_testclass. DATA: lv_line1 LIKE LINE OF it_source, lv_line2 LIKE LINE OF it_source. * when creating classes in Eclipse it automatically generates the * testclass include, but it is not needed, so skip to avoid * creating an extra file in the repository. * Also remove it if the content is manually removed, but * the class still thinks it contains tests rv_skip_testclass = abap_false. IF lines( it_source ) = 2. READ TABLE it_source INDEX 1 INTO lv_line1. ASSERT sy-subrc = 0. READ TABLE it_source INDEX 2 INTO lv_line2. ASSERT sy-subrc = 0. IF strlen( lv_line1 ) >= 3 AND lv_line1(3) = '*"*' AND lv_line2 IS INITIAL. rv_skip_testclass = abap_true. ENDIF. ELSEIF lines( it_source ) = 1. READ TABLE it_source INDEX 1 INTO lv_line1. ASSERT sy-subrc = 0. IF lv_line1 IS INITIAL OR ( strlen( lv_line1 ) >= 3 AND lv_line1(3) = '*"*' ) OR ( strlen( lv_line1 ) = 1 AND lv_line1(1) = '*' ). rv_skip_testclass = abap_true. ENDIF. ELSEIF lines( it_source ) = 0. rv_skip_testclass = abap_true. ENDIF. ENDMETHOD. METHOD read_include. DATA: ls_include TYPE progstruc. ASSERT iv_type = seop_ext_class_locals_def OR iv_type = seop_ext_class_locals_imp OR iv_type = seop_ext_class_macros OR iv_type = seop_ext_class_testclasses. ls_include-rootname = is_clskey-clsname. TRANSLATE ls_include-rootname USING ' ='. ls_include-categorya = iv_type(1). ls_include-codea = iv_type+1(4). * it looks like there is an issue in function module SEO_CLASS_GET_INCLUDE_SOURCE * on 750 kernels, where the READ REPORT without STATE addition does not * return the active version, this method is a workaround for this issue READ REPORT ls_include INTO rt_source STATE 'A'. ENDMETHOD. METHOD reduce. DATA: lv_source LIKE LINE OF ct_source, lv_found TYPE abap_bool. * skip files that only contain the standard comments lv_found = abap_false. LOOP AT ct_source INTO lv_source. IF strlen( lv_source ) >= 3 AND lv_source(3) <> '*"*'. lv_found = abap_true. ENDIF. ENDLOOP. IF lv_found = abap_false. CLEAR ct_source. ENDIF. ENDMETHOD. METHOD remove_signatures. * signatures messes up in CL_OO_SOURCE when deserializing and serializing * within same session DATA: lv_begin TYPE string, lv_end TYPE string, lv_remove TYPE abap_bool, lv_source LIKE LINE OF ct_source. "@TODO: Put under test CONCATENATE '* <SIGNATURE>------------------------------------' '---------------------------------------------------+' INTO lv_begin. CONCATENATE '* +------------------------------------------------' '--------------------------------------</SIGNATURE>' INTO lv_end. lv_remove = abap_false. LOOP AT ct_source INTO lv_source. IF lv_source = lv_begin. lv_remove = abap_true. ENDIF. IF lv_remove = abap_true. DELETE ct_source INDEX sy-tabix. ENDIF. IF lv_source = lv_end. lv_remove = abap_false. ENDIF. ENDLOOP. ENDMETHOD. METHOD serialize_abap_clif_source. rt_source = zcl_abapgit_exit=>get_instance( )->custom_serialize_abap_clif( is_class_key ). IF rt_source IS NOT INITIAL. RETURN. ENDIF. TRY. rt_source = serialize_abap_new( is_class_key ). CATCH cx_sy_dyn_call_error. rt_source = serialize_abap_old( is_class_key ). ENDTRY. ENDMETHOD. METHOD serialize_abap_new. DATA: lo_source TYPE REF TO object, lo_instance TYPE REF TO object. * do not call the class/methods statically, as it will * give syntax errors on old versions CALL METHOD ('CL_OO_FACTORY')=>('CREATE_INSTANCE') RECEIVING result = lo_instance. CALL METHOD lo_instance->('CREATE_CLIF_SOURCE') EXPORTING clif_name = is_clskey-clsname version = 'A' RECEIVING result = lo_source. CALL METHOD lo_source->('GET_SOURCE') IMPORTING source = rt_source. ENDMETHOD. METHOD serialize_abap_old. * for old ABAP AS versions DATA: lo_source TYPE REF TO cl_oo_source. CREATE OBJECT lo_source EXPORTING clskey = is_clskey EXCEPTIONS class_not_existing = 1 OTHERS = 2. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. lo_source->read( 'A' ). rt_source = lo_source->get_old_source( ). remove_signatures( CHANGING ct_source = rt_source ). ENDMETHOD. METHOD serialize_locals_def. rt_source = read_include( is_clskey = is_clskey iv_type = seop_ext_class_locals_def ). reduce( CHANGING ct_source = rt_source ). ENDMETHOD. METHOD serialize_locals_imp. rt_source = read_include( is_clskey = is_clskey iv_type = seop_ext_class_locals_imp ). reduce( CHANGING ct_source = rt_source ). ENDMETHOD. METHOD serialize_macros. rt_source = read_include( is_clskey = is_clskey iv_type = seop_ext_class_macros ). reduce( CHANGING ct_source = rt_source ). ENDMETHOD. METHOD serialize_testclasses. DATA ls_vseoclass TYPE vseoclass. CALL FUNCTION 'SEO_CLIF_GET' EXPORTING cifkey = is_clskey version = seoc_version_active IMPORTING class = ls_vseoclass EXCEPTIONS not_existing = 1 deleted = 2 model_only = 3 OTHERS = 4. IF sy-subrc <> 0 OR ls_vseoclass-with_unit_tests = abap_false. mv_skip_testclass = abap_true. RETURN. ENDIF. rt_source = read_include( is_clskey = is_clskey iv_type = seop_ext_class_testclasses ). mv_skip_testclass = calculate_skip_testclass( rt_source ). ENDMETHOD. ENDCLASS.
26.556923
94
0.649751
12e234fbb34552f493a4aef8d229736f3e98eeb5
3,080
abap
ABAP
src/objects/zcl_abapgit_object_tran.clas.testclasses.abap
timbolski/downport
c5fa01ed27c8265606d7a67832d64164d1769c79
[ "MIT" ]
3
2020-05-31T18:55:42.000Z
2021-01-08T21:36:09.000Z
src/objects/zcl_abapgit_object_tran.clas.testclasses.abap
timbolski/downport
c5fa01ed27c8265606d7a67832d64164d1769c79
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_tran.clas.testclasses.abap
timbolski/downport
c5fa01ed27c8265606d7a67832d64164d1769c79
[ "MIT" ]
2
2021-01-08T21:36:15.000Z
2022-03-29T05:40:00.000Z
CLASS ltcl_split_parameters DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS. PRIVATE SECTION. DATA mo_cut TYPE REF TO zcl_abapgit_object_tran. METHODS: setup, parmeter_transaction FOR TESTING RAISING cx_static_check, given_parameter_transaction IMPORTING iv_tcode TYPE csequence iv_param TYPE csequence, when_parameter_split, then_st_tcode_shd_be IMPORTING iv_exp_st_tcode TYPE eusel_tcod, then_st_skip_1_shd_be IMPORTING iv_st_skip TYPE eusel_skip, then_call_tcode_shd_be IMPORTING iv_call_tcode TYPE tcode, then_param_shd_be IMPORTING iv_line TYPE i iv_field TYPE string iv_value TYPE string. DATA: ms_tstcp TYPE tstcp, mt_rsparam TYPE s_param, ms_rsstcd TYPE rsstcd, ms_tstc TYPE tstc. ENDCLASS. CLASS zcl_abapgit_object_tran DEFINITION LOCAL FRIENDS ltcl_split_parameters. CLASS ltcl_split_parameters IMPLEMENTATION. METHOD setup. DATA: ls_item TYPE zif_abapgit_definitions=>ty_item. ls_item-obj_name = 'ZDUMMY'. ls_item-obj_type = 'TRAN'. CREATE OBJECT mo_cut EXPORTING is_item = ls_item iv_language = sy-langu. ENDMETHOD. METHOD parmeter_transaction. "Parameter transaction ISSUE_1276 given_parameter_transaction( iv_tcode = 'ZMM_BF_SPEZ_ROLE' iv_param = '/*SM30 VIEWNAME=ZMM_BF_SPEZ_ROLE;UPDATE=X;' ). when_parameter_split( ). then_st_tcode_shd_be( 'X' ). then_st_skip_1_shd_be( 'X' ). then_call_tcode_shd_be( 'SM30' ). then_param_shd_be( iv_line = 1 iv_field = 'VIEWNAME' iv_value ='ZMM_BF_SPEZ_ROLE' ). then_param_shd_be( iv_line = 2 iv_field = 'UPDATE' iv_value = 'X' ). ENDMETHOD. METHOD given_parameter_transaction. ms_tstcp-tcode = iv_tcode. ms_tstcp-param = iv_param. ENDMETHOD. METHOD when_parameter_split. mo_cut->split_parameters( CHANGING ct_rsparam = mt_rsparam cs_rsstcd = ms_rsstcd cs_tstcp = ms_tstcp cs_tstc = ms_tstc ). ENDMETHOD. METHOD then_st_tcode_shd_be. cl_abap_unit_assert=>assert_equals( exp = iv_exp_st_tcode act = ms_rsstcd-st_tcode ). ENDMETHOD. METHOD then_st_skip_1_shd_be. cl_abap_unit_assert=>assert_equals( exp = iv_st_skip act = ms_rsstcd-st_skip_1 ). ENDMETHOD. METHOD then_call_tcode_shd_be. cl_abap_unit_assert=>assert_equals( exp = iv_call_tcode act = ms_rsstcd-call_tcode ). ENDMETHOD. METHOD then_param_shd_be. DATA: ls_exp_rsparam LIKE LINE OF mt_rsparam, ls_act_rsparam TYPE rsparam. ls_exp_rsparam-field = iv_field. ls_exp_rsparam-value = iv_value. READ TABLE mt_rsparam INDEX iv_line INTO ls_act_rsparam. cl_abap_unit_assert=>assert_equals( exp = ls_exp_rsparam act = ls_act_rsparam ). ENDMETHOD. ENDCLASS.
20.263158
77
0.669156
12e959f5af3ebee1c40e499fea7331a3fa7b67b0
384
abap
ABAP
src/zdop_mv_employee.fugr.lzdop_mv_employeei00.abap
DogukanP/ABAP-SSR
c2019809e7c809235e3a96641f4188d96cdeeebb
[ "Apache-2.0" ]
null
null
null
src/zdop_mv_employee.fugr.lzdop_mv_employeei00.abap
DogukanP/ABAP-SSR
c2019809e7c809235e3a96641f4188d96cdeeebb
[ "Apache-2.0" ]
null
null
null
src/zdop_mv_employee.fugr.lzdop_mv_employeei00.abap
DogukanP/ABAP-SSR
c2019809e7c809235e3a96641f4188d96cdeeebb
[ "Apache-2.0" ]
null
null
null
*---------------------------------------------------------------------* * view related PAI modules *---------------------------------------------------------------------* *...processing: ZDOP_MV_EMPLOYEE................................* *---------------------------------------------------------------------* *---------------------------------------------------------------------*
54.857143
71
0.122396
12ecc91c5709a2079f5a9890f31d09041ab07407
3,951
abap
ABAP
src/legacy/#dmo#flight_travel_api18.fugr.#dmo#flight_travel_update18.abap
SAP-Cloud-Platform/flight18
8e20ebbb832f8a27465c5a191fd45e773b3efee2
[ "BSD-Source-Code" ]
null
null
null
src/legacy/#dmo#flight_travel_api18.fugr.#dmo#flight_travel_update18.abap
SAP-Cloud-Platform/flight18
8e20ebbb832f8a27465c5a191fd45e773b3efee2
[ "BSD-Source-Code" ]
null
null
null
src/legacy/#dmo#flight_travel_api18.fugr.#dmo#flight_travel_update18.abap
SAP-Cloud-Platform/flight18
8e20ebbb832f8a27465c5a191fd45e773b3efee2
[ "BSD-Source-Code" ]
null
null
null
"! <h1>API for Updating a Travel</h1> "! "! <p> "! Function module to update a single Travel instance with the possibility to update related Bookings and "! Booking Supplements in the same call. "! </p> "! "! <p> "! For an operation only on a Booking or Booking Supplement the Travel Data Change Flag structure still must be applied. "! It then contains only the <em>travel_id</em> and all flags set to <em>false</em> respectively left <em>initial</em>. "! </p> "! "! "! @parameter is_travel | Travel Data "! @parameter is_travelx | Travel Data Change Flags "! @parameter it_booking | Table of predefined Booking Key <em>booking_id</em> and Booking Data "! @parameter it_bookingx | Change Flag Table of Booking Data with predefined Booking Key <em>booking_id</em> "! @parameter it_booking_supplement | Table of predefined Booking Supplement Key <em>booking_id</em>, <em>booking_supplement_id</em> and Booking Supplement Data "! @parameter it_booking_supplementx | Change Flag Table of Booking Supplement Data with predefined Booking Supplement Key <em>booking_id</em>, <em>booking_supplement_id</em> "! @parameter es_travel | Evaluated Travel Data like /DMO/TRAVEL18 "! @parameter et_booking | Table of evaluated Bookings like /DMO/BOOKING18 "! @parameter et_booking_supplement | Table of evaluated Booking Supplements like /DMO/BOOK_SUP_18 "! @parameter et_messages | Table of occurred messages "! FUNCTION /DMO/FLIGHT_TRAVEL_UPDATE18. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" REFERENCE(IS_TRAVEL) TYPE /DMO/IF_FLIGHT_LEGACY18=>TS_TRAVEL_IN *" REFERENCE(IS_TRAVELX) TYPE /DMO/IF_FLIGHT_LEGACY18=>TS_TRAVEL_INX *" REFERENCE(IT_BOOKING) TYPE /DMO/IF_FLIGHT_LEGACY18=>TT_BOOKING_IN *" OPTIONAL *" REFERENCE(IT_BOOKINGX) TYPE *" /DMO/IF_FLIGHT_LEGACY18=>TT_BOOKING_INX OPTIONAL *" REFERENCE(IT_BOOKING_SUPPLEMENT) TYPE *" /DMO/IF_FLIGHT_LEGACY18=>TT_BOOKING_SUPPLEMENT_IN OPTIONAL *" REFERENCE(IT_BOOKING_SUPPLEMENTX) TYPE *" /DMO/IF_FLIGHT_LEGACY18=>TT_BOOKING_SUPPLEMENT_INX OPTIONAL *" EXPORTING *" REFERENCE(ES_TRAVEL) TYPE /DMO/TRAVEL18 *" REFERENCE(ET_BOOKING) TYPE /DMO/IF_FLIGHT_LEGACY18=>TT_BOOKING *" REFERENCE(ET_BOOKING_SUPPLEMENT) TYPE *" /DMO/IF_FLIGHT_LEGACY18=>TT_BOOKING_SUPPLEMENT *" REFERENCE(ET_MESSAGES) TYPE /DMO/IF_FLIGHT_LEGACY18=>TT_MESSAGE *"---------------------------------------------------------------------- CLEAR es_travel. CLEAR et_booking. CLEAR et_booking_supplement. CLEAR et_messages. /dmo/cl_flight_legacy18=>get_instance( )->update_travel( EXPORTING is_travel = is_travel it_booking = it_booking it_booking_supplement = it_booking_supplement is_travelx = is_travelx it_bookingx = it_bookingx it_booking_supplementx = it_booking_supplementx IMPORTING es_travel = es_travel et_booking = et_booking et_booking_supplement = et_booking_supplement et_messages = DATA(lt_messages) ). /dmo/cl_flight_legacy18=>get_instance( )->convert_messages( EXPORTING it_messages = lt_messages IMPORTING et_messages = et_messages ). ENDFUNCTION.
60.784615
174
0.581625
12f5252e5829875e7825f78daddbd5ba0a5ff97a
776
abap
ABAP
src/zread_report.prog.abap
larshp/CLAS_rewrite
7279f343f2a2ac267c05caec152a3e8905b49da8
[ "MIT" ]
null
null
null
src/zread_report.prog.abap
larshp/CLAS_rewrite
7279f343f2a2ac267c05caec152a3e8905b49da8
[ "MIT" ]
null
null
null
src/zread_report.prog.abap
larshp/CLAS_rewrite
7279f343f2a2ac267c05caec152a3e8905b49da8
[ "MIT" ]
null
null
null
*&---------------------------------------------------------------------* *& Report ZREAD_REPORT *&---------------------------------------------------------------------* *& *&---------------------------------------------------------------------* REPORT zread_report. START-OF-SELECTION. PERFORM run. FORM run. SELECT * FROM reposrc INTO TABLE @DATA(lt_reposrc) WHERE progname LIKE 'ZCL_FOOBAA%'. LOOP AT lt_reposrc INTO DATA(ls_reposrc). PERFORM read USING ls_reposrc-progname. ENDLOOP. ENDFORM. FORM read USING p_program TYPE programm. DATA: source TYPE TABLE OF string. WRITE: / p_program. READ REPORT p_program INTO source. IF sy-subrc <> 0. RETURN. ENDIF. LOOP AT source INTO DATA(src). WRITE: / | |, src. ENDLOOP. ENDFORM.
20.972973
72
0.5
12f667ea730c3ae9e4e1dc453c726eaf4ce61de9
20,531
abap
ABAP
src/zcl_excel_writer_xlsm.clas.abap
chrisaasan/abap2xlsx
cb315c557225928baacbbcfd42087c3a8ed34a12
[ "Apache-2.0" ]
6
2020-05-23T13:03:37.000Z
2021-09-30T09:23:43.000Z
src/zcl_excel_writer_xlsm.clas.abap
chrisaasan/abap2xlsx
cb315c557225928baacbbcfd42087c3a8ed34a12
[ "Apache-2.0" ]
null
null
null
src/zcl_excel_writer_xlsm.clas.abap
chrisaasan/abap2xlsx
cb315c557225928baacbbcfd42087c3a8ed34a12
[ "Apache-2.0" ]
3
2020-12-31T07:32:35.000Z
2021-03-21T14:16:20.000Z
CLASS zcl_excel_writer_xlsm DEFINITION PUBLIC INHERITING FROM zcl_excel_writer_2007 CREATE PUBLIC . PUBLIC SECTION. *"* public components of class ZCL_EXCEL_WRITER_XLSM *"* do not include other source files here!!! PROTECTED SECTION. *"* protected components of class ZCL_EXCEL_WRITER_XLSM *"* do not include other source files here!!! CONSTANTS c_xl_vbaproject TYPE string VALUE 'xl/vbaProject.bin'. "#EC NOTEXT METHODS add_further_data_to_zip REDEFINITION . METHODS create REDEFINITION . METHODS create_content_types REDEFINITION . METHODS create_xl_relationships REDEFINITION . METHODS create_xl_sheet REDEFINITION . METHODS create_xl_workbook REDEFINITION . PRIVATE SECTION. *"* private components of class ZCL_EXCEL_WRITER_XLSM *"* do not include other source files here!!! ENDCLASS. CLASS zcl_excel_writer_xlsm IMPLEMENTATION. METHOD add_further_data_to_zip. super->add_further_data_to_zip( io_zip = io_zip ). * Add vbaProject.bin to zip io_zip->add( name = me->c_xl_vbaproject content = me->excel->zif_excel_book_vba_project~vbaproject ). ENDMETHOD. METHOD create. * Office 2007 file format is a cab of several xml files with extension .xlsx DATA: lo_zip TYPE REF TO cl_abap_zip, lo_worksheet TYPE REF TO zcl_excel_worksheet, lo_active_worksheet TYPE REF TO zcl_excel_worksheet, lo_iterator TYPE REF TO cl_object_collection_iterator, lo_nested_iterator TYPE REF TO cl_object_collection_iterator, lo_table TYPE REF TO zcl_excel_table, lo_drawing TYPE REF TO zcl_excel_drawing, lo_drawings TYPE REF TO zcl_excel_drawings. DATA: lv_content TYPE xstring, lv_active TYPE flag, lv_xl_sheet TYPE string, lv_xl_sheet_rels TYPE string, lv_xl_drawing TYPE string, lv_xl_drawing_rels TYPE string, lv_syindex TYPE string, lv_value TYPE string, lv_drawing_index TYPE i, lv_comment_index TYPE i. " (+) Issue 588 ********************************************************************** * Start of insertion # issue 139 - Dateretention of cellstyles me->excel->add_static_styles( ). * End of insertion # issue 139 - Dateretention of cellstyles ********************************************************************** * STEP 1: Create archive object file (ZIP) CREATE OBJECT lo_zip. ********************************************************************** * STEP 2: Add [Content_Types].xml to zip lv_content = me->create_content_types( ). lo_zip->add( name = me->c_content_types content = lv_content ). ********************************************************************** * STEP 3: Add _rels/.rels to zip lv_content = me->create_relationships( ). lo_zip->add( name = me->c_relationships content = lv_content ). ********************************************************************** * STEP 4: Add docProps/app.xml to zip lv_content = me->create_docprops_app( ). lo_zip->add( name = me->c_docprops_app content = lv_content ). ********************************************************************** * STEP 5: Add docProps/core.xml to zip lv_content = me->create_docprops_core( ). lo_zip->add( name = me->c_docprops_core content = lv_content ). ********************************************************************** * STEP 6: Add xl/_rels/workbook.xml.rels to zip lv_content = me->create_xl_relationships( ). lo_zip->add( name = me->c_xl_relationships content = lv_content ). ********************************************************************** * STEP 6: Add xl/_rels/workbook.xml.rels to zip lv_content = me->create_xl_theme( ). lo_zip->add( name = me->c_xl_theme content = lv_content ). ********************************************************************** * STEP 7: Add xl/workbook.xml to zip lv_content = me->create_xl_workbook( ). lo_zip->add( name = me->c_xl_workbook content = lv_content ). ********************************************************************** * STEP 8: Add xl/workbook.xml to zip * lv_content = me->create_xl_styles_static( ). lv_content = me->create_xl_styles( ). lo_zip->add( name = me->c_xl_styles content = lv_content ). ********************************************************************** * STEP 9: Add sharedStrings.xml to zip lv_content = me->create_xl_sharedstrings( ). lo_zip->add( name = me->c_xl_sharedstrings content = lv_content ). ********************************************************************** * STEP 10: Add sheet#.xml and drawing#.xml to zip lo_iterator = me->excel->get_worksheets_iterator( ). lo_active_worksheet = me->excel->get_active_worksheet( ). lv_drawing_index = 1. WHILE lo_iterator->has_next( ) EQ abap_true. lo_worksheet ?= lo_iterator->get_next( ). IF lo_active_worksheet->get_guid( ) EQ lo_worksheet->get_guid( ). lv_active = abap_true. ELSE. lv_active = abap_false. ENDIF. lv_content = me->create_xl_sheet( io_worksheet = lo_worksheet iv_active = lv_active ). lv_xl_sheet = me->c_xl_sheet. MOVE sy-index TO: lv_syindex, lv_comment_index. " (+) Issue 588 SHIFT lv_syindex RIGHT DELETING TRAILING space. SHIFT lv_syindex LEFT DELETING LEADING space. REPLACE ALL OCCURRENCES OF '#' IN lv_xl_sheet WITH lv_syindex. lo_zip->add( name = lv_xl_sheet content = lv_content ). lv_xl_sheet_rels = me->c_xl_sheet_rels. lv_content = me->create_xl_sheet_rels( io_worksheet = lo_worksheet iv_drawing_index = lv_drawing_index iv_comment_index = lv_comment_index ). " (+) Issue 588 REPLACE ALL OCCURRENCES OF '#' IN lv_xl_sheet_rels WITH lv_syindex. lo_zip->add( name = lv_xl_sheet_rels content = lv_content ). lo_nested_iterator = lo_worksheet->get_tables_iterator( ). WHILE lo_nested_iterator->has_next( ) EQ abap_true. lo_table ?= lo_nested_iterator->get_next( ). lv_content = me->create_xl_table( lo_table ). lv_value = lo_table->get_name( ). CONCATENATE 'xl/tables/' lv_value '.xml' INTO lv_value. lo_zip->add( name = lv_value content = lv_content ). ENDWHILE. * Add drawings ********************************** lo_drawings = lo_worksheet->get_drawings( ). IF lo_drawings->is_empty( ) = abap_false. MOVE lv_drawing_index TO lv_syindex. SHIFT lv_syindex RIGHT DELETING TRAILING space. SHIFT lv_syindex LEFT DELETING LEADING space. lv_content = me->create_xl_drawings( lo_worksheet ). lv_xl_drawing = me->c_xl_drawings. REPLACE ALL OCCURRENCES OF '#' IN lv_xl_drawing WITH lv_syindex. lo_zip->add( name = lv_xl_drawing content = lv_content ). lv_content = me->create_xl_drawings_rels( lo_worksheet ). lv_xl_drawing_rels = me->c_xl_drawings_rels. REPLACE ALL OCCURRENCES OF '#' IN lv_xl_drawing_rels WITH lv_syindex. lo_zip->add( name = lv_xl_drawing_rels content = lv_content ). ADD 1 TO lv_drawing_index. ENDIF. ENDWHILE. ********************************************************************** * STEP 11: Add media lo_iterator = me->excel->get_drawings_iterator( zcl_excel_drawing=>type_image ). WHILE lo_iterator->has_next( ) EQ abap_true. lo_drawing ?= lo_iterator->get_next( ). lv_content = lo_drawing->get_media( ). lv_value = lo_drawing->get_media_name( ). CONCATENATE 'xl/media/' lv_value INTO lv_value. lo_zip->add( name = lv_value content = lv_content ). ENDWHILE. ********************************************************************** * STEP 12: Add charts lo_iterator = me->excel->get_drawings_iterator( zcl_excel_drawing=>type_chart ). WHILE lo_iterator->has_next( ) EQ abap_true. lo_drawing ?= lo_iterator->get_next( ). lv_content = lo_drawing->get_media( ). lv_value = lo_drawing->get_media_name( ). CONCATENATE 'xl/charts/' lv_value INTO lv_value. lo_zip->add( name = lv_value content = lv_content ). ENDWHILE. ********************************************************************** * STEP 9: Add vbaProject.bin to zip lo_zip->add( name = me->c_xl_vbaproject content = me->excel->zif_excel_book_vba_project~vbaproject ). ********************************************************************** * STEP 12: Create the final zip ep_excel = lo_zip->save( ). ENDMETHOD. METHOD create_content_types. ** Constant node name DATA: lc_xml_node_workb_ct TYPE string VALUE 'application/vnd.ms-excel.sheet.macroEnabled.main+xml', lc_xml_node_default TYPE string VALUE 'Default', " Node attributes lc_xml_attr_partname TYPE string VALUE 'PartName', lc_xml_attr_extension TYPE string VALUE 'Extension', lc_xml_attr_contenttype TYPE string VALUE 'ContentType', lc_xml_node_workb_pn TYPE string VALUE '/xl/workbook.xml', lc_xml_node_bin_ext TYPE string VALUE 'bin', lc_xml_node_bin_ct TYPE string VALUE 'application/vnd.ms-office.vbaProject'. DATA: lo_ixml TYPE REF TO if_ixml, lo_document TYPE REF TO if_ixml_document, lo_document_xml TYPE REF TO cl_xml_document, lo_element_root TYPE REF TO if_ixml_node, lo_element TYPE REF TO if_ixml_element, lo_collection TYPE REF TO if_ixml_node_collection, lo_iterator TYPE REF TO if_ixml_node_iterator, lo_streamfactory TYPE REF TO if_ixml_stream_factory, lo_ostream TYPE REF TO if_ixml_ostream, lo_renderer TYPE REF TO if_ixml_renderer. DATA: lv_subrc TYPE sysubrc, lv_contenttype TYPE string. ********************************************************************** * STEP 3: Create standard contentType ep_content = super->create_content_types( ). ********************************************************************** * STEP 2: modify XML adding the extension bin definition CREATE OBJECT lo_document_xml. lv_subrc = lo_document_xml->parse_xstring( ep_content ). lo_document ?= lo_document_xml->m_document. lo_element_root = lo_document->if_ixml_node~get_first_child( ). " extension node lo_element = lo_document->create_simple_element( name = lc_xml_node_default parent = lo_document ). lo_element->set_attribute_ns( name = lc_xml_attr_extension value = lc_xml_node_bin_ext ). lo_element->set_attribute_ns( name = lc_xml_attr_contenttype value = lc_xml_node_bin_ct ). lo_element_root->append_child( new_child = lo_element ). ********************************************************************** * STEP 3: modify XML changing the contentType of node Override /xl/workbook.xml lo_collection = lo_document->get_elements_by_tag_name( 'Override' ). lo_iterator = lo_collection->create_iterator( ). lo_element ?= lo_iterator->get_next( ). WHILE lo_element IS BOUND. lv_contenttype = lo_element->get_attribute_ns( lc_xml_attr_partname ). IF lv_contenttype EQ lc_xml_node_workb_pn. lo_element->remove_attribute_ns( lc_xml_attr_contenttype ). lo_element->set_attribute_ns( name = lc_xml_attr_contenttype value = lc_xml_node_workb_ct ). EXIT. ENDIF. lo_element ?= lo_iterator->get_next( ). ENDWHILE. ********************************************************************** * STEP 3: Create xstring stream CLEAR ep_content. lo_ixml = cl_ixml=>create( ). lo_streamfactory = lo_ixml->create_stream_factory( ). lo_ostream = lo_streamfactory->create_ostream_xstring( string = ep_content ). lo_renderer = lo_ixml->create_renderer( ostream = lo_ostream document = lo_document ). lo_renderer->render( ). ENDMETHOD. METHOD create_xl_relationships. ** Constant node name DATA: lc_xml_node_relationship TYPE string VALUE 'Relationship', " Node attributes lc_xml_attr_id TYPE string VALUE 'Id', lc_xml_attr_type TYPE string VALUE 'Type', lc_xml_attr_target TYPE string VALUE 'Target', " Node id lc_xml_node_ridx_id TYPE string VALUE 'rId#', " Node type lc_xml_node_rid_vba_tp TYPE string VALUE 'http://schemas.microsoft.com/office/2006/relationships/vbaProject', " Node target lc_xml_node_rid_vba_tg TYPE string VALUE 'vbaProject.bin'. DATA: lo_ixml TYPE REF TO if_ixml, lo_document TYPE REF TO if_ixml_document, lo_document_xml TYPE REF TO cl_xml_document, lo_element_root TYPE REF TO if_ixml_node, lo_element TYPE REF TO if_ixml_element, lo_streamfactory TYPE REF TO if_ixml_stream_factory, lo_ostream TYPE REF TO if_ixml_ostream, lo_renderer TYPE REF TO if_ixml_renderer. DATA: lv_xml_node_ridx_id TYPE string, lv_size TYPE i, lv_subrc TYPE sysubrc, lv_syindex(2) TYPE c. ********************************************************************** * STEP 3: Create standard relationship ep_content = super->create_xl_relationships( ). ********************************************************************** * STEP 2: modify XML adding the vbaProject relation CREATE OBJECT lo_document_xml. lv_subrc = lo_document_xml->parse_xstring( ep_content ). lo_document ?= lo_document_xml->m_document. lo_element_root = lo_document->if_ixml_node~get_first_child( ). lv_size = excel->get_worksheets_size( ). " Relationship node lo_element = lo_document->create_simple_element( name = lc_xml_node_relationship parent = lo_document ). ADD 4 TO lv_size. lv_syindex = lv_size. SHIFT lv_syindex RIGHT DELETING TRAILING space. SHIFT lv_syindex LEFT DELETING LEADING space. lv_xml_node_ridx_id = lc_xml_node_ridx_id. REPLACE ALL OCCURRENCES OF '#' IN lv_xml_node_ridx_id WITH lv_syindex. lo_element->set_attribute_ns( name = lc_xml_attr_id value = lv_xml_node_ridx_id ). lo_element->set_attribute_ns( name = lc_xml_attr_type value = lc_xml_node_rid_vba_tp ). lo_element->set_attribute_ns( name = lc_xml_attr_target value = lc_xml_node_rid_vba_tg ). lo_element_root->append_child( new_child = lo_element ). ********************************************************************** * STEP 3: Create xstring stream CLEAR ep_content. lo_ixml = cl_ixml=>create( ). lo_streamfactory = lo_ixml->create_stream_factory( ). lo_ostream = lo_streamfactory->create_ostream_xstring( string = ep_content ). lo_renderer = lo_ixml->create_renderer( ostream = lo_ostream document = lo_document ). lo_renderer->render( ). ENDMETHOD. METHOD create_xl_sheet. ** Constant node name DATA: lc_xml_attr_codename TYPE string VALUE 'codeName'. DATA: lo_ixml TYPE REF TO if_ixml, lo_document TYPE REF TO if_ixml_document, lo_document_xml TYPE REF TO cl_xml_document, lo_element_root TYPE REF TO if_ixml_node, lo_element TYPE REF TO if_ixml_element, lo_collection TYPE REF TO if_ixml_node_collection, lo_iterator TYPE REF TO if_ixml_node_iterator, lo_streamfactory TYPE REF TO if_ixml_stream_factory, lo_ostream TYPE REF TO if_ixml_ostream, lo_renderer TYPE REF TO if_ixml_renderer. DATA: lv_subrc TYPE sysubrc. ********************************************************************** * STEP 3: Create standard relationship ep_content = super->create_xl_sheet( io_worksheet = io_worksheet iv_active = iv_active ). ********************************************************************** * STEP 2: modify XML adding the vbaProject relation CREATE OBJECT lo_document_xml. lv_subrc = lo_document_xml->parse_xstring( ep_content ). lo_document ?= lo_document_xml->m_document. lo_element_root = lo_document->if_ixml_node~get_first_child( ). lo_collection = lo_document->get_elements_by_tag_name( 'sheetPr' ). lo_iterator = lo_collection->create_iterator( ). lo_element ?= lo_iterator->get_next( ). WHILE lo_element IS BOUND. lo_element->set_attribute_ns( name = lc_xml_attr_codename value = io_worksheet->zif_excel_sheet_vba_project~codename_pr ). lo_element ?= lo_iterator->get_next( ). ENDWHILE. ********************************************************************** * STEP 3: Create xstring stream CLEAR ep_content. lo_ixml = cl_ixml=>create( ). lo_streamfactory = lo_ixml->create_stream_factory( ). lo_ostream = lo_streamfactory->create_ostream_xstring( string = ep_content ). lo_renderer = lo_ixml->create_renderer( ostream = lo_ostream document = lo_document ). lo_renderer->render( ). ENDMETHOD. METHOD create_xl_workbook. ** Constant node name DATA: lc_xml_attr_codename TYPE string VALUE 'codeName'. DATA: lo_ixml TYPE REF TO if_ixml, lo_document TYPE REF TO if_ixml_document, lo_document_xml TYPE REF TO cl_xml_document, lo_element_root TYPE REF TO if_ixml_node, lo_element TYPE REF TO if_ixml_element, lo_collection TYPE REF TO if_ixml_node_collection, lo_iterator TYPE REF TO if_ixml_node_iterator, lo_streamfactory TYPE REF TO if_ixml_stream_factory, lo_ostream TYPE REF TO if_ixml_ostream, lo_renderer TYPE REF TO if_ixml_renderer. DATA: lv_subrc TYPE sysubrc. ********************************************************************** * STEP 3: Create standard relationship ep_content = super->create_xl_workbook( ). ********************************************************************** * STEP 2: modify XML adding the vbaProject relation CREATE OBJECT lo_document_xml. lv_subrc = lo_document_xml->parse_xstring( ep_content ). lo_document ?= lo_document_xml->m_document. lo_element_root = lo_document->if_ixml_node~get_first_child( ). lo_collection = lo_document->get_elements_by_tag_name( 'fileVersion' ). lo_iterator = lo_collection->create_iterator( ). lo_element ?= lo_iterator->get_next( ). WHILE lo_element IS BOUND. lo_element->set_attribute_ns( name = lc_xml_attr_codename value = me->excel->zif_excel_book_vba_project~codename ). lo_element ?= lo_iterator->get_next( ). ENDWHILE. lo_collection = lo_document->get_elements_by_tag_name( 'workbookPr' ). lo_iterator = lo_collection->create_iterator( ). lo_element ?= lo_iterator->get_next( ). WHILE lo_element IS BOUND. lo_element->set_attribute_ns( name = lc_xml_attr_codename value = me->excel->zif_excel_book_vba_project~codename_pr ). lo_element ?= lo_iterator->get_next( ). ENDWHILE. ********************************************************************** * STEP 3: Create xstring stream CLEAR ep_content. lo_ixml = cl_ixml=>create( ). lo_streamfactory = lo_ixml->create_stream_factory( ). lo_ostream = lo_streamfactory->create_ostream_xstring( string = ep_content ). lo_renderer = lo_ixml->create_renderer( ostream = lo_ostream document = lo_document ). lo_renderer->render( ). ENDMETHOD. ENDCLASS.
40.655446
121
0.592908
12f8523e64721aff6a39aa3ad122b2aaecc945fc
309
abap
ABAP
src/zabapgittest_tmg.fugr.lzabapgittest_tmgtop.abap
abapGit-tests/FUGR_maintenance_view_variant
49ff9232e65971ec8e5b1b18dcccc4d44fa37a21
[ "MIT" ]
null
null
null
src/zabapgittest_tmg.fugr.lzabapgittest_tmgtop.abap
abapGit-tests/FUGR_maintenance_view_variant
49ff9232e65971ec8e5b1b18dcccc4d44fa37a21
[ "MIT" ]
null
null
null
src/zabapgittest_tmg.fugr.lzabapgittest_tmgtop.abap
abapGit-tests/FUGR_maintenance_view_variant
49ff9232e65971ec8e5b1b18dcccc4d44fa37a21
[ "MIT" ]
null
null
null
* regenerated at 15.05.2019 19:12:53 FUNCTION-POOL ZABAPGITTEST_TMG MESSAGE-ID SV. * INCLUDE LZABAPGITTEST_TMGD... " Local class definition INCLUDE LSVIMDAT . "general data decl. INCLUDE LZABAPGITTEST_TMGT00 . "view rel. data dcl.
44.142857
72
0.588997
12fe87c4d6c8e04cb0de4b2ccc9d4812715d174b
4,032
abap
ABAP
src/zcl_abapgit_res_repo_info_ext.clas.abap
bigld/ADT_Backend
0d44288d55a546feff815e7558f9e0b5dbb71d99
[ "MIT" ]
null
null
null
src/zcl_abapgit_res_repo_info_ext.clas.abap
bigld/ADT_Backend
0d44288d55a546feff815e7558f9e0b5dbb71d99
[ "MIT" ]
null
null
null
src/zcl_abapgit_res_repo_info_ext.clas.abap
bigld/ADT_Backend
0d44288d55a546feff815e7558f9e0b5dbb71d99
[ "MIT" ]
null
null
null
class ZCL_ABAPGIT_RES_REPO_INFO_EXT definition public inheriting from CL_ADT_REST_RESOURCE final create public . public section. types: BEGIN OF ty_request_data, url TYPE string, user TYPE string, password TYPE string, END OF ty_request_data . types: BEGIN OF ty_response_data, access_mode TYPE string, branches TYPE zif_abapgit_definitions=>ty_git_branch_list_tt, END OF ty_response_data . constants CO_CONTENT_TYPE_REQUEST_V1 type STRING value 'application/abapgit.adt.repo.info.ext.request.v1+xml' ##NO_TEXT. constants CO_CONTENT_TYPE_RESPONSE_V1 type STRING value 'application/abapgit.adt.repo.info.ext.response.v1+xml' ##NO_TEXT. constants CO_ROOT_NAME_REQUEST type STRING value 'REPOSITORY_EXTERNAL_REQ' ##NO_TEXT. constants CO_ST_NAME_REQUEST type STRING value 'ZABAPGIT_ST_REPO_INFO_EXT_REQ' ##NO_TEXT. constants CO_ST_NAME_RESPONSE type STRING value 'ZABAPGIT_ST_REPO_INFO_EXT_RES' ##NO_TEXT. constants CO_ROOT_NAME_RESPONSE type STRING value 'REPOSITORY_EXTERNAL' ##NO_TEXT. methods POST redefinition . PROTECTED SECTION. private section. ENDCLASS. CLASS ZCL_ABAPGIT_RES_REPO_INFO_EXT IMPLEMENTATION. METHOD post. DATA: ls_request_data TYPE ty_request_data, ls_response_data TYPE ty_response_data. *** Request Content Handler *** Wrap the request content handler in a cl_adt_rest_comp_cnt_handler in order to ensure that the client sends a correct 'Content-Type:' header DATA(lo_request_content_handler) = cl_adt_rest_comp_cnt_handler=>create( request = request content_handler = cl_adt_rest_cnt_hdl_factory=>get_instance( )->get_handler_for_xml_using_st( st_name = co_st_name_request root_name = co_root_name_request content_type = co_content_type_request_v1 ) ). *** Response Content Handler DATA(lo_response_content_handler) = cl_adt_rest_cnt_hdl_factory=>get_instance( )->get_handler_for_xml_using_st( st_name = co_st_name_response root_name = co_root_name_response content_type = co_content_type_response_v1 ). *** Validation of request 'Accept:' header cl_adt_rest_comp_cnt_handler=>create( request = request content_handler = lo_response_content_handler )->check_cnt_type_is_supported( ). *** Retrieve request data request->get_body_data( EXPORTING content_handler = lo_request_content_handler IMPORTING data = ls_request_data ). TRY. *** Set logon information if supplied IF ls_request_data-user IS NOT INITIAL AND ls_request_data-password IS NOT INITIAL. zcl_abapgit_default_auth_info=>refresh( ). zcl_abapgit_default_auth_info=>set_auth_info( iv_user = ls_request_data-user iv_password = ls_request_data-password ). ENDIF. *** Check whether passed repo URL has public or privated access ls_response_data-access_mode = zcl_abapgit_http=>determine_access_level( ls_request_data-url ). *** Retrieve list of branches for repo IF ls_response_data-access_mode = 'PUBLIC' OR ( ls_response_data-access_mode = 'PRIVATE' AND ls_request_data-user IS NOT INITIAL AND ls_request_data-password IS NOT INITIAL ). DATA(lo_branch_list) = zcl_abapgit_git_transport=>branches( ls_request_data-url ). DATA(lt_branches_input) = lo_branch_list->get_branches_only( ). APPEND LINES OF lt_branches_input TO ls_response_data-branches. ENDIF. *** Prepare Response response->set_body_data( content_handler = lo_response_content_handler data = ls_response_data ). response->set_status( cl_rest_status_code=>gc_success_ok ). CATCH zcx_abapgit_exception INTO DATA(lx_abapgit_exception). zcx_adt_rest_abapgit=>raise_with_error( lx_abapgit_exception ). ENDTRY. ENDMETHOD. ENDCLASS.
39.145631
144
0.722966
4204d247b0276aba49e852bafc8ed04266295c15
4,953
abap
ABAP
src/zcl_abaplint_backend_api_agent.clas.abap
sbcgua/abaplint-sci-client
9f269f4b3d12a7fd3f090bf615ffd2d9e1c371ff
[ "MIT" ]
null
null
null
src/zcl_abaplint_backend_api_agent.clas.abap
sbcgua/abaplint-sci-client
9f269f4b3d12a7fd3f090bf615ffd2d9e1c371ff
[ "MIT" ]
null
null
null
src/zcl_abaplint_backend_api_agent.clas.abap
sbcgua/abaplint-sci-client
9f269f4b3d12a7fd3f090bf615ffd2d9e1c371ff
[ "MIT" ]
null
null
null
CLASS zcl_abaplint_backend_api_agent DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. CLASS-METHODS create IMPORTING !iv_host TYPE zabaplint_glob_data-url RETURNING VALUE(ro_instance) TYPE REF TO zcl_abaplint_backend_api_agent . " TODO query ? " TODO headers ? METHODS request IMPORTING !iv_uri TYPE string !iv_method TYPE string DEFAULT if_http_request=>co_request_method_get !iv_payload TYPE string OPTIONAL RETURNING VALUE(ro_json) TYPE REF TO zif_ajson_reader RAISING zcx_abaplint_error . PROTECTED SECTION. PRIVATE SECTION. DATA mv_host TYPE zabaplint_glob_data-url. METHODS create_client RETURNING VALUE(ri_client) TYPE REF TO if_http_client RAISING zcx_abaplint_error . METHODS parse_response IMPORTING ii_response TYPE REF TO if_http_response RETURNING VALUE(ro_json) TYPE REF TO zif_ajson_reader RAISING zcx_abaplint_error . METHODS send_receive IMPORTING ii_client TYPE REF TO if_http_client RAISING zcx_abaplint_error . ENDCLASS. CLASS ZCL_ABAPLINT_BACKEND_API_AGENT IMPLEMENTATION. METHOD create. CREATE OBJECT ro_instance. ro_instance->mv_host = iv_host. ENDMETHOD. METHOD create_client. cl_http_client=>create_by_url( EXPORTING url = |{ mv_host }| ssl_id = 'ANONYM' IMPORTING client = ri_client EXCEPTIONS argument_not_found = 1 plugin_not_active = 2 internal_error = 3 OTHERS = 4 ). IF sy-subrc <> 0. RAISE EXCEPTION TYPE zcx_abaplint_error EXPORTING message = |Create_client error: sy-subrc={ sy-subrc }, url={ mv_host }|. ENDIF. ENDMETHOD. METHOD parse_response. DATA lv_scode TYPE i. DATA lv_sreason TYPE string. DATA lv_response TYPE string. ii_response->get_status( IMPORTING code = lv_scode reason = lv_sreason ). lv_response = ii_response->get_cdata( ). IF lv_response IS INITIAL. RAISE EXCEPTION TYPE zcx_abaplint_error EXPORTING message = |API request failed [{ lv_scode }]|. ENDIF. DATA li_reader TYPE REF TO zif_ajson_reader. DATA lo_ajson_err TYPE REF TO zcx_ajson_error. TRY. li_reader = zcl_ajson=>parse( lv_response ). CATCH zcx_ajson_error INTO lo_ajson_err. RAISE EXCEPTION TYPE zcx_abaplint_error EXPORTING message = lo_ajson_err->get_text( ). ENDTRY. IF li_reader->exists( '/success' ) = abap_false. RAISE EXCEPTION TYPE zcx_abaplint_error EXPORTING message = |API request failed [{ lv_scode }]: Unexpected API response shape|. ENDIF. IF li_reader->get_integer( '/success' ) <> 1. RAISE EXCEPTION TYPE zcx_abaplint_error EXPORTING message = |API request failed [{ lv_scode }]: { li_reader->get_string( '/error/message' ) }|. ENDIF. IF lv_scode < 200 OR lv_scode >= 300. RAISE EXCEPTION TYPE zcx_abaplint_error EXPORTING message = |API request failed [{ lv_scode }], but API response is OK (?)|. ENDIF. ro_json = li_reader->slice( '/payload' ). ENDMETHOD. METHOD request. DATA li_client TYPE REF TO if_http_client. li_client = create_client( ). cl_http_utility=>set_request_uri( request = li_client->request uri = iv_uri ). li_client->request->set_method( iv_method ). li_client->request->set_compression( ). li_client->request->set_header_field( name = 'content-type' value = 'application/json' ). IF iv_method = 'POST' AND iv_payload IS NOT INITIAL. " OR PUT ... maybe in future li_client->request->set_cdata( iv_payload ). ENDIF. send_receive( li_client ). ro_json = parse_response( li_client->response ). li_client->close( ). ENDMETHOD. METHOD send_receive. ii_client->send( EXPORTING timeout = 6000 EXCEPTIONS http_communication_failure = 1 http_invalid_state = 2 http_processing_failed = 3 http_invalid_timeout = 4 OTHERS = 5 ). IF sy-subrc = 0. ii_client->receive( EXCEPTIONS http_communication_failure = 1 http_invalid_state = 2 http_processing_failed = 3 OTHERS = 4 ). ENDIF. IF sy-subrc <> 0. DATA lv_ecode TYPE i. DATA lv_emessage TYPE string. ii_client->get_last_error( IMPORTING code = lv_ecode message = lv_emessage ). RAISE EXCEPTION TYPE zcx_abaplint_error EXPORTING message = |{ lv_ecode } { lv_emessage }|. ENDIF. ENDMETHOD. ENDCLASS.
25.663212
103
0.625681
42057c3981f3b607411ce9a295a7f0983374dc26
8,231
abap
ABAP
src/ui/zcl_abapgit_gui_page_bkg.clas.abap
sagardarji/abapGit
a1699302a652d304f66e1ecda2f232158dbd879d
[ "MIT" ]
1
2021-01-21T15:34:26.000Z
2021-01-21T15:34:26.000Z
src/ui/zcl_abapgit_gui_page_bkg.clas.abap
sagardarji/abapGit
a1699302a652d304f66e1ecda2f232158dbd879d
[ "MIT" ]
1
2020-01-05T16:45:32.000Z
2020-01-05T16:45:32.000Z
src/ui/zcl_abapgit_gui_page_bkg.clas.abap
sagardarji/abapGit
a1699302a652d304f66e1ecda2f232158dbd879d
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_gui_page_bkg DEFINITION PUBLIC INHERITING FROM zcl_abapgit_gui_page FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES: zif_abapgit_gui_page_hotkey. METHODS constructor IMPORTING iv_key TYPE zif_abapgit_persistence=>ty_repo-key . METHODS zif_abapgit_gui_event_handler~on_event REDEFINITION . PROTECTED SECTION. METHODS read_persist IMPORTING !io_repo TYPE REF TO zcl_abapgit_repo_online RETURNING VALUE(rs_persist) TYPE zcl_abapgit_persist_background=>ty_background RAISING zcx_abapgit_exception . METHODS render_methods IMPORTING !is_per TYPE zcl_abapgit_persist_background=>ty_background RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html . METHODS render_settings IMPORTING !is_per TYPE zcl_abapgit_persist_background=>ty_background RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html . METHODS build_menu RETURNING VALUE(ro_menu) TYPE REF TO zcl_abapgit_html_toolbar . CLASS-METHODS update IMPORTING !is_bg_task TYPE zcl_abapgit_persist_background=>ty_background RAISING zcx_abapgit_exception . METHODS render RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html RAISING zcx_abapgit_exception . METHODS decode IMPORTING !iv_getdata TYPE clike RETURNING VALUE(rs_fields) TYPE zcl_abapgit_persist_background=>ty_background . METHODS render_content REDEFINITION . PRIVATE SECTION. DATA mv_key TYPE zif_abapgit_persistence=>ty_repo-key . ENDCLASS. CLASS ZCL_ABAPGIT_GUI_PAGE_BKG IMPLEMENTATION. METHOD build_menu. CREATE OBJECT ro_menu. ro_menu->add( iv_txt = 'Run background logic' iv_act = zif_abapgit_definitions=>c_action-go_background_run ) ##NO_TEXT. ENDMETHOD. METHOD constructor. super->constructor( ). mv_key = iv_key. ms_control-page_title = 'BACKGROUND'. ms_control-page_menu = build_menu( ). ENDMETHOD. METHOD decode. DATA: lt_fields TYPE tihttpnvp. FIELD-SYMBOLS: <ls_setting> LIKE LINE OF rs_fields-settings. rs_fields-key = mv_key. lt_fields = zcl_abapgit_html_action_utils=>parse_fields_upper_case_name( iv_getdata ). zcl_abapgit_html_action_utils=>get_field( EXPORTING iv_name = 'METHOD' it_field = lt_fields CHANGING cg_field = rs_fields ). IF rs_fields-method IS INITIAL. RETURN. ENDIF. zcl_abapgit_html_action_utils=>get_field( EXPORTING iv_name = 'USERNAME' it_field = lt_fields CHANGING cg_field = rs_fields ). zcl_abapgit_html_action_utils=>get_field( EXPORTING iv_name = 'PASSWORD' it_field = lt_fields CHANGING cg_field = rs_fields ). CALL METHOD (rs_fields-method)=>zif_abapgit_background~get_settings CHANGING ct_settings = rs_fields-settings. LOOP AT rs_fields-settings ASSIGNING <ls_setting>. zcl_abapgit_html_action_utils=>get_field( EXPORTING iv_name = <ls_setting>-key it_field = lt_fields CHANGING cg_field = <ls_setting>-value ). ENDLOOP. ASSERT NOT rs_fields IS INITIAL. ENDMETHOD. METHOD read_persist. DATA: lo_per TYPE REF TO zcl_abapgit_persist_background, lt_per TYPE zcl_abapgit_persist_background=>tt_background. CREATE OBJECT lo_per. lt_per = lo_per->list( ). READ TABLE lt_per INTO rs_persist WITH KEY key = io_repo->get_key( ). IF sy-subrc <> 0. CLEAR rs_persist. ENDIF. ENDMETHOD. METHOD render. DATA: lo_repo TYPE REF TO zcl_abapgit_repo_online, ls_per TYPE zcl_abapgit_persist_background=>ty_background. lo_repo ?= zcl_abapgit_repo_srv=>get_instance( )->get( mv_key ). ls_per = read_persist( lo_repo ). CREATE OBJECT ro_html. ro_html->add( '<div id="toc">' ). ro_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top( lo_repo ) ). ro_html->add( '<br>' ). ro_html->add( render_methods( ls_per ) ). ro_html->add( '<u>HTTP Authentication, optional</u><br>' ) ##NO_TEXT. ro_html->add( '(password will be saved in clear text)<br>' ) ##NO_TEXT. ro_html->add( '<table>' ). ro_html->add( '<tr>' ). ro_html->add( '<td>Username:</td>' ). ro_html->add( '<td><input type="text" name="username" value="' && ls_per-username && '"></td>' ). ro_html->add( '</tr>' ). ro_html->add( '<tr>' ). ro_html->add( '<td>Password:</td>' ). ro_html->add( '<td><input type="text" name="password" value="' && ls_per-password && '"></td>' ). ro_html->add( '</tr>' ). ro_html->add( '</table>' ). ro_html->add( '<br>' ). ro_html->add( render_settings( ls_per ) ). ro_html->add( '<br>' ). ro_html->add( '<input type="submit" value="Save">' ). ro_html->add( '</form>' ). ro_html->add( '<br>' ). ro_html->add( '</div>' ). ENDMETHOD. METHOD render_content. CREATE OBJECT ro_html. ro_html->add( render( ) ). ENDMETHOD. METHOD render_methods. DATA: lt_methods TYPE zcl_abapgit_background=>ty_methods_tt, ls_method LIKE LINE OF lt_methods, lv_checked TYPE string. CREATE OBJECT ro_html. lt_methods = zcl_abapgit_background=>list_methods( ). ro_html->add( '<u>Method</u><br>' ) ##NO_TEXT. ro_html->add( |<form method="get" action="sapevent:{ zif_abapgit_definitions=>c_action-bg_update }">| ). IF is_per-method IS INITIAL. lv_checked = ' checked' ##NO_TEXT. ENDIF. ro_html->add( '<input type="radio" name="method" value=""' && lv_checked && '>Do nothing<br>' ) ##NO_TEXT. LOOP AT lt_methods INTO ls_method. CLEAR lv_checked. IF is_per-method = ls_method-class. lv_checked = ' checked' ##NO_TEXT. ENDIF. ro_html->add( '<input type="radio" name="method" value="' && ls_method-class && '"' && lv_checked && '>' && ls_method-description && '<br>' ) ##NO_TEXT. ENDLOOP. ro_html->add( '<br>' ). ENDMETHOD. METHOD render_settings. DATA: lt_settings LIKE is_per-settings, ls_setting LIKE LINE OF lt_settings. CREATE OBJECT ro_html. IF is_per-method IS INITIAL. RETURN. ENDIF. lt_settings = is_per-settings. * skip invalid values, from old background logic IF is_per-method <> 'push' AND is_per-method <> 'pull' AND is_per-method <> 'nothing'. CALL METHOD (is_per-method)=>zif_abapgit_background~get_settings CHANGING ct_settings = lt_settings. ENDIF. IF lines( lt_settings ) = 0. RETURN. ENDIF. ro_html->add( '<table>' ). LOOP AT lt_settings INTO ls_setting. ro_html->add( '<tr>' ). ro_html->add( '<td>' && ls_setting-key && ':</td>' ). ro_html->add( '<td><input type="text" name="' && ls_setting-key && '" value="' && ls_setting-value && '"></td>' ). ro_html->add( '</tr>' ). ENDLOOP. ro_html->add( '</table>' ). ENDMETHOD. METHOD update. DATA lo_persistence TYPE REF TO zcl_abapgit_persist_background. CREATE OBJECT lo_persistence. IF is_bg_task-method IS INITIAL. lo_persistence->delete( is_bg_task-key ). ELSE. lo_persistence->modify( is_bg_task ). ENDIF. MESSAGE 'Saved' TYPE 'S' ##NO_TEXT. COMMIT WORK. ENDMETHOD. METHOD zif_abapgit_gui_event_handler~on_event. CASE iv_action. WHEN zif_abapgit_definitions=>c_action-bg_update. update( decode( iv_getdata ) ). ev_state = zcl_abapgit_gui=>c_event_state-re_render. WHEN OTHERS. super->zif_abapgit_gui_event_handler~on_event( EXPORTING iv_action = iv_action iv_prev_page = iv_prev_page iv_getdata = iv_getdata it_postdata = it_postdata IMPORTING ei_page = ei_page ev_state = ev_state ). ENDCASE. ENDMETHOD. METHOD zif_abapgit_gui_page_hotkey~get_hotkey_actions. ENDMETHOD. ENDCLASS.
24.717718
110
0.642328
42072f1230bd49ee24c1fcbf344fceabe60e0f80
8,019
abap
ABAP
lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zcl_gtt_mia_ef_performer.clas.abap
SAP-samples/logistics-business-network-gtt-standardapps-samples
eea4aae1bb74112a3a34f14c6f94f496ca708ea3
[ "Apache-2.0" ]
3
2021-07-08T07:16:53.000Z
2021-10-18T07:56:18.000Z
lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zcl_gtt_mia_ef_performer.clas.abap
SAP-samples/logistics-business-network-gtt-standardapps-samples
eea4aae1bb74112a3a34f14c6f94f496ca708ea3
[ "Apache-2.0" ]
null
null
null
lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zcl_gtt_mia_ef_performer.clas.abap
SAP-samples/logistics-business-network-gtt-standardapps-samples
eea4aae1bb74112a3a34f14c6f94f496ca708ea3
[ "Apache-2.0" ]
7
2021-06-03T09:47:37.000Z
2022-03-25T12:20:07.000Z
CLASS zcl_gtt_mia_ef_performer DEFINITION PUBLIC CREATE PUBLIC . PUBLIC SECTION. CLASS-METHODS check_relevance IMPORTING !is_definition TYPE zif_gtt_mia_ef_types=>ts_definition !io_tp_factory TYPE REF TO zif_gtt_mia_tp_factory !iv_appsys TYPE /saptrx/applsystem !is_app_obj_types TYPE /saptrx/aotypes !it_all_appl_tables TYPE trxas_tabcontainer !it_app_type_cntl_tabs TYPE trxas_apptype_tabs OPTIONAL !it_app_objects TYPE trxas_appobj_ctabs RETURNING VALUE(rv_result) TYPE sy-binpt RAISING cx_udm_message . CLASS-METHODS get_app_obj_type_id IMPORTING !is_definition TYPE zif_gtt_mia_ef_types=>ts_definition !io_tp_factory TYPE REF TO zif_gtt_mia_tp_factory !iv_appsys TYPE /saptrx/applsystem !is_app_obj_types TYPE /saptrx/aotypes !it_all_appl_tables TYPE trxas_tabcontainer !it_app_type_cntl_tabs TYPE trxas_apptype_tabs OPTIONAL !it_app_objects TYPE trxas_appobj_ctabs RETURNING VALUE(rv_appobjid) TYPE /saptrx/aoid RAISING cx_udm_message . CLASS-METHODS get_control_data IMPORTING !is_definition TYPE zif_gtt_mia_ef_types=>ts_definition !io_tp_factory TYPE REF TO zif_gtt_mia_tp_factory !iv_appsys TYPE /saptrx/applsystem !is_app_obj_types TYPE /saptrx/aotypes !it_all_appl_tables TYPE trxas_tabcontainer !it_app_type_cntl_tabs TYPE trxas_apptype_tabs !it_app_objects TYPE trxas_appobj_ctabs CHANGING !ct_control_data TYPE zif_gtt_mia_ef_types=>tt_control_data RAISING cx_udm_message . CLASS-METHODS get_planned_events IMPORTING !is_definition TYPE zif_gtt_mia_ef_types=>ts_definition !io_tp_factory TYPE REF TO zif_gtt_mia_tp_factory !iv_appsys TYPE /saptrx/applsystem !is_app_obj_types TYPE /saptrx/aotypes !it_all_appl_tables TYPE trxas_tabcontainer !it_app_type_cntl_tabs TYPE trxas_apptype_tabs !it_app_objects TYPE trxas_appobj_ctabs CHANGING !ct_expeventdata TYPE zif_gtt_mia_ef_types=>tt_expeventdata !ct_measrmntdata TYPE zif_gtt_mia_ef_types=>tt_measrmntdata !ct_infodata TYPE zif_gtt_mia_ef_types=>tt_infodata RAISING cx_udm_message . CLASS-METHODS get_track_id_data IMPORTING !is_definition TYPE zif_gtt_mia_ef_types=>ts_definition !io_tp_factory TYPE REF TO zif_gtt_mia_tp_factory !iv_appsys TYPE /saptrx/applsystem !is_app_obj_types TYPE /saptrx/aotypes !it_all_appl_tables TYPE trxas_tabcontainer !it_app_type_cntl_tabs TYPE trxas_apptype_tabs !it_app_objects TYPE trxas_appobj_ctabs EXPORTING !et_track_id_data TYPE zif_gtt_mia_ef_types=>tt_track_id_data RAISING cx_udm_message . PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS zcl_gtt_mia_ef_performer IMPLEMENTATION. METHOD check_relevance. DATA: lo_ef_processor TYPE REF TO zif_gtt_mia_ef_processor. " get instance of extractor function processor lo_ef_processor = io_tp_factory->get_ef_processor( is_definition = is_definition io_bo_factory = io_tp_factory iv_appsys = iv_appsys is_app_obj_types = is_app_obj_types it_all_appl_tables = it_all_appl_tables it_app_type_cntl_tabs = it_app_type_cntl_tabs it_app_objects = it_app_objects ). " check i_app_objects : is maintabdef correct? lo_ef_processor->check_app_objects( ). " check relevance rv_result = lo_ef_processor->check_relevance( ). ENDMETHOD. METHOD get_app_obj_type_id. DATA: lo_ef_processor TYPE REF TO zif_gtt_mia_ef_processor. " get instance of extractor function processor lo_ef_processor = io_tp_factory->get_ef_processor( is_definition = is_definition io_bo_factory = io_tp_factory iv_appsys = iv_appsys is_app_obj_types = is_app_obj_types it_all_appl_tables = it_all_appl_tables it_app_type_cntl_tabs = it_app_type_cntl_tabs it_app_objects = it_app_objects ). " check i_app_objects : is maintabdef correct? lo_ef_processor->check_app_objects( ). " fill control data from business object data rv_appobjid = lo_ef_processor->get_app_obj_type_id( ). ENDMETHOD. METHOD get_control_data. DATA: lo_ef_processor TYPE REF TO zif_gtt_mia_ef_processor. " get instance of extractor function processor lo_ef_processor = io_tp_factory->get_ef_processor( is_definition = is_definition io_bo_factory = io_tp_factory iv_appsys = iv_appsys is_app_obj_types = is_app_obj_types it_all_appl_tables = it_all_appl_tables it_app_type_cntl_tabs = it_app_type_cntl_tabs it_app_objects = it_app_objects ). " check i_app_objects : is maintabdef correct? lo_ef_processor->check_app_objects( ). " fill control data from business object data lo_ef_processor->get_control_data( CHANGING ct_control_data = ct_control_data[] ). ENDMETHOD. METHOD get_planned_events. DATA: lo_ef_processor TYPE REF TO zif_gtt_mia_ef_processor. " get instance of extractor function processor lo_ef_processor = io_tp_factory->get_ef_processor( is_definition = is_definition io_bo_factory = io_tp_factory iv_appsys = iv_appsys is_app_obj_types = is_app_obj_types it_all_appl_tables = it_all_appl_tables it_app_type_cntl_tabs = it_app_type_cntl_tabs it_app_objects = it_app_objects ). " check i_app_objects : is maintabdef correct? lo_ef_processor->check_app_objects( ). " fill planned events data lo_ef_processor->get_planned_events( CHANGING ct_expeventdata = ct_expeventdata ct_measrmntdata = ct_measrmntdata ct_infodata = ct_infodata ). ENDMETHOD. METHOD get_track_id_data. DATA: lo_ef_processor TYPE REF TO zif_gtt_mia_ef_processor. CLEAR: et_track_id_data[]. " get instance of extractor function processor lo_ef_processor = io_tp_factory->get_ef_processor( is_definition = is_definition io_bo_factory = io_tp_factory iv_appsys = iv_appsys is_app_obj_types = is_app_obj_types it_all_appl_tables = it_all_appl_tables it_app_type_cntl_tabs = it_app_type_cntl_tabs it_app_objects = it_app_objects ). " check i_app_objects : is maintabdef correct? lo_ef_processor->check_app_objects( ). " fill controll data from PO Header data lo_ef_processor->get_track_id_data( IMPORTING et_track_id_data = et_track_id_data ). ENDMETHOD. ENDCLASS.
37.647887
74
0.615788
42076f73bb189a1f9ee1b8a4259ad2066110df27
1,441
abap
ABAP
src/zcl_abapgit_user_exit.clas.abap
AndreaBorgia-Abo/abapGit-user-exit-logon-by-rfc
f2c2319827765921e4e430a42edfcb2b59850441
[ "MIT" ]
null
null
null
src/zcl_abapgit_user_exit.clas.abap
AndreaBorgia-Abo/abapGit-user-exit-logon-by-rfc
f2c2319827765921e4e430a42edfcb2b59850441
[ "MIT" ]
null
null
null
src/zcl_abapgit_user_exit.clas.abap
AndreaBorgia-Abo/abapGit-user-exit-logon-by-rfc
f2c2319827765921e4e430a42edfcb2b59850441
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_user_exit DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES zif_abapgit_exit. ENDCLASS. CLASS zcl_abapgit_user_exit IMPLEMENTATION. METHOD zif_abapgit_exit~allow_sap_objects. ENDMETHOD. METHOD zif_abapgit_exit~change_local_host. ENDMETHOD. METHOD zif_abapgit_exit~change_proxy_authentication. ENDMETHOD. METHOD zif_abapgit_exit~change_proxy_port. ENDMETHOD. METHOD zif_abapgit_exit~change_proxy_url. ENDMETHOD. METHOD zif_abapgit_exit~change_tadir. ENDMETHOD. METHOD zif_abapgit_exit~create_http_client. DATA(lv_host) = zcl_abapgit_url=>host( iv_url ). DATA(lv_destination) = COND rfcdest( WHEN lv_host CS 'gitlab' THEN |GITLAB| WHEN lv_host CS 'github' THEN |GITHUB| ). IF lv_destination IS INITIAL. RETURN. ENDIF. cl_http_client=>create_by_destination( EXPORTING destination = lv_destination IMPORTING client = ri_client EXCEPTIONS argument_not_found = 1 destination_not_found = 2 destination_no_authority = 3 plugin_not_active = 4 internal_error = 5 OTHERS = 6 ). IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDMETHOD. METHOD zif_abapgit_exit~http_client. ENDMETHOD. ENDCLASS.
20.295775
82
0.659958
421358c313d3943b7cad3866f7f9695534e8bc89
1,819
abap
ABAP
src/fcat/zdemo_ain_cl35.prog.abap
fidley/ALVGridInNutschell
d3c95d7f31afbff001fff50edae0c2e09e51fe90
[ "Apache-2.0" ]
5
2019-07-08T11:40:25.000Z
2021-10-02T12:26:06.000Z
src/fcat/zdemo_ain_cl35.prog.abap
fidley/ALVGridInNutschell
d3c95d7f31afbff001fff50edae0c2e09e51fe90
[ "Apache-2.0" ]
null
null
null
src/fcat/zdemo_ain_cl35.prog.abap
fidley/ALVGridInNutschell
d3c95d7f31afbff001fff50edae0c2e09e51fe90
[ "Apache-2.0" ]
4
2020-03-21T12:44:33.000Z
2021-09-27T08:43:38.000Z
*&---------------------------------------------------------------------* *& Report zdemo_ain_cl35 *&---------------------------------------------------------------------* *& This is the demo program written for book: *& ALV grid in nutshell by Łukasz Pęgiel *&---------------------------------------------------------------------* REPORT zdemo_ain_cl35. INCLUDE zdemo_ain_include_screen. PARAMETERS: p_rollnm TYPE lvc_s_fcat-rollname default 'S_CONN_ID'. START-OF-SELECTION. SELECT * UP TO 50 ROWS FROM spfli INTO TABLE @DATA(flights). DATA(grid) = NEW cl_gui_alv_grid( i_parent = NEW cl_gui_custom_container( container_name = 'CC' ) ). DATA(fcat) = VALUE lvc_t_fcat( ( fieldname = 'CARRID' ) ( fieldname = 'CONNID' rollname = p_rollnm ) ( fieldname = 'COUNTRYFR' ) ( fieldname = 'CITYFROM' ) ( fieldname = 'AIRPFROM' ) ( fieldname = 'COUNTRYTO' ) ( fieldname = 'CITYTO' ) ( fieldname = 'FLTIME' ) ( fieldname = 'DEPTIME' ) ( fieldname = 'FLTYPE' ) ). grid->set_table_for_first_display( EXPORTING is_layout = VALUE #( col_opt = abap_true ) CHANGING it_fieldcatalog = fcat it_outtab = flights EXCEPTIONS invalid_parameter_combination = 1 program_error = 2 too_many_lines = 3 OTHERS = 4 ). IF sy-subrc EQ 0. CALL SCREEN 0100. ENDIF.
37.895833
83
0.411765
4214c15a9af48dd86d2b4209cab3368a8e5f4095
3,742
abap
ABAP
src/ztest_excel_image_header.prog.abap
AndreaBorgia-Abo/demos
2f89e63babc3590ea44773873b7b78db549f4c7b
[ "MIT" ]
4
2022-03-06T12:05:48.000Z
2022-03-11T13:46:58.000Z
src/ztest_excel_image_header.prog.abap
AndreaBorgia-Abo/demos
2f89e63babc3590ea44773873b7b78db549f4c7b
[ "MIT" ]
2
2022-03-26T11:49:46.000Z
2022-03-27T11:49:30.000Z
src/ztest_excel_image_header.prog.abap
AndreaBorgia-Abo/demos
2f89e63babc3590ea44773873b7b78db549f4c7b
[ "MIT" ]
1
2022-03-12T11:50:30.000Z
2022-03-12T11:50:30.000Z
*&---------------------------------------------------------------------* *& Report ZTEST_EXCEL_IMAGE_HEADER *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT ztest_excel_image_header. DATA: lo_excel TYPE REF TO zcl_excel, lo_worksheet TYPE REF TO zcl_excel_worksheet, lo_drawing TYPE REF TO zcl_excel_drawing, ls_key TYPE wwwdatatab, ls_header TYPE zexcel_s_worksheet_head_foot, ls_footer TYPE zexcel_s_worksheet_head_foot, lv_content TYPE xstring. DATA: ls_io TYPE skwf_io. CONSTANTS: gc_save_file_name TYPE string VALUE 'Image_Header_Footer.xlsx'. INCLUDE zdemo_excel_outputopt_incl. START-OF-SELECTION. " Creates active sheet CREATE OBJECT lo_excel. ********************************************************************** *** Header Center " create global drawing, set position and media from web repository lo_drawing = lo_excel->add_new_drawing( ip_type = zcl_excel_drawing=>type_image_header_footer ). ls_key-relid = 'MI'. ls_key-objid = 'SAPLOGO.GIF'. lo_drawing->set_media_www( ip_key = ls_key ip_width = 166 ip_height = 75 ). ********************************************************************** ls_header-center_image = lo_drawing. ********************************************************************** *** Header Left " create global drawing, set position and media from web repository lo_drawing = lo_excel->add_new_drawing( ip_type = zcl_excel_drawing=>type_image_header_footer ). ls_key-relid = 'MI'. ls_key-objid = 'SAPLOGO.GIF'. lo_drawing->set_media_www( ip_key = ls_key ip_width = 166 ip_height = 75 ). ls_header-left_image = ls_footer-left_image = lo_drawing. ls_header-left_value = 'Hallo'. lo_worksheet = lo_excel->get_active_worksheet( ). lo_worksheet->sheet_setup->set_header_footer( ip_odd_header = ls_header ip_odd_footer = ls_footer ). ********************************************************************** *** Normal Image " create global drawing, set position and media from web repository lo_drawing = lo_excel->add_new_drawing( ). lo_drawing->set_position( ip_from_row = 3 ip_from_col = 'B' ). ls_key-relid = 'MI'. ls_key-objid = 'SAPLOGO.GIF'. lo_drawing->set_media_www( ip_key = ls_key ip_width = 166 ip_height = 75 ). " assign drawing to the worksheet lo_worksheet->add_drawing( lo_drawing ). ********************************************************************** ********************************************************************** * New sheet lo_worksheet = lo_excel->add_new_worksheet( 'Sheet2' ). " Add some content otherwise the error "nothing to be printed" is shown lo_worksheet->set_cell( ip_column = 'B' ip_row = 3 ip_value = 'Hello world' ). ********************************************************************** *** Header Left " create global drawing, set position and media from web repository lo_drawing = lo_excel->add_new_drawing( ip_type = zcl_excel_drawing=>type_image_header_footer ). ls_key-relid = 'MI'. ls_key-objid = 'SAPLOGO.GIF'. lo_drawing->set_media_www( ip_key = ls_key ip_width = 166 ip_height = 75 ). CLEAR ls_header. ls_header-left_image = ls_footer-left_image = lo_drawing. lo_worksheet->sheet_setup->set_header_footer( ip_odd_header = ls_header ). *** Create output lcl_output=>output( lo_excel ).
34.971963
98
0.539284
421874b05d8f6a585d33c5b5f263bf122d0f1503
60
abap
ABAP
kapitel_21/zbook_http.fugr.lzbook_httptop.abap
abapkochbuch/Sources
159775b787fcbc4c6b7eff01e505144b7c33a437
[ "MIT" ]
12
2018-06-22T10:55:06.000Z
2022-03-22T12:10:48.000Z
kapitel_21/zbook_http.fugr.lzbook_httptop.abap
abapkochbuch/Sources
159775b787fcbc4c6b7eff01e505144b7c33a437
[ "MIT" ]
5
2018-06-25T11:45:26.000Z
2019-09-04T19:41:55.000Z
kapitel_21/zbook_http.fugr.lzbook_httptop.abap
abapkochbuch/Sources
159775b787fcbc4c6b7eff01e505144b7c33a437
[ "MIT" ]
7
2018-07-02T14:20:28.000Z
2022-03-25T19:33:33.000Z
FUNCTION-POOL ZBOOK_HTTP. "MESSAGE-ID ..
20
58
0.516667
421dfd2522aee59c66569e703067748f775207f9
3,775
abap
ABAP
src/ycl_ticksys_jira_gtrttc.clas.abap
keremkoseoglu/ticksys
95fd5453a037716eb1bd33633950e4f4b1e8d677
[ "Apache-2.0" ]
4
2020-11-12T07:33:43.000Z
2022-02-15T18:04:29.000Z
src/ycl_ticksys_jira_gtrttc.clas.abap
keremkoseoglu/ticksys
95fd5453a037716eb1bd33633950e4f4b1e8d677
[ "Apache-2.0" ]
8
2020-11-03T08:13:48.000Z
2022-01-17T07:50:51.000Z
src/ycl_ticksys_jira_gtrttc.clas.abap
keremkoseoglu/ticksys
95fd5453a037716eb1bd33633950e4f4b1e8d677
[ "Apache-2.0" ]
3
2020-11-30T06:14:17.000Z
2021-09-11T18:01:30.000Z
CLASS ycl_ticksys_jira_gtrttc DEFINITION PUBLIC FINAL CREATE PRIVATE . PUBLIC SECTION. CLASS-METHODS get_instance RETURNING VALUE(result) TYPE REF TO ycl_ticksys_jira_gtrttc raising ycx_addict_table_content. METHODS execute IMPORTING !tcodes TYPE yif_addict_ticketing_system=>tcode_list RETURNING VALUE(tickets) TYPE yif_addict_ticketing_system=>ticket_id_list RAISING ycx_addict_ticketing_system. PROTECTED SECTION. PRIVATE SECTION. TYPES: BEGIN OF tcode_ticket_dict, tcode TYPE tcode, tickets TYPE yif_addict_ticketing_system=>ticket_id_list, END OF tcode_ticket_dict, tcode_ticket_set TYPE HASHED TABLE OF tcode_ticket_dict WITH UNIQUE KEY primary_key COMPONENTS tcode. CLASS-DATA singleton TYPE REF TO ycl_ticksys_jira_gtrttc. DATA defs TYPE REF TO ycl_ticksys_jira_def. DATA reader TYPE REF TO ycl_ticksys_jira_reader. DATA tcode_ticket_cache TYPE tcode_ticket_set. methods constructor raising ycx_addict_table_content. ENDCLASS. CLASS ycl_ticksys_jira_gtrttc IMPLEMENTATION. METHOD get_instance. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Singleton """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" result = ycl_ticksys_jira_gtrttc=>singleton. IF result IS INITIAL. result = NEW #( ). ENDIF. ENDMETHOD. method execute. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Returns a list of tickets related to the given TCodes """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" TRY. LOOP AT tcodes ASSIGNING FIELD-SYMBOL(<tcode>). ASSIGN me->tcode_ticket_cache[ KEY primary_key COMPONENTS tcode = <tcode> ] TO FIELD-SYMBOL(<cache>). IF sy-subrc <> 0. DATA(new_cache) = VALUE tcode_ticket_dict( tcode = <tcode> ). LOOP AT me->defs->tcode_fields ASSIGNING FIELD-SYMBOL(<tcode_field>). DATA(jql_field) = <tcode_field>. IF jql_field CS 'customfield_'. DATA(split1) = ||. DATA(split2) = ||. SPLIT jql_field AT '_' INTO split1 split2. jql_field = |cf[{ split2 }]|. ENDIF. DATA(results) = me->reader->search_issues( |{ jql_field }={ <tcode> }| ). ENDLOOP. APPEND LINES OF VALUE yif_addict_ticketing_system=>ticket_id_list( FOR GROUPS _grp OF _result IN results WHERE ( parent IN me->reader->issue_key_parent_rng AND name = 'key' ) GROUP BY _result-value ( CONV #( _grp ) ) ) TO new_cache-tickets. INSERT new_cache INTO TABLE me->tcode_ticket_cache ASSIGNING <cache>. ENDIF. APPEND LINES OF <cache>-tickets TO tickets. ENDLOOP. SORT tickets. DELETE ADJACENT DUPLICATES FROM tickets. CATCH ycx_ticksys_ticketing_system INTO DATA(ts_error). RAISE EXCEPTION ts_error. CATCH cx_root INTO DATA(diaper). RAISE EXCEPTION TYPE ycx_ticksys_ticketing_system EXPORTING previous = diaper. ENDTRY. endmethod. method constructor. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Object creation """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" me->defs = ycl_ticksys_jira_def=>get_instance( ). me->reader = ycl_ticksys_jira_reader=>get_instance( ). endmethod. ENDCLASS.
34.318182
90
0.548609
42203cbccf3be0ecc9cc86ac94c9b1d930e89733
942
abap
ABAP
src/legacy/#dmo#flight_travel_api.fugr.#dmo#saplflight_travel_api.abap
saif4hana/abap-platform-refscen-flight
9332aaf1a68d65bdfa3d62a3cb7404adc48d59ab
[ "BSD-Source-Code" ]
null
null
null
src/legacy/#dmo#flight_travel_api.fugr.#dmo#saplflight_travel_api.abap
saif4hana/abap-platform-refscen-flight
9332aaf1a68d65bdfa3d62a3cb7404adc48d59ab
[ "BSD-Source-Code" ]
null
null
null
src/legacy/#dmo#flight_travel_api.fugr.#dmo#saplflight_travel_api.abap
saif4hana/abap-platform-refscen-flight
9332aaf1a68d65bdfa3d62a3cb7404adc48d59ab
[ "BSD-Source-Code" ]
null
null
null
******************************************************************* * System-defined Include-files. * ******************************************************************* INCLUDE /DMO/LFLIGHT_TRAVEL_APITOP. " Global Declarations INCLUDE /DMO/LFLIGHT_TRAVEL_APIUXX. " Function Modules ******************************************************************* * User-defined Include-files (if necessary). * ******************************************************************* * INCLUDE /DMO/LFLIGHT_TRAVEL_APIF... " Subroutines * INCLUDE /DMO/LFLIGHT_TRAVEL_APIO... " PBO-Modules * INCLUDE /DMO/LFLIGHT_TRAVEL_APII... " PAI-Modules * INCLUDE /DMO/LFLIGHT_TRAVEL_APIE... " Events * INCLUDE /DMO/LFLIGHT_TRAVEL_APIP... " Local class implement. * INCLUDE /DMO/LFLIGHT_TRAVEL_APIT99. " ABAP Unit tests *INCLUDE /dmo/lflight_travel_apit99.
52.333333
69
0.456476
42216492a9183c57faf69b3149098c829cb89bb4
2,302
abap
ABAP
src/zcl_ca_gw_openapi_meta_base.clas.abap
irodrigob/Gateway-OpenAPI
dee5ffbe2ebf0cb5fd0337341517853b6c6cc3b9
[ "MIT" ]
null
null
null
src/zcl_ca_gw_openapi_meta_base.clas.abap
irodrigob/Gateway-OpenAPI
dee5ffbe2ebf0cb5fd0337341517853b6c6cc3b9
[ "MIT" ]
null
null
null
src/zcl_ca_gw_openapi_meta_base.clas.abap
irodrigob/Gateway-OpenAPI
dee5ffbe2ebf0cb5fd0337341517853b6c6cc3b9
[ "MIT" ]
null
null
null
CLASS zcl_ca_gw_openapi_meta_base DEFINITION PUBLIC CREATE PROTECTED . PUBLIC SECTION. PROTECTED SECTION. * DATA mv_repository TYPE /iwbep/v4_med_repository_id . * DATA mv_group_id TYPE /iwbep/v4_med_group_id . DATA mv_external_service TYPE /iwfnd/med_mdl_service_grp_id . DATA mv_version TYPE /iwfnd/med_mdl_version . DATA mv_base_url TYPE string . DATA mv_scheme TYPE string . DATA mv_host TYPE string . DATA mv_path TYPE string . DATA mv_description TYPE string . METHODS convert_odatav2_to_odatav4 IMPORTING !iv_metadata_v2 TYPE xstring RETURNING VALUE(rv_metadata_v4) TYPE xstring . METHODS convert_odatav4_to_json IMPORTING !iv_metadata_v4 TYPE xstring RETURNING VALUE(rv_json) TYPE xstring . PRIVATE SECTION. ENDCLASS. CLASS zcl_ca_gw_openapi_meta_base IMPLEMENTATION. METHOD convert_odatav2_to_odatav4. * Convert OData V2 to V4 metadata document CALL TRANSFORMATION zca_gw_odatav2_to_v4 SOURCE XML iv_metadata_v2 RESULT XML rv_metadata_v4. ENDMETHOD. METHOD convert_odatav4_to_json. DATA: lt_parameters TYPE abap_trans_parmbind_tab. * Set transformation parameters DATA(lv_version) = me->mv_version. SHIFT lv_version LEFT DELETING LEADING '0'. lv_version = 'V' && lv_version. lt_parameters = VALUE #( ( name = 'openapi-version' value = '3.0.0' ) ( name = 'odata-version' value = '4.0' ) ( name = 'scheme' value = me->mv_scheme ) ( name = 'host' value = me->mv_host ) ( name = 'basePath' value = '/' && me->mv_path ) ( name = 'info-version' value = lv_version ) ( name = 'info-title' value = me->mv_external_service ) ( name = 'info-description' value = me->mv_description ) ( name = 'references' value = 'YES' ) ( name = 'diagram' value = 'YES' ) ). * Convert metadata document to openapi CALL TRANSFORMATION zca_gw_odatav4_to_openapi SOURCE XML iv_metadata_v4 RESULT XML rv_json PARAMETERS (lt_parameters). ENDMETHOD. ENDCLASS.
31.108108
85
0.626846
4221699866a68ac4e3657760f27994e4f5b0f6c0
1,666
abap
ABAP
src/main/mse/z2mse_output_model.clas.abap
sabatale/SAP2Moose
59553fab013de732e2b7c9e67b6a4de799617b6a
[ "MIT" ]
25
2017-09-05T12:57:46.000Z
2021-12-18T21:47:13.000Z
src/main/mse/z2mse_output_model.clas.abap
sabatale/SAP2Moose
59553fab013de732e2b7c9e67b6a4de799617b6a
[ "MIT" ]
72
2017-09-18T15:16:20.000Z
2021-12-10T20:09:32.000Z
src/main/mse/z2mse_output_model.clas.abap
sabatale/SAP2Moose
59553fab013de732e2b7c9e67b6a4de799617b6a
[ "MIT" ]
6
2017-11-05T19:23:19.000Z
2020-02-01T20:02:51.000Z
CLASS z2mse_output_model DEFINITION PUBLIC CREATE PUBLIC. PUBLIC SECTION. METHODS make IMPORTING mse_model TYPE z2mse_model=>lines_type g_parameter_download_file TYPE abap_bool i_default_prefix TYPE string. ENDCLASS. CLASS z2mse_output_model IMPLEMENTATION. METHOD make. " Download the file DATA: filename TYPE string, default_file_name TYPE string, pathname TYPE string, fullpath TYPE string, user_action TYPE i. default_file_name = |{ i_default_prefix }_{ sy-sysid }_{ sy-datum }_{ sy-uzeit }|. IF g_parameter_download_file EQ abap_true. cl_gui_frontend_services=>file_save_dialog( EXPORTING default_extension = 'mse' default_file_name = default_file_name CHANGING filename = filename " File Name to Save path = pathname " Path to File fullpath = fullpath " Path + File Name user_action = user_action ). " User Action (C Class Const ACTION_OK, ACTION_OVERWRITE etc) IF user_action = cl_gui_frontend_services=>action_cancel. WRITE: / 'Canceled by user'. ELSE. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING filename = fullpath TABLES data_tab = mse_model. ENDIF. ENDIF. ENDMETHOD. ENDCLASS.
31.433962
150
0.529412
422416a127dc3e5762d521ee752e289f155d6723
5,847
abap
ABAP
src/utils/zcl_abapgit_diff.clas.testclasses.abap
jeevanrajv1901/ABAPGIT
6d2deece76a481da75a04e4bbafae2d286b64834
[ "MIT" ]
2
2021-03-20T20:27:04.000Z
2021-03-20T20:34:58.000Z
src/utils/zcl_abapgit_diff.clas.testclasses.abap
jeevanrajv1901/ABAPGIT
6d2deece76a481da75a04e4bbafae2d286b64834
[ "MIT" ]
40
2021-06-01T05:58:26.000Z
2022-03-01T05:02:17.000Z
src/utils/zcl_abapgit_diff.clas.testclasses.abap
jeevanrajv1901/ABAPGIT
6d2deece76a481da75a04e4bbafae2d286b64834
[ "MIT" ]
1
2021-08-18T07:58:26.000Z
2021-08-18T07:58:26.000Z
CLASS ltcl_diff DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS. PRIVATE SECTION. DATA: mt_new TYPE TABLE OF string, mt_old TYPE TABLE OF string, mt_expected TYPE zif_abapgit_definitions=>ty_diffs_tt. METHODS: add_new IMPORTING iv_new TYPE string, add_old IMPORTING iv_old TYPE string, add_expected IMPORTING iv_new_num TYPE zif_abapgit_definitions=>ty_diff-new_num iv_new TYPE zif_abapgit_definitions=>ty_diff-new iv_result TYPE zif_abapgit_definitions=>ty_diff-result iv_old_num TYPE zif_abapgit_definitions=>ty_diff-old_num iv_old TYPE zif_abapgit_definitions=>ty_diff-old. METHODS: setup. METHODS: test. METHODS: diff01 FOR TESTING, diff02 FOR TESTING, diff03 FOR TESTING, diff04 FOR TESTING, diff05 FOR TESTING, diff06 FOR TESTING. ENDCLASS. CLASS ltcl_diff IMPLEMENTATION. METHOD add_new. DATA lv_new LIKE LINE OF mt_new. lv_new = iv_new. APPEND lv_new TO mt_new. ENDMETHOD. METHOD add_old. DATA lv_old LIKE LINE OF mt_old. lv_old = iv_old. APPEND lv_old TO mt_old. ENDMETHOD. METHOD add_expected. DATA ls_expected LIKE LINE OF mt_expected. ls_expected-new_num = iv_new_num. ls_expected-new = iv_new. ls_expected-result = iv_result. ls_expected-old_num = iv_old_num. ls_expected-old = iv_old. ls_expected-beacon = zcl_abapgit_diff=>co_starting_beacon. APPEND ls_expected TO mt_expected. ENDMETHOD. METHOD setup. CLEAR mt_new. CLEAR mt_old. CLEAR mt_expected. ENDMETHOD. METHOD test. DATA: lv_new TYPE string, lv_xnew TYPE xstring, lv_old TYPE string, lv_xold TYPE xstring, lo_diff TYPE REF TO zcl_abapgit_diff, lt_diff TYPE zif_abapgit_definitions=>ty_diffs_tt. FIELD-SYMBOLS: <ls_diff> LIKE LINE OF lt_diff. CONCATENATE LINES OF mt_new INTO lv_new SEPARATED BY zif_abapgit_definitions=>c_newline. CONCATENATE LINES OF mt_old INTO lv_old SEPARATED BY zif_abapgit_definitions=>c_newline. lv_xnew = zcl_abapgit_convert=>string_to_xstring_utf8( lv_new ). lv_xold = zcl_abapgit_convert=>string_to_xstring_utf8( lv_old ). CREATE OBJECT lo_diff EXPORTING iv_new = lv_xnew iv_old = lv_xold. lt_diff = lo_diff->get( ). LOOP AT lt_diff ASSIGNING <ls_diff>. CLEAR <ls_diff>-short. ENDLOOP. cl_abap_unit_assert=>assert_equals( act = lt_diff exp = mt_expected ). ENDMETHOD. METHOD diff01. "insert add_new( iv_new = 'A' ). add_expected( iv_new_num = ' 1' iv_new = 'A' iv_result = zif_abapgit_definitions=>c_diff-insert iv_old_num = '' iv_old = '' ). test( ). ENDMETHOD. METHOD diff02. " identical add_new( iv_new = 'A' ). add_old( iv_old = 'A' ). add_expected( iv_new_num = ' 1' iv_new = 'A' iv_result = '' iv_old_num = ' 1' iv_old = 'A' ). test( ). ENDMETHOD. METHOD diff03. " delete add_old( iv_old = 'A' ). add_expected( iv_new_num = '' iv_new = '' iv_result = zif_abapgit_definitions=>c_diff-delete iv_old_num = ' 1' iv_old = 'A' ). test( ). ENDMETHOD. METHOD diff04. " update add_new( iv_new = 'A+' ). add_old( iv_old = 'A' ). add_expected( iv_new_num = ' 1' iv_new = 'A+' iv_result = zif_abapgit_definitions=>c_diff-update iv_old_num = ' 1' iv_old = 'A' ). test( ). ENDMETHOD. METHOD diff05. " identical add_new( iv_new = 'A' ). add_new( iv_new = 'B' ). add_old( iv_old = 'A' ). add_old( iv_old = 'B' ). add_expected( iv_new_num = ' 1' iv_new = 'A' iv_result = '' iv_old_num = ' 1' iv_old = 'A' ). add_expected( iv_new_num = ' 2' iv_new = 'B' iv_result = '' iv_old_num = ' 2' iv_old = 'B' ). test( ). ENDMETHOD. METHOD diff06. add_new( iv_new = 'A' ). add_new( iv_new = 'B' ). add_new( iv_new = 'inserted' ). add_new( iv_new = 'C' ). add_new( iv_new = 'D update' ). add_old( iv_old = 'A' ). add_old( iv_old = 'B' ). add_old( iv_old = 'C' ). add_old( iv_old = 'D' ). add_expected( iv_new_num = ' 1' iv_new = 'A' iv_result = '' iv_old_num = ' 1' iv_old = 'A' ). add_expected( iv_new_num = ' 2' iv_new = 'B' iv_result = '' iv_old_num = ' 2' iv_old = 'B' ). add_expected( iv_new_num = ' 3' iv_new = 'inserted' iv_result = zif_abapgit_definitions=>c_diff-insert iv_old_num = '' iv_old = '' ). add_expected( iv_new_num = ' 4' iv_new = 'C' iv_result = '' iv_old_num = ' 3' iv_old = 'C' ). add_expected( iv_new_num = ' 5' iv_new = 'D update' iv_result = zif_abapgit_definitions=>c_diff-update iv_old_num = ' 4' iv_old = 'D' ). test( ). ENDMETHOD. ENDCLASS.
25.532751
92
0.526766
4227f01dac44e2fe61689ff830f8a7889ac4218a
7,934
abap
ABAP
src/git/zcl_abapgit_git_commit.clas.abap
amit3kumar/ABAP_ALL
67822ae13ffda6597a91bb5b39e428c39bc445a3
[ "MIT" ]
2
2021-03-20T20:27:04.000Z
2021-03-20T20:34:58.000Z
src/git/zcl_abapgit_git_commit.clas.abap
amit3kumar/ABAP_ALL
67822ae13ffda6597a91bb5b39e428c39bc445a3
[ "MIT" ]
18
2019-11-05T16:18:55.000Z
2021-02-25T22:56:06.000Z
src/git/zcl_abapgit_git_commit.clas.abap
amit3kumar/ABAP_ALL
67822ae13ffda6597a91bb5b39e428c39bc445a3
[ "MIT" ]
1
2021-07-09T02:07:11.000Z
2021-07-09T02:07:11.000Z
"! <p class="shorttext synchronized" lang="en">Git Commit</p> CLASS zcl_abapgit_git_commit DEFINITION PUBLIC CREATE PUBLIC . PUBLIC SECTION. TYPES: BEGIN OF ty_pull_result, commits TYPE zif_abapgit_definitions=>ty_commit_tt, commit TYPE zif_abapgit_definitions=>ty_sha1, END OF ty_pull_result . CLASS-METHODS get_by_branch IMPORTING !iv_branch_name TYPE string !iv_repo_url TYPE zif_abapgit_persistence=>ty_repo-url !iv_deepen_level TYPE i RETURNING VALUE(rs_pull_result) TYPE ty_pull_result RAISING zcx_abapgit_exception . CLASS-METHODS get_by_commit IMPORTING !iv_commit_hash TYPE zif_abapgit_definitions=>ty_sha1 !iv_repo_url TYPE zif_abapgit_persistence=>ty_repo-url !iv_deepen_level TYPE i RETURNING VALUE(rt_commits) TYPE zif_abapgit_definitions=>ty_commit_tt RAISING zcx_abapgit_exception . CLASS-METHODS parse_commits IMPORTING !it_objects TYPE zif_abapgit_definitions=>ty_objects_tt RETURNING VALUE(rt_commits) TYPE zif_abapgit_definitions=>ty_commit_tt RAISING zcx_abapgit_exception . CLASS-METHODS sort_commits CHANGING !ct_commits TYPE zif_abapgit_definitions=>ty_commit_tt . CLASS-METHODS reverse_sort_order CHANGING !ct_commits TYPE zif_abapgit_definitions=>ty_commit_tt . PROTECTED SECTION. PRIVATE SECTION. TYPES: ty_sha1_range TYPE RANGE OF zif_abapgit_definitions=>ty_sha1 . CLASS-METHODS get_1st_child_commit IMPORTING it_commit_sha1s TYPE ty_sha1_range EXPORTING et_commit_sha1s TYPE ty_sha1_range es_1st_commit TYPE zif_abapgit_definitions=>ty_commit CHANGING ct_commits TYPE zif_abapgit_definitions=>ty_commit_tt . ENDCLASS. CLASS zcl_abapgit_git_commit IMPLEMENTATION. METHOD get_by_branch. DATA: li_progress TYPE REF TO zif_abapgit_progress, lt_objects TYPE zif_abapgit_definitions=>ty_objects_tt. li_progress = zcl_abapgit_progress=>get_instance( 1 ). li_progress->show( iv_current = 1 iv_text = |Get git commits { iv_repo_url }| ). zcl_abapgit_git_transport=>upload_pack_by_branch( EXPORTING iv_url = iv_repo_url iv_branch_name = iv_branch_name iv_deepen_level = iv_deepen_level IMPORTING ev_branch = rs_pull_result-commit et_objects = lt_objects ). DELETE lt_objects WHERE type <> zif_abapgit_definitions=>c_type-commit. rs_pull_result-commits = parse_commits( lt_objects ). sort_commits( CHANGING ct_commits = rs_pull_result-commits ). ENDMETHOD. METHOD get_by_commit. DATA: li_progress TYPE REF TO zif_abapgit_progress, lt_objects TYPE zif_abapgit_definitions=>ty_objects_tt. li_progress = zcl_abapgit_progress=>get_instance( 1 ). li_progress->show( iv_current = 1 iv_text = |Get git commits { iv_repo_url }| ). zcl_abapgit_git_transport=>upload_pack_by_commit( EXPORTING iv_url = iv_repo_url iv_deepen_level = iv_deepen_level iv_hash = iv_commit_hash IMPORTING et_objects = lt_objects ). DELETE lt_objects WHERE type <> zif_abapgit_definitions=>c_type-commit. rt_commits = parse_commits( lt_objects ). sort_commits( CHANGING ct_commits = rt_commits ). ENDMETHOD. METHOD get_1st_child_commit. DATA: lt_1stchild_commits TYPE zif_abapgit_definitions=>ty_commit_tt, ls_parent LIKE LINE OF it_commit_sha1s, lt_commit_sha1s LIKE it_commit_sha1s. FIELD-SYMBOLS: <ls_child_commit> TYPE zif_abapgit_definitions=>ty_commit. CLEAR: es_1st_commit. * get all reachable next commits lt_commit_sha1s = it_commit_sha1s. LOOP AT ct_commits ASSIGNING <ls_child_commit> WHERE parent1 IN lt_commit_sha1s OR parent2 IN lt_commit_sha1s. INSERT <ls_child_commit> INTO TABLE lt_1stchild_commits. ENDLOOP. * return oldest one SORT lt_1stchild_commits BY time ASCENDING. READ TABLE lt_1stchild_commits INTO es_1st_commit INDEX 1. * remove from available commits DELETE ct_commits WHERE sha1 = es_1st_commit-sha1. * set relevant parent commit sha1s IF lines( lt_1stchild_commits ) = 1. CLEAR et_commit_sha1s. ELSE. et_commit_sha1s = it_commit_sha1s. ENDIF. ls_parent-sign = 'I'. ls_parent-option = 'EQ'. ls_parent-low = es_1st_commit-sha1. INSERT ls_parent INTO TABLE et_commit_sha1s. ENDMETHOD. METHOD parse_commits. DATA: ls_commit TYPE zif_abapgit_definitions=>ty_commit, lt_body TYPE STANDARD TABLE OF string WITH DEFAULT KEY, ls_raw TYPE zcl_abapgit_git_pack=>ty_commit. FIELD-SYMBOLS: <ls_object> LIKE LINE OF it_objects, <lv_body> TYPE string. LOOP AT it_objects ASSIGNING <ls_object> USING KEY type WHERE type = zif_abapgit_definitions=>c_type-commit. ls_raw = zcl_abapgit_git_pack=>decode_commit( <ls_object>-data ). CLEAR ls_commit. ls_commit-sha1 = <ls_object>-sha1. ls_commit-parent1 = ls_raw-parent. ls_commit-parent2 = ls_raw-parent2. SPLIT ls_raw-body AT zif_abapgit_definitions=>c_newline INTO TABLE lt_body. READ TABLE lt_body WITH KEY table_line = ' -----END PGP SIGNATURE-----' TRANSPORTING NO FIELDS. IF sy-subrc = 0. DELETE lt_body TO sy-tabix. DELETE lt_body TO 2. ENDIF. READ TABLE lt_body INDEX 1 INTO ls_commit-message. "#EC CI_SUBRC " The second line is always empty. Therefore we omit it. LOOP AT lt_body ASSIGNING <lv_body> FROM 3. INSERT <lv_body> INTO TABLE ls_commit-body. ENDLOOP. zcl_abapgit_utils=>extract_author_data( EXPORTING iv_author = ls_raw-author IMPORTING ev_author = ls_commit-author ev_email = ls_commit-email ev_time = ls_commit-time ). APPEND ls_commit TO rt_commits. ENDLOOP. ENDMETHOD. METHOD reverse_sort_order. DATA: lt_commits TYPE zif_abapgit_definitions=>ty_commit_tt. FIELD-SYMBOLS: <ls_commit> TYPE zif_abapgit_definitions=>ty_commit. LOOP AT ct_commits ASSIGNING <ls_commit>. INSERT <ls_commit> INTO lt_commits INDEX 1. ENDLOOP. ct_commits = lt_commits. FREE lt_commits. ENDMETHOD. METHOD sort_commits. DATA: lt_sorted_commits TYPE zif_abapgit_definitions=>ty_commit_tt, ls_next_commit TYPE zif_abapgit_definitions=>ty_commit, lt_parents TYPE ty_sha1_range, ls_parent LIKE LINE OF lt_parents. FIELD-SYMBOLS: <ls_initial_commit> TYPE zif_abapgit_definitions=>ty_commit. " find initial commit READ TABLE ct_commits ASSIGNING <ls_initial_commit> WITH KEY parent1 = space. IF sy-subrc = 0. ls_parent-sign = 'I'. ls_parent-option = 'EQ'. ls_parent-low = <ls_initial_commit>-sha1. INSERT ls_parent INTO TABLE lt_parents. " first commit INSERT <ls_initial_commit> INTO TABLE lt_sorted_commits. " remove from available commits DELETE ct_commits WHERE sha1 = <ls_initial_commit>-sha1. DO. get_1st_child_commit( EXPORTING it_commit_sha1s = lt_parents IMPORTING et_commit_sha1s = lt_parents es_1st_commit = ls_next_commit CHANGING ct_commits = ct_commits ). IF ls_next_commit IS INITIAL. EXIT. "DO ENDIF. INSERT ls_next_commit INTO TABLE lt_sorted_commits. ENDDO. ct_commits = lt_sorted_commits. ENDIF. ENDMETHOD. ENDCLASS.
30.1673
101
0.679481
422c2c639e5ffed63ffddfa71cbbaa76dbb03263
11,879
abap
ABAP
src/ui/core/zcl_abapgit_gui.clas.abap
filak-sap/abapGit
93fc5b927ccd4035d76254777df961a3243f8bf8
[ "MIT" ]
null
null
null
src/ui/core/zcl_abapgit_gui.clas.abap
filak-sap/abapGit
93fc5b927ccd4035d76254777df961a3243f8bf8
[ "MIT" ]
null
null
null
src/ui/core/zcl_abapgit_gui.clas.abap
filak-sap/abapGit
93fc5b927ccd4035d76254777df961a3243f8bf8
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_gui DEFINITION PUBLIC FINAL . PUBLIC SECTION. CONSTANTS: BEGIN OF c_event_state, not_handled VALUE 0, re_render VALUE 1, new_page VALUE 2, go_back VALUE 3, no_more_act VALUE 4, new_page_w_bookmark VALUE 5, go_back_to_bookmark VALUE 6, new_page_replacing VALUE 7, END OF c_event_state . CONSTANTS: BEGIN OF c_action, go_home TYPE string VALUE 'go_home', END OF c_action. INTERFACES zif_abapgit_gui_services. ALIASES: cache_asset FOR zif_abapgit_gui_services~cache_asset. METHODS go_home RAISING zcx_abapgit_exception. METHODS go_page IMPORTING io_page TYPE REF TO zif_abapgit_gui_renderable iv_clear_stack TYPE abap_bool DEFAULT abap_true RAISING zcx_abapgit_exception. METHODS back IMPORTING iv_to_bookmark TYPE abap_bool DEFAULT abap_false RETURNING VALUE(rv_exit) TYPE abap_bool RAISING zcx_abapgit_exception. METHODS on_event FOR EVENT sapevent OF cl_gui_html_viewer IMPORTING action frame getdata postdata query_table. METHODS constructor IMPORTING io_component TYPE REF TO object OPTIONAL ii_asset_man TYPE REF TO zif_abapgit_gui_asset_manager OPTIONAL ii_html_processor TYPE REF TO zif_abapgit_gui_html_processor OPTIONAL RAISING zcx_abapgit_exception. METHODS free. PROTECTED SECTION. PRIVATE SECTION. TYPES: BEGIN OF ty_page_stack, page TYPE REF TO zif_abapgit_gui_renderable, bookmark TYPE abap_bool, END OF ty_page_stack. DATA: mi_cur_page TYPE REF TO zif_abapgit_gui_renderable, mt_stack TYPE STANDARD TABLE OF ty_page_stack, mi_router TYPE REF TO zif_abapgit_gui_event_handler, mi_asset_man TYPE REF TO zif_abapgit_gui_asset_manager, mi_html_processor TYPE REF TO zif_abapgit_gui_html_processor, mo_html_viewer TYPE REF TO cl_gui_html_viewer. METHODS startup RAISING zcx_abapgit_exception. METHODS cache_html IMPORTING iv_text TYPE string RETURNING VALUE(rv_url) TYPE w3url. METHODS render RAISING zcx_abapgit_exception. METHODS get_current_page_name RETURNING VALUE(rv_page_name) TYPE string. METHODS call_page IMPORTING ii_page TYPE REF TO zif_abapgit_gui_renderable iv_with_bookmark TYPE abap_bool DEFAULT abap_false iv_replacing TYPE abap_bool DEFAULT abap_false RAISING zcx_abapgit_exception. METHODS handle_action IMPORTING iv_action TYPE c iv_frame TYPE c OPTIONAL iv_getdata TYPE c OPTIONAL it_postdata TYPE cnht_post_data_tab OPTIONAL it_query_table TYPE cnht_query_table OPTIONAL. METHODS handle_error IMPORTING ix_exception TYPE REF TO zcx_abapgit_exception. ENDCLASS. CLASS zcl_abapgit_gui IMPLEMENTATION. METHOD back. DATA: lv_index TYPE i, ls_stack LIKE LINE OF mt_stack. lv_index = lines( mt_stack ). IF lv_index = 0. rv_exit = abap_true. RETURN. ENDIF. DO lv_index TIMES. READ TABLE mt_stack INDEX lv_index INTO ls_stack. ASSERT sy-subrc = 0. DELETE mt_stack INDEX lv_index. ASSERT sy-subrc = 0. lv_index = lv_index - 1. IF iv_to_bookmark = abap_false OR ls_stack-bookmark = abap_true. EXIT. ENDIF. ENDDO. mi_cur_page = ls_stack-page. " last page always stays render( ). ENDMETHOD. METHOD cache_html. rv_url = cache_asset( iv_text = iv_text iv_type = 'text' iv_subtype = 'html' ). ENDMETHOD. METHOD call_page. DATA: ls_stack TYPE ty_page_stack. IF iv_replacing = abap_false AND NOT mi_cur_page IS INITIAL. ls_stack-page = mi_cur_page. ls_stack-bookmark = iv_with_bookmark. APPEND ls_stack TO mt_stack. ENDIF. mi_cur_page = ii_page. render( ). ENDMETHOD. METHOD constructor. IF io_component IS BOUND. IF zcl_abapgit_gui_utils=>is_renderable( io_component ) = abap_true. mi_cur_page ?= io_component. " direct page ELSE. IF zcl_abapgit_gui_utils=>is_event_handler( io_component ) = abap_false. zcx_abapgit_exception=>raise( 'Component must be renderable or be an event handler' ). ENDIF. mi_router ?= io_component. ENDIF. ENDIF. mi_asset_man = ii_asset_man. mi_html_processor = ii_html_processor. " Maybe improve to middlewares stack ?? startup( ). ENDMETHOD. METHOD free. SET HANDLER me->on_event FOR mo_html_viewer ACTIVATION space. mo_html_viewer->close_document( ). mo_html_viewer->free( ). FREE mo_html_viewer. ENDMETHOD. METHOD get_current_page_name. IF mi_cur_page IS BOUND. rv_page_name = cl_abap_classdescr=>describe_by_object_ref( mi_cur_page )->get_relative_name( ). ENDIF." ELSE - return is empty => initial page ENDMETHOD. METHOD go_home. DATA ls_stack LIKE LINE OF mt_stack. IF mi_router IS BOUND. CLEAR mt_stack. on_event( action = |{ c_action-go_home }| ). " doesn't accept strings directly ELSE. IF lines( mt_stack ) > 0. READ TABLE mt_stack INTO ls_stack INDEX 1. mi_cur_page = ls_stack-page. ENDIF. render( ). ENDIF. ENDMETHOD. METHOD go_page. IF iv_clear_stack = abap_true. CLEAR mt_stack. ENDIF. mi_cur_page = io_page. render( ). ENDMETHOD. METHOD handle_action. DATA: lx_exception TYPE REF TO zcx_abapgit_exception, li_page_eh TYPE REF TO zif_abapgit_gui_event_handler, li_page TYPE REF TO zif_abapgit_gui_renderable, lv_state TYPE i. DATA(postdata) = it_postdata. DATA hex TYPE xstring VALUE 'EFBFBD'. DATA(text) = cl_abap_codepage=>convert_from( hex ). LOOP AT postdata ASSIGNING FIELD-SYMBOL(<line>). REPLACE ALL OCCURRENCES OF text IN <line> WITH ` `. ENDLOOP. TRY. " Home must be processed by router if it presents IF ( iv_action <> c_action-go_home OR mi_router IS NOT BOUND ) AND mi_cur_page IS BOUND AND zcl_abapgit_gui_utils=>is_event_handler( mi_cur_page ) = abap_true. li_page_eh ?= mi_cur_page. li_page_eh->on_event( EXPORTING iv_action = iv_action iv_prev_page = get_current_page_name( ) iv_getdata = iv_getdata it_postdata = postdata IMPORTING ei_page = li_page ev_state = lv_state ). ENDIF. IF lv_state IS INITIAL AND mi_router IS BOUND. mi_router->on_event( EXPORTING iv_action = iv_action iv_prev_page = get_current_page_name( ) iv_getdata = iv_getdata it_postdata = postdata IMPORTING ei_page = li_page ev_state = lv_state ). ENDIF. CASE lv_state. WHEN c_event_state-re_render. render( ). WHEN c_event_state-new_page. call_page( li_page ). WHEN c_event_state-new_page_w_bookmark. call_page( ii_page = li_page iv_with_bookmark = abap_true ). WHEN c_event_state-new_page_replacing. call_page( ii_page = li_page iv_replacing = abap_true ). WHEN c_event_state-go_back. back( ). WHEN c_event_state-go_back_to_bookmark. back( abap_true ). WHEN c_event_state-no_more_act. " Do nothing, handling completed WHEN OTHERS. zcx_abapgit_exception=>raise( |Unknown action: { iv_action }| ). ENDCASE. CATCH zcx_abapgit_cancel ##NO_HANDLER. " Do nothing = gc_event_state-no_more_act CATCH zcx_abapgit_exception INTO lx_exception. ROLLBACK WORK. handle_error( lx_exception ). ENDTRY. ENDMETHOD. METHOD on_event. handle_action( iv_action = action iv_frame = frame iv_getdata = getdata it_postdata = postdata it_query_table = query_table ). ENDMETHOD. METHOD render. DATA: lv_url TYPE w3url, lv_html TYPE string, li_html TYPE REF TO zif_abapgit_html, lo_css_processor TYPE REF TO zcl_abapgit_gui_css_processor. IF mi_cur_page IS NOT BOUND. zcx_abapgit_exception=>raise( 'GUI error: no current page' ). ENDIF. li_html = mi_cur_page->render( ). lv_html = li_html->render( iv_no_indent_jscss = abap_true ). IF mi_html_processor IS BOUND. lv_html = mi_html_processor->process( iv_html = lv_html ii_gui_services = me ). ENDIF. lv_url = cache_html( lv_html ). mo_html_viewer->show_url( lv_url ). ENDMETHOD. METHOD startup. DATA: lt_events TYPE cntl_simple_events, ls_event LIKE LINE OF lt_events, lt_assets TYPE zif_abapgit_gui_asset_manager=>tt_web_assets. FIELD-SYMBOLS <ls_asset> LIKE LINE OF lt_assets. CREATE OBJECT mo_html_viewer EXPORTING query_table_disabled = abap_true parent = cl_gui_container=>screen0. IF mi_asset_man IS BOUND. lt_assets = mi_asset_man->get_all_assets( ). LOOP AT lt_assets ASSIGNING <ls_asset> WHERE is_cacheable = abap_true. cache_asset( iv_xdata = <ls_asset>-content iv_url = <ls_asset>-url iv_type = <ls_asset>-type iv_subtype = <ls_asset>-subtype ). ENDLOOP. ENDIF. ls_event-eventid = mo_html_viewer->m_id_sapevent. ls_event-appl_event = abap_true. APPEND ls_event TO lt_events. mo_html_viewer->set_registered_events( lt_events ). SET HANDLER me->on_event FOR mo_html_viewer. ENDMETHOD. METHOD cache_asset. DATA: lv_xstr TYPE xstring, lt_xdata TYPE lvc_t_mime, lv_size TYPE int4. ASSERT iv_text IS SUPPLIED OR iv_xdata IS SUPPLIED. IF iv_text IS SUPPLIED. " String input lv_xstr = zcl_abapgit_convert=>string_to_xstring( iv_text ). ELSE. " Raw input lv_xstr = iv_xdata. ENDIF. zcl_abapgit_convert=>xstring_to_bintab( EXPORTING iv_xstr = lv_xstr IMPORTING ev_size = lv_size et_bintab = lt_xdata ). mo_html_viewer->load_data( EXPORTING type = iv_type subtype = iv_subtype size = lv_size url = iv_url IMPORTING assigned_url = rv_url CHANGING data_table = lt_xdata EXCEPTIONS OTHERS = 1 ) ##NO_TEXT. ASSERT sy-subrc = 0. " Image data error ENDMETHOD. METHOD handle_error. DATA: li_gui_error_handler TYPE REF TO zif_abapgit_gui_error_handler, lx_exception TYPE REF TO cx_root. TRY. li_gui_error_handler ?= mi_cur_page. IF li_gui_error_handler->handle_error( ix_exception ) = abap_true. " We rerender the current page to display the error box render( ). ELSE. MESSAGE ix_exception TYPE 'S' DISPLAY LIKE 'E'. ENDIF. CATCH zcx_abapgit_exception cx_sy_move_cast_error INTO lx_exception. " In case of fire we just fallback to plain old message MESSAGE lx_exception TYPE 'S' DISPLAY LIKE 'E'. ENDTRY. ENDMETHOD. ENDCLASS.
25.993435
101
0.632882
422ca134f9f966d46a4365bf33f29a0557e3f429
2,148
abap
ABAP
src/checks/y_check_non_class_exception.clas.abap
pokrakam/code-pal-for-abap
65c008f75d4d2453c6994c57dc03741862c1d510
[ "Apache-2.0" ]
202
2020-05-05T13:41:12.000Z
2022-03-26T15:18:13.000Z
src/checks/y_check_non_class_exception.clas.abap
pokrakam/code-pal-for-abap
65c008f75d4d2453c6994c57dc03741862c1d510
[ "Apache-2.0" ]
322
2020-05-05T19:14:35.000Z
2022-03-22T14:48:44.000Z
src/checks/y_check_non_class_exception.clas.abap
lucasborin/code-pal-for-abap
4e1247693457e7687648806b18b63cb8968f927a
[ "Apache-2.0" ]
59
2020-05-05T18:59:19.000Z
2022-03-20T11:24:48.000Z
CLASS y_check_non_class_exception DEFINITION PUBLIC INHERITING FROM y_check_base CREATE PUBLIC. PUBLIC SECTION. METHODS constructor. PROTECTED SECTION. METHODS inspect_tokens REDEFINITION. METHODS inspect_message IMPORTING statement TYPE sstmnt index TYPE i. METHODS inspect_raise IMPORTING statement TYPE sstmnt index TYPE i. PRIVATE SECTION. METHODS checkif_error IMPORTING index TYPE i statement TYPE sstmnt. ENDCLASS. CLASS Y_CHECK_NON_CLASS_EXCEPTION IMPLEMENTATION. METHOD checkif_error. 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 constructor. super->constructor( ). settings-pseudo_comment = '"#EC NON_CL_EXCEPT' ##NO_TEXT. settings-disable_threshold_selection = abap_true. settings-threshold = 0. settings-documentation = |{ c_docs_path-checks }non-class-exception.md|. set_check_message( 'Non-class-based exceptions should not be used!' ). ENDMETHOD. METHOD inspect_tokens. inspect_raise( statement = statement index = index ). inspect_message( statement = statement index = index ). ENDMETHOD. METHOD inspect_message. CHECK get_token_abs( statement-from ) = 'MESSAGE'. LOOP AT ref_scan_manager->tokens TRANSPORTING NO FIELDS FROM statement-from TO statement-to WHERE str = 'RAISING' AND type = 'I'. checkif_error( index = index statement = statement ). ENDLOOP. ENDMETHOD. METHOD inspect_raise. CHECK get_token_abs( statement-from ) = 'RAISE'. CHECK statement-from + 1 = statement-to. checkif_error( index = index statement = statement ). ENDMETHOD. ENDCLASS.
26.195122
95
0.648976
422cca44868d8aeca4fe8531896bb70ef0146b02
10,738
abap
ABAP
src/ui/zcl_abapgit_gui_page_commit.clas.abap
Ankit4033/zabapGit
f4e33039d6fbe13e9390dec511939333215cbd43
[ "MIT" ]
null
null
null
src/ui/zcl_abapgit_gui_page_commit.clas.abap
Ankit4033/zabapGit
f4e33039d6fbe13e9390dec511939333215cbd43
[ "MIT" ]
null
null
null
src/ui/zcl_abapgit_gui_page_commit.clas.abap
Ankit4033/zabapGit
f4e33039d6fbe13e9390dec511939333215cbd43
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_gui_page_commit DEFINITION PUBLIC INHERITING FROM zcl_abapgit_gui_page FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES: zif_abapgit_gui_page_hotkey. CONSTANTS: BEGIN OF c_action, commit_post TYPE string VALUE 'commit_post', commit_cancel TYPE string VALUE 'commit_cancel', END OF c_action . METHODS constructor IMPORTING io_repo TYPE REF TO zcl_abapgit_repo_online io_stage TYPE REF TO zcl_abapgit_stage RAISING zcx_abapgit_exception. METHODS zif_abapgit_gui_event_handler~on_event REDEFINITION . PROTECTED SECTION. CLASS-METHODS parse_commit_request IMPORTING !it_postdata TYPE cnht_post_data_tab EXPORTING !eg_fields TYPE any . METHODS render_content REDEFINITION . METHODS scripts REDEFINITION . PRIVATE SECTION. DATA: mo_repo TYPE REF TO zcl_abapgit_repo_online, mo_stage TYPE REF TO zcl_abapgit_stage. METHODS: render_menu RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html, render_stage RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html RAISING zcx_abapgit_exception, render_form RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html RAISING zcx_abapgit_exception, render_text_input IMPORTING iv_name TYPE string iv_label TYPE string iv_value TYPE string OPTIONAL iv_max_length TYPE string OPTIONAL RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html. ENDCLASS. CLASS ZCL_ABAPGIT_GUI_PAGE_COMMIT IMPLEMENTATION. METHOD constructor. super->constructor( ). mo_repo = io_repo. mo_stage = io_stage. ms_control-page_title = 'COMMIT'. ENDMETHOD. METHOD parse_commit_request. CONSTANTS: lc_replace TYPE string VALUE '<<new>>'. DATA: lv_string TYPE string, lt_fields TYPE tihttpnvp. FIELD-SYMBOLS <lv_body> TYPE string. CLEAR eg_fields. CONCATENATE LINES OF it_postdata INTO lv_string. REPLACE ALL OCCURRENCES OF zif_abapgit_definitions=>c_crlf IN lv_string WITH lc_replace. REPLACE ALL OCCURRENCES OF zif_abapgit_definitions=>c_newline IN lv_string WITH lc_replace. lt_fields = zcl_abapgit_html_action_utils=>parse_fields_upper_case_name( lv_string ). zcl_abapgit_html_action_utils=>get_field( EXPORTING iv_name = 'COMMITTER_NAME' it_field = lt_fields CHANGING cg_field = eg_fields ). zcl_abapgit_html_action_utils=>get_field( EXPORTING iv_name = 'COMMITTER_EMAIL' it_field = lt_fields CHANGING cg_field = eg_fields ). zcl_abapgit_html_action_utils=>get_field( EXPORTING iv_name = 'AUTHOR_NAME' it_field = lt_fields CHANGING cg_field = eg_fields ). zcl_abapgit_html_action_utils=>get_field( EXPORTING iv_name = 'AUTHOR_EMAIL' it_field = lt_fields CHANGING cg_field = eg_fields ). zcl_abapgit_html_action_utils=>get_field( EXPORTING iv_name = 'COMMENT' it_field = lt_fields CHANGING cg_field = eg_fields ). zcl_abapgit_html_action_utils=>get_field( EXPORTING iv_name = 'BODY' it_field = lt_fields CHANGING cg_field = eg_fields ). ASSIGN COMPONENT 'BODY' OF STRUCTURE eg_fields TO <lv_body>. ASSERT <lv_body> IS ASSIGNED. REPLACE ALL OCCURRENCES OF lc_replace IN <lv_body> WITH zif_abapgit_definitions=>c_newline. ENDMETHOD. METHOD render_content. CREATE OBJECT ro_html. ro_html->add( '<div class="repo">' ). ro_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top( io_repo = mo_repo iv_show_package = abap_false iv_branch = mo_repo->get_branch_name( ) ) ). ro_html->add( render_menu( ) ). ro_html->add( render_form( ) ). ro_html->add( render_stage( ) ). ro_html->add( '</div>' ). ENDMETHOD. METHOD render_form. CONSTANTS: lc_body_col_max TYPE i VALUE 150. DATA: li_user TYPE REF TO zif_abapgit_persist_user. DATA: lv_user TYPE string. DATA: lv_email TYPE string. DATA: lv_s_param TYPE string. DATA: lo_settings TYPE REF TO zcl_abapgit_settings. DATA: lv_body_size TYPE i. * see https://git-scm.com/book/ch5-2.html * commit messages should be max 50 characters * body should wrap at 72 characters li_user = zcl_abapgit_persistence_user=>get_instance( ). lv_user = li_user->get_repo_git_user_name( mo_repo->get_url( ) ). IF lv_user IS INITIAL. lv_user = li_user->get_default_git_user_name( ). ENDIF. IF lv_user IS INITIAL. " get default from user master record lv_user = zcl_abapgit_user_master_record=>get_instance( sy-uname )->get_name( ). ENDIF. lv_email = li_user->get_repo_git_user_email( mo_repo->get_url( ) ). IF lv_email IS INITIAL. lv_email = li_user->get_default_git_user_email( ). ENDIF. IF lv_email IS INITIAL. " get default from user master record lv_email = zcl_abapgit_user_master_record=>get_instance( sy-uname )->get_email( ). ENDIF. CREATE OBJECT ro_html. ro_html->add( '<div class="form-container">' ). ro_html->add( '<form id="commit_form" class="aligned-form"' && ' method="post" action="sapevent:commit_post">' ). ro_html->add( render_text_input( iv_name = 'committer_name' iv_label = 'committer name' iv_value = lv_user ) ). ro_html->add( render_text_input( iv_name = 'committer_email' iv_label = 'committer e-mail' iv_value = lv_email ) ). lo_settings = zcl_abapgit_persist_settings=>get_instance( )->read( ). lv_s_param = lo_settings->get_commitmsg_comment_length( ). ro_html->add( render_text_input( iv_name = 'comment' iv_label = 'comment' iv_max_length = lv_s_param ) ). ro_html->add( '<div class="row">' ). ro_html->add( '<label for="c-body">body</label>' ). lv_body_size = lo_settings->get_commitmsg_body_size( ). IF lv_body_size > lc_body_col_max. lv_body_size = lc_body_col_max. ENDIF. ro_html->add( |<textarea id="c-body" name="body" rows="10" cols="| && |{ lv_body_size }"></textarea>| ). ro_html->add( '<input type="submit" class="hidden-submit">' ). ro_html->add( '</div>' ). ro_html->add( '<div class="row">' ). ro_html->add( '<span class="cell"></span>' ). ro_html->add( '<span class="cell sub-title">Optionally,' && ' specify author (same as committer by default)</span>' ). ro_html->add( '</div>' ). ro_html->add( render_text_input( iv_name = 'author_name' iv_label = 'author name' ) ). ro_html->add( render_text_input( iv_name = 'author_email' iv_label = 'author e-mail' ) ). ro_html->add( '</form>' ). ro_html->add( '</div>' ). ENDMETHOD. METHOD render_menu. DATA lo_toolbar TYPE REF TO zcl_abapgit_html_toolbar. CREATE OBJECT ro_html. CREATE OBJECT lo_toolbar. lo_toolbar->add( iv_act = 'submitFormById(''commit_form'');' iv_txt = 'Commit' iv_typ = zif_abapgit_html=>c_action_type-onclick iv_opt = zif_abapgit_html=>c_html_opt-strong ) ##NO_TEXT. lo_toolbar->add( iv_act = c_action-commit_cancel iv_txt = 'Cancel' iv_opt = zif_abapgit_html=>c_html_opt-cancel ) ##NO_TEXT. ro_html->add( '<div class="paddings">' ). ro_html->add( lo_toolbar->render( ) ). ro_html->add( '</div>' ). ENDMETHOD. METHOD render_stage. DATA: lt_stage TYPE zcl_abapgit_stage=>ty_stage_tt. FIELD-SYMBOLS: <ls_stage> LIKE LINE OF lt_stage. CREATE OBJECT ro_html. lt_stage = mo_stage->get_all( ). ro_html->add( '<table class="stage_tab">' ). ro_html->add( '<thead>' ). ro_html->add( '<tr>' ). ro_html->add( '<th colspan="2">Staged files</th>' ). ro_html->add( '</tr>' ). ro_html->add( '</thead>' ). ro_html->add( '<tbody>' ). LOOP AT lt_stage ASSIGNING <ls_stage>. ro_html->add( '<tr>' ). ro_html->add( '<td class="method">' ). ro_html->add( zcl_abapgit_stage=>method_description( <ls_stage>-method ) ). ro_html->add( '</td>' ). ro_html->add( '<td>' ). ro_html->add( <ls_stage>-file-path && <ls_stage>-file-filename ). ro_html->add( '</td>' ). ro_html->add( '</tr>' ). ENDLOOP. ro_html->add( '</tbody>' ). ro_html->add( '</table>' ). ENDMETHOD. METHOD render_text_input. DATA lv_attrs TYPE string. CREATE OBJECT ro_html. IF iv_value IS NOT INITIAL. lv_attrs = | value="{ iv_value }"|. ENDIF. IF iv_max_length IS NOT INITIAL. lv_attrs = | maxlength="{ iv_max_length }"|. ENDIF. ro_html->add( '<div class="row">' ). ro_html->add( |<label for="{ iv_name }">{ iv_label }</label>| ). ro_html->add( |<input id="{ iv_name }" name="{ iv_name }" type="text"{ lv_attrs }>| ). ro_html->add( '</div>' ). ENDMETHOD. METHOD scripts. ro_html = super->scripts( ). ro_html->add( 'setInitialFocus("comment");' ). ENDMETHOD. METHOD zif_abapgit_gui_event_handler~on_event. DATA: ls_commit TYPE zcl_abapgit_services_git=>ty_commit_fields. CASE iv_action. WHEN c_action-commit_post. parse_commit_request( EXPORTING it_postdata = it_postdata IMPORTING eg_fields = ls_commit ). ls_commit-repo_key = mo_repo->get_key( ). zcl_abapgit_services_git=>commit( is_commit = ls_commit io_repo = mo_repo io_stage = mo_stage ). MESSAGE 'Commit was successful' TYPE 'S' ##NO_TEXT. ev_state = zcl_abapgit_gui=>c_event_state-go_back_to_bookmark. WHEN c_action-commit_cancel. ev_state = zcl_abapgit_gui=>c_event_state-go_back. WHEN OTHERS. super->zif_abapgit_gui_event_handler~on_event( EXPORTING iv_action = iv_action iv_prev_page = iv_prev_page iv_getdata = iv_getdata it_postdata = it_postdata IMPORTING ei_page = ei_page ev_state = ev_state ). ENDCASE. ENDMETHOD. METHOD zif_abapgit_gui_page_hotkey~get_hotkey_actions. ENDMETHOD. ENDCLASS.
28.71123
95
0.628143
422d6c299ea3a486ff63df1a1dc38f5a4926d680
3,301
abap
ABAP
zif_logger.intf.abap
srps/ABAP-Logger
f4313d29f847893104a108522b6ca743e62176d2
[ "MIT" ]
null
null
null
zif_logger.intf.abap
srps/ABAP-Logger
f4313d29f847893104a108522b6ca743e62176d2
[ "MIT" ]
null
null
null
zif_logger.intf.abap
srps/ABAP-Logger
f4313d29f847893104a108522b6ca743e62176d2
[ "MIT" ]
null
null
null
interface zif_logger public . data handle type balloghndl read-only . data db_number type balognr read-only . data header type bal_s_log read-only . methods add importing obj_to_log type any optional context type simple optional callback_form type csequence optional callback_prog type csequence optional callback_fm type csequence optional type type symsgty optional importance type balprobcl optional preferred parameter obj_to_log returning value(self) type ref to zif_logger . methods a importing obj_to_log type any optional context type simple optional callback_form type csequence optional callback_prog type csequence optional callback_fm type csequence optional importance type balprobcl optional preferred parameter obj_to_log returning value(self) type ref to zif_logger . methods e importing obj_to_log type any optional context type simple optional callback_form type csequence optional callback_prog type csequence optional callback_fm type csequence optional importance type balprobcl optional preferred parameter obj_to_log returning value(self) type ref to zif_logger . methods w importing obj_to_log type any optional context type simple optional callback_form type csequence optional callback_prog type csequence optional callback_fm type csequence optional importance type balprobcl optional preferred parameter obj_to_log returning value(self) type ref to zif_logger . methods i importing obj_to_log type any optional context type simple optional callback_form type csequence optional callback_prog type csequence optional callback_fm type csequence optional importance type balprobcl optional preferred parameter obj_to_log returning value(self) type ref to zif_logger . methods s importing obj_to_log type any optional context type simple optional callback_form type csequence optional callback_prog type csequence optional callback_fm type csequence optional importance type balprobcl optional preferred parameter obj_to_log returning value(self) type ref to zif_logger . methods has_errors returning value(rv_yes) type abap_bool . methods has_warnings returning value(rv_yes) type abap_bool . methods is_empty returning value(rv_yes) type abap_bool . methods length returning value(rv_length) type i . "! Saves the log on demand. Intended to be called at the "! end of the log processing so that logs can be saved depending "! on other criteria, like the existence of error messages. "! If there are no error messages, it may not be desirable to save "! a log. "! If auto save is enabled, save will do nothing. methods save . methods export_to_table returning value(rt_bapiret) type bapirettab . methods fullscreen . methods popup importing log_profile type bal_s_prof optional. endinterface.
28.704348
68
0.695547
422ff2c254128b7e049811b915437df2872cec43
1,481
abap
ABAP
src/zif_abapgit_exit.intf.abap
jeevanrajv1901/ABAPGIT
6d2deece76a481da75a04e4bbafae2d286b64834
[ "MIT" ]
1
2019-05-27T18:50:14.000Z
2019-05-27T18:50:14.000Z
src/zif_abapgit_exit.intf.abap
jeevanrajv1901/ABAPGIT
6d2deece76a481da75a04e4bbafae2d286b64834
[ "MIT" ]
1
2020-01-05T16:45:32.000Z
2020-01-05T16:45:32.000Z
src/zif_abapgit_exit.intf.abap
jeevanrajv1901/ABAPGIT
6d2deece76a481da75a04e4bbafae2d286b64834
[ "MIT" ]
null
null
null
INTERFACE zif_abapgit_exit PUBLIC . TYPES: ty_icm_sinfo2_tt TYPE STANDARD TABLE OF icm_sinfo2 WITH DEFAULT KEY . METHODS change_local_host CHANGING !ct_hosts TYPE ty_icm_sinfo2_tt . METHODS allow_sap_objects RETURNING VALUE(rv_allowed) TYPE abap_bool . METHODS change_proxy_url IMPORTING !iv_repo_url TYPE csequence CHANGING !cv_proxy_url TYPE string . METHODS change_proxy_port IMPORTING !iv_repo_url TYPE csequence CHANGING !cv_proxy_port TYPE string . METHODS change_proxy_authentication IMPORTING !iv_repo_url TYPE csequence CHANGING !cv_proxy_authentication TYPE abap_bool . METHODS create_http_client IMPORTING !iv_url TYPE string RETURNING VALUE(ri_client) TYPE REF TO if_http_client RAISING zcx_abapgit_exception . METHODS http_client IMPORTING !iv_url TYPE string !ii_client TYPE REF TO if_http_client . METHODS change_tadir IMPORTING !iv_package TYPE devclass !ii_log TYPE REF TO zif_abapgit_log CHANGING !ct_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt . METHODS get_ssl_id RETURNING VALUE(rv_ssl_id) TYPE ssfapplssl . METHODS custom_serialize_abap_clif IMPORTING is_class_key TYPE seoclskey RETURNING VALUE(rt_source) TYPE zif_abapgit_definitions=>ty_string_tt RAISING zcx_abapgit_exception. ENDINTERFACE.
25.982456
73
0.713707
4234afbcf2772361cdf5891daf2c0db98279c21f
2,300
abap
ABAP
src/zcl_rap_xco_on_prem_lib.clas.abap
saif4hana/cloud-abap-rap
2781025c84499f38fbd089580ebd4ad89cb5ca4a
[ "Apache-2.0" ]
1
2021-01-31T07:22:51.000Z
2021-01-31T07:22:51.000Z
src/zcl_rap_xco_on_prem_lib.clas.abap
saif4hana/cloud-abap-rap
2781025c84499f38fbd089580ebd4ad89cb5ca4a
[ "Apache-2.0" ]
null
null
null
src/zcl_rap_xco_on_prem_lib.clas.abap
saif4hana/cloud-abap-rap
2781025c84499f38fbd089580ebd4ad89cb5ca4a
[ "Apache-2.0" ]
null
null
null
CLASS zcl_rap_xco_on_prem_lib DEFINITION INHERITING FROM zcl_rap_xco_lib PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. METHODS get_aggregated_annotations REDEFINITION. METHODS get_behavior_definition REDEFINITION. METHODS get_class REDEFINITION. METHODS get_database_table REDEFINITION. METHODS get_data_definition REDEFINITION. METHODS get_metadata_extension REDEFINITION. METHODS get_package REDEFINITION. METHODS get_service_binding REDEFINITION. METHODS get_service_definition REDEFINITION. METHODS get_structure REDEFINITION. METHODS get_view_entity REDEFINITION. METHODS get_view REDEFINITION. METHODS get_entity REDEFINITION. PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS ZCL_RAP_XCO_ON_PREM_LIB IMPLEMENTATION. METHOD get_aggregated_annotations. * ro_aggregated_annotations = xco_cds=>annotations->aggregated->of( io_field ). ENDMETHOD. METHOD get_behavior_definition. * ro_behavior_definition = xco_abap_repository=>object->bdef->for( iv_name ). ENDMETHOD. METHOD get_class. * ro_class = xco_abap_repository=>object->clas->for( iv_name ). ENDMETHOD. METHOD get_database_table. * ro_table = xco_abap_repository=>object->tabl->database_table->for( iv_name ). ENDMETHOD. METHOD get_data_definition. * ro_data_definition = xco_abap_repository=>object->ddls->for( iv_name ). ENDMETHOD. METHOD get_entity. * ro_entity = xco_cds=>view_entity( iv_name ). ENDMETHOD. METHOD get_metadata_extension. * ro_metadata_extension = xco_abap_repository=>object->ddlx->for( iv_name ). ENDMETHOD. METHOD get_package. * ro_package = xco_abap_repository=>object->devc->for( iv_name ). ENDMETHOD. METHOD get_service_binding. * ro_service_binding = xco_abap_repository=>object->srvb->for( iv_name ). ENDMETHOD. METHOD get_service_definition. * ro_service_definition = xco_abap_repository=>object->srvd->for( iv_name ). ENDMETHOD. METHOD get_structure. * ro_structure = xco_abap_repository=>object->tabl->structure->for( iv_name ). ENDMETHOD. METHOD get_view. * ro_view = xco_cds=>view( iv_name ). ENDMETHOD. METHOD get_view_entity. * ro_view_entity = xco_cds=>view_entity( iv_name ). ENDMETHOD. ENDCLASS.
24.731183
83
0.754783
423614bb9b9f59b4b70019c178bcc9d480053e14
15,508
abap
ABAP
src/zcl_wf_static.clas.abap
ivangurin/abapWF
8484fa73487d915f017db0dee31c16818b16e5ad
[ "MIT" ]
null
null
null
src/zcl_wf_static.clas.abap
ivangurin/abapWF
8484fa73487d915f017db0dee31c16818b16e5ad
[ "MIT" ]
null
null
null
src/zcl_wf_static.clas.abap
ivangurin/abapWF
8484fa73487d915f017db0dee31c16818b16e5ad
[ "MIT" ]
null
null
null
class zcl_wf_static definition public final create public . *"* public components of class ZCL_WF_STATIC *"* do not include other source files here!!! public section. class-methods lock importing !i_wi_id type sww_wiid raising zcx_generic . class-methods unlock importing !i_wi_id type sww_wiid . class-methods get_value importing !i_wi_id type sww_wiid !i_name type swfdname exporting !e_value type any raising zcx_generic . class-methods set_value importing !i_wi_id type sww_wiid !i_name type swfdname !i_value type any !i_commit type abap_bool default abap_false raising zcx_generic . class-methods get_container importing !i_wi_id type sww_wiid exporting !et_cont type swrtcont raising zcx_generic . class-methods set_container importing !i_wi_id type sww_wiid !it_cont type swrtcont !i_commit type abap_bool default abap_false raising zcx_generic . class-methods get_context importing !i_id type sww_wiid returning value(er_context) type ref to if_wapi_workitem_context raising zcx_generic . class-methods complete importing !i_wi_id type sww_wiid !it_cont type swrtcont optional !i_commit type abap_bool default abap_false raising zcx_generic . class-methods complete_manual importing !i_id type simple raising zcx_generic . class-methods get_wi_by_users importing !it_users type zirange !i_task_id type simple returning value(et_wi) type stringtab . class-methods get_substitutes importing !i_user type simple default sy-uname !i_substitutes type abap_bool default abap_true changing !ct_substitutes type stringtab . class-methods forward importing !i_id type simple !i_to type simple default sy-uname !i_by type simple default sy-uname raising zcx_generic . protected section. *"* protected components of class ZCL_WF_STATIC *"* do not include other source files here!!! private section. ENDCLASS. CLASS ZCL_WF_STATIC IMPLEMENTATION. method complete. data: l_rc like sy-subrc, lt_messages type table of swr_mstruc, ls_message like line of lt_messages. call function 'SAP_WAPI_WORKITEM_COMPLETE' exporting workitem_id = i_wi_id do_commit = i_commit importing return_code = l_rc tables simple_container = it_cont message_struct = lt_messages. loop at lt_messages transporting no fields where msgty ca 'EAX'. zcx_generic=>raise( it_messages = lt_messages ). endloop. endmethod. method complete_manual. constants: notes_contelem_name type swc_elem value swfco_notes_contelem_name, attach_contelem_name type swc_elem value swfco_attach_contelem_name, adhoc_contelem_name type swc_elem value swfco_adhoc_contelem_name, wi_comp_event_name type swc_elem value swfco_wi_comp_event_name, wi_comp_event_objtype type swc_elem value swfco_wi_comp_event_objtype, wi_comp_event_objkey type swc_elem value swfco_wi_comp_event_objkey, wi_comp_event_catid type swc_elem value swfco_wi_comp_event_catid. data l_id type swwwihead-wi_id. l_id = i_id. data ls_flow_info type swp_wi_req. call function 'SWP_WI_CREATOR_GET' exporting wi_id = l_id importing wi_req_workflow = ls_flow_info exceptions no_parent_workflow = 1. if sy-subrc ne 0. zcx_generic=>raise( ). endif. data ls_wf_def_key type swd_wfdkey. call function 'SWP_WF_DEFINITION_KEY_GET' exporting wf_id = ls_flow_info-wf_id importing wf_def_key = ls_wf_def_key exceptions workflow_not_found = 1. if sy-subrc ne 0. zcx_generic=>raise( ). endif. data ls_flowitem type swlc_workitem. call function 'SWL_WI_HEADER_READ' exporting wi_id = ls_flow_info-wf_id changing workitem = ls_flowitem exceptions workitem_not_found = 1. if sy-subrc ne 0. zcx_generic=>raise( ). endif. data l_task type swd_ahead-task. l_task = ls_flowitem-wi_rh_task. data l_tab_results type swd_data-xfeld. data lt_successor_events type table of swd_succes. call function 'SWD_GET_SUCCESSOR_EVENTS' exporting act_wfdkey = ls_wf_def_key act_task = l_task act_nodeid = ls_flow_info-node_id importing tab_result = l_tab_results tables successor_events = lt_successor_events exceptions workflow_not_found = 1 node_not_found = 2. if sy-subrc ne 0. zcx_generic=>raise( ). endif. data lt_modeled_event_data type table of swl_succes. zcl_abap_static=>table2table( exporting it_data = lt_successor_events importing et_data = lt_modeled_event_data ). data ls_modeled_event_data like line of lt_modeled_event_data. read table lt_modeled_event_data into ls_modeled_event_data with key evt_type = 'EXECUTED'. check sy-subrc eq 0. try. data lr_txmgr type ref to cl_swf_run_transaction_manager. lr_txmgr = cl_swf_run_transaction_manager=>get_instance( im_enqueue_owner = 'SWW_WI_MANUALLY_COMPLETE' ). data lr_wi_handle type ref to if_swf_run_wim_internal. lr_wi_handle = cl_swf_run_wim_factory=>find_by_wiid( im_wiid = l_id im_read_for_update = 'X' im_tx = lr_txmgr ). data lr_container type ref to if_swf_cnt_container. lr_container = lr_wi_handle->get_wi_container( ). data lr_result type ref to cl_swf_run_result. lr_result = cl_swf_run_result=>get_instance( im_wi_handle = lr_wi_handle ). if ls_modeled_event_data-evt_result eq abap_true or ( ls_modeled_event_data-evt_except eq abap_true and ls_modeled_event_data-return eq '0000' ). data l_result_string type string. l_result_string = ls_modeled_event_data-returncode. data ls_swf_return type swf_return. lr_result->set_main_method_result( im_return = ls_swf_return im_result_string = l_result_string ). swf_set_element lr_container swfco_wi_result_const l_result_string. elseif ls_modeled_event_data-evt_detevt eq abap_true. data name type swfdname. name = ls_modeled_event_data-evt_contel. data ls_ibfobject type sibflporb. swf_get_element lr_container name ls_ibfobject. data l_event_name type sibfevent. l_event_name = ls_modeled_event_data-evt_type. data lr_event type ref to if_swf_run_wim_event. lr_event = cl_swf_run_event=>get_instance( im_event = l_event_name im_sender = ls_ibfobject ). lr_result->set_event( im_event = lr_event ). swf_set_element lr_container wi_comp_event_name ls_modeled_event_data-evt_type. if ls_modeled_event_data-evt_catid is initial. ls_modeled_event_data-evt_catid = swfco_objtype_bor. endif. swf_set_element lr_container wi_comp_event_catid ls_modeled_event_data-evt_catid. swf_set_element lr_container wi_comp_event_objtype ls_modeled_event_data-evt_otype. swf_set_element lr_container wi_comp_event_objkey ls_ibfobject-instid. elseif ls_modeled_event_data-evt_desevt eq abap_true. l_result_string = ls_modeled_event_data-returncode. lr_result->set_main_method_result( im_return = ls_swf_return im_result_string = l_result_string ). swf_set_element lr_container swfco_wi_result_const l_result_string. elseif ls_modeled_event_data-evt_except eq abap_true. data ls_exception_data type sww_excdat. ls_exception_data-return-code = ls_modeled_event_data-return. if ls_modeled_event_data-error_1 eq 'X'. ls_exception_data-return-errortype = 1. elseif ls_modeled_event_data-error_2 eq 'X'. ls_exception_data-return-errortype = 2. endif. ls_exception_data-return-workarea = ls_modeled_event_data-arbgb. ls_exception_data-return-message = ls_modeled_event_data-msgnr. ls_exception_data-return-msgtyp = 'W'. lr_result->set_exception( im_exception_data = ls_exception_data ). endif. data ls_result_for_container type swf_wiresult. ls_result_for_container = lr_result->get_result( ). data ls_result_manually type swf_wiresult_manually_complete. move-corresponding ls_result_for_container to ls_result_manually. if lr_wi_handle->m_sww_wihead-wi_type eq swfco_wi_batch. while lr_wi_handle->m_sww_wihead-retry_cnt lt 99. lr_wi_handle->increment_retry_counter( ). endwhile. endif. if ls_result_for_container-type eq ls_result_manually-type and ls_result_for_container-value eq ls_result_manually-value. lr_container->element_set( exporting name = swfco_manually_result_const value = ls_result_manually ). call method lr_txmgr->save( ). call method lr_txmgr->commit( ). else. endif. call method lr_txmgr->dequeue( ). data lr_excp type ref to cx_swf_ifs_exception. catch cx_swf_ifs_exception into lr_excp. endtry. check lr_wi_handle->m_sww_wihead-wi_stat ne 'ERROR'. call function 'SWW_WI_ADMIN_COMPLETE' exporting wi_id = l_id do_commit = abap_true authorization_checked = abap_false exceptions update_failed = 01 infeasible_state_transition = 03 no_authorization = 02. if sy-subrc ne 0. zcx_generic=>raise( ). endif. endmethod. method forward. check i_id is not initial. data l_id type swwwihead-wi_id. l_id = i_id. data l_to type sy-uname. l_to = i_to. data l_by type sy-uname. l_by = i_by. call function 'SAP_WAPI_FORWARD_WORKITEM' exporting workitem_id = l_id user_id = l_to current_user = l_by do_commit = abap_true. endmethod. method get_container. data: l_rc like sy-subrc, lt_messages type table of swr_mstruc, ls_message like line of lt_messages. call function 'SAP_WAPI_READ_CONTAINER' exporting workitem_id = i_wi_id importing return_code = l_rc tables simple_container = et_cont message_struct = lt_messages. loop at lt_messages transporting no fields where msgty ca 'EAX'. zcx_generic=>raise( it_messages = lt_messages ). endloop. endmethod. method get_context. try. er_context ?= cl_swf_run_workitem_context=>get_instance( i_id ). data lx_root type ref to cx_root. catch cx_root into lx_root. zcx_generic=>raise( ix_root = lx_root ). endtry. endmethod. method get_substitutes. data ls_substituted_object type swragent. ls_substituted_object-otype = 'US'. ls_substituted_object-objid = i_user. data lt_substitutes type table of swr_substitute. call function 'SAP_WAPI_SUBSTITUTES_GET' exporting substituted_object = ls_substituted_object tables substitutes = lt_substitutes. data ls_substitute like line of lt_substitutes. loop at lt_substitutes into ls_substitute. read table ct_substitutes transporting no fields with key table_line = ls_substitute-objid. check sy-subrc ne 0. data l_substitute like line of ct_substitutes. l_substitute = ls_substitute-objid. insert l_substitute into table ct_substitutes. get_substitutes( exporting i_user = l_substitute changing ct_substitutes = ct_substitutes ). endloop. endmethod. method get_value. " Get contaner handle data lo_cont type ref to if_swf_cnt_container. call function 'SWW_WI_CONTAINER_READ' exporting wi_id = i_wi_id importing wi_container_handle = lo_cont exceptions container_does_not_exist = 1 read_failed = 2 others = 3. if sy-subrc ne 0. zcx_generic=>raise( ). endif. " Get value try. lo_cont->if_swf_cnt_element_access_1~element_get_value( exporting name = i_name importing value = e_value ). data lx_root type ref to cx_root. catch cx_root into lx_root. zcx_generic=>raise( ix_root = lx_root ). endtry. endmethod. method get_wi_by_users. select user~wi_id from swwuserwi as user join swwwihead as ts on ts~wi_id eq user~wi_id into table et_wi where user~user_id in it_users and user~task_obj eq i_task_id. endmethod. method lock. call function 'SWL_WI_ENQUEUE' exporting wi_id = i_wi_id exceptions wi_locked_by_another_user = 1 wi_enqueue_failed = 2 others = 3. if sy-subrc <> 0. zcx_generic=>raise( ). endif. endmethod. method set_container. data: l_rc like sy-subrc, lt_messages type table of swr_mstruc, ls_message like line of lt_messages. call function 'SAP_WAPI_WRITE_CONTAINER' exporting workitem_id = i_wi_id do_commit = i_commit importing return_code = l_rc tables simple_container = it_cont message_struct = lt_messages. loop at lt_messages transporting no fields where msgty ca 'EAX'. zcx_generic=>raise( it_messages = lt_messages ). endloop. endmethod. method set_value. data: lt_cont type swrtcont, ls_cont like line of lt_cont. ls_cont-element = i_name. ls_cont-value = i_value. insert ls_cont into table lt_cont. set_container( i_wi_id = i_wi_id it_cont = lt_cont i_commit = i_commit ). endmethod. method unlock. call function 'DEQUEUE_E_WORKITEM' exporting wi_id = i_wi_id. endmethod. ENDCLASS.
27.643494
104
0.62903
4238d484bed0fc49cdb98dcb63f25e6563dee2f5
1,271
abap
ABAP
src/zbc_idoc_cfg.fugr.saplzbc_idoc_cfg.abap
engswee/equalize-idoc-framework
0d08659a9633d7c54be5da959d7839ce4c38fb8f
[ "MIT" ]
1
2019-04-23T07:12:21.000Z
2019-04-23T07:12:21.000Z
src/zbc_idoc_cfg.fugr.saplzbc_idoc_cfg.abap
engswee/equalize-idoc-framework
0d08659a9633d7c54be5da959d7839ce4c38fb8f
[ "MIT" ]
null
null
null
src/zbc_idoc_cfg.fugr.saplzbc_idoc_cfg.abap
engswee/equalize-idoc-framework
0d08659a9633d7c54be5da959d7839ce4c38fb8f
[ "MIT" ]
null
null
null
* regenerated at 13.02.2019 15:18:48 ******************************************************************* * System-defined Include-files. * ******************************************************************* INCLUDE LZBC_IDOC_CFGTOP. " Global Declarations INCLUDE LZBC_IDOC_CFGUXX. " Function Modules ******************************************************************* * User-defined Include-files (if necessary). * ******************************************************************* * INCLUDE LZBC_IDOC_CFGF... " Subroutines * INCLUDE LZBC_IDOC_CFGO... " PBO-Modules * INCLUDE LZBC_IDOC_CFGI... " PAI-Modules * INCLUDE LZBC_IDOC_CFGE... " Events * INCLUDE LZBC_IDOC_CFGP... " Local class implement. * INCLUDE LZBC_IDOC_CFGT99. " ABAP Unit tests INCLUDE LZBC_IDOC_CFGF00 . " subprograms INCLUDE LZBC_IDOC_CFGI00 . " PAI modules INCLUDE LSVIMFXX . " subprograms INCLUDE LSVIMOXX . " PBO modules INCLUDE LSVIMIXX . " PAI modules
57.772727
69
0.397325
423dde3292bcdd899d4c090899fcb84dfc4bd73e
2,452
abap
ABAP
src/http/cl_http_utility.clas.abap
sbcgua/open-abap
98d939658ec0db2a1ff2bd6979d7c9b52dc9dc5e
[ "MIT" ]
20
2020-10-02T09:37:08.000Z
2022-03-26T15:29:11.000Z
src/http/cl_http_utility.clas.abap
sbcgua/open-abap
98d939658ec0db2a1ff2bd6979d7c9b52dc9dc5e
[ "MIT" ]
28
2020-12-02T15:19:10.000Z
2022-03-24T06:12:47.000Z
src/http/cl_http_utility.clas.abap
sbcgua/open-abap
98d939658ec0db2a1ff2bd6979d7c9b52dc9dc5e
[ "MIT" ]
2
2020-11-17T13:21:38.000Z
2021-11-07T14:35:54.000Z
CLASS cl_http_utility DEFINITION PUBLIC. PUBLIC SECTION. CLASS-METHODS decode_x_base64 IMPORTING encoded TYPE string RETURNING VALUE(decoded) TYPE xstring. CLASS-METHODS unescape_url IMPORTING escaped TYPE string RETURNING VALUE(unescaped) TYPE string. CLASS-METHODS encode_base64 IMPORTING data TYPE string RETURNING VALUE(encoded) TYPE string. CLASS-METHODS encode_x_base64 IMPORTING data TYPE xstring RETURNING VALUE(encoded) TYPE string. CLASS-METHODS fields_to_string IMPORTING fields TYPE tihttpnvp RETURNING VALUE(string) TYPE string. CLASS-METHODS string_to_fields IMPORTING string TYPE string RETURNING VALUE(fields) TYPE tihttpnvp. CLASS-METHODS set_query IMPORTING request TYPE REF TO if_http_request query TYPE string. ENDCLASS. CLASS cl_http_utility IMPLEMENTATION. METHOD string_to_fields. DATA tab TYPE STANDARD TABLE OF string. DATA str LIKE LINE OF tab. DATA ls_field LIKE LINE OF fields. SPLIT string AT '&' INTO TABLE tab. LOOP AT tab INTO str. SPLIT str AT '=' INTO ls_field-name ls_field-value. APPEND ls_field TO fields. ENDLOOP. ENDMETHOD. METHOD set_query. request->set_form_fields( string_to_fields( query ) ). ENDMETHOD. METHOD fields_to_string. DATA tab TYPE STANDARD TABLE OF string. DATA str TYPE string. DATA ls_field LIKE LINE OF fields. LOOP AT fields INTO ls_field. str = ls_field-name && '=' && ls_field-value. APPEND str TO tab. ENDLOOP. string = concat_lines_of( table = tab sep = '&' ). ENDMETHOD. METHOD encode_x_base64. WRITE '@KERNEL let buffer = Buffer.from(data.get(), "hex");'. WRITE '@KERNEL encoded.set(buffer.toString("base64"));'. ENDMETHOD. METHOD decode_x_base64. WRITE '@KERNEL let buffer = Buffer.from(encoded.get(), "base64");'. WRITE '@KERNEL decoded.set(buffer.toString("hex").toUpperCase());'. ENDMETHOD. METHOD unescape_url. " todo, this can probably be done in ABAP with a few regex'es WRITE '@KERNEL unescaped.set(decodeURI(escaped.get()));'. ENDMETHOD. METHOD encode_base64. WRITE '@KERNEL let buffer = Buffer.from(data.get());'. WRITE '@KERNEL encoded.set(buffer.toString("base64"));'. ENDMETHOD. ENDCLASS.
25.810526
71
0.665987
423e1aed8074efa71e9c69b880604a7b33ac120a
11,777
abap
ABAP
lbn-gtt-template-tpo/ABAP/zsrc/zpof_gtt.fugr.lzpof_gttd11.abap
DanHaer/logistics-business-network-gtt-samples
739978ac389da6f3530b26cd6402a3892f4b605a
[ "Apache-2.0" ]
null
null
null
lbn-gtt-template-tpo/ABAP/zsrc/zpof_gtt.fugr.lzpof_gttd11.abap
DanHaer/logistics-business-network-gtt-samples
739978ac389da6f3530b26cd6402a3892f4b605a
[ "Apache-2.0" ]
null
null
null
lbn-gtt-template-tpo/ABAP/zsrc/zpof_gtt.fugr.lzpof_gttd11.abap
DanHaer/logistics-business-network-gtt-samples
739978ac389da6f3530b26cd6402a3892f4b605a
[ "Apache-2.0" ]
null
null
null
*&---------------------------------------------------------------------* *& Local class definition - General for Actual Events *&---------------------------------------------------------------------* ********************************************************************** ********************************************************************** ********************************************************************** CLASS lcl_ae_performer DEFINITION. PUBLIC SECTION. CLASS-METHODS check_relevance IMPORTING is_definition TYPE lif_ef_types=>ts_definition io_ae_factory TYPE REF TO lif_ae_factory iv_appsys TYPE /saptrx/applsystem is_event_type TYPE /saptrx/evtypes it_all_appl_tables TYPE trxas_tabcontainer it_event_type_cntl_tabs TYPE trxas_eventtype_tabs OPTIONAL is_events TYPE trxas_evt_ctab_wa RETURNING VALUE(rv_result) TYPE lif_ef_types=>tv_condition RAISING cx_udm_message. CLASS-METHODS get_event_data IMPORTING is_definition TYPE lif_ef_types=>ts_definition io_ae_factory TYPE REF TO lif_ae_factory iv_appsys TYPE /saptrx/applsystem is_event_type TYPE /saptrx/evtypes it_all_appl_tables TYPE trxas_tabcontainer it_event_type_cntl_tabs TYPE trxas_eventtype_tabs it_events TYPE trxas_evt_ctabs CHANGING ct_eventid_map TYPE trxas_evtid_evtcnt_map ct_trackingheader TYPE lif_ae_types=>tt_trackingheader ct_tracklocation TYPE lif_ae_types=>tt_tracklocation ct_trackreferences TYPE lif_ae_types=>tt_trackreferences ct_trackparameters TYPE lif_ae_types=>tt_trackparameters RAISING cx_udm_message. ENDCLASS. CLASS lcl_ae_performer IMPLEMENTATION. METHOD check_relevance. DATA: lt_events TYPE trxas_evt_ctabs. lt_events = VALUE #( ( is_events ) ). DATA(lo_ae_processor) = io_ae_factory->get_ae_processor( is_definition = is_definition io_ae_factory = io_ae_factory iv_appsys = iv_appsys is_event_type = is_event_type it_all_appl_tables = it_all_appl_tables it_event_type_cntl_tabs = it_event_type_cntl_tabs it_events = lt_events ). lo_ae_processor->check_events( ). rv_result = lo_ae_processor->check_relevance( ). ENDMETHOD. METHOD get_event_data. DATA(lo_ae_processor) = io_ae_factory->get_ae_processor( is_definition = is_definition io_ae_factory = io_ae_factory iv_appsys = iv_appsys is_event_type = is_event_type it_all_appl_tables = it_all_appl_tables it_event_type_cntl_tabs = it_event_type_cntl_tabs it_events = it_events ). lo_ae_processor->check_events( ). lo_ae_processor->get_event_data( CHANGING ct_eventid_map = ct_eventid_map ct_trackingheader = ct_trackingheader ct_tracklocation = ct_tracklocation ct_trackreferences = ct_trackreferences ct_trackparameters = ct_trackparameters ). ENDMETHOD. ENDCLASS. CLASS lcl_ae_processor DEFINITION. PUBLIC SECTION. INTERFACES lif_ae_processor. METHODS constructor IMPORTING is_definition TYPE lif_ef_types=>ts_definition io_ae_parameters TYPE REF TO lif_ae_parameters io_ae_filler TYPE REF TO lif_ae_filler. PRIVATE SECTION. DATA: ms_definition TYPE lif_ef_types=>ts_definition, mo_ae_parameters TYPE REF TO lif_ae_parameters, mo_ae_filler TYPE REF TO lif_ae_filler. ENDCLASS. CLASS lcl_ae_processor IMPLEMENTATION. METHOD constructor. ms_definition = is_definition. mo_ae_parameters = io_ae_parameters. mo_ae_filler = io_ae_filler. ENDMETHOD. METHOD lif_ae_processor~check_events. DATA: lr_events TYPE REF TO data, lv_dummy TYPE char100. FIELD-SYMBOLS: <lt_events> TYPE trxas_evt_ctabs. lr_events = mo_ae_parameters->get_events( ). ASSIGN lr_events->* TO <lt_events>. LOOP AT <lt_events> ASSIGNING FIELD-SYMBOL(<ls_events>). IF <ls_events>-maintabdef <> ms_definition-maintab. MESSAGE e087(/saptrx/asc) WITH <ls_events>-maintabdef mo_ae_parameters->get_event_type( )-eventdatafunc <ls_events>-eventtype mo_ae_parameters->get_appsys( ) INTO lv_dummy. lcl_tools=>throw_exception( iv_textid = lif_ef_constants=>cs_errors-table_determination ). ELSEIF ms_definition-mastertab IS NOT INITIAL AND <ls_events>-mastertabdef <> ms_definition-mastertab. MESSAGE e088(/saptrx/asc) WITH <ls_events>-mastertabdef mo_ae_parameters->get_event_type( )-eventdatafunc <ls_events>-eventtype mo_ae_parameters->get_appsys( ) INTO lv_dummy. lcl_tools=>throw_exception( iv_textid = lif_ef_constants=>cs_errors-table_determination ). ENDIF. ENDLOOP. ENDMETHOD. METHOD lif_ae_processor~check_relevance. DATA(lr_events) = mo_ae_parameters->get_events( ). FIELD-SYMBOLS <lt_events> TYPE trxas_evt_ctabs. ASSIGN lr_events->* TO <lt_events>. rv_result = lif_ef_constants=>cs_condition-false. LOOP AT <lt_events> ASSIGNING FIELD-SYMBOL(<ls_events>). rv_result = mo_ae_filler->check_relevance( is_events = <ls_events> ). IF rv_result = lif_ef_constants=>cs_condition-true. EXIT. ENDIF. ENDLOOP. ENDMETHOD. METHOD lif_ae_processor~get_event_data. DATA: lt_eventid_map TYPE trxas_evtid_evtcnt_map, lt_trackingheader TYPE lif_ae_types=>tt_trackingheader, lt_tracklocation TYPE lif_ae_types=>tt_tracklocation, lt_trackreferences TYPE lif_ae_types=>tt_trackreferences, lt_trackparameters TYPE lif_ae_types=>tt_trackparameters. DATA(lr_events) = mo_ae_parameters->get_events( ). FIELD-SYMBOLS <lt_events> TYPE trxas_evt_ctabs. ASSIGN lr_events->* TO <lt_events>. LOOP AT <lt_events> ASSIGNING FIELD-SYMBOL(<ls_events>) WHERE maintabdef = ms_definition-maintab. mo_ae_filler->get_event_data( EXPORTING is_events = <ls_events> CHANGING ct_eventid_map = lt_eventid_map ct_trackingheader = lt_trackingheader ct_tracklocation = lt_tracklocation ct_trackreferences = lt_trackreferences ct_trackparameters = lt_trackparameters ). ENDLOOP. " Add all the changes to result tables in the end of the method, " so that in case of exceptions there will be no inconsistent data in them ct_eventid_map[] = VALUE #( BASE ct_eventid_map ( LINES OF lt_eventid_map ) ). ct_trackingheader[] = VALUE #( BASE ct_trackingheader ( LINES OF lt_trackingheader ) ). ct_tracklocation[] = VALUE #( BASE ct_tracklocation ( LINES OF lt_tracklocation ) ). ct_trackreferences[] = VALUE #( BASE ct_trackreferences ( LINES OF lt_trackreferences ) ). ct_trackparameters[] = VALUE #( BASE ct_trackparameters ( LINES OF lt_trackparameters ) ). ENDMETHOD. ENDCLASS. ********************************************************************** ********************************************************************** ********************************************************************** CLASS lcl_ae_parameters DEFINITION. PUBLIC SECTION. INTERFACES: lif_ae_parameters. METHODS constructor IMPORTING iv_appsys TYPE /saptrx/applsystem is_event_type TYPE /saptrx/evtypes it_all_appl_tables TYPE trxas_tabcontainer it_event_type_cntl_tabs TYPE trxas_eventtype_tabs it_events TYPE trxas_evt_ctabs. PRIVATE SECTION. DATA: mv_appsys TYPE /saptrx/applsystem, ms_event_type TYPE /saptrx/evtypes, mr_all_appl_tables TYPE REF TO data, "trxas_tabcontainer mr_event_type_cntl_tabs TYPE REF TO data, "trxas_eventtype_tabs mr_events TYPE REF TO data. "trxas_evt_ctabs ENDCLASS. CLASS lcl_ae_parameters IMPLEMENTATION. METHOD constructor. mv_appsys = iv_appsys. ms_event_type = is_event_type. mr_all_appl_tables = REF #( it_all_appl_tables ). mr_event_type_cntl_tabs = REF #( it_event_type_cntl_tabs ). mr_events = REF #( it_events ). ENDMETHOD. METHOD lif_ae_parameters~get_appl_table. TRY. FIELD-SYMBOLS: <lt_all_appl_tables> TYPE trxas_tabcontainer. ASSIGN mr_all_appl_tables->* TO <lt_all_appl_tables>. rr_data = <lt_all_appl_tables>[ tabledef = iv_tabledef ]-tableref. CATCH cx_sy_itab_line_not_found. MESSAGE e008(/saptrx/asc) WITH iv_tabledef ms_event_type-eventdatafunc INTO DATA(lv_dummy). lcl_tools=>throw_exception( iv_textid = lif_ef_constants=>cs_errors-stop_processing ). ENDTRY. ENDMETHOD. METHOD lif_ae_parameters~get_appsys. rv_appsys = mv_appsys. ENDMETHOD. METHOD lif_ae_parameters~get_events. rr_data = mr_events. ENDMETHOD. METHOD lif_ae_parameters~get_event_type. rs_event_type = ms_event_type. ENDMETHOD. ENDCLASS. ********************************************************************** ********************************************************************** ********************************************************************** CLASS lcl_ae_factory DEFINITION ABSTRACT. PUBLIC SECTION. INTERFACES: lif_ae_factory ABSTRACT METHODS get_ae_filler. ENDCLASS. CLASS lcl_ae_factory IMPLEMENTATION. METHOD lif_ae_factory~get_ae_parameters. ro_ae_parameters = NEW lcl_ae_parameters( iv_appsys = iv_appsys is_event_type = is_event_type it_all_appl_tables = it_all_appl_tables it_event_type_cntl_tabs = it_event_type_cntl_tabs it_events = it_events ). ENDMETHOD. METHOD lif_ae_factory~get_ae_processor. DATA: lo_ae_parameters TYPE REF TO lif_ae_parameters, lo_ae_filler TYPE REF TO lif_ae_filler. lo_ae_parameters = lif_ae_factory~get_ae_parameters( iv_appsys = iv_appsys is_event_type = is_event_type it_all_appl_tables = it_all_appl_tables it_event_type_cntl_tabs = it_event_type_cntl_tabs it_events = it_events ). lo_ae_filler = lif_ae_factory~get_ae_filler( io_ae_parameters = lo_ae_parameters ). ro_ae_processor = NEW lcl_ae_processor( is_definition = is_definition io_ae_parameters = lo_ae_parameters io_ae_filler = lo_ae_filler ). ENDMETHOD. ENDCLASS.
37.387302
81
0.590728
424052776b9639f6568c899c530e44ece9c2a1f4
2,329
abap
ABAP
src/api/zcl_cilib_api_resource_base.clas.abap
flaiker/ci-lib
80cb7704d0f0bb1242f104c0175cf95dfa29d987
[ "MIT" ]
10
2018-12-23T20:06:08.000Z
2021-03-20T07:44:13.000Z
src/api/zcl_cilib_api_resource_base.clas.abap
Saurabhsharma009/ci-lib
3e53b77f632bb703522868d7c2bb7441d52feafb
[ "MIT" ]
11
2018-12-22T16:39:28.000Z
2020-06-10T07:36:35.000Z
src/api/zcl_cilib_api_resource_base.clas.abap
Saurabhsharma009/ci-lib
3e53b77f632bb703522868d7c2bb7441d52feafb
[ "MIT" ]
3
2019-11-16T13:43:44.000Z
2021-07-26T10:02:12.000Z
"! REST resource base class CLASS zcl_cilib_api_resource_base DEFINITION PUBLIC ABSTRACT INHERITING FROM cl_rest_resource CREATE PUBLIC. PUBLIC SECTION. PROTECTED SECTION. TYPES: BEGIN OF gty_format, request TYPE string, response TYPE string, END OF gty_format. CONSTANTS: gc_uri_format_parameter_name TYPE string VALUE `format`, gc_uri_format_value_json TYPE string VALUE `json`, gc_uri_format_value_xml TYPE string VALUE `xml`, gc_format_json TYPE string VALUE `application/json`, gc_format_xml TYPE string VALUE `application/xml`, gc_header_fallback TYPE string VALUE gc_format_json. METHODS: determine_format RETURNING VALUE(rs_format) TYPE gty_format RAISING cx_rest_parser_error, get_supported_content_types RETURNING VALUE(rt_content_types) TYPE string_table. PRIVATE SECTION. ENDCLASS. CLASS zcl_cilib_api_resource_base IMPLEMENTATION. METHOD determine_format. DATA(lv_format) = mo_request->get_uri_query_parameter( gc_uri_format_parameter_name ). IF lv_format = gc_uri_format_value_json. rs_format-request = rs_format-response = gc_format_json. ELSEIF lv_format = gc_uri_format_value_xml. rs_format-request = rs_format-response = gc_format_xml. ELSEIF lv_format IS NOT INITIAL. RAISE EXCEPTION TYPE cx_rest_parser_error. ENDIF. CHECK rs_format IS INITIAL. DATA(lv_accept) = mo_request->get_header_field( if_http_header_fields=>accept ). IF lv_accept IS INITIAL. lv_accept = gc_header_fallback. ENDIF. DATA(lv_response_content_type) = cl_rest_http_utils=>negotiate_content_type( iv_header_accept = lv_accept it_supported_content_type = get_supported_content_types( ) ). rs_format-response = lv_response_content_type. DATA(lv_request_content_type) = mo_request->get_header_field( if_http_header_fields=>content_type ). IF lv_request_content_type IS INITIAL. lv_request_content_type = gc_header_fallback. ENDIF. rs_format-request = lv_request_content_type. ENDMETHOD. METHOD get_supported_content_types. rt_content_types = VALUE #( ( gc_format_json ) ( gc_format_xml ) ). ENDMETHOD. ENDCLASS.
32.802817
104
0.727351
424189175189f8c10ed075466134567fe9d6e836
3,604
abap
ABAP
src/sources/zcl_abak_source_factory.clas.abap
Sdfraga/abaK
04ec4a436429ec7f8145bbfad93adc41733929b1
[ "MIT" ]
38
2018-12-13T09:03:30.000Z
2022-02-11T17:57:33.000Z
src/sources/zcl_abak_source_factory.clas.abap
Sdfraga/abaK
04ec4a436429ec7f8145bbfad93adc41733929b1
[ "MIT" ]
59
2018-12-13T09:20:02.000Z
2019-12-10T09:40:25.000Z
src/sources/zcl_abak_source_factory.clas.abap
Sdfraga/abaK
04ec4a436429ec7f8145bbfad93adc41733929b1
[ "MIT" ]
14
2018-12-15T18:17:07.000Z
2019-04-23T08:32:56.000Z
CLASS zcl_abak_source_factory DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. METHODS get_instance IMPORTING !i_source_type TYPE zabak_source_type !i_content TYPE string RETURNING value(ro_content) TYPE REF TO zif_abak_source RAISING zcx_abak . PROTECTED SECTION. PRIVATE SECTION. CONSTANTS gc_so10_id_default TYPE tdid VALUE 'ST'. "#EC NOTEXT METHODS get_instance_so10 IMPORTING !i_content TYPE string RETURNING value(ro_content) TYPE REF TO zif_abak_source RAISING zcx_abak . METHODS get_instance_rfc IMPORTING !i_content TYPE string RETURNING value(ro_content) TYPE REF TO zif_abak_source RAISING zcx_abak . ENDCLASS. CLASS ZCL_ABAK_SOURCE_FACTORY IMPLEMENTATION. METHOD get_instance. CASE i_source_type. WHEN zif_abak_consts=>source_type-inline. CREATE OBJECT ro_content TYPE zcl_abak_source_inline EXPORTING i_content = i_content. WHEN zif_abak_consts=>source_type-url. CREATE OBJECT ro_content TYPE zcl_abak_source_url EXPORTING i_url = i_content. WHEN zif_abak_consts=>source_type-file. CREATE OBJECT ro_content TYPE zcl_abak_source_file EXPORTING i_filepath = i_content. WHEN zif_abak_consts=>source_type-database. CREATE OBJECT ro_content TYPE zcl_abak_source_database EXPORTING i_tablename = i_content. WHEN zif_abak_consts=>source_type-standard_text. ro_content = get_instance_so10( i_content ). WHEN zif_abak_consts=>source_type-rfc. ro_content = get_instance_rfc( i_content ). WHEN OTHERS. RAISE EXCEPTION TYPE zcx_abak EXPORTING textid = zcx_abak=>invalid_parameters. ENDCASE. ENDMETHOD. METHOD get_instance_rfc. DATA: o_params TYPE REF TO zif_abak_params, rfcdest TYPE rfcdest, id TYPE zabak_id. o_params = zcl_abak_params=>create_instance( i_params = i_content i_paramsdef = '+RFCDEST(32) +ID' ). id = o_params->get( 'ID' ). rfcdest = o_params->get( 'RFCDEST' ). CREATE OBJECT ro_content TYPE zcl_abak_source_rfc EXPORTING i_id = id i_rfcdest = rfcdest. ENDMETHOD. METHOD get_instance_so10. DATA: o_params TYPE REF TO zif_abak_params, name TYPE tdobname, id TYPE tdid, language TYPE char2, spras TYPE spras. o_params = zcl_abak_params=>create_instance( i_params = i_content i_paramsdef = '+NAME(70) ID(4) LANGUAGE(2)' ). name = o_params->get( 'NAME' ). id = o_params->get( 'ID' ). IF id IS INITIAL. id = gc_so10_id_default. ENDIF. language = o_params->get( 'LANGUAGE' ). IF language IS NOT INITIAL. CALL FUNCTION 'CONVERSION_EXIT_ISOLA_INPUT' EXPORTING input = language IMPORTING output = spras EXCEPTIONS unknown_language = 1 OTHERS = 2. IF sy-subrc <> 0. RAISE EXCEPTION TYPE zcx_abak EXPORTING previous_from_syst = abap_true. ENDIF. ELSE. spras = sy-langu. ENDIF. CREATE OBJECT ro_content TYPE zcl_abak_source_so10 EXPORTING i_id = id i_name = name i_spras = spras. ENDMETHOD. ENDCLASS.
25.202797
95
0.614595
424329fcea9c03dde7caa48b1d96a3603005aed0
4,270
abap
ABAP
src/zcl_excel_style_color.clas.abap
chrisaasan/abap2xlsx
cb315c557225928baacbbcfd42087c3a8ed34a12
[ "Apache-2.0" ]
251
2019-02-23T03:36:38.000Z
2021-12-10T21:39:23.000Z
src/zcl_excel_style_color.clas.abap
chrisaasan/abap2xlsx
cb315c557225928baacbbcfd42087c3a8ed34a12
[ "Apache-2.0" ]
278
2019-02-17T10:42:59.000Z
2021-12-10T20:24:56.000Z
src/zcl_excel_style_color.clas.abap
chrisaasan/abap2xlsx
cb315c557225928baacbbcfd42087c3a8ed34a12
[ "Apache-2.0" ]
130
2019-02-20T13:25:30.000Z
2021-12-09T03:20:31.000Z
CLASS zcl_excel_style_color DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. *"* public components of class ZCL_EXCEL_STYLE_COLOR *"* do not include other source files here!!! CONSTANTS c_black TYPE zexcel_style_color_argb VALUE 'FF000000'. "#EC NOTEXT CONSTANTS c_blue TYPE zexcel_style_color_argb VALUE 'FF0000FF'. "#EC NOTEXT CONSTANTS c_darkblue TYPE zexcel_style_color_argb VALUE 'FF000080'. "#EC NOTEXT CONSTANTS c_darkgreen TYPE zexcel_style_color_argb VALUE 'FF008000'. "#EC NOTEXT CONSTANTS c_darkred TYPE zexcel_style_color_argb VALUE 'FF800000'. "#EC NOTEXT CONSTANTS c_darkyellow TYPE zexcel_style_color_argb VALUE 'FF808000'. "#EC NOTEXT CONSTANTS c_gray TYPE zexcel_style_color_argb VALUE 'FFCCCCCC'. "#EC NOTEXT CONSTANTS c_green TYPE zexcel_style_color_argb VALUE 'FF00FF00'. "#EC NOTEXT CONSTANTS c_red TYPE zexcel_style_color_argb VALUE 'FFFF0000'. "#EC NOTEXT CONSTANTS c_white TYPE zexcel_style_color_argb VALUE 'FFFFFFFF'. "#EC NOTEXT CONSTANTS c_yellow TYPE zexcel_style_color_argb VALUE 'FFFFFF00'. "#EC NOTEXT CONSTANTS c_theme_dark1 TYPE zexcel_style_color_theme VALUE 0. "#EC NOTEXT CONSTANTS c_theme_light1 TYPE zexcel_style_color_theme VALUE 1. "#EC NOTEXT CONSTANTS c_theme_dark2 TYPE zexcel_style_color_theme VALUE 2. "#EC NOTEXT CONSTANTS c_theme_light2 TYPE zexcel_style_color_theme VALUE 3. "#EC NOTEXT CONSTANTS c_theme_accent1 TYPE zexcel_style_color_theme VALUE 4. "#EC NOTEXT CONSTANTS c_theme_accent2 TYPE zexcel_style_color_theme VALUE 5. "#EC NOTEXT CONSTANTS c_theme_accent3 TYPE zexcel_style_color_theme VALUE 6. "#EC NOTEXT CONSTANTS c_theme_accent4 TYPE zexcel_style_color_theme VALUE 7. "#EC NOTEXT CONSTANTS c_theme_accent5 TYPE zexcel_style_color_theme VALUE 8. "#EC NOTEXT CONSTANTS c_theme_accent6 TYPE zexcel_style_color_theme VALUE 9. "#EC NOTEXT CONSTANTS c_theme_hyperlink TYPE zexcel_style_color_theme VALUE 10. "#EC NOTEXT CONSTANTS c_theme_hyperlink_followed TYPE zexcel_style_color_theme VALUE 11. "#EC NOTEXT CONSTANTS c_theme_not_set TYPE zexcel_style_color_theme VALUE -1. "#EC NOTEXT CONSTANTS c_indexed_not_set TYPE zexcel_style_color_indexed VALUE -1. "#EC NOTEXT CONSTANTS c_indexed_sys_foreground TYPE zexcel_style_color_indexed VALUE 64. "#EC NOTEXT CLASS-METHODS create_new_argb IMPORTING !ip_red TYPE zexcel_style_color_component !ip_green TYPE zexcel_style_color_component !ip_blu TYPE zexcel_style_color_component RETURNING VALUE(ep_color_argb) TYPE zexcel_style_color_argb . CLASS-METHODS create_new_arbg_int IMPORTING !iv_red TYPE numeric !iv_green TYPE numeric !iv_blue TYPE numeric RETURNING VALUE(rv_color_argb) TYPE zexcel_style_color_argb . *"* protected components of class ZCL_EXCEL_STYLE_COLOR *"* do not include other source files here!!! *"* protected components of class ZCL_EXCEL_STYLE_COLOR *"* do not include other source files here!!! PROTECTED SECTION. PRIVATE SECTION. *"* private components of class ZCL_EXCEL_STYLE_COLOR *"* do not include other source files here!!! CONSTANTS c_alpha TYPE c LENGTH 2 VALUE 'FF'. "#EC NOTEXT ENDCLASS. CLASS zcl_excel_style_color IMPLEMENTATION. METHOD create_new_arbg_int. DATA: lv_red TYPE int1, lv_green TYPE int1, lv_blue TYPE int1, lv_hex TYPE x, lv_char_red TYPE zexcel_style_color_component, lv_char_green TYPE zexcel_style_color_component, lv_char_blue TYPE zexcel_style_color_component. lv_red = iv_red MOD 256. lv_green = iv_green MOD 256. lv_blue = iv_blue MOD 256. lv_hex = lv_red. lv_char_red = lv_hex. lv_hex = lv_green. lv_char_green = lv_hex. lv_hex = lv_blue. lv_char_blue = lv_hex. CONCATENATE zcl_excel_style_color=>c_alpha lv_char_red lv_char_green lv_char_blue INTO rv_color_argb. ENDMETHOD. METHOD create_new_argb. CONCATENATE zcl_excel_style_color=>c_alpha ip_red ip_green ip_blu INTO ep_color_argb. ENDMETHOD. ENDCLASS.
41.456311
105
0.743091