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
98bf845cd089ec177b95b8e4f50ee80cda142549
11,396
abap
ABAP
src/objects/zcl_abapgit_objects_super.clas.abap
Elberet/abapGit
b7b5c2e62e6d029f194b079f6dd94741ec52f4a5
[ "MIT" ]
1
2020-04-21T04:00:18.000Z
2020-04-21T04:00:18.000Z
src/objects/zcl_abapgit_objects_super.clas.abap
Elberet/abapGit
b7b5c2e62e6d029f194b079f6dd94741ec52f4a5
[ "MIT" ]
1
2017-10-27T09:32:58.000Z
2017-10-27T09:32:58.000Z
src/objects/zcl_abapgit_objects_super.clas.abap
Elberet/abapGit
b7b5c2e62e6d029f194b079f6dd94741ec52f4a5
[ "MIT" ]
1
2021-07-09T02:07:11.000Z
2021-07-09T02:07:11.000Z
CLASS zcl_abapgit_objects_super DEFINITION PUBLIC ABSTRACT. PUBLIC SECTION. METHODS: constructor IMPORTING is_item TYPE zif_abapgit_definitions=>ty_item iv_language TYPE spras. CLASS-METHODS: jump_adt IMPORTING iv_obj_name TYPE zif_abapgit_definitions=>ty_item-obj_name iv_obj_type TYPE zif_abapgit_definitions=>ty_item-obj_type iv_sub_obj_name TYPE zif_abapgit_definitions=>ty_item-obj_name OPTIONAL iv_sub_obj_type TYPE zif_abapgit_definitions=>ty_item-obj_type OPTIONAL iv_line_number TYPE i OPTIONAL RAISING zcx_abapgit_exception. CONSTANTS: c_user_unknown TYPE xubname VALUE 'UNKNOWN'. PROTECTED SECTION. DATA ms_item TYPE zif_abapgit_definitions=>ty_item . DATA mv_language TYPE spras . METHODS check_timestamp IMPORTING !iv_timestamp TYPE timestamp !iv_date TYPE d !iv_time TYPE t RETURNING VALUE(rv_changed) TYPE abap_bool . METHODS get_metadata RETURNING VALUE(rs_metadata) TYPE zif_abapgit_definitions=>ty_metadata . METHODS corr_insert IMPORTING !iv_package TYPE devclass !ig_object_class TYPE any OPTIONAL RAISING zcx_abapgit_exception . METHODS tadir_insert IMPORTING !iv_package TYPE devclass RAISING zcx_abapgit_exception . METHODS jump_se11 IMPORTING !iv_radio TYPE string !iv_field TYPE string RAISING zcx_abapgit_exception . METHODS exists_a_lock_entry_for IMPORTING !iv_lock_object TYPE string !iv_argument TYPE seqg3-garg OPTIONAL RETURNING VALUE(rv_exists_a_lock_entry) TYPE abap_bool RAISING zcx_abapgit_exception . METHODS set_default_package IMPORTING !iv_package TYPE devclass . METHODS serialize_longtexts IMPORTING !ii_xml TYPE REF TO zif_abapgit_xml_output !iv_longtext_id TYPE dokil-id OPTIONAL !it_dokil TYPE zif_abapgit_definitions=>ty_dokil_tt OPTIONAL RAISING zcx_abapgit_exception . METHODS deserialize_longtexts IMPORTING !ii_xml TYPE REF TO zif_abapgit_xml_input RAISING zcx_abapgit_exception . METHODS delete_longtexts IMPORTING !iv_longtext_id TYPE dokil-id RAISING zcx_abapgit_exception . METHODS is_active RETURNING VALUE(rv_active) TYPE abap_bool RAISING zcx_abapgit_exception . METHODS delete_ddic IMPORTING VALUE(iv_objtype) TYPE string VALUE(iv_no_ask) TYPE abap_bool DEFAULT abap_true VALUE(iv_no_ask_delete_append) TYPE abap_bool DEFAULT abap_false RAISING zcx_abapgit_exception . PRIVATE SECTION. ENDCLASS. CLASS ZCL_ABAPGIT_OBJECTS_SUPER IMPLEMENTATION. METHOD check_timestamp. DATA: lv_ts TYPE timestamp. IF sy-subrc = 0 AND iv_date IS NOT INITIAL AND iv_time IS NOT INITIAL. cl_abap_tstmp=>systemtstmp_syst2utc( EXPORTING syst_date = iv_date syst_time = iv_time IMPORTING utc_tstmp = lv_ts ). IF lv_ts < iv_timestamp. rv_changed = abap_false. " Unchanged ELSE. rv_changed = abap_true. ENDIF. ELSE. " Not found? => changed rv_changed = abap_true. ENDIF. ENDMETHOD. METHOD constructor. ms_item = is_item. ASSERT NOT ms_item IS INITIAL. mv_language = iv_language. ASSERT NOT mv_language IS INITIAL. ENDMETHOD. METHOD corr_insert. DATA: lv_object TYPE string, lv_object_class TYPE string. IF ig_object_class IS NOT INITIAL. lv_object_class = ig_object_class. IF ig_object_class = 'DICT'. CONCATENATE ms_item-obj_type ms_item-obj_name INTO lv_object. ELSE. lv_object = ms_item-obj_name. ENDIF. ELSE. lv_object_class = ms_item-obj_type. lv_object = ms_item-obj_name. ENDIF. CALL FUNCTION 'RS_CORR_INSERT' EXPORTING object = lv_object object_class = lv_object_class devclass = iv_package master_language = mv_language global_lock = abap_true mode = 'I' suppress_dialog = abap_true EXCEPTIONS cancelled = 1 permission_failure = 2 unknown_objectclass = 3 OTHERS = 4. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDMETHOD. METHOD delete_ddic. DATA: lv_objname TYPE rsedd0-ddobjname, lv_objtype TYPE rsedd0-ddobjtype. lv_objname = ms_item-obj_name. lv_objtype = iv_objtype. TRY. CALL FUNCTION 'RS_DD_DELETE_OBJ' EXPORTING no_ask = iv_no_ask objname = lv_objname objtype = lv_objtype no_ask_delete_append = iv_no_ask_delete_append EXCEPTIONS not_executed = 1 object_not_found = 2 object_not_specified = 3 permission_failure = 4 dialog_needed = 5 OTHERS = 6. CATCH cx_sy_dyn_call_param_not_found. " no_ask_delete_append not available in lower releases CALL FUNCTION 'RS_DD_DELETE_OBJ' EXPORTING no_ask = iv_no_ask objname = lv_objname objtype = lv_objtype EXCEPTIONS not_executed = 1 object_not_found = 2 object_not_specified = 3 permission_failure = 4 dialog_needed = 5 OTHERS = 6. ENDTRY. IF sy-subrc = 5. zcx_abapgit_exception=>raise( |Object { ms_item-obj_type } { ms_item-obj_name } has dependencies and must be deleted manually| ). ELSEIF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Error deleting { ms_item-obj_type } { ms_item-obj_name }| ). ENDIF. ENDMETHOD. METHOD delete_longtexts. zcl_abapgit_factory=>get_longtexts( )->delete( iv_longtext_id = iv_longtext_id iv_object_name = ms_item-obj_name ). ENDMETHOD. METHOD deserialize_longtexts. zcl_abapgit_factory=>get_longtexts( )->deserialize( ii_xml = ii_xml iv_master_language = mv_language ). ENDMETHOD. METHOD exists_a_lock_entry_for. DATA: lt_lock_entries TYPE STANDARD TABLE OF seqg3. CALL FUNCTION 'ENQUEUE_READ' EXPORTING guname = '*' garg = iv_argument TABLES enq = lt_lock_entries EXCEPTIONS communication_failure = 1 system_failure = 2 OTHERS = 3. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. READ TABLE lt_lock_entries TRANSPORTING NO FIELDS WITH KEY gobj = iv_lock_object. IF sy-subrc = 0. rv_exists_a_lock_entry = abap_true. ENDIF. ENDMETHOD. METHOD get_metadata. DATA: lv_class TYPE string. lv_class = cl_abap_classdescr=>describe_by_object_ref( me )->get_relative_name( ). REPLACE FIRST OCCURRENCE OF 'ZCL_ABAPGIT' IN lv_class WITH 'LCL'. rs_metadata-class = lv_class. rs_metadata-version = 'v1.0.0'. ENDMETHOD. METHOD is_active. DATA: lt_messages TYPE STANDARD TABLE OF sprot_u WITH DEFAULT KEY, lt_e071_tadirs TYPE STANDARD TABLE OF e071 WITH DEFAULT KEY, ls_e071_tadir LIKE LINE OF lt_e071_tadirs. ms_item-inactive = abap_false. ls_e071_tadir-object = ms_item-obj_type. ls_e071_tadir-obj_name = ms_item-obj_name. INSERT ls_e071_tadir INTO TABLE lt_e071_tadirs. CALL FUNCTION 'RS_INACTIVE_OBJECTS_WARNING' EXPORTING suppress_protocol = abap_false with_program_includes = abap_false suppress_dictionary_check = abap_false TABLES p_e071 = lt_e071_tadirs p_xmsg = lt_messages. IF lt_messages IS NOT INITIAL. ms_item-inactive = abap_true. ENDIF. rv_active = boolc( ms_item-inactive = abap_false ). ENDMETHOD. METHOD jump_adt. DATA: lv_adt_link TYPE string, lx_error TYPE REF TO cx_root. TRY. lv_adt_link = zcl_abapgit_adt_link=>generate( iv_obj_name = iv_obj_name iv_obj_type = iv_obj_type iv_sub_obj_name = iv_sub_obj_name iv_line_number = iv_line_number ). cl_gui_frontend_services=>execute( EXPORTING document = lv_adt_link EXCEPTIONS OTHERS = 1 ). IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |ADT Jump Error - failed to open link { lv_adt_link }. Subrc={ sy-subrc }| ). ENDIF. CATCH cx_root INTO lx_error. zcx_abapgit_exception=>raise( iv_text = 'ADT Jump Error' ix_previous = lx_error ). ENDTRY. ENDMETHOD. METHOD jump_se11. CALL FUNCTION 'RS_TOOL_ACCESS' EXPORTING operation = 'SHOW' object_name = ms_item-obj_name object_type = ms_item-obj_type devclass = ms_item-devclass in_new_window = abap_true EXCEPTIONS not_executed = 1 invalid_object_type = 2 OTHERS = 3. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Jump to SE11 failed (subrc={ sy-subrc } ).| ). ENDIF. ENDMETHOD. METHOD serialize_longtexts. zcl_abapgit_factory=>get_longtexts( )->serialize( iv_object_name = ms_item-obj_name iv_longtext_id = iv_longtext_id it_dokil = it_dokil ii_xml = ii_xml ). ENDMETHOD. METHOD set_default_package. " In certain cases we need to set the package package via ABAP memory " because we can't supply it via the APIs. " " Set default package, see function module RS_CORR_INSERT FORM get_current_devclass. " " We use ABAP memory instead the SET parameter because it is " more reliable. SET parameter doesn't work when multiple objects " are deserialized which uses the ABAP memory mechanism. " We don't need to reset the memory as it is done in above mentioned form routine. EXPORT current_devclass FROM iv_package TO MEMORY ID 'EUK'. ENDMETHOD. METHOD tadir_insert. CALL FUNCTION 'TR_TADIR_INTERFACE' EXPORTING wi_test_modus = abap_false wi_tadir_pgmid = 'R3TR' wi_tadir_object = ms_item-obj_type wi_tadir_obj_name = ms_item-obj_name wi_tadir_author = sy-uname wi_tadir_devclass = iv_package wi_tadir_masterlang = mv_language iv_delflag = abap_false EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Error from TR_TADIR_INTERFACE (subrc={ sy-subrc } ).| ). ENDIF. ENDMETHOD. ENDCLASS.
28.138272
117
0.617497
98c14bdd18c98ebf7c93d0d35c5882a8741ecd04
9,566
abap
ABAP
src/zabap2xlsx_demo_show.prog.abap
rotda/abap2xlsx
45e11a380943c425a5c8b350e2e506ec3fd46d9c
[ "Apache-2.0" ]
1
2021-04-30T19:32:09.000Z
2021-04-30T19:32:09.000Z
src/zabap2xlsx_demo_show.prog.abap
rotda/abap2xlsx
45e11a380943c425a5c8b350e2e506ec3fd46d9c
[ "Apache-2.0" ]
null
null
null
src/zabap2xlsx_demo_show.prog.abap
rotda/abap2xlsx
45e11a380943c425a5c8b350e2e506ec3fd46d9c
[ "Apache-2.0" ]
null
null
null
*&---------------------------------------------------------------------* *& Report ZABAP2XLSX_DEMO_SHOW *&---------------------------------------------------------------------* REPORT zabap2xlsx_demo_like_se83. *----------------------------------------------------------------------* * CLASS lcl_perform DEFINITION *----------------------------------------------------------------------* CLASS lcl_perform DEFINITION CREATE PRIVATE. PUBLIC SECTION. CLASS-METHODS: setup_objects, collect_reports, handle_nav FOR EVENT double_click OF cl_gui_alv_grid IMPORTING e_row. PRIVATE SECTION. TYPES: BEGIN OF ty_reports, progname TYPE reposrc-progname, sort TYPE reposrc-progname, filename TYPE string, END OF ty_reports. CLASS-DATA: lo_grid TYPE REF TO cl_gui_alv_grid, lo_text TYPE REF TO cl_gui_textedit, cl_document TYPE REF TO i_oi_document_proxy, t_reports TYPE STANDARD TABLE OF ty_reports WITH NON-UNIQUE DEFAULT KEY. CLASS-DATA:error TYPE REF TO i_oi_error, t_errors TYPE STANDARD TABLE OF REF TO i_oi_error WITH NON-UNIQUE DEFAULT KEY, cl_control TYPE REF TO i_oi_container_control. "Office Dokument ENDCLASS. "lcl_perform DEFINITION START-OF-SELECTION. lcl_perform=>collect_reports( ). lcl_perform=>setup_objects( ). END-OF-SELECTION. WRITE '.'. " Force output *----------------------------------------------------------------------* * CLASS lcl_perform IMPLEMENTATION *----------------------------------------------------------------------* CLASS lcl_perform IMPLEMENTATION. METHOD setup_objects. DATA: lo_split TYPE REF TO cl_gui_splitter_container, lo_container TYPE REF TO cl_gui_container. DATA: it_fieldcat TYPE lvc_t_fcat, is_layout TYPE lvc_s_layo, is_variant TYPE disvariant. FIELD-SYMBOLS: <fc> LIKE LINE OF it_fieldcat. CREATE OBJECT lo_split EXPORTING parent = cl_gui_container=>screen0 rows = 1 columns = 3 no_autodef_progid_dynnr = 'X'. lo_split->set_column_width( EXPORTING id = 1 width = 20 ). lo_split->set_column_width( EXPORTING id = 2 width = 40 ). * Left: List of reports lo_container = lo_split->get_container( row = 1 column = 1 ). CREATE OBJECT lo_grid EXPORTING i_parent = lo_container. SET HANDLER lcl_perform=>handle_nav FOR lo_grid. is_variant-report = sy-repid. is_variant-handle = '0001'. is_layout-cwidth_opt = 'X'. APPEND INITIAL LINE TO it_fieldcat ASSIGNING <fc>. <fc>-fieldname = 'PROGNAME'. <fc>-tabname = 'REPOSRC'. APPEND INITIAL LINE TO it_fieldcat ASSIGNING <fc>. <fc>-fieldname = 'SORT'. <fc>-ref_field = 'PROGNAME'. <fc>-ref_table = 'REPOSRC'. lo_grid->set_table_for_first_display( EXPORTING is_variant = is_variant i_save = 'A' is_layout = is_layout CHANGING it_outtab = t_reports it_fieldcatalog = it_fieldcat EXCEPTIONS invalid_parameter_combination = 1 program_error = 2 too_many_lines = 3 OTHERS = 4 ). * Middle: Text with coding lo_container = lo_split->get_container( row = 1 column = 2 ). CREATE OBJECT lo_text EXPORTING parent = lo_container. lo_text->set_readonly_mode( cl_gui_textedit=>true ). lo_text->set_font_fixed( ). * right: DemoOutput lo_container = lo_split->get_container( row = 1 column = 3 ). c_oi_container_control_creator=>get_container_control( IMPORTING control = cl_control error = error ). APPEND error TO t_errors. cl_control->init_control( EXPORTING inplace_enabled = 'X' no_flush = 'X' r3_application_name = 'Demo Document Container' parent = lo_container IMPORTING error = error EXCEPTIONS OTHERS = 2 ). APPEND error TO t_errors. cl_control->get_document_proxy( EXPORTING document_type = 'Excel.Sheet' " EXCEL no_flush = ' ' IMPORTING document_proxy = cl_document error = error ). APPEND error TO t_errors. * Errorhandling should be inserted here ENDMETHOD. "setup_objects "collect_reports METHOD collect_reports. FIELD-SYMBOLS:<report> LIKE LINE OF t_reports. DATA: t_source TYPE STANDARD TABLE OF text255 WITH NON-UNIQUE DEFAULT KEY. * Get all demoreports SELECT progname INTO CORRESPONDING FIELDS OF TABLE t_reports FROM reposrc WHERE progname LIKE 'ZDEMO_EXCEL%' AND progname <> sy-repid AND subc = '1'. LOOP AT t_reports ASSIGNING <report>. * Check if already switched to new outputoptions READ REPORT <report>-progname INTO t_source. IF sy-subrc = 0. FIND 'INCLUDE zdemo_excel_outputopt_incl.' IN TABLE t_source IGNORING CASE. ENDIF. IF sy-subrc <> 0. DELETE t_reports. CONTINUE. ENDIF. * Build half-numeric sort <report>-sort = <report>-progname. REPLACE REGEX '(ZDEMO_EXCEL)(\d\d)\s*$' IN <report>-sort WITH '$1\0$2'. " REPLACE REGEX '(ZDEMO_EXCEL)([^][^])*$' IN <report>-sort WITH '$1$2'.REPLACE REGEX '(ZDEMO_EXCEL)([^][^])*$' IN <report>-sort WITH '$1$2'.REPLACE REPLACE REGEX '(ZDEMO_EXCEL)(\d)\s*$' IN <report>-sort WITH '$1\0\0$2'. ENDLOOP. SORT t_reports BY sort progname. ENDMETHOD. "collect_reports METHOD handle_nav. CONSTANTS: filename TYPE text80 VALUE 'ZABAP2XLSX_DEMO_SHOW.xlsx'. DATA: wa_report LIKE LINE OF t_reports, t_source TYPE STANDARD TABLE OF text255, t_rawdata TYPE solix_tab, wa_rawdata LIKE LINE OF t_rawdata, bytecount TYPE i, length TYPE i, add_selopt TYPE flag. READ TABLE t_reports INTO wa_report INDEX e_row-index. CHECK sy-subrc = 0. * Set new text into middle frame READ REPORT wa_report-progname INTO t_source. lo_text->set_text_as_r3table( EXPORTING table = t_source ). * Unload old xls-file cl_document->close_document( ). * Get the demo * If additional parameters found on selection screen, start via selection screen , otherwise start w/o CLEAR add_selopt. FIND 'PARAMETERS' IN TABLE t_source. IF sy-subrc = 0. add_selopt = 'X'. ELSE. FIND 'SELECT-OPTIONS' IN TABLE t_source. IF sy-subrc = 0. add_selopt = 'X'. ENDIF. ENDIF. IF add_selopt IS INITIAL. SUBMIT (wa_report-progname) AND RETURN "#EC CI_SUBMIT WITH p_backfn = filename WITH rb_back = 'X' WITH rb_down = ' ' WITH rb_send = ' ' WITH rb_show = ' '. ELSE. SUBMIT (wa_report-progname) VIA SELECTION-SCREEN AND RETURN "#EC CI_SUBMIT WITH p_backfn = filename WITH rb_back = 'X' WITH rb_down = ' ' WITH rb_send = ' ' WITH rb_show = ' '. ENDIF. OPEN DATASET filename FOR INPUT IN BINARY MODE. IF sy-subrc = 0. DO. CLEAR wa_rawdata. READ DATASET filename INTO wa_rawdata LENGTH length. IF sy-subrc <> 0. APPEND wa_rawdata TO t_rawdata. ADD length TO bytecount. EXIT. ENDIF. APPEND wa_rawdata TO t_rawdata. ADD length TO bytecount. ENDDO. CLOSE DATASET filename. ENDIF. cl_control->get_document_proxy( EXPORTING document_type = 'Excel.Sheet' " EXCEL no_flush = ' ' IMPORTING document_proxy = cl_document error = error ). cl_document->open_document_from_table( EXPORTING document_size = bytecount document_table = t_rawdata open_inplace = 'X' ). ENDMETHOD. "handle_nav ENDCLASS. "lcl_perform IMPLEMENTATION
36.792308
230
0.500941
98c5ba41de408eb38dd26be34ca07057b6ae2fdb
1,353
abap
ABAP
src/zcl_xml_to_json.clas.abap
julianocacheta/abap-oo-basics
9a0043d22dce1b4753e7253aa0b8c4084cc02071
[ "Apache-2.0" ]
82
2020-04-24T14:57:30.000Z
2022-03-16T03:01:36.000Z
src/zcl_xml_to_json.clas.abap
julianocacheta/abap-oo-basics
9a0043d22dce1b4753e7253aa0b8c4084cc02071
[ "Apache-2.0" ]
1
2020-06-11T12:36:13.000Z
2020-06-11T12:36:13.000Z
src/zcl_xml_to_json.clas.abap
julianocacheta/abap-oo-basics
9a0043d22dce1b4753e7253aa0b8c4084cc02071
[ "Apache-2.0" ]
26
2020-05-07T17:32:20.000Z
2022-03-08T06:37:32.000Z
"! <p class="shorttext synchronized" lang="en">XML to JSON Conversion</p> CLASS ZCL_XML_TO_JSON DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES IF_OO_ADT_CLASSRUN. PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS ZCL_XML_TO_JSON IMPLEMENTATION. METHOD IF_OO_ADT_CLASSRUN~MAIN. DATA(XML) = CL_ABAP_CONV_CODEPAGE=>CREATE_OUT( )->CONVERT( `<object><str name="TEXT">JSON</str></object>` ). DATA(XML_READER) = CL_SXML_STRING_READER=>CREATE( XML ). DATA(JSON_WRITER) = CL_SXML_STRING_WRITER=>CREATE( TYPE = IF_SXML=>CO_XT_JSON ). XML_READER->NEXT_NODE( ). XML_READER->SKIP_NODE( JSON_WRITER ). TRY. DATA(READER) = CL_SXML_STRING_READER=>CREATE( JSON_WRITER->GET_OUTPUT( ) ). DATA(WRITER) = CAST IF_SXML_WRITER( CL_SXML_STRING_WRITER=>CREATE( TYPE = IF_SXML=>CO_XT_JSON ) ). WRITER->SET_OPTION( OPTION = IF_SXML_WRITER=>CO_OPT_LINEBREAKS ). WRITER->SET_OPTION( OPTION = IF_SXML_WRITER=>CO_OPT_INDENT ). READER->NEXT_NODE( ). READER->SKIP_NODE( WRITER ). DATA(JSON_OUTPUT) = CL_ABAP_CONV_CODEPAGE=>CREATE_IN( )->CONVERT( CAST CL_SXML_STRING_WRITER( WRITER )->GET_OUTPUT( ) ). CATCH CX_SXML_PARSE_ERROR. RETURN. ENDTRY. OUT->WRITE( JSON_OUTPUT ). ENDMETHOD. ENDCLASS.
31.465116
129
0.678492
98c84abc238d6bd82445bdc1e94a741cd89ec8e0
4,212
abap
ABAP
lbn-gtt-template-tpo/ABAP/zsrc/zpof_gtt.fugr.zpof_gtt_ee_po_item_del.abap
DanHaer/logistics-business-network-gtt-samples
739978ac389da6f3530b26cd6402a3892f4b605a
[ "Apache-2.0" ]
null
null
null
lbn-gtt-template-tpo/ABAP/zsrc/zpof_gtt.fugr.zpof_gtt_ee_po_item_del.abap
DanHaer/logistics-business-network-gtt-samples
739978ac389da6f3530b26cd6402a3892f4b605a
[ "Apache-2.0" ]
null
null
null
lbn-gtt-template-tpo/ABAP/zsrc/zpof_gtt.fugr.zpof_gtt_ee_po_item_del.abap
DanHaer/logistics-business-network-gtt-samples
739978ac389da6f3530b26cd6402a3892f4b605a
[ "Apache-2.0" ]
null
null
null
FUNCTION ZPOF_GTT_EE_PO_ITEM_DEL . *"---------------------------------------------------------------------- *"*"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 *"---------------------------------------------------------------------- DATA: lo_udm_message TYPE REF TO cx_udm_message, ls_bapiret TYPE bapiret2. TRY. lcl_ae_performer=>get_event_data( EXPORTING is_definition = VALUE #( maintab = lif_pof_constants=>cs_tabledef-po_item_new mastertab = lif_pof_constants=>cs_tabledef-po_header_new ) io_ae_factory = NEW lcl_ae_factory_po_item_del( ) iv_appsys = i_appsys is_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 CHANGING ct_eventid_map = c_eventid_map[] ct_trackingheader = ct_trackingheader[] ct_tracklocation = ct_tracklocation[] ct_trackreferences = ct_trackreferences[] ct_trackparameters = ct_trackparameters[] ). CATCH cx_udm_message INTO lo_udm_message. lcl_tools=>get_errors_log( EXPORTING io_umd_message = lo_udm_message iv_appsys = i_appsys IMPORTING es_bapiret = ls_bapiret ). " add error message APPEND ls_bapiret TO ct_logtable. " throw corresponding exception CASE lo_udm_message->textid. WHEN lif_ef_constants=>cs_errors-stop_processing. RAISE stop_processing. WHEN lif_ef_constants=>cs_errors-table_determination. RAISE event_data_error. ENDCASE. ENDTRY. ENDFUNCTION.
41.294118
94
0.656695
98ca97f2df65a8eeb14059151ec7bdf1cfa1d0dc
9,796
abap
ABAP
src/zcl_abapgit_zip.clas.abap
abapGit/upport
322935c225756b5107d7c835e6ccc13ba3dcbe4a
[ "MIT" ]
2
2021-01-08T21:38:32.000Z
2021-11-17T19:37:14.000Z
src/zcl_abapgit_zip.clas.abap
abapGit/upport
322935c225756b5107d7c835e6ccc13ba3dcbe4a
[ "MIT" ]
null
null
null
src/zcl_abapgit_zip.clas.abap
abapGit/upport
322935c225756b5107d7c835e6ccc13ba3dcbe4a
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_zip DEFINITION PUBLIC CREATE PUBLIC . PUBLIC SECTION. CLASS-METHODS encode_files IMPORTING !it_files TYPE zif_abapgit_definitions=>ty_files_item_tt RETURNING VALUE(rv_xstr) TYPE xstring RAISING zcx_abapgit_exception . CLASS-METHODS export IMPORTING !is_local_settings TYPE zif_abapgit_persistence=>ty_repo-local_settings !iv_package TYPE devclass !io_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit !iv_show_log TYPE abap_bool DEFAULT abap_true !it_filter TYPE zif_abapgit_definitions=>ty_tadir_tt OPTIONAL RETURNING VALUE(rv_xstr) TYPE xstring RAISING zcx_abapgit_exception . CLASS-METHODS export_object IMPORTING iv_object_type TYPE trobjtype iv_object_name TYPE sobj_name RAISING zcx_abapgit_exception. CLASS-METHODS export_package IMPORTING iv_package TYPE devclass iv_folder_logic TYPE string iv_main_lang_only TYPE abap_bool RAISING zcx_abapgit_exception. CLASS-METHODS load IMPORTING !iv_xstr TYPE xstring RETURNING VALUE(rt_files) TYPE zif_abapgit_definitions=>ty_files_tt RAISING zcx_abapgit_exception . CLASS-METHODS save_binstring_to_localfile IMPORTING !iv_filename TYPE string !iv_binstring TYPE xstring RAISING zcx_abapgit_exception . PROTECTED SECTION. CLASS-DATA gv_prev TYPE string . PRIVATE SECTION. CLASS-METHODS filename IMPORTING !iv_str TYPE string EXPORTING !ev_path TYPE string !ev_filename TYPE string RAISING zcx_abapgit_exception . CLASS-METHODS normalize_path CHANGING !ct_files TYPE zif_abapgit_definitions=>ty_files_tt RAISING zcx_abapgit_exception . CLASS-METHODS unzip_file IMPORTING !iv_xstr TYPE xstring RETURNING VALUE(rt_files) TYPE zif_abapgit_definitions=>ty_files_tt RAISING zcx_abapgit_exception . ENDCLASS. CLASS zcl_abapgit_zip IMPLEMENTATION. METHOD encode_files. DATA: lo_zip TYPE REF TO cl_abap_zip, lv_filename TYPE string. FIELD-SYMBOLS: <ls_file> LIKE LINE OF it_files. lo_zip = NEW #( ). LOOP AT it_files ASSIGNING <ls_file>. CONCATENATE <ls_file>-file-path+1 <ls_file>-file-filename INTO lv_filename. lo_zip->add( name = lv_filename content = <ls_file>-file-data ). ENDLOOP. rv_xstr = lo_zip->save( ). ENDMETHOD. METHOD export. DATA li_log TYPE REF TO zif_abapgit_log. DATA lt_zip TYPE zif_abapgit_definitions=>ty_files_item_tt. DATA lo_serialize TYPE REF TO zcl_abapgit_serialize. li_log = NEW zcl_abapgit_log( ). li_log->set_title( 'Zip Export Log' ). IF zcl_abapgit_factory=>get_sap_package( iv_package )->exists( ) = abap_false. zcx_abapgit_exception=>raise( |Package { iv_package } doesn't exist| ). ENDIF. lo_serialize = NEW #( io_dot_abapgit = io_dot_abapgit is_local_settings = is_local_settings ). lt_zip = lo_serialize->files_local( iv_package = iv_package ii_log = li_log it_filter = it_filter ). FREE lo_serialize. IF li_log->count( ) > 0 AND iv_show_log = abap_true. zcl_abapgit_log_viewer=>show_log( li_log ). ENDIF. rv_xstr = encode_files( lt_zip ). ENDMETHOD. METHOD export_object. DATA: ls_tadir TYPE zif_abapgit_definitions=>ty_tadir, lv_folder TYPE string, lv_fullpath TYPE string, lv_sep TYPE c LENGTH 1, ls_files_item TYPE zcl_abapgit_objects=>ty_serialization, lo_frontend_serv TYPE REF TO zif_abapgit_frontend_services. FIELD-SYMBOLS: <ls_file> LIKE LINE OF ls_files_item-files. ls_tadir = zcl_abapgit_factory=>get_tadir( )->read_single( iv_object = iv_object_type iv_obj_name = iv_object_name ). IF ls_tadir IS INITIAL. zcx_abapgit_exception=>raise( 'Object could not be found' ). ENDIF. ls_files_item-item-obj_type = ls_tadir-object. ls_files_item-item-obj_name = ls_tadir-obj_name. ls_files_item = zcl_abapgit_objects=>serialize( is_item = ls_files_item-item iv_language = sy-langu ). IF lines( ls_files_item-files ) = 0. zcx_abapgit_exception=>raise( 'Empty' ). ENDIF. lo_frontend_serv = zcl_abapgit_ui_factory=>get_frontend_services( ). lo_frontend_serv->directory_browse( EXPORTING iv_initial_folder = gv_prev CHANGING cv_selected_folder = lv_folder ). IF lv_folder IS INITIAL. RAISE EXCEPTION TYPE zcx_abapgit_cancel. ENDIF. gv_prev = lv_folder. lo_frontend_serv->get_file_separator( CHANGING cv_file_separator = lv_sep ). LOOP AT ls_files_item-files ASSIGNING <ls_file>. lv_fullpath = |{ lv_folder }{ lv_sep }{ <ls_file>-filename }|. save_binstring_to_localfile( iv_filename = lv_fullpath iv_binstring = <ls_file>-data ). ENDLOOP. ENDMETHOD. METHOD export_package. DATA: ls_local_settings TYPE zif_abapgit_persistence=>ty_repo-local_settings, lo_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit, lo_frontend_serv TYPE REF TO zif_abapgit_frontend_services, lv_default TYPE string, lv_package_escaped TYPE string, lv_path TYPE string, lv_zip_xstring TYPE xstring. ls_local_settings-main_language_only = iv_main_lang_only. lo_dot_abapgit = zcl_abapgit_dot_abapgit=>build_default( ). lo_dot_abapgit->set_folder_logic( iv_folder_logic ). lo_frontend_serv = zcl_abapgit_ui_factory=>get_frontend_services( ). lv_package_escaped = iv_package. REPLACE ALL OCCURRENCES OF '/' IN lv_package_escaped WITH '#'. lv_default = |{ lv_package_escaped }_{ sy-datlo }_{ sy-timlo }|. lv_zip_xstring = export( is_local_settings = ls_local_settings iv_package = iv_package io_dot_abapgit = lo_dot_abapgit ). lv_path = lo_frontend_serv->show_file_save_dialog( iv_title = 'Package Export' iv_extension = 'zip' iv_default_filename = lv_default ). lo_frontend_serv->file_download( iv_path = lv_path iv_xstr = lv_zip_xstring ). ENDMETHOD. METHOD filename. IF iv_str CA '/'. FIND REGEX '(.*/)(.*)' IN iv_str SUBMATCHES ev_path ev_filename. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'Malformed path' ). ENDIF. IF ev_path <> '/'. CONCATENATE '/' ev_path INTO ev_path. ENDIF. ELSE. ev_path = '/'. ev_filename = iv_str. ENDIF. TRANSLATE ev_filename TO LOWER CASE. ENDMETHOD. METHOD load. rt_files = unzip_file( iv_xstr ). ENDMETHOD. METHOD normalize_path. * removes first folder from path if needed DATA: lt_split TYPE TABLE OF string, lv_needed TYPE abap_bool, lv_length TYPE i, lv_split LIKE LINE OF lt_split. FIELD-SYMBOLS: <ls_file> LIKE LINE OF ct_files. READ TABLE ct_files INDEX 1 ASSIGNING <ls_file>. IF sy-subrc <> 0. RETURN. ENDIF. SPLIT <ls_file>-path AT '/' INTO TABLE lt_split. IF sy-subrc <> 0. RETURN. ENDIF. READ TABLE lt_split INDEX 2 INTO lv_split. IF sy-subrc <> 0 OR strlen( lv_split ) = 0. RETURN. ENDIF. CONCATENATE '/' lv_split '/*' INTO lv_split. lv_needed = abap_true. LOOP AT ct_files ASSIGNING <ls_file>. IF NOT <ls_file>-path CP lv_split. lv_needed = abap_false. EXIT. " current loop ENDIF. ENDLOOP. IF lv_needed = abap_true. lv_length = strlen( lv_split ) - 2. LOOP AT ct_files ASSIGNING <ls_file>. <ls_file>-path = <ls_file>-path+lv_length. ENDLOOP. ENDIF. ENDMETHOD. METHOD save_binstring_to_localfile. zcl_abapgit_ui_factory=>get_frontend_services( )->file_download( iv_path = iv_filename iv_xstr = iv_binstring ). ENDMETHOD. METHOD unzip_file. DATA: lo_zip TYPE REF TO cl_abap_zip, lv_data TYPE xstring. FIELD-SYMBOLS: <ls_zipfile> LIKE LINE OF lo_zip->files, <ls_file> LIKE LINE OF rt_files. lo_zip = NEW #( ). lo_zip->load( EXPORTING zip = iv_xstr EXCEPTIONS zip_parse_error = 1 OTHERS = 2 ). IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'error from zip' ). ENDIF. LOOP AT lo_zip->files ASSIGNING <ls_zipfile>. lo_zip->get( EXPORTING name = <ls_zipfile>-name IMPORTING content = lv_data EXCEPTIONS zip_index_error = 1 zip_decompression_error = 2 OTHERS = 3 ). IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'error from zip get' ). ENDIF. APPEND INITIAL LINE TO rt_files ASSIGNING <ls_file>. filename( EXPORTING iv_str = <ls_zipfile>-name IMPORTING ev_path = <ls_file>-path ev_filename = <ls_file>-filename ). <ls_file>-data = lv_data. <ls_file>-sha1 = zcl_abapgit_hash=>sha1_blob( <ls_file>-data ). ENDLOOP. DELETE rt_files WHERE filename IS INITIAL. normalize_path( CHANGING ct_files = rt_files ). ENDMETHOD. ENDCLASS.
27.135734
84
0.63577
98cbcba9a3ba26d2008b8af32b2ee8ed09630641
265
abap
ABAP
src/test2/p3/z2mse_test2_p3_fgr_a.fugr.z2mse_test2_p3_function_a.abap
sabatale/SAP2Moose
59553fab013de732e2b7c9e67b6a4de799617b6a
[ "MIT" ]
25
2017-09-05T12:57:46.000Z
2021-12-18T21:47:13.000Z
src/test2/p3/z2mse_test2_p3_fgr_a.fugr.z2mse_test2_p3_function_a.abap
sabatale/SAP2Moose
59553fab013de732e2b7c9e67b6a4de799617b6a
[ "MIT" ]
72
2017-09-18T15:16:20.000Z
2021-12-10T20:09:32.000Z
src/test2/p3/z2mse_test2_p3_fgr_a.fugr.z2mse_test2_p3_function_a.abap
sabatale/SAP2Moose
59553fab013de732e2b7c9e67b6a4de799617b6a
[ "MIT" ]
6
2017-11-05T19:23:19.000Z
2020-02-01T20:02:51.000Z
FUNCTION z2mse_test2_p3_function_a. *"---------------------------------------------------------------------- *"*"Local Interface: *"---------------------------------------------------------------------- CALL FUNCTION 'Z2MSE_TEST2_P2_FUNCTION_A'. ENDFUNCTION.
24.090909
72
0.358491
98cf4a6ee43a0ca25c4982604f418ede0eedc846
166
abap
ABAP
src/new/SDOK_MIMETYPE_GET.abap
kkayacan/abap-reference
6b7ec01b7833393a999f620cc2075d060c96860b
[ "MIT" ]
1
2019-10-07T10:25:17.000Z
2019-10-07T10:25:17.000Z
src/new/SDOK_MIMETYPE_GET.abap
kkayacan/abap-reference
6b7ec01b7833393a999f620cc2075d060c96860b
[ "MIT" ]
null
null
null
src/new/SDOK_MIMETYPE_GET.abap
kkayacan/abap-reference
6b7ec01b7833393a999f620cc2075d060c96860b
[ "MIT" ]
2
2020-04-01T16:59:47.000Z
2021-05-31T01:37:45.000Z
DATA lv_mimetype TYPE mimetypes-type. CALL FUNCTION 'SDOK_MIMETYPE_GET' EXPORTING extension = ls_document_data-obj_type IMPORTING mimetype = lv_mimetype.
27.666667
41
0.789157
98d3f52b01f09580c728af547da1275e00c54047
5,435
abap
ABAP
src/objects/zcl_abapgit_longtexts.clas.abap
se38/abapGit
6d9320505c98e2a663d9564cb927e7d58721899f
[ "MIT" ]
1
2020-08-05T05:25:41.000Z
2020-08-05T05:25:41.000Z
src/objects/zcl_abapgit_longtexts.clas.abap
se38/abapGit
6d9320505c98e2a663d9564cb927e7d58721899f
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_longtexts.clas.abap
se38/abapGit
6d9320505c98e2a663d9564cb927e7d58721899f
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_longtexts DEFINITION PUBLIC CREATE PRIVATE GLOBAL FRIENDS zcl_abapgit_factory . PUBLIC SECTION. INTERFACES zif_abapgit_longtexts . PROTECTED SECTION. TYPES: BEGIN OF ty_longtext, dokil TYPE dokil, head TYPE thead, lines TYPE tline_tab, END OF ty_longtext . TYPES: tty_longtexts TYPE STANDARD TABLE OF ty_longtext WITH NON-UNIQUE DEFAULT KEY . METHODS read IMPORTING !iv_object_name TYPE sobj_name !iv_longtext_id TYPE dokil-id !it_dokil TYPE zif_abapgit_definitions=>tty_dokil !iv_master_lang_only TYPE abap_bool DEFAULT abap_false RETURNING VALUE(rt_longtexts) TYPE tty_longtexts RAISING zcx_abapgit_exception . PRIVATE SECTION. CONSTANTS c_docu_state_active TYPE dokstate VALUE 'A' ##NO_TEXT. ENDCLASS. CLASS ZCL_ABAPGIT_LONGTEXTS IMPLEMENTATION. METHOD read. DATA: ls_longtext TYPE ty_longtext, 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. IF iv_master_lang_only = abap_true. SELECT * FROM dokil INTO TABLE lt_dokil WHERE id = iv_longtext_id AND object = iv_object_name AND masterlang = abap_true ORDER BY PRIMARY KEY. ELSE. SELECT * FROM dokil INTO TABLE lt_dokil WHERE id = iv_longtext_id AND object = iv_object_name ORDER BY PRIMARY KEY. ENDIF. 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 rt_longtexts. ENDLOOP. ENDMETHOD. METHOD zif_abapgit_longtexts~changed_by. DATA: lt_longtexts TYPE tty_longtexts. FIELD-SYMBOLS: <ls_longtext> TYPE ty_longtext. lt_longtexts = read( iv_object_name = iv_object_name iv_longtext_id = iv_longtext_id it_dokil = it_dokil ). READ TABLE lt_longtexts INDEX 1 ASSIGNING <ls_longtext>. IF sy-subrc = 0. rv_user = <ls_longtext>-head-tdluser. ENDIF. ENDMETHOD. METHOD zif_abapgit_longtexts~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_object_name. 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 zif_abapgit_longtexts~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 = iv_longtext_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 zif_abapgit_longtexts~serialize. DATA lt_longtexts TYPE tty_longtexts. DATA lt_dokil LIKE it_dokil. DATA lv_master_lang_only TYPE abap_bool. lt_dokil = it_dokil. lv_master_lang_only = io_xml->i18n_params( )-serialize_master_lang_only. IF lv_master_lang_only = abap_true. DELETE lt_dokil WHERE masterlang <> abap_true. ENDIF. lt_longtexts = read( iv_object_name = iv_object_name iv_longtext_id = iv_longtext_id it_dokil = lt_dokil iv_master_lang_only = lv_master_lang_only ). io_xml->add( iv_name = iv_longtext_name ig_data = lt_longtexts ). ENDMETHOD. ENDCLASS.
26.004785
82
0.611408
98d8fcb04a92b3ca09f2e0fedf1c0ecea1c31e9f
6,178
abap
ABAP
src/objects/zcl_abapgit_object_susc.clas.abap
joymike/abapGit
e06f22bb22a3c0a3c66eec4da698124c1ec98d65
[ "MIT" ]
1
2019-05-27T18:50:14.000Z
2019-05-27T18:50:14.000Z
src/objects/zcl_abapgit_object_susc.clas.abap
joymike/abapGit
e06f22bb22a3c0a3c66eec4da698124c1ec98d65
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_susc.clas.abap
joymike/abapGit
e06f22bb22a3c0a3c66eec4da698124c1ec98d65
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_object_susc 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. CONSTANTS transobjecttype_class TYPE char1 VALUE 'C' ##NO_TEXT. METHODS has_authorization IMPORTING !iv_class TYPE tobc-oclss !iv_activity TYPE activ_auth RAISING zcx_abapgit_exception . METHODS is_used IMPORTING !iv_auth_object_class TYPE tobc-oclss RAISING zcx_abapgit_exception . PRIVATE SECTION. METHODS delete_class IMPORTING !iv_auth_object_class TYPE tobc-oclss . METHODS put_delete_to_transport RAISING zcx_abapgit_exception . ENDCLASS. CLASS ZCL_ABAPGIT_OBJECT_SUSC IMPLEMENTATION. METHOD delete_class. DELETE FROM tobc WHERE oclss = iv_auth_object_class. DELETE FROM tobct WHERE oclss = iv_auth_object_class. ENDMETHOD. METHOD has_authorization. AUTHORITY-CHECK OBJECT 'S_DEVELOP' ID 'DEVCLASS' DUMMY ID 'OBJTYPE' FIELD 'SUSC' ID 'OBJNAME' FIELD iv_class ID 'P_GROUP' DUMMY ID 'ACTVT' FIELD iv_activity. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( iv_msgid = '01' iv_msgno = '467' ). ENDIF. ENDMETHOD. METHOD is_used. DATA: lv_used_auth_object_class TYPE tobc-oclss. SELECT SINGLE oclss FROM tobj INTO lv_used_auth_object_class WHERE oclss = iv_auth_object_class ##WARN_OK. IF sy-subrc = 0. zcx_abapgit_exception=>raise_t100( iv_msgid = '01' iv_msgno = '212' iv_msgv1 = |{ iv_auth_object_class }| ). ENDIF. ENDMETHOD. METHOD put_delete_to_transport. DATA: lv_tr_object_name TYPE e071-obj_name, lv_tr_return TYPE char1, ls_package_info TYPE tdevc, lv_tadir_object TYPE tadir-object, lv_tadir_obj_name TYPE tadir-obj_name. lv_tr_object_name = ms_item-obj_name. CALL FUNCTION 'SUSR_COMMEDITCHECK' EXPORTING objectname = lv_tr_object_name transobjecttype = zcl_abapgit_object_susc=>transobjecttype_class IMPORTING return_from_korr = lv_tr_return. IF lv_tr_return <> 'M'. zcx_abapgit_exception=>raise( |error in SUSC delete at SUSR_COMMEDITCHECK| ). ENDIF. CALL FUNCTION 'TR_DEVCLASS_GET' EXPORTING iv_devclass = ms_item-devclass IMPORTING es_tdevc = ls_package_info EXCEPTIONS OTHERS = 1. IF sy-subrc = 0 AND ls_package_info-korrflag IS INITIAL. lv_tadir_object = ms_item-obj_type. lv_tadir_obj_name = lv_tr_object_name. CALL FUNCTION 'TR_TADIR_INTERFACE' EXPORTING wi_delete_tadir_entry = abap_true wi_test_modus = space wi_tadir_pgmid = 'R3TR' wi_tadir_object = lv_tadir_object wi_tadir_obj_name = lv_tadir_obj_name EXCEPTIONS OTHERS = 0. ENDIF. ENDMETHOD. METHOD zif_abapgit_object~changed_by. rv_user = c_user_unknown. " todo ENDMETHOD. METHOD zif_abapgit_object~delete. CONSTANTS lc_activity_delete_06 TYPE activ_auth VALUE '06'. DATA: lv_auth_object_class TYPE tobc-oclss. lv_auth_object_class = ms_item-obj_name. TRY. me->zif_abapgit_object~exists( ). CATCH zcx_abapgit_exception. RETURN. ENDTRY. has_authorization( iv_class = lv_auth_object_class iv_activity = lc_activity_delete_06 ). is_used( lv_auth_object_class ). delete_class( lv_auth_object_class ). put_delete_to_transport( ). ENDMETHOD. METHOD zif_abapgit_object~deserialize. * see function group SUSA DATA: ls_tobc TYPE tobc, lv_objectname TYPE e071-obj_name, ls_tobct TYPE tobct. io_xml->read( EXPORTING iv_name = 'TOBC' CHANGING cg_data = ls_tobc ). io_xml->read( EXPORTING iv_name = 'TOBCT' CHANGING cg_data = ls_tobct ). tadir_insert( iv_package ). lv_objectname = ms_item-obj_name. CALL FUNCTION 'SUSR_COMMEDITCHECK' EXPORTING objectname = lv_objectname transobjecttype = zcl_abapgit_object_susc=>transobjecttype_class. INSERT tobc FROM ls_tobc. "#EC CI_SUBRC * ignore sy-subrc as all fields are key fields MODIFY tobct FROM ls_tobct. "#EC CI_SUBRC ASSERT sy-subrc = 0. ENDMETHOD. METHOD zif_abapgit_object~exists. DATA: lv_oclss TYPE tobc-oclss. SELECT SINGLE oclss FROM tobc INTO lv_oclss WHERE oclss = ms_item-obj_name. rv_bool = boolc( sy-subrc = 0 ). ENDMETHOD. METHOD zif_abapgit_object~get_comparator. RETURN. ENDMETHOD. METHOD zif_abapgit_object~get_deserialize_steps. APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps. ENDMETHOD. METHOD zif_abapgit_object~get_metadata. rs_metadata = get_metadata( ). rs_metadata-delete_tadir = abap_true. ENDMETHOD. METHOD zif_abapgit_object~is_active. rv_active = is_active( ). ENDMETHOD. METHOD zif_abapgit_object~is_locked. rv_is_locked = abap_false. ENDMETHOD. METHOD zif_abapgit_object~jump. DATA: lv_objclass TYPE tobc-oclss. lv_objclass = ms_item-obj_name. CALL FUNCTION 'SUSR_SHOW_OBJECT_CLASS' EXPORTING objclass = lv_objclass. ENDMETHOD. METHOD zif_abapgit_object~serialize. DATA: ls_tobc TYPE tobc, ls_tobct TYPE tobct. SELECT SINGLE * FROM tobc INTO ls_tobc WHERE oclss = ms_item-obj_name. IF sy-subrc <> 0. RETURN. ENDIF. SELECT SINGLE * FROM tobct INTO ls_tobct WHERE oclss = ms_item-obj_name AND langu = mv_language. io_xml->add( iv_name = 'TOBC' ig_data = ls_tobc ). io_xml->add( iv_name = 'TOBCT' ig_data = ls_tobct ). ENDMETHOD. ENDCLASS.
23.853282
96
0.653448
98e72af053d598914cdaa1ae058ecaf6ceb0a0b8
23,654
abap
ABAP
src/syntax/zcl_abapgit_syntax_css.clas.abap
goreraks/abapGit
e4bafbe7159650d0a465bb6584f950e4add6b21f
[ "MIT" ]
2
2020-11-17T10:39:56.000Z
2021-02-25T09:31:47.000Z
src/syntax/zcl_abapgit_syntax_css.clas.abap
goreraks/abapGit
e4bafbe7159650d0a465bb6584f950e4add6b21f
[ "MIT" ]
37
2021-06-01T05:57:18.000Z
2022-03-01T05:02:10.000Z
src/syntax/zcl_abapgit_syntax_css.clas.abap
goreraks/abapGit
e4bafbe7159650d0a465bb6584f950e4add6b21f
[ "MIT" ]
1
2021-07-09T02:07:11.000Z
2021-07-09T02:07:11.000Z
CLASS zcl_abapgit_syntax_css DEFINITION PUBLIC INHERITING FROM zcl_abapgit_syntax_highlighter CREATE PUBLIC . PUBLIC SECTION. " CSS Standard https://www.w3.org/TR/css-2018/ " CSS Reference https://www.w3schools.com/cssref/default.asp " We used a mixture of above as reference for the keyword list " 1) CSS Properties https://www.w3schools.com/cssref/default.asp " 2) CSS Values & Units https://www.w3schools.com/cssref/css_units.asp " 3) CSS Selectors https://www.w3.org/TR/css-2018/#selectors " 4) CSS Functions https://www.w3schools.com/cssref/css_functions.asp " 5) CSS Colors https://www.w3schools.com/colors/colors_names.asp " 6) CSS Extensions " 7) CSS At-Rules https://www.w3.org/TR/css-2018/#at-rules " 8) HTML Tags CONSTANTS: BEGIN OF c_css, keyword TYPE string VALUE 'keyword', "#EC NOTEXT text TYPE string VALUE 'text', "#EC NOTEXT comment TYPE string VALUE 'comment', "#EC NOTEXT selectors TYPE string VALUE 'selectors', "#EC NOTEXT units TYPE string VALUE 'units', "#EC NOTEXT properties TYPE string VALUE 'properties', "#EC NOTEXT values TYPE string VALUE 'values', "#EC NOTEXT functions TYPE string VALUE 'functions', "#EC NOTEXT colors TYPE string VALUE 'colors', "#EC NOTEXT extensions TYPE string VALUE 'extensions', "#EC NOTEXT at_rules TYPE string VALUE 'at_rules', "#EC NOTEXT html TYPE string VALUE 'html', "#EC NOTEXT END OF c_css . CONSTANTS: BEGIN OF c_token, keyword TYPE c VALUE 'K', "#EC NOTEXT text TYPE c VALUE 'T', "#EC NOTEXT comment TYPE c VALUE 'C', "#EC NOTEXT selectors TYPE c VALUE 'S', "#EC NOTEXT units TYPE c VALUE 'U', "#EC NOTEXT properties TYPE c VALUE 'P', "#EC NOTEXT values TYPE c VALUE 'V', "#EC NOTEXT functions TYPE c VALUE 'F', "#EC NOTEXT colors TYPE c VALUE 'Z', "#EC NOTEXT extensions TYPE c VALUE 'E', "#EC NOTEXT at_rules TYPE c VALUE 'A', "#EC NOTEXT html TYPE c VALUE 'H', "#EC NOTEXT END OF c_token . CONSTANTS: BEGIN OF c_regex, " comments /* ... */ comment TYPE string VALUE '\/\*.*\*\/|\/\*|\*\/', "#EC NOTEXT " single or double quoted strings text TYPE string VALUE '("[^"]*")|(''[^'']*'')', "#EC NOTEXT " in general keywords don't contain numbers (except -ms-scrollbar-3dlight-color) keyword TYPE string VALUE '\b[a-z3@\-]+\b', "#EC NOTEXT " selectors begin with : selectors TYPE string VALUE ':[:a-z]+\b', "#EC NOTEXT " units units TYPE string VALUE '\b[0-9\. ]+(ch|cm|em|ex|in|mm|pc|pt|px|vh|vmax|vmin|vw)\b|\b[0-9\. ]+%', "#EC NOTEXT END OF c_regex . CLASS-METHODS class_constructor . METHODS constructor . PROTECTED SECTION. TYPES: BEGIN OF ty_keyword, keyword TYPE string, token TYPE char1, END OF ty_keyword. CLASS-DATA gt_keywords TYPE HASHED TABLE OF ty_keyword WITH UNIQUE KEY keyword. CLASS-DATA gv_comment TYPE abap_bool. CLASS-METHODS init_keywords. CLASS-METHODS insert_keywords IMPORTING iv_keywords TYPE string iv_token TYPE char1. CLASS-METHODS is_keyword IMPORTING iv_chunk TYPE string RETURNING VALUE(rv_yes) TYPE abap_bool. METHODS order_matches REDEFINITION. METHODS parse_line REDEFINITION. PRIVATE SECTION. ENDCLASS. CLASS ZCL_ABAPGIT_SYNTAX_CSS IMPLEMENTATION. METHOD class_constructor. init_keywords( ). ENDMETHOD. METHOD constructor. super->constructor( ). " Initialize instances of regular expression add_rule( iv_regex = c_regex-keyword iv_token = c_token-keyword iv_style = c_css-keyword ). add_rule( iv_regex = c_regex-comment iv_token = c_token-comment iv_style = c_css-comment ). add_rule( iv_regex = c_regex-text iv_token = c_token-text iv_style = c_css-text ). add_rule( iv_regex = c_regex-selectors iv_token = c_token-selectors iv_style = c_css-selectors ). add_rule( iv_regex = c_regex-units iv_token = c_token-units iv_style = c_css-units ). " Styles for keywords add_rule( iv_regex = '' iv_token = c_token-html iv_style = c_css-html ). add_rule( iv_regex = '' iv_token = c_token-properties iv_style = c_css-properties ). add_rule( iv_regex = '' iv_token = c_token-values iv_style = c_css-values ). add_rule( iv_regex = '' iv_token = c_token-functions iv_style = c_css-functions ). add_rule( iv_regex = '' iv_token = c_token-colors iv_style = c_css-colors ). add_rule( iv_regex = '' iv_token = c_token-extensions iv_style = c_css-extensions ). add_rule( iv_regex = '' iv_token = c_token-at_rules iv_style = c_css-at_rules ). ENDMETHOD. METHOD init_keywords. DATA: lv_keywords TYPE string. CLEAR gt_keywords. " 1) CSS Properties lv_keywords = 'align-content|align-items|align-self|animation|animation-delay|animation-direction|animation-duration|' && 'animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|' && 'backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|' && 'background-image|background-origin|background-position|background-repeat|background-size|border|' && 'border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|' && 'border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|' && 'border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|' && 'border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|' && 'border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|' && 'border-top-style|border-top-width|border-width|box-decoration-break|box-shadow|box-sizing|caption-side|' && 'caret-color|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|' && 'column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|' && 'counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|' && 'flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-kerning|font-size|font-size-adjust|' && 'font-stretch|font-style|font-variant|font-weight|grid|grid-area|grid-auto-columns|grid-auto-flow|' && 'grid-auto-rows|grid-column|grid-column-end|grid-column-gap|grid-column-start|grid-gap|grid-row|' && 'grid-row-end|grid-row-gap|grid-row-start|grid-template|grid-template-areas|grid-template-columns|' && 'grid-template-rows|hanging-punctuation|height|hyphens|isolation|justify-content|' && 'letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|' && 'margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|media|min-height|min-width|' && 'mix-blend-mode|object-fit|object-position|opacity|order|outline|outline-color|outline-offset|' && 'outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|' && 'padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|' && 'perspective-origin|pointer-events|position|quotes|resize|scroll-behavior|tab-size|table-layout|' && 'text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|' && 'text-decoration-style|text-indent|text-justify|text-overflow|text-rendering|text-shadow|text-transform|' && 'transform|transform-origin|transform-style|transition|transition-delay|transition-duration|' && 'transition-property|transition-timing-function|unicode-bidi|user-select|vertical-align|visibility|' && 'white-space|width|word-break|word-spacing|word-wrap|writing-mode|z-index'. insert_keywords( iv_keywords = lv_keywords iv_token = c_token-properties ). " 2) CSS Values lv_keywords = 'absolute|all|auto|block|bold|border-box|both|bottom|center|counter|cover|dashed|fixed|hidden|important|' && 'inherit|initial|inline-block|italic|left|max-content|middle|min-content|no-repeat|none|normal|pointer|' && 'relative|rem|right|solid|table-cell|text|top|transparent|underline|url'. insert_keywords( iv_keywords = lv_keywords iv_token = c_token-values ). " 3) CSS Selectors lv_keywords = ':active|::after|::before|:checked|:disabled|:empty|:enabled|:first-child|::first-letter|::first-line|' && ':first-of-type|:focus|:hover|:lang|:last-child|:last-of-type|:link|:not|:nth-child|:nth-last-child|' && ':nth-last-of-type|:nth-of-type|:only-child|:only-of-type|:root|:target|:visited'. insert_keywords( iv_keywords = lv_keywords iv_token = c_token-selectors ). " 4) CSS Functions lv_keywords = 'attr|calc|cubic-bezier|hsl|hsla|linear-gradient|radial-gradient|repeating-linear-gradient|' && 'repeating-radial-gradient|rgb|rgba|rotate|scale|translateX|translateY|var'. insert_keywords( iv_keywords = lv_keywords iv_token = c_token-functions ). " 5) CSS Colors lv_keywords = '#|aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|' && 'burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|' && 'darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|' && 'darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|' && 'deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|' && 'ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|' && 'lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|' && 'lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|' && 'lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|' && 'mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|' && 'mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|' && 'orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|' && 'peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|' && 'seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|' && 'tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen'. insert_keywords( iv_keywords = lv_keywords iv_token = c_token-colors ). " 6) CSS Extensions lv_keywords = 'moz|moz-binding|moz-border-bottom-colors|moz-border-left-colors|moz-border-right-colors|' && 'moz-border-top-colors|moz-box-align|moz-box-direction|moz-box-flex|moz-box-ordinal-group|' && 'moz-box-orient|moz-box-pack|moz-box-shadow|moz-context-properties|moz-float-edge|' && 'moz-force-broken-image-icon|moz-image-region|moz-orient|moz-osx-font-smoothing|' && 'moz-outline-radius|moz-outline-radius-bottomleft|moz-outline-radius-bottomright|' && 'moz-outline-radius-topleft|moz-outline-radius-topright|moz-stack-sizing|moz-system-metric|' && 'moz-transform|moz-transform-origin|moz-transition|moz-transition-delay|moz-user-focus|' && 'moz-user-input|moz-user-modify|moz-window-dragging|moz-window-shadow|ms|ms-accelerator|' && 'ms-block-progression|ms-content-zoom-chaining|ms-content-zoom-limit|' && 'ms-content-zoom-limit-max|ms-content-zoom-limit-min|ms-content-zoom-snap|' && 'ms-content-zoom-snap-points|ms-content-zoom-snap-type|ms-content-zooming|ms-filter|' && 'ms-flow-from|ms-flow-into|ms-high-contrast-adjust|ms-hyphenate-limit-chars|' && 'ms-hyphenate-limit-lines|ms-hyphenate-limit-zone|ms-ime-align|ms-overflow-style|' && 'ms-scroll-chaining|ms-scroll-limit|ms-scroll-limit-x-max|ms-scroll-limit-x-min|' && 'ms-scroll-limit-y-max|ms-scroll-limit-y-min|ms-scroll-rails|ms-scroll-snap-points-x|' && 'ms-scroll-snap-points-y|ms-scroll-snap-x|ms-scroll-snap-y|ms-scroll-translation|' && 'ms-scrollbar-3dlight-color|ms-scrollbar-arrow-color|ms-scrollbar-base-color|' && 'ms-scrollbar-darkshadow-color|ms-scrollbar-face-color|ms-scrollbar-highlight-color|' && 'ms-scrollbar-shadow-color|ms-scrollbar-track-color|ms-transform|ms-text-autospace|' && 'ms-touch-select|ms-wrap-flow|ms-wrap-margin|ms-wrap-through|o|o-transform|webkit|' && 'webkit-animation-trigger|webkit-app-region|webkit-appearance|webkit-aspect-ratio|' && 'webkit-backdrop-filter|webkit-background-composite|webkit-border-after|' && 'webkit-border-after-color|webkit-border-after-style|webkit-border-after-width|' && 'webkit-border-before|webkit-border-before-color|webkit-border-before-style|' && 'webkit-border-before-width|webkit-border-end|webkit-border-end-color|' && 'webkit-border-end-style|webkit-border-end-width|webkit-border-fit|' && 'webkit-border-horizontal-spacing|webkit-border-radius|webkit-border-start|' && 'webkit-border-start-color|webkit-border-start-style|webkit-border-start-width|' && 'webkit-border-vertical-spacing|webkit-box-align|webkit-box-direction|webkit-box-flex|' && 'webkit-box-flex-group|webkit-box-lines|webkit-box-ordinal-group|webkit-box-orient|' && 'webkit-box-pack|webkit-box-reflect|webkit-box-shadow|webkit-column-axis|' && 'webkit-column-break-after|webkit-column-break-before|webkit-column-break-inside|' && 'webkit-column-progression|webkit-cursor-visibility|webkit-dashboard-region|' && 'webkit-font-size-delta|webkit-font-smoothing|webkit-highlight|webkit-hyphenate-character|' && 'webkit-hyphenate-limit-after|webkit-hyphenate-limit-before|webkit-hyphenate-limit-lines|' && 'webkit-initial-letter|webkit-line-align|webkit-line-box-contain|webkit-line-clamp|' && 'webkit-line-grid|webkit-line-snap|webkit-locale|webkit-logical-height|' && 'webkit-logical-width|webkit-margin-after|webkit-margin-after-collapse|' && 'webkit-margin-before|webkit-margin-before-collapse|webkit-margin-bottom-collapse|' && 'webkit-margin-collapse|webkit-margin-end|webkit-margin-start|webkit-margin-top-collapse|' && 'webkit-marquee|webkit-marquee-direction|webkit-marquee-increment|' && 'webkit-marquee-repetition|webkit-marquee-speed|webkit-marquee-style|webkit-mask-box-image|' && 'webkit-mask-box-image-outset|webkit-mask-box-image-repeat|webkit-mask-box-image-slice|' && 'webkit-mask-box-image-source|webkit-mask-box-image-width|webkit-mask-repeat-x|' && 'webkit-mask-repeat-y|webkit-mask-source-type|webkit-max-logical-height|' && 'webkit-max-logical-width|webkit-min-logical-height|webkit-min-logical-width|' && 'webkit-nbsp-mode|webkit-padding-after|webkit-padding-before|webkit-padding-end|' && 'webkit-padding-start|webkit-perspective-origin-x|webkit-perspective-origin-y|' && 'webkit-print-color-adjust|webkit-rtl-ordering|webkit-svg-shadow|' && 'webkit-tap-highlight-color|webkit-text-combine|webkit-text-decoration-skip|' && 'webkit-text-decorations-in-effect|webkit-text-fill-color|webkit-text-security|' && 'webkit-text-stroke|webkit-text-stroke-color|webkit-text-stroke-width|webkit-text-zoom|' && 'webkit-transform|webkit-transform-origin|webkit-transform-origin-x|' && 'webkit-transform-origin-y|webkit-transform-origin-z|webkit-transition|' && 'webkit-transition-delay|webkit-user-drag|webkit-user-modify|overflow-clip-box|' && 'overflow-clip-box-block|overflow-clip-box-inline|zoom'. insert_keywords( iv_keywords = lv_keywords iv_token = c_token-extensions ). " 6) CSS At-Rules lv_keywords = '@|charset|counter-style|font-face|import|keyframes'. insert_keywords( iv_keywords = lv_keywords iv_token = c_token-at_rules ). " 7) HTML tage lv_keywords = 'doctyype|a|abbr|acronym|address|applet|area|b|base|basefont|bdo|bgsound|big|blink|blockquote|' && 'body|br|button|caption|center|cite|code|col|colgroup|dd|del|dfn|dir|div|dl|dt|em|embed|fieldset|' && 'font|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|hr|html|i|iframe|ilayer|img|input|ins|isindex|' && 'kbd|keygen|label|layer|legend|li|link|listing|map|menu|meta|multicol|nobr|noembed|noframes|' && 'nolayer|noscript|object|ol|optgroup|option|p|param|plaintext|pre|q|s|samp|script|select|server|' && 'small|sound|spacer|span|strike|strong|style|sub|sup|tbody|textarea|title|tt|u|ul|var|wbr|xmp|' && 'xsl|xml|accesskey|action|align|alink|alt|background|balance|behavior|bgcolor|bgproperties|' && 'border|bordercolor|bordercolordark|bordercolorlight|bottommargin|checked|class|classid|clear|' && 'code|codebase|codetype|color|cols|colspan|compact|content|controls|coords|data|datafld|' && 'dataformatas|datasrc|direction|disabled|dynsrc|enctype|event|face|for|frame|frameborder|' && 'framespacing|height|hidden|href|hspace|http-equiv|id|ismap|lang|language|leftmargin|link|loop|' && 'lowsrc|marginheight|marginwidth|maxlength|mayscript|method|methods|multiple|name|nohref|' && 'noresize|noshade|nowrap|palette|pluginspage|public|readonly|rel|rev|rightmargin|rows|rowspan|' && 'rules|scroll|scrollamount|scrolldelay|scrolling|selected|shape|size|span|src|start|style|' && 'tabindex|target|text|title|topmargin|truespeed|type|url|urn|usemap|valign|value|vlink|volume|' && 'vrml|vspace|width|wrap|apply-templates|attribute|choose|comment|define-template-set|' && 'entity-ref|eval|expr|for-each|if|match|no-entities|node-name|order-by|otherwise|select|' && 'stylesheet|template|test|value-of|version|when|xmlns|xsl|cellpadding|cellspacing|table|td|' && 'tfoot|th|thead|tr'. insert_keywords( iv_keywords = lv_keywords iv_token = c_token-html ). ENDMETHOD. METHOD insert_keywords. DATA: lt_keywords TYPE STANDARD TABLE OF string, ls_keyword TYPE ty_keyword. FIELD-SYMBOLS: <lv_keyword> TYPE any. SPLIT iv_keywords AT '|' INTO TABLE lt_keywords. LOOP AT lt_keywords ASSIGNING <lv_keyword>. CLEAR ls_keyword. ls_keyword-keyword = <lv_keyword>. ls_keyword-token = iv_token. INSERT ls_keyword INTO TABLE gt_keywords. ENDLOOP. ENDMETHOD. METHOD is_keyword. DATA lv_str TYPE string. lv_str = to_lower( iv_chunk ). READ TABLE gt_keywords WITH TABLE KEY keyword = lv_str TRANSPORTING NO FIELDS. rv_yes = boolc( sy-subrc = 0 ). ENDMETHOD. METHOD order_matches. DATA: lv_match TYPE string, lv_line_len TYPE i, lv_cmmt_end TYPE i, lv_prev_end TYPE i, lv_prev_token TYPE c. FIELD-SYMBOLS: <ls_prev> TYPE ty_match, <ls_match> TYPE ty_match, <ls_keyword> TYPE ty_keyword. " Longest matches SORT ct_matches BY offset length DESCENDING. lv_line_len = strlen( iv_line ). " Check if this is part of multi-line comment and mark it accordingly IF gv_comment = abap_true. READ TABLE ct_matches WITH KEY token = c_token-comment TRANSPORTING NO FIELDS. IF sy-subrc <> 0. CLEAR ct_matches. APPEND INITIAL LINE TO ct_matches ASSIGNING <ls_match>. <ls_match>-token = c_token-comment. <ls_match>-offset = 0. <ls_match>-length = lv_line_len. RETURN. ENDIF. ENDIF. LOOP AT ct_matches ASSIGNING <ls_match>. " Delete matches after open text match IF lv_prev_token = c_token-text AND <ls_match>-token <> c_token-text. CLEAR <ls_match>-token. CONTINUE. ENDIF. lv_match = substring( val = iv_line off = <ls_match>-offset len = <ls_match>-length ). CASE <ls_match>-token. WHEN c_token-keyword. " Skip keyword that's part of previous (longer) keyword IF <ls_match>-offset < lv_prev_end. CLEAR <ls_match>-token. CONTINUE. ENDIF. " Map generic keyword to specific CSS token lv_match = to_lower( lv_match ). READ TABLE gt_keywords ASSIGNING <ls_keyword> WITH TABLE KEY keyword = lv_match. IF sy-subrc = 0. <ls_match>-token = <ls_keyword>-token. ENDIF. WHEN c_token-comment. IF lv_match = '/*'. DELETE ct_matches WHERE offset > <ls_match>-offset. <ls_match>-length = lv_line_len - <ls_match>-offset. gv_comment = abap_true. ELSEIF lv_match = '*/'. DELETE ct_matches WHERE offset < <ls_match>-offset. <ls_match>-length = <ls_match>-offset + 2. <ls_match>-offset = 0. gv_comment = abap_false. ELSE. lv_cmmt_end = <ls_match>-offset + <ls_match>-length. DELETE ct_matches WHERE offset > <ls_match>-offset AND offset <= lv_cmmt_end. ENDIF. WHEN c_token-text. <ls_match>-text_tag = lv_match. IF lv_prev_token = c_token-text. IF <ls_match>-text_tag = <ls_prev>-text_tag. <ls_prev>-length = <ls_match>-offset + <ls_match>-length - <ls_prev>-offset. CLEAR lv_prev_token. ENDIF. CLEAR <ls_match>-token. CONTINUE. ENDIF. ENDCASE. lv_prev_token = <ls_match>-token. lv_prev_end = <ls_match>-offset + <ls_match>-length. ASSIGN <ls_match> TO <ls_prev>. ENDLOOP. DELETE ct_matches WHERE token IS INITIAL. ENDMETHOD. METHOD parse_line. "REDEFINITION DATA lv_index TYPE i. FIELD-SYMBOLS <ls_match> LIKE LINE OF rt_matches. rt_matches = super->parse_line( iv_line ). " Remove non-keywords LOOP AT rt_matches ASSIGNING <ls_match> WHERE token = c_token-keyword. lv_index = sy-tabix. IF abap_false = is_keyword( substring( val = iv_line off = <ls_match>-offset len = <ls_match>-length ) ). CLEAR <ls_match>-token. ENDIF. ENDLOOP. DELETE rt_matches WHERE token IS INITIAL. ENDMETHOD. ENDCLASS.
48.471311
117
0.672191
98e7e02f26737211de03f7cd9b1c8dfc71236889
8,001
abap
ABAP
src/ui/zcl_abapgit_gui_page_code_insp.clas.abap
DiscoveryConsulting/abapGit
437052cd6a32ddbd9a808730284c7f9f4ee100e7
[ "MIT" ]
null
null
null
src/ui/zcl_abapgit_gui_page_code_insp.clas.abap
DiscoveryConsulting/abapGit
437052cd6a32ddbd9a808730284c7f9f4ee100e7
[ "MIT" ]
null
null
null
src/ui/zcl_abapgit_gui_page_code_insp.clas.abap
DiscoveryConsulting/abapGit
437052cd6a32ddbd9a808730284c7f9f4ee100e7
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_gui_page_code_insp DEFINITION PUBLIC FINAL CREATE PUBLIC INHERITING FROM zcl_abapgit_gui_page. PUBLIC SECTION. METHODS: constructor IMPORTING io_repo TYPE REF TO zcl_abapgit_repo io_stage TYPE REF TO zcl_abapgit_stage OPTIONAL RAISING zcx_abapgit_exception, zif_abapgit_gui_page~on_event REDEFINITION, zif_abapgit_gui_page~render REDEFINITION. PROTECTED SECTION. DATA: mo_repo TYPE REF TO zcl_abapgit_repo. METHODS: render_content REDEFINITION. PRIVATE SECTION. CONSTANTS: BEGIN OF c_actions, stage TYPE string VALUE 'stage' ##NO_TEXT, commit TYPE string VALUE 'commit' ##NO_TEXT, rerun TYPE string VALUE 'rerun' ##NO_TEXT, END OF c_actions. DATA: mt_result TYPE scit_alvlist, mo_stage TYPE REF TO zcl_abapgit_stage. METHODS: build_menu RETURNING VALUE(ro_menu) TYPE REF TO zcl_abapgit_html_toolbar RAISING zcx_abapgit_exception, run_code_inspector RAISING zcx_abapgit_exception, has_inspection_errors RETURNING VALUE(rv_has_inspection_errors) TYPE abap_bool, is_stage_allowed RETURNING VALUE(rv_is_stage_allowed) TYPE abap_bool, jump IMPORTING is_item TYPE zif_abapgit_definitions=>ty_item RAISING zcx_abapgit_exception. ENDCLASS. CLASS zcl_abapgit_gui_page_code_insp IMPLEMENTATION. METHOD build_menu. DATA: lv_opt TYPE c LENGTH 1. CREATE OBJECT ro_menu. ro_menu->add( iv_txt = 'Re-Run' iv_act = c_actions-rerun iv_cur = abap_false ) ##NO_TEXT. IF is_stage_allowed( ) = abap_false. lv_opt = zif_abapgit_definitions=>gc_html_opt-crossout. ENDIF. IF mo_repo->is_offline( ) = abap_true. RETURN. ENDIF. IF mo_stage IS BOUND. " Staging info already available, we can directly " offer to commit ro_menu->add( iv_txt = 'Commit' iv_act = c_actions-commit iv_cur = abap_false iv_opt = lv_opt ) ##NO_TEXT. ELSE. ro_menu->add( iv_txt = 'Stage' iv_act = c_actions-stage iv_cur = abap_false iv_opt = lv_opt ) ##NO_TEXT. ENDIF. ENDMETHOD. METHOD constructor. super->constructor( ). mo_repo ?= io_repo. mo_stage = io_stage. ms_control-page_title = 'Code Inspector'. run_code_inspector( ). ENDMETHOD. " constructor. METHOD has_inspection_errors. READ TABLE mt_result TRANSPORTING NO FIELDS WITH KEY kind = 'E'. rv_has_inspection_errors = boolc( sy-subrc = 0 ). ENDMETHOD. METHOD is_stage_allowed. rv_is_stage_allowed = boolc( NOT ( mo_repo->get_local_settings( )-block_commit = abap_true AND has_inspection_errors( ) = abap_true ) ). ENDMETHOD. METHOD jump. DATA: lo_test TYPE REF TO cl_ci_test_root, li_code_inspector TYPE REF TO zif_abapgit_code_inspector, ls_info TYPE scir_rest, lo_result TYPE REF TO cl_ci_result_root, lv_check_variant_name TYPE sci_chkv, lv_package TYPE devclass. FIELD-SYMBOLS: <ls_result> TYPE scir_alvlist. READ TABLE mt_result WITH KEY objtype = is_item-obj_type objname = is_item-obj_name ASSIGNING <ls_result>. ASSERT sy-subrc = 0. lv_package = mo_repo->get_package( ). lv_check_variant_name = mo_repo->get_local_settings( )-code_inspector_check_variant. li_code_inspector = zcl_abapgit_factory=>get_code_inspector( iv_package = lv_package iv_check_variant_name = lv_check_variant_name ). " see SCI_LCL_DYNP_530 / HANDLE_DOUBLE_CLICK MOVE-CORRESPONDING <ls_result> TO ls_info. TRY. lo_test ?= cl_ci_tests=>get_test_ref( <ls_result>-test ). CATCH cx_root. zcx_abapgit_exception=>raise( |Jump to object not supported in your NW release| ). ENDTRY. lo_result = lo_test->get_result_node( <ls_result>-kind ). lo_result->set_info( ls_info ). lo_result->if_ci_test~navigate( ). ENDMETHOD. METHOD render_content. DATA: lv_check_variant TYPE sci_chkv, lv_class TYPE string, lv_line TYPE string. FIELD-SYMBOLS: <ls_result> TYPE scir_alvlist. CREATE OBJECT ro_html. lv_check_variant = mo_repo->get_local_settings( )-code_inspector_check_variant. IF lv_check_variant IS INITIAL. ro_html->add( |No check variant maintained in repo settings.| ). RETURN. ENDIF. ro_html->add( '<div class="toc"><br/>' ). ro_html->add( |Code inspector check variant: { mo_repo->get_local_settings( )-code_inspector_check_variant }<br/>| ). IF lines( mt_result ) = 0. ro_html->add( '<br/><div class="success">No code inspector findings</div>' ). ENDIF. ro_html->add( |<br/>| ). LOOP AT mt_result ASSIGNING <ls_result>. ro_html->add( '<div>' ). ro_html->add_a( iv_txt = |{ <ls_result>-objtype } { <ls_result>-objname }| iv_act = |{ <ls_result>-objtype }{ <ls_result>-objname }| iv_typ = zif_abapgit_definitions=>gc_action_type-sapevent ). ro_html->add( '</div>' ). CASE <ls_result>-kind. WHEN 'E'. lv_class = 'error'. WHEN 'W'. lv_class = 'warning'. WHEN OTHERS. lv_class = 'grey'. ENDCASE. CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT' EXPORTING input = <ls_result>-line IMPORTING output = lv_line. ro_html->add( |<div class="{ lv_class }">Line { lv_line }: { <ls_result>-text }</div><br>| ). ENDLOOP. ro_html->add( '</div>' ). ENDMETHOD. "render_content METHOD run_code_inspector. mt_result = mo_repo->run_code_inspector( ). ENDMETHOD. METHOD zif_abapgit_gui_page~on_event. DATA: lo_repo_online TYPE REF TO zcl_abapgit_repo_online, ls_item TYPE zif_abapgit_definitions=>ty_item. CASE iv_action. WHEN c_actions-stage. lo_repo_online ?= mo_repo. IF is_stage_allowed( ) = abap_true. " we need to refresh as the source might have changed lo_repo_online->refresh( ). CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_stage EXPORTING io_repo = lo_repo_online. ev_state = zif_abapgit_definitions=>gc_event_state-new_page. ELSE. ei_page = me. ev_state = zif_abapgit_definitions=>gc_event_state-no_more_act. ENDIF. WHEN c_actions-commit. lo_repo_online ?= mo_repo. IF is_stage_allowed( ) = abap_true. CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_commit EXPORTING io_repo = lo_repo_online io_stage = mo_stage. ev_state = zif_abapgit_definitions=>gc_event_state-new_page. ELSE. ei_page = me. ev_state = zif_abapgit_definitions=>gc_event_state-no_more_act. ENDIF. WHEN c_actions-rerun. run_code_inspector( ). ei_page = me. ev_state = zif_abapgit_definitions=>gc_event_state-re_render. WHEN OTHERS. ls_item-obj_type = iv_action(4). ls_item-obj_name = iv_action+4(*). jump( ls_item ). * zcl_abapgit_objects=>jump( ls_item ). ev_state = zif_abapgit_definitions=>gc_event_state-no_more_act. ENDCASE. ENDMETHOD. METHOD zif_abapgit_gui_page~render. ms_control-page_menu = build_menu( ). ro_html = super->zif_abapgit_gui_page~render( ). ENDMETHOD. ENDCLASS.
25.003125
99
0.621172
98e890b13d92dbd70846bae0d818f1a22e554999
25,405
abap
ABAP
src/objects/zcl_abapgit_object_tran.clas.abap
PeregrinTooc/abapGit
8e6fe2c785dd03faed5554d8255a4c4fa8358b2a
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_tran.clas.abap
PeregrinTooc/abapGit
8e6fe2c785dd03faed5554d8255a4c4fa8358b2a
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_tran.clas.abap
PeregrinTooc/abapGit
8e6fe2c785dd03faed5554d8255a4c4fa8358b2a
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_object_tran DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES zif_abapgit_object . ALIASES mo_files FOR zif_abapgit_object~mo_files . PROTECTED SECTION. PRIVATE SECTION. TYPES: ty_param_values TYPE STANDARD TABLE OF rsparam WITH NON-UNIQUE DEFAULT KEY , ty_tstca TYPE STANDARD TABLE OF tstca WITH DEFAULT KEY. CONSTANTS: c_oo_program TYPE c LENGTH 9 VALUE '\PROGRAM=' ##NO_TEXT, c_oo_class TYPE c LENGTH 7 VALUE '\CLASS=' ##NO_TEXT, c_oo_method TYPE c LENGTH 8 VALUE '\METHOD=' ##NO_TEXT, c_oo_tcode TYPE tcode VALUE 'OS_APPLICATION' ##NO_TEXT, c_oo_frclass TYPE c LENGTH 30 VALUE 'CLASS' ##NO_TEXT, c_oo_frmethod TYPE c LENGTH 30 VALUE 'METHOD' ##NO_TEXT, c_oo_frupdtask TYPE c LENGTH 30 VALUE 'UPDATE_MODE' ##NO_TEXT, c_oo_synchron TYPE c VALUE 'S' ##NO_TEXT, c_oo_asynchron TYPE c VALUE 'U' ##NO_TEXT, c_true TYPE c VALUE 'X' ##NO_TEXT, c_false TYPE c VALUE space ##NO_TEXT, BEGIN OF c_variant_type, dialog TYPE rglif-docutype VALUE 'D' ##NO_TEXT, report TYPE rglif-docutype VALUE 'R' ##NO_TEXT, variant TYPE rglif-docutype VALUE 'V' ##NO_TEXT, parameters TYPE rglif-docutype VALUE 'P' ##NO_TEXT, object TYPE rglif-docutype VALUE 'O' ##NO_TEXT, END OF c_variant_type. DATA: mt_bcdata TYPE STANDARD TABLE OF bdcdata . METHODS transaction_read IMPORTING iv_transaction TYPE tcode EXPORTING es_transaction TYPE tstc es_gui_attr TYPE tstcc RAISING zcx_abapgit_exception. METHODS shift_param CHANGING !ct_rsparam TYPE s_param !cs_tstcp TYPE tstcp . METHODS add_data IMPORTING !iv_fnam TYPE bdcdata-fnam !iv_fval TYPE clike . METHODS call_se93 RAISING zcx_abapgit_exception . METHODS set_oo_parameters IMPORTING !it_rsparam TYPE s_param CHANGING !cs_rsstcd TYPE rsstcd . METHODS split_parameters CHANGING !ct_rsparam TYPE s_param !cs_rsstcd TYPE rsstcd !cs_tstcp TYPE tstcp !cs_tstc TYPE tstc . METHODS split_parameters_comp IMPORTING !ig_type TYPE any !ig_param TYPE any CHANGING !cg_value TYPE any . 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 RAISING zcx_abapgit_exception . METHODS deserialize_oo_transaction IMPORTING !iv_package TYPE devclass !is_tstc TYPE tstc !is_tstcc TYPE tstcc !is_tstct TYPE tstct !is_rsstcd TYPE rsstcd RAISING zcx_abapgit_exception . METHODS save_authorizations IMPORTING iv_transaction TYPE tstc-tcode it_authorizations TYPE ty_tstca RAISING zcx_abapgit_exception. METHODS clear_functiongroup_globals. METHODS is_variant_transaction IMPORTING is_tstcp TYPE tstcp RETURNING VALUE(rv_variant_transaction) TYPE abap_bool. ENDCLASS. CLASS zcl_abapgit_object_tran IMPLEMENTATION. METHOD add_data. DATA: ls_bcdata LIKE LINE OF mt_bcdata. ls_bcdata-fnam = iv_fnam. ls_bcdata-fval = iv_fval. APPEND ls_bcdata TO mt_bcdata. ENDMETHOD. METHOD call_se93. DATA: lt_message TYPE STANDARD TABLE OF bdcmsgcoll. FIELD-SYMBOLS: <ls_message> TYPE bdcmsgcoll. CALL FUNCTION 'ABAP4_CALL_TRANSACTION' EXPORTING tcode = 'SE93' mode_val = 'N' TABLES using_tab = mt_bcdata mess_tab = lt_message EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Error deserializing { ms_item-obj_type } { ms_item-obj_name }| ). ENDIF. LOOP AT lt_message ASSIGNING <ls_message> WHERE msgtyp CA 'EAX'. MESSAGE ID <ls_message>-msgid TYPE <ls_message>-msgtyp NUMBER <ls_message>-msgnr WITH <ls_message>-msgv1 <ls_message>-msgv2 <ls_message>-msgv3 <ls_message>-msgv4 INTO sy-msgli. zcx_abapgit_exception=>raise_t100( ). ENDLOOP. ENDMETHOD. METHOD clear_functiongroup_globals. TYPES ty_param_vari TYPE abap_bool. DATA lt_error_list TYPE STANDARD TABLE OF rsmp_check WITH DEFAULT KEY. FIELD-SYMBOLS <lv_param_vari> TYPE ty_param_vari. " only way to clear global fields in function group CALL FUNCTION 'RS_TRANSACTION_INCONSISTENCIES' EXPORTING transaction_code = 'ZTHISTCODENEVEREXIST' TABLES error_list = lt_error_list EXCEPTIONS object_not_found = 1 OTHERS = 2. IF sy-subrc <> 0. "Expected - fine " but there is no other way to clear this field ASSIGN ('(SAPLSEUK)PARAM_VARI') TO <lv_param_vari>. IF sy-subrc = 0. CLEAR <lv_param_vari>. ENDIF. ENDIF. ENDMETHOD. METHOD deserialize_oo_transaction. " You should remember that we don't use batch input just for fun, " but because FM RPY_TRANSACTION_INSERT doesn't support OO transactions. DATA: ls_bcdata TYPE bdcdata. CLEAR mt_bcdata. ls_bcdata-program = 'SAPLSEUK'. ls_bcdata-dynpro = '0390'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO mt_bcdata. add_data( iv_fnam = 'TSTC-TCODE' iv_fval = is_tstc-tcode ). IF zif_abapgit_object~exists( ) = abap_true. add_data( iv_fnam = 'BDC_OKCODE' iv_fval = '=CHNG' ). ELSE. add_data( iv_fnam = 'BDC_OKCODE' iv_fval = '=ADD' ). ENDIF. ls_bcdata-program = 'SAPLSEUK'. ls_bcdata-dynpro = '0300'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO mt_bcdata. add_data( iv_fnam = 'TSTCT-TTEXT' iv_fval = is_tstct-ttext ). add_data( iv_fnam = 'RSSTCD-S_CLASS' iv_fval = 'X' ). add_data( iv_fnam = 'BDC_OKCODE' iv_fval = '=ENTR' ). ls_bcdata-program = 'SAPLSEUK'. ls_bcdata-dynpro = '0360'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO mt_bcdata. add_data( iv_fnam = 'RSSTCD-S_TRFRAME' iv_fval = is_rsstcd-s_trframe ). add_data( iv_fnam = 'RSSTCD-S_UPDTASK' iv_fval = is_rsstcd-s_updtask ). add_data( iv_fnam = 'BDC_OKCODE' iv_fval = '=TR_FRAMEWORK' ). ls_bcdata-program = 'SAPLSEUK'. ls_bcdata-dynpro = '0360'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO mt_bcdata. add_data( iv_fnam = 'RSSTCD-CLASSNAME' iv_fval = is_rsstcd-classname ). add_data( iv_fnam = 'RSSTCD-METHOD' iv_fval = is_rsstcd-method ). IF is_rsstcd-s_local IS NOT INITIAL. add_data( iv_fnam = 'RSSTCD-S_LOCAL' iv_fval = is_rsstcd-s_local ). ENDIF. IF is_rsstcd-s_updlok IS NOT INITIAL. add_data( iv_fnam = 'RSSTCD-S_UPDLOK' iv_fval = is_rsstcd-s_updlok ). ENDIF. add_data( iv_fnam = 'TSTC-PGMNA' iv_fval = is_tstc-pgmna ). IF is_tstcc-s_webgui = '2'. add_data( iv_fnam = 'G_IAC_EWT' iv_fval = abap_true ). add_data( iv_fnam = 'BDC_OKCODE' iv_fval = 'MAKE_PROFI' ). ls_bcdata-program = 'SAPLSEUK'. ls_bcdata-dynpro = '0360'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO mt_bcdata. ELSEIF is_tstcc-s_webgui IS NOT INITIAL. add_data( iv_fnam = 'TSTCC-S_WEBGUI' iv_fval = is_tstcc-s_webgui ). ENDIF. IF is_tstcc-s_pervas IS NOT INITIAL. add_data( iv_fnam = 'TSTCC-S_PERVAS' iv_fval = is_tstcc-s_pervas ). ENDIF. IF is_tstcc-s_service IS NOT INITIAL. add_data( iv_fnam = 'TSTCC-S_SERVICE' iv_fval = is_tstcc-s_service ). ENDIF. IF is_tstcc-s_platin IS NOT INITIAL. add_data( iv_fnam = 'TSTCC-S_PLATIN' iv_fval = is_tstcc-s_platin ). ENDIF. IF is_tstcc-s_win32 IS NOT INITIAL. add_data( iv_fnam = 'TSTCC-S_WIN32' iv_fval = is_tstcc-s_win32 ). ENDIF. add_data( iv_fnam = 'BDC_OKCODE' iv_fval = '=WB_SAVE' ). ls_bcdata-program = 'SAPLSTRD'. ls_bcdata-dynpro = '0100'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO mt_bcdata. add_data( iv_fnam = 'KO007-L_DEVCLASS' iv_fval = iv_package ). add_data( iv_fnam = 'BDC_OKCODE' iv_fval = '=ADD' ). ls_bcdata-program = 'BDC_OKCODE'. ls_bcdata-dynpro = '0360'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO mt_bcdata. add_data( iv_fnam = 'BDC_OKCODE' iv_fval = '=WB_BACK' ). ls_bcdata-program = 'BDC_OKCODE'. ls_bcdata-dynpro = '0360'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO mt_bcdata. add_data( iv_fnam = 'BDC_OKCODE' iv_fval = '=WB_BACK' ). call_se93( ). ENDMETHOD. METHOD deserialize_texts. DATA lt_tpool_i18n TYPE TABLE OF tstct. FIELD-SYMBOLS <ls_tpool> LIKE LINE OF lt_tpool_i18n. " Read XML-files data io_xml->read( EXPORTING iv_name = 'I18N_TPOOL' CHANGING cg_data = lt_tpool_i18n ). " Force t-code name (security reasons) LOOP AT lt_tpool_i18n ASSIGNING <ls_tpool>. <ls_tpool>-tcode = ms_item-obj_name. ENDLOOP. IF lines( lt_tpool_i18n ) > 0. MODIFY tstct FROM TABLE lt_tpool_i18n. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'Update of t-code translations failed' ). ENDIF. ENDIF. ENDMETHOD. METHOD is_variant_transaction. rv_variant_transaction = boolc( is_tstcp-param(1) = '@' ). ENDMETHOD. METHOD save_authorizations. CONSTANTS: lc_hex_chk TYPE x VALUE '04'. DATA: ls_transaction TYPE tstc. transaction_read( EXPORTING iv_transaction = iv_transaction IMPORTING es_transaction = ls_transaction ). DELETE FROM tstca WHERE tcode = iv_transaction. IF ls_transaction IS NOT INITIAL. INSERT tstca FROM TABLE it_authorizations. ls_transaction-cinfo = ls_transaction-cinfo + lc_hex_chk. UPDATE tstc SET cinfo = ls_transaction-cinfo WHERE tcode = ls_transaction-tcode. ENDIF. ENDMETHOD. METHOD serialize_texts. DATA lt_tpool_i18n TYPE TABLE OF tstct. IF io_xml->i18n_params( )-serialize_master_lang_only = abap_true. RETURN. ENDIF. " Skip main language - it was already serialized " Don't serialize t-code itself SELECT sprsl ttext INTO CORRESPONDING FIELDS OF TABLE lt_tpool_i18n FROM tstct WHERE sprsl <> mv_language AND tcode = ms_item-obj_name ##TOO_MANY_ITAB_FIELDS. "#EC CI_GENBUFF IF lines( lt_tpool_i18n ) > 0. SORT lt_tpool_i18n BY sprsl ASCENDING. io_xml->add( iv_name = 'I18N_TPOOL' ig_data = lt_tpool_i18n ). ENDIF. ENDMETHOD. METHOD set_oo_parameters. DATA: ls_param LIKE LINE OF it_rsparam. IF cs_rsstcd-call_tcode = c_oo_tcode. cs_rsstcd-s_trframe = c_true. LOOP AT it_rsparam INTO ls_param. CASE ls_param-field. WHEN c_oo_frclass. cs_rsstcd-classname = ls_param-value. WHEN c_oo_frmethod. cs_rsstcd-method = ls_param-value. WHEN c_oo_frupdtask. IF ls_param-value = c_oo_synchron. cs_rsstcd-s_upddir = c_true. cs_rsstcd-s_updtask = c_false. cs_rsstcd-s_updlok = c_false. ELSEIF ls_param-value = c_oo_asynchron. cs_rsstcd-s_upddir = c_false. cs_rsstcd-s_updtask = c_true. cs_rsstcd-s_updlok = c_false. ELSE. cs_rsstcd-s_upddir = c_false. cs_rsstcd-s_updtask = c_false. cs_rsstcd-s_updlok = c_true. ENDIF. ENDCASE. ENDLOOP. ENDIF. ENDMETHOD. METHOD shift_param. DATA: ls_param LIKE LINE OF ct_rsparam, lv_length TYPE i. FIELD-SYMBOLS <lg_f> TYPE any. DO 254 TIMES. IF cs_tstcp-param = space. EXIT. ENDIF. CLEAR ls_param. IF cs_tstcp-param CA '='. CHECK sy-fdpos <> 0. ASSIGN cs_tstcp-param(sy-fdpos) TO <lg_f>. ls_param-field = <lg_f>. IF ls_param-field(1) = space. SHIFT ls_param-field. ENDIF. sy-fdpos = sy-fdpos + 1. SHIFT cs_tstcp-param BY sy-fdpos PLACES. IF cs_tstcp-param CA ';'. IF sy-fdpos <> 0. ASSIGN cs_tstcp-param(sy-fdpos) TO <lg_f>. ls_param-value = <lg_f>. IF ls_param-value(1) = space. SHIFT ls_param-value. ENDIF. ENDIF. sy-fdpos = sy-fdpos + 1. SHIFT cs_tstcp-param BY sy-fdpos PLACES. APPEND ls_param TO ct_rsparam. ELSE. lv_length = strlen( cs_tstcp-param ). CHECK lv_length > 0. ASSIGN cs_tstcp-param(lv_length) TO <lg_f>. ls_param-value = <lg_f>. IF ls_param-value(1) = space. SHIFT ls_param-value. ENDIF. lv_length = lv_length + 1. SHIFT cs_tstcp-param BY lv_length PLACES. APPEND ls_param TO ct_rsparam. ENDIF. ENDIF. ENDDO. ENDMETHOD. METHOD split_parameters. * see subroutine split_parameters in include LSEUKF01 DATA: lv_off TYPE i, lv_param_beg TYPE i. CLEAR cs_rsstcd-s_vari. IF cs_tstcp-param(1) = '\'. " OO-Transaktion ohne FR split_parameters_comp( EXPORTING ig_type = c_oo_program ig_param = cs_tstcp-param CHANGING cg_value = cs_tstc-pgmna ). split_parameters_comp( EXPORTING ig_type = c_oo_class ig_param = cs_tstcp-param CHANGING cg_value = cs_rsstcd-classname ). split_parameters_comp( EXPORTING ig_type = c_oo_method ig_param = cs_tstcp-param CHANGING cg_value = cs_rsstcd-method ). IF NOT cs_tstc-pgmna IS INITIAL. cs_rsstcd-s_local = c_true. ENDIF. RETURN. ELSEIF cs_tstcp-param(1) = '@'. " Transaktionsvariante cs_rsstcd-s_vari = c_true. IF cs_tstcp-param(2) = '@@'. cs_rsstcd-s_ind_vari = c_true. lv_off = 2. ELSE. CLEAR cs_rsstcd-s_ind_vari. lv_off = 1. ENDIF. IF cs_tstcp-param CA ' '. ENDIF. sy-fdpos = sy-fdpos - lv_off. IF sy-fdpos > 0. cs_rsstcd-call_tcode = cs_tstcp-param+lv_off(sy-fdpos). sy-fdpos = sy-fdpos + 1 + lv_off. cs_rsstcd-variant = cs_tstcp-param+sy-fdpos. ENDIF. ELSEIF cs_tstcp-param(1) = '/'. cs_rsstcd-st_tcode = c_true. cs_rsstcd-st_prog = space. IF cs_tstcp-param+1(1) = '*'. cs_rsstcd-st_skip_1 = c_true. ELSE. CLEAR cs_rsstcd-st_skip_1. ENDIF. IF cs_tstcp-param CA ' '. ENDIF. lv_param_beg = sy-fdpos + 1. sy-fdpos = sy-fdpos - 2. IF sy-fdpos > 0. cs_rsstcd-call_tcode = cs_tstcp-param+2(sy-fdpos). ENDIF. SHIFT cs_tstcp-param BY lv_param_beg PLACES. ELSE. cs_rsstcd-st_tcode = space. cs_rsstcd-st_prog = c_true. ENDIF. shift_param( CHANGING ct_rsparam = ct_rsparam cs_tstcp = cs_tstcp ). set_oo_parameters( EXPORTING it_rsparam = ct_rsparam CHANGING cs_rsstcd = cs_rsstcd ). ENDMETHOD. METHOD split_parameters_comp. DATA: lv_off TYPE i. IF ig_param CS ig_type. lv_off = sy-fdpos + strlen( ig_type ). cg_value = ig_param+lv_off. IF cg_value CA '\'. CLEAR cg_value+sy-fdpos. ENDIF. ENDIF. ENDMETHOD. METHOD transaction_read. DATA: lt_tcodes TYPE TABLE OF tstc, lt_gui_attr TYPE TABLE OF tstcc. CLEAR: es_transaction, es_gui_attr. CALL FUNCTION 'RPY_TRANSACTION_READ' EXPORTING transaction = iv_transaction TABLES tcodes = lt_tcodes gui_attributes = lt_gui_attr EXCEPTIONS permission_error = 1 cancelled = 2 not_found = 3 object_not_found = 4 OTHERS = 5. IF sy-subrc = 4 OR sy-subrc = 3. RETURN. ELSEIF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. READ TABLE lt_tcodes INDEX 1 INTO es_transaction. ASSERT sy-subrc = 0. READ TABLE lt_gui_attr INDEX 1 INTO es_gui_attr. ASSERT sy-subrc = 0. ENDMETHOD. METHOD zif_abapgit_object~changed_by. rv_user = c_user_unknown. " todo ENDMETHOD. METHOD zif_abapgit_object~delete. DATA: lv_transaction TYPE tstc-tcode. lv_transaction = ms_item-obj_name. CALL FUNCTION 'RPY_TRANSACTION_DELETE' EXPORTING transaction = lv_transaction EXCEPTIONS not_excecuted = 1 object_not_found = 0 OTHERS = 3. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDMETHOD. METHOD zif_abapgit_object~deserialize. CONSTANTS: lc_hex_tra TYPE x VALUE '00', * lc_hex_men TYPE x VALUE '01', lc_hex_par TYPE x VALUE '02', lc_hex_rep TYPE x VALUE '80', * lc_hex_rpv TYPE x VALUE '10', lc_hex_obj TYPE x VALUE '08'. DATA: lv_dynpro TYPE d020s-dnum, ls_tstc TYPE tstc, lv_type TYPE rglif-docutype, ls_tstct TYPE tstct, ls_tstcc TYPE tstcc, ls_tstcp TYPE tstcp, lt_tstca TYPE ty_tstca, lt_param_values TYPE ty_param_values, ls_rsstcd TYPE rsstcd. IF zif_abapgit_object~exists( ) = abap_true. zif_abapgit_object~delete( iv_package ). ENDIF. io_xml->read( EXPORTING iv_name = 'TSTC' CHANGING cg_data = ls_tstc ). io_xml->read( EXPORTING iv_name = 'TSTCC' CHANGING cg_data = ls_tstcc ). io_xml->read( EXPORTING iv_name = 'TSTCT' CHANGING cg_data = ls_tstct ). io_xml->read( EXPORTING iv_name = 'TSTCP' CHANGING cg_data = ls_tstcp ). io_xml->read( EXPORTING iv_name = 'AUTHORIZATIONS' CHANGING cg_data = lt_tstca ). lv_dynpro = ls_tstc-dypno. IF ls_tstc-cinfo O lc_hex_rep. lv_type = c_variant_type-report. ELSEIF ls_tstc-cinfo O lc_hex_obj. lv_type = c_variant_type-object. ELSEIF ls_tstc-cinfo O lc_hex_par. IF is_variant_transaction( ls_tstcp ) = abap_true. lv_type = c_variant_type-variant. ELSE. lv_type = c_variant_type-parameters. ENDIF. ELSEIF ls_tstc-cinfo O lc_hex_tra. lv_type = c_variant_type-dialog. ELSE. zcx_abapgit_exception=>raise( 'Transaction, unknown CINFO' ). ENDIF. IF ls_tstcp IS NOT INITIAL. split_parameters( CHANGING ct_rsparam = lt_param_values cs_rsstcd = ls_rsstcd cs_tstcp = ls_tstcp cs_tstc = ls_tstc ). ENDIF. CASE lv_type. WHEN c_variant_type-object. deserialize_oo_transaction( iv_package = iv_package is_tstc = ls_tstc is_tstcc = ls_tstcc is_tstct = ls_tstct is_rsstcd = ls_rsstcd ). WHEN OTHERS. clear_functiongroup_globals( ). CALL FUNCTION 'RPY_TRANSACTION_INSERT' EXPORTING transaction = ls_tstc-tcode program = ls_tstc-pgmna dynpro = lv_dynpro language = mv_language development_class = iv_package transaction_type = lv_type shorttext = ls_tstct-ttext called_transaction = ls_rsstcd-call_tcode called_transaction_skip = ls_rsstcd-st_skip_1 variant = ls_rsstcd-variant cl_independend = ls_rsstcd-s_ind_vari html_enabled = ls_tstcc-s_webgui java_enabled = ls_tstcc-s_platin wingui_enabled = ls_tstcc-s_win32 TABLES param_values = lt_param_values EXCEPTIONS cancelled = 1 already_exist = 2 permission_error = 3 name_not_allowed = 4 name_conflict = 5 illegal_type = 6 object_inconsistent = 7 db_access_error = 8 OTHERS = 9. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDCASE. IF lt_tstca IS NOT INITIAL. save_authorizations( iv_transaction = ls_tstc-tcode it_authorizations = lt_tstca ). ENDIF. " Texts deserializing (translations) deserialize_texts( io_xml ). ENDMETHOD. METHOD zif_abapgit_object~exists. DATA: lv_tcode TYPE tstc-tcode. SELECT SINGLE tcode FROM tstc INTO lv_tcode WHERE tcode = 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-abap TO rt_steps. ENDMETHOD. METHOD zif_abapgit_object~get_metadata. rs_metadata = get_metadata( ). ENDMETHOD. METHOD zif_abapgit_object~is_active. rv_active = is_active( ). ENDMETHOD. METHOD zif_abapgit_object~is_locked. DATA: lv_object TYPE eqegraarg. lv_object = |TN{ ms_item-obj_name }|. OVERLAY lv_object WITH ' '. lv_object = lv_object && '*'. rv_is_locked = exists_a_lock_entry_for( iv_lock_object = 'EEUDB' iv_argument = lv_object ). ENDMETHOD. METHOD zif_abapgit_object~jump. DATA: lt_bdcdata TYPE TABLE OF bdcdata. FIELD-SYMBOLS: <ls_bdcdata> LIKE LINE OF lt_bdcdata. APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>. <ls_bdcdata>-program = 'SAPLSEUK'. <ls_bdcdata>-dynpro = '0390'. <ls_bdcdata>-dynbegin = abap_true. APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>. <ls_bdcdata>-fnam = 'BDC_OKCODE'. <ls_bdcdata>-fval = '=SHOW'. APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>. <ls_bdcdata>-fnam = 'TSTC-TCODE'. <ls_bdcdata>-fval = ms_item-obj_name. CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'GIT' EXPORTING tcode = 'SE93' mode_val = 'E' TABLES using_tab = lt_bdcdata EXCEPTIONS system_failure = 1 communication_failure = 2 resource_failure = 3 OTHERS = 4 ##fm_subrc_ok. "#EC CI_SUBRC ENDMETHOD. METHOD zif_abapgit_object~serialize. DATA: lv_transaction TYPE tstc-tcode, ls_tcode TYPE tstc, ls_tstct TYPE tstct, ls_tstcp TYPE tstcp, lt_tstca TYPE ty_tstca, ls_gui_attr TYPE tstcc. lv_transaction = ms_item-obj_name. transaction_read( EXPORTING iv_transaction = lv_transaction IMPORTING es_transaction = ls_tcode es_gui_attr = ls_gui_attr ). IF ls_tcode IS INITIAL. RETURN. ENDIF. SELECT SINGLE * FROM tstct INTO ls_tstct WHERE sprsl = mv_language AND tcode = lv_transaction. "#EC CI_SUBRC "#EC CI_GENBUFF SELECT SINGLE * FROM tstcp INTO ls_tstcp WHERE tcode = lv_transaction. "#EC CI_SUBRC "#EC CI_GENBUFF SELECT * FROM tstca INTO TABLE lt_tstca WHERE tcode = lv_transaction. IF sy-subrc <> 0. CLEAR: lt_tstca. ENDIF. io_xml->add( iv_name = 'TSTC' ig_data = ls_tcode ). io_xml->add( iv_name = 'TSTCC' ig_data = ls_gui_attr ). io_xml->add( iv_name = 'TSTCT' ig_data = ls_tstct ). IF ls_tstcp IS NOT INITIAL. io_xml->add( iv_name = 'TSTCP' ig_data = ls_tstcp ). ENDIF. io_xml->add( iv_name = 'AUTHORIZATIONS' ig_data = lt_tstca ). " Texts serializing (translations) serialize_texts( io_xml ). ENDMETHOD. ENDCLASS.
28.133998
102
0.593466
98ef6602c355d9a0592f1828662e55ef2301a59b
4,549
abap
ABAP
src/zguibp_example_alv.prog.abap
sbcgua/abap_gui_boilerplate
ae530e9123b729c67a338cbb570a81e94271a4dd
[ "MIT" ]
4
2018-12-23T19:52:12.000Z
2022-01-03T14:30:32.000Z
src/zguibp_example_alv.prog.abap
sbcgua/abap_gui_boilerplate
ae530e9123b729c67a338cbb570a81e94271a4dd
[ "MIT" ]
1
2019-04-11T04:12:24.000Z
2019-04-15T08:11:36.000Z
src/zguibp_example_alv.prog.abap
sbcgua/abap_gui_boilerplate
ae530e9123b729c67a338cbb570a81e94271a4dd
[ "MIT" ]
2
2019-01-01T19:13:46.000Z
2021-08-14T10:47:09.000Z
report zguibp_example_alv. include zguibp_error. include zguibp_alv. include zguibp_html. include zguibp_example_common. include zguibp_example_component. ********************************************************************** * html view ********************************************************************** class lcl_html_view definition final. public section. methods run importing iv_payload type string raising lcx_guibp_error. endclass. class lcl_html_view implementation. method run. lcl_gui_factory=>init( io_component = lcl_page_hoc=>wrap( iv_page_title = 'Home page' ii_child = lcl_hello_component=>create( iv_name = iv_payload ) ) ii_asset_man = lcl_common_parts=>create_asset_manager( ) ). lcl_gui_factory=>run( ). endmethod. endclass. ********************************************************************** * ALV view ********************************************************************** class lcl_content_view definition final inheriting from lcl_view_base. public section. methods constructor importing it_contents type any table. methods display redefinition. methods on_user_command redefinition. methods on_double_click redefinition. private section. methods build_toolbar returning value(rt_buttons) type ttb_button. endclass. class lcl_content_view implementation. method constructor. super->constructor( ). copy_content( it_contents ). endmethod. method display. create_alv( ). set_column_tech_names( ). set_default_handlers( ). set_default_layout( 'My view' ). set_sorting( 'NAME' ). set_toolbar( build_toolbar( ) ). mo_alv->display( ). endmethod. method on_user_command. data lv_msg type string. lv_msg = |User asked for: { iv_cmd }|. message lv_msg type 'I'. endmethod. "on_user_command method on_double_click. field-symbols <tab> type standard table. field-symbols <line> type any. assign mr_data->* to <tab>. read table <tab> assigning <line> index iv_row. field-symbols <name> type string. assign component 'NAME' of structure <line> to <name>. data lo_html type ref to lcl_html_view. data lx type ref to lcx_guibp_error. create object lo_html. try . lo_html->run( <name> ). catch lcx_guibp_error into lx. message lx type 'E' display like 'S'. endtry. endmethod. method build_toolbar. data ls_toolbar like line of rt_buttons. " Sort default clear ls_toolbar. ls_toolbar-function = cl_gui_alv_grid=>mc_fc_sort_asc. ls_toolbar-quickinfo = 'SORT'. ls_toolbar-icon = icon_sort_down. ls_toolbar-disabled = space. append ls_toolbar to rt_buttons. " toolbar seperator clear ls_toolbar. * ls_toolbar-function = '&&sep01'. ls_toolbar-butn_type = 3. append ls_toolbar to rt_buttons. " Custom command clear ls_toolbar. ls_toolbar-function = 'ZHELLO'. ls_toolbar-quickinfo = 'Custom command'. ls_toolbar-icon = icon_failure. ls_toolbar-disabled = space. ls_toolbar-text = 'Hello button'. append ls_toolbar to rt_buttons. endmethod. endclass. ********************************************************************** * APP ********************************************************************** class lcl_app definition final. public section. types: begin of ty_my_type, name type string, year type numc4, amount type dmbtr, end of ty_my_type, tt_my_type type standard table of ty_my_type with default key. methods run raising lcx_guibp_error. private section. methods prepare_data returning value(rt_data) type tt_my_type. endclass. class lcl_app implementation. method prepare_data. field-symbols <i> like line of rt_data. append initial line to rt_data assigning <i>. <i>-name = 'Vasya'. <i>-year = '2014'. <i>-amount = '1234.10'. append initial line to rt_data assigning <i>. <i>-name = 'Grysha'. <i>-year = '2008'. <i>-amount = '10234.10'. append initial line to rt_data assigning <i>. <i>-name = 'Kostya'. <i>-year = '1999'. <i>-amount = '80034.10'. endmethod. method run. data lo_alv type ref to lcl_content_view. create object lo_alv exporting it_contents = prepare_data( ). lo_alv->display( ). endmethod. endclass. include zguibp_example_run.
24.068783
77
0.611783
98f0e09ddfccbeb487111e02c93a4f4e6c933207
4,473
abap
ABAP
src/zcl_guidrasil_tools_icons.clas.abap
tricktresor/guidrasil
fe3c388c81e1443b7a4dc6e58db4ba0906582702
[ "MIT" ]
9
2018-10-11T15:14:09.000Z
2022-03-19T06:50:29.000Z
src/zcl_guidrasil_tools_icons.clas.abap
tricktresor/guidrasil
fe3c388c81e1443b7a4dc6e58db4ba0906582702
[ "MIT" ]
7
2018-10-11T15:30:25.000Z
2019-01-16T16:04:34.000Z
src/zcl_guidrasil_tools_icons.clas.abap
tricktresor/guidrasil
fe3c388c81e1443b7a4dc6e58db4ba0906582702
[ "MIT" ]
3
2018-10-11T15:30:59.000Z
2020-06-02T21:55:39.000Z
class ZCL_GUIDRASIL_TOOLS_ICONS definition public create public . public section. class-data ICONNAME type ICONNAME . class-methods INIT importing !PARENT type ref to CL_GUI_CONTAINER . protected section. types: BEGIN OF ts_icon, icon01 TYPE icon_d, name01 TYPE iconname, icon02 TYPE icon_d, name02 TYPE iconname, icon03 TYPE icon_d, name03 TYPE iconname, icon04 TYPE icon_d, name04 TYPE iconname, icon05 TYPE icon_d, name05 TYPE iconname, icon06 TYPE icon_d, name06 TYPE iconname, icon07 TYPE icon_d, name07 TYPE iconname, icon08 TYPE icon_d, name08 TYPE iconname, icon09 TYPE icon_d, name09 TYPE iconname, icon10 TYPE icon_d, name10 TYPE iconname, icon11 TYPE icon_d, name11 TYPE iconname, icon12 TYPE icon_d, name12 TYPE iconname, icon13 TYPE icon_d, name13 TYPE iconname, icon14 TYPE icon_d, name14 TYPE iconname, icon15 TYPE icon_d, name15 TYPE iconname, icon16 TYPE icon_d, name16 TYPE iconname, icon17 TYPE icon_d, name17 TYPE iconname, icon18 TYPE icon_d, name18 TYPE iconname, icon19 TYPE icon_d, name19 TYPE iconname, icon20 TYPE icon_d, name20 TYPE iconname, icon21 TYPE icon_d, name21 TYPE iconname, icon22 TYPE icon_d, name22 TYPE iconname, icon23 TYPE icon_d, name23 TYPE iconname, icon24 TYPE icon_d, name24 TYPE iconname, icon25 TYPE icon_d, name25 TYPE iconname, icon26 TYPE icon_d, name26 TYPE iconname, icon27 TYPE icon_d, name27 TYPE iconname, icon28 TYPE icon_d, name28 TYPE iconname, icon29 TYPE icon_d, name29 TYPE iconname, icon30 TYPE icon_d, name30 TYPE iconname, END OF ts_icon . class-data: t_data TYPE STANDARD TABLE OF ts_icon . class-methods DC for event DOUBLE_CLICK of CL_SALV_EVENTS_TABLE importing !COLUMN !ROW . private section. ENDCLASS. CLASS ZCL_GUIDRASIL_TOOLS_ICONS IMPLEMENTATION. method DC. DATA(colname) = column. REPLACE 'ICON' IN colname WITH 'NAME'. ASSIGN t_data[ row ] TO FIELD-SYMBOL(<icons>). IF sy-subrc = 0. ASSIGN COMPONENT colname OF STRUCTURE <icons> TO FIELD-SYMBOL(<icon>). IF sy-subrc = 0. iconname = <icon>. cl_gui_cfw=>set_new_ok_code( 'FF' ). ENDIF. ENDIF. endmethod. METHOD init. DATA count TYPE i VALUE 20. DATA pos TYPE n LENGTH 2. * DATA(dock) = NEW cl_gui_docking_container( * side = cl_gui_docking_container=>dock_at_bottom ). parent->get_width( IMPORTING width = DATA(size) ). cl_gui_cfw=>flush( ). count = size / 41. IF count > 30. "Max size of icons count = 30. ENDIF. SELECT id, name FROM icon INTO TABLE @DATA(icons). APPEND INITIAL LINE TO t_data ASSIGNING FIELD-SYMBOL(<icons>). pos = 0. LOOP AT icons INTO DATA(icon). pos = pos + 1. IF pos = count. APPEND INITIAL LINE TO t_data ASSIGNING <icons>. pos = 1. ENDIF. DATA(colname) = |ICON{ pos }|. ASSIGN COMPONENT colname OF STRUCTURE <icons> TO FIELD-SYMBOL(<icon>). <icon> = icon-id. colname = |NAME{ pos }|. ASSIGN COMPONENT colname OF STRUCTURE <icons> TO <icon>. <icon> = icon-name. ENDLOOP. TRY. cl_salv_table=>factory( EXPORTING r_container = parent IMPORTING r_salv_table = DATA(salv) CHANGING t_table = t_data ). DATA rcol TYPE REF TO cl_salv_column_list. DATA(cols) = salv->get_columns( ). CLEAR pos. LOOP AT cols->get( ) INTO DATA(col_icon) WHERE columnname(4) = 'ICON'. ADD 1 TO pos. rcol ?= col_icon-r_column. IF pos >= count. rcol->set_technical( abap_true ). ELSE. rcol->set_icon( abap_true ). ENDIF. ENDLOOP. LOOP AT cols->get( ) INTO DATA(col_name) WHERE columnname(4) = 'NAME'. rcol ?= col_name-r_column. rcol->set_technical( abap_true ). ENDLOOP. SET HANDLER dc FOR salv->get_event( ). salv->display( ). CATCH cx_salv_msg. ENDTRY. ENDMETHOD. ENDCLASS.
29.235294
93
0.600268
98f688c15304661f1e91fe683092831f2ac8fb0e
367
abap
ABAP
src/demo/z2mse_demo_long_prefix_cl_c.clas.abap
sabatale/SAP2Moose
59553fab013de732e2b7c9e67b6a4de799617b6a
[ "MIT" ]
25
2017-09-05T12:57:46.000Z
2021-12-18T21:47:13.000Z
src/demo/z2mse_demo_long_prefix_cl_c.clas.abap
sabatale/SAP2Moose
59553fab013de732e2b7c9e67b6a4de799617b6a
[ "MIT" ]
72
2017-09-18T15:16:20.000Z
2021-12-10T20:09:32.000Z
src/demo/z2mse_demo_long_prefix_cl_c.clas.abap
sabatale/SAP2Moose
59553fab013de732e2b7c9e67b6a4de799617b6a
[ "MIT" ]
6
2017-11-05T19:23:19.000Z
2020-02-01T20:02:51.000Z
class Z2MSE_DEMO_LONG_PREFIX_CL_C definition public create public . public section. class-METHODS: long_meaningless_method_name. protected section. private section. ENDCLASS. CLASS Z2MSE_DEMO_LONG_PREFIX_CL_C IMPLEMENTATION. METHOD LONG_MEANINGLESS_METHOD_NAME. Z2MSE_DEMO_LONG_PREFIX_CL_A=>long_meaningless_method_name( ). ENDMETHOD. ENDCLASS.
15.956522
65
0.825613
98f8df7ed4cc45f029284e419cd800deec02c729
10,563
abap
ABAP
src/ui/zcl_abapgit_gui_page_repo_sett.clas.abap
isisdanismanlik/abapGit
60f6b75f197c95d50bc79eb3fb69ef682339c536
[ "MIT" ]
1
2020-10-01T06:11:00.000Z
2020-10-01T06:11:00.000Z
src/ui/zcl_abapgit_gui_page_repo_sett.clas.abap
mkulawik-pacg/abapGit
faef85ad389bb9dc411b62ffa05bf5cfa1680d93
[ "MIT" ]
null
null
null
src/ui/zcl_abapgit_gui_page_repo_sett.clas.abap
mkulawik-pacg/abapGit
faef85ad389bb9dc411b62ffa05bf5cfa1680d93
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_gui_page_repo_sett 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 . METHODS zif_abapgit_gui_event_handler~on_event REDEFINITION . PROTECTED SECTION. CONSTANTS: BEGIN OF c_action, save_settings TYPE string VALUE 'save_settings', END OF c_action . DATA mo_repo TYPE REF TO zcl_abapgit_repo. METHODS render_dot_abapgit IMPORTING !io_html TYPE REF TO zcl_abapgit_html . METHODS render_local_settings IMPORTING !io_html TYPE REF TO zcl_abapgit_html RAISING zcx_abapgit_exception . METHODS save IMPORTING !it_postdata TYPE cnht_post_data_tab RAISING zcx_abapgit_exception . METHODS save_dot_abap IMPORTING !it_post_fields TYPE tihttpnvp RAISING zcx_abapgit_exception . METHODS save_local_settings IMPORTING !it_post_fields TYPE tihttpnvp RAISING zcx_abapgit_exception . METHODS parse_post IMPORTING !it_postdata TYPE cnht_post_data_tab RETURNING VALUE(rt_post_fields) TYPE tihttpnvp . METHODS render_content REDEFINITION . PRIVATE SECTION. ENDCLASS. CLASS ZCL_ABAPGIT_GUI_PAGE_REPO_SETT IMPLEMENTATION. METHOD constructor. super->constructor( ). ms_control-page_title = 'REPO SETTINGS'. mo_repo = io_repo. ENDMETHOD. METHOD parse_post. DATA lv_serialized_post_data TYPE string. CONCATENATE LINES OF it_postdata INTO lv_serialized_post_data. rt_post_fields = zcl_abapgit_html_action_utils=>parse_fields( lv_serialized_post_data ). ENDMETHOD. METHOD render_content. CREATE OBJECT ro_html. ro_html->add( '<div class="settings_container">' ). ro_html->add( '<form id="settings_form" method="post" action="sapevent:' && c_action-save_settings && '">' ). render_dot_abapgit( ro_html ). render_local_settings( ro_html ). ro_html->add( '<br><input type="submit" value="Save" class="floating-button blue-set emphasis">' ). ro_html->add( '</form>' ). ro_html->add( '</div>' ). ENDMETHOD. METHOD render_dot_abapgit. CONSTANTS: lc_requirement_edit_count TYPE i VALUE 5. DATA: ls_dot TYPE zif_abapgit_dot_abapgit=>ty_dot_abapgit, lv_selected TYPE string, lt_folder_logic TYPE string_table, lv_req_index TYPE i, lv_requirement_count TYPE i. FIELD-SYMBOLS: <lv_folder_logic> TYPE LINE OF string_table, <ls_requirement> TYPE zif_abapgit_dot_abapgit=>ty_requirement. ls_dot = mo_repo->get_dot_abapgit( )->get_data( ). lv_requirement_count = lines( ls_dot-requirements ). IF lv_requirement_count < lc_requirement_edit_count. DO - lv_requirement_count + lc_requirement_edit_count TIMES. INSERT INITIAL LINE INTO TABLE ls_dot-requirements. ENDDO. ENDIF. INSERT zif_abapgit_dot_abapgit=>c_folder_logic-full INTO TABLE lt_folder_logic. INSERT zif_abapgit_dot_abapgit=>c_folder_logic-prefix INTO TABLE lt_folder_logic. io_html->add( '<h2>.abapgit.xml</h2>' ). io_html->add( 'Folder logic: <select name="folder_logic">' ). LOOP AT lt_folder_logic ASSIGNING <lv_folder_logic>. IF ls_dot-folder_logic = <lv_folder_logic>. lv_selected = 'selected'. ELSE. CLEAR: lv_selected. ENDIF. io_html->add( |<option value="{ <lv_folder_logic> }" | && |{ lv_selected }>| && |{ <lv_folder_logic> }</option>| ). ENDLOOP. io_html->add( '</select>' ). io_html->add( '<br>' ). io_html->add( 'Starting folder: <input name="starting_folder" type="text" size="10" value="' && ls_dot-starting_folder && '">' ). io_html->add( '<br>' ). io_html->add( '<h3>Requirements</h3>' ). io_html->add( '<table class="repo_tab" id="requirement-tab" style="max-width: 300px;">' ). io_html->add( '<tr><th>Software Component</th><th>Min Release</th><th>Min Patch</th></tr>' ). LOOP AT ls_dot-requirements ASSIGNING <ls_requirement>. lv_req_index = sy-tabix. io_html->add( '<tr>' ). io_html->add( |<td><input name="req_com_{ lv_req_index }" maxlength=30 type="text" | && |value="{ <ls_requirement>-component }"></td>| ). io_html->add( |<td><input name="req_rel_{ lv_req_index }" maxlength=10 type="text" | && |value="{ <ls_requirement>-min_release }"></td>| ). io_html->add( |<td><input name="req_pat_{ lv_req_index }" maxlength=10 type="text" | && |value="{ <ls_requirement>-min_patch }"></td>| ). io_html->add( '</tr>' ). ENDLOOP. io_html->add( '</table>' ). ENDMETHOD. METHOD render_local_settings. DATA: lv_checked TYPE string, ls_settings TYPE zif_abapgit_persistence=>ty_repo-local_settings. ls_settings = mo_repo->get_local_settings( ). io_html->add( '<h2>Local settings</h2>' ). IF mo_repo->is_offline( ) = abap_false. io_html->add( '<br>' ). io_html->add( 'Display name: <input name="display_name" type="text" size="30" value="' && ls_settings-display_name && '">' ). io_html->add( '<br>' ). ENDIF. CLEAR lv_checked. IF ls_settings-write_protected = abap_true. IF zcl_abapgit_environment=>is_repo_object_changes_allowed( ) = abap_true. lv_checked = | checked|. ELSE. lv_checked = | checked disabled|. ENDIF. ENDIF. io_html->add( |Write protected <input name="write_protected" type="checkbox"{ lv_checked }><br>| ). CLEAR lv_checked. IF ls_settings-ignore_subpackages = abap_true. lv_checked = | checked|. ENDIF. io_html->add( |Ignore subpackages <input name="ignore_subpackages" type="checkbox"{ lv_checked }><br>| ). CLEAR lv_checked. IF ls_settings-only_local_objects = abap_true. lv_checked = | checked|. ENDIF. io_html->add( |Only local objects <input name="only_local_objects" type="checkbox"{ lv_checked }><br>| ). io_html->add( '<br>' ). io_html->add( 'Code inspector check variant: <input name="check_variant" type="text" size="30" value="' && ls_settings-code_inspector_check_variant && '">' ). io_html->add( '<br>' ). CLEAR lv_checked. IF ls_settings-block_commit = abap_true. lv_checked = | checked|. ENDIF. io_html->add( |Block commit commit/push if code inspection has erros: | && |<input name="block_commit" type="checkbox"{ lv_checked }><br>| ). ENDMETHOD. METHOD save. DATA: lt_post_fields TYPE tihttpnvp. lt_post_fields = parse_post( it_postdata ). save_dot_abap( lt_post_fields ). save_local_settings( lt_post_fields ). mo_repo->refresh( ). ENDMETHOD. METHOD save_dot_abap. DATA: lo_dot TYPE REF TO zcl_abapgit_dot_abapgit, ls_post_field LIKE LINE OF it_post_fields, lo_requirements TYPE REF TO lcl_requirements. lo_dot = mo_repo->get_dot_abapgit( ). READ TABLE it_post_fields INTO ls_post_field WITH KEY name = 'folder_logic'. ASSERT sy-subrc = 0. lo_dot->set_folder_logic( ls_post_field-value ). READ TABLE it_post_fields INTO ls_post_field WITH KEY name = 'starting_folder'. ASSERT sy-subrc = 0. lo_dot->set_starting_folder( ls_post_field-value ). lo_requirements = lcl_requirements=>new( ). LOOP AT it_post_fields INTO ls_post_field WHERE name CP 'req_*'. CASE ls_post_field-name+4(3). WHEN 'com'. lo_requirements->set_component( ls_post_field-value ). WHEN 'rel'. lo_requirements->set_min_release( ls_post_field-value ). WHEN 'pat'. lo_requirements->set_min_patch( ls_post_field-value ). ENDCASE. ENDLOOP. lo_dot->set_requirements( lo_requirements->get_as_table( ) ). mo_repo->set_dot_abapgit( lo_dot ). ENDMETHOD. METHOD save_local_settings. DATA: ls_settings TYPE zif_abapgit_persistence=>ty_repo-local_settings, ls_post_field LIKE LINE OF it_post_fields, lv_check_variant TYPE sci_chkv. ls_settings = mo_repo->get_local_settings( ). IF mo_repo->is_offline( ) = abap_false. READ TABLE it_post_fields INTO ls_post_field WITH KEY name = 'display_name'. ASSERT sy-subrc = 0. ls_settings-display_name = ls_post_field-value. ENDIF. READ TABLE it_post_fields INTO ls_post_field WITH KEY name = 'write_protected' value = 'on'. IF sy-subrc = 0. ls_settings-write_protected = abap_true. ELSE. ls_settings-write_protected = abap_false. ENDIF. READ TABLE it_post_fields INTO ls_post_field WITH KEY name = 'ignore_subpackages' value = 'on'. IF sy-subrc = 0. ls_settings-ignore_subpackages = abap_true. ELSE. ls_settings-ignore_subpackages = abap_false. ENDIF. READ TABLE it_post_fields INTO ls_post_field WITH KEY name = 'only_local_objects' value = 'on'. IF sy-subrc = 0. ls_settings-only_local_objects = abap_true. ELSE. ls_settings-only_local_objects = abap_false. ENDIF. READ TABLE it_post_fields INTO ls_post_field WITH KEY name = 'check_variant'. ASSERT sy-subrc = 0. lv_check_variant = to_upper( ls_post_field-value ). IF ls_post_field-value IS NOT INITIAL. zcl_abapgit_code_inspector=>validate_check_variant( lv_check_variant ). ENDIF. ls_settings-code_inspector_check_variant = lv_check_variant. READ TABLE it_post_fields INTO ls_post_field WITH KEY name = 'block_commit' value = 'on'. IF sy-subrc = 0. ls_settings-block_commit = abap_true. ELSE. ls_settings-block_commit = abap_false. ENDIF. IF ls_settings-block_commit = abap_true AND ls_settings-code_inspector_check_variant IS INITIAL. zcx_abapgit_exception=>raise( |If block commit is active, a check variant has to be maintained.| ). ENDIF. mo_repo->set_local_settings( ls_settings ). ENDMETHOD. METHOD zif_abapgit_gui_event_handler~on_event. CASE iv_action. WHEN c_action-save_settings. save( it_postdata ). ev_state = zcl_abapgit_gui=>c_event_state-go_back. ENDCASE. ENDMETHOD. METHOD zif_abapgit_gui_page_hotkey~get_hotkey_actions. ENDMETHOD. ENDCLASS.
29.671348
110
0.669885
98f98756c16d826a45874b4b758c2f8998960eeb
986
abap
ABAP
src/zcl_capi_executors.clas.testclasses.abap
larshp/zconcurrency_api
9404d8c6b04d71ada3c8afa963a3f13dab153ac2
[ "MIT" ]
19
2021-01-10T15:47:28.000Z
2022-03-18T08:39:04.000Z
src/zcl_capi_executors.clas.testclasses.abap
larshp/zconcurrency_api
9404d8c6b04d71ada3c8afa963a3f13dab153ac2
[ "MIT" ]
7
2021-01-11T09:17:37.000Z
2021-06-06T15:15:05.000Z
src/zcl_capi_executors.clas.testclasses.abap
larshp/zconcurrency_api
9404d8c6b04d71ada3c8afa963a3f13dab153ac2
[ "MIT" ]
10
2021-01-10T15:47:39.000Z
2022-02-06T17:01:36.000Z
CLASS ltc_capi_executors DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS. PRIVATE SECTION. DATA: mo_cut TYPE REF TO zcl_capi_executors. "class under test METHODS: setup. METHODS: teardown. METHODS: new_fixed_thread_pool FOR TESTING. ENDCLASS. "ltc_Capi_Executors CLASS ltc_capi_executors IMPLEMENTATION. METHOD setup. ENDMETHOD. METHOD teardown. ENDMETHOD. METHOD new_fixed_thread_pool. DATA lo_capi_mhandler TYPE REF TO zcl_capi_message_handler. DATA lo_capi_exec TYPE REF TO zcl_capi_thread_pool_executor. CREATE OBJECT lo_capi_mhandler. lo_capi_exec = zcl_capi_executors=>new_fixed_thread_pool( iv_server_group = 'parallel_generators' io_capi_message_handler = lo_capi_mhandler ). IF lo_capi_exec IS NOT BOUND. cl_aunit_assert=>fail( msg = 'Testing value lo_Capi_Thread_Pool_Executor' ). ENDIF. ENDMETHOD. ENDCLASS.
21.911111
107
0.712982
98fdcdee8786733c0577a536c76fa2b1e6147421
3,345
abap
ABAP
src/zcl_abapgit_branch_overview.clas.testclasses.abap
qinhanguyun/abapGit
272925fff7625a65a22825b546790948769f1556
[ "MIT" ]
1
2019-05-27T18:50:14.000Z
2019-05-27T18:50:14.000Z
src/zcl_abapgit_branch_overview.clas.testclasses.abap
qinhanguyun/abapGit
272925fff7625a65a22825b546790948769f1556
[ "MIT" ]
null
null
null
src/zcl_abapgit_branch_overview.clas.testclasses.abap
qinhanguyun/abapGit
272925fff7625a65a22825b546790948769f1556
[ "MIT" ]
1
2019-12-31T11:44:14.000Z
2019-12-31T11:44:14.000Z
CLASS ltcl_test DEFINITION DEFERRED. CLASS zcl_abapgit_branch_overview DEFINITION LOCAL FRIENDS ltcl_test. CLASS ltcl_test DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL. PRIVATE SECTION. METHODS: parse_commits FOR TESTING RAISING zcx_abapgit_exception, check_author_regex FOR TESTING RAISING zcx_abapgit_exception. ENDCLASS. CLASS ltcl_test IMPLEMENTATION. METHOD parse_commits. DATA: lt_objects TYPE zif_abapgit_definitions=>ty_objects_tt, lt_commits TYPE zcl_abapgit_branch_overview=>ty_commits, ls_commit LIKE LINE OF lt_commits, ls_object LIKE LINE OF lt_objects. ls_object-type = zif_abapgit_definitions=>c_type-commit. ls_object-data = '7472656520396335376238613931336465306539' && '3735333630633261306330643638363037306162' && '61343965650A706172656E742036393532346462' && '3139363263383839366566343364323861616131' && '396536366533373263653364620A617574686F72' && '206C6172736870203C6C617273687040686F746D' && '61696C2E636F6D3E203135333236313133353020' && '2B303030300A636F6D6D6974746572206C617273' && '6870203C6C617273687040686F746D61696C2E63' && '6F6D3E2031353332363131333530202B30303030' && '0A0A56494557'. APPEND ls_object TO lt_objects. lt_commits = zcl_abapgit_branch_overview=>parse_commits( lt_objects ). cl_abap_unit_assert=>assert_equals( act = lines( lt_commits ) exp = 1 ). READ TABLE lt_commits INTO ls_commit INDEX 1. cl_abap_unit_assert=>assert_subrc( ). cl_abap_unit_assert=>assert_equals( act = ls_commit-message exp = 'VIEW' ). ENDMETHOD. METHOD check_author_regex. DATA: lt_objects TYPE zif_abapgit_definitions=>ty_objects_tt, lt_commits TYPE zcl_abapgit_branch_overview=>ty_commits, ls_object LIKE LINE OF lt_objects, ls_git_pack_commit TYPE zcl_abapgit_git_pack=>ty_commit. ls_object-type = zif_abapgit_definitions=>c_type-commit. ls_git_pack_commit-tree = 'dummy'. ls_git_pack_commit-committer = 'dummy'. ls_git_pack_commit-author = 'Lastname, Firstname <[email protected]> 1532611350 +0000'. ls_object-data = zcl_abapgit_git_pack=>encode_commit( ls_git_pack_commit ). APPEND ls_object TO lt_objects. ls_git_pack_commit-author = 'Soeren Mueller <[email protected]> 1532611350 +0000'. ls_object-data = zcl_abapgit_git_pack=>encode_commit( ls_git_pack_commit ). APPEND ls_object TO lt_objects. ls_git_pack_commit-author = 'S#ren M#ller <[email protected]> 1532611350 +0000'. ls_object-data = zcl_abapgit_git_pack=>encode_commit( ls_git_pack_commit ). APPEND ls_object TO lt_objects. ls_git_pack_commit-author = 'Dr. Werner Mueller <[email protected]> 1532611350 +0000'. ls_object-data = zcl_abapgit_git_pack=>encode_commit( ls_git_pack_commit ). APPEND ls_object TO lt_objects. ls_git_pack_commit-author = 'SAP*........ <SAP*........@localhost> 1535375483 +0200'. ls_object-data = zcl_abapgit_git_pack=>encode_commit( ls_git_pack_commit ). APPEND ls_object TO lt_objects. lt_commits = zcl_abapgit_branch_overview=>parse_commits( lt_objects ). cl_abap_unit_assert=>assert_equals( act = lines( lt_commits ) exp = 5 ). ENDMETHOD. ENDCLASS.
33.787879
89
0.736921
c702e3d46934c644ce592f30bdaa00f2f781cf54
991
abap
ABAP
zcl_001_xml_util.clas.abap
TimoJohn/TST_ABAP1
e7f9524626b8d3c2b17d017c84824ab3d5fbc8ec
[ "Apache-2.0" ]
null
null
null
zcl_001_xml_util.clas.abap
TimoJohn/TST_ABAP1
e7f9524626b8d3c2b17d017c84824ab3d5fbc8ec
[ "Apache-2.0" ]
null
null
null
zcl_001_xml_util.clas.abap
TimoJohn/TST_ABAP1
e7f9524626b8d3c2b17d017c84824ab3d5fbc8ec
[ "Apache-2.0" ]
null
null
null
CLASS zcl_001_xml_util DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. *"* public components of class ZCL_001_XML_UTIL *"* do not include other source files here!!! CLASS-METHODS build_xml_datetime IMPORTING !iv_datetime TYPE c RETURNING value(rv_xml_datetime) TYPE zd_001_xml_datetime . PROTECTED SECTION. *"* protected components of class ZCL_001_XML_UTIL *"* do not include other source files here!!! PRIVATE SECTION. *"* private components of class ZCL_001_XML_UTIL *"* do not include other source files here!!! ENDCLASS. CLASS ZCL_001_XML_UTIL IMPLEMENTATION. METHOD build_xml_datetime. rv_xml_datetime = iv_datetime+0(4) && '-' && iv_datetime+4(2) && '-' && iv_datetime+6(2) && 'T' && iv_datetime+8(2) && ':' && iv_datetime+10(2) && ':' && iv_datetime+12(2). ENDMETHOD. "build_xml_datetime ENDCLASS.
26.078947
68
0.624622
c70393e4a30efd138ea9210151f41afc04535ba5
13,306
abap
ABAP
src/zabapgit_gui_router.prog.abap
christian102094/abapGit
b8df5f1e80c3f944f745bdfae61d37931e037e09
[ "MIT" ]
null
null
null
src/zabapgit_gui_router.prog.abap
christian102094/abapGit
b8df5f1e80c3f944f745bdfae61d37931e037e09
[ "MIT" ]
null
null
null
src/zabapgit_gui_router.prog.abap
christian102094/abapGit
b8df5f1e80c3f944f745bdfae61d37931e037e09
[ "MIT" ]
null
null
null
*&---------------------------------------------------------------------* *& Include ZABAPGIT_GUI_ROUTER *&---------------------------------------------------------------------* *----------------------------------------------------------------------* * CLASS lcl_gui_router DEFINITION *----------------------------------------------------------------------* CLASS lcl_gui_router DEFINITION FINAL. PUBLIC SECTION. METHODS on_event IMPORTING iv_action TYPE clike iv_prev_page TYPE clike iv_getdata TYPE clike OPTIONAL it_postdata TYPE cnht_post_data_tab OPTIONAL EXPORTING ei_page TYPE REF TO lif_gui_page ev_state TYPE i RAISING lcx_exception lcx_cancel. PRIVATE SECTION. METHODS get_page_by_name IMPORTING iv_name TYPE clike RETURNING VALUE(ri_page) TYPE REF TO lif_gui_page RAISING lcx_exception. METHODS get_page_diff IMPORTING iv_getdata TYPE clike RETURNING VALUE(ri_page) TYPE REF TO lif_gui_page RAISING lcx_exception. METHODS get_page_branch_overview IMPORTING iv_getdata TYPE clike RETURNING VALUE(ri_page) TYPE REF TO lif_gui_page RAISING lcx_exception. METHODS get_page_stage IMPORTING iv_key TYPE lcl_persistence_repo=>ty_repo-key RETURNING VALUE(ri_page) TYPE REF TO lif_gui_page RAISING lcx_exception. METHODS get_page_db_by_name IMPORTING iv_name TYPE clike iv_getdata TYPE clike RETURNING VALUE(ri_page) TYPE REF TO lif_gui_page RAISING lcx_exception. METHODS get_page_background IMPORTING iv_key TYPE lcl_persistence_repo=>ty_repo-key RETURNING VALUE(ri_page) TYPE REF TO lif_gui_page RAISING lcx_exception. METHODS get_page_playground RETURNING VALUE(ri_page) TYPE REF TO lif_gui_page RAISING lcx_exception lcx_cancel. ENDCLASS. *----------------------------------------------------------------------* * CLASS lcl_gui_router IMPLEMENTATION *----------------------------------------------------------------------* CLASS lcl_gui_router IMPLEMENTATION. METHOD on_event. DATA: lv_url TYPE string, lv_key TYPE lcl_persistence_repo=>ty_repo-key, ls_db TYPE lcl_persistence_db=>ty_content, ls_item TYPE ty_item. lv_key = iv_getdata. " TODO refactor lv_url = iv_getdata. " TODO refactor CASE iv_action. " General routing WHEN gc_action-go_main " Go Main page OR gc_action-go_explore " Go Explore page OR gc_action-go_db " Go DB util page OR gc_action-go_background_run " Go background run page OR gc_action-go_debuginfo " Go debug info page OR gc_action-go_settings. " Go settings page ei_page = get_page_by_name( iv_action ). ev_state = gc_event_state-new_page. WHEN gc_action-go_background. " Go Background page ei_page = get_page_background( lv_key ). ev_state = gc_event_state-new_page. WHEN gc_action-go_diff. " Go Diff page ei_page = get_page_diff( iv_getdata ). ev_state = gc_event_state-new_page. WHEN gc_action-go_stage. " Go Staging page ei_page = get_page_stage( lv_key ). ev_state = gc_event_state-new_page_w_bookmark. WHEN gc_action-go_branch_overview. " Go repo branch overview ei_page = get_page_branch_overview( iv_getdata ). ev_state = gc_event_state-new_page. WHEN gc_action-go_playground. " Create playground page ei_page = get_page_playground( ). ev_state = gc_event_state-new_page. WHEN gc_action-go_tutorial. " Go to tutorial lcl_app=>user( )->set_repo_show( '' ). " Clear show_id ev_state = gc_event_state-re_render. " Assume we are on main page " SAP GUI actions WHEN gc_action-jump. " Open object editor lcl_html_action_utils=>jump_decode( EXPORTING iv_string = iv_getdata IMPORTING ev_obj_type = ls_item-obj_type ev_obj_name = ls_item-obj_name ). lcl_objects=>jump( ls_item ). ev_state = gc_event_state-no_more_act. WHEN gc_action-jump_pkg. " Open SE80 lcl_services_repo=>open_se80( |{ iv_getdata }| ). ev_state = gc_event_state-no_more_act. " DB actions WHEN gc_action-db_display OR gc_action-db_edit. " DB Display/Edit ei_page = get_page_db_by_name( iv_name = iv_action iv_getdata = iv_getdata ). ev_state = gc_event_state-new_page. IF iv_prev_page = 'PAGE_DB_DISPLAY'. ev_state = gc_event_state-new_page_replacing. ENDIF. WHEN gc_action-db_delete. " DB Delete ls_db = lcl_html_action_utils=>dbkey_decode( iv_getdata ). lcl_services_db=>delete( ls_db ). ev_state = gc_event_state-re_render. WHEN gc_action-db_update. " DB Update ls_db = lcl_html_action_utils=>dbcontent_decode( it_postdata ). lcl_services_db=>update( ls_db ). ev_state = gc_event_state-go_back. " Abapgit services actions WHEN gc_action-abapgit_home. " Go abapGit homepage lcl_services_abapgit=>open_abapgit_homepage( ). ev_state = gc_event_state-no_more_act. WHEN gc_action-abapgit_wiki. " Go abapGit wikipage lcl_services_abapgit=>open_abapgit_wikipage( ). ev_state = gc_event_state-no_more_act. WHEN gc_action-abapgit_install. " Install abapGit lcl_services_abapgit=>install_abapgit( ). ev_state = gc_event_state-re_render. WHEN gc_action-abapgit_install_pi. " Install abapGit plugins lcl_services_abapgit=>install_abapgit_pi( ). ev_state = gc_event_state-re_render. " Repository services actions WHEN gc_action-repo_newoffline. " New offline repo lcl_services_repo=>new_offline( ). ev_state = gc_event_state-re_render. WHEN gc_action-repo_refresh. " Repo refresh lcl_services_repo=>refresh( lv_key ). ev_state = gc_event_state-re_render. WHEN gc_action-repo_purge. " Repo remove & purge all objects lcl_services_repo=>purge( lv_key ). ev_state = gc_event_state-re_render. WHEN gc_action-repo_remove. " Repo remove lcl_services_repo=>remove( lv_key ). ev_state = gc_event_state-re_render. WHEN gc_action-repo_clone OR 'install'. " Repo clone, 'install' is for explore page lcl_services_repo=>clone( lv_url ). ev_state = gc_event_state-re_render. WHEN gc_action-repo_refresh_checksums. " Rebuil local checksums lcl_services_repo=>refresh_local_checksums( lv_key ). ev_state = gc_event_state-re_render. WHEN gc_action-repo_toggle_fav. " Toggle repo as favorite lcl_services_repo=>toggle_favorite( lv_key ). ev_state = gc_event_state-re_render. " ZIP services actions WHEN gc_action-zip_import. " Import repo from ZIP lcl_zip=>import( lv_key ). ev_state = gc_event_state-re_render. WHEN gc_action-zip_export. " Export repo as ZIP lcl_zip=>export( lcl_app=>repo_srv( )->get( lv_key ) ). ev_state = gc_event_state-no_more_act. WHEN gc_action-zip_package. " Export package as ZIP lcl_zip=>export_package( ). ev_state = gc_event_state-no_more_act. WHEN gc_action-zip_transport. " Export transport as ZIP lcl_transport=>zip( ). ev_state = gc_event_state-no_more_act. WHEN gc_action-zip_object. " Export object as ZIP lcl_zip=>export_object( ). ev_state = gc_event_state-no_more_act. " Remote origin manipulations WHEN gc_action-repo_remote_attach. " Remote attach lcl_services_repo=>remote_attach( lv_key ). ev_state = gc_event_state-re_render. WHEN gc_action-repo_remote_detach. " Remote detach lcl_services_repo=>remote_detach( lv_key ). ev_state = gc_event_state-re_render. WHEN gc_action-repo_remote_change. " Remote change lcl_services_repo=>remote_change( lv_key ). ev_state = gc_event_state-re_render. " Git actions WHEN gc_action-git_pull. " GIT Pull lcl_services_git=>pull( lv_key ). ev_state = gc_event_state-re_render. WHEN gc_action-git_reset. " GIT Reset lcl_services_git=>reset( lv_key ). ev_state = gc_event_state-re_render. WHEN gc_action-git_branch_create. " GIT Create new branch lcl_services_git=>create_branch( lv_key ). ev_state = gc_event_state-re_render. WHEN gc_action-git_branch_delete. " Delete remote branch lcl_services_git=>delete_branch( lv_key ). ev_state = gc_event_state-re_render. WHEN gc_action-git_branch_switch. " Switch branch lcl_services_git=>switch_branch( lv_key ). ev_state = gc_event_state-re_render. "Others WHEN OTHERS. ev_state = gc_event_state-not_handled. ENDCASE. ENDMETHOD. " on_event METHOD get_page_by_name. DATA: lv_page_class TYPE string, lv_page_name TYPE string. lv_page_name = iv_name. SHIFT lv_page_name LEFT DELETING LEADING 'go_'. lv_page_class = |LCL_GUI_PAGE_{ to_upper( lv_page_name ) }|. TRY. CREATE OBJECT ri_page TYPE (lv_page_class). CATCH cx_sy_create_object_error. lcx_exception=>raise( |Cannot create page class { lv_page_class }| ). ENDTRY. ENDMETHOD. " get_page_by_name METHOD get_page_db_by_name. DATA: lv_page_class TYPE string, lv_message TYPE string, ls_key TYPE lcl_persistence_db=>ty_content. lv_page_class = |LCL_GUI_PAGE_{ to_upper( iv_name ) }|. ls_key = lcl_html_action_utils=>dbkey_decode( iv_getdata ). TRY. CREATE OBJECT ri_page TYPE (lv_page_class) EXPORTING is_key = ls_key. CATCH cx_sy_create_object_error. lv_message = |Cannot create page class { lv_page_class }|. lcx_exception=>raise( lv_message ). ENDTRY. ENDMETHOD. " get_page_db_by_name METHOD get_page_branch_overview. DATA: lo_repo TYPE REF TO lcl_repo_online, lo_page TYPE REF TO lcl_gui_page_branch_overview, lv_key TYPE lcl_persistence_repo=>ty_repo-key. lv_key = iv_getdata. lo_repo ?= lcl_app=>repo_srv( )->get( lv_key ). CREATE OBJECT lo_page EXPORTING io_repo = lo_repo. ri_page = lo_page. ENDMETHOD. "get_page_branch_overview METHOD get_page_diff. DATA: ls_file TYPE ty_file, ls_object TYPE ty_item, lo_page TYPE REF TO lcl_gui_page_diff, lv_key TYPE lcl_persistence_repo=>ty_repo-key. lcl_html_action_utils=>file_obj_decode( EXPORTING iv_string = iv_getdata IMPORTING ev_key = lv_key eg_file = ls_file eg_object = ls_object ). CREATE OBJECT lo_page EXPORTING iv_key = lv_key is_file = ls_file is_object = ls_object. ri_page = lo_page. ENDMETHOD. "get_page_diff METHOD get_page_stage. DATA: lo_repo TYPE REF TO lcl_repo_online, lo_stage_page TYPE REF TO lcl_gui_page_stage. lo_repo ?= lcl_app=>repo_srv( )->get( iv_key ). " force refresh on stage, to make sure the latest local and remote files are used lo_repo->refresh( ). CREATE OBJECT lo_stage_page EXPORTING io_repo = lo_repo. ri_page = lo_stage_page. ENDMETHOD. "get_page_stage METHOD get_page_background. CREATE OBJECT ri_page TYPE lcl_gui_page_background EXPORTING iv_key = iv_key. ENDMETHOD. "get_page_background METHOD get_page_playground. DATA: lv_class_name TYPE string, lv_cancel TYPE abap_bool. lcl_popups=>run_page_class_popup( IMPORTING ev_name = lv_class_name ev_cancel = lv_cancel ). IF lv_cancel = abap_true. RAISE EXCEPTION TYPE lcx_cancel. ENDIF. TRY. CREATE OBJECT ri_page TYPE (lv_class_name). CATCH cx_sy_create_object_error. lcx_exception=>raise( |Cannot create page class { lv_class_name }| ). ENDTRY. ENDMETHOD. "get_page_playground ENDCLASS. " lcl_gui_router
38.456647
92
0.60747
c70411c6e4cf5945770e364a72964de15b464917
5,000
abap
ABAP
src/day02/zcl_advent2020_day02_schmelto.clas.abap
schmelto/abap-advent-2020
631fd0615429d83b80b587499314c06e18a691da
[ "Unlicense" ]
null
null
null
src/day02/zcl_advent2020_day02_schmelto.clas.abap
schmelto/abap-advent-2020
631fd0615429d83b80b587499314c06e18a691da
[ "Unlicense" ]
null
null
null
src/day02/zcl_advent2020_day02_schmelto.clas.abap
schmelto/abap-advent-2020
631fd0615429d83b80b587499314c06e18a691da
[ "Unlicense" ]
null
null
null
" Your flight departs in a few days from the coastal airport; " the easiest way down to the coast from here is via toboggan. " The shopkeeper at the North Pole Toboggan Rental Shop is having a bad day. " "Something's wrong with our computers; we can't log in!" You ask if you can take a look. " Their password database seems to be a little corrupted: " some of the passwords wouldn't have been allowed by the Official Toboggan Corporate Policy " that was in effect when they were chosen. " To try to debug the problem, they have created a list (your puzzle input) " of passwords (according to the corrupted database) and the corporate policy when that password was set. " For example, suppose you have the following list: " 1-3 a: abcde " 1-3 b: cdefg " 2-9 c: ccccccccc " Each line gives the password policy and then the password. " The password policy indicates the lowest and highest number of times a given " letter must appear for the password to be valid. " For example, 1-3 a means that the password must contain a at least 1 time and at most 3 times. " In the above example, 2 passwords are valid. The middle password, cdefg, is not; " it contains no instances of b, but needs at least 1. The first and third passwords are valid: " they contain one a or nine c, both within the limits of their respective policies. " How many passwords are valid according to their policies? " Your puzzle answer was 519. " --- Part Two --- " While it appears you validated the passwords correctly, " they don't seem to be what the Official Toboggan Corporate Authentication System is expecting. " The shopkeeper suddenly realizes that he just accidentally explained the password policy rules from his old job " at the sled rental place down the street! The Official Toboggan Corporate Policy actually works a little differently. " Each policy actually describes two positions in the password, where 1 means the first character, " 2 means the second character, and so on. (Be careful; Toboggan Corporate Policies have no concept of "index zero"!) " Exactly one of these positions must contain the given letter. " Other occurrences of the letter are irrelevant for the purposes of policy enforcement. " Given the same example list from above: " 1-3 a: abcde is valid: position 1 contains a and position 3 does not. " 1-3 b: cdefg is invalid: neither position 1 nor position 3 contains b. " 2-9 c: ccccccccc is invalid: both position 2 and position 9 contain c. " How many passwords are valid according to the new interpretation of the policies? " Your puzzle answer was 708. CLASS zcl_advent2020_day02_schmelto DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES zif_advent2020_schmelto . TYPES: BEGIN OF ty_password, min TYPE string, max TYPE string, letter TYPE c LENGTH 1, password TYPE string, END OF ty_password. TYPES: ty_passwords TYPE STANDARD TABLE OF ty_password WITH EMPTY KEY. METHODS parse IMPORTING !input TYPE string RETURNING VALUE(passwords) TYPE ty_passwords. METHODS part1 IMPORTING !input TYPE string RETURNING VALUE(output) TYPE string . METHODS part2 IMPORTING !input TYPE string RETURNING VALUE(output) TYPE string . PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS zcl_advent2020_day02_schmelto IMPLEMENTATION. METHOD parse. DATA strings TYPE STANDARD TABLE OF string. DATA password LIKE LINE OF passwords. SPLIT input AT |\r\n| INTO TABLE strings. LOOP AT strings INTO DATA(string). CLEAR password. FIND REGEX '(\d+)-(\d+) (\w): (\w+)' IN string SUBMATCHES password-min password-max password-letter password-password. ASSERT sy-subrc = 0. APPEND password TO passwords. ENDLOOP. ENDMETHOD. METHOD part1. DATA(passwords) = parse( input ). DATA(valid) = 0. LOOP AT passwords INTO DATA(password). FIND ALL OCCURRENCES OF password-letter IN password-password MATCH COUNT DATA(count). IF count BETWEEN password-min AND password-max. valid = valid + 1. ENDIF. ENDLOOP. output = valid. CONDENSE output. ENDMETHOD. METHOD part2. DATA(lt_passwords) = parse( input ). DATA(lv_valid) = 0. LOOP AT lt_passwords INTO DATA(ls_password). DATA(lv_pos1) = ls_password-min - 1. DATA(lv_pos2) = ls_password-max - 1. DATA(lv_val1) = ls_password-password+lv_pos1(1). DATA(lv_val2) = ls_password-password+lv_pos2(1). IF ( lv_val1 = ls_password-letter AND lv_val2 <> ls_password-letter ) OR ( lv_val1 <> ls_password-letter AND lv_val2 = ls_password-letter ). lv_valid = lv_valid + 1. ENDIF. ENDLOOP. output = lv_valid. CONDENSE output. ENDMETHOD. METHOD zif_advent2020_schmelto~solve. output = part2( input ). ENDMETHOD. ENDCLASS.
32.467532
119
0.7058
c708e735a9ee2d0e6e8a688c842a23b3fc579752
5,596
abap
ABAP
src/zcl_abapgit_tran_to_bran.clas.testclasses.abap
flaiker/background_modes
9d1e388d72c5d4755d0517dd523c8f8524009ce5
[ "MIT" ]
null
null
null
src/zcl_abapgit_tran_to_bran.clas.testclasses.abap
flaiker/background_modes
9d1e388d72c5d4755d0517dd523c8f8524009ce5
[ "MIT" ]
null
null
null
src/zcl_abapgit_tran_to_bran.clas.testclasses.abap
flaiker/background_modes
9d1e388d72c5d4755d0517dd523c8f8524009ce5
[ "MIT" ]
null
null
null
CLASS lcl_helper DEFINITION FOR TESTING CREATE PRIVATE. PUBLIC SECTION. TYPES: BEGIN OF ty_tadir, object TYPE tadir-object, obj_name TYPE tadir-obj_name, devclass TYPE tadir-devclass, END OF ty_tadir. TYPES: ty_tadir_tt TYPE STANDARD TABLE OF ty_tadir WITH EMPTY KEY. TYPES: BEGIN OF ty_package, package TYPE devclass, parent TYPE devclass, END OF ty_package. TYPES: ty_packages_tt TYPE STANDARD TABLE OF ty_package WITH EMPTY KEY. CLASS-METHODS: inject IMPORTING it_tadir TYPE ty_tadir_tt OPTIONAL it_packages TYPE ty_packages_tt OPTIONAL. INTERFACES: zif_abapgit_tadir PARTIALLY IMPLEMENTED, zif_abapgit_sap_package PARTIALLY IMPLEMENTED. PRIVATE SECTION. DATA: mv_package TYPE devclass. CLASS-DATA: gt_packages TYPE ty_packages_tt, gt_tadir TYPE ty_tadir_tt. METHODS: constructor IMPORTING iv_package TYPE devclass OPTIONAL. ENDCLASS. CLASS lcl_helper IMPLEMENTATION. METHOD constructor. mv_package = iv_package. ENDMETHOD. METHOD inject. gt_packages = it_packages. gt_tadir = it_tadir. zcl_abapgit_injector=>set_tadir( NEW lcl_helper( ) ). LOOP AT it_packages INTO DATA(ls_package). zcl_abapgit_injector=>set_sap_package( iv_package = ls_package-package ii_sap_package = NEW lcl_helper( ls_package-package ) ). ENDLOOP. ENDMETHOD. METHOD zif_abapgit_sap_package~list_subpackages. LOOP AT gt_packages INTO DATA(ls_package) WHERE parent = mv_package. APPEND ls_package-package TO rt_list. ENDLOOP. ENDMETHOD. METHOD zif_abapgit_tadir~read_single. READ TABLE gt_tadir INTO DATA(ls_tadir) WITH KEY object = iv_object obj_name = iv_obj_name. cl_abap_unit_assert=>assert_subrc( ). MOVE-CORRESPONDING ls_tadir TO rs_tadir. ENDMETHOD. ENDCLASS. CLASS ltcl_is_relevant DEFINITION DEFERRED. CLASS zcl_abapgit_tran_to_bran DEFINITION LOCAL FRIENDS ltcl_is_relevant. CLASS ltcl_is_relevant DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL. PRIVATE SECTION. DATA: mo_cut TYPE REF TO zcl_abapgit_tran_to_bran. METHODS: setup, empty FOR TESTING RAISING zcx_abapgit_exception, nope FOR TESTING RAISING zcx_abapgit_exception, sub FOR TESTING RAISING zcx_abapgit_exception, outside FOR TESTING RAISING zcx_abapgit_exception. ENDCLASS. CLASS ltcl_is_relevant IMPLEMENTATION. METHOD setup. mo_cut = NEW #( ). ENDMETHOD. METHOD empty. DATA(lv_relevant) = mo_cut->is_relevant( iv_main = '$MAIN' it_objects = VALUE #( ) ). cl_abap_unit_assert=>assert_equals( act = lv_relevant exp = abap_false ). ENDMETHOD. METHOD nope. lcl_helper=>inject( it_tadir = VALUE #( ( object = 'CLAS' obj_name = 'ZCL_FOOBAR' devclass = '$MAIN' ) ) ). DATA(lv_relevant) = mo_cut->is_relevant( iv_main = '$MAIN' it_objects = VALUE #( ( object = 'CLAS' obj_name = 'ZCL_FOOBAR' ) ) ). cl_abap_unit_assert=>assert_equals( act = lv_relevant exp = abap_true ). ENDMETHOD. METHOD sub. lcl_helper=>inject( it_tadir = VALUE #( ( object = 'CLAS' obj_name = 'ZCL_FOOBAR' devclass = '$SUB' ) ) it_packages = VALUE #( ( package = '$MAIN' ) ( package = '$SUB' parent = '$MAIN' ) ) ). DATA(lv_relevant) = mo_cut->is_relevant( iv_main = '$MAIN' it_objects = VALUE #( ( object = 'CLAS' obj_name = 'ZCL_FOOBAR' ) ) ). cl_abap_unit_assert=>assert_equals( act = lv_relevant exp = abap_true ). ENDMETHOD. METHOD outside. lcl_helper=>inject( it_tadir = VALUE #( ( object = 'CLAS' obj_name = 'ZCL_FOOBAR' devclass = '$OTHER' ) ) ). DATA(lv_relevant) = mo_cut->is_relevant( iv_main = '$MAIN' it_objects = VALUE #( ( object = 'CLAS' obj_name = 'ZCL_FOOBAR' ) ) ). cl_abap_unit_assert=>assert_equals( act = lv_relevant exp = abap_false ). ENDMETHOD. ENDCLASS. CLASS ltcl_build_stage DEFINITION DEFERRED. CLASS zcl_abapgit_tran_to_bran DEFINITION LOCAL FRIENDS ltcl_build_stage. CLASS ltcl_build_stage DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL. PUBLIC SECTION. INTERFACES: zif_abapgit_stage_logic PARTIALLY IMPLEMENTED, zif_bg_transports PARTIALLY IMPLEMENTED. PRIVATE SECTION. DATA: mo_cut TYPE REF TO zcl_abapgit_tran_to_bran. METHODS: setup, test01 FOR TESTING RAISING cx_static_check. ENDCLASS. CLASS ltcl_build_stage IMPLEMENTATION. METHOD setup. mo_cut = NEW #( ). mo_cut->mo_log = NEW zcl_abapgit_log( ). zcl_abapgit_injector=>set_stage_logic( me ). zcl_bg_injector=>set_transports( me ). ENDMETHOD. METHOD zif_abapgit_stage_logic~get. rs_files = VALUE #( local = VALUE #( ( item-obj_type = 'PROG' item-obj_name = 'ZFOOBAR' ) ) ). ENDMETHOD. METHOD zif_bg_transports~read_description. rv_description = |Hello World|. ENDMETHOD. METHOD zif_bg_transports~list_contents. rt_list = VALUE #( ( pgmid = 'R3TR' object = 'PROG' obj_name = 'ZFOOBAR' ) ). ENDMETHOD. METHOD test01. DATA(lt_result) = mo_cut->build_stage( 'ABC123' ). cl_abap_unit_assert=>assert_equals( act = lines( lt_result ) exp = 1 ). ENDMETHOD. ENDCLASS.
22.747967
80
0.660472
c70bdb6c400d2bb4d8826ec427f7f95da9146ed1
584
abap
ABAP
src/zfg_dp.fugr.zf_dp_mvc_entegrasyon.abap
keremkoseoglu/MAR2022
1761a16ce4d180e9102d78b70859f69e56aeef04
[ "MIT" ]
null
null
null
src/zfg_dp.fugr.zf_dp_mvc_entegrasyon.abap
keremkoseoglu/MAR2022
1761a16ce4d180e9102d78b70859f69e56aeef04
[ "MIT" ]
null
null
null
src/zfg_dp.fugr.zf_dp_mvc_entegrasyon.abap
keremkoseoglu/MAR2022
1761a16ce4d180e9102d78b70859f69e56aeef04
[ "MIT" ]
null
null
null
FUNCTION ZF_DP_MVC_ENTEGRASYON. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" VALUE(FLDATE) TYPE SFLIGHT-FLDATE *" TABLES *" FLIGHTS STRUCTURE SFLIGHT OPTIONAL *"---------------------------------------------------------------------- data(model) = new zcl_dp_mvc_model( value #( fldate_rng = value #( ( sign = 'I' option = 'EQ' low = fldate ) ) ) ). flights[] = model->flights. ENDFUNCTION.
32.444444
72
0.371575
c70d02461ebaff8fda7458e1528afba89b90d79e
6,277
abap
ABAP
src/ui/zcl_abapgit_gui_page_data.clas.abap
Manny27nyc/abapGit
dc51247e9b8c0c792193aba857ec31df3a82db4a
[ "MIT" ]
317
2020-09-25T19:50:59.000Z
2022-03-29T22:59:01.000Z
src/ui/zcl_abapgit_gui_page_data.clas.abap
Manny27nyc/abapGit
dc51247e9b8c0c792193aba857ec31df3a82db4a
[ "MIT" ]
1,114
2020-09-24T07:44:36.000Z
2022-03-31T18:01:19.000Z
src/ui/zcl_abapgit_gui_page_data.clas.abap
Manny27nyc/abapGit
dc51247e9b8c0c792193aba857ec31df3a82db4a
[ "MIT" ]
167
2020-09-24T18:31:37.000Z
2022-03-24T10:07:04.000Z
CLASS zcl_abapgit_gui_page_data DEFINITION PUBLIC INHERITING FROM zcl_abapgit_gui_page FINAL CREATE PUBLIC . PUBLIC SECTION. METHODS constructor IMPORTING !iv_key TYPE zif_abapgit_persistence=>ty_repo-key RAISING zcx_abapgit_exception . METHODS zif_abapgit_gui_event_handler~on_event REDEFINITION . PROTECTED SECTION. CONSTANTS: BEGIN OF c_event, add TYPE string VALUE 'add', update TYPE string VALUE 'update', remove TYPE string VALUE 'remove', END OF c_event . CONSTANTS: BEGIN OF c_id, table TYPE string VALUE 'table', where TYPE string VALUE 'where', END OF c_id . DATA mi_config TYPE REF TO zif_abapgit_data_config . METHODS render_content REDEFINITION . PRIVATE SECTION. DATA mo_repo TYPE REF TO zcl_abapgit_repo . METHODS build_where IMPORTING !io_map TYPE REF TO zcl_abapgit_string_map RETURNING VALUE(rt_where) TYPE string_table . METHODS render_add RETURNING VALUE(ri_html) TYPE REF TO zif_abapgit_html RAISING zcx_abapgit_exception . METHODS render_existing RETURNING VALUE(ri_html) TYPE REF TO zif_abapgit_html RAISING zcx_abapgit_exception . METHODS event_add IMPORTING !ii_event TYPE REF TO zif_abapgit_gui_event RAISING zcx_abapgit_exception . METHODS event_remove IMPORTING !ii_event TYPE REF TO zif_abapgit_gui_event RAISING zcx_abapgit_exception . METHODS event_update IMPORTING !ii_event TYPE REF TO zif_abapgit_gui_event RAISING zcx_abapgit_exception . ENDCLASS. CLASS zcl_abapgit_gui_page_data IMPLEMENTATION. METHOD build_where. DATA lv_where LIKE LINE OF rt_where. SPLIT io_map->get( c_id-where ) AT |\n| INTO TABLE rt_where. DELETE rt_where WHERE table_line IS INITIAL. LOOP AT rt_where INTO lv_where. IF strlen( lv_where ) <= 2. DELETE rt_where INDEX sy-tabix. ENDIF. ENDLOOP. ENDMETHOD. METHOD constructor. super->constructor( ). ms_control-page_title = 'Data'. mo_repo = zcl_abapgit_repo_srv=>get_instance( )->get( iv_key ). mi_config = mo_repo->get_data_config( ). ENDMETHOD. METHOD event_add. DATA lo_map TYPE REF TO zcl_abapgit_string_map. DATA ls_config TYPE zif_abapgit_data_config=>ty_config. lo_map = ii_event->form_data( ). ls_config-type = zif_abapgit_data_config=>c_data_type-tabu. ls_config-name = to_upper( lo_map->get( c_id-table ) ). ls_config-where = build_where( lo_map ). mi_config->add_config( ls_config ). ENDMETHOD. METHOD event_remove. DATA lo_map TYPE REF TO zcl_abapgit_string_map. DATA ls_config TYPE zif_abapgit_data_config=>ty_config. lo_map = ii_event->form_data( ). ls_config-type = zif_abapgit_data_config=>c_data_type-tabu. ls_config-name = to_upper( lo_map->get( c_id-table ) ). mi_config->remove_config( ls_config ). ENDMETHOD. METHOD event_update. DATA lo_map TYPE REF TO zcl_abapgit_string_map. DATA ls_config TYPE zif_abapgit_data_config=>ty_config. lo_map = ii_event->form_data( ). ls_config-type = zif_abapgit_data_config=>c_data_type-tabu. ls_config-name = to_upper( lo_map->get( c_id-table ) ). ls_config-where = build_where( lo_map ). mi_config->update_config( ls_config ). ENDMETHOD. METHOD render_add. DATA lo_form TYPE REF TO zcl_abapgit_html_form. DATA lo_form_data TYPE REF TO zcl_abapgit_string_map. CREATE OBJECT ri_html TYPE zcl_abapgit_html. CREATE OBJECT lo_form_data. lo_form = zcl_abapgit_html_form=>create( ). lo_form->text( iv_label = 'Table' iv_name = c_id-table iv_required = abap_true ). lo_form->textarea( iv_label = 'Where' iv_placeholder = 'Conditions separated by newline' iv_name = c_id-where ). lo_form->command( iv_label = 'Add' iv_cmd_type = zif_abapgit_html_form=>c_cmd_type-input_main iv_action = c_event-add ). ri_html->add( lo_form->render( lo_form_data ) ). ENDMETHOD. METHOD render_content. CREATE OBJECT ri_html TYPE zcl_abapgit_html. ri_html->add( render_add( ) ). ri_html->add( render_existing( ) ). ENDMETHOD. METHOD render_existing. DATA lo_form TYPE REF TO zcl_abapgit_html_form. DATA lo_form_data TYPE REF TO zcl_abapgit_string_map. DATA lt_configs TYPE zif_abapgit_data_config=>ty_config_tt. DATA ls_config LIKE LINE OF lt_configs. CREATE OBJECT ri_html TYPE zcl_abapgit_html. CREATE OBJECT lo_form_data. lt_configs = mi_config->get_configs( ). LOOP AT lt_configs INTO ls_config. lo_form = zcl_abapgit_html_form=>create( ). CREATE OBJECT lo_form_data. lo_form_data->set( iv_key = c_id-table iv_val = |{ ls_config-name }| ). lo_form->text( iv_label = 'Table' iv_name = c_id-table iv_readonly = abap_true ). lo_form_data->set( iv_key = c_id-where iv_val = concat_lines_of( table = ls_config-where sep = |\n| ) ). lo_form->textarea( iv_label = 'Where' iv_placeholder = 'Conditions separated by newline' iv_name = c_id-where ). lo_form->command( iv_label = 'Update' iv_cmd_type = zif_abapgit_html_form=>c_cmd_type-input_main iv_action = c_event-update ). lo_form->command( iv_label = 'Remove' iv_action = c_event-remove ). ri_html->add( lo_form->render( lo_form_data ) ). ENDLOOP. ENDMETHOD. METHOD zif_abapgit_gui_event_handler~on_event. CASE ii_event->mv_action. WHEN c_event-add. event_add( ii_event ). rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render. WHEN c_event-update. event_update( ii_event ). rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render. WHEN c_event-remove. event_remove( ii_event ). rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render. ENDCASE. ENDMETHOD. ENDCLASS.
25.108
73
0.671499
c70ffed52603d51312c792bb951a4135197bf23f
1,004
abap
ABAP
zcx_dynscreen_stat_chk_base.clas.abap
thedoginthewok/ZwdDynscreen
eb5b532a7743f00bd762e9e165c2f4662ff2d987
[ "MIT" ]
3
2019-03-01T14:24:43.000Z
2019-12-09T17:30:34.000Z
zcx_dynscreen_stat_chk_base.clas.abap
thedoginthewok/ZwdDynscreen
eb5b532a7743f00bd762e9e165c2f4662ff2d987
[ "MIT" ]
null
null
null
zcx_dynscreen_stat_chk_base.clas.abap
thedoginthewok/ZwdDynscreen
eb5b532a7743f00bd762e9e165c2f4662ff2d987
[ "MIT" ]
2
2019-06-28T09:00:16.000Z
2021-12-23T15:47:32.000Z
CLASS zcx_dynscreen_stat_chk_base DEFINITION PUBLIC INHERITING FROM cx_static_check ABSTRACT CREATE PUBLIC. PUBLIC SECTION. INTERFACES: if_t100_message. METHODS: constructor IMPORTING textid LIKE if_t100_message=>t100key OPTIONAL previous LIKE previous OPTIONAL . PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS zcx_dynscreen_stat_chk_base IMPLEMENTATION. METHOD constructor ##ADT_SUPPRESS_GENERATION. * --------------------------------------------------------------------- super->constructor( previous = previous ). * --------------------------------------------------------------------- CLEAR me->textid. * --------------------------------------------------------------------- IF textid IS INITIAL. if_t100_message~t100key = if_t100_message=>default_textid. ELSE. if_t100_message~t100key = textid. ENDIF. * --------------------------------------------------------------------- ENDMETHOD. ENDCLASS.
29.529412
107
0.518924
c710f9b3f868a678782691ca51d685684387b6dd
2,767
abap
ABAP
src/zcl_graphql_test_model.clas.abap
Allam76/abapGraphql2
650fa13d408da974ee2699eb4af59be914912fb5
[ "MIT" ]
5
2019-11-19T21:14:06.000Z
2022-02-05T10:57:39.000Z
src/zcl_graphql_test_model.clas.abap
Allam76/abapGraphql2
650fa13d408da974ee2699eb4af59be914912fb5
[ "MIT" ]
null
null
null
src/zcl_graphql_test_model.clas.abap
Allam76/abapGraphql2
650fa13d408da974ee2699eb4af59be914912fb5
[ "MIT" ]
null
null
null
class zcl_graphql_test_model definition public create public . public section. type-pools zgrql. 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 entity_out_type, id type string, label type string, attributes type attribute_out_type_tab, relations type rel_out_type_tab, tables type stringtab, views type stringtab, end of entity_out_type, entity_out_type_tab type table of entity_out_type with key id. data entities type entity_out_type_tab. methods load_model_from_mime importing name type string. methods convert_2_graphql_metadata returning value(result) type zgrql_schema_type. protected section. private section. endclass. class zcl_graphql_test_model implementation. method load_model_from_mime. 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 = me->entities ). endmethod. method convert_2_graphql_metadata. * data(types) = value zgrql_type_type_tab( for entity in me->entities ( * name = entity-label * kind = 'OBJECT' * of_type = value #( ) * ) ). * result = value #( * query_type = value #( name = 'QueryType' kind = 'OBJECT' description = '' ) * types = value #( for entity in me->entities ( * name = '' * kind = '' * of_type = value #( ) * fields = value #( for att in entity-attributes ( * name = '' * kind = '' * type = att-type, * * ) ) * ) ) ). endmethod. endclass.
33.337349
134
0.650885
c71db2c106d6ea2a501fad26549c2753094941ee
6,348
abap
ABAP
src/objects/zcl_abapgit_object_idoc.clas.abap
Fmueller17/abapGit
0db2c9c0859403330726fc64913e133c854f2667
[ "MIT" ]
1
2022-01-19T05:10:00.000Z
2022-01-19T05:10:00.000Z
src/objects/zcl_abapgit_object_idoc.clas.abap
Fmueller17/abapGit
0db2c9c0859403330726fc64913e133c854f2667
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_idoc.clas.abap
Fmueller17/abapGit
0db2c9c0859403330726fc64913e133c854f2667
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_object_idoc DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL. PUBLIC SECTION. INTERFACES zif_abapgit_object. ALIASES mo_files FOR zif_abapgit_object~mo_files. METHODS: constructor IMPORTING is_item TYPE zif_abapgit_definitions=>ty_item iv_language TYPE spras. CLASS-METHODS clear_idoc_segement_fields CHANGING cg_structure TYPE any. PROTECTED SECTION. PRIVATE SECTION. TYPES: BEGIN OF ty_idoc, attributes TYPE edi_iapi01, t_syntax TYPE STANDARD TABLE OF edi_iapi02 WITH NON-UNIQUE DEFAULT KEY, END OF ty_idoc. DATA: mv_idoctyp TYPE edi_iapi00-idoctyp. CLASS-METHODS clear_idoc_segement_field IMPORTING iv_fieldname TYPE csequence CHANGING cg_structure TYPE any. ENDCLASS. CLASS zcl_abapgit_object_idoc IMPLEMENTATION. METHOD clear_idoc_segement_field. FIELD-SYMBOLS <lg_any_field> TYPE any. ASSIGN COMPONENT iv_fieldname OF STRUCTURE cg_structure TO <lg_any_field>. IF sy-subrc = 0. CLEAR <lg_any_field>. ENDIF. ENDMETHOD. METHOD clear_idoc_segement_fields. clear_idoc_segement_field( EXPORTING iv_fieldname = 'DEVC' CHANGING cg_structure = cg_structure ). clear_idoc_segement_field( EXPORTING iv_fieldname = 'PLAST' CHANGING cg_structure = cg_structure ). clear_idoc_segement_field( EXPORTING iv_fieldname = 'PWORK' CHANGING cg_structure = cg_structure ). clear_idoc_segement_field( EXPORTING iv_fieldname = 'PRESP' CHANGING cg_structure = cg_structure ). clear_idoc_segement_field( EXPORTING iv_fieldname = 'CREDATE' CHANGING cg_structure = cg_structure ). clear_idoc_segement_field( EXPORTING iv_fieldname = 'CRETIME' CHANGING cg_structure = cg_structure ). clear_idoc_segement_field( EXPORTING iv_fieldname = 'LDATE' CHANGING cg_structure = cg_structure ). clear_idoc_segement_field( EXPORTING iv_fieldname = 'LTIME' CHANGING cg_structure = cg_structure ). ENDMETHOD. METHOD constructor. super->constructor( is_item = is_item iv_language = iv_language ). mv_idoctyp = ms_item-obj_name. ENDMETHOD. METHOD zif_abapgit_object~changed_by. DATA: ls_attributes TYPE edi_iapi01. CALL FUNCTION 'IDOCTYPE_READ' EXPORTING pi_idoctyp = mv_idoctyp IMPORTING pe_attributes = ls_attributes EXCEPTIONS object_not_found = 1 db_error = 2 no_authority = 3 OTHERS = 4. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. rv_user = ls_attributes-plast. ENDMETHOD. METHOD zif_abapgit_object~delete. CALL FUNCTION 'IDOCTYPE_DELETE' EXPORTING pi_idoctyp = mv_idoctyp EXCEPTIONS object_not_found = 1 lock_error = 2 action_not_possible = 3 transport_error = 4 db_error = 5 no_authority = 6 OTHERS = 7. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDMETHOD. METHOD zif_abapgit_object~deserialize. DATA: ls_idoc TYPE ty_idoc, ls_attributes TYPE edi_iapi05. io_xml->read( EXPORTING iv_name = 'IDOC' CHANGING cg_data = ls_idoc ). MOVE-CORRESPONDING ls_idoc-attributes TO ls_attributes. CALL FUNCTION 'IDOCTYPE_CREATE' EXPORTING pi_idoctyp = mv_idoctyp pi_devclass = iv_package pi_attributes = ls_attributes TABLES pt_syntax = ls_idoc-t_syntax EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDMETHOD. METHOD zif_abapgit_object~exists. CALL FUNCTION 'IDOCTYPE_READ' EXPORTING pi_idoctyp = mv_idoctyp EXCEPTIONS object_not_found = 1 db_error = 2 no_authority = 3 OTHERS = 4. rv_bool = boolc( sy-subrc = 0 ). ENDMETHOD. METHOD zif_abapgit_object~get_comparator. RETURN. ENDMETHOD. METHOD zif_abapgit_object~get_deserialize_steps. APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps. ENDMETHOD. METHOD zif_abapgit_object~get_metadata. rs_metadata = get_metadata( ). ENDMETHOD. METHOD zif_abapgit_object~is_active. rv_active = is_active( ). ENDMETHOD. METHOD zif_abapgit_object~is_locked. rv_is_locked = abap_false. ENDMETHOD. METHOD zif_abapgit_object~jump. DATA: lt_bdcdata TYPE TABLE OF bdcdata. FIELD-SYMBOLS: <ls_bdcdata> LIKE LINE OF lt_bdcdata. APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>. <ls_bdcdata>-program = 'SAPMSED5'. <ls_bdcdata>-dynpro = '0010'. <ls_bdcdata>-dynbegin = abap_true. APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>. <ls_bdcdata>-fnam = 'SED5STRUC-OBJECT'. <ls_bdcdata>-fval = ms_item-obj_name. APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>. <ls_bdcdata>-fnam = 'SED5STRUC-SELECT_ORG'. <ls_bdcdata>-fval = abap_true. APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>. <ls_bdcdata>-fnam = 'BDC_OKCODE'. <ls_bdcdata>-fval = '=DISP'. zcl_abapgit_ui_factory=>get_gui_jumper( )->jump_batch_input( iv_tcode = 'WE30' it_bdcdata = lt_bdcdata ). ENDMETHOD. METHOD zif_abapgit_object~serialize. DATA: ls_idoc TYPE ty_idoc. CALL FUNCTION 'IDOCTYPE_READ' EXPORTING pi_idoctyp = mv_idoctyp IMPORTING pe_attributes = ls_idoc-attributes TABLES pt_syntax = ls_idoc-t_syntax EXCEPTIONS object_not_found = 1 db_error = 2 no_authority = 3 OTHERS = 4. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. clear_idoc_segement_fields( CHANGING cg_structure = ls_idoc-attributes ). io_xml->add( iv_name = 'IDOC' ig_data = ls_idoc ). ENDMETHOD. ENDCLASS.
25.290837
96
0.64288
c71f401f212579781b8dd09c7defa9500a6d742a
14,578
abap
ABAP
src/ui/zcl_abapgit_free_sel_dialog.clas.abap
IvxLars/abapGit
bcdeebb3ad1432034b5ad1ea40683470956b8e07
[ "MIT" ]
797
2015-02-06T15:38:41.000Z
2020-09-23T02:57:02.000Z
src/ui/zcl_abapgit_free_sel_dialog.clas.abap
IvxLars/abapGit
bcdeebb3ad1432034b5ad1ea40683470956b8e07
[ "MIT" ]
2,776
2015-01-13T03:59:55.000Z
2020-09-23T21:46:34.000Z
src/ui/zcl_abapgit_free_sel_dialog.clas.abap
IvxLars/abapGit
bcdeebb3ad1432034b5ad1ea40683470956b8e07
[ "MIT" ]
499
2015-01-13T03:41:36.000Z
2020-09-22T11:50:54.000Z
"! Free Selections Dialog CLASS zcl_abapgit_free_sel_dialog DEFINITION PUBLIC FINAL CREATE PUBLIC. PUBLIC SECTION. TYPES: BEGIN OF ty_free_sel_field, name TYPE fieldname, only_parameter TYPE abap_bool, param_obligatory TYPE abap_bool, value TYPE string, value_range TYPE rsds_selopt_t, ddic_tabname TYPE tabname, ddic_fieldname TYPE fieldname, text TYPE rsseltext, END OF ty_free_sel_field, ty_free_sel_field_tab TYPE STANDARD TABLE OF ty_free_sel_field WITH DEFAULT KEY. TYPES: ty_syst_title TYPE c LENGTH 70. METHODS: constructor IMPORTING iv_title TYPE ty_syst_title OPTIONAL iv_frame_text TYPE ty_syst_title OPTIONAL, set_fields CHANGING ct_fields TYPE ty_free_sel_field_tab, show RAISING zcx_abapgit_cancel zcx_abapgit_exception. PROTECTED SECTION. PRIVATE SECTION. TYPES: ty_field_text_tab TYPE STANDARD TABLE OF rsdstexts WITH DEFAULT KEY. METHODS: convert_input_fields EXPORTING et_default_values TYPE rsds_trange es_restriction TYPE sscr_restrict_ds et_fields TYPE rsdsfields_t et_field_texts TYPE ty_field_text_tab, free_selections_init IMPORTING it_default_values TYPE rsds_trange is_restriction TYPE sscr_restrict_ds EXPORTING ev_selection_id TYPE dynselid CHANGING ct_fields TYPE rsdsfields_t ct_field_texts TYPE ty_field_text_tab RAISING zcx_abapgit_exception, free_selections_dialog IMPORTING iv_selection_id TYPE dynselid EXPORTING et_result_ranges TYPE rsds_trange CHANGING ct_fields TYPE rsdsfields_t RAISING zcx_abapgit_cancel zcx_abapgit_exception, validate_results IMPORTING it_result_ranges TYPE rsds_trange RAISING zcx_abapgit_exception, transfer_results_to_input IMPORTING it_result_ranges TYPE rsds_trange. DATA: mr_fields TYPE REF TO ty_free_sel_field_tab, mv_title TYPE ty_syst_title, mv_frame_text TYPE ty_syst_title. ENDCLASS. CLASS zcl_abapgit_free_sel_dialog IMPLEMENTATION. METHOD constructor. mv_title = iv_title. mv_frame_text = iv_frame_text. ENDMETHOD. METHOD convert_input_fields. CONSTANTS: lc_only_eq_optlist_name TYPE c LENGTH 10 VALUE 'ONLYEQ'. DATA: ls_parameter_opt_list TYPE sscr_opt_list. FIELD-SYMBOLS: <ls_input_field> TYPE ty_free_sel_field, <lt_input_fields> TYPE ty_free_sel_field_tab, <ls_free_sel_field> TYPE rsdsfields, <ls_restriction_ass> TYPE sscr_ass_ds, <ls_text> TYPE rsdstexts, <ls_default_value> TYPE rsds_range, <ls_default_value_range> TYPE rsds_frange, <ls_default_val_range_line> TYPE rsdsselopt. ASSERT mr_fields IS BOUND. ASSIGN mr_fields->* TO <lt_input_fields>. LOOP AT <lt_input_fields> ASSIGNING <ls_input_field>. APPEND INITIAL LINE TO et_fields ASSIGNING <ls_free_sel_field>. <ls_free_sel_field>-fieldname = <ls_input_field>-ddic_fieldname. <ls_free_sel_field>-tablename = <ls_input_field>-ddic_tabname. IF <ls_input_field>-only_parameter = abap_true. IF es_restriction IS INITIAL. ls_parameter_opt_list-name = lc_only_eq_optlist_name. ls_parameter_opt_list-options-eq = abap_true. APPEND ls_parameter_opt_list TO es_restriction-opt_list_tab. ENDIF. APPEND INITIAL LINE TO es_restriction-ass_tab ASSIGNING <ls_restriction_ass>. <ls_restriction_ass>-kind = 'S'. <ls_restriction_ass>-fieldname = <ls_input_field>-ddic_fieldname. <ls_restriction_ass>-tablename = <ls_input_field>-ddic_tabname. <ls_restriction_ass>-sg_main = 'I'. <ls_restriction_ass>-sg_addy = 'N'. <ls_restriction_ass>-op_main = lc_only_eq_optlist_name. ENDIF. IF <ls_input_field>-text IS NOT INITIAL. APPEND INITIAL LINE TO et_field_texts ASSIGNING <ls_text>. <ls_text>-fieldname = <ls_input_field>-ddic_fieldname. <ls_text>-tablename = <ls_input_field>-ddic_tabname. <ls_text>-text = <ls_input_field>-text. ENDIF. IF <ls_input_field>-value IS NOT INITIAL OR <ls_input_field>-value_range IS NOT INITIAL. READ TABLE et_default_values WITH KEY tablename = <ls_input_field>-ddic_tabname ASSIGNING <ls_default_value>. IF sy-subrc <> 0. APPEND INITIAL LINE TO et_default_values ASSIGNING <ls_default_value>. <ls_default_value>-tablename = <ls_input_field>-ddic_tabname. ENDIF. APPEND INITIAL LINE TO <ls_default_value>-frange_t ASSIGNING <ls_default_value_range>. <ls_default_value_range>-fieldname = <ls_input_field>-ddic_fieldname. IF <ls_input_field>-value IS NOT INITIAL. APPEND INITIAL LINE TO <ls_default_value_range>-selopt_t ASSIGNING <ls_default_val_range_line>. <ls_default_val_range_line>-sign = 'I'. <ls_default_val_range_line>-option = 'EQ'. <ls_default_val_range_line>-low = <ls_input_field>-value. ELSEIF <ls_input_field>-value_range IS NOT INITIAL. <ls_default_value_range>-selopt_t = <ls_input_field>-value_range. ENDIF. ENDIF. ENDLOOP. ENDMETHOD. METHOD free_selections_dialog. DATA ls_position TYPE zcl_abapgit_popups=>ty_popup_position. ls_position = zcl_abapgit_popups=>center( iv_width = 60 iv_height = lines( ct_fields ) + 15 ). CALL FUNCTION 'FREE_SELECTIONS_DIALOG' EXPORTING selection_id = iv_selection_id title = mv_title frame_text = mv_frame_text status = 1 start_col = ls_position-start_column start_row = ls_position-start_row as_window = abap_true no_intervals = abap_true tree_visible = abap_false IMPORTING field_ranges = et_result_ranges TABLES fields_tab = ct_fields EXCEPTIONS internal_error = 1 no_action = 2 selid_not_found = 3 illegal_status = 4 OTHERS = 5. CASE sy-subrc. WHEN 0 ##NEEDED. WHEN 2. RAISE EXCEPTION TYPE zcx_abapgit_cancel. WHEN OTHERS. zcx_abapgit_exception=>raise( |Error from FREE_SELECTIONS_DIALOG: { sy-subrc }| ). ENDCASE. ENDMETHOD. METHOD free_selections_init. CALL FUNCTION 'FREE_SELECTIONS_INIT' EXPORTING kind = 'F' field_ranges_int = it_default_values restriction = is_restriction IMPORTING selection_id = ev_selection_id TABLES fields_tab = ct_fields field_texts = ct_field_texts EXCEPTIONS fields_incomplete = 1 fields_no_join = 2 field_not_found = 3 no_tables = 4 table_not_found = 5 expression_not_supported = 6 incorrect_expression = 7 illegal_kind = 8 area_not_found = 9 inconsistent_area = 10 kind_f_no_fields_left = 11 kind_f_no_fields = 12 too_many_fields = 13 dup_field = 14 field_no_type = 15 field_ill_type = 16 dup_event_field = 17 node_not_in_ldb = 18 area_no_field = 19 OTHERS = 20. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Error from FREE_SELECTIONS_INIT: { sy-subrc }| ). ENDIF. ENDMETHOD. METHOD set_fields. GET REFERENCE OF ct_fields INTO mr_fields. ENDMETHOD. METHOD show. DATA: lt_default_values TYPE rsds_trange, ls_restriction TYPE sscr_restrict_ds, lt_fields TYPE rsdsfields_t, lt_field_texts TYPE ty_field_text_tab, lv_repeat_dialog TYPE abap_bool VALUE abap_true, lv_selection_id TYPE dynselid, lt_results TYPE rsds_trange, lx_validation_error TYPE REF TO zcx_abapgit_exception. convert_input_fields( IMPORTING et_default_values = lt_default_values es_restriction = ls_restriction et_fields = lt_fields et_field_texts = lt_field_texts ). WHILE lv_repeat_dialog = abap_true. lv_repeat_dialog = abap_false. free_selections_init( EXPORTING it_default_values = lt_default_values is_restriction = ls_restriction IMPORTING ev_selection_id = lv_selection_id CHANGING ct_fields = lt_fields ct_field_texts = lt_field_texts ). free_selections_dialog( EXPORTING iv_selection_id = lv_selection_id IMPORTING et_result_ranges = lt_results CHANGING ct_fields = lt_fields ). TRY. validate_results( lt_results ). CATCH zcx_abapgit_exception INTO lx_validation_error. lv_repeat_dialog = abap_true. lt_default_values = lt_results. MESSAGE lx_validation_error TYPE 'I' DISPLAY LIKE 'E'. CONTINUE. ENDTRY. transfer_results_to_input( lt_results ). ENDWHILE. ENDMETHOD. METHOD transfer_results_to_input. FIELD-SYMBOLS: <ls_input_field> TYPE ty_free_sel_field, <lt_input_fields> TYPE ty_free_sel_field_tab, <ls_result_range_for_tab> TYPE rsds_range, <ls_result_range_line> TYPE rsds_frange, <ls_selopt_line> TYPE rsdsselopt. ASSIGN mr_fields->* TO <lt_input_fields>. ASSERT sy-subrc = 0. LOOP AT <lt_input_fields> ASSIGNING <ls_input_field>. READ TABLE it_result_ranges WITH KEY tablename = <ls_input_field>-ddic_tabname ASSIGNING <ls_result_range_for_tab>. IF sy-subrc = 0. READ TABLE <ls_result_range_for_tab>-frange_t WITH KEY fieldname = <ls_input_field>-ddic_fieldname ASSIGNING <ls_result_range_line>. IF sy-subrc = 0 AND <ls_result_range_line>-selopt_t IS NOT INITIAL. IF <ls_input_field>-only_parameter = abap_true. ASSERT lines( <ls_result_range_line>-selopt_t ) = 1. READ TABLE <ls_result_range_line>-selopt_t INDEX 1 ASSIGNING <ls_selopt_line>. ASSERT sy-subrc = 0. ASSERT <ls_selopt_line>-sign = 'I' AND <ls_selopt_line>-option = 'EQ' AND <ls_selopt_line>-high IS INITIAL. <ls_input_field>-value = <ls_selopt_line>-low. ELSE. <ls_input_field>-value_range = <ls_result_range_line>-selopt_t. ENDIF. ELSE. CLEAR: <ls_input_field>-value, <ls_input_field>-value_range. ENDIF. ELSE. CLEAR: <ls_input_field>-value, <ls_input_field>-value_range. ENDIF. ENDLOOP. ENDMETHOD. METHOD validate_results. DATA: ls_error_msg TYPE symsg, lv_ddut_fieldname TYPE fnam_____4, lv_value TYPE rsdsselop_. FIELD-SYMBOLS: <ls_result_range_for_tab> TYPE rsds_range, <ls_result_range_line> TYPE rsds_frange, <ls_input_field> TYPE ty_free_sel_field, <lt_input_fields> TYPE ty_free_sel_field_tab, <ls_selopt_line> TYPE rsdsselopt. ASSIGN mr_fields->* TO <lt_input_fields>. ASSERT sy-subrc = 0. LOOP AT it_result_ranges ASSIGNING <ls_result_range_for_tab>. LOOP AT <ls_result_range_for_tab>-frange_t ASSIGNING <ls_result_range_line>. READ TABLE <lt_input_fields> WITH KEY ddic_tabname = <ls_result_range_for_tab>-tablename ddic_fieldname = <ls_result_range_line>-fieldname ASSIGNING <ls_input_field>. ASSERT sy-subrc = 0. IF <ls_input_field>-only_parameter = abap_false. CONTINUE. ENDIF. CASE lines( <ls_result_range_line>-selopt_t ). WHEN 0. CLEAR lv_value. WHEN 1. READ TABLE <ls_result_range_line>-selopt_t INDEX 1 ASSIGNING <ls_selopt_line>. ASSERT sy-subrc = 0. lv_value = <ls_selopt_line>-low. WHEN OTHERS. ASSERT 1 = 2. ENDCASE. CLEAR ls_error_msg. lv_ddut_fieldname = <ls_input_field>-ddic_fieldname. CALL FUNCTION 'DDUT_INPUT_CHECK' EXPORTING tabname = <ls_input_field>-ddic_tabname fieldname = lv_ddut_fieldname value = lv_value accept_all_initial = abap_true value_list = 'S' IMPORTING msgid = ls_error_msg-msgid msgty = ls_error_msg-msgty msgno = ls_error_msg-msgno msgv1 = ls_error_msg-msgv1 msgv2 = ls_error_msg-msgv2 msgv3 = ls_error_msg-msgv3 msgv4 = ls_error_msg-msgv4. IF ls_error_msg IS NOT INITIAL. zcx_abapgit_exception=>raise_t100( iv_msgid = ls_error_msg-msgid iv_msgno = ls_error_msg-msgno iv_msgv1 = ls_error_msg-msgv1 iv_msgv2 = ls_error_msg-msgv2 iv_msgv3 = ls_error_msg-msgv3 iv_msgv4 = ls_error_msg-msgv4 ). ELSEIF <ls_input_field>-param_obligatory = abap_true AND lv_value IS INITIAL. zcx_abapgit_exception=>raise( |Field '{ <ls_input_field>-name }' is obligatory| ). ENDIF. ENDLOOP. ENDLOOP. ENDMETHOD. ENDCLASS.
38.566138
106
0.607148
c7240c03ac85116fb03e2d0ad511ee8547dd5c94
3,142
abap
ABAP
src/zmqba_tab.fugr.lzmqba_tabt00.abap
MDJoerg/MQBA
25214fcba497a2a753ca104f1adb41cf9a091222
[ "MIT" ]
10
2018-08-29T07:07:26.000Z
2021-07-09T06:27:04.000Z
src/zmqba_tab.fugr.lzmqba_tabt00.abap
MDJoerg/MQBA
25214fcba497a2a753ca104f1adb41cf9a091222
[ "MIT" ]
6
2018-08-29T11:01:54.000Z
2019-02-16T15:14:11.000Z
src/zmqba_tab.fugr.lzmqba_tabt00.abap
MDJoerg/MQBA
25214fcba497a2a753ca104f1adb41cf9a091222
[ "MIT" ]
7
2018-08-29T11:34:34.000Z
2020-06-22T04:16:22.000Z
*---------------------------------------------------------------------* * view related data declarations * generation date: 06.11.2018 at 23:24:28 * view maintenance generator version: #001407# *---------------------------------------------------------------------* *...processing: ZTC_MQBABRK.....................................* DATA: BEGIN OF STATUS_ZTC_MQBABRK . "state vector INCLUDE STRUCTURE VIMSTATUS. DATA: END OF STATUS_ZTC_MQBABRK . CONTROLS: TCTRL_ZTC_MQBABRK TYPE TABLEVIEW USING SCREEN '2060'. *...processing: ZTC_MQBACMP.....................................* DATA: BEGIN OF STATUS_ZTC_MQBACMP . "state vector INCLUDE STRUCTURE VIMSTATUS. DATA: END OF STATUS_ZTC_MQBACMP . CONTROLS: TCTRL_ZTC_MQBACMP TYPE TABLEVIEW USING SCREEN '2030'. *...processing: ZTC_MQBACPD.....................................* DATA: BEGIN OF STATUS_ZTC_MQBACPD . "state vector INCLUDE STRUCTURE VIMSTATUS. DATA: END OF STATUS_ZTC_MQBACPD . CONTROLS: TCTRL_ZTC_MQBACPD TYPE TABLEVIEW USING SCREEN '2001'. *...processing: ZTC_MQBACSA.....................................* DATA: BEGIN OF STATUS_ZTC_MQBACSA . "state vector INCLUDE STRUCTURE VIMSTATUS. DATA: END OF STATUS_ZTC_MQBACSA . CONTROLS: TCTRL_ZTC_MQBACSA TYPE TABLEVIEW USING SCREEN '2040'. *...processing: ZTC_MQBACSM.....................................* DATA: BEGIN OF STATUS_ZTC_MQBACSM . "state vector INCLUDE STRUCTURE VIMSTATUS. DATA: END OF STATUS_ZTC_MQBACSM . CONTROLS: TCTRL_ZTC_MQBACSM TYPE TABLEVIEW USING SCREEN '2050'. *...processing: ZTC_MQBAGIBL....................................* DATA: BEGIN OF STATUS_ZTC_MQBAGIBL . "state vector INCLUDE STRUCTURE VIMSTATUS. DATA: END OF STATUS_ZTC_MQBAGIBL . CONTROLS: TCTRL_ZTC_MQBAGIBL TYPE TABLEVIEW USING SCREEN '2010'. *...processing: ZTC_MQBAGIWL....................................* DATA: BEGIN OF STATUS_ZTC_MQBAGIWL . "state vector INCLUDE STRUCTURE VIMSTATUS. DATA: END OF STATUS_ZTC_MQBAGIWL . CONTROLS: TCTRL_ZTC_MQBAGIWL TYPE TABLEVIEW USING SCREEN '2020'. *.........table declarations:.................................* TABLES: *ZTC_MQBABRK . TABLES: *ZTC_MQBACMP . TABLES: *ZTC_MQBACPD . TABLES: *ZTC_MQBACSA . TABLES: *ZTC_MQBACSM . TABLES: *ZTC_MQBAGIBL . TABLES: *ZTC_MQBAGIWL . TABLES: ZTC_MQBABRK . TABLES: ZTC_MQBACMP . TABLES: ZTC_MQBACPD . TABLES: ZTC_MQBACSA . TABLES: ZTC_MQBACSM . TABLES: ZTC_MQBAGIBL . TABLES: ZTC_MQBAGIWL . * general table data declarations.............. INCLUDE LSVIMTDT .
47.606061
71
0.498409
c727b0cc05c6ea8068ff76fd0ae7daceb9b6e4ed
2,926
abap
ABAP
src/database/zcl_ags_db_branches.clas.abap
mbtools/abapGitServer
cab6405fcee5769c6d828e7dd3a8ca24856a4c49
[ "MIT" ]
null
null
null
src/database/zcl_ags_db_branches.clas.abap
mbtools/abapGitServer
cab6405fcee5769c6d828e7dd3a8ca24856a4c49
[ "MIT" ]
null
null
null
src/database/zcl_ags_db_branches.clas.abap
mbtools/abapGitServer
cab6405fcee5769c6d828e7dd3a8ca24856a4c49
[ "MIT" ]
null
null
null
CLASS zcl_ags_db_branches DEFINITION PUBLIC CREATE PRIVATE GLOBAL FRIENDS zcl_ags_db . PUBLIC SECTION. METHODS update_sha1 IMPORTING !iv_repo TYPE zags_branches-repo !iv_branch TYPE zags_branches-branch !iv_sha1 TYPE zags_branches-sha1 . METHODS single IMPORTING !iv_repo TYPE zags_branches-repo !iv_name TYPE zags_branches-name RETURNING VALUE(rs_data) TYPE zags_branches RAISING zcx_ags_error . METHODS list IMPORTING !iv_repo TYPE zags_branches-repo RETURNING VALUE(rt_list) TYPE zags_branches_tt . METHODS delete IMPORTING !iv_repo TYPE zags_branches-repo !iv_name TYPE zags_branches-name . METHODS insert IMPORTING !is_branch TYPE zags_branches . PROTECTED SECTION. PRIVATE SECTION. DATA mt_branches TYPE zags_branches_tt . DATA mv_fake TYPE abap_bool . METHODS set_fake ##RELAX. ENDCLASS. CLASS ZCL_AGS_DB_BRANCHES IMPLEMENTATION. METHOD delete. IF mv_fake = abap_true. DELETE mt_branches WHERE repo = iv_repo AND name = iv_name. ELSE. DELETE FROM zags_branches WHERE repo = iv_repo AND name = iv_name. "#EC CI_SUBRC ENDIF. ASSERT sy-subrc = 0. ENDMETHOD. METHOD insert. IF mv_fake = abap_true. INSERT is_branch INTO TABLE mt_branches. ELSE. INSERT zags_branches FROM is_branch. "#EC CI_SUBRC ENDIF. ASSERT sy-subrc = 0. ENDMETHOD. METHOD list. IF mv_fake = abap_true. rt_list = mt_branches. DELETE rt_list WHERE repo <> iv_repo. "#EC CI_SORTSEQ ELSE. SELECT * FROM zags_branches INTO TABLE rt_list WHERE repo = iv_repo ORDER BY name ASCENDING. "#EC CI_NOWHERE "#EC CI_SUBRC ENDIF. ENDMETHOD. METHOD set_fake. mv_fake = abap_true. ENDMETHOD. METHOD single. IF mv_fake = abap_true. READ TABLE mt_branches INTO rs_data WITH KEY name = iv_name repo = iv_repo. "#EC CI_SUBRC ELSE. SELECT SINGLE * FROM zags_branches INTO rs_data WHERE name = iv_name AND repo = iv_repo ##WARN_OK. ENDIF. IF sy-subrc <> 0. RAISE EXCEPTION TYPE zcx_ags_error EXPORTING textid = zcx_ags_error=>m002. ENDIF. ENDMETHOD. METHOD update_sha1. FIELD-SYMBOLS: <ls_branch> LIKE LINE OF mt_branches. IF mv_fake = abap_true. READ TABLE mt_branches ASSIGNING <ls_branch> WITH KEY repo = iv_repo branch = iv_branch. ASSERT sy-subrc = 0. <ls_branch>-sha1 = iv_sha1. ELSE. UPDATE zags_branches SET sha1 = iv_sha1 WHERE repo = iv_repo AND branch = iv_branch. "#EC CI_SUBRC ASSERT sy-subrc = 0. ENDIF. ENDMETHOD. ENDCLASS.
21.835821
71
0.626794
c72846e75a61a7e354551aab0267f6e954b6da5c
5,979
abap
ABAP
src/zdemo_teched6.prog.abap
rotda/abap2xlsx
45e11a380943c425a5c8b350e2e506ec3fd46d9c
[ "Apache-2.0" ]
null
null
null
src/zdemo_teched6.prog.abap
rotda/abap2xlsx
45e11a380943c425a5c8b350e2e506ec3fd46d9c
[ "Apache-2.0" ]
null
null
null
src/zdemo_teched6.prog.abap
rotda/abap2xlsx
45e11a380943c425a5c8b350e2e506ec3fd46d9c
[ "Apache-2.0" ]
null
null
null
*&---------------------------------------------------------------------* *& Report ZDEMO_TECHED3 *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT zdemo_teched3. ******************************* * 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.841772
111
0.593076
c72ca6675f0d08cd610a101aedcc913e7845e68d
67,338
abap
ABAP
src/zcl_ibmc_nat_lang_undrstnd_v1.clas.abap
watson-developer-cloud/abap-sdk-nwas
cdf28b2ab4ae6ff326a8caa051323595aa44b05c
[ "Apache-2.0" ]
18
2019-10-09T03:11:14.000Z
2022-02-11T18:03:20.000Z
src/zcl_ibmc_nat_lang_undrstnd_v1.clas.abap
watson-developer-cloud/abap-sdk-nwas
cdf28b2ab4ae6ff326a8caa051323595aa44b05c
[ "Apache-2.0" ]
6
2019-10-07T23:41:22.000Z
2020-09-17T07:39:37.000Z
src/zcl_ibmc_nat_lang_undrstnd_v1.clas.abap
watson-developer-cloud/abap-sdk-nwas
cdf28b2ab4ae6ff326a8caa051323595aa44b05c
[ "Apache-2.0" ]
11
2019-10-07T17:21:15.000Z
2021-12-14T10:09:26.000Z
* Copyright 2019, 2020 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. "! <p class="shorttext synchronized" lang="en">Natural Language Understanding</p> "! 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.<br/> "! <br/> "! You can create [custom "! models](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural "! -language-understanding-customizing) with Watson Knowledge Studio to detect "! custom entities and relations 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: "! No documentation available. begin of T_SEMANTIC_ROLES_ENTITY, "! Entity type. TYPE type STRING, "! The entity text. TEXT type STRING, end of T_SEMANTIC_ROLES_ENTITY. types: "! No documentation available. begin of T_SEMANTIC_ROLES_KEYWORD, "! The keyword text. TEXT type STRING, end of T_SEMANTIC_ROLES_KEYWORD. types: "! <p class="shorttext synchronized" lang="en"> "! The extracted subject from the sentence.</p> begin of T_SMNTC_ROLES_RESULT_SUBJECT, "! Text that corresponds to the subject role. TEXT type STRING, "! An array of extracted entities. ENTITIES type STANDARD TABLE OF T_SEMANTIC_ROLES_ENTITY WITH NON-UNIQUE DEFAULT KEY, "! An array of extracted keywords. KEYWORDS type STANDARD TABLE OF T_SEMANTIC_ROLES_KEYWORD WITH NON-UNIQUE DEFAULT KEY, end of T_SMNTC_ROLES_RESULT_SUBJECT. types: "! <p class="shorttext synchronized" lang="en"> "! The extracted object from the sentence.</p> begin of T_SEMANTIC_ROLES_RESULT_OBJECT, "! Object text. TEXT type STRING, "! An array of extracted keywords. KEYWORDS type STANDARD TABLE OF T_SEMANTIC_ROLES_KEYWORD WITH NON-UNIQUE DEFAULT KEY, end of T_SEMANTIC_ROLES_RESULT_OBJECT. types: "! No documentation available. begin of T_SEMANTIC_ROLES_VERB, "! The keyword text. TEXT type STRING, "! Verb tense. TENSE type STRING, end of T_SEMANTIC_ROLES_VERB. types: "! <p class="shorttext synchronized" lang="en"> "! The extracted action from the sentence.</p> begin of T_SEMANTIC_ROLES_RESULT_ACTION, "! Analyzed text that corresponds to the action. TEXT type STRING, "! normalized version of the action. NORMALIZED type STRING, "! No documentation available. VERB type T_SEMANTIC_ROLES_VERB, end of T_SEMANTIC_ROLES_RESULT_ACTION. types: "! <p class="shorttext synchronized" lang="en"> "! The object containing the actions and the objects the</p> "! actions act upon. begin of T_SEMANTIC_ROLES_RESULT, "! Sentence from the source that contains the subject, action, and object. SENTENCE type STRING, "! The extracted subject from the sentence. SUBJECT type T_SMNTC_ROLES_RESULT_SUBJECT, "! The extracted action from the sentence. ACTION type T_SEMANTIC_ROLES_RESULT_ACTION, "! The extracted object from the sentence. OBJECT type T_SEMANTIC_ROLES_RESULT_OBJECT, end of T_SEMANTIC_ROLES_RESULT. types: "! <p class="shorttext synchronized" lang="en"> "! Parses sentences into subject, action, and object form.</p><br/> "! <br/> "! Supported languages: English, German, Japanese, Korean, Spanish. begin of T_SEMANTIC_ROLES_OPTIONS, "! Maximum number of semantic_roles results to return. LIMIT type INTEGER, "! Set this to `true` to return keyword information for subjects and objects. KEYWORDS type BOOLEAN, "! Set this to `true` to return entity information for subjects and objects. ENTITIES type BOOLEAN, end of T_SEMANTIC_ROLES_OPTIONS. types: "! <p class="shorttext synchronized" lang="en"> "! Metadata associated with this custom model.</p> begin of T_MODEL_METADATA, "! An optional name for the model. NAME type STRING, "! An optional map of metadata key-value pairs to store with this model. USER_METADATA type MAP, "! The 2-letter language code of this model. LANGUAGE type STRING, "! An optional description of the model. DESCRIPTION type STRING, "! An optional version string. MODEL_VERSION type STRING, "! Deprecated — use `model_version`. VERSION type STRING, "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural "! Language Understanding. WORKSPACE_ID type STRING, "! The description of the version. VERSION_DESCRIPTION type STRING, end of T_MODEL_METADATA. types: "! <p class="shorttext synchronized" lang="en"> "! An entity that corresponds with an argument in a relation.</p> begin of T_RELATION_ENTITY, "! Text that corresponds to the entity. TEXT type STRING, "! Entity type. TYPE type STRING, end of T_RELATION_ENTITY. types: "! No documentation available. begin of T_RELATION_ARGUMENT, "! An array of extracted entities. ENTITIES type STANDARD TABLE OF T_RELATION_ENTITY WITH NON-UNIQUE DEFAULT KEY, "! Character offsets indicating the beginning and end of the mention in the "! analyzed text. LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY, "! Text that corresponds to the argument. TEXT type STRING, end of T_RELATION_ARGUMENT. types: "! <p class="shorttext synchronized" lang="en"> "! The relations between entities found in the content.</p> begin of T_RELATIONS_RESULT, "! Confidence score for the relation. Higher values indicate greater confidence. SCORE type DOUBLE, "! The sentence that contains the relation. SENTENCE type STRING, "! The type of the relation. TYPE type STRING, "! Entity mentions that are involved in the relation. ARGUMENTS type STANDARD TABLE OF T_RELATION_ARGUMENT WITH NON-UNIQUE DEFAULT KEY, end of T_RELATIONS_RESULT. types: "! No documentation available. begin of T_MODEL, "! When the status is `available`, the model is ready to use. STATUS type STRING, "! Unique model ID. MODEL_ID type STRING, "! ISO 639-1 code that indicates the language of the model. LANGUAGE type STRING, "! Model description. DESCRIPTION type STRING, "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural "! Language Understanding. WORKSPACE_ID type STRING, "! The model version, if it was manually provided in Watson Knowledge Studio. MODEL_VERSION type STRING, "! Deprecated — use `model_version`. VERSION type STRING, "! The description of the version, if it was manually provided in Watson Knowledge "! Studio. VERSION_DESCRIPTION type STRING, "! A dateTime indicating when the model was created. CREATED type DATETIME, end of T_MODEL. types: "! No documentation available. begin of T_FEATURE_SENTIMENT_RESULTS, "! Sentiment score from -1 (negative) to 1 (positive). SCORE type DOUBLE, end of T_FEATURE_SENTIMENT_RESULTS. types: "! No documentation available. begin of T_EMOTION_SCORES, "! Anger score from 0 to 1. A higher score means that the text is more likely to "! convey anger. ANGER type DOUBLE, "! Disgust score from 0 to 1. A higher score means that the text is more likely to "! convey disgust. DISGUST type DOUBLE, "! Fear score from 0 to 1. A higher score means that the text is more likely to "! convey fear. FEAR type DOUBLE, "! Joy score from 0 to 1. A higher score means that the text is more likely to "! convey joy. JOY type DOUBLE, "! Sadness score from 0 to 1. A higher score means that the text is more likely to "! convey sadness. SADNESS type DOUBLE, end of T_EMOTION_SCORES. types: "! <p class="shorttext synchronized" lang="en"> "! The author of the analyzed content.</p> begin of T_AUTHOR, "! Name of the author. NAME type STRING, end of T_AUTHOR. types: "! <p class="shorttext synchronized" lang="en"> "! RSS or ATOM feed found on the webpage.</p> begin of T_FEED, "! URL of the RSS or ATOM feed. LINK type STRING, end of T_FEED. types: "! <p class="shorttext synchronized" lang="en"> "! Webpage metadata, such as the author and the title of the</p> "! page. begin of T_FEATURES_RESULTS_METADATA, "! The authors of the document. AUTHORS type STANDARD TABLE OF T_AUTHOR WITH NON-UNIQUE DEFAULT KEY, "! The publication date in the format ISO 8601. PUBLICATION_DATE type STRING, "! The title of the document. TITLE type STRING, "! URL of a prominent image on the webpage. IMAGE type STRING, "! RSS/ATOM feeds found on the webpage. FEEDS type STANDARD TABLE OF T_FEED WITH NON-UNIQUE DEFAULT KEY, end of T_FEATURES_RESULTS_METADATA. types: "! No documentation available. begin of T_ENTITY_MENTION, "! Entity mention text. TEXT type STRING, "! Character offsets indicating the beginning and end of the mention in the "! analyzed text. LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY, "! Confidence in the entity identification from 0 to 1. Higher values indicate "! higher confidence. In standard entities requests, confidence is returned only "! for English text. All entities requests that use custom models return the "! confidence score. CONFIDENCE type DOUBLE, end of T_ENTITY_MENTION. types: "! <p class="shorttext synchronized" lang="en"> "! Disambiguation information for the entity.</p> begin of T_DISAMBIGUATION_RESULT, "! Common entity name. NAME type STRING, "! Link to the corresponding DBpedia resource. DBPEDIA_RESOURCE type STRING, "! Entity subtype information. SUBTYPE type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, end of T_DISAMBIGUATION_RESULT. types: "! <p class="shorttext synchronized" lang="en"> "! The important people, places, geopolitical entities and</p> "! other types of entities in your content. begin of T_ENTITIES_RESULT, "! Entity type. TYPE type STRING, "! The name of the entity. TEXT type STRING, "! Relevance score from 0 to 1. Higher values indicate greater relevance. RELEVANCE type DOUBLE, "! Confidence in the entity identification from 0 to 1. Higher values indicate "! higher confidence. In standard entities requests, confidence is returned only "! for English text. All entities requests that use custom models return the "! confidence score. CONFIDENCE type DOUBLE, "! Entity mentions and locations. MENTIONS type STANDARD TABLE OF T_ENTITY_MENTION WITH NON-UNIQUE DEFAULT KEY, "! How many times the entity was mentioned in the text. COUNT type INTEGER, "! Emotion analysis results for the entity, enabled with the `emotion` option. EMOTION type T_EMOTION_SCORES, "! Sentiment analysis results for the entity, enabled with the `sentiment` option. SENTIMENT type T_FEATURE_SENTIMENT_RESULTS, "! Disambiguation information for the entity. DISAMBIGUATION type T_DISAMBIGUATION_RESULT, end of T_ENTITIES_RESULT. types: "! <p class="shorttext synchronized" lang="en"> "! Emotion results for a specified target.</p> begin of T_TARGETED_EMOTION_RESULTS, "! Targeted text. TEXT type STRING, "! The emotion results for the target. EMOTION type T_EMOTION_SCORES, end of T_TARGETED_EMOTION_RESULTS. types: "! <p class="shorttext synchronized" lang="en"> "! The important keywords in the content, organized by</p> "! relevance. begin of T_KEYWORDS_RESULT, "! Number of times the keyword appears in the analyzed text. COUNT type INTEGER, "! Relevance score from 0 to 1. Higher values indicate greater relevance. RELEVANCE type DOUBLE, "! The keyword text. TEXT type STRING, "! Emotion analysis results for the keyword, enabled with the `emotion` option. EMOTION type T_EMOTION_SCORES, "! Sentiment analysis results for the keyword, enabled with the `sentiment` option. "! SENTIMENT type T_FEATURE_SENTIMENT_RESULTS, end of T_KEYWORDS_RESULT. types: "! No documentation available. begin of T_TARGETED_SENTIMENT_RESULTS, "! Targeted text. TEXT type STRING, "! Sentiment score from -1 (negative) to 1 (positive). SCORE type DOUBLE, end of T_TARGETED_SENTIMENT_RESULTS. types: "! <p class="shorttext synchronized" lang="en"> "! Relevant text that contributed to the categorization.</p> begin of T_CATEGORIES_RELEVANT_TEXT, "! Text from the analyzed source that supports the categorization. TEXT type STRING, end of T_CATEGORIES_RELEVANT_TEXT. types: "! <p class="shorttext synchronized" lang="en"> "! Emotion results for the document as a whole.</p> begin of T_DOCUMENT_EMOTION_RESULTS, "! Emotion results for the document as a whole. EMOTION type T_EMOTION_SCORES, end of T_DOCUMENT_EMOTION_RESULTS. types: "! No documentation available. begin of T_DOCUMENT_SENTIMENT_RESULTS, "! Indicates whether the sentiment is positive, neutral, or negative. LABEL type STRING, "! Sentiment score from -1 (negative) to 1 (positive). SCORE type DOUBLE, end of T_DOCUMENT_SENTIMENT_RESULTS. types: "! <p class="shorttext synchronized" lang="en"> "! The sentiment of the content.</p> begin of T_SENTIMENT_RESULT, "! The document level sentiment. DOCUMENT type T_DOCUMENT_SENTIMENT_RESULTS, "! The targeted sentiment to analyze. TARGETS type STANDARD TABLE OF T_TARGETED_SENTIMENT_RESULTS WITH NON-UNIQUE DEFAULT KEY, end of T_SENTIMENT_RESULT. types: "! No documentation available. begin of T_TOKEN_RESULT, "! The token as it appears in the analyzed text. TEXT type STRING, "! The part of speech of the token. For more information about the values, see "! [Universal Dependencies POS tags](https://universaldependencies.org/u/pos/). PART_OF_SPEECH type STRING, "! Character offsets indicating the beginning and end of the token in the analyzed "! text. LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY, "! The [lemma](https://wikipedia.org/wiki/Lemma_%28morphology%29) of the token. LEMMA type STRING, end of T_TOKEN_RESULT. types: "! No documentation available. begin of T_SENTENCE_RESULT, "! The sentence. TEXT type STRING, "! Character offsets indicating the beginning and end of the sentence in the "! analyzed text. LOCATION type STANDARD TABLE OF INTEGER WITH NON-UNIQUE DEFAULT KEY, end of T_SENTENCE_RESULT. types: "! <p class="shorttext synchronized" lang="en"> "! Tokens and sentences returned from syntax analysis.</p> begin of T_SYNTAX_RESULT, "! No documentation available. TOKENS type STANDARD TABLE OF T_TOKEN_RESULT WITH NON-UNIQUE DEFAULT KEY, "! No documentation available. SENTENCES type STANDARD TABLE OF T_SENTENCE_RESULT WITH NON-UNIQUE DEFAULT KEY, end of T_SYNTAX_RESULT. types: "! <p class="shorttext synchronized" lang="en"> "! The general concepts referenced or alluded to in the</p> "! analyzed text. begin of T_CONCEPTS_RESULT, "! Name of the concept. TEXT type STRING, "! Relevance score between 0 and 1. Higher scores indicate greater relevance. RELEVANCE type DOUBLE, "! Link to the corresponding DBpedia resource. DBPEDIA_RESOURCE type STRING, end of T_CONCEPTS_RESULT. types: "! <p class="shorttext synchronized" lang="en"> "! Information that helps to explain what contributed to the</p> "! categories result. begin of T_CTGRS_RESULT_EXPLANATION, "! An array of relevant text from the source that contributed to the "! categorization. The sorted array begins with the phrase that contributed most "! significantly to the result, followed by phrases that were less and less "! impactful. RELEVANT_TEXT type STANDARD TABLE OF T_CATEGORIES_RELEVANT_TEXT WITH NON-UNIQUE DEFAULT KEY, end of T_CTGRS_RESULT_EXPLANATION. types: "! <p class="shorttext synchronized" lang="en"> "! A categorization of the analyzed text.</p> begin of T_CATEGORIES_RESULT, "! The path to the category through the 5-level taxonomy hierarchy. For more "! information about the categories, see [Categories "! hierarchy](https://cloud.ibm.com/docs/natural-language-understanding?topic=natu "! ral-language-understanding-categories#categories-hierarchy). LABEL type STRING, "! Confidence score for the category classification. Higher values indicate greater "! confidence. SCORE type DOUBLE, "! Information that helps to explain what contributed to the categories result. EXPLANATION type T_CTGRS_RESULT_EXPLANATION, end of T_CATEGORIES_RESULT. types: "! <p class="shorttext synchronized" lang="en"> "! The detected anger, disgust, fear, joy, or sadness that is</p> "! 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, "! Emotion results for the document as a whole. DOCUMENT type T_DOCUMENT_EMOTION_RESULTS, "! Emotion results for specified targets. TARGETS type STANDARD TABLE OF T_TARGETED_EMOTION_RESULTS WITH NON-UNIQUE DEFAULT KEY, end of T_EMOTION_RESULT. types: "! <p class="shorttext synchronized" lang="en"> "! Analysis results for each requested feature.</p> begin of T_FEATURES_RESULTS, "! The general concepts referenced or alluded to in the analyzed text. CONCEPTS type STANDARD TABLE OF T_CONCEPTS_RESULT WITH NON-UNIQUE DEFAULT KEY, "! The entities detected in the analyzed text. ENTITIES type STANDARD TABLE OF T_ENTITIES_RESULT WITH NON-UNIQUE DEFAULT KEY, "! The keywords from the analyzed text. KEYWORDS type STANDARD TABLE OF T_KEYWORDS_RESULT WITH NON-UNIQUE DEFAULT KEY, "! The categories that the service assigned to the analyzed text. CATEGORIES type STANDARD TABLE OF T_CATEGORIES_RESULT WITH NON-UNIQUE DEFAULT KEY, "! The anger, disgust, fear, joy, or sadness conveyed by the content. EMOTION type T_EMOTION_RESULT, "! Webpage metadata, such as the author and the title of the page. METADATA type T_FEATURES_RESULTS_METADATA, "! The relationships between entities in the content. RELATIONS type STANDARD TABLE OF T_RELATIONS_RESULT WITH NON-UNIQUE DEFAULT KEY, "! Sentences parsed into `subject`, `action`, and `object` form. SEMANTIC_ROLES type STANDARD TABLE OF T_SEMANTIC_ROLES_RESULT WITH NON-UNIQUE DEFAULT KEY, "! The sentiment of the content. SENTIMENT type T_SENTIMENT_RESULT, "! Tokens and sentences returned from syntax analysis. SYNTAX type T_SYNTAX_RESULT, end of T_FEATURES_RESULTS. types: "! <p class="shorttext synchronized" lang="en"> "! The authors, publication date, title, prominent page image,</p> "! and RSS/ATOM feeds of the webpage. Supports URL and HTML input types. begin of T_METADATA_RESULT, "! The authors of the document. AUTHORS type STANDARD TABLE OF T_AUTHOR WITH NON-UNIQUE DEFAULT KEY, "! The publication date in the format ISO 8601. PUBLICATION_DATE type STRING, "! The title of the document. TITLE type STRING, "! URL of a prominent image on the webpage. IMAGE type STRING, "! RSS/ATOM feeds found on the webpage. FEEDS type STANDARD TABLE OF T_FEED WITH NON-UNIQUE DEFAULT KEY, end of T_METADATA_RESULT. types: "! No documentation available. begin of T_ERROR_RESPONSE, "! The HTTP error status code. CODE type INTEGER, "! A message describing the error. ERROR type STRING, end of T_ERROR_RESPONSE. types: "! <p class="shorttext synchronized" lang="en"> "! Detects anger, disgust, fear, joy, or sadness that is</p> "! 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`.<br/> "! <br/> "! Supported languages: English. begin of T_EMOTION_OPTIONS, "! Set this to `false` to hide document-level emotion results. DOCUMENT type BOOLEAN, "! Emotion results will be returned for each target string that is found in the "! document. TARGETS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, end of T_EMOTION_OPTIONS. types: "! <p class="shorttext synchronized" lang="en"> "! Usage information.</p> begin of T_USAGE, "! Number of features used in the API call. FEATURES type INTEGER, "! Number of text characters processed. TEXT_CHARACTERS type INTEGER, "! Number of 10,000-character units processed. TEXT_UNITS type INTEGER, end of T_USAGE. types: "! <p class="shorttext synchronized" lang="en"> "! Analyzes the general sentiment of your content or the</p> "! sentiment toward specific target phrases. You can analyze sentiment for "! detected entities with `entities.sentiment` and for keywords with "! `keywords.sentiment`.<br/> "! <br/> "! Supported languages: Arabic, English, French, German, Italian, Japanese, "! Korean, Portuguese, Russian, Spanish. begin of T_SENTIMENT_OPTIONS, "! Set this to `false` to hide document-level sentiment results. DOCUMENT type BOOLEAN, "! Sentiment results will be returned for each target string that is found in the "! document. TARGETS type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, end of T_SENTIMENT_OPTIONS. types: "! No documentation available. begin of T_SEMANTIC_ROLES_ACTION, "! Analyzed text that corresponds to the action. TEXT type STRING, "! normalized version of the action. NORMALIZED type STRING, "! No documentation available. VERB type T_SEMANTIC_ROLES_VERB, end of T_SEMANTIC_ROLES_ACTION. types: "! <p class="shorttext synchronized" lang="en"> "! Tokenization options.</p> begin of T_SYNTAX_OPTIONS_TOKENS, "! Set this to `true` to return the lemma for each token. LEMMA type BOOLEAN, "! Set this to `true` to return the part of speech for each token. PART_OF_SPEECH type BOOLEAN, end of T_SYNTAX_OPTIONS_TOKENS. types: "! <p class="shorttext synchronized" lang="en"> "! Metadata associated with this custom model.</p> begin of T_FILE_AND_METADATA, "! An optional name for the model. NAME type STRING, "! An optional map of metadata key-value pairs to store with this model. USER_METADATA type MAP, "! The 2-letter language code of this model. LANGUAGE type STRING, "! An optional description of the model. DESCRIPTION type STRING, "! An optional version string. MODEL_VERSION type STRING, "! Deprecated — use `model_version`. VERSION type STRING, "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural "! Language Understanding. WORKSPACE_ID type STRING, "! The description of the version. VERSION_DESCRIPTION type STRING, "! Model file exported from the advanced rules editor in Watson Knowledge Studio. "! For more information, see [Creating an advanced rules "! model](https://cloud.ibm.com/docs/watson-knowledge-studio?topic=watson-knowledg "! e-studio-create-advanced-rules-model#create-advanced-rules-model-procedure). MODEL type FILE, end of T_FILE_AND_METADATA. types: "! <p class="shorttext synchronized" lang="en"> "! Returns important keywords in the content.</p><br/> "! <br/> "! Supported languages: English, French, German, Italian, Japanese, Korean, "! Portuguese, Russian, Spanish, Swedish. begin of T_KEYWORDS_OPTIONS, "! Maximum number of keywords to return. LIMIT type INTEGER, "! Set this to `true` to return sentiment information for detected keywords. SENTIMENT type BOOLEAN, "! Set this to `true` to analyze emotion for detected keywords. EMOTION type BOOLEAN, end of T_KEYWORDS_OPTIONS. types: "! <p class="shorttext synchronized" lang="en"> "! Recognizes when two entities are related and identifies the</p> "! type of relation. For example, an `awardedTo` relation might connect the "! entities &quot;Nobel Prize&quot; and &quot;Albert Einstein&quot;. For more "! information, see [Relation "! types](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural- "! language-understanding-relations).<br/> "! <br/> "! Supported languages: Arabic, English, German, Japanese, Korean, Spanish. "! Chinese, Dutch, French, Italian, and Portuguese custom models are also "! supported. begin of T_RELATIONS_OPTIONS, "! Enter a [custom "! model](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural- "! language-understanding-customizing) ID to override the default model. MODEL type STRING, end of T_RELATIONS_OPTIONS. types: "! <p class="shorttext synchronized" lang="en"> "! Identifies people, cities, organizations, and other entities</p> "! in the content. For more information, see [Entity types and "! subtypes](https://cloud.ibm.com/docs/natural-language-understanding?topic=natur "! al-language-understanding-entity-types).<br/> "! <br/> "! 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, "! Maximum number of entities to return. LIMIT type INTEGER, "! Set this to `true` to return locations of entity mentions. MENTIONS type BOOLEAN, "! Enter a [custom "! model](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural- "! language-understanding-customizing) ID to override the standard entity detection "! model. MODEL type STRING, "! Set this to `true` to return sentiment information for detected entities. SENTIMENT type BOOLEAN, "! Set this to `true` to analyze emotion for detected keywords. EMOTION type BOOLEAN, end of T_ENTITIES_OPTIONS. types: "! <p class="shorttext synchronized" lang="en"> "! Returns high-level concepts in the content. For example, a</p> "! research paper about deep learning might return the concept, &quot;Artificial "! Intelligence&quot; although the term is not mentioned.<br/> "! <br/> "! Supported languages: English, French, German, Italian, Japanese, Korean, "! Portuguese, Spanish. begin of T_CONCEPTS_OPTIONS, "! Maximum number of concepts to return. LIMIT type INTEGER, end of T_CONCEPTS_OPTIONS. types: "! <p class="shorttext synchronized" lang="en"> "! Returns tokens and sentences from the input text.</p> begin of T_SYNTAX_OPTIONS, "! Tokenization options. TOKENS type T_SYNTAX_OPTIONS_TOKENS, "! Set this to `true` to return sentence information. SENTENCES type BOOLEAN, end of T_SYNTAX_OPTIONS. types: "! <p class="shorttext synchronized" lang="en"> "! Returns a five-level taxonomy of the content. The top three</p> "! categories are returned. <br/> "! <br/> "! Supported languages: Arabic, English, French, German, Italian, Japanese, Korean, "! Portuguese, Spanish. begin of T_CATEGORIES_OPTIONS, "! Set this to `true` to return explanations for each categorization. **This is "! available only for English categories.**. EXPLANATION type BOOLEAN, "! Maximum number of categories to return. LIMIT type INTEGER, "! Enter a [custom "! model](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural- "! language-understanding-customizing) ID to override the standard categories "! model. <br/> "! <br/> "! The custom categories experimental feature will be retired on 19 December 2019. "! On that date, deployed custom categories models will no longer be accessible in "! Natural Language Understanding. The feature will be removed from Knowledge "! Studio on an earlier date. Custom categories models will no longer be "! accessible in Knowledge Studio on 17 December 2019. MODEL type STRING, end of T_CATEGORIES_OPTIONS. types: "! <p class="shorttext synchronized" lang="en"> "! Analysis features and options.</p> begin of T_FEATURES, "! Returns high-level concepts in the content. For example, a research paper about "! deep learning might return the concept, &quot;Artificial Intelligence&quot; "! although the term is not mentioned.<br/> "! <br/> "! Supported languages: English, French, German, Italian, Japanese, Korean, "! Portuguese, Spanish. CONCEPTS type T_CONCEPTS_OPTIONS, "! 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`.<br/> "! <br/> "! Supported languages: English. EMOTION type T_EMOTION_OPTIONS, "! Identifies people, cities, organizations, and other entities in the content. For "! more information, see [Entity types and "! subtypes](https://cloud.ibm.com/docs/natural-language-understanding?topic=natur "! al-language-understanding-entity-types).<br/> "! <br/> "! Supported languages: English, French, German, Italian, Japanese, Korean, "! Portuguese, Russian, Spanish, Swedish. Arabic, Chinese, and Dutch are supported "! only through custom models. ENTITIES type T_ENTITIES_OPTIONS, "! Returns important keywords in the content.<br/> "! <br/> "! Supported languages: English, French, German, Italian, Japanese, Korean, "! Portuguese, Russian, Spanish, Swedish. KEYWORDS type T_KEYWORDS_OPTIONS, "! 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. METADATA type JSONOBJECT, "! Recognizes when two entities are related and identifies the type of relation. "! For example, an `awardedTo` relation might connect the entities &quot;Nobel "! Prize&quot; and &quot;Albert Einstein&quot;. For more information, see "! [Relation "! types](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural- "! language-understanding-relations).<br/> "! <br/> "! Supported languages: Arabic, English, German, Japanese, Korean, Spanish. "! Chinese, Dutch, French, Italian, and Portuguese custom models are also "! supported. RELATIONS type T_RELATIONS_OPTIONS, "! Parses sentences into subject, action, and object form.<br/> "! <br/> "! Supported languages: English, German, Japanese, Korean, Spanish. SEMANTIC_ROLES type T_SEMANTIC_ROLES_OPTIONS, "! 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`.<br/> "! <br/> "! Supported languages: Arabic, English, French, German, Italian, Japanese, "! Korean, Portuguese, Russian, Spanish. SENTIMENT type T_SENTIMENT_OPTIONS, "! Returns a five-level taxonomy of the content. The top three categories are "! returned. <br/> "! <br/> "! Supported languages: Arabic, English, French, German, Italian, Japanese, Korean, "! Portuguese, Spanish. CATEGORIES type T_CATEGORIES_OPTIONS, "! Returns tokens and sentences from the input text. SYNTAX type T_SYNTAX_OPTIONS, end of T_FEATURES. types: "! <p class="shorttext synchronized" lang="en"> "! Advanced rules model.</p> begin of T_BASE_ADVANCED_RULES_MODEL, "! An optional name for the model. NAME type STRING, "! An optional map of metadata key-value pairs to store with this model. USER_METADATA type MAP, "! The 2-letter language code of this model. LANGUAGE type STRING, "! An optional description of the model. DESCRIPTION type STRING, "! An optional version string. MODEL_VERSION type STRING, "! Deprecated — use `model_version`. VERSION type STRING, "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural "! Language Understanding. WORKSPACE_ID type STRING, "! The description of the version. VERSION_DESCRIPTION type STRING, "! The service features that are supported by the custom model. FEATURES type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, "! When the status is `available`, the model is ready to use. STATUS type STRING, "! Unique model ID. MODEL_ID type STRING, "! dateTime indicating when the model was created. CREATED type DATETIME, "! dateTime of last successful model training. LAST_TRAINED type DATETIME, "! dateTime of last successful model deployment. LAST_DEPLOYED type DATETIME, end of T_BASE_ADVANCED_RULES_MODEL. types: "! <p class="shorttext synchronized" lang="en"> "! API usage information for the request.</p> begin of T_ANALYSIS_RESULTS_USAGE, "! Number of features used in the API call. FEATURES type INTEGER, "! Number of text characters processed. TEXT_CHARACTERS type INTEGER, "! Number of 10,000-character units processed. TEXT_UNITS type INTEGER, end of T_ANALYSIS_RESULTS_USAGE. types: "! <p class="shorttext synchronized" lang="en"> "! Results of the analysis, organized by feature.</p> begin of T_ANALYSIS_RESULTS, "! Language used to analyze the text. LANGUAGE type STRING, "! Text that was used in the analysis. ANALYZED_TEXT type STRING, "! URL of the webpage that was analyzed. RETRIEVED_URL type STRING, "! API usage information for the request. USAGE type T_ANALYSIS_RESULTS_USAGE, "! The general concepts referenced or alluded to in the analyzed text. CONCEPTS type STANDARD TABLE OF T_CONCEPTS_RESULT WITH NON-UNIQUE DEFAULT KEY, "! The entities detected in the analyzed text. ENTITIES type STANDARD TABLE OF T_ENTITIES_RESULT WITH NON-UNIQUE DEFAULT KEY, "! The keywords from the analyzed text. KEYWORDS type STANDARD TABLE OF T_KEYWORDS_RESULT WITH NON-UNIQUE DEFAULT KEY, "! The categories that the service assigned to the analyzed text. CATEGORIES type STANDARD TABLE OF T_CATEGORIES_RESULT WITH NON-UNIQUE DEFAULT KEY, "! The anger, disgust, fear, joy, or sadness conveyed by the content. EMOTION type T_EMOTION_RESULT, "! Webpage metadata, such as the author and the title of the page. METADATA type T_FEATURES_RESULTS_METADATA, "! The relationships between entities in the content. RELATIONS type STANDARD TABLE OF T_RELATIONS_RESULT WITH NON-UNIQUE DEFAULT KEY, "! Sentences parsed into `subject`, `action`, and `object` form. SEMANTIC_ROLES type STANDARD TABLE OF T_SEMANTIC_ROLES_RESULT WITH NON-UNIQUE DEFAULT KEY, "! The sentiment of the content. SENTIMENT type T_SENTIMENT_RESULT, "! Tokens and sentences returned from syntax analysis. SYNTAX type T_SYNTAX_RESULT, end of T_ANALYSIS_RESULTS. types: "! No documentation available. begin of T_SEMANTIC_ROLES_SUBJECT, "! Text that corresponds to the subject role. TEXT type STRING, "! An array of extracted entities. ENTITIES type STANDARD TABLE OF T_SEMANTIC_ROLES_ENTITY WITH NON-UNIQUE DEFAULT KEY, "! An array of extracted keywords. KEYWORDS type STANDARD TABLE OF T_SEMANTIC_ROLES_KEYWORD WITH NON-UNIQUE DEFAULT KEY, end of T_SEMANTIC_ROLES_SUBJECT. types: "! <p class="shorttext synchronized" lang="en"> "! (Experimental) Returns a summary of content.</p><br/> "! <br/> "! Supported languages: English only. begin of T_SUMMARIZATION_OPTIONS, "! Maximum number of summary sentences to return. LIMIT type INTEGER, end of T_SUMMARIZATION_OPTIONS. types: "! <p class="shorttext synchronized" lang="en"> "! (Experimental) Summary of content.</p> begin of T_SUMMARIZATION_RESULT, "! Summary sentences of input source. TEXT type STRING, end of T_SUMMARIZATION_RESULT. types: "! <p class="shorttext synchronized" lang="en"> "! Advanced rules model.</p> begin of T_ADVANCED_RULES_MODEL, "! An optional name for the model. NAME type STRING, "! An optional map of metadata key-value pairs to store with this model. USER_METADATA type MAP, "! The 2-letter language code of this model. LANGUAGE type STRING, "! An optional description of the model. DESCRIPTION type STRING, "! An optional version string. MODEL_VERSION type STRING, "! Deprecated — use `model_version`. VERSION type STRING, "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural "! Language Understanding. WORKSPACE_ID type STRING, "! The description of the version. VERSION_DESCRIPTION type STRING, "! The service features that are supported by the custom model. FEATURES type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, "! When the status is `available`, the model is ready to use. STATUS type STRING, "! Unique model ID. MODEL_ID type STRING, "! dateTime indicating when the model was created. CREATED type DATETIME, "! dateTime of last successful model training. LAST_TRAINED type DATETIME, "! dateTime of last successful model deployment. LAST_DEPLOYED type DATETIME, end of T_ADVANCED_RULES_MODEL. types: "! <p class="shorttext synchronized" lang="en"> "! List of advanced rules models.</p> begin of T_ADVANCED_RULES_MODEL_LIST, "! The advanced rules models. MODELS type STANDARD TABLE OF T_ADVANCED_RULES_MODEL WITH NON-UNIQUE DEFAULT KEY, end of T_ADVANCED_RULES_MODEL_LIST. types: "! <p class="shorttext synchronized" lang="en"> "! Custom models that are available for entities and relations.</p> begin of T_LIST_MODELS_RESULTS, "! An array of available models. MODELS type STANDARD TABLE OF T_MODEL WITH NON-UNIQUE DEFAULT KEY, end of T_LIST_MODELS_RESULTS. types: "! No documentation available. begin of T_SEMANTIC_ROLES_OBJECT, "! Object text. TEXT type STRING, "! An array of extracted keywords. KEYWORDS type STANDARD TABLE OF T_SEMANTIC_ROLES_KEYWORD WITH NON-UNIQUE DEFAULT KEY, end of T_SEMANTIC_ROLES_OBJECT. types: "! <p class="shorttext synchronized" lang="en"> "! Returns information from the document, including author</p> "! name, title, RSS/ATOM feeds, prominent page image, and publication date. "! Supports URL and HTML input types only. T_METADATA_OPTIONS type JSONOBJECT. types: "! <p class="shorttext synchronized" lang="en"> "! An object containing request parameters.</p> begin of T_PARAMETERS, "! The plain text to analyze. One of the `text`, `html`, or `url` parameters is "! required. TEXT type STRING, "! The HTML file to analyze. One of the `text`, `html`, or `url` parameters is "! required. HTML type STRING, "! The webpage to analyze. One of the `text`, `html`, or `url` parameters is "! required. URL type STRING, "! Specific features to analyze the document for. FEATURES type T_FEATURES, "! Set this to `false` to disable webpage cleaning. For more information about "! webpage cleaning, see [Analyzing "! webpages](https://cloud.ibm.com/docs/natural-language-understanding?topic=natur "! al-language-understanding-analyzing-webpages). CLEAN type BOOLEAN, "! An [XPath "! query](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural- "! language-understanding-analyzing-webpages#xpath) to perform on `html` or `url` "! input. Results of the query will be appended to the cleaned webpage text before "! it is analyzed. To analyze only the results of the XPath query, set the `clean` "! parameter to `false`. XPATH type STRING, "! Whether to use raw HTML content if text cleaning fails. FALLBACK_TO_RAW type BOOLEAN, "! Whether or not to return the analyzed text. RETURN_ANALYZED_TEXT type BOOLEAN, "! ISO 639-1 code that specifies the language of your text. This overrides "! automatic language detection. Language support differs depending on the "! features you include in your analysis. For more information, see [Language "! support](https://cloud.ibm.com/docs/natural-language-understanding?topic=natura "! l-language-understanding-language-support). LANGUAGE type STRING, "! Sets the maximum number of characters that are processed by the service. LIMIT_TEXT_CHARACTERS type INTEGER, end of T_PARAMETERS. types: "! No documentation available. begin of T_SENTIMENT_MODEL, "! The service features that are supported by the custom model. FEATURES type STANDARD TABLE OF STRING WITH NON-UNIQUE DEFAULT KEY, "! When the status is `available`, the model is ready to use. STATUS type STRING, "! Unique model ID. MODEL_ID type STRING, "! dateTime indicating when the model was created. CREATED type DATETIME, "! dateTime of last successful model training. LAST_TRAINED type DATETIME, "! dateTime of last successful model deployment. LAST_DEPLOYED type DATETIME, "! A name for the model. NAME type STRING, "! An optional map of metadata key-value pairs to store with this model. USER_METADATA type MAP, "! The 2-letter language code of this model. LANGUAGE type STRING, "! An optional description of the model. DESCRIPTION type STRING, "! An optional version string. MODEL_VERSION type STRING, "! Deprecated — use `model_version`. VERSION type STRING, "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural "! Language Understanding. WORKSPACE_ID type STRING, "! The description of the version. VERSION_DESCRIPTION type STRING, end of T_SENTIMENT_MODEL. types: "! <p class="shorttext synchronized" lang="en"> "! Link to the corresponding DBpedia resource.</p> T_DBPEDIA_RESOURCE type String. types: "! <p class="shorttext synchronized" lang="en"> "! Metadata associated with this custom model.</p> begin of T_SNTMNT_MDL_FILE_AND_METADATA, "! An optional name for the model. NAME type STRING, "! An optional map of metadata key-value pairs to store with this model. USER_METADATA type MAP, "! The 2-letter language code of this model. LANGUAGE type STRING, "! An optional description of the model. DESCRIPTION type STRING, "! An optional version string. MODEL_VERSION type STRING, "! Deprecated — use `model_version`. VERSION type STRING, "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural "! Language Understanding. WORKSPACE_ID type STRING, "! The description of the version. VERSION_DESCRIPTION type STRING, "! Training data in CSV format. For more information, see [Sentiment training data "! requirements](https://cloud.ibm.com/docs/natural-language-understanding?topic=n "! atural-language-understanding-customizing#sentiment-training-data-requirements). "! TRAINING_DATA type FILE, end of T_SNTMNT_MDL_FILE_AND_METADATA. types: "! <p class="shorttext synchronized" lang="en"> "! Metadata associated with this custom model.</p> begin of T_MODEL_FILE_AND_METADATA, "! An optional name for the model. NAME type STRING, "! An optional map of metadata key-value pairs to store with this model. USER_METADATA type MAP, "! The 2-letter language code of this model. LANGUAGE type STRING, "! An optional description of the model. DESCRIPTION type STRING, "! An optional version string. MODEL_VERSION type STRING, "! Deprecated — use `model_version`. VERSION type STRING, "! ID of the Watson Knowledge Studio workspace that deployed this model to Natural "! Language Understanding. WORKSPACE_ID type STRING, "! The description of the version. VERSION_DESCRIPTION type STRING, "! No documentation available. FILE type FILE, end of T_MODEL_FILE_AND_METADATA. types: "! No documentation available. T_ADVNCD_RLS_ANALYSIS_RESULTS type JSONOBJECT. types: "! <p class="shorttext synchronized" lang="en"> "! Delete model results.</p> begin of T_DELETE_MODEL_RESULTS, "! model_id of the deleted model. DELETED type STRING, end of T_DELETE_MODEL_RESULTS. constants: "! <p class="shorttext synchronized" lang="en">List of required fields per type.</p> 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_MODEL_METADATA type string value '|LANGUAGE|', 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_FILE_AND_METADATA type string value '|LANGUAGE|', 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_BASE_ADVANCED_RULES_MODEL type string value '|LANGUAGE|', T_ANALYSIS_RESULTS_USAGE type string value '|', T_ANALYSIS_RESULTS type string value '|', T_SEMANTIC_ROLES_SUBJECT type string value '|', T_SUMMARIZATION_OPTIONS type string value '|', T_SUMMARIZATION_RESULT type string value '|', T_ADVANCED_RULES_MODEL type string value '|LANGUAGE|STATUS|MODEL_ID|CREATED|', T_ADVANCED_RULES_MODEL_LIST type string value '|', T_LIST_MODELS_RESULTS type string value '|', T_SEMANTIC_ROLES_OBJECT type string value '|', T_PARAMETERS type string value '|FEATURES|', T_SENTIMENT_MODEL type string value '|', T_SNTMNT_MDL_FILE_AND_METADATA type string value '|LANGUAGE|TRAINING_DATA|', T_MODEL_FILE_AND_METADATA type string value '|LANGUAGE|FILE|', T_DELETE_MODEL_RESULTS type string value '|', __DUMMY type string value SPACE, end of C_REQUIRED_FIELDS . constants: "! <p class="shorttext synchronized" lang="en">Map ABAP identifiers to service identifiers.</p> begin of C_ABAPNAME_DICTIONARY, NAME type string value 'name', USER_METADATA type string value 'user_metadata', INNER type string value 'inner', LANGUAGE type string value 'language', DESCRIPTION type string value 'description', MODEL_VERSION type string value 'model_version', VERSION type string value 'version', WORKSPACE_ID type string value 'workspace_id', VERSION_DESCRIPTION type string value 'version_description', FEATURES type string value 'features', STATUS type string value 'status', MODEL_ID type string value 'model_id', CREATED type string value 'created', LAST_TRAINED type string value 'last_trained', LAST_DEPLOYED type string value 'last_deployed', MODELS type string value 'models', MODEL type string value 'model', TEXT type string value 'text', HTML type string value 'html', URL type string value 'url', 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', 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', DELETED type string value 'deleted', TRAINING_DATA type string value 'training_data', FILE type string value 'file', ANALYZED_TEXT type string value 'analyzed_text', RETRIEVED_URL type string value 'retrieved_url', USAGE type string value 'usage', 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', 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', CODE type string value 'code', ERROR type string value 'error', RELEVANT_TEXT type string value 'relevant_text', end of C_ABAPNAME_DICTIONARY . methods GET_APPNAME redefinition . methods GET_REQUEST_PROP redefinition . methods GET_SDK_VERSION_DATE redefinition . "! <p class="shorttext synchronized" lang="en">Analyze text</p> "! Analyzes text, HTML, or a public webpage for the following features:<br/> "! - Categories<br/> "! - Concepts<br/> "! - Emotion<br/> "! - Entities<br/> "! - Keywords<br/> "! - Metadata<br/> "! - Relations<br/> "! - Semantic roles<br/> "! - Sentiment<br/> "! - Syntax<br/> "! - Summarization (Experimental)<br/> "! <br/> "! If a language for the input text is not specified with the `language` parameter, "! the service [automatically detects the "! language](https://cloud.ibm.com/docs/natural-language-understanding?topic=natur "! al-language-understanding-detectable-languages). "! "! @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 "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. "! 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 . "! <p class="shorttext synchronized" lang="en">List models</p> "! Lists Watson Knowledge Studio [custom entities and relations "! models](https://cloud.ibm.com/docs/natural-language-understanding?topic=natural "! -language-understanding-customizing) that are deployed to your Natural Language "! Understanding service. "! "! @parameter E_RESPONSE | "! Service return value of type T_LIST_MODELS_RESULTS "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. "! methods LIST_MODELS importing !I_accept type string default 'application/json' exporting !E_RESPONSE type T_LIST_MODELS_RESULTS raising ZCX_IBMC_SERVICE_EXCEPTION . "! <p class="shorttext synchronized" lang="en">Delete model</p> "! Deletes a custom model "! "! @parameter I_MODEL_ID | "! Model ID of the model to delete. "! @parameter E_RESPONSE | "! Service return value of type T_DELETE_MODEL_RESULTS "! @raising ZCX_IBMC_SERVICE_EXCEPTION | Exception being raised in case of an error. "! 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. 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( i_auth_method = i_auth_method ). 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_query = c_boolean_false. e_request_prop-auth_header = c_boolean_true. else. endif. e_request_prop-url-protocol = 'https'. e_request_prop-url-host = 'api.us-south.natural-language-understanding.watson.cloud.ibm.com'. e_request_prop-url-path_base = ''. 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 = '20210312144437'. 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. ENDCLASS.
43.5
137
0.663058
c72d1facbda220e04eb6633c6aaea50378dae0c8
1,481
abap
ABAP
src/parsing/zcl_aoc_parser.clas.locals_def.abap
phaniacumen/SAPPROJ
dc4bf7a03d9ab2f4ac30bb77f6f38e6a55e5fcc4
[ "MIT" ]
1
2018-04-22T04:47:28.000Z
2018-04-22T04:47:28.000Z
src/parsing/zcl_aoc_parser.clas.locals_def.abap
phaniacumen/SAPPROJ
dc4bf7a03d9ab2f4ac30bb77f6f38e6a55e5fcc4
[ "MIT" ]
null
null
null
src/parsing/zcl_aoc_parser.clas.locals_def.abap
phaniacumen/SAPPROJ
dc4bf7a03d9ab2f4ac30bb77f6f38e6a55e5fcc4
[ "MIT" ]
1
2019-08-08T12:13:30.000Z
2019-08-08T12:13:30.000Z
*"* use this source file for any type of declarations (class *"* definitions, interfaces or type declarations) you need for *"* components in the private section TYPES: ty_syntax_tt TYPE STANDARD TABLE OF ssyntaxstructure. TYPES: ty_node_type TYPE c LENGTH 1. CONSTANTS: gc_dummy TYPE ty_node_type VALUE 'D', gc_start TYPE ty_node_type VALUE 'S', gc_end TYPE ty_node_type VALUE 'E', gc_role TYPE ty_node_type VALUE 'R', gc_terminal TYPE ty_node_type VALUE 'T', gc_nonterminal TYPE ty_node_type VALUE 'N'. *----------------------------------------------------------------------* * CLASS lcl_node DEFINITION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* CLASS lcl_node DEFINITION FINAL. PUBLIC SECTION. DATA: mv_type TYPE ty_node_type READ-ONLY, mv_value TYPE string READ-ONLY, mv_key TYPE i READ-ONLY, mv_rulename TYPE string READ-ONLY, mt_edges TYPE TABLE OF REF TO lcl_node READ-ONLY. METHODS: constructor IMPORTING iv_type TYPE ty_node_type iv_value TYPE string iv_rulename TYPE string, edge IMPORTING io_node TYPE REF TO lcl_node. PRIVATE SECTION. CLASS-DATA: gv_key TYPE i VALUE 1. ENDCLASS. "lcl_node DEFINITIONd
37.974359
72
0.544227
c72d45cc81a828f993feaf7c3d797cbb541de417
23,244
abap
ABAP
src/zcl_googlepoc_drive_impl.abap
filak-sap/abap-alv-google-upload-sheet
926e2e85cf001a65cf0f6c2500711c1ee91f1ed1
[ "CC-BY-3.0" ]
2
2018-08-14T12:50:12.000Z
2019-04-17T06:55:20.000Z
src/zcl_googlepoc_drive_impl.abap
filak-sap/abap-alv-google-upload-sheet
926e2e85cf001a65cf0f6c2500711c1ee91f1ed1
[ "CC-BY-3.0" ]
null
null
null
src/zcl_googlepoc_drive_impl.abap
filak-sap/abap-alv-google-upload-sheet
926e2e85cf001a65cf0f6c2500711c1ee91f1ed1
[ "CC-BY-3.0" ]
1
2019-10-02T16:14:57.000Z
2019-10-02T16:14:57.000Z
"! <p> "! Invokes the Google Drive REST API. Authentication is done via ABAP OAuth 2.0 "! Client with Google specific configuration profile. "! </p> "! "! <p> "! Uses the internal <em>WDR JSON Library</em>. "! </p> "! "! <p> "! Version: 0.0.4<br/> "! </p> "! "! See https://developers.google.com/drive/ class zcl_googlepoc_drive_impl definition public create public final. public section. interfaces zif_googlepoc_drive_api. aliases has_valid_token for zif_googlepoc_drive_api~has_valid_token. aliases list_all_files for zif_googlepoc_drive_api~list_all_files. aliases simple_upload for zif_googlepoc_drive_api~simple_upload. aliases multipart_upload for zif_googlepoc_drive_api~multipart_upload. aliases create_file_metadata for zif_googlepoc_drive_api~create_file_metadata. aliases get_files_metadata for zif_googlepoc_drive_api~get_files_metadata. aliases get_log for zif_googlepoc_drive_api~get_log. "! The default OAuth 2.0 profile to use. constants c_default_oauth_20_profile type oa2c_profile value 'Z_GOOGLE_SHEETS'. "#EC NOTEXT "! Constructs a new Google Drive REST API instance. "! "! @parameter iv_oa2c_profile_name | The name of the OAuth 2.0 profile to "! use. "! @parameter io_drive_json_api | The Google Drive JSON API to use for "! creating and parsing JSOn content sent respectively received using "! this Google Drive REST API. "! "! @raising cx_oa2c_config_not_found | In case the OAuth 2.0 client "! configuration was not found. "! @raising cx_oa2c_config_profile_assign | In case the given profile was "! not assigned to an OAuth 2.0 client configuration. "! @raising cx_oa2c_kernel_too_old | In case the system kernel is too old - "! meaning that the OAuth 2.0 backend support does not exist or is not "! sufficient. "! @raising cx_oa2c_missing_authorization | In case the required "! authorization (S_OA2C_USE) for creating and using an OAuth 2.0 client "! were not granted. methods constructor importing iv_oa2c_profile_name type oa2c_profile optional io_drive_json_api type ref to zif_googlepoc_drive_json_api raising cx_oa2c_config_not_found cx_oa2c_config_profile_assign cx_oa2c_kernel_too_old cx_oa2c_missing_authorization. private section. types: "! Describes a HTTP response. begin of ys_response, "! The status code. status_code type i, "! The content type. content_type type string, "! The received data. data type string, "! The header fields in shape of name/value pairs. header_fields type tihttpnvp, end of ys_response. "! The SSL id to use for creating HTTP clients. constants c_ssl_id type ssfapplssl value 'ANONYM'. "#EC NOTEXT "! The UTF-8 encoding representation. constants c_encoding_utf8 type string value `UTF-8`. "#EC NOTEXT "! The HTTP status code SUCCESS_OK. constants c_http_status_success_ok type i value 200 . "#EC NOTEXT constants: "! Enumeration of the used content types. begin of cs_content_type, "! The JSON content type. json type string value `application/json`, "#EC NOTEXT "! The multi part content type. multipart type string value `multipart/related`, "#EC NOTEXT end of cs_content_type. constants: "! Enumeration of the supported available Google Drive query parameters "! of the Files: list REST API. begin of cs_files_query_parameter, "! The name of the Google Drive FIELDS query parameter to request a "! partial "! response. "! "! See https://developers.google.com/drive/v3/web/performance#partial fields type string value `fields`, "#EC NOTEXT "! The name of the parameter to query for filtering the file results. "! See https://developers.google.com/drive/v3/web/search-parameters query type string value `q`, "#EC NOTEXT end of cs_files_query_parameter. constants: "! Enumeration of the supported available Google Drive query parameters "! of the Files: list REST API. begin of cs_files_search_field, "! The name of the file. name type string value `name`, "#EC NOTEXT "! The MIME type of the file. mime_type type string value `mimeType`, "#EC NOTEXT end of cs_files_search_field. constants: "! Enumeration of the supported available Google Drive REST API "! target URIs. begin of cs_google_drive_rest_api_uri, list_files type string value `https://www.googleapis.com/drive/v3/files`, "#EC NOTEXT file_metadata type string value `https://www.googleapis.com/drive/v3/files`, "#EC NOTEXT simple_upload type string value `https://www.googleapis.com/upload/drive/v3/files?uploadType=media`, "#EC NOTEXT multipart_upload type string value `https://www.googleapis.com/upload/drive/v3/files?uploadType=multipart`, "#EC NOTEXT end of cs_google_drive_rest_api_uri. "! The OAuth 2.0 Client used by this Drive API. data mo_oauth_client type ref to if_oauth2_client. "! The HTPP Client used by this Drive API. data mo_http_client type ref to if_http_client. "! The OA2C Profile Name. data mv_oa2c_profile_name type oa2c_profile. "! The used Google Drive JSON API. data mo_json_api type ref to zif_googlepoc_drive_json_api. "! The used logging API. data mo_log_api type ref to zif_googlepoc_drive_log_api. "! Determines if the given HTTP(S) request has succeeded. "! "! @parameter iv_http_status_code | The HTTP status code to verify. "! @parameter rv_has_succeeded | abap_true if the request has succeeded; "! abap_false otherwise. class-methods has_request_succeeded importing iv_http_status_code type i returning value(rv_has_succeeded) type abap_bool. "! Creates the OAuth 2.0 client instance. "! "! @raising cx_oa2c_config_not_found | In case the OAuth 2.0 client "! configuration was not found. "! @raising cx_oa2c_config_profile_assign | In case the given profile was "! not assigned to an OAuth 2.0 client configuration. "! @raising cx_oa2c_kernel_too_old | In case the system kernel is too old - "! meaning that the OAuth 2.0 backend support does not exist or is not "! sufficient. "! @raising cx_oa2c_missing_authorization | In case the required "! authorization (S_OA2C_USE) for creating and using an OAuth 2.0 client "! were not granted. methods create_oauth_client raising cx_oa2c_config_not_found cx_oa2c_config_profile_assign cx_oa2c_kernel_too_old cx_oa2c_missing_authorization. "! Gets the OAuth 2.0 profile to use for creating the OAuth 2.0 client. "! "! @parameter rv_profile | The determined profile. methods get_oauth_profile returning value(rv_profile) type oa2c_profile. "! Sets the OAuth 2.0 token on the previously established HTTP(S) "! connection. "! "! @parameter rv_has_succeeded | abap_true if the token has been "! successfully set; abap_false if the operation failed. methods set_oauth_token returning value(rv_has_succeeded) type abap_bool. "! Opens a HTTP(S) connection to the given URL using the specified method. "! "! @parameter iv_url | The URL to connect to. "! @parameter iv_method | The method (GET, POST, PUT, DELETE, OPTIONS) to "! use. "! @parameter it_header_fields | The header fields to set on the request. "! @parameter it_form_fields | The form fields to set on the request. "! @parameter rv_has_succeeded | abap_true if the connection has been "! successfully established; abap_false if the connection attempt failed. methods open_connection importing iv_url type string iv_method type string it_header_fields type tihttpnvp optional it_form_fields type tihttpnvp optional returning value(rv_has_succeeded) type abap_bool. "! Closes the previously opened HTTP(S) connection. methods close_connection. "! Prepares a request for the previously opened HTTP(S) connection. "! "! @parameter iv_method | The method (GET, POST, PUT, DELETE, OPTIONS) to "! use. "! @parameter it_header_fields | The header fields to set on the request. "! @parameter it_form_fields | The form fields to set on the request. methods prepare_request importing iv_method type string it_header_fields type tihttpnvp optional it_form_fields type tihttpnvp optional. "! Sends the HTTP(S) request and receives the response. "! "! @parameter es_response | The received response. methods send_receive exporting es_response type ys_response. endclass. class zcl_googlepoc_drive_impl implementation. method close_connection. if me->mo_http_client is bound. me->mo_http_client->close( exceptions http_invalid_state = 1 others = 2 ). if sy-subrc <> 0. me->mo_log_api->log( |Error closing HTTP connection: Error Code ({ sy-subrc })| ). "#EC NOTEXT endif. endif. clear: me->mo_http_client. endmethod. method constructor. me->mv_oa2c_profile_name = iv_oa2c_profile_name. me->mo_json_api = io_drive_json_api. me->mo_log_api = new zcl_googlepoc_drive_log_impl( ). me->mo_json_api->set_log_api( me->mo_log_api ). me->create_oauth_client( ). endmethod. method create_oauth_client. data(lv_profile) = me->get_oauth_profile( ). me->mo_oauth_client = cl_oauth2_client=>create( lv_profile ). endmethod. method get_oauth_profile. rv_profile = me->mv_oa2c_profile_name. if rv_profile is initial. rv_profile = c_default_oauth_20_profile. endif. endmethod. method has_request_succeeded. rv_has_succeeded = cond abap_bool( when iv_http_status_code = c_http_status_success_ok then abap_true else abap_false ). endmethod. method open_connection. cl_http_client=>create_by_url( exporting url = iv_url ssl_id = c_ssl_id importing client = me->mo_http_client exceptions argument_not_found = 1 plugin_not_active = 2 internal_error = 3 others = 4 ). if sy-subrc = 0. me->prepare_request( iv_method = iv_method it_header_fields = it_header_fields it_form_fields = it_form_fields ). rv_has_succeeded = me->set_oauth_token( ). else. me->mo_log_api->log( |Error creating HTTP connection: Error Code ({ sy-subrc })| ). "#EC NOTEXT rv_has_succeeded = abap_false. endif. endmethod. method prepare_request. "Turn off logon popup. Detect authentication errors. me->mo_http_client->propertytype_logon_popup = 0. me->mo_http_client->request->set_method( iv_method ). if it_header_fields is supplied and it_header_fields is not initial. me->mo_http_client->request->set_header_fields( it_header_fields ). endif. if it_form_fields is supplied and it_form_fields is not initial. me->mo_http_client->request->set_form_fields( it_form_fields ). endif. endmethod. method send_receive. clear es_response. me->mo_http_client->send( exceptions http_communication_failure = 1 http_invalid_state = 2 http_processing_failed = 3 http_invalid_timeout = 4 others = 5 ). if sy-subrc <> 0. me->mo_log_api->log( |Error sending HTTP request: Error Code ({ sy-subrc })| ). "#EC NOTEXT endif. me->mo_http_client->receive( exceptions http_communication_failure = 1 http_invalid_state = 2 http_processing_failed = 3 others = 4 ). if sy-subrc <> 0. me->mo_log_api->log( |Error receiving HTTP request: Error Code ({ sy-subrc })| ). "#EC NOTEXT endif. "Fill response structure. me->mo_http_client->response->get_status( importing code = es_response-status_code ). es_response-data = me->mo_http_client->response->get_cdata( ). es_response-content_type = me->mo_http_client->response->get_content_type( ). me->mo_http_client->response->get_header_fields( changing fields = es_response-header_fields ). me->mo_log_api->log( |HTTP request sent: Status Code ({ es_response-status_code })| ). "#EC NOTEXT endmethod. method set_oauth_token. try. me->mo_oauth_client->set_token( io_http_client = me->mo_http_client i_param_kind = if_oauth2_client=>c_param_kind_form_field ). catch cx_oa2c into data(lo_oauth_exc). try. me->mo_oauth_client->execute_refresh_flow( ). catch cx_oa2c into lo_oauth_exc. me->mo_log_api->log( `Error executing OAuth 2.0 refresh flow: ` && lo_oauth_exc->get_text( ) ). "#EC NOTEXT rv_has_succeeded = abap_false. return. endtry. try. me->mo_oauth_client->set_token( io_http_client = me->mo_http_client i_param_kind = if_oauth2_client=>c_param_kind_form_field ). catch cx_oa2c into lo_oauth_exc. me->mo_log_api->log( `Error setting OAuth 2.0 token: ` && lo_oauth_exc->get_text( ) ). "#EC NOTEXT rv_has_succeeded = abap_false. return. endtry. endtry. rv_has_succeeded = abap_true. endmethod. method zif_googlepoc_drive_api~create_file_metadata. data(lv_open_connection_succeeded) = me->open_connection( iv_url = cs_google_drive_rest_api_uri-file_metadata && |?{ cs_files_query_parameter-fields }=| && |{ zif_googlepoc_drive_json_api=>file_resource_field-id },| && |{ zif_googlepoc_drive_json_api=>file_resource_field-web_view_link }| "#EC NOTEXT iv_method = if_http_entity=>co_request_method_post ). if lv_open_connection_succeeded = abap_true. me->mo_http_client->request->set_content_type( |{ cs_content_type-json };charset={ c_encoding_utf8 }| "#EC NOTEXT ). data(lv_metadata) = me->mo_json_api->create_file_resource( iv_name = iv_name iv_mime_type = iv_mime_type ). me->mo_http_client->request->set_cdata( lv_metadata ). me->send_receive( importing es_response = data(ls_response) ). me->close_connection( ). if has_request_succeeded( ls_response-status_code ) = abap_true. rs_file_resource = me->mo_json_api->parse_file_resource( ls_response-data ). if rs_file_resource is not initial. rs_file_resource-name = iv_name. rs_file_resource-mime_type = iv_mime_type. endif. endif. endif. endmethod. method zif_googlepoc_drive_api~get_files_metadata. if iv_name is not initial. data(lv_search_parameters) = escape( val = |{ cs_files_search_field-name }='{ iv_name }'| "#EC NOTEXT format = cl_abap_format=>e_url_full ). endif. if iv_mime_type is not initial. if lv_search_parameters is not initial. lv_search_parameters = lv_search_parameters && ` and `. "#EC NOTEXT endif. lv_search_parameters = lv_search_parameters && escape( val = |{ cs_files_search_field-mime_type }='{ iv_mime_type }'| "#EC NOTEXT format = cl_abap_format=>e_url_full ). endif. data(lv_url) = cs_google_drive_rest_api_uri-list_files && |?{ cs_files_query_parameter-fields }=| && |{ zif_googlepoc_drive_json_api=>files_resource_list_field-files }(| && |{ zif_googlepoc_drive_json_api=>file_resource_field-id },| && |{ zif_googlepoc_drive_json_api=>file_resource_field-name },| && |{ zif_googlepoc_drive_json_api=>file_resource_field-mime_type },| && |{ zif_googlepoc_drive_json_api=>file_resource_field-web_view_link },| && |{ zif_googlepoc_drive_json_api=>file_resource_field-parents })|. "#EC NOTEXT if lv_search_parameters is not initial. lv_url = lv_url && |&{ cs_files_query_parameter-query }=| && |{ lv_search_parameters }|. "#EC NOTEXT endif. data(lv_open_connection_succeeded) = me->open_connection( iv_url = lv_url iv_method = if_http_entity=>co_request_method_get ). if lv_open_connection_succeeded = abap_true. me->send_receive( importing es_response = data(ls_response) ). me->close_connection( ). if has_request_succeeded( ls_response-status_code ) = abap_true. me->mo_json_api->parse_file_resource_list( exporting iv_file_resource_list_json = ls_response-data importing et_file_resources = rt_file_resources ). endif. endif. endmethod. method zif_googlepoc_drive_api~get_log. clear et_log. et_log = me->mo_log_api->mt_log. endmethod. method zif_googlepoc_drive_api~has_valid_token. rv_has_valid_token = me->open_connection( iv_url = cs_google_drive_rest_api_uri-list_files && |?{ cs_files_query_parameter-fields }=| && |{ zif_googlepoc_drive_json_api=>files_resource_list_field-files }(| && |{ zif_googlepoc_drive_json_api=>file_resource_field-id },| && |{ zif_googlepoc_drive_json_api=>file_resource_field-name })| "#EC NOTEXT iv_method = if_http_entity=>co_request_method_get ). me->close_connection( ). endmethod. method zif_googlepoc_drive_api~list_all_files. data(lv_open_connection_succeeded) = me->open_connection( iv_url = cs_google_drive_rest_api_uri-list_files && |?{ cs_files_query_parameter-fields }=| && |{ zif_googlepoc_drive_json_api=>files_resource_list_field-files }(| && |{ zif_googlepoc_drive_json_api=>file_resource_field-id },| && |{ zif_googlepoc_drive_json_api=>file_resource_field-name },| && |{ zif_googlepoc_drive_json_api=>file_resource_field-mime_type },| && |{ zif_googlepoc_drive_json_api=>file_resource_field-web_view_link },| && |{ zif_googlepoc_drive_json_api=>file_resource_field-parents })| "#EC NOTEXT iv_method = if_http_entity=>co_request_method_get ). if lv_open_connection_succeeded = abap_true. me->send_receive( importing es_response = data(ls_response) ). me->close_connection( ). if has_request_succeeded( ls_response-status_code ) = abap_true. me->mo_json_api->parse_file_resource_list( exporting iv_file_resource_list_json = ls_response-data importing et_file_resources = rt_file_resources ). endif. endif. endmethod. method zif_googlepoc_drive_api~multipart_upload. data(lv_open_connection_succeeded) = me->open_connection( iv_url = cs_google_drive_rest_api_uri-multipart_upload && |&{ cs_files_query_parameter-fields }=| && |{ zif_googlepoc_drive_json_api=>file_resource_field-id },| && |{ zif_googlepoc_drive_json_api=>file_resource_field-web_view_link }| "#EC NOTEXT iv_method = if_http_entity=>co_request_method_post ). if lv_open_connection_succeeded = abap_true. me->mo_http_client->request->set_content_type( cs_content_type-multipart ). "Metadata data(lo_entity) = me->mo_http_client->request->add_multipart( ). lo_entity->set_content_type( |{ cs_content_type-json };charset={ c_encoding_utf8 }| "#EC NOTEXT ). data(lv_metadata) = me->mo_json_api->create_file_resource( iv_mime_type = iv_mime_type iv_name = iv_name it_parents = it_parents ). lo_entity->set_cdata( lv_metadata ). "Binary file content lo_entity = me->mo_http_client->request->add_multipart( ). lo_entity->set_content_type( iv_content_type ). lo_entity->set_data( data = ir_data->* ). me->send_receive( importing es_response = data(ls_response) ). me->close_connection( ). if has_request_succeeded( ls_response-status_code ) = abap_true. rs_file_resource = me->mo_json_api->parse_file_resource( ls_response-data ). if rs_file_resource is not initial. rs_file_resource-name = iv_name. rs_file_resource-mime_type = iv_mime_type. rs_file_resource-parents = it_parents. endif. endif. endif. endmethod. method zif_googlepoc_drive_api~simple_upload. data(lv_open_connection_succeeded) = me->open_connection( iv_url = cs_google_drive_rest_api_uri-simple_upload iv_method = if_http_entity=>co_request_method_post ). if lv_open_connection_succeeded = abap_true. me->mo_http_client->request->set_content_type( iv_content_type ). me->mo_http_client->request->set_data( ir_data->* ). me->send_receive( importing es_response = data(ls_response) ). me->close_connection( ). rv_has_succeeded = has_request_succeeded( ls_response-status_code ). endif. endmethod. endclass.
34.848576
102
0.626828
c72f168e1ff3c3d3196419f0261a4fd9eb2b2d7a
9,722
abap
ABAP
lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zcl_gtt_mia_dl_tools.clas.abap
rakshitha-1234/logistics-business-network-gtt-standardapps-samples
3d1e3249046c0112ff33f524d30cde2ac9f38b4c
[ "Apache-2.0" ]
null
null
null
lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zcl_gtt_mia_dl_tools.clas.abap
rakshitha-1234/logistics-business-network-gtt-standardapps-samples
3d1e3249046c0112ff33f524d30cde2ac9f38b4c
[ "Apache-2.0" ]
null
null
null
lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zcl_gtt_mia_dl_tools.clas.abap
rakshitha-1234/logistics-business-network-gtt-standardapps-samples
3d1e3249046c0112ff33f524d30cde2ac9f38b4c
[ "Apache-2.0" ]
null
null
null
CLASS zcl_gtt_mia_dl_tools DEFINITION PUBLIC CREATE PUBLIC . PUBLIC SECTION. CLASS-METHODS convert_quantity_into_pounits IMPORTING !iv_quantity_uom TYPE any !ir_lips TYPE REF TO data RETURNING VALUE(rv_quantity_pou) TYPE f RAISING cx_udm_message . CLASS-METHODS get_addres_info IMPORTING !iv_addr_type TYPE ad_adrtype DEFAULT zif_gtt_mia_app_constants=>cs_adrtype-organization !iv_addr_numb TYPE ad_addrnum EXPORTING !ev_address TYPE clike !ev_email TYPE clike !ev_telephone TYPE clike RAISING cx_udm_message . CLASS-METHODS get_door_description IMPORTING !iv_lgnum TYPE lgnum !iv_lgtor TYPE lgtor RETURNING VALUE(rv_descr) TYPE /saptrx/paramval200 RAISING cx_udm_message . CLASS-METHODS get_delivery_date IMPORTING !ir_data TYPE REF TO data RETURNING VALUE(rv_date) TYPE /saptrx/event_exp_datetime RAISING cx_udm_message . CLASS-METHODS get_next_event_counter RETURNING VALUE(rv_evtcnt) TYPE /saptrx/evtcnt . CLASS-METHODS get_plant_address_number IMPORTING !iv_werks TYPE werks_d RETURNING VALUE(ev_adrnr) TYPE adrnr RAISING cx_udm_message . CLASS-METHODS get_storage_location_txt IMPORTING !iv_werks TYPE werks_d !iv_lgort TYPE lgort_d RETURNING VALUE(rv_lgobe) TYPE lgobe RAISING cx_udm_message . CLASS-METHODS get_tracking_id_dl_item IMPORTING !ir_lips TYPE REF TO data RETURNING VALUE(rv_track_id) TYPE /saptrx/trxid RAISING cx_udm_message . CLASS-METHODS is_appropriate_dl_item IMPORTING !ir_struct TYPE REF TO data RETURNING VALUE(rv_result) TYPE abap_bool RAISING cx_udm_message . CLASS-METHODS is_appropriate_dl_type IMPORTING !ir_struct TYPE REF TO data RETURNING VALUE(rv_result) TYPE abap_bool RAISING cx_udm_message . PROTECTED SECTION. PRIVATE SECTION. CLASS-DATA mv_evtcnt TYPE /saptrx/evtcnt VALUE zif_gtt_mia_app_constants=>cs_start_evtcnt-delivery ##NO_TEXT. ENDCLASS. CLASS zcl_gtt_mia_dl_tools IMPLEMENTATION. METHOD convert_quantity_into_pounits. DATA(lv_matnr) = CONV matnr( zcl_gtt_mia_tools=>get_field_of_structure( ir_struct_data = ir_lips iv_field_name = 'MATNR' ) ). DATA(lv_vrkme) = CONV vrkme( zcl_gtt_mia_tools=>get_field_of_structure( ir_struct_data = ir_lips iv_field_name = 'VRKME' ) ). CALL FUNCTION 'MATERIAL_UNIT_CONVERSION' EXPORTING input = iv_quantity_uom matnr = lv_matnr meinh = lv_vrkme IMPORTING output = rv_quantity_pou EXCEPTIONS conversion_not_found = 1 input_invalid = 2 material_not_found = 3 meinh_not_found = 4 meins_missing = 5 no_meinh = 6 output_invalid = 7 overflow = 8 OTHERS = 9. IF sy-subrc <> 0. CLEAR: rv_quantity_pou. zcl_gtt_mia_tools=>throw_exception( ). ENDIF. ENDMETHOD. METHOD get_addres_info. DATA: lt_address TYPE szadr_printform_table, ls_addr_comp TYPE szadr_addr1_complete. IF ev_address IS REQUESTED. CLEAR: ev_address. CALL FUNCTION 'ADDRESS_INTO_PRINTFORM' EXPORTING address_type = iv_addr_type address_number = iv_addr_numb IMPORTING address_printform_table = lt_address EXCEPTIONS address_blocked = 1 person_blocked = 2 contact_person_blocked = 3 addr_to_be_formated_is_blocked = 4 OTHERS = 5. IF sy-subrc = 0. LOOP AT lt_address ASSIGNING FIELD-SYMBOL(<ls_address>). ev_address = COND #( WHEN ev_address IS INITIAL THEN <ls_address>-address_line ELSE |{ ev_address }${ <ls_address>-address_line }| ). ENDLOOP. ELSE. zcl_gtt_mia_tools=>throw_exception( ). ENDIF. ENDIF. IF ev_email IS REQUESTED OR ev_telephone IS REQUESTED. CLEAR: ev_email, ev_telephone. CALL FUNCTION 'ADDR_GET_COMPLETE' EXPORTING addrnumber = iv_addr_numb IMPORTING addr1_complete = ls_addr_comp EXCEPTIONS parameter_error = 1 address_not_exist = 2 internal_error = 3 wrong_access_to_archive = 4 address_blocked = 5 OTHERS = 6. IF sy-subrc = 0. ev_email = VALUE #( ls_addr_comp-adsmtp_tab[ 1 ]-adsmtp-smtp_addr OPTIONAL ). ev_telephone = VALUE #( ls_addr_comp-adtel_tab[ 1 ]-adtel-tel_number OPTIONAL ). ELSE. zcl_gtt_mia_tools=>throw_exception( ). ENDIF. ENDIF. ENDMETHOD. METHOD get_delivery_date. rv_date = zcl_gtt_mia_tools=>get_local_timestamp( iv_date = zcl_gtt_mia_tools=>get_field_of_structure( ir_struct_data = ir_data iv_field_name = 'LFDAT' ) iv_time = zcl_gtt_mia_tools=>get_field_of_structure( ir_struct_data = ir_data iv_field_name = 'LFUHR' ) ). ENDMETHOD. METHOD get_door_description. "concatenate T300T-LNUMT '/' T30BT-ltort using SY-LANGU and LIPSVB-LGNUM & LIPSVB-LGTOR DATA: ls_t300t TYPE t300t, lv_ltort TYPE t30bt-ltort. CLEAR: rv_descr. CALL FUNCTION 'T300T_SINGLE_READ' EXPORTING t300t_spras = sy-langu t300t_lgnum = iv_lgnum IMPORTING wt300t = ls_t300t EXCEPTIONS not_found = 1 OTHERS = 2. IF sy-subrc = 0. SELECT SINGLE ltort INTO lv_ltort FROM t30bt WHERE spras = sy-langu AND lgnum = iv_lgnum AND lgtor = iv_lgtor. IF sy-subrc = 0. rv_descr = |{ ls_t300t-lnumt }/{ lv_ltort }|. ELSE. MESSAGE e057(00) WITH iv_lgnum iv_lgtor '' 'T30BT' INTO DATA(lv_dummy). zcl_gtt_mia_tools=>throw_exception( ). ENDIF. ELSE. zcl_gtt_mia_tools=>throw_exception( ). ENDIF. ENDMETHOD. METHOD get_next_event_counter. ADD 1 TO mv_evtcnt. rv_evtcnt = mv_evtcnt. ENDMETHOD. METHOD get_plant_address_number. DATA: ls_t001w TYPE T001w. CALL FUNCTION 'WCB_T001W_SINGLE_READ' EXPORTING i_werks = iv_werks IMPORTING e_t001w = ls_t001w EXCEPTIONS not_found = 1 OTHERS = 2. IF sy-subrc = 0. ev_adrnr = ls_t001w-adrnr. ELSE. zcl_gtt_mia_tools=>throw_exception( ). ENDIF. ENDMETHOD. METHOD get_storage_location_txt. DATA: ls_t001l TYPE t001l. CALL FUNCTION 'T001L_SINGLE_READ' EXPORTING t001l_werks = iv_werks t001l_lgort = iv_lgort IMPORTING wt001l = ls_t001l EXCEPTIONS not_found = 1 OTHERS = 2. IF sy-subrc = 0. rv_lgobe = ls_t001l-lgobe. ELSE. MESSAGE e058(00) WITH iv_werks iv_lgort '' 'T001L' INTO DATA(lv_dummy). zcl_gtt_mia_tools=>throw_exception( ). ENDIF. ENDMETHOD. METHOD get_tracking_id_dl_item. DATA: lv_vbeln TYPE lips-vbeln, lv_posnr TYPE lips-posnr. lv_vbeln = zcl_gtt_mia_tools=>get_field_of_structure( ir_struct_data = ir_lips iv_field_name = 'VBELN' ). lv_posnr = zcl_gtt_mia_tools=>get_field_of_structure( ir_struct_data = ir_lips iv_field_name = 'POSNR' ). rv_track_id = |{ lv_vbeln }{ lv_posnr }|. ENDMETHOD. METHOD is_appropriate_dl_item. DATA: it_tvlp TYPE STANDARD TABLE OF tvlp. DATA(lv_pstyv) = CONV pstyv_vl( zcl_gtt_mia_tools=>get_field_of_structure( ir_struct_data = ir_struct iv_field_name = 'PSTYV' ) ). CALL FUNCTION 'MCV_TVLP_READ' EXPORTING i_pstyv = lv_pstyv TABLES t_tvlp = it_tvlp EXCEPTIONS not_found = 1 OTHERS = 2. IF sy-subrc = 0. rv_result = boolc( it_tvlp[ 1 ]-vbtyp = zif_gtt_mia_app_constants=>cs_vbtyp-delivery AND it_tvlp[ 1 ]-bwart IS NOT INITIAL ). ELSE. MESSAGE e057(00) WITH lv_pstyv '' '' 'TVLP' INTO DATA(lv_dummy). zcl_gtt_mia_tools=>throw_exception( ). ENDIF. ENDMETHOD. METHOD is_appropriate_dl_type. DATA: ls_tvlk TYPE tvlk. DATA(lv_lfart) = CONV lfart( zcl_gtt_mia_tools=>get_field_of_structure( ir_struct_data = ir_struct iv_field_name = 'LFART' ) ). CALL FUNCTION 'CSO_O_DLV_TYPE_GET' EXPORTING pi_dlv_type = lv_lfart IMPORTING pe_tvlk = ls_tvlk. rv_result = boolc( ls_tvlk-vbtyp = zif_gtt_mia_app_constants=>cs_vbtyp-delivery ). ENDMETHOD. ENDCLASS.
27.156425
113
0.58167
c730b71596e44a75e0238706ee46c7307a8923be
9,115
abap
ABAP
src/objects/ecatt/zcl_abapgit_ecatt_val_obj_upl.clas.abap
joymike/abapGit
e06f22bb22a3c0a3c66eec4da698124c1ec98d65
[ "MIT" ]
1
2020-01-27T08:55:52.000Z
2020-01-27T08:55:52.000Z
src/objects/ecatt/zcl_abapgit_ecatt_val_obj_upl.clas.abap
joymike/abapGit
e06f22bb22a3c0a3c66eec4da698124c1ec98d65
[ "MIT" ]
null
null
null
src/objects/ecatt/zcl_abapgit_ecatt_val_obj_upl.clas.abap
joymike/abapGit
e06f22bb22a3c0a3c66eec4da698124c1ec98d65
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_ecatt_val_obj_upl DEFINITION PUBLIC INHERITING FROM cl_apl_ecatt_upload FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES: zif_abapgit_ecatt_upload. METHODS: upload REDEFINITION. PROTECTED SECTION. METHODS: upload_data_from_stream REDEFINITION, get_business_msgs_from_dom RAISING cx_ecatt_apl, get_impl_detail_from_dom RAISING cx_ecatt_apl, get_vo_flags_from_dom RAISING cx_ecatt_apl. PRIVATE SECTION. DATA: mv_external_xml TYPE xstring. ENDCLASS. CLASS zcl_abapgit_ecatt_val_obj_upl IMPLEMENTATION. METHOD get_business_msgs_from_dom. " downport from CL_APL_ECATT_VO_UPLOAD DATA: li_section TYPE REF TO if_ixml_element, lt_buss_msg_ref TYPE zif_abapgit_ecatt=>etvo_bus_msg_tabtype, lv_exception_occurred TYPE etonoff, lo_ecatt_vo TYPE REF TO object. FIELD-SYMBOLS: <lg_ecatt_vo> TYPE any. li_section = template_over_all->find_from_name_ns( 'ETVO_MSG' ). IF NOT li_section IS INITIAL. CALL FUNCTION 'SDIXML_DOM_TO_DATA' EXPORTING data_as_dom = li_section IMPORTING dataobject = lt_buss_msg_ref EXCEPTIONS illegal_object = 1 OTHERS = 2. IF sy-subrc <> 0. CLEAR lt_buss_msg_ref. ENDIF. ENDIF. ASSIGN ('ECATT_OBJECT') TO <lg_ecatt_vo>. ASSERT sy-subrc = 0. lo_ecatt_vo = <lg_ecatt_vo>. TRY. CALL METHOD lo_ecatt_vo->('SET_BUSSINESS_MSG') EXPORTING im_buss_msg_ref = lt_buss_msg_ref. CATCH cx_ecatt_apl INTO exception_to_raise. lv_exception_occurred = 'X'. ENDTRY. IF lv_exception_occurred = 'X'. raise_upload_exception( previous = exception_to_raise ). ENDIF. ENDMETHOD. METHOD get_impl_detail_from_dom. " downport from CL_APL_ECATT_VO_UPLOAD DATA: li_section TYPE REF TO if_ixml_element, ls_impl_details TYPE zif_abapgit_ecatt=>etvoimpl_det, lv_exception_occurred TYPE etonoff, lo_ecatt_vo TYPE REF TO object. FIELD-SYMBOLS: <lg_ecatt_vo> TYPE any. li_section = template_over_all->find_from_name_ns( 'IMPL_DET' ). IF NOT li_section IS INITIAL. CALL FUNCTION 'SDIXML_DOM_TO_DATA' EXPORTING data_as_dom = li_section IMPORTING dataobject = ls_impl_details EXCEPTIONS illegal_object = 1 OTHERS = 2. IF sy-subrc <> 0. CLEAR ls_impl_details. ENDIF. ENDIF. ASSIGN ('ECATT_OBJECT') TO <lg_ecatt_vo>. ASSERT sy-subrc = 0. lo_ecatt_vo = <lg_ecatt_vo>. TRY. CALL METHOD lo_ecatt_vo->('SET_IMPL_DETAILS') EXPORTING im_impl_details = ls_impl_details. CATCH cx_ecatt_apl INTO exception_to_raise. lv_exception_occurred = 'X'. ENDTRY. IF lv_exception_occurred = 'X'. raise_upload_exception( previous = exception_to_raise ). ENDIF. ENDMETHOD. METHOD get_vo_flags_from_dom. " downport from CL_APL_ECATT_VO_UPLOAD DATA: li_section TYPE REF TO if_ixml_element, lv_error_prio TYPE zif_abapgit_ecatt=>etvo_error_prio, lv_invert_validation TYPE zif_abapgit_ecatt=>etvo_invert_validation, lv_exception_occurred TYPE etonoff, lo_ecatt_vo TYPE REF TO object. FIELD-SYMBOLS: <lg_ecatt_vo> TYPE any. li_section = template_over_all->find_from_name_ns( 'INVERT_VALIDATION' ). IF NOT li_section IS INITIAL. CALL FUNCTION 'SDIXML_DOM_TO_DATA' EXPORTING data_as_dom = li_section IMPORTING dataobject = lv_invert_validation EXCEPTIONS illegal_object = 1 OTHERS = 2. IF sy-subrc <> 0. CLEAR lv_invert_validation. ENDIF. ENDIF. ASSIGN ('ECATT_OBJECT') TO <lg_ecatt_vo>. ASSERT sy-subrc = 0. lo_ecatt_vo = <lg_ecatt_vo>. TRY. CALL METHOD lo_ecatt_vo->('SET_INVERT_VALIDATION_FLAG') EXPORTING im_invert_validation = lv_invert_validation. CATCH cx_ecatt_apl INTO exception_to_raise. lv_exception_occurred = 'X'. ENDTRY. li_section = template_over_all->find_from_name_ns( 'ERROR_PRIORITY' ). IF NOT li_section IS INITIAL. CALL FUNCTION 'SDIXML_DOM_TO_DATA' EXPORTING data_as_dom = li_section IMPORTING dataobject = lv_error_prio EXCEPTIONS illegal_object = 1 OTHERS = 2. IF sy-subrc <> 0. CLEAR lv_invert_validation. ENDIF. ENDIF. TRY. CALL METHOD lo_ecatt_vo->('SET_ERROR_PRIORITY') EXPORTING im_error_prio = lv_error_prio. CATCH cx_ecatt_apl INTO exception_to_raise. lv_exception_occurred = 'X'. ENDTRY. IF lv_exception_occurred = 'X'. raise_upload_exception( previous = exception_to_raise ). ENDIF. ENDMETHOD. METHOD upload. " We inherit from CL_APL_ECATT_UPLOAD because CL_APL_ECATT_VO_UPLOAD " doesn't exist in 702 " downport from CL_APL_ECATT_VO_UPLOAD DATA: lx_ex TYPE REF TO cx_ecatt_apl, lv_exists TYPE etonoff, lv_exc_occ TYPE etonoff, ls_tadir TYPE tadir, lo_ecatt_vo TYPE REF TO object, lo_params TYPE REF TO cl_apl_ecatt_params. FIELD-SYMBOLS: <lg_ecatt_vo> TYPE any, <lg_params> TYPE data, <lv_d_akh> TYPE data, <lv_i_akh> TYPE data. TRY. ch_object-i_devclass = ch_object-d_devclass. ASSIGN COMPONENT 'D_AKH' OF STRUCTURE ch_object TO <lv_d_akh>. " doesn't exist in 702 ASSIGN COMPONENT 'I_AKH' OF STRUCTURE ch_object TO <lv_i_akh>. " doesn't exist in 702 IF <lv_d_akh> IS ASSIGNED AND <lv_i_akh> IS ASSIGNED. <lv_i_akh> = <lv_d_akh>. ENDIF. super->upload( CHANGING ch_object = ch_object ). upload_data_from_stream( ch_object-filename ). CATCH cx_ecatt_apl INTO lx_ex. IF template_over_all IS INITIAL. RAISE EXCEPTION lx_ex. ELSE. lv_exc_occ = 'X'. ENDIF. ENDTRY. TRY. CALL METHOD ('GET_ATTRIBUTES_FROM_DOM_NEW') " doesn't exit in 702 CHANGING ch_object = ch_object. CATCH cx_ecatt_apl INTO lx_ex. lv_exc_occ = 'X'. ENDTRY. ASSIGN ('ECATT_OBJECT') TO <lg_ecatt_vo>. ASSERT sy-subrc = 0. lo_ecatt_vo = <lg_ecatt_vo>. ASSIGN lo_ecatt_vo->('PARAMS') TO <lg_params>. ASSERT sy-subrc = 0. lo_params = <lg_params>. TRY. get_impl_detail_from_dom( ). CATCH cx_ecatt_apl INTO lx_ex. lv_exc_occ = 'X'. ENDTRY. TRY. get_vo_flags_from_dom( ). CATCH cx_ecatt_apl INTO lx_ex. lv_exc_occ = 'X'. ENDTRY. TRY. get_business_msgs_from_dom( ). CATCH cx_ecatt_apl INTO lx_ex. lv_exc_occ = 'X'. ENDTRY. TRY. CALL METHOD ('GET_PARAMS_FROM_DOM_NEW') " doesn't exist in 702 EXPORTING im_params = lo_params. CATCH cx_ecatt_apl INTO lx_ex. lv_exc_occ = 'X'. ENDTRY. TRY. get_variants_from_dom( lo_params ). CATCH cx_ecatt_apl INTO lx_ex. lv_exc_occ = 'X'. ENDTRY. TRY. lv_exists = cl_apl_ecatt_object=>existence_check_object( im_name = ch_object-d_obj_name im_version = ch_object-d_obj_ver im_obj_type = ch_object-s_obj_type im_exists_any_version = 'X' ). IF lv_exists = space. CALL METHOD lo_ecatt_vo->('SET_TADIR_FOR_NEW_OBJECT') EXPORTING im_tadir_for_new_object = tadir_preset. ENDIF. CATCH cx_ecatt. CLEAR lv_exists. ENDTRY. TRY. CALL METHOD lo_ecatt_vo->('SAVE') EXPORTING im_do_commit = 'X'. CATCH cx_ecatt_apl INTO lx_ex. lv_exc_occ = 'X'. ENDTRY. * get devclass from existing object TRY. cl_apl_ecatt_object=>get_tadir_entry( EXPORTING im_obj_name = ch_object-d_obj_name im_obj_type = ch_object-s_obj_type IMPORTING ex_tadir = ls_tadir ). ch_object-d_devclass = ls_tadir-devclass. CATCH cx_ecatt. CLEAR ls_tadir. ENDTRY. IF lv_exc_occ = 'X'. raise_upload_exception( previous = lx_ex ). ENDIF. ENDMETHOD. METHOD upload_data_from_stream. " Downport template_over_all = zcl_abapgit_ecatt_helper=>upload_data_from_stream( mv_external_xml ). ENDMETHOD. METHOD zif_abapgit_ecatt_upload~set_stream_for_upload. " downport from CL_ABAPGIT_ECATT_DATA_UPLOAD SET_STREAM_FOR_UPLOAD mv_external_xml = iv_xml. ENDMETHOD. ENDCLASS.
25.389972
93
0.624026
c73312f513858f7a2df627718ab6d2988919f2c5
2,060
abap
ABAP
src/zwwwform.fugr.zwww_openform.abap
sap-russia/zwww
18b449f56d86224c40611c70c83a7ebdad4c22b4
[ "Apache-2.0" ]
null
null
null
src/zwwwform.fugr.zwww_openform.abap
sap-russia/zwww
18b449f56d86224c40611c70c83a7ebdad4c22b4
[ "Apache-2.0" ]
null
null
null
src/zwwwform.fugr.zwww_openform.abap
sap-russia/zwww
18b449f56d86224c40611c70c83a7ebdad4c22b4
[ "Apache-2.0" ]
null
null
null
FUNCTION ZWWW_OPENFORM. *"---------------------------------------------------------------------- *"*"######### #########: *" IMPORTING *" VALUE(FORM_NAME) TYPE WWWDATATAB-OBJID *" VALUE(FILE_NAME) TYPE RLGRAP-FILENAME OPTIONAL *" VALUE(FILE_LOCATION) TYPE C DEFAULT '' *" VALUE(PRINTDIALOG) TYPE C DEFAULT '' *" VALUE(PROTECT) TYPE C DEFAULT 'X' *" VALUE(OPTIMIZE) TYPE N DEFAULT 100 *" VALUE(DEBUG_MODE) TYPE C DEFAULT '' *" VALUE(DECIMAL_SEPARATOR) TYPE C DEFAULT '.' *" VALUE(CLOSE_FORM) TYPE C DEFAULT '' *" VALUE(DELETE_FILE) TYPE C DEFAULT 'X' *" VALUE(WITHOUT_OLE) TYPE C DEFAULT '' *" VALUE(USE_JAR) TYPE C DEFAULT '' *" VALUE(USE_UNICODE) TYPE C DEFAULT '' *" TABLES *" IT_VALUES TYPE ZWWW_VALUES_T *" IT_FILES TYPE ZWWW_FILES_T OPTIONAL *" EXCEPTIONS *" PRINTCANCEL *"---------------------------------------------------------------------- Data: return_code type i, FileType type t_FileType, sy_subrc type sy-subrc, File_Text type string, FileIndex type string, FILE_TEMP type string. * CodePage type TCP00-CPCODEPAGE value space. * Perform AssignCharX. Perform InitParams changing FILE_LOCATION OPTIMIZE WITHOUT_OLE USE_JAR USE_UNICODE CLOSE_FORM. Perform DownloadWWWTemplate using FORM_NAME * FILE_NAME FILE_LOCATION FileType FileIndex File_Text USE_JAR sy_subrc changing FILE_TEMP. Check sy_subrc = 0. Perform OpenForm using FILE_NAME FILE_LOCATION FILE_TEMP FileType FileIndex File_Text IT_VALUES[] IT_FILES[] OPTIMIZE PROTECT PRINTDIALOG DEBUG_MODE DECIMAL_SEPARATOR CLOSE_FORM DELETE_FILE WITHOUT_OLE USE_JAR * CODEPAGE return_code. Case return_code. when 1. Raise PrintCancel. EndCase. ENDFUNCTION.
24.235294
72
0.556796
c733f08c0346d8d60a69fafa2911ffb3caac3674
9,657
abap
ABAP
src/objects/zcl_abapgit_object_prog.clas.abap
IvxLars/abapGit
bcdeebb3ad1432034b5ad1ea40683470956b8e07
[ "MIT" ]
797
2015-02-06T15:38:41.000Z
2020-09-23T02:57:02.000Z
src/objects/zcl_abapgit_object_prog.clas.abap
IvxLars/abapGit
bcdeebb3ad1432034b5ad1ea40683470956b8e07
[ "MIT" ]
2,776
2015-01-13T03:59:55.000Z
2020-09-23T21:46:34.000Z
src/objects/zcl_abapgit_object_prog.clas.abap
IvxLars/abapGit
bcdeebb3ad1432034b5ad1ea40683470956b8e07
[ "MIT" ]
499
2015-01-13T03:41:36.000Z
2020-09-22T11:50:54.000Z
CLASS zcl_abapgit_object_prog DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_program FINAL. PUBLIC SECTION. INTERFACES zif_abapgit_object. ALIASES mo_files FOR zif_abapgit_object~mo_files. PROTECTED SECTION. PRIVATE SECTION. TYPES: BEGIN OF ty_tpool_i18n, language TYPE langu, textpool TYPE zif_abapgit_definitions=>ty_tpool_tt, END OF ty_tpool_i18n . TYPES: ty_tpools_i18n TYPE STANDARD TABLE OF ty_tpool_i18n . CONSTANTS c_longtext_id_prog TYPE dokil-id VALUE 'RE' ##NO_TEXT. METHODS deserialize_with_ext IMPORTING !is_progdir TYPE ty_progdir !it_source TYPE abaptxt255_tab RAISING zcx_abapgit_exception . METHODS serialize_texts IMPORTING !ii_xml TYPE REF TO zif_abapgit_xml_output RAISING zcx_abapgit_exception . METHODS deserialize_texts IMPORTING !ii_xml TYPE REF TO zif_abapgit_xml_input RAISING zcx_abapgit_exception . METHODS is_program_locked RETURNING VALUE(rv_is_program_locked) TYPE abap_bool RAISING zcx_abapgit_exception . ENDCLASS. CLASS zcl_abapgit_object_prog IMPLEMENTATION. METHOD deserialize_texts. DATA: lt_tpool_i18n TYPE ty_tpools_i18n, lt_tpool TYPE textpool_table. FIELD-SYMBOLS <ls_tpool> LIKE LINE OF lt_tpool_i18n. ii_xml->read( EXPORTING iv_name = 'I18N_TPOOL' CHANGING cg_data = lt_tpool_i18n ). LOOP AT lt_tpool_i18n ASSIGNING <ls_tpool>. lt_tpool = read_tpool( <ls_tpool>-textpool ). deserialize_textpool( iv_program = ms_item-obj_name iv_language = <ls_tpool>-language it_tpool = lt_tpool ). ENDLOOP. ENDMETHOD. METHOD deserialize_with_ext. " Special treatment for extensions " If the program name exceeds 30 characters it is not a usual ABAP program but might be " some extension, which requires the internal addition EXTENSION TYPE " https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm?file=abapinsert_report_internal.htm " This e.g. occurs in case of transportable Code Inspector variants (ending with ===VC) INSERT REPORT is_progdir-name FROM it_source STATE 'I' EXTENSION TYPE is_progdir-name+30 PROGRAM TYPE is_progdir-subc. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'Error from INSERT REPORT .. EXTENSION TYPE' ). ENDIF. CALL FUNCTION 'UPDATE_PROGDIR' EXPORTING i_progdir = is_progdir i_progname = is_progdir-name i_state = 'I' EXCEPTIONS not_executed = 1 OTHERS = 2. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'Error updating program directory' ). ENDIF. zcl_abapgit_objects_activation=>add( iv_type = 'REPS' iv_name = is_progdir-name ). ENDMETHOD. METHOD is_program_locked. rv_is_program_locked = exists_a_lock_entry_for( iv_lock_object = 'ESRDIRE' iv_argument = |{ ms_item-obj_name }| ). ENDMETHOD. METHOD serialize_texts. DATA: lt_tpool_i18n TYPE ty_tpools_i18n, lt_tpool TYPE textpool_table. FIELD-SYMBOLS <ls_tpool> LIKE LINE OF lt_tpool_i18n. IF ii_xml->i18n_params( )-main_language_only = abap_true. RETURN. ENDIF. " Table d010tinf stores info. on languages in which program is maintained " Select all active translations of program texts " Skip main language - it was already serialized SELECT DISTINCT language INTO CORRESPONDING FIELDS OF TABLE lt_tpool_i18n FROM d010tinf WHERE r3state = 'A' AND prog = ms_item-obj_name AND language <> mv_language ##TOO_MANY_ITAB_FIELDS. SORT lt_tpool_i18n BY language ASCENDING. LOOP AT lt_tpool_i18n ASSIGNING <ls_tpool>. READ TEXTPOOL ms_item-obj_name LANGUAGE <ls_tpool>-language INTO lt_tpool. <ls_tpool>-textpool = add_tpool( lt_tpool ). ENDLOOP. IF lines( lt_tpool_i18n ) > 0. ii_xml->add( iv_name = 'I18N_TPOOL' ig_data = lt_tpool_i18n ). ENDIF. ENDMETHOD. METHOD zif_abapgit_object~changed_by. SELECT SINGLE unam FROM reposrc INTO rv_user WHERE progname = ms_item-obj_name AND r3state = 'A'. IF sy-subrc <> 0. rv_user = c_user_unknown. ENDIF. ENDMETHOD. METHOD zif_abapgit_object~delete. DATA: lv_program LIKE sy-repid, lv_obj_name TYPE e071-obj_name. lv_program = ms_item-obj_name. CALL FUNCTION 'RS_DELETE_PROGRAM' EXPORTING corrnumber = iv_transport program = lv_program suppress_popup = abap_true mass_delete_call = abap_true tadir_devclass = iv_package force_delete_used_includes = abap_true EXCEPTIONS enqueue_lock = 1 object_not_found = 2 permission_failure = 3 reject_deletion = 4 OTHERS = 5. IF sy-subrc = 2. " Drop also any inactive code that is left in REPOSRC DELETE REPORT lv_program ##SUBRC_OK. " Remove inactive objects from work area lv_obj_name = lv_program. CALL FUNCTION 'RS_DELETE_FROM_WORKING_AREA' EXPORTING object = 'REPS' obj_name = lv_obj_name immediate = 'X' actualize_working_area = 'X'. CALL FUNCTION 'RS_DELETE_FROM_WORKING_AREA' EXPORTING object = 'REPT' obj_name = lv_obj_name immediate = 'X' actualize_working_area = 'X'. ELSEIF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. delete_longtexts( c_longtext_id_prog ). ENDMETHOD. METHOD zif_abapgit_object~deserialize. DATA: lv_program_name TYPE programm, ls_progdir TYPE ty_progdir, lt_tpool TYPE textpool_table, lt_dynpros TYPE ty_dynpro_tt, lt_tpool_ext TYPE zif_abapgit_definitions=>ty_tpool_tt, ls_cua TYPE ty_cua, lt_source TYPE abaptxt255_tab. " Add R3TR PROG to transport first, otherwise we get several LIMUs corr_insert( iv_package ). lv_program_name = ms_item-obj_name. lt_source = mo_files->read_abap( ). io_xml->read( EXPORTING iv_name = 'TPOOL' CHANGING cg_data = lt_tpool_ext ). lt_tpool = read_tpool( lt_tpool_ext ). io_xml->read( EXPORTING iv_name = 'PROGDIR' CHANGING cg_data = ls_progdir ). IF strlen( lv_program_name ) > 30. " Objects with extension for example transportable Code Inspector variants (ending with ===VC) deserialize_with_ext( is_progdir = ls_progdir it_source = lt_source ). ELSE. deserialize_program( is_progdir = ls_progdir it_source = lt_source it_tpool = lt_tpool iv_package = iv_package ). io_xml->read( EXPORTING iv_name = 'DYNPROS' CHANGING cg_data = lt_dynpros ). deserialize_dynpros( lt_dynpros ). io_xml->read( EXPORTING iv_name = 'CUA' CHANGING cg_data = ls_cua ). deserialize_cua( iv_program_name = lv_program_name is_cua = ls_cua ). " Texts deserializing (English) deserialize_textpool( iv_program = lv_program_name it_tpool = lt_tpool ). " Texts deserializing (translations) deserialize_texts( io_xml ). deserialize_lxe_texts( io_xml ). deserialize_longtexts( io_xml ). ENDIF. ENDMETHOD. METHOD zif_abapgit_object~exists. DATA: lv_progname TYPE reposrc-progname. SELECT SINGLE progname FROM reposrc INTO lv_progname WHERE progname = ms_item-obj_name. rv_bool = boolc( sy-subrc = 0 ). ENDMETHOD. METHOD zif_abapgit_object~get_comparator. RETURN. ENDMETHOD. METHOD zif_abapgit_object~get_deserialize_steps. APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps. ENDMETHOD. METHOD zif_abapgit_object~get_metadata. rs_metadata = get_metadata( ). ENDMETHOD. METHOD zif_abapgit_object~is_active. rv_active = is_active( ). ENDMETHOD. METHOD zif_abapgit_object~is_locked. IF is_program_locked( ) = abap_true OR is_any_dynpro_locked( ms_item-obj_name ) = abap_true OR is_cua_locked( ms_item-obj_name ) = abap_true OR is_text_locked( ms_item-obj_name ) = abap_true. rv_is_locked = abap_true. ENDIF. ENDMETHOD. METHOD zif_abapgit_object~jump. " Covered by ZCL_ABAPGIT_OBJECTS=>JUMP ENDMETHOD. METHOD zif_abapgit_object~serialize. * see SAP note 1025291, run report DELETE_TADIR_FOR_EIMP_INCLUDE to clean bad TADIR entries ASSERT NOT ms_item-obj_name CP '*=E'. serialize_program( io_xml = io_xml is_item = ms_item io_files = mo_files ). " Texts serializing (translations) IF io_xml->i18n_params( )-translation_languages IS INITIAL. " Old I18N option serialize_texts( io_xml ). ELSE. " New LXE option serialize_lxe_texts( io_xml ). ENDIF. serialize_longtexts( ii_xml = io_xml iv_longtext_id = c_longtext_id_prog ). ENDMETHOD. ENDCLASS.
27.991304
110
0.639743
c736b1200f03a89a54bfca8b29ef509f132d23c7
3,940
abap
ABAP
src/zcl_custom_signs.clas.testclasses.abap
pokrakam/exercism-abap-local
d32413055706fff79d9c47015fd403d6422e0159
[ "MIT" ]
23
2021-10-01T12:48:00.000Z
2022-03-31T08:34:36.000Z
exercises/practice/custom-signs/zcl_custom_signs.clas.testclasses.abap
mbtools/abap
f806df9956254e7edd4848c927ca366c447a46b1
[ "MIT" ]
54
2021-09-30T15:14:04.000Z
2022-03-31T17:30:50.000Z
exercises/practice/custom-signs/zcl_custom_signs.clas.testclasses.abap
mbtools/abap
f806df9956254e7edd4848c927ca366c447a46b1
[ "MIT" ]
13
2021-10-01T20:46:24.000Z
2022-03-29T16:49:42.000Z
CLASS ltc_sign DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS. PRIVATE SECTION. DATA cut TYPE REF TO zcl_custom_signs. METHODS setup. METHODS occasion_is_birthday FOR TESTING RAISING cx_static_check. METHODS occasion_is_anniversary FOR TESTING RAISING cx_static_check. ENDCLASS. CLASS ltc_sign IMPLEMENTATION. METHOD setup. cut = NEW zcl_custom_signs( ). ENDMETHOD. METHOD occasion_is_birthday. cl_abap_unit_assert=>assert_equals( act = cut->build_sign( occasion = 'Birthday' name = 'Jack' ) exp = 'Happy Birthday Jack!' ). ENDMETHOD. METHOD occasion_is_anniversary. cl_abap_unit_assert=>assert_equals( act = cut->build_sign( occasion = 'Anniversary' name = 'Jill' ) exp = 'Happy Anniversary Jill!' ). ENDMETHOD. ENDCLASS. CLASS ltc_birthday DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS. PRIVATE SECTION. DATA cut TYPE REF TO zcl_custom_signs. METHODS setup. METHODS age_less_than_50 FOR TESTING RAISING cx_static_check. METHODS age_50 FOR TESTING RAISING cx_static_check. METHODS age_over_50 FOR TESTING RAISING cx_static_check. ENDCLASS. CLASS ltc_birthday IMPLEMENTATION. METHOD setup. cut = NEW zcl_custom_signs( ). ENDMETHOD. METHOD age_less_than_50. cl_abap_unit_assert=>assert_equals( act = cut->build_birthday_sign( 49 ) exp = 'Happy Birthday! What a young fellow you are.' ). ENDMETHOD. METHOD age_50. cl_abap_unit_assert=>assert_equals( act = cut->build_birthday_sign( 50 ) exp = 'Happy Birthday! What a mature fellow you are.' ). ENDMETHOD. METHOD age_over_50. cl_abap_unit_assert=>assert_equals( act = cut->build_birthday_sign( 51 ) exp = 'Happy Birthday! What a mature fellow you are.' ). ENDMETHOD. ENDCLASS. CLASS ltc_graduation DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS. PRIVATE SECTION. DATA cut TYPE REF TO zcl_custom_signs. METHODS setup. METHODS rob_2021 FOR TESTING RAISING cx_static_check. METHODS jill_1999 FOR TESTING RAISING cx_static_check. ENDCLASS. CLASS ltc_graduation IMPLEMENTATION. METHOD setup. cut = NEW zcl_custom_signs( ). ENDMETHOD. METHOD rob_2021. cl_abap_unit_assert=>assert_equals( act = cut->graduation_for( name = 'Rob' year = '2021' ) exp = |Congratulations Rob!\nClass of 2021| ). ENDMETHOD. METHOD jill_1999. cl_abap_unit_assert=>assert_equals( act = cut->graduation_for( name = 'Jill' year = '1999' ) exp = |Congratulations Jill!\nClass of 1999| ). ENDMETHOD. ENDCLASS. CLASS ltc_cost DEFINITION FINAL FOR TESTING DURATION SHORT RISK LEVEL HARMLESS. PRIVATE SECTION. DATA cut TYPE REF TO zcl_custom_signs. METHODS setup. METHODS character_count FOR TESTING RAISING cx_static_check. METHODS line_breaks_included FOR TESTING RAISING cx_static_check. METHODS different_currency FOR TESTING RAISING cx_static_check. ENDCLASS. CLASS ltc_cost IMPLEMENTATION. METHOD setup. cut = NEW zcl_custom_signs( ). ENDMETHOD. METHOD character_count. cl_abap_unit_assert=>assert_equals( act = cut->cost_of( sign = |Happy Birthday!| currency = 'dollars' ) exp = 'Your sign costs 50.00 dollars.' ). ENDMETHOD. METHOD line_breaks_included. cl_abap_unit_assert=>assert_equals( act = cut->cost_of( sign = |Congratulations Rob\nClass of 2021| currency = 'dollars' ) exp = 'Your sign costs 86.00 dollars.' ). ENDMETHOD. METHOD different_currency. cl_abap_unit_assert=>assert_equals( act = cut->cost_of( sign = |Happy Easter, little sister!| currency = 'euros' ) exp = 'Your sign costs 76.00 euros.' ). ENDMETHOD. ENDCLASS.
21.888889
72
0.68934
c73d7d511473864611b770d14e593c60b2c66888
7,580
abap
ABAP
zcl_flseoq_wrap.clas.abap
hapejot/abapFLWrapper
fee1bce8baa1f4d3bb5c1404447fcf5d8ee49f97
[ "MIT" ]
1
2019-07-01T18:31:39.000Z
2019-07-01T18:31:39.000Z
zcl_flseoq_wrap.clas.abap
hapejot/abapFLWrapper
fee1bce8baa1f4d3bb5c1404447fcf5d8ee49f97
[ "MIT" ]
5
2018-04-24T09:26:06.000Z
2018-05-21T19:59:56.000Z
zcl_flseoq_wrap.clas.abap
hapejot/abapFLWrapper
fee1bce8baa1f4d3bb5c1404447fcf5d8ee49f97
[ "MIT" ]
null
null
null
CLASS zcl_flseoq_wrap DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES zif_flseoq. CLASS-METHODS test RETURNING VALUE(r_rc) TYPE i. METHODS seo_class_delete_complete IMPORTING clskey TYPE seoclskey OPTIONAL EXCEPTIONS not_existing is_interface db_error no_access . METHODS seo_class_existence_check IMPORTING clskey TYPE seoclskey EXPORTING not_active TYPE seox_boolean EXCEPTIONS not_specified not_existing is_interface no_text inconsistent other. PROTECTED SECTION. PRIVATE SECTION. TYPE-POOLS: seoc, seok, seop. ENDCLASS. CLASS ZCL_FLSEOQ_WRAP IMPLEMENTATION. METHOD seo_class_delete_complete. CALL FUNCTION 'SEO_CLASS_DELETE_COMPLETE' EXPORTING clskey = clskey " Class * genflag = SPACE " Generation Flag * authority_check = " Execute authority check (suppress possible only for GENFLAG * suppress_docu_delete = * suppress_commit = " No DB_COMMIT will be executed * suppress_corr = " Suppress Corr-Insert and Corr-Check * lifecycle_manager = " Lifecycle manager * lock_handle = " Lock Handle * suppress_dialog = " X = no user interaction * CHANGING * corrnr = " Request/Task EXCEPTIONS not_existing = 1 is_interface = 2 db_error = 3 no_access = 4 other = 5 OTHERS = 6. IF sy-subrc <> 0. * MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno * WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. ENDMETHOD. METHOD seo_class_existence_check. CALL FUNCTION 'SEO_CLASS_EXISTENCE_CHECK' EXPORTING clskey = clskey IMPORTING not_active = not_active EXCEPTIONS not_specified = 1 not_existing = 2 is_interface = 3 no_text = 4 inconsistent = 5 OTHERS = 6. CASE sy-subrc. WHEN 0. " do nothing WHEN 1. RAISE not_specified. WHEN 2. RAISE not_existing. WHEN 3. RAISE is_interface. WHEN 4. RAISE no_text. WHEN 5. RAISE inconsistent. WHEN OTHERS. RAISE other. ENDCASE. ENDMETHOD. METHOD test. DATA: l_class TYPE vseoclass. l_class = VALUE #( clsname = |{ 'zcl_pjl_test1' CASE = UPPER }| state = seoc_state_implemented exposure = seoc_exposure_public langu = 'EN' descript = 'Generated class' clsccincl = abap_true " new include structure for locals unicode = abap_true author = 'developer' ). DATA(l_app) = CAST zif_flseoq( NEW zcl_flseoq_wrap( ) ). * CALL METHOD l_app->seo_class_existence_check * EXPORTING * clskey = VALUE seoclskey( clsname = l_class-clsname ) * IMPORTING * not_active = DATA(not_active) * EXCEPTIONS * not_specified = 1 * not_existing = 2 * is_interface = 3 * no_text = 4 * inconsistent = 5 * other = 6 * OTHERS = 7. * IF sy-subrc IS INITIAL. * l_app->seo_class_delete_complete( * EXPORTING * clskey = VALUE seoclskey( clsname = l_class-clsname ) * EXCEPTIONS * not_existing = 1 * is_interface = 2 * db_error = 3 * no_access = 4 * OTHERS = 5 * ). * IF sy-subrc <> 0. * MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno * WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. * ENDIF. * ENDIF. CALL METHOD l_app->seo_class_create_complete EXPORTING devclass = '$TMP' CHANGING class = l_class EXCEPTIONS existing = 1 is_interface = 2 db_error = 3 component_error = 4 no_access = 5 other = 6 OTHERS = 7. r_rc = sy-subrc. MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv4 sy-msgv4. ENDMETHOD. METHOD zif_flseoq~seo_class_create_complete. CALL FUNCTION 'SEO_CLASS_CREATE_COMPLETE' EXPORTING * corrnr = " Correction Number devclass = devclass " Package version = seoc_version_active " Active/Inactive * genflag = SPACE " Generation Flag * authority_check = overwrite = abap_true suppress_method_generation = abap_false * suppress_refactoring_support = method_sources = method_sources " Table of Methodsources * locals_def = " Sourcetext klassenlokaler Klassen (Definitionsteil) * locals_imp = " Sourcetext klassenlokaler Klassen (Implementierungsteil) * locals_mac = " ABAP-Source * suppress_index_update = * typesrc = " Updated type Source parameter to support more than 9999 char * suppress_corr = * suppress_dialog = * lifecycle_manager = " Lifecycle manager * locals_au = " Sourcecode for local testclasses * lock_handle = " Lock Handle * suppress_unlock = * suppress_commit = " No DB_COMMIT will be executed * generate_method_impls_wo_frame = " X -> METHOD_SOURCES have to contain METHOD and ENDMETHOD sta * IMPORTING * korrnr = " Request/Task * TABLES * class_descriptions = " Short description class/interface * component_descriptions = " Short description class/interface component * subcomponent_descriptions = " Class/interface subcomponent short description CHANGING class = class * inheritance = * redefinitions = implementings = implementings impl_details = impl_details attributes = attributes methods = methods * events = types = types * type_source = " This parameter is deprecated. Please use typesrc. parameters = parameters * exceps = * aliases = * typepusages = " Type group application * clsdeferrds = * intdeferrds = * friendships = EXCEPTIONS existing = 1 is_interface = 2 db_error = 3 component_error = 4 no_access = 5 other = 6 OTHERS = 7. CASE sy-subrc. WHEN 0. " do nothing WHEN 1. RAISE existing. WHEN 2. RAISE is_interface. WHEN 3. RAISE db_error. WHEN 4. RAISE component_error. WHEN 5. RAISE no_access. WHEN OTHERS. RAISE other. ENDCASE. ENDMETHOD. ENDCLASS.
32.118644
107
0.523747
c7415482f7bd44472cea9a546b66ebc34c708796
705
abap
ABAP
collections/zif_listiterator.abap
lhs123/ztest
a9b5710a304c524d4b897a1d0316ee7872b9c425
[ "MIT" ]
86
2015-02-12T01:44:24.000Z
2022-03-17T03:14:48.000Z
collections/zif_listiterator.abap
lhs123/ztest
a9b5710a304c524d4b897a1d0316ee7872b9c425
[ "MIT" ]
4
2015-04-10T21:33:56.000Z
2017-07-17T00:19:52.000Z
collections/zif_listiterator.abap
lhs123/ztest
a9b5710a304c524d4b897a1d0316ee7872b9c425
[ "MIT" ]
29
2015-04-01T04:19:04.000Z
2021-08-18T07:46:56.000Z
interface ZIF_LISTITERATOR public . interfaces ZIF_ITERATOR . aliases HASNEXT for ZIF_ITERATOR~HASNEXT . aliases NEXT for ZIF_ITERATOR~NEXT . aliases REMOVE for ZIF_ITERATOR~REMOVE . methods ADD importing !ELEMENT type ref to ZCL_OBJECT . type-pools ABAP . methods HASPREVIOUS returning value(RETURNING) type ABAP_BOOL . methods NEXTINDEX returning value(RETURNING) type I . methods PREVIOUS returning value(RETURNING) type ref to ZCL_OBJECT . methods PREVIOUSINDEX returning value(RETURNING) type I . methods SET importing !ELEMENT type ref to ZCL_OBJECT . endinterface.
20.735294
48
0.668085
c743085b44f6113060ab1e0b8847225dabe05e69
1,370
abap
ABAP
#gal#cx_lock_exception.clas.abap
galileo-group/galileo-abap-lib
a013885096af9bc461d6000ad27b91789f150d00
[ "MIT" ]
2
2017-11-02T12:33:44.000Z
2019-10-14T10:10:13.000Z
#gal#cx_lock_exception.clas.abap
galileo-group/galileo-abap-lib
a013885096af9bc461d6000ad27b91789f150d00
[ "MIT" ]
1
2017-11-05T19:36:27.000Z
2020-10-23T14:35:47.000Z
#gal#cx_lock_exception.clas.abap
galileo-group/galileo-abap-lib
a013885096af9bc461d6000ad27b91789f150d00
[ "MIT" ]
null
null
null
class /GAL/CX_LOCK_EXCEPTION definition public inheriting from /GAL/CX_EXCEPTION final create public . public section. type-pools ABAP . constants /GAL/CX_LOCK_EXCEPTION type SOTR_CONC value '00155D0122031EE3BAE00BB6BDAB42CA'. "#EC NOTEXT constants CANNOT_ACQUIRE_LOCK type SOTR_CONC value '00155D0122031EE3BAE00BB6BDAB62CA'. "#EC NOTEXT constants RFC_EXCEPTION type SOTR_CONC value '00155D0122031EE3BAE00BB6BDAB82CA'. "#EC NOTEXT constants NOT_LOCKED_SET_SYNC_TIMESTAMP type SOTR_CONC value '00155D0122031EE3BAE21990619302CA'. "#EC NOTEXT methods CONSTRUCTOR importing !TEXTID like TEXTID optional !PREVIOUS like PREVIOUS optional !VAR1 type STRING optional !VAR2 type STRING optional !VAR3 type STRING optional !VAR4 type STRING optional !VAR5 type STRING optional !VAR6 type STRING optional !VAR7 type STRING optional !VAR8 type STRING optional !VAR9 type STRING optional . protected section. private section. ENDCLASS. CLASS /GAL/CX_LOCK_EXCEPTION IMPLEMENTATION. method CONSTRUCTOR. CALL METHOD SUPER->CONSTRUCTOR EXPORTING TEXTID = TEXTID PREVIOUS = PREVIOUS VAR1 = VAR1 VAR2 = VAR2 VAR3 = VAR3 VAR4 = VAR4 VAR5 = VAR5 VAR6 = VAR6 VAR7 = VAR7 VAR8 = VAR8 VAR9 = VAR9 . IF textid IS INITIAL. me->textid = /GAL/CX_LOCK_EXCEPTION . ENDIF. endmethod. ENDCLASS.
24.035088
110
0.755474
c7436c977f7df5372ce783b33e43951138751657
740
abap
ABAP
src/gui/zcx_uitb_gui_exception.clas.abap
stockbal/abap-ui-toolbox
93ee48975deab71aa16e3c898c9863b0c4e6ee19
[ "MIT" ]
3
2021-03-08T13:02:46.000Z
2021-11-30T20:04:44.000Z
src/gui/zcx_uitb_gui_exception.clas.abap
stockbal/abap-ui-toolbox
93ee48975deab71aa16e3c898c9863b0c4e6ee19
[ "MIT" ]
1
2021-03-31T17:13:50.000Z
2021-03-31T20:05:02.000Z
src/gui/zcx_uitb_gui_exception.clas.abap
stockbal/abap-ui-toolbox
93ee48975deab71aa16e3c898c9863b0c4e6ee19
[ "MIT" ]
null
null
null
"! <p class="shorttext synchronized" lang="en">Generic GUI Error</p> CLASS zcx_uitb_gui_exception DEFINITION PUBLIC INHERITING FROM zcx_uitb_nc_exception CREATE PUBLIC . PUBLIC SECTION. CONSTANTS: "! <p class="shorttext synchronized" lang="en">Generic Exception message</p> BEGIN OF zcx_uitb_gui_exception, msgid TYPE symsgid VALUE 'ZUITB_EXCEPTION', msgno TYPE symsgno VALUE '011', attr1 TYPE scx_attrname VALUE '', attr2 TYPE scx_attrname VALUE '', attr3 TYPE scx_attrname VALUE '', attr4 TYPE scx_attrname VALUE '', END OF zcx_uitb_gui_exception . PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS zcx_uitb_gui_exception IMPLEMENTATION. ENDCLASS.
26.428571
82
0.709459
c744053fa762a9be3e25b2e8b818422ba96b4d62
31,516
abap
ABAP
src/z4_01_business_objects/z4_012_monster/zcl_z_4_monster_mpc.clas.abap
larshp/ABAPToTheFuture04
43b686f8d9fd7b7fb5414249152dffa54fd05dd8
[ "MIT" ]
null
null
null
src/z4_01_business_objects/z4_012_monster/zcl_z_4_monster_mpc.clas.abap
larshp/ABAPToTheFuture04
43b686f8d9fd7b7fb5414249152dffa54fd05dd8
[ "MIT" ]
null
null
null
src/z4_01_business_objects/z4_012_monster/zcl_z_4_monster_mpc.clas.abap
larshp/ABAPToTheFuture04
43b686f8d9fd7b7fb5414249152dffa54fd05dd8
[ "MIT" ]
null
null
null
class ZCL_Z_4_MONSTER_MPC definition public inheriting from /IWBEP/CL_MGW_PUSH_ABS_MODEL create public . public section. types: TS_MONSTER type Z4SC_MONSTER_HEADER_EX . types: TT_MONSTER type standard table of TS_MONSTER . types: begin of ts_text_element, artifact_name type c length 40, " technical name artifact_type type c length 4, parent_artifact_name type c length 40, " technical name parent_artifact_type type c length 4, text_symbol type textpoolky, end of ts_text_element . types: tt_text_elements type standard table of ts_text_element with key text_symbol . types: TS_MONSTERITEM type Z4SC_MONSTER_ITEMS_EX . types: TT_MONSTERITEM type standard table of TS_MONSTERITEM . constants GC_MONSTER type /IWBEP/IF_MGW_MED_ODATA_TYPES=>TY_E_MED_ENTITY_NAME value 'Monster' ##NO_TEXT. constants GC_MONSTERITEM type /IWBEP/IF_MGW_MED_ODATA_TYPES=>TY_E_MED_ENTITY_NAME value 'Monsteritem' ##NO_TEXT. methods LOAD_TEXT_ELEMENTS final returning value(RT_TEXT_ELEMENTS) type TT_TEXT_ELEMENTS raising /IWBEP/CX_MGW_MED_EXCEPTION . methods DEFINE redefinition . methods GET_LAST_MODIFIED redefinition . protected section. private section. methods DEFINE_MONSTER raising /IWBEP/CX_MGW_MED_EXCEPTION . methods DEFINE_MONSTERITEM raising /IWBEP/CX_MGW_MED_EXCEPTION . methods DEFINE_ASSOCIATIONS raising /IWBEP/CX_MGW_MED_EXCEPTION . ENDCLASS. CLASS ZCL_Z_4_MONSTER_MPC IMPLEMENTATION. method DEFINE. *&---------------------------------------------------------------------* *& Generated code for the MODEL PROVIDER BASE CLASS &* *& &* *& !!!NEVER MODIFY THIS CLASS. IN CASE YOU WANT TO CHANGE THE MODEL &* *& DO THIS IN THE MODEL PROVIDER SUBCLASS!!! &* *& &* *&---------------------------------------------------------------------* super->define( ). model->set_schema_namespace( 'Z_4_MONSTER_SRV' ). define_monster( ). define_monsteritem( ). define_associations( ). endmethod. method DEFINE_ASSOCIATIONS. *&---------------------------------------------------------------------* *& Generated code for the MODEL PROVIDER BASE CLASS &* *& &* *& !!!NEVER MODIFY THIS CLASS. IN CASE YOU WANT TO CHANGE THE MODEL &* *& DO THIS IN THE MODEL PROVIDER SUBCLASS!!! &* *& &* *&---------------------------------------------------------------------* data: lo_annotation type ref to /iwbep/if_mgw_odata_annotation, "#EC NEEDED lo_entity_type type ref to /iwbep/if_mgw_odata_entity_typ, "#EC NEEDED lo_association type ref to /iwbep/if_mgw_odata_assoc, "#EC NEEDED lo_ref_constraint type ref to /iwbep/if_mgw_odata_ref_constr, "#EC NEEDED lo_assoc_set type ref to /iwbep/if_mgw_odata_assoc_set, "#EC NEEDED lo_nav_property type ref to /iwbep/if_mgw_odata_nav_prop. "#EC NEEDED *********************************************************************************************************************************** * ASSOCIATIONS *********************************************************************************************************************************** lo_association = model->create_association( iv_association_name = 'MonstersWithMonsterItems' "#EC NOTEXT iv_left_type = 'Monster' "#EC NOTEXT iv_right_type = 'Monsteritem' "#EC NOTEXT iv_right_card = 'N' "#EC NOTEXT iv_left_card = '1' "#EC NOTEXT iv_def_assoc_set = abap_false ). "#EC NOTEXT * Referential constraint for association - MonstersWithMonsterItems lo_ref_constraint = lo_association->create_ref_constraint( ). lo_ref_constraint->add_property( iv_principal_property = 'MonsterNumber' iv_dependent_property = 'MonsterNumber' ). "#EC NOTEXT lo_assoc_set = model->create_association_set( iv_association_set_name = 'MonstersWithMonsterItems' "#EC NOTEXT iv_left_entity_set_name = 'Monsters' "#EC NOTEXT iv_right_entity_set_name = 'Monsteritems' "#EC NOTEXT iv_association_name = 'MonstersWithMonsterItems' ). "#EC NOTEXT *********************************************************************************************************************************** * NAVIGATION PROPERTIES *********************************************************************************************************************************** * Navigation Properties for entity - Monster lo_entity_type = model->get_entity_type( iv_entity_name = 'Monster' ). "#EC NOTEXT lo_nav_property = lo_entity_type->create_navigation_property( iv_property_name = 'FromMonstersToMonsterItems' "#EC NOTEXT iv_abap_fieldname = 'FROMMONSTERSTOMONSTERITEMS' "#EC NOTEXT iv_association_name = 'MonstersWithMonsterItems' ). "#EC NOTEXT endmethod. method DEFINE_MONSTER. *&---------------------------------------------------------------------* *& Generated code for the MODEL PROVIDER BASE CLASS &* *& &* *& !!!NEVER MODIFY THIS CLASS. IN CASE YOU WANT TO CHANGE THE MODEL &* *& DO THIS IN THE MODEL PROVIDER SUBCLASS!!! &* *& &* *&---------------------------------------------------------------------* data: lo_annotation type ref to /iwbep/if_mgw_odata_annotation, "#EC NEEDED lo_entity_type type ref to /iwbep/if_mgw_odata_entity_typ, "#EC NEEDED lo_complex_type type ref to /iwbep/if_mgw_odata_cmplx_type, "#EC NEEDED lo_property type ref to /iwbep/if_mgw_odata_property, "#EC NEEDED lo_entity_set type ref to /iwbep/if_mgw_odata_entity_set. "#EC NEEDED *********************************************************************************************************************************** * ENTITY - Monster *********************************************************************************************************************************** lo_entity_type = model->create_entity_type( iv_entity_type_name = 'Monster' iv_def_entity_set = abap_false ). "#EC NOTEXT *********************************************************************************************************************************** *Properties *********************************************************************************************************************************** lo_property = lo_entity_type->create_property( iv_property_name = 'MonsterNumber' iv_abap_fieldname = 'MONSTER_NUMBER' ). "#EC NOTEXT lo_property->set_is_key( ). lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 10 ). "#EC NOTEXT lo_property->set_conversion_exit( 'ALPHA' ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'Name' iv_abap_fieldname = 'NAME' ). "#EC NOTEXT lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 30 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'TaxNumber' iv_abap_fieldname = 'TAX_NUMBER' ). "#EC NOTEXT lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 16 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'Model' iv_abap_fieldname = 'MODEL' ). "#EC NOTEXT lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 4 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'MonsterUsage' iv_abap_fieldname = 'MONSTER_USAGE' ). "#EC NOTEXT lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 4 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'SanityPercentage' iv_abap_fieldname = 'SANITY_PERCENTAGE' ). "#EC NOTEXT lo_property->set_type_edm_int32( ). lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'Evilness' iv_abap_fieldname = 'EVILNESS' ). "#EC NOTEXT lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 4 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'Scariness' iv_abap_fieldname = 'SCARINESS' ). "#EC NOTEXT lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 4 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'BrainSize' iv_abap_fieldname = 'BRAIN_SIZE' ). "#EC NOTEXT lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 10 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'Color' iv_abap_fieldname = 'COLOR' ). "#EC NOTEXT lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 4 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'NoOfHeads' iv_abap_fieldname = 'NO_OF_HEADS' ). "#EC NOTEXT lo_property->set_type_edm_int32( ). lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'HatSize' iv_abap_fieldname = 'HAT_SIZE' ). "#EC NOTEXT lo_property->set_type_edm_int32( ). lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'RagesPerDay' iv_abap_fieldname = 'RAGES_PER_DAY' ). "#EC NOTEXT lo_property->set_type_edm_int32( ). lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'Strength' iv_abap_fieldname = 'STRENGTH' ). "#EC NOTEXT lo_property->set_type_edm_int32( ). lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'EarlyAgeStrength' iv_abap_fieldname = 'EARLY_AGE_STRENGTH' ). "#EC NOTEXT lo_property->set_type_edm_int32( ). lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'EasDays' iv_abap_fieldname = 'EAS_DAYS' ). "#EC NOTEXT lo_property->set_type_edm_int32( ). lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'GrowthPercentage' iv_abap_fieldname = 'GROWTH_PERCENTAGE' ). "#EC NOTEXT lo_property->set_type_edm_byte( ). lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'OsoupPercentage' iv_abap_fieldname = 'OSOUP_PERCENTAGE' ). "#EC NOTEXT lo_property->set_type_edm_byte( ). lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'BedHiderFlag' iv_abap_fieldname = 'BED_HIDER_FLAG' ). "#EC NOTEXT lo_property->set_type_edm_boolean( ). lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'SockEatingFlag' iv_abap_fieldname = 'SOCK_EATING_FLAG' ). "#EC NOTEXT lo_property->set_type_edm_boolean( ). lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'Weapon' iv_abap_fieldname = 'WEAPON' ). "#EC NOTEXT lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 20 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'CreationDate' iv_abap_fieldname = 'CREATION_DATE' ). "#EC NOTEXT lo_property->set_type_edm_datetimeoffset( ). lo_property->set_precison( iv_precision = 7 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'Lastchangedby' iv_abap_fieldname = 'LASTCHANGEDBY' ). "#EC NOTEXT lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 12 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'Lastchangedat' iv_abap_fieldname = 'LASTCHANGEDAT' ). "#EC NOTEXT lo_property->set_type_edm_datetime( ). lo_property->set_precison( iv_precision = 7 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'SanityDescription' iv_abap_fieldname = 'SANITY_DESCRIPTION' ). "#EC NOTEXT lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 30 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'HatSizeDescription' iv_abap_fieldname = 'HAT_SIZE_DESCRIPTION' ). "#EC NOTEXT lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 30 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'StrengthDescription' iv_abap_fieldname = 'STRENGTH_DESCRIPTION' ). "#EC NOTEXT lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 30 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'IngredientType' iv_abap_fieldname = 'INGREDIENT_TYPE' ). "#EC NOTEXT lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 12 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_entity_type->bind_structure( iv_structure_name = 'Z4SC_MONSTER_HEADER_EX' iv_bind_conversions = 'X' ). "#EC NOTEXT *********************************************************************************************************************************** * ENTITY SETS *********************************************************************************************************************************** lo_entity_set = lo_entity_type->create_entity_set( 'Monsters' ). "#EC NOTEXT lo_entity_set->set_creatable( abap_true ). lo_entity_set->set_updatable( abap_true ). lo_entity_set->set_deletable( abap_true ). lo_entity_set->set_pageable( abap_true ). lo_entity_set->set_addressable( abap_true ). lo_entity_set->set_has_ftxt_search( abap_true ). lo_entity_set->set_subscribable( abap_true ). lo_entity_set->set_filter_required( abap_false ). endmethod. method DEFINE_MONSTERITEM. *&---------------------------------------------------------------------* *& Generated code for the MODEL PROVIDER BASE CLASS &* *& &* *& !!!NEVER MODIFY THIS CLASS. IN CASE YOU WANT TO CHANGE THE MODEL &* *& DO THIS IN THE MODEL PROVIDER SUBCLASS!!! &* *& &* *&---------------------------------------------------------------------* data: lo_annotation type ref to /iwbep/if_mgw_odata_annotation, "#EC NEEDED lo_entity_type type ref to /iwbep/if_mgw_odata_entity_typ, "#EC NEEDED lo_complex_type type ref to /iwbep/if_mgw_odata_cmplx_type, "#EC NEEDED lo_property type ref to /iwbep/if_mgw_odata_property, "#EC NEEDED lo_entity_set type ref to /iwbep/if_mgw_odata_entity_set. "#EC NEEDED *********************************************************************************************************************************** * ENTITY - Monsteritem *********************************************************************************************************************************** lo_entity_type = model->create_entity_type( iv_entity_type_name = 'Monsteritem' iv_def_entity_set = abap_false ). "#EC NOTEXT *********************************************************************************************************************************** *Properties *********************************************************************************************************************************** lo_property = lo_entity_type->create_property( iv_property_name = 'MonsterNumber' iv_abap_fieldname = 'MONSTER_NUMBER' ). "#EC NOTEXT lo_property->set_is_key( ). lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 10 ). "#EC NOTEXT lo_property->set_conversion_exit( 'ALPHA' ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'MonsterItem' iv_abap_fieldname = 'MONSTER_ITEM' ). "#EC NOTEXT lo_property->set_is_key( ). lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 6 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'PartCategory' iv_abap_fieldname = 'PART_CATEGORY' ). "#EC NOTEXT lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 2 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'PartQuantity' iv_abap_fieldname = 'PART_QUANTITY' ). "#EC NOTEXT lo_property->set_type_edm_int32( ). lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_property = lo_entity_type->create_property( iv_property_name = 'PartDescription' iv_abap_fieldname = 'PART_DESCRIPTION' ). "#EC NOTEXT lo_property->set_type_edm_string( ). lo_property->set_maxlength( iv_max_length = 30 ). "#EC NOTEXT lo_property->set_creatable( abap_false ). lo_property->set_updatable( abap_false ). lo_property->set_sortable( abap_false ). lo_property->set_nullable( abap_false ). lo_property->set_filterable( abap_false ). lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( 'sap' )->add( EXPORTING iv_key = 'unicode' iv_value = 'false' ). lo_entity_type->bind_structure( iv_structure_name = 'Z4SC_MONSTER_ITEMS_EX' iv_bind_conversions = 'X' ). "#EC NOTEXT *********************************************************************************************************************************** * ENTITY SETS *********************************************************************************************************************************** lo_entity_set = lo_entity_type->create_entity_set( 'Monsteritems' ). "#EC NOTEXT lo_entity_set->set_creatable( abap_true ). lo_entity_set->set_updatable( abap_true ). lo_entity_set->set_deletable( abap_true ). lo_entity_set->set_pageable( abap_true ). lo_entity_set->set_addressable( abap_true ). lo_entity_set->set_has_ftxt_search( abap_true ). lo_entity_set->set_subscribable( abap_true ). lo_entity_set->set_filter_required( abap_false ). endmethod. method GET_LAST_MODIFIED. *&---------------------------------------------------------------------* *& Generated code for the MODEL PROVIDER BASE CLASS &* *& &* *& !!!NEVER MODIFY THIS CLASS. IN CASE YOU WANT TO CHANGE THE MODEL &* *& DO THIS IN THE MODEL PROVIDER SUBCLASS!!! &* *& &* *&---------------------------------------------------------------------* CONSTANTS: lc_gen_date_time TYPE timestamp VALUE '20210627071613'. "#EC NOTEXT rv_last_modified = super->get_last_modified( ). IF rv_last_modified LT lc_gen_date_time. rv_last_modified = lc_gen_date_time. ENDIF. endmethod. method LOAD_TEXT_ELEMENTS. *&---------------------------------------------------------------------* *& Generated code for the MODEL PROVIDER BASE CLASS &* *& &* *& !!!NEVER MODIFY THIS CLASS. IN CASE YOU WANT TO CHANGE THE MODEL &* *& DO THIS IN THE MODEL PROVIDER SUBCLASS!!! &* *& &* *&---------------------------------------------------------------------* DATA: ls_text_element TYPE ts_text_element. "#EC NEEDED endmethod. ENDCLASS.
48.560863
146
0.631298
c7456f910fb434d91a677b814bac7b2d1c0f52aa
7,878
abap
ABAP
src/ui/util/zcl_dbbr_query_var_starter.clas.abap
reichr-dev/abap-db-browser
d513d49692f1f0ee613c8eab2c99e325ef5b78fe
[ "MIT" ]
15
2020-02-05T10:38:12.000Z
2022-02-11T18:06:17.000Z
src/ui/util/zcl_dbbr_query_var_starter.clas.abap
reichr-dev/abap-db-browser
d513d49692f1f0ee613c8eab2c99e325ef5b78fe
[ "MIT" ]
10
2021-01-19T07:45:37.000Z
2021-07-15T19:08:54.000Z
src/ui/util/zcl_dbbr_query_var_starter.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_query_var_starter DEFINITION PUBLIC INHERITING FROM zcl_dbbr_variant_starter CREATE PUBLIC . PUBLIC SECTION. INTERFACES zif_dbbr_variant_starter. METHODS constructor IMPORTING iv_query_id TYPE string iv_variant_id TYPE zdbbr_variant_id. PROTECTED SECTION. METHODS load_variant REDEFINITION. METHODS: fill_primary_entity REDEFINITION. PRIVATE SECTION. DATA mv_query_id TYPE string. DATA mr_query_f TYPE REF TO zcl_dbbr_query_factory. DATA ms_join_def TYPE zdbbr_join_def. DATA mt_table_list TYPE zdbbr_query_data-tables. DATA ms_query TYPE zdbbr_query_data. DATA: mo_formula TYPE REF TO zcl_dbbr_formula. "! <p class="shorttext synchronized" lang="en">Handle join entities</p> "! METHODS handle_join_tables. "! <p class="shorttext synchronized" lang="en">Load the query from the database</p> "! METHODS load_query. "! <p class="shorttext synchronized" lang="en">Fill necessary information for execution</p> "! METHODS fill_secondary_data. ENDCLASS. CLASS zcl_dbbr_query_var_starter IMPLEMENTATION. METHOD constructor. super->constructor( iv_variant_id ). mv_query_id = iv_query_id. mr_query_f = NEW #( ). ENDMETHOD. METHOD handle_join_tables. *.. add fields of join table to selfields output LOOP AT ms_join_def-tables ASSIGNING FIELD-SYMBOL(<ls_join_table_info>). DATA(ls_join_entity) = VALUE zdbbr_entity_info( tabname = <ls_join_table_info>-add_table tabname_alias = <ls_join_table_info>-add_table_alias alias = <ls_join_table_info>-add_table_alias_alv virtual_join_table = <ls_join_table_info>-is_virtual selection_order = VALUE #( mt_table_list[ tabname_alias = <ls_join_table_info>-add_table_alias ]-selection_order OPTIONAL ) ). IF <ls_join_table_info>-entity_type = ZIF_SAT_C_ENTITY_TYPE=>cds_view. create_cds_fields( ls_join_entity ). ELSE. create_table_fields( ls_join_entity ). ENDIF. ENDLOOP. mo_tabfield_list->update_tables( ). mo_tabfield_list->update_alias_names( ). ENDMETHOD. METHOD load_variant. IF mv_variant_id = zif_dbbr_c_global=>c_dummy_variant. *.... Check if there is a default variant for the query DATA(lv_default_variant_id) = zcl_dbbr_variant_factory=>find_default_query_variant( iv_query_id = ms_query-query_id ). IF lv_default_variant_id IS NOT INITIAL. mv_variant_id = lv_default_variant_id. ENDIF. ENDIF. super->load_variant( ). ENDMETHOD. METHOD fill_primary_entity. DATA(ls_entity) = VALUE zdbbr_entity_info( active_selection = abap_true tabname = ms_query-primary_table tabname_alias = ms_query-primary_table_alias type = ms_query-entity_type selection_order = VALUE #( mt_table_list[ tabname_alias = ms_query-primary_table_alias ]-selection_order OPTIONAL ) fields_are_loaded = abap_true is_primary = abap_true ). IF ms_query-entity_type = ZIF_SAT_C_ENTITY_TYPE=>cds_view. create_cds_fields( ls_entity ). ELSE. create_table_fields( ls_entity ). ENDIF. ENDMETHOD. METHOD fill_secondary_data. IF ms_join_def IS NOT INITIAL. handle_join_tables( ). ENDIF. mo_tabfield_list->clear_active_flag( if_clear_selection = abap_true if_clear_sort = ms_query-has_sort_fields if_clear_output = ms_query-has_output_fields ). " update selection fields from query mo_tabfield_list->initialize_iterator( ). WHILE mo_tabfield_list->has_more_lines( ). DATA(lr_current_field) = mo_tabfield_list->get_next_entry( ). ASSIGN ms_query-fields[ tabname_alias = lr_current_field->tabname_alias fieldname = lr_current_field->fieldname is_text_field = lr_current_field->is_text_field ] TO FIELD-SYMBOL(<ls_query_selfield>). IF sy-subrc = 0. lr_current_field->selection_active = <ls_query_selfield>-selection_active. lr_current_field->selection_order = <ls_query_selfield>-selection_order. lr_current_field->output_active = <ls_query_selfield>-output_active. lr_current_field->output_order = <ls_query_selfield>-output_order. lr_current_field->sort_active = <ls_query_selfield>-sort_active. lr_current_field->sort_order = <ls_query_selfield>-sort_order. lr_current_field->sort_direction = <ls_query_selfield>-sort_direction. ENDIF. ENDWHILE. IF ms_query-formula IS NOT INITIAL. TRY. mo_formula = NEW zcl_dbbr_fe_validator( iv_formula = ms_query-formula io_tabfields = mo_tabfield_list )->validate( ). zcl_dbbr_formula_helper=>update_tabflds_from_formula( ir_tabfields = mo_tabfield_list ir_formula = mo_formula it_form_selfields = ms_query-fields ). CATCH zcx_dbbr_formula_exception. mo_tabfield_list->clear_calculation_flag( ). mo_tabfield_list->delete_formula_fields( ). CLEAR ms_query-formula. ENDTRY. ENDIF. ENDMETHOD. METHOD load_query. *.. load query from database ms_query = COND #( WHEN mv_variant_id = zif_dbbr_c_global=>c_dummy_variant THEN mr_query_f->get_query( iv_query_name = CONV #( mv_query_id ) ) ELSE mr_query_f->get_query_by_id( CONV #( mv_query_id ) ) ). ms_join_def = ms_query-join_def. mt_table_list = ms_query-tables. ENDMETHOD. METHOD zif_dbbr_variant_starter~execute_variant. show_start_progress_text( ). fill_data_from_variant( ). get_tabfields( IMPORTING er_tabfields = DATA(lr_tabfields) er_tabfields_all = DATA(lr_tabfields_all) ). " create and start selection controller DATA(lr_controller) = zcl_dbbr_selection_controller=>create_controller( VALUE #( entity_type = zif_dbbr_c_selscreen_mode=>query entity_id = ms_query-query_name selection_fields = mt_selfields multi_or = mt_selfields_or technical_infos = CORRESPONDING #( ms_global_data ) grouping_minimum = ms_global_data-grouping_minimum selfields_multi = mt_selfields_multi tabfields = lr_tabfields tabfields_all = lr_tabfields_all join_def = ms_join_def exclude_function = VALUE #( ( zif_dbbr_c_selection_functions=>leave_screen_with_layout ) ( zif_dbbr_c_selection_functions=>transfer_filter_values ) ) formula = COND #( WHEN mo_formula IS BOUND AND mo_formula->has_executable_code( ) THEN mo_formula ) ) ). rf_no_data = lr_controller->execute_selection( ). ENDMETHOD. METHOD zif_dbbr_variant_starter~initialize. load_query( ). fill_primary_entity( ). fill_secondary_data( ). load_variant( ). IF mv_variant_id <> zif_dbbr_c_global=>c_dummy_variant OR ms_global_data-called_from_adt = abap_true. IF ms_global_data-called_from_adt = abap_true. zcl_dbbr_usersettings_factory=>update_start_settings( iv_entity_id = ms_query-query_name iv_entity_type = ZIF_SAT_C_ENTITY_TYPE=>query ). ENDIF. NEW zcl_dbbr_favmenu_factory( )->refresh_most_used( iv_entry = ms_query-query_name iv_entry_raw = ms_query-query_name iv_type = zif_dbbr_c_favmenu_type=>query iv_text = ms_query-description ). ENDIF. ENDMETHOD. ENDCLASS.
34.401747
134
0.676187
c745a00fff15c8afe744c807da4e9f785bb6b6d8
5,114
abap
ABAP
src/zabaplint_list_deps.prog.abap
ed-holland/abaplint-abap-backend
4ea4188f87bcc6a5f4dd2dc2c6d614c76a08fea2
[ "MIT" ]
16
2020-09-04T14:21:30.000Z
2022-02-16T11:28:18.000Z
src/zabaplint_list_deps.prog.abap
ed-holland/abaplint-abap-backend
4ea4188f87bcc6a5f4dd2dc2c6d614c76a08fea2
[ "MIT" ]
149
2020-07-11T06:21:27.000Z
2022-02-19T06:49:00.000Z
src/zabaplint_list_deps.prog.abap
ed-holland/abaplint-abap-backend
4ea4188f87bcc6a5f4dd2dc2c6d614c76a08fea2
[ "MIT" ]
15
2020-07-16T21:39:09.000Z
2022-01-01T18:46:10.000Z
REPORT zabaplint_list_deps. * This report depends on the cross reference generated automatically in SAP * * In case it you think there is an issue, run these reports in background: * - SAPRSEUB for SAP objects * - SAPRSEUC for Customer objects (Y*/Z*) * * Also to ensure that the repository is kept clean, run the abap SAPRSEUJ * it schedules the jobs required * * OSS # 2752795 - Environment analysis progams and classes - use of BAdI definitions * OSS # 2243139 - REPOSITORY_ENVIRONMENT_ALL - too few hits for enhancement implementations TABLES: tdevc. SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE TEXT-001. PARAMETERS: p_obje RADIOBUTTON GROUP g2. PARAMETERS: p_type TYPE tadir-object, p_name TYPE tadir-obj_name. PARAMETERS: p_devc RADIOBUTTON GROUP g2. SELECT-OPTIONS: s_devc FOR tdevc-devclass. SELECTION-SCREEN: END OF BLOCK b1. SELECTION-SCREEN: BEGIN OF BLOCK b2 WITH FRAME TITLE TEXT-002. PARAMETERS: p_depth TYPE i DEFAULT 10, p_sap TYPE c AS CHECKBOX, p_cache TYPE c AS CHECKBOX. SELECTION-SCREEN SKIP. PARAMETERS: p_skip RADIOBUTTON GROUP g1, p_seri RADIOBUTTON GROUP g1, p_down RADIOBUTTON GROUP g1. SELECTION-SCREEN SKIP. PARAMETERS: p_log TYPE c AS CHECKBOX. SELECTION-SCREEN: END OF BLOCK b2. START-OF-SELECTION. PERFORM run. FORM run RAISING cx_static_check. DATA lo_find TYPE REF TO zcl_abaplint_deps_find. DATA lt_deps TYPE zif_abapgit_definitions=>ty_tadir_tt. DATA lv_package TYPE devclass. DATA lt_packages TYPE tr_devclasses. DATA ls_deps LIKE LINE OF lt_deps. DATA lv_lines TYPE i. DATA lx_error TYPE REF TO zcx_abaplint_error. DATA lx_error2 TYPE REF TO zcx_abapgit_exception. DATA ls_options TYPE zcl_abaplint_deps_find=>ty_options. DATA li_log TYPE REF TO zif_abapgit_log. DATA lo_cache TYPE REF TO zcl_abaplint_deps_cache. ls_options-depth = p_depth. ls_options-conti = p_sap. ls_options-cache = p_cache. CREATE OBJECT lo_find EXPORTING is_options = ls_options. TRY. CASE abap_true. WHEN p_obje. lt_deps = lo_find->find_by_item( iv_object_type = p_type iv_object_name = p_name ). WHEN p_devc. SELECT devclass FROM tdevc INTO TABLE lt_packages WHERE devclass IN s_devc. IF sy-subrc = 0. lt_deps = lo_find->find_by_packages( lt_packages ). ENDIF. WHEN OTHERS. ASSERT 0 = 1. ENDCASE. CATCH zcx_abaplint_error INTO lx_error. MESSAGE lx_error->message TYPE 'E'. CATCH zcx_abapgit_exception INTO lx_error2. MESSAGE lx_error2 TYPE 'E'. ENDTRY. li_log = lo_find->get_log( ). li_log->set_title( sy-title ). IF li_log->count( ) > 0 AND p_log = abap_true. zcl_abapgit_log_viewer=>show_log( li_log ). ENDIF. FORMAT INTENSIFIED OFF. LOOP AT lt_deps INTO ls_deps. WRITE: / ls_deps-object, ls_deps-obj_name, ls_deps-devclass. ENDLOOP. PERFORM serialize USING lt_deps ls_options. lo_cache = zcl_abaplint_deps_cache=>get_instance( ls_options-cache ). lo_cache->save( ). ULINE. lv_lines = lines( lt_deps ). FORMAT INTENSIFIED ON. IF p_obje = abap_true. WRITE: / 'Found', lv_lines, 'dependencies for', p_type, p_name. ELSE. WRITE: / 'Found', lv_lines, 'dependencies for the following packages:'. LOOP AT lt_packages INTO lv_package. WRITE: AT /5 lv_package. ENDLOOP. ENDIF. FORMAT INTENSIFIED OFF. ULINE. ENDFORM. FORM serialize USING pt_deps TYPE zif_abapgit_definitions=>ty_tadir_tt ps_options TYPE zcl_abaplint_deps_find=>ty_options RAISING zcx_abapgit_exception. DATA lt_local TYPE zif_abapgit_definitions=>ty_files_tt. DATA lo_dep_ser TYPE REF TO zcl_abaplint_deps_serializer. DATA lx_error2 TYPE REF TO zcx_abapgit_exception. IF p_skip = abap_true. RETURN. ENDIF. IF p_down = abap_true OR p_seri = abap_true. CREATE OBJECT lo_dep_ser EXPORTING is_options = ps_options. TRY. lt_local = lo_dep_ser->serialize( pt_deps ). CATCH zcx_abapgit_exception INTO lx_error2. MESSAGE lx_error2 TYPE 'E'. ENDTRY. ENDIF. IF p_down = abap_true. PERFORM download USING lt_local. ENDIF. ENDFORM. FORM download USING pt_local TYPE zif_abapgit_definitions=>ty_files_tt RAISING zcx_abapgit_exception. DATA: lo_zip TYPE REF TO cl_abap_zip, lv_xstr TYPE xstring, lv_path TYPE string, lv_filename TYPE string. FIELD-SYMBOLS: <ls_file> LIKE LINE OF pt_local. lv_path = zcl_abapgit_ui_factory=>get_frontend_services( )->show_file_save_dialog( iv_title = 'Save' iv_extension = 'zip' iv_default_filename = 'dependencies.zip' ). CREATE OBJECT lo_zip. LOOP AT pt_local ASSIGNING <ls_file>. CONCATENATE <ls_file>-path+1 <ls_file>-filename INTO lv_filename. lo_zip->add( name = lv_filename content = <ls_file>-data ). ENDLOOP. lv_xstr = lo_zip->save( ). zcl_abapgit_ui_factory=>get_frontend_services( )->file_download( iv_path = lv_path iv_xstr = lv_xstr ). ENDFORM.
29.560694
101
0.713727
c74b17e1198c43039a1b63fcf3204935a9f6cbb8
8,628
abap
ABAP
src/objects/zcl_abapgit_object_sxci.clas.abap
timbolski/downport
c5fa01ed27c8265606d7a67832d64164d1769c79
[ "MIT" ]
3
2020-05-31T18:55:42.000Z
2021-01-08T21:36:09.000Z
src/objects/zcl_abapgit_object_sxci.clas.abap
timbolski/downport
c5fa01ed27c8265606d7a67832d64164d1769c79
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_sxci.clas.abap
timbolski/downport
c5fa01ed27c8265606d7a67832d64164d1769c79
[ "MIT" ]
2
2021-01-08T21:36:15.000Z
2022-03-29T05:40:00.000Z
CLASS zcl_abapgit_object_sxci DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL. PUBLIC SECTION. INTERFACES zif_abapgit_object. PROTECTED SECTION. PRIVATE SECTION. TYPES: BEGIN OF ty_classic_badi_implementation, implementation_data TYPE impl_data, function_codes TYPE seex_fcode_table, control_composites TYPE seex_coco_table, customer_includes TYPE seex_table_table, screens TYPE seex_screen_table, filters TYPE seex_filter_table, END OF ty_classic_badi_implementation. ENDCLASS. CLASS zcl_abapgit_object_sxci IMPLEMENTATION. METHOD zif_abapgit_object~changed_by. SELECT SINGLE uname FROM sxc_attr INTO rv_user WHERE imp_name = ms_item-obj_name. IF sy-subrc <> 0. rv_user = c_user_unknown. ENDIF. ENDMETHOD. METHOD zif_abapgit_object~delete. DATA: lv_implementation_name TYPE rsexscrn-imp_name. lv_implementation_name = ms_item-obj_name. CALL FUNCTION 'SXO_IMPL_DELETE' EXPORTING imp_name = lv_implementation_name no_dialog = abap_true EXCEPTIONS imp_not_existing = 1 action_canceled = 2 access_failure = 3 data_inconsistency = 4 OTHERS = 5. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDMETHOD. METHOD zif_abapgit_object~deserialize. DATA: ls_badi_definition TYPE badi_data, lo_filter_object TYPE REF TO cl_badi_flt_struct, lo_filter_values_object TYPE REF TO cl_badi_flt_values_alv, lv_korrnum TYPE trkorr, lv_filter_type_enhanceability TYPE rsexscrn-flt_ext, lv_package TYPE devclass, ls_classic_badi_implementation TYPE ty_classic_badi_implementation. io_xml->read( EXPORTING iv_name = 'SXCI' CHANGING cg_data = ls_classic_badi_implementation ). CALL FUNCTION 'SXO_BADI_READ' EXPORTING exit_name = ls_classic_badi_implementation-implementation_data-exit_name IMPORTING badi = ls_badi_definition filter_obj = lo_filter_object EXCEPTIONS read_failure = 1 OTHERS = 2. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. lv_package = iv_package. CREATE OBJECT lo_filter_values_object EXPORTING filter_object = lo_filter_object filter_values = ls_classic_badi_implementation-filters. CALL FUNCTION 'SXO_IMPL_SAVE' EXPORTING impl = ls_classic_badi_implementation-implementation_data flt_ext = lv_filter_type_enhanceability filter_val_obj = lo_filter_values_object genflag = abap_true no_dialog = abap_true TABLES fcodes_to_insert = ls_classic_badi_implementation-function_codes cocos_to_insert = ls_classic_badi_implementation-control_composites intas_to_insert = ls_classic_badi_implementation-customer_includes sscrs_to_insert = ls_classic_badi_implementation-screens CHANGING korrnum = lv_korrnum devclass = lv_package EXCEPTIONS save_failure = 1 action_canceled = 2 OTHERS = 3. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. CALL FUNCTION 'SXO_IMPL_ACTIVE' EXPORTING imp_name = ls_classic_badi_implementation-implementation_data-imp_name no_dialog = abap_true EXCEPTIONS badi_not_existing = 1 imp_not_existing = 2 already_active = 3 data_inconsistency = 4 activation_not_admissable = 5 action_canceled = 6 access_failure = 7 OTHERS = 8. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDMETHOD. METHOD zif_abapgit_object~exists. DATA: lv_implementation_name TYPE rsexscrn-imp_name. lv_implementation_name = ms_item-obj_name. CALL FUNCTION 'SXV_IMP_EXISTS' EXPORTING imp_name = lv_implementation_name EXCEPTIONS not_existing = 1 data_inconsistency = 2 OTHERS = 3. rv_bool = boolc( sy-subrc = 0 ). ENDMETHOD. METHOD zif_abapgit_object~get_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( ). "Note: SAP does not show inactive classic BAdIs as "Inactive objects" in SE80 "Therefore, rv_active will always be true. The implementation state (runtime "behaviour of the BAdI) will be serialized as part of the XML ENDMETHOD. METHOD zif_abapgit_object~is_locked. rv_is_locked = abap_false. ENDMETHOD. METHOD zif_abapgit_object~jump. " Covered by ZCL_ABAPGIT_OBJECTS=>JUMP ENDMETHOD. METHOD zif_abapgit_object~serialize. DATA: lv_implementation_name TYPE rsexscrn-imp_name, lv_exit_name TYPE rsexscrn-exit_name, lo_filter_object TYPE REF TO cl_badi_flt_struct, ls_badi_definition TYPE badi_data, lo_filter_values_object TYPE REF TO cl_badi_flt_values_alv, lt_methods TYPE seex_mtd_table, ls_classic_badi_implementation TYPE ty_classic_badi_implementation. lv_implementation_name = ms_item-obj_name. CALL FUNCTION 'SXV_EXIT_FOR_IMP' EXPORTING imp_name = lv_implementation_name IMPORTING exit_name = lv_exit_name TABLES filters = ls_classic_badi_implementation-filters EXCEPTIONS data_inconsistency = 1 OTHERS = 2. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. CALL FUNCTION 'SXO_BADI_READ' EXPORTING exit_name = lv_exit_name IMPORTING badi = ls_badi_definition filter_obj = lo_filter_object TABLES fcodes = ls_classic_badi_implementation-function_codes cocos = ls_classic_badi_implementation-control_composites intas = ls_classic_badi_implementation-customer_includes scrns = ls_classic_badi_implementation-screens methods = lt_methods EXCEPTIONS read_failure = 1 OTHERS = 2. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. CALL FUNCTION 'SXO_IMPL_FOR_BADI_READ' EXPORTING imp_name = lv_implementation_name exit_name = lv_exit_name inter_name = ls_badi_definition-inter_name filter_obj = lo_filter_object no_create_filter_values_obj = abap_true IMPORTING impl = ls_classic_badi_implementation-implementation_data filter_values_obj = lo_filter_values_object TABLES fcodes = ls_classic_badi_implementation-function_codes cocos = ls_classic_badi_implementation-control_composites intas = ls_classic_badi_implementation-customer_includes scrns = ls_classic_badi_implementation-screens CHANGING methods = lt_methods EXCEPTIONS read_failure = 1 OTHERS = 2. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. CLEAR: ls_classic_badi_implementation-implementation_data-aname, ls_classic_badi_implementation-implementation_data-adate, ls_classic_badi_implementation-implementation_data-atime, ls_classic_badi_implementation-implementation_data-uname, ls_classic_badi_implementation-implementation_data-udate, ls_classic_badi_implementation-implementation_data-utime. io_xml->add( iv_name = 'SXCI' ig_data = ls_classic_badi_implementation ). ENDMETHOD. ENDCLASS.
31.26087
107
0.635141
c752e867ce295b5d0bf90910238e681ea4da8f57
16,734
abap
ABAP
src/ZCA_ZCX_RETURN3_TEMPLATES.abap
beedy01/zcx_return3
f508cff7e30abb2dd9ce9c76470a6a6d799ccaa1
[ "MIT" ]
null
null
null
src/ZCA_ZCX_RETURN3_TEMPLATES.abap
beedy01/zcx_return3
f508cff7e30abb2dd9ce9c76470a6a6d799ccaa1
[ "MIT" ]
null
null
null
src/ZCA_ZCX_RETURN3_TEMPLATES.abap
beedy01/zcx_return3
f508cff7e30abb2dd9ce9c76470a6a6d799ccaa1
[ "MIT" ]
null
null
null
REPORT zca_zcx_return3_unit_test. * *CLASS zcx_return3 DEFINITION * INHERITING FROM zcx_return3. * *ENDCLASS. CLASS unit_test DEFINITION FOR TESTING RISK LEVEL HARMLESS. PRIVATE SECTION. METHODS get_test_data_bapiret2_1_struc RETURNING VALUE(rs_exp_bapiret2) TYPE bapiret2. METHODS get_test_data_bapiret2_1_tab RETURNING VALUE(rt_exp_bapiret2) TYPE bapiret2_t. METHODS get_bapiret2_00_059_struc RETURNING VALUE(rs_exp_bapiret2) TYPE bapiret2. METHODS get_bapiret2_00_060_struc IMPORTING iv_type TYPE bapi_mtype RETURNING VALUE(rs_exp_bapiret2) TYPE bapiret2. METHODS get_test_data_bapiret2_2_tab RETURNING VALUE(rt_exp_bapiret2) TYPE bapiret2_t. METHODS get_test_data_bapiret2_3_tab RETURNING VALUE(rt_exp_bapiret2) TYPE bapiret2_t. * METHODS sc010_create_system_message FOR TESTING. METHODS sc020_create_system_message_2 FOR TESTING. METHODS sc095_create_by_oo_exception FOR TESTING. METHODS sc030_create_mess_and_text_var FOR TESTING. METHODS sc040_create_bapireturn_struc FOR TESTING. METHODS sc050_create_bapireturn_table FOR TESTING. METHODS sc060_create_by_bapiret1_struc FOR TESTING. METHODS sc070_create_by_bapiret1_table FOR TESTING. METHODS sc080_create_by_bapiret2_struc FOR TESTING. METHODS sc090_create_by_bapiret2_table FOR TESTING. METHODS sc091_create_by_bapiret2_table FOR TESTING. **CREATE_BY_BDC_TABLE METHODS sc100_create_by_text FOR TESTING. "Do not use ENDCLASS. CLASS unit_test IMPLEMENTATION. METHOD get_test_data_bapiret2_1_struc. rs_exp_bapiret2 = VALUE #( type = 'E' id = '00' number = '058' message = 'Entry 1 2 3 does not exist in 4 (check entry)' message_v1 = '1' message_v2 = '2' message_v3 = '3' message_v4 = '4' ). ENDMETHOD. METHOD get_test_data_bapiret2_1_tab. DATA(ls_exp_bapiret2) = get_test_data_bapiret2_1_struc( ). APPEND ls_exp_bapiret2 TO rt_exp_bapiret2. ENDMETHOD. METHOD get_bapiret2_00_059_struc. rs_exp_bapiret2 = VALUE #( type = 'E' id = '00' number = '059' message = '' message_v1 = '' message_v2 = '' message_v3 = '' message_v4 = '' ). MESSAGE ID rs_exp_bapiret2-id TYPE rs_exp_bapiret2-type NUMBER rs_exp_bapiret2-number WITH rs_exp_bapiret2-message_v1 rs_exp_bapiret2-message_v2 rs_exp_bapiret2-message_v3 rs_exp_bapiret2-message_v4 INTO rs_exp_bapiret2-message. ENDMETHOD. METHOD get_bapiret2_00_060_struc. rs_exp_bapiret2 = VALUE #( type = iv_type id = '00' number = '060' message = '' message_v1 = '' message_v2 = '' message_v3 = '' message_v4 = '' ). MESSAGE ID rs_exp_bapiret2-id TYPE rs_exp_bapiret2-type NUMBER rs_exp_bapiret2-number WITH rs_exp_bapiret2-message_v1 rs_exp_bapiret2-message_v2 rs_exp_bapiret2-message_v3 rs_exp_bapiret2-message_v4 INTO rs_exp_bapiret2-message. ENDMETHOD. METHOD get_test_data_bapiret2_2_tab. rt_exp_bapiret2 = get_test_data_bapiret2_1_tab( ). DATA(ls_exp_bapiret2) = get_bapiret2_00_059_struc( ). APPEND ls_exp_bapiret2 TO rt_exp_bapiret2. ENDMETHOD. METHOD get_test_data_bapiret2_3_tab. DATA ls_exp_bapiret2 TYPE bapiret2. ls_exp_bapiret2 = get_bapiret2_00_060_struc( 'S' ). APPEND ls_exp_bapiret2 TO rt_exp_bapiret2. ls_exp_bapiret2 = get_test_data_bapiret2_1_struc( ). APPEND ls_exp_bapiret2 TO rt_exp_bapiret2. ls_exp_bapiret2 = get_bapiret2_00_060_struc( 'I' ). APPEND ls_exp_bapiret2 TO rt_exp_bapiret2. ls_exp_bapiret2 = get_bapiret2_00_060_struc( 'S' ). APPEND ls_exp_bapiret2 TO rt_exp_bapiret2. ls_exp_bapiret2 = get_bapiret2_00_059_struc( ). APPEND ls_exp_bapiret2 TO rt_exp_bapiret2. ls_exp_bapiret2 = get_bapiret2_00_060_struc( 'S' ). APPEND ls_exp_bapiret2 TO rt_exp_bapiret2. ENDMETHOD. METHOD sc010_create_system_message. DATA(lt_exp_bapiret2) = get_test_data_bapiret2_1_tab( ). TRY. "******************************************************** "Create message: Tag '&1' may not be nested in tag '&2' RAISE EXCEPTION TYPE zcx_return3 MESSAGE e058(00) WITH '1' '2' '3' '4'. CATCH zcx_return3 INTO DATA(lx_return). DATA(lt_act_bapiret2) = lx_return->get_bapiret2_table( ). cl_abap_unit_assert=>assert_equals( act = lt_act_bapiret2 exp = lt_exp_bapiret2 ). DATA(lv_text) = lx_return->get_text( ). cl_abap_unit_assert=>assert_equals( act = lv_text exp = lt_act_bapiret2[ 1 ]-message ). "******************************************************** "Add message: The input value is too big (maximum 255) "Expected DATA(ls_exp_bapiret2) = get_bapiret2_00_059_struc( ). APPEND ls_exp_bapiret2 TO lt_exp_bapiret2. "Actual MESSAGE e059(00) INTO DATA(lv_dummy_2). lx_return->add_system_message( ). lt_act_bapiret2 = lx_return->get_bapiret2_table( ). cl_abap_unit_assert=>assert_equals( act = lt_act_bapiret2 exp = lt_exp_bapiret2 ). ENDTRY. ENDMETHOD. METHOD sc020_create_system_message_2. MESSAGE i058(00) WITH '1' '2' '3' '4' INTO DATA(lv_dummy). DATA(lx_return) = NEW zcx_return3( ). lx_return->add_system_message( ). IF lx_return->has_messages( ) = abap_true. cl_abap_unit_assert=>fail( msg = 'It should not contain messages' ). ENDIF. MESSAGE s058(00) WITH '1' '2' '3' '4' INTO DATA(lv_dummy2). lx_return->add_system_message( ). IF lx_return->has_messages( ) = abap_true. cl_abap_unit_assert=>fail( msg = 'It should not contain messages' ). ENDIF. ENDMETHOD. METHOD sc030_create_mess_and_text_var. "Expected data DATA(ls_exp_bapiret2) = VALUE bapiret2( type = 'E' id = '00' number = '081' message = 'Entry 1 2 3 does not exist in 4 (check entry)' message_v1 = 'V1:45678901234567890123456789012345678901234567890' message_v2 = 'V2:45678901234567890123456789012345678901234567890' message_v3 = 'V3:45678901234567890123456789012345678901234567890' message_v4 = 'V4:45678901234567890123456789012345678901234567890' ). MESSAGE ID ls_exp_bapiret2-id TYPE ls_exp_bapiret2-type NUMBER ls_exp_bapiret2-number WITH ls_exp_bapiret2-message_v1 ls_exp_bapiret2-message_v2 ls_exp_bapiret2-message_v3 ls_exp_bapiret2-message_v4 INTO ls_exp_bapiret2-message. DATA lt_exp_bapiret2 TYPE bapiret2_t. APPEND ls_exp_bapiret2 TO lt_exp_bapiret2. "Call data DATA lv_char_200 TYPE char200. lv_char_200 = ls_exp_bapiret2-message_v1 && ls_exp_bapiret2-message_v2 && ls_exp_bapiret2-message_v3 && ls_exp_bapiret2-message_v4. DATA(lx_return) = NEW zcx_return3( ). lx_return->add_message_and_text_var( iv_type = ls_exp_bapiret2-type iv_id = ls_exp_bapiret2-id iv_number = ls_exp_bapiret2-number iv_text_variable = lv_char_200 ). "Actual data DATA(lt_act_bapiret2) = lx_return->get_bapiret2_table( ). cl_abap_unit_assert=>assert_equals( act = lt_act_bapiret2 exp = lt_exp_bapiret2 ). ENDMETHOD. METHOD sc040_create_bapireturn_struc. DATA(lt_exp_bapiret2) = get_test_data_bapiret2_1_tab( ). DATA(ls_exp_bapiret2) = lt_exp_bapiret2[ 1 ]. DATA ls_bapireturn TYPE bapireturn. ls_bapireturn = VALUE #( type = ls_exp_bapiret2-type code = ls_exp_bapiret2-id && ls_exp_bapiret2-number message = ls_exp_bapiret2-message log_no = ls_exp_bapiret2-log_no log_msg_no = ls_exp_bapiret2-log_msg_no message_v1 = ls_exp_bapiret2-message_v1 message_v2 = ls_exp_bapiret2-message_v2 message_v3 = ls_exp_bapiret2-message_v3 message_v4 = ls_exp_bapiret2-message_v4 ). DATA(lx_return) = NEW zcx_return3( ). lx_return->add_bapireturn_struc( ls_bapireturn ). IF lx_return->has_messages( ) = abap_false. cl_abap_unit_assert=>fail( msg = 'It should contain messages' ). ENDIF. DATA(lt_act_bapiret2) = lx_return->get_bapiret2_table( ). cl_abap_unit_assert=>assert_equals( act = lt_act_bapiret2 exp = lt_exp_bapiret2 ). DATA(lv_text) = lx_return->get_text( ). cl_abap_unit_assert=>assert_equals( act = lv_text exp = lt_exp_bapiret2[ 1 ]-message ). ENDMETHOD. METHOD sc050_create_bapireturn_table. DATA(lt_exp_bapiret2) = get_test_data_bapiret2_2_tab( ). DATA lt_bapireturn TYPE STANDARD TABLE OF bapireturn. LOOP AT lt_exp_bapiret2 ASSIGNING FIELD-SYMBOL(<ls_exp_bapiret2>). DATA ls_bapireturn TYPE bapireturn. ls_bapireturn = VALUE #( type = <ls_exp_bapiret2>-type code = <ls_exp_bapiret2>-id && <ls_exp_bapiret2>-number message = <ls_exp_bapiret2>-message log_no = <ls_exp_bapiret2>-log_no log_msg_no = <ls_exp_bapiret2>-log_msg_no message_v1 = <ls_exp_bapiret2>-message_v1 message_v2 = <ls_exp_bapiret2>-message_v2 message_v3 = <ls_exp_bapiret2>-message_v3 message_v4 = <ls_exp_bapiret2>-message_v4 ). APPEND ls_bapireturn TO lt_bapireturn. ENDLOOP. DATA(lx_return) = NEW zcx_return3( ). lx_return->add_bapireturn_table( lt_bapireturn ). DATA(lt_act_bapiret2) = lx_return->get_bapiret2_table( ). cl_abap_unit_assert=>assert_equals( act = lt_act_bapiret2 exp = lt_exp_bapiret2 ). DATA(ls_act_bapiret2) = lx_return->get_bapiret2_struc( ). DATA(ls_exp_bapiret2) = lt_exp_bapiret2[ 1 ]. cl_abap_unit_assert=>assert_equals( act = ls_act_bapiret2 exp = ls_exp_bapiret2 ). ENDMETHOD. METHOD sc060_create_by_bapiret1_struc. DATA(lt_exp_bapiret2) = get_test_data_bapiret2_1_tab( ). DATA(ls_exp_bapiret2) = lt_exp_bapiret2[ 1 ]. DATA ls_bapiret1 TYPE bapiret1. ls_bapiret1 = VALUE #( type = ls_exp_bapiret2-type id = ls_exp_bapiret2-id number = ls_exp_bapiret2-number message = ls_exp_bapiret2-message log_no = ls_exp_bapiret2-log_no log_msg_no = ls_exp_bapiret2-log_msg_no message_v1 = ls_exp_bapiret2-message_v1 message_v2 = ls_exp_bapiret2-message_v2 message_v3 = ls_exp_bapiret2-message_v3 message_v4 = ls_exp_bapiret2-message_v4 ). DATA(lx_return) = NEW zcx_return3( ). lx_return->add_bapiret1_struc( ls_bapiret1 ). DATA(lt_act_bapiret2) = lx_return->get_bapiret2_table( ). cl_abap_unit_assert=>assert_equals( act = lt_act_bapiret2 exp = lt_exp_bapiret2 ). ENDMETHOD. METHOD sc070_create_by_bapiret1_table. DATA(lt_exp_bapiret2) = get_test_data_bapiret2_2_tab( ). DATA lt_bapiret1 TYPE STANDARD TABLE OF bapiret1. LOOP AT lt_exp_bapiret2 ASSIGNING FIELD-SYMBOL(<ls_exp_bapiret2>). DATA ls_bapiret1 TYPE bapiret1. ls_bapiret1 = VALUE #( type = <ls_exp_bapiret2>-type id = <ls_exp_bapiret2>-id number = <ls_exp_bapiret2>-number message = <ls_exp_bapiret2>-message log_no = <ls_exp_bapiret2>-log_no log_msg_no = <ls_exp_bapiret2>-log_msg_no message_v1 = <ls_exp_bapiret2>-message_v1 message_v2 = <ls_exp_bapiret2>-message_v2 message_v3 = <ls_exp_bapiret2>-message_v3 message_v4 = <ls_exp_bapiret2>-message_v4 ). APPEND ls_bapiret1 TO lt_bapiret1. ENDLOOP. DATA(lx_return) = NEW zcx_return3( ). lx_return->add_bapiret1_table( lt_bapiret1 ). DATA(lt_act_bapiret2) = lx_return->get_bapiret2_table( ). cl_abap_unit_assert=>assert_equals( act = lt_act_bapiret2 exp = lt_exp_bapiret2 ). DATA(ls_act_bapiret2) = lx_return->get_bapiret2_struc( ). DATA(ls_exp_bapiret2) = lt_exp_bapiret2[ 1 ]. cl_abap_unit_assert=>assert_equals( act = ls_act_bapiret2 exp = ls_exp_bapiret2 ). ENDMETHOD. METHOD sc080_create_by_bapiret2_struc. DATA(lt_exp_bapiret2) = get_test_data_bapiret2_1_tab( ). DATA(ls_exp_bapiret2) = lt_exp_bapiret2[ 1 ]. DATA(lx_return) = NEW zcx_return3( ). lx_return->add_bapiret2_struc( ls_exp_bapiret2 ). DATA(lt_act_bapiret2) = lx_return->get_bapiret2_table( ). cl_abap_unit_assert=>assert_equals( act = lt_act_bapiret2 exp = lt_exp_bapiret2 ). ENDMETHOD. METHOD sc090_create_by_bapiret2_table. DATA(lt_exp_bapiret2) = get_test_data_bapiret2_2_tab( ). DATA(lx_return) = NEW zcx_return3( ). lx_return->add_bapiret2_table( lt_exp_bapiret2 ). DATA(lt_act_bapiret2) = lx_return->get_bapiret2_table( ). cl_abap_unit_assert=>assert_equals( act = lt_act_bapiret2 exp = lt_exp_bapiret2 ). DATA(ls_act_bapiret2) = lx_return->get_bapiret2_struc( ). DATA(ls_exp_bapiret2) = lt_exp_bapiret2[ 1 ]. cl_abap_unit_assert=>assert_equals( act = ls_act_bapiret2 exp = ls_exp_bapiret2 ). DATA(lv_act_text) = lx_return->get_text( ). cl_abap_unit_assert=>assert_equals( act = lv_act_text exp = ls_exp_bapiret2-message ). ENDMETHOD. METHOD sc091_create_by_bapiret2_table. DATA(lt_exp_bapiret2) = get_test_data_bapiret2_2_tab( ). DATA(lt_data_bapiret2) = get_test_data_bapiret2_3_tab( ). DATA(lx_return) = NEW zcx_return3( ). lx_return->add_bapiret2_table( lt_data_bapiret2 ). DATA(lt_act_bapiret2) = lx_return->get_bapiret2_table( ). cl_abap_unit_assert=>assert_equals( act = lt_act_bapiret2 exp = lt_exp_bapiret2 ). DATA(ls_act_bapiret2) = lx_return->get_bapiret2_struc( ). DATA(ls_exp_bapiret2) = lt_exp_bapiret2[ 1 ]. cl_abap_unit_assert=>assert_equals( act = ls_act_bapiret2 exp = ls_exp_bapiret2 ). ENDMETHOD. METHOD sc095_create_by_oo_exception. TRY. TRY. RAISE EXCEPTION TYPE cx_aab_object. CATCH cx_root INTO DATA(lx_root). "TODO: change exception class "<Short error name>: &1 &2 &3 &4 MESSAGE e001(00) "Todo: change error number INTO DATA(lv_dummy). "Method will split message text into &1 &2 &3 &4 DATA(lx_return) = NEW zcx_return3( ). lx_return->add_exception_object( lx_root ). "Change variable name RAISE EXCEPTION lx_return. ENDTRY. CATCH zcx_return3 INTO DATA(lx_return2). DATA(lt_act_bapiret2) = lx_return2->get_bapiret2_table( ). DATA(lt_exp_bapiret2) = VALUE bapiret2_t( ( type = 'E' id = '00' number = '001' message = 'Checkpoint group or activation variant specified does not exist' message_v1 = 'Checkpoint group or activation variant specified d' message_v2 = 'oes not exist' message_v3 = '' message_v4 = '' ) ). cl_abap_unit_assert=>assert_equals( act = lt_act_bapiret2 exp = lt_exp_bapiret2 ). ENDTRY. ENDMETHOD. METHOD sc100_create_by_text. DATA(lt_exp_bapiret2) = VALUE bapiret2_t( ( type = 'E' id = '' number = '000' message = 'Entry A B C does not exist in D (check entry)' message_v1 = 'A' message_v2 = 'B' message_v3 = 'C' message_v4 = 'D' ) ). DATA(lx_return) = NEW zcx_return3( ). lx_return->add_text( iv_type = 'E' iv_message = 'Entry &1 &2 &3 does not exist in &4 (check entry)' iv_variable_1 = 'A' iv_variable_2 = 'B' iv_variable_3 = 'C' iv_variable_4 = 'D' ). DATA(lt_act_bapiret2) = lx_return->get_bapiret2_table( ). cl_abap_unit_assert=>assert_equals( act = lt_act_bapiret2 exp = lt_exp_bapiret2 ). ENDMETHOD. ENDCLASS.
26.731629
91
0.65107
c75990cf6a1c489b8afdbd7c3274098a42ae626e
2,924
abap
ABAP
src/zdbframework.prog.abap
rayatus/-sapcodegenerator_class_reader
0f9c2c3ab7d85024cf97b7bcfa80675357c73272
[ "MIT" ]
null
null
null
src/zdbframework.prog.abap
rayatus/-sapcodegenerator_class_reader
0f9c2c3ab7d85024cf97b7bcfa80675357c73272
[ "MIT" ]
1
2020-06-11T11:01:45.000Z
2020-06-11T11:02:21.000Z
src/zdbframework.prog.abap
rayatus/sapcodegenerator_class_reader
8b7e8bea0c83c272a9862fbc06912c6eaf5156ee
[ "MIT" ]
null
null
null
*/---------------------------------------------------------------------\ *| This file is part of SAPCodeGenerator. | *| | *| ZDBFRAMEWORK 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 | *| | *| ZDBFRAMEWORK 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. | *\---------------------------------------------------------------------/ */---------------------------------------------------------------------\ | *| SPECIAL THANKS | *| | *| We would like to thanks SAPLink project because we learned how to | *| create an ABAP Classe studying their code | *\---------------------------------------------------------------------/ */---------------------------------------------------------------------\ *| For a full list of contributors visit: | *| | *| project homepage: https://github.com/rayatus/sapcodegenerator | *\---------------------------------------------------------------------/ *&---------------------------------------------------------------------* *& Report ZDBFRAMEWORK *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT zdbframework. PARAMETERS: p_clname TYPE vseoclass-clsname OBLIGATORY, p_dbname TYPE tabname16 OBLIGATORY. PARAMETERS p_ttyp TYPE typename OBLIGATORY. PARAMETERS p_devcls TYPE devclass OBLIGATORY. START-OF-SELECTION. DATA: ld_string TYPE string, ld_clsname TYPE seoclsname. zcl_zdbframework_engine_read=>generate_class( EXPORTING id_devclass = p_devcls id_dbname = p_dbname id_classname = p_clname id_ttyp = p_ttyp IMPORTING ed_classname = ld_clsname EXCEPTIONS OTHERS = 999 ). IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE. CONCATENATE 'Class '(007) ld_clsname ' created successfullly'(008) INTO ld_string SEPARATED BY space. MESSAGE ld_string TYPE 'I'. ENDIF.
44.984615
142
0.398769
c75cb5b87563070387062aedef3dc8696b081318
17,157
abap
ABAP
src/zcl_app_alv_table.clas.abap
dreitagebart/abap-app-framework
376cf5156cb947c2fac947fc8779d2da0e1199c4
[ "MIT" ]
null
null
null
src/zcl_app_alv_table.clas.abap
dreitagebart/abap-app-framework
376cf5156cb947c2fac947fc8779d2da0e1199c4
[ "MIT" ]
null
null
null
src/zcl_app_alv_table.clas.abap
dreitagebart/abap-app-framework
376cf5156cb947c2fac947fc8779d2da0e1199c4
[ "MIT" ]
null
null
null
CLASS zcl_app_alv_table DEFINITION PUBLIC FINAL CREATE PRIVATE. PUBLIC SECTION. CONSTANTS: mc_stable TYPE lvc_s_stbl VALUE 'XX', BEGIN OF mc_refresh_modes, full TYPE salv_de_constant VALUE if_salv_c_refresh=>full, soft TYPE salv_de_constant VALUE if_salv_c_refresh=>soft, END OF mc_refresh_modes, BEGIN OF mc_colors, background TYPE i VALUE cl_gui_resources=>list_col_background, blue TYPE i VALUE cl_gui_resources=>list_col_heading, gray TYPE i VALUE cl_gui_resources=>list_col_normal, yellow TYPE i VALUE cl_gui_resources=>list_col_total, gray_blue TYPE i VALUE cl_gui_resources=>list_col_key, green TYPE i VALUE cl_gui_resources=>list_col_positive, red TYPE i VALUE cl_gui_resources=>list_col_negative, orange TYPE i VALUE cl_gui_resources=>list_col_group, END OF mc_colors, BEGIN OF mc_celltypes, hotspot TYPE salv_de_celltype VALUE if_salv_c_cell_type=>hotspot, button TYPE salv_de_celltype VALUE if_salv_c_cell_type=>button, checkbox TYPE salv_de_celltype VALUE if_salv_c_cell_type=>checkbox, dropdown TYPE salv_de_celltype VALUE if_salv_c_cell_type=>dropdown, link TYPE salv_de_celltype VALUE if_salv_c_cell_type=>link, text TYPE salv_de_celltype VALUE if_salv_c_cell_type=>text, END OF mc_celltypes, BEGIN OF mc_selmodes, single TYPE char1 VALUE 'B', cell TYPE char1 VALUE 'A', multiple TYPE char1 VALUE 'C', row_column TYPE char1 VALUE 'D', END OF mc_selmodes. EVENTS: on_extension EXPORTING VALUE(io_table) TYPE REF TO zcl_app_container_table, on_double_click EXPORTING VALUE(iv_row) TYPE int4 VALUE(iv_column) TYPE string, on_right_click EXPORTING VALUE(io_context) TYPE REF TO cl_ctmenu, on_link_click EXPORTING VALUE(iv_row) TYPE int4 VALUE(iv_column) TYPE string, on_added_function EXPORTING VALUE(iv_function) TYPE string, on_before_function EXPORTING VALUE(iv_function) TYPE string, on_after_function EXPORTING VALUE(iv_function) TYPE string. CLASS-METHODS: factory IMPORTING io_parent TYPE REF TO cl_gui_container OPTIONAL iv_container_name TYPE string OPTIONAL CHANGING ct_table TYPE table RETURNING VALUE(ro_result) TYPE REF TO zcl_app_alv_table RAISING zcx_app. METHODS: display, get_columns RETURNING VALUE(ro_result) TYPE REF TO zcl_app_table_columns, get_layout RETURNING VALUE(ro_result) TYPE REF TO zcl_app_table_layout, get_display_settings RETURNING VALUE(ro_result) TYPE REF TO zcl_app_table_settings, get_functions RETURNING VALUE(ro_result) TYPE REF TO zcl_app_table_functions, get_selections RETURNING VALUE(ro_result) TYPE REF TO zcl_app_table_selections, get_filters RETURNING VALUE(ro_result) TYPE REF TO zcl_app_table_filters, handle_f1 FOR EVENT onf1 OF cl_gui_alv_grid IMPORTING e_fieldname es_row_no er_event_data, handle_f4 FOR EVENT onf4 OF cl_gui_alv_grid IMPORTING e_fieldname e_fieldvalue es_row_no er_event_data et_bad_cells e_display, handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid IMPORTING er_data_changed e_onf4 e_onf4_before e_onf4_after e_ucomm, handle_drop_get_flavor FOR EVENT ondropgetflavor OF cl_gui_alv_grid IMPORTING e_row e_column es_row_no e_dragdropobj e_flavors, handle_drag FOR EVENT ondrag OF cl_gui_alv_grid IMPORTING e_row e_column es_row_no e_dragdropobj, handle_drop FOR EVENT ondrop OF cl_gui_alv_grid IMPORTING e_row e_column es_row_no e_dragdropobj, handle_drop_complete FOR EVENT ondropcomplete OF cl_gui_alv_grid IMPORTING e_row e_column es_row_no e_dragdropobj, handle_subtotal_text FOR EVENT subtotal_text OF cl_gui_alv_grid IMPORTING es_subtottxt_info ep_subtot_line e_event_data, handle_before_usercommand FOR EVENT before_user_command OF cl_gui_alv_grid IMPORTING e_ucomm, handle_usercommand FOR EVENT user_command OF cl_gui_alv_grid IMPORTING e_ucomm, handle_after_usercommand FOR EVENT after_user_command OF cl_gui_alv_grid IMPORTING e_ucomm e_saved e_not_processed, handle_double_click FOR EVENT double_click OF cl_gui_alv_grid IMPORTING e_row e_column es_row_no, handle_ctx_request FOR EVENT context_menu_request OF cl_gui_alv_grid IMPORTING e_object, handle_menu_button FOR EVENT menu_button OF cl_gui_alv_grid IMPORTING e_object e_ucomm, handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid IMPORTING e_object e_interactive, handle_hotspot_click FOR EVENT hotspot_click OF cl_gui_alv_grid IMPORTING e_row_id e_column_id es_row_no, handle_after_refresh FOR EVENT after_refresh OF cl_gui_alv_grid, handle_button_click FOR EVENT button_click OF cl_gui_alv_grid IMPORTING es_col_id es_row_no, handle_data_changed_finish FOR EVENT data_changed_finished OF cl_gui_alv_grid IMPORTING e_modified et_good_cells, handle_drop_ext_files FOR EVENT drop_external_files OF cl_gui_alv_grid IMPORTING files, refresh IMPORTING is_stable TYPE lvc_s_stbl DEFAULT mc_stable iv_mode TYPE salv_de_constant DEFAULT mc_refresh_modes-soft. PROTECTED SECTION. PRIVATE SECTION. DATA: mo_alv TYPE REF TO cl_gui_alv_grid, mo_salv TYPE REF TO cl_salv_table, mo_columns TYPE REF TO zcl_app_table_columns, mo_selections TYPE REF TO zcl_app_table_selections, mo_filters TYPE REF TO zcl_app_table_filters, mo_functions TYPE REF TO zcl_app_table_functions, mo_layout TYPE REF TO zcl_app_table_layout, mo_settings TYPE REF TO zcl_app_table_settings, mr_output TYPE REF TO data, ms_layout TYPE lvc_s_layo, mt_fieldcat TYPE lvc_t_fcat. METHODS: constructor IMPORTING iv_name TYPE string ir_output TYPE REF TO data io_parent TYPE REF TO cl_gui_container. ENDCLASS. CLASS ZCL_APP_ALV_TABLE IMPLEMENTATION. METHOD constructor. FIELD-SYMBOLS: <output> TYPE ANY TABLE. mr_output = ir_output. mo_alv = NEW cl_gui_alv_grid( * i_shellstyle = 0 * i_lifetime = i_parent = io_parent * i_appl_events = space * i_parentdbg = * i_applogparent = * i_graphicsparent = i_name = iv_name i_fcat_complete = abap_false ). TRY. ASSIGN mr_output->* TO <output>. cl_salv_table=>factory( IMPORTING r_salv_table = mo_salv CHANGING t_table = <output> ). mt_fieldcat = cl_salv_controller_metadata=>get_lvc_fieldcatalog( EXPORTING r_columns = mo_salv->get_columns( ) r_aggregations = mo_salv->get_aggregations( ) ). CATCH cx_salv_msg. ENDTRY. mo_functions = NEW zcl_app_table_functions( ). ENDMETHOD. METHOD display. FIELD-SYMBOLS: <output> TYPE ANY TABLE. ASSIGN mr_output->* TO <output>. mo_alv->set_table_for_first_display( EXPORTING * i_buffer_active = " Buffering Active * i_bypassing_buffer = " Switch Off Buffer * i_consistency_check = " Starting Consistency Check for Interface Error Recognition * i_structure_name = " Internal Output Table Structure Name * is_variant = " Layout i_save = abap_true i_default = abap_false is_layout = ms_layout " Layout * is_print = " Print Control * it_special_groups = " Field Groups * it_toolbar_excluding = mo_functions->mt_exclude " Excluded Toolbar Standard Functions * it_hyperlink = " Hyperlinks * it_alv_graphics = " Table of Structure DTC_S_TC * it_except_qinfo = " Table for Exception Quickinfo * ir_salv_adapter = " Interface ALV Adapter CHANGING it_outtab = <output> it_fieldcatalog = mt_fieldcat " Field Catalog * it_sort = " Sort Criteria * it_filter = " Filter Criteria 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. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ENDIF. SET HANDLER handle_after_refresh FOR mo_alv. SET HANDLER handle_after_usercommand FOR mo_alv. SET HANDLER handle_before_usercommand FOR mo_alv. SET HANDLER handle_button_click FOR mo_alv. SET HANDLER handle_ctx_request FOR mo_alv. SET HANDLER handle_data_changed FOR mo_alv. SET HANDLER handle_data_changed_finish FOR mo_alv. * SET HANDLER handle_delayed_callback FOR mo_alv. * SET HANDLER handle_delayed_c_sel_cb FOR mo_alv. SET HANDLER handle_double_click FOR mo_alv. SET HANDLER handle_drag FOR mo_alv. SET HANDLER handle_drop FOR mo_alv. SET HANDLER handle_drop_complete FOR mo_alv. SET HANDLER handle_drop_ext_files FOR mo_alv. SET HANDLER handle_f1 FOR mo_alv. SET HANDLER handle_f4 FOR mo_alv. SET HANDLER handle_hotspot_click FOR mo_alv. SET HANDLER handle_menu_button FOR mo_alv. SET HANDLER handle_subtotal_text FOR mo_alv. SET HANDLER handle_toolbar FOR mo_alv. SET HANDLER handle_usercommand FOR mo_alv. * DATA lt_events TYPE cntl_simple_events. mo_alv->register_delayed_event( cl_gui_alv_grid=>mc_evt_delayed_change_select ). mo_alv->register_delayed_event( cl_gui_alv_grid=>mc_evt_delayed_move_curr_cell ). mo_alv->register_edit_event( cl_gui_alv_grid=>mc_evt_enter ). mo_alv->register_edit_event( cl_gui_alv_grid=>mc_evt_modified ). mo_alv->set_ready_for_input( ). * mo_alv->set_registered_events( lt_events ). mo_alv->set_toolbar_interactive( ). ENDMETHOD. METHOD factory. DATA lr_ref TYPE REF TO data. GET REFERENCE OF ct_table INTO lr_ref. ro_result = NEW zcl_app_alv_table( iv_name = iv_container_name ir_output = lr_ref io_parent = io_parent ). ENDMETHOD. METHOD get_columns. IF mo_columns IS NOT BOUND. GET REFERENCE OF mt_fieldcat INTO DATA(lr_fieldcat). GET REFERENCE OF ms_layout INTO DATA(lr_layout). mo_columns = NEW zcl_app_table_columns( ir_layout = lr_layout ir_fieldcat = lr_fieldcat ). ENDIF. ro_result = mo_columns. ENDMETHOD. METHOD get_display_settings. * ro_result = mo_settings. ENDMETHOD. METHOD get_filters. ro_result = mo_filters. ENDMETHOD. METHOD get_functions. ro_result = mo_functions. ENDMETHOD. METHOD get_layout. ro_result = mo_layout. ENDMETHOD. METHOD get_selections. IF mo_selections IS NOT BOUND. GET REFERENCE OF ms_layout INTO DATA(lr_layout). mo_selections = NEW zcl_app_table_selections( ir_layout = lr_layout io_alv = mo_alv ). ENDIF. ro_result = mo_selections. ENDMETHOD. METHOD handle_after_refresh. ENDMETHOD. METHOD handle_after_usercommand. RAISE EVENT on_after_function EXPORTING iv_function = CONV #( e_ucomm ). ENDMETHOD. METHOD handle_before_usercommand. RAISE EVENT on_before_function EXPORTING iv_function = CONV #( e_ucomm ). ENDMETHOD. METHOD handle_button_click. RAISE EVENT on_link_click EXPORTING iv_row = es_row_no-row_id iv_column = CONV #( es_col_id-fieldname ). ENDMETHOD. METHOD handle_ctx_request. BREAK developer. RAISE EVENT on_right_click EXPORTING io_context = e_object. ENDMETHOD. METHOD handle_data_changed. BREAK developer. ENDMETHOD. METHOD handle_data_changed_finish. ENDMETHOD. METHOD handle_double_click. RAISE EVENT on_double_click EXPORTING iv_row = CONV #( e_row-index ) iv_column = CONV #( e_column-fieldname ). ENDMETHOD. METHOD handle_drag. ENDMETHOD. METHOD handle_drop. ENDMETHOD. METHOD handle_drop_complete. ENDMETHOD. METHOD handle_drop_ext_files. ENDMETHOD. METHOD handle_drop_get_flavor. ENDMETHOD. METHOD handle_f1. ENDMETHOD. METHOD handle_f4. ENDMETHOD. METHOD handle_hotspot_click. RAISE EVENT on_link_click EXPORTING iv_row = CONV #( e_row_id-index ) iv_column = CONV #( e_column_id-fieldname ). ENDMETHOD. METHOD handle_menu_button. e_object->add_function( EXPORTING fcode = 'LLL' " Function code text = 'Testified' " Function text * icon = " Icons * ftype = " Functional Type * disabled = " Inactive * hidden = " Invisible * checked = " Selected * accelerator = " Fastpath * insert_at_the_top = space " Insert at Start (Default: Insert at End) ). ENDMETHOD. METHOD handle_subtotal_text. ENDMETHOD. METHOD handle_toolbar. DATA lt_active TYPE ttb_button. LOOP AT e_object->mt_toolbar REFERENCE INTO DATA(lr_standard). DATA(lv_index) = sy-tabix. IF line_exists( mo_functions->mt_active[ table_line = lr_standard->function ] ). APPEND lr_standard->* TO lt_active. ENDIF. ENDLOOP. CLEAR e_object->mt_toolbar. e_object->mt_toolbar = lt_active. LOOP AT mo_functions->get_functions( ) REFERENCE INTO DATA(lr_function). IF lr_function->function->mv_visible = abap_false. CONTINUE. ENDIF. APPEND INITIAL LINE TO e_object->mt_toolbar REFERENCE INTO DATA(lr_toolbar). lr_toolbar->butn_type = cntb_btype_button. lr_toolbar->function = lr_function->name. lr_toolbar->disabled = SWITCH #( lr_function->function->mv_enabled WHEN abap_true THEN abap_false ELSE abap_true ). lr_toolbar->icon = lr_function->function->mv_icon. lr_toolbar->quickinfo = lr_function->function->mv_tooltip. lr_toolbar->text = lr_function->function->mv_text. ENDLOOP. ENDMETHOD. METHOD handle_usercommand. RAISE EVENT on_added_function EXPORTING iv_function = CONV #( e_ucomm ). ENDMETHOD. METHOD refresh. mo_alv->set_frontend_fieldcatalog( mt_fieldcat ). mo_alv->set_frontend_layout( ms_layout ). mo_alv->refresh_table_display( EXPORTING is_stable = is_stable i_soft_refresh = SWITCH #( iv_mode WHEN if_salv_c_refresh=>full THEN abap_false WHEN if_salv_c_refresh=>none THEN abap_false WHEN if_salv_c_refresh=>soft THEN abap_true ) EXCEPTIONS finished = 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. ENDMETHOD. ENDCLASS.
30.52847
122
0.618232
c7611dab175c47b3a6a3c17a228d6c7d9958fbd8
1,507
abap
ABAP
src/ycl_table_cell.clas.abap
MBartsch71/ABAP_DATA_CLASSES
2f7adc93f545a14ccfde0bfe7eb52dfd8ee79d05
[ "MIT" ]
null
null
null
src/ycl_table_cell.clas.abap
MBartsch71/ABAP_DATA_CLASSES
2f7adc93f545a14ccfde0bfe7eb52dfd8ee79d05
[ "MIT" ]
null
null
null
src/ycl_table_cell.clas.abap
MBartsch71/ABAP_DATA_CLASSES
2f7adc93f545a14ccfde0bfe7eb52dfd8ee79d05
[ "MIT" ]
null
null
null
CLASS ycl_table_cell DEFINITION PUBLIC FINAL CREATE PRIVATE. PUBLIC SECTION. INTERFACES yif_table_cell . ALIASES get_row FOR yif_table_cell~get_row. ALIASES get_col FOR yif_table_cell~get_col. ALIASES get_value FOR yif_table_cell~get_value. ALIASES set_value FOR yif_table_cell~set_value. "! <p class="shorttext synchronized" lang="en"></p> "! Factory method "! @parameter row | Table row <p class="shorttext synchronized" lang="en"></p> "! @parameter col | Table col <p class="shorttext synchronized" lang="en"></p> "! @parameter r_result | Table cell object <p class="shorttext synchronized" lang="en"></p> CLASS-METHODS new IMPORTING row TYPE i col TYPE i RETURNING VALUE(r_result) TYPE REF TO ycl_table_cell. PRIVATE SECTION. METHODS constructor IMPORTING row TYPE i col TYPE i. ENDCLASS. CLASS YCL_TABLE_CELL IMPLEMENTATION. METHOD new. r_result = NEW ycl_table_cell( row = row col = col ). ENDMETHOD. METHOD constructor. yif_table_cell~row = row. yif_table_cell~col = col. ENDMETHOD. METHOD yif_table_cell~get_col. col = yif_table_cell~col. ENDMETHOD. METHOD yif_table_cell~get_row. row = yif_table_cell~row. ENDMETHOD. METHOD yif_table_cell~get_value. r_value = yif_table_cell~value. ENDMETHOD. METHOD yif_table_cell~set_value. yif_table_cell~value = REF #( value ). ENDMETHOD. ENDCLASS.
23.184615
95
0.679496
c7641915aaa0b94865098188a760f7ef39fff0fa
8,683
abap
ABAP
rest/zcl_resource.abap
lhs123/ztest
a9b5710a304c524d4b897a1d0316ee7872b9c425
[ "MIT" ]
86
2015-02-12T01:44:24.000Z
2022-03-17T03:14:48.000Z
rest/zcl_resource.abap
lhs123/ztest
a9b5710a304c524d4b897a1d0316ee7872b9c425
[ "MIT" ]
4
2015-04-10T21:33:56.000Z
2017-07-17T00:19:52.000Z
rest/zcl_resource.abap
lhs123/ztest
a9b5710a304c524d4b897a1d0316ee7872b9c425
[ "MIT" ]
29
2015-04-01T04:19:04.000Z
2021-08-18T07:46:56.000Z
class ZCL_RESOURCE definition public inheriting from ZCL_OBJECT abstract create public global friends ZCL_DISPATCHER . public section. *"* public components of class zCL_RESOURCE *"* do not include other source files here!!! methods CREATE importing !REQUEST type ref to ZCL_REQUEST !RESPONSE type ref to ZCL_RESPONSE . methods READ importing !REQUEST type ref to ZCL_REQUEST !RESPONSE type ref to ZCL_RESPONSE . methods UPDATE importing !REQUEST type ref to ZCL_REQUEST !RESPONSE type ref to ZCL_RESPONSE . methods DELETE importing !REQUEST type ref to ZCL_REQUEST !RESPONSE type ref to ZCL_RESPONSE . methods HEAD importing !REQUEST type ref to ZCL_REQUEST !RESPONSE type ref to ZCL_RESPONSE . methods NAME final returning value(RETURNING) type ZRESOURCENAME . methods PATH final returning value(RETURNING) type ZRESOURCEPATH . methods ID final returning value(RETURNING) type STRING . protected section. *"* protected components of class zCL_RESOURCE *"* do not include other source files here!!! private section. data _NAME type ZRESOURCENAME . data _PATH type ZRESOURCEPATH . data _ID type STRING . ENDCLASS. CLASS ZCL_RESOURCE IMPLEMENTATION. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Public Method ZCL_RESOURCE->CREATE * +-------------------------------------------------------------------------------------------------+ * | [--->] REQUEST TYPE REF TO ZCL_REQUEST * | [--->] RESPONSE TYPE REF TO ZCL_RESPONSE * +--------------------------------------------------------------------------------------</SIGNATURE> method create. */** * Handle the POST method: * - parses the HTTP body and instantiates a new resource * - creates the new resource using the repository * * Method specification: * - SAFE: no * - IDEMPOTENT: no * * Common responses: * - 200 with the created resource as HTTP body * - 201 without HTTP body, with Location header referring to the created resource * - 204 without HTTP body, same as 200 but the created resource is not returned */ " Method not allowed unless overridden by subclass data message type string. message e005(rest) into message. response->send_error( code = zcl_http_status_codes=>method_not_allowed message = message ). endmethod. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Public Method ZCL_RESOURCE->DELETE * +-------------------------------------------------------------------------------------------------+ * | [--->] REQUEST TYPE REF TO ZCL_REQUEST * | [--->] RESPONSE TYPE REF TO ZCL_RESPONSE * +--------------------------------------------------------------------------------------</SIGNATURE> method delete. */** * Handle the DELETE method: * - deletes the referred resource * * Method specification: * - SAFE: no * - IDEMPOTENT: yes * * Common responses: * - 200 with the deleted resource as HTTP body * - 202 without HTTP body, used for asynchronous processing * - 204 without HTTP body, same as 200 but the deleted resource is not returned */ " Method not allowed unless overridden by subclass data message type string. message e005(rest) into message. response->send_error( code = zcl_http_status_codes=>method_not_allowed message = message ). endmethod. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Public Method ZCL_RESOURCE->HEAD * +-------------------------------------------------------------------------------------------------+ * | [--->] REQUEST TYPE REF TO ZCL_REQUEST * | [--->] RESPONSE TYPE REF TO ZCL_RESPONSE * +--------------------------------------------------------------------------------------</SIGNATURE> method head. */** * Handle the HEAD method: * - exactly the same as the GET method, but ONLY returns the headers * * Method specification: * - SAFE: yes * - IDEMPOTENT: yes * * Common responses: * - 200 without HTTP body * - 404 without HTTP body, if the requested resource was not found */ " Method not allowed unless overridden by subclass data message type string. message e005(rest) into message. response->send_error( code = zcl_http_status_codes=>method_not_allowed message = message ). endmethod. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Public Method ZCL_RESOURCE->ID * +-------------------------------------------------------------------------------------------------+ * | [<-()] RETURNING TYPE STRING * +--------------------------------------------------------------------------------------</SIGNATURE> method id. returning = _id. endmethod. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Public Method ZCL_RESOURCE->NAME * +-------------------------------------------------------------------------------------------------+ * | [<-()] RETURNING TYPE ZRESOURCENAME * +--------------------------------------------------------------------------------------</SIGNATURE> method name. returning = _name. endmethod. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Public Method ZCL_RESOURCE->PATH * +-------------------------------------------------------------------------------------------------+ * | [<-()] RETURNING TYPE ZRESOURCEPATH * +--------------------------------------------------------------------------------------</SIGNATURE> method path. returning = _path. endmethod. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Public Method ZCL_RESOURCE->READ * +-------------------------------------------------------------------------------------------------+ * | [--->] REQUEST TYPE REF TO ZCL_REQUEST * | [--->] RESPONSE TYPE REF TO ZCL_RESPONSE * +--------------------------------------------------------------------------------------</SIGNATURE> method read. */** * Handle the GET method: * - retrieves the referred resource from the repository * - formats the resource into the requested representation and * - returns the representation as the HTTP body using either the SEND_BINARY or SEND_TEXT methods of the response * * Method specification: * - SAFE: yes * - IDEMPOTENT: yes * * Common responses: * - 200 with the requested resource as HTTP body * - 404 without HTTP body, if the requested resource was not found */ " Method not allowed unless overridden by subclass data message type string. message e005(rest) into message. response->send_error( code = zcl_http_status_codes=>method_not_allowed message = message ). endmethod. * <SIGNATURE>---------------------------------------------------------------------------------------+ * | Instance Public Method ZCL_RESOURCE->UPDATE * +-------------------------------------------------------------------------------------------------+ * | [--->] REQUEST TYPE REF TO ZCL_REQUEST * | [--->] RESPONSE TYPE REF TO ZCL_RESPONSE * +--------------------------------------------------------------------------------------</SIGNATURE> method update. */** * Handle the PUT method: * - this method updates an existing resource, or creates a new resource if the referred resource does not exist yet * - retrieves the referred resource from the repository * - parses the HTTP body and instantiates a new resource * - creates a new, or replaces the existing resource with the new resource * * Method specification: * - SAFE: no * - IDEMPOTENT: yes * * Common responses: * - 200 with the updated resource as HTTP body * - 201 without HTTP body, with Location header referring to the updated resource * - 204 without HTTP body, same as 200 but the updated resource is not returned */ " Method not allowed unless overridden by subclass data message type string. message e005(rest) into message. response->send_error( code = zcl_http_status_codes=>method_not_allowed message = message ). endmethod. ENDCLASS.
38.083333
116
0.497524
c766a87b90b12d3693338246ee838749fbd789ea
337
abap
ABAP
src/ytticksys_jista.fugr.lytticksys_jistaf00.abap
keremkoseoglu/ticksys
95fd5453a037716eb1bd33633950e4f4b1e8d677
[ "Apache-2.0" ]
4
2020-11-12T07:33:43.000Z
2022-02-15T18:04:29.000Z
src/ytticksys_jista.fugr.lytticksys_jistaf00.abap
MikeSidorochkin/ticksys
a3fc7d827943481d309fb88038003962ef9676b5
[ "Apache-2.0" ]
8
2020-11-03T08:13:48.000Z
2022-01-17T07:50:51.000Z
src/ytticksys_jista.fugr.lytticksys_jistaf00.abap
MikeSidorochkin/ticksys
a3fc7d827943481d309fb88038003962ef9676b5
[ "Apache-2.0" ]
3
2020-11-30T06:14:17.000Z
2021-09-11T18:01:30.000Z
*---------------------------------------------------------------------* * view related FORM routines * generation date: 08.11.2020 at 16:44:30 * view maintenance generator version: #001407# *---------------------------------------------------------------------* * base table related FORM-routines............. INCLUDE LSVIMFTX .
37.444444
71
0.394659
c767fb819c633bf6e94a055dbe114cbda94c2430
29,364
abap
ABAP
src/objects/zcl_abapgit_objects_program.clas.abap
joymike/abapGit
e06f22bb22a3c0a3c66eec4da698124c1ec98d65
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_objects_program.clas.abap
joymike/abapGit
e06f22bb22a3c0a3c66eec4da698124c1ec98d65
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_objects_program.clas.abap
joymike/abapGit
e06f22bb22a3c0a3c66eec4da698124c1ec98d65
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_objects_program DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super. PUBLIC SECTION. TYPES: BEGIN OF ty_progdir, name TYPE progdir-name, state TYPE progdir-state, sqlx TYPE progdir-sqlx, edtx TYPE progdir-edtx, varcl TYPE progdir-varcl, dbapl TYPE progdir-dbapl, dbna TYPE progdir-dbna, clas TYPE progdir-clas, type TYPE progdir-type, occurs TYPE progdir-occurs, subc TYPE progdir-subc, appl TYPE progdir-appl, secu TYPE progdir-secu, cnam TYPE progdir-cnam, cdat TYPE progdir-cdat, unam TYPE progdir-unam, udat TYPE progdir-udat, vern TYPE progdir-vern, levl TYPE progdir-levl, rstat TYPE progdir-rstat, rmand TYPE progdir-rmand, rload TYPE progdir-rload, fixpt TYPE progdir-fixpt, sset TYPE progdir-sset, sdate TYPE progdir-sdate, stime TYPE progdir-stime, idate TYPE progdir-idate, itime TYPE progdir-itime, ldbname TYPE progdir-ldbname, uccheck TYPE progdir-uccheck, END OF ty_progdir. METHODS serialize_program IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_output OPTIONAL is_item TYPE zif_abapgit_definitions=>ty_item io_files TYPE REF TO zcl_abapgit_objects_files iv_program TYPE programm OPTIONAL iv_extra TYPE clike OPTIONAL RAISING zcx_abapgit_exception. METHODS read_progdir IMPORTING iv_program TYPE programm RETURNING VALUE(rs_progdir) TYPE ty_progdir. METHODS deserialize_program IMPORTING is_progdir TYPE ty_progdir it_source TYPE abaptxt255_tab it_tpool TYPE textpool_table iv_package TYPE devclass RAISING zcx_abapgit_exception. PROTECTED SECTION. TYPES: ty_spaces_tt TYPE STANDARD TABLE OF i WITH DEFAULT KEY . TYPES: BEGIN OF ty_dynpro, header TYPE rpy_dyhead, containers TYPE dycatt_tab, fields TYPE dyfatc_tab, flow_logic TYPE swydyflow, spaces TYPE ty_spaces_tt, END OF ty_dynpro . TYPES: ty_dynpro_tt TYPE STANDARD TABLE OF ty_dynpro WITH DEFAULT KEY . TYPES: BEGIN OF ty_cua, adm TYPE rsmpe_adm, sta TYPE STANDARD TABLE OF rsmpe_stat WITH DEFAULT KEY, fun TYPE STANDARD TABLE OF rsmpe_funt WITH DEFAULT KEY, men TYPE STANDARD TABLE OF rsmpe_men WITH DEFAULT KEY, mtx TYPE STANDARD TABLE OF rsmpe_mnlt WITH DEFAULT KEY, act TYPE STANDARD TABLE OF rsmpe_act WITH DEFAULT KEY, but TYPE STANDARD TABLE OF rsmpe_but WITH DEFAULT KEY, pfk TYPE STANDARD TABLE OF rsmpe_pfk WITH DEFAULT KEY, set TYPE STANDARD TABLE OF rsmpe_staf WITH DEFAULT KEY, doc TYPE STANDARD TABLE OF rsmpe_atrt WITH DEFAULT KEY, tit TYPE STANDARD TABLE OF rsmpe_titt WITH DEFAULT KEY, biv TYPE STANDARD TABLE OF rsmpe_buts WITH DEFAULT KEY, END OF ty_cua . METHODS serialize_dynpros IMPORTING !iv_program_name TYPE programm RETURNING VALUE(rt_dynpro) TYPE ty_dynpro_tt RAISING zcx_abapgit_exception . METHODS serialize_cua IMPORTING !iv_program_name TYPE programm RETURNING VALUE(rs_cua) TYPE ty_cua RAISING zcx_abapgit_exception . METHODS deserialize_dynpros IMPORTING !it_dynpros TYPE ty_dynpro_tt RAISING zcx_abapgit_exception . METHODS deserialize_textpool IMPORTING !iv_program TYPE programm !it_tpool TYPE textpool_table !iv_language TYPE langu OPTIONAL !iv_is_include TYPE abap_bool DEFAULT abap_false RAISING zcx_abapgit_exception . METHODS deserialize_cua IMPORTING !iv_program_name TYPE programm !is_cua TYPE ty_cua RAISING zcx_abapgit_exception . METHODS is_any_dynpro_locked IMPORTING !iv_program TYPE programm RETURNING VALUE(rv_is_any_dynpro_locked) TYPE abap_bool RAISING zcx_abapgit_exception . METHODS is_cua_locked IMPORTING !iv_program TYPE programm RETURNING VALUE(rv_is_cua_locked) TYPE abap_bool RAISING zcx_abapgit_exception . METHODS is_text_locked IMPORTING !iv_program TYPE programm RETURNING VALUE(rv_is_text_locked) TYPE abap_bool RAISING zcx_abapgit_exception . CLASS-METHODS add_tpool IMPORTING !it_tpool TYPE textpool_table RETURNING VALUE(rt_tpool) TYPE zif_abapgit_definitions=>ty_tpool_tt . CLASS-METHODS read_tpool IMPORTING !it_tpool TYPE zif_abapgit_definitions=>ty_tpool_tt RETURNING VALUE(rt_tpool) TYPE zif_abapgit_definitions=>ty_tpool_tt . PRIVATE SECTION. METHODS: condense_flow EXPORTING et_spaces TYPE ty_spaces_tt CHANGING ct_flow TYPE swydyflow, uncondense_flow IMPORTING it_flow TYPE swydyflow it_spaces TYPE ty_spaces_tt RETURNING VALUE(rt_flow) TYPE swydyflow. CLASS-METHODS auto_correct_cua_adm IMPORTING is_cua TYPE zcl_abapgit_objects_program=>ty_cua CHANGING cs_adm TYPE rsmpe_adm. ENDCLASS. CLASS ZCL_ABAPGIT_OBJECTS_PROGRAM IMPLEMENTATION. METHOD add_tpool. FIELD-SYMBOLS: <ls_tpool_in> LIKE LINE OF it_tpool, <ls_tpool_out> LIKE LINE OF rt_tpool. LOOP AT it_tpool ASSIGNING <ls_tpool_in>. APPEND INITIAL LINE TO rt_tpool ASSIGNING <ls_tpool_out>. MOVE-CORRESPONDING <ls_tpool_in> TO <ls_tpool_out>. IF <ls_tpool_out>-id = 'S'. <ls_tpool_out>-split = <ls_tpool_out>-entry. <ls_tpool_out>-entry = <ls_tpool_out>-entry+8. ENDIF. ENDLOOP. ENDMETHOD. METHOD auto_correct_cua_adm. " issue #1807 automatic correction of CUA interfaces saved incorrectly in the past (ADM was not saved in the XML) CONSTANTS: lc_num_n_space TYPE string VALUE ' 0123456789', lc_num_only TYPE string VALUE '0123456789'. FIELD-SYMBOLS: <ls_pfk> TYPE rsmpe_pfk, <ls_act> TYPE rsmpe_act, <ls_men> TYPE rsmpe_men. IF cs_adm IS NOT INITIAL AND ( cs_adm-actcode CO lc_num_n_space AND cs_adm-mencode CO lc_num_n_space AND cs_adm-pfkcode CO lc_num_n_space ). "Check performed in form check_adm of include LSMPIF03 RETURN. ENDIF. LOOP AT is_cua-act ASSIGNING <ls_act>. IF <ls_act>-code+6(14) IS INITIAL AND <ls_act>-code(6) CO lc_num_only. cs_adm-actcode = <ls_act>-code. ENDIF. ENDLOOP. LOOP AT is_cua-men ASSIGNING <ls_men>. IF <ls_men>-code+6(14) IS INITIAL AND <ls_men>-code(6) CO lc_num_only. cs_adm-mencode = <ls_men>-code. ENDIF. ENDLOOP. LOOP AT is_cua-pfk ASSIGNING <ls_pfk>. IF <ls_pfk>-code+6(14) IS INITIAL AND <ls_pfk>-code(6) CO lc_num_only. cs_adm-pfkcode = <ls_pfk>-code. ENDIF. ENDLOOP. ENDMETHOD. METHOD condense_flow. DATA: lv_spaces LIKE LINE OF et_spaces. FIELD-SYMBOLS: <ls_flow> LIKE LINE OF ct_flow. CLEAR et_spaces. LOOP AT ct_flow ASSIGNING <ls_flow>. lv_spaces = 0. WHILE NOT <ls_flow>-line IS INITIAL AND <ls_flow>-line(1) = space. lv_spaces = lv_spaces + 1. <ls_flow>-line = <ls_flow>-line+1. ENDWHILE. APPEND lv_spaces TO et_spaces. ENDLOOP. ENDMETHOD. METHOD deserialize_cua. DATA: ls_tr_key TYPE trkey, ls_adm TYPE rsmpe_adm. IF lines( is_cua-sta ) = 0 AND lines( is_cua-fun ) = 0 AND lines( is_cua-men ) = 0 AND lines( is_cua-mtx ) = 0 AND lines( is_cua-act ) = 0 AND lines( is_cua-but ) = 0 AND lines( is_cua-pfk ) = 0 AND lines( is_cua-set ) = 0 AND lines( is_cua-doc ) = 0 AND lines( is_cua-tit ) = 0 AND lines( is_cua-biv ) = 0. RETURN. ENDIF. SELECT SINGLE devclass INTO ls_tr_key-devclass FROM tadir WHERE pgmid = 'R3TR' AND object = ms_item-obj_type AND obj_name = ms_item-obj_name. "#EC CI_GENBUFF IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'not found in tadir' ). ENDIF. ls_tr_key-obj_type = ms_item-obj_type. ls_tr_key-obj_name = ms_item-obj_name. ls_tr_key-sub_type = 'CUAD'. ls_tr_key-sub_name = iv_program_name. ls_adm = is_cua-adm. auto_correct_cua_adm( EXPORTING is_cua = is_cua CHANGING cs_adm = ls_adm ). sy-tcode = 'SE41' ##write_ok. " evil hack, workaround to handle fixes in note 2159455 CALL FUNCTION 'RS_CUA_INTERNAL_WRITE' EXPORTING program = iv_program_name language = mv_language tr_key = ls_tr_key adm = ls_adm state = 'I' TABLES sta = is_cua-sta fun = is_cua-fun men = is_cua-men mtx = is_cua-mtx act = is_cua-act but = is_cua-but pfk = is_cua-pfk set = is_cua-set doc = is_cua-doc tit = is_cua-tit biv = is_cua-biv EXCEPTIONS not_found = 1 OTHERS = 2. IF sy-subrc <> 0. * if moving code from SAPlink, see https://github.com/larshp/abapGit/issues/562 zcx_abapgit_exception=>raise( |Error from RS_CUA_INTERNAL_WRITE. Subrc = { sy-subrc }| ). ENDIF. zcl_abapgit_objects_activation=>add( iv_type = 'CUAD' iv_name = iv_program_name ). ENDMETHOD. METHOD deserialize_dynpros. CONSTANTS lc_rpyty_force_off TYPE char01 VALUE '/' ##NO_TEXT. DATA: lv_name TYPE dwinactiv-obj_name, ls_dynpro LIKE LINE OF it_dynpros. FIELD-SYMBOLS: <ls_field> TYPE rpy_dyfatc. * ls_dynpro is changed by the function module, a field-symbol will cause * the program to dump since it_dynpros cannot be changed LOOP AT it_dynpros INTO ls_dynpro. ls_dynpro-flow_logic = uncondense_flow( it_flow = ls_dynpro-flow_logic it_spaces = ls_dynpro-spaces ). LOOP AT ls_dynpro-fields ASSIGNING <ls_field>. * if the DDIC element has a PARAMETER_ID and the flag "from_dict" is active * the import will enable the SET-/GET_PARAM flag. In this case: "force off" IF <ls_field>-param_id IS NOT INITIAL AND <ls_field>-from_dict = abap_true. IF <ls_field>-set_param IS INITIAL. <ls_field>-set_param = lc_rpyty_force_off. ENDIF. IF <ls_field>-get_param IS INITIAL. <ls_field>-get_param = lc_rpyty_force_off. ENDIF. ENDIF. * If the previous conditions are met the value 'F' will be taken over * during de-serialization potentially overlapping other fields in the screen, * we set the tag to the correct value 'X' IF <ls_field>-type = 'CHECK' AND <ls_field>-from_dict = abap_true AND <ls_field>-text IS INITIAL AND <ls_field>-modific IS INITIAL. <ls_field>-modific = 'X'. ENDIF. "fix for issue #2747: IF <ls_field>-foreignkey IS INITIAL. <ls_field>-foreignkey = lc_rpyty_force_off. ENDIF. ENDLOOP. CALL FUNCTION 'RPY_DYNPRO_INSERT' EXPORTING header = ls_dynpro-header suppress_exist_checks = abap_true TABLES containers = ls_dynpro-containers fields_to_containers = ls_dynpro-fields flow_logic = ls_dynpro-flow_logic EXCEPTIONS cancelled = 1 already_exists = 2 program_not_exists = 3 not_executed = 4 missing_required_field = 5 illegal_field_value = 6 field_not_allowed = 7 not_generated = 8 illegal_field_position = 9 OTHERS = 10. IF sy-subrc <> 2 AND sy-subrc <> 0. zcx_abapgit_exception=>raise( |Error from RPY_DYNPRO_INSERT: { sy-subrc }| ). ENDIF. * todo, RPY_DYNPRO_UPDATE? CONCATENATE ls_dynpro-header-program ls_dynpro-header-screen INTO lv_name RESPECTING BLANKS. ASSERT NOT lv_name IS INITIAL. zcl_abapgit_objects_activation=>add( iv_type = 'DYNP' iv_name = lv_name ). ENDLOOP. ENDMETHOD. METHOD deserialize_program. DATA: lv_exists TYPE abap_bool, lv_progname TYPE reposrc-progname, ls_tpool LIKE LINE OF it_tpool, lv_title TYPE rglif-title, ls_progdir_new TYPE progdir. FIELD-SYMBOLS: <lg_any> TYPE any. CALL FUNCTION 'RS_CORR_INSERT' EXPORTING object = is_progdir-name object_class = 'ABAP' devclass = iv_package master_language = mv_language mode = 'I' suppress_dialog = abap_true EXCEPTIONS cancelled = 1 permission_failure = 2 unknown_objectclass = 3 OTHERS = 4. IF sy-subrc = 1. zcx_abapgit_exception=>raise( |Error from RS_CORR_INSERT, Cancelled, { sy-msgid }, { sy-msgno }| ). ELSEIF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Error from RS_CORR_INSERT, { sy-msgid }, { sy-msgno }| ). ENDIF. READ TABLE it_tpool INTO ls_tpool WITH KEY id = 'R'. IF sy-subrc = 0. * there is a bug in RPY_PROGRAM_UPDATE, the header line of TTAB is not * cleared, so the title length might be inherited from a different program. ASSIGN ('(SAPLSIFP)TTAB') TO <lg_any>. IF sy-subrc = 0. CLEAR <lg_any>. ENDIF. lv_title = ls_tpool-entry. ENDIF. SELECT SINGLE progname FROM reposrc INTO lv_progname WHERE progname = is_progdir-name AND r3state = 'A'. IF sy-subrc = 0. lv_exists = abap_true. ELSE. lv_exists = abap_false. ENDIF. IF lv_exists = abap_true. zcl_abapgit_language=>set_current_language( mv_language ). CALL FUNCTION 'RPY_PROGRAM_UPDATE' EXPORTING program_name = is_progdir-name title_string = lv_title save_inactive = 'I' TABLES source_extended = it_source EXCEPTIONS cancelled = 1 permission_error = 2 not_found = 3 OTHERS = 4. IF sy-subrc <> 0. zcl_abapgit_language=>restore_login_language( ). IF sy-msgid = 'EU' AND sy-msgno = '510'. zcx_abapgit_exception=>raise( 'User is currently editing program' ). ELSE. zcx_abapgit_exception=>raise( |PROG { is_progdir-name }, updating error: { sy-msgid } { sy-msgno }| ). ENDIF. ENDIF. zcl_abapgit_language=>restore_login_language( ). ELSEIF strlen( is_progdir-name ) > 30. * function module RPY_PROGRAM_INSERT cannot handle function group includes " special treatment for extensions " if the program name exceeds 30 characters it is not a usual " ABAP program but might be some extension, which requires the internal " addition EXTENSION TYPE, see " http://help.sap.com/abapdocu_751/en/abapinsert_report_internal.htm#!ABAP_ADDITION_1@1@ " This e.g. occurs in case of transportable Code Inspector variants (ending with ===VC) INSERT REPORT is_progdir-name FROM it_source STATE 'I' EXTENSION TYPE is_progdir-name+30. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'error from INSERT REPORT .. EXTENSION TYPE' ). ENDIF. ELSE. INSERT REPORT is_progdir-name FROM it_source STATE 'I' PROGRAM TYPE is_progdir-subc. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'error from INSERT REPORT' ). ENDIF. ENDIF. IF NOT it_tpool[] IS INITIAL. INSERT TEXTPOOL is_progdir-name FROM it_tpool LANGUAGE mv_language STATE 'I'. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'error from INSERT TEXTPOOL' ). ENDIF. ENDIF. CALL FUNCTION 'READ_PROGDIR' EXPORTING i_progname = is_progdir-name i_state = 'I' IMPORTING e_progdir = ls_progdir_new EXCEPTIONS not_exists = 1 OTHERS = 2. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |not found in PROGDIR. Subrc = { sy-subrc }| ). ENDIF. * todo, package? ls_progdir_new-ldbname = is_progdir-ldbname. ls_progdir_new-dbna = is_progdir-dbna. ls_progdir_new-dbapl = is_progdir-dbapl. ls_progdir_new-rload = is_progdir-rload. ls_progdir_new-fixpt = is_progdir-fixpt. ls_progdir_new-varcl = is_progdir-varcl. ls_progdir_new-appl = is_progdir-appl. ls_progdir_new-rstat = is_progdir-rstat. CALL FUNCTION 'UPDATE_PROGDIR' EXPORTING i_progdir = ls_progdir_new i_progname = ls_progdir_new-name i_state = ls_progdir_new-state EXCEPTIONS not_executed = 1 OTHERS = 2. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |PROG, error inserting. Subrc = { sy-subrc }| ). ENDIF. SELECT SINGLE * FROM progdir INTO ls_progdir_new WHERE name = ls_progdir_new-name AND state = ls_progdir_new-state. IF sy-subrc = 0 AND is_progdir-varcl = space AND ls_progdir_new-varcl = abap_true. * function module UPDATE_PROGDIR does not update VARCL UPDATE progdir SET varcl = is_progdir-varcl WHERE name = ls_progdir_new-name AND state = ls_progdir_new-state. "#EC CI_SUBRC ENDIF. zcl_abapgit_objects_activation=>add( iv_type = 'REPS' iv_name = is_progdir-name ). ENDMETHOD. METHOD deserialize_textpool. DATA lv_language TYPE langu. DATA lv_state TYPE c. DATA lv_delete TYPE abap_bool. IF iv_language IS INITIAL. lv_language = mv_language. ELSE. lv_language = iv_language. ENDIF. IF lv_language = mv_language. lv_state = 'I'. "Textpool in master language needs to be activated ELSE. lv_state = 'A'. "Translations are always active ENDIF. IF it_tpool IS INITIAL. IF iv_is_include = abap_false OR lv_state = 'A'. DELETE TEXTPOOL iv_program "Remove initial description from textpool if LANGUAGE iv_program "original program does not have a textpool STATE lv_state. lv_delete = abap_true. ELSE. INSERT TEXTPOOL iv_program "In case of includes: Deletion of textpool in FROM it_tpool "master language cannot be activated because LANGUAGE lv_language "this woul activate the deletion of the textpool STATE lv_state. "of the mail program -> insert empty textpool ENDIF. ELSE. IF lines( it_tpool ) = 1 AND lv_language = mv_language. READ TABLE it_tpool WITH KEY id = 'R' TRANSPORTING NO FIELDS. IF sy-subrc = 0. RETURN. "No action because description in master language is already there ENDIF. ENDIF. INSERT TEXTPOOL iv_program FROM it_tpool LANGUAGE lv_language STATE lv_state. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'error from INSERT TEXTPOOL' ). ENDIF. ENDIF. IF lv_state = 'I'. "Textpool in master language needs to be activated zcl_abapgit_objects_activation=>add( iv_type = 'REPT' iv_name = iv_program iv_delete = lv_delete ). ENDIF. ENDMETHOD. METHOD is_any_dynpro_locked. DATA: lt_dynpros TYPE zcl_abapgit_objects_program=>ty_dynpro_tt, lv_object TYPE seqg3-garg. FIELD-SYMBOLS: <ls_dynpro> TYPE zcl_abapgit_objects_program=>ty_dynpro. lt_dynpros = serialize_dynpros( iv_program ). LOOP AT lt_dynpros ASSIGNING <ls_dynpro>. lv_object = |{ <ls_dynpro>-header-screen }{ <ls_dynpro>-header-program }|. IF exists_a_lock_entry_for( iv_lock_object = 'ESCRP' iv_argument = lv_object ) = abap_true. rv_is_any_dynpro_locked = abap_true. EXIT. ENDIF. ENDLOOP. ENDMETHOD. METHOD is_cua_locked. DATA: lv_object TYPE eqegraarg. lv_object = |CU{ iv_program }|. OVERLAY lv_object WITH ' '. lv_object = lv_object && '*'. rv_is_cua_locked = exists_a_lock_entry_for( iv_lock_object = 'ESCUAPAINT' iv_argument = lv_object ). ENDMETHOD. METHOD is_text_locked. DATA: lv_object TYPE eqegraarg. lv_object = |*{ iv_program }|. rv_is_text_locked = exists_a_lock_entry_for( iv_lock_object = 'EABAPTEXTE' iv_argument = lv_object ). ENDMETHOD. METHOD read_progdir. DATA: ls_sapdir TYPE progdir. CALL FUNCTION 'READ_PROGDIR' EXPORTING i_progname = iv_program i_state = 'A' IMPORTING e_progdir = ls_sapdir. MOVE-CORRESPONDING ls_sapdir TO rs_progdir. CLEAR: rs_progdir-edtx, rs_progdir-cnam, rs_progdir-cdat, rs_progdir-unam, rs_progdir-udat, rs_progdir-levl, rs_progdir-vern, rs_progdir-rmand, rs_progdir-sdate, rs_progdir-stime, rs_progdir-idate, rs_progdir-itime, rs_progdir-varcl, rs_progdir-state. ENDMETHOD. METHOD read_tpool. FIELD-SYMBOLS: <ls_tpool_in> LIKE LINE OF it_tpool, <ls_tpool_out> LIKE LINE OF rt_tpool. LOOP AT it_tpool ASSIGNING <ls_tpool_in>. APPEND INITIAL LINE TO rt_tpool ASSIGNING <ls_tpool_out>. MOVE-CORRESPONDING <ls_tpool_in> TO <ls_tpool_out>. IF <ls_tpool_out>-id = 'S'. CONCATENATE <ls_tpool_in>-split <ls_tpool_in>-entry INTO <ls_tpool_out>-entry RESPECTING BLANKS. ENDIF. ENDLOOP. ENDMETHOD. METHOD serialize_cua. CALL FUNCTION 'RS_CUA_INTERNAL_FETCH' EXPORTING program = iv_program_name language = mv_language state = 'A' IMPORTING adm = rs_cua-adm TABLES sta = rs_cua-sta fun = rs_cua-fun men = rs_cua-men mtx = rs_cua-mtx act = rs_cua-act but = rs_cua-but pfk = rs_cua-pfk set = rs_cua-set doc = rs_cua-doc tit = rs_cua-tit biv = rs_cua-biv EXCEPTIONS not_found = 1 unknown_version = 2 OTHERS = 3. IF sy-subrc > 1. zcx_abapgit_exception=>raise( |Error from RS_CUA_INTERNAL_FETCH, { sy-subrc }| ). ENDIF. ENDMETHOD. METHOD serialize_dynpros. DATA: ls_header TYPE rpy_dyhead, lt_containers TYPE dycatt_tab, lt_fields_to_containers TYPE dyfatc_tab, lt_flow_logic TYPE swydyflow, lt_d020s TYPE TABLE OF d020s. FIELD-SYMBOLS: <ls_d020s> LIKE LINE OF lt_d020s, <lv_outputstyle> TYPE scrpostyle, <ls_container> LIKE LINE OF lt_containers, <ls_field> LIKE LINE OF lt_fields_to_containers, <ls_dynpro> LIKE LINE OF rt_dynpro. CALL FUNCTION 'RS_SCREEN_LIST' EXPORTING dynnr = '' progname = iv_program_name TABLES dynpros = lt_d020s EXCEPTIONS not_found = 1 OTHERS = 2. IF sy-subrc = 2. zcx_abapgit_exception=>raise( |Error from RS_SCREEN_LIST. Subrc = { sy-subrc }| ). ENDIF. SORT lt_d020s BY dnum ASCENDING. * loop dynpros and skip generated selection screens LOOP AT lt_d020s ASSIGNING <ls_d020s> WHERE type <> 'S' AND type <> 'W' AND type <> 'J' AND NOT dnum IS INITIAL. CALL FUNCTION 'RPY_DYNPRO_READ' EXPORTING progname = iv_program_name dynnr = <ls_d020s>-dnum IMPORTING header = ls_header TABLES containers = lt_containers fields_to_containers = lt_fields_to_containers flow_logic = lt_flow_logic EXCEPTIONS cancelled = 1 not_found = 2 permission_error = 3 OTHERS = 4. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Error while reading dynpro: { sy-subrc }| ). ENDIF. LOOP AT lt_fields_to_containers ASSIGNING <ls_field>. * output style is a NUMC field, the XML conversion will fail if it contains invalid value * field does not exist in all versions ASSIGN COMPONENT 'OUTPUTSTYLE' OF STRUCTURE <ls_field> TO <lv_outputstyle>. IF sy-subrc = 0 AND <lv_outputstyle> = ' '. CLEAR <lv_outputstyle>. ENDIF. ENDLOOP. LOOP AT lt_containers ASSIGNING <ls_container>. IF <ls_container>-c_resize_v = abap_false. CLEAR <ls_container>-c_line_min. ENDIF. IF <ls_container>-c_resize_h = abap_false. CLEAR <ls_container>-c_coln_min. ENDIF. ENDLOOP. APPEND INITIAL LINE TO rt_dynpro ASSIGNING <ls_dynpro>. <ls_dynpro>-header = ls_header. <ls_dynpro>-containers = lt_containers. <ls_dynpro>-fields = lt_fields_to_containers. condense_flow( IMPORTING et_spaces = <ls_dynpro>-spaces CHANGING ct_flow = lt_flow_logic ). <ls_dynpro>-flow_logic = lt_flow_logic. ENDLOOP. ENDMETHOD. METHOD serialize_program. DATA: ls_progdir TYPE ty_progdir, lv_program_name TYPE programm, lt_dynpros TYPE ty_dynpro_tt, ls_cua TYPE ty_cua, lt_source TYPE TABLE OF abaptxt255, lt_tpool TYPE textpool_table, ls_tpool LIKE LINE OF lt_tpool, lo_xml TYPE REF TO zcl_abapgit_xml_output. IF iv_program IS INITIAL. lv_program_name = is_item-obj_name. ELSE. lv_program_name = iv_program. ENDIF. zcl_abapgit_language=>set_current_language( mv_language ). CALL FUNCTION 'RPY_PROGRAM_READ' EXPORTING program_name = lv_program_name with_lowercase = abap_true TABLES source_extended = lt_source textelements = lt_tpool EXCEPTIONS cancelled = 1 not_found = 2 permission_error = 3 OTHERS = 4. IF sy-subrc = 2. zcl_abapgit_language=>restore_login_language( ). RETURN. ELSEIF sy-subrc <> 0. zcl_abapgit_language=>restore_login_language( ). zcx_abapgit_exception=>raise( |Error reading program with RPY_PROGRAM_READ. Subrc = { sy-subrc }| ). ENDIF. zcl_abapgit_language=>restore_login_language( ). ls_progdir = read_progdir( lv_program_name ). IF io_xml IS BOUND. lo_xml = io_xml. ELSE. CREATE OBJECT lo_xml. ENDIF. lo_xml->add( iv_name = 'PROGDIR' ig_data = ls_progdir ). IF ls_progdir-subc = '1' OR ls_progdir-subc = 'M'. lt_dynpros = serialize_dynpros( lv_program_name ). lo_xml->add( iv_name = 'DYNPROS' ig_data = lt_dynpros ). ls_cua = serialize_cua( lv_program_name ). IF NOT ls_cua IS INITIAL. lo_xml->add( iv_name = 'CUA' ig_data = ls_cua ). ENDIF. ENDIF. READ TABLE lt_tpool WITH KEY id = 'R' INTO ls_tpool. IF sy-subrc = 0 AND ls_tpool-key = '' AND ls_tpool-length = 0. DELETE lt_tpool INDEX sy-tabix. ENDIF. lo_xml->add( iv_name = 'TPOOL' ig_data = add_tpool( lt_tpool ) ). IF NOT io_xml IS BOUND. io_files->add_xml( iv_extra = iv_extra io_xml = lo_xml ). ENDIF. io_files->add_abap( iv_extra = iv_extra it_abap = lt_source ). ENDMETHOD. METHOD uncondense_flow. DATA: lv_spaces LIKE LINE OF it_spaces. FIELD-SYMBOLS: <ls_flow> LIKE LINE OF it_flow, <ls_output> LIKE LINE OF rt_flow. LOOP AT it_flow ASSIGNING <ls_flow>. APPEND INITIAL LINE TO rt_flow ASSIGNING <ls_output>. <ls_output>-line = <ls_flow>-line. READ TABLE it_spaces INDEX sy-tabix INTO lv_spaces. IF sy-subrc = 0. SHIFT <ls_output>-line RIGHT BY lv_spaces PLACES IN CHARACTER MODE. ENDIF. ENDLOOP. ENDMETHOD. ENDCLASS.
30.651357
117
0.609658
c7683ffd7ce25311276f785885c4b5b5f2c66c05
11,516
abap
ABAP
src/ui/core/zcl_abapgit_html.clas.abap
RedWolf112/abapGit
4420de02971a3a61f3c526c2778a9ff669d21a0a
[ "MIT" ]
null
null
null
src/ui/core/zcl_abapgit_html.clas.abap
RedWolf112/abapGit
4420de02971a3a61f3c526c2778a9ff669d21a0a
[ "MIT" ]
null
null
null
src/ui/core/zcl_abapgit_html.clas.abap
RedWolf112/abapGit
4420de02971a3a61f3c526c2778a9ff669d21a0a
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_html DEFINITION PUBLIC CREATE PUBLIC . PUBLIC SECTION. INTERFACES zif_abapgit_html . ALIASES a FOR zif_abapgit_html~a . ALIASES add FOR zif_abapgit_html~add . ALIASES add_a FOR zif_abapgit_html~add_a . ALIASES add_checkbox FOR zif_abapgit_html~add_checkbox . ALIASES icon FOR zif_abapgit_html~icon . ALIASES is_empty FOR zif_abapgit_html~is_empty . ALIASES render FOR zif_abapgit_html~render . CONSTANTS c_indent_size TYPE i VALUE 2 ##NO_TEXT. CLASS-METHODS class_constructor . METHODS add_icon IMPORTING !iv_name TYPE string !iv_hint TYPE string OPTIONAL !iv_class TYPE string OPTIONAL !iv_onclick TYPE string OPTIONAL . CLASS-METHODS create RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html. PROTECTED SECTION. PRIVATE SECTION. TYPES: BEGIN OF ty_indent_context, no_indent_jscss TYPE abap_bool, within_style TYPE abap_bool, within_js TYPE abap_bool, indent TYPE i, indent_str TYPE string, END OF ty_indent_context . TYPES: BEGIN OF ty_study_result, style_open TYPE abap_bool, style_close TYPE abap_bool, script_open TYPE abap_bool, script_close TYPE abap_bool, tag_close TYPE abap_bool, curly_close TYPE abap_bool, openings TYPE i, closings TYPE i, singles TYPE i, END OF ty_study_result . CLASS-DATA go_single_tags_re TYPE REF TO cl_abap_regex . DATA mt_buffer TYPE string_table . METHODS indent_line CHANGING !cs_context TYPE ty_indent_context !cv_line TYPE string . METHODS study_line IMPORTING !iv_line TYPE string !is_context TYPE ty_indent_context RETURNING VALUE(rs_result) TYPE ty_study_result . METHODS checkbox IMPORTING !iv_id TYPE string !iv_checked TYPE abap_bool OPTIONAL RETURNING VALUE(rv_html) TYPE string . ENDCLASS. CLASS ZCL_ABAPGIT_HTML IMPLEMENTATION. METHOD a. DATA: lv_class TYPE string, lv_href TYPE string, lv_click TYPE string, lv_id TYPE string, lv_style TYPE string, lv_title TYPE string. lv_class = iv_class. IF iv_opt CA zif_abapgit_html=>c_html_opt-strong. lv_class = lv_class && ' emphasis' ##NO_TEXT. ENDIF. IF iv_opt CA zif_abapgit_html=>c_html_opt-cancel. lv_class = lv_class && ' attention' ##NO_TEXT. ENDIF. IF iv_opt CA zif_abapgit_html=>c_html_opt-crossout. lv_class = lv_class && ' crossout grey' ##NO_TEXT. ENDIF. IF lv_class IS NOT INITIAL. SHIFT lv_class LEFT DELETING LEADING space. lv_class = | class="{ lv_class }"|. ENDIF. lv_href = ' href="#"'. " Default, dummy IF ( iv_act IS NOT INITIAL OR iv_typ = zif_abapgit_html=>c_action_type-dummy ) AND iv_opt NA zif_abapgit_html=>c_html_opt-crossout. CASE iv_typ. WHEN zif_abapgit_html=>c_action_type-url. lv_href = | href="{ iv_act }"|. WHEN zif_abapgit_html=>c_action_type-sapevent. lv_href = | href="sapevent:{ iv_act }"|. WHEN zif_abapgit_html=>c_action_type-onclick. lv_href = ' href="#"'. lv_click = | onclick="{ iv_act }"|. WHEN zif_abapgit_html=>c_action_type-dummy. lv_href = ' href="#"'. ENDCASE. ENDIF. IF iv_id IS NOT INITIAL. lv_id = | id="{ iv_id }"|. ENDIF. IF iv_style IS NOT INITIAL. lv_style = | style="{ iv_style }"|. ENDIF. IF iv_title IS NOT INITIAL. lv_title = | title="{ iv_title }"|. ENDIF. rv_str = |<a{ lv_id }{ lv_class }{ lv_href }{ lv_click }{ lv_style }{ lv_title }>| && |{ iv_txt }</a>|. ENDMETHOD. METHOD add. DATA: lv_type TYPE c, lo_html TYPE REF TO zcl_abapgit_html. FIELD-SYMBOLS: <lt_tab> TYPE string_table. DESCRIBE FIELD ig_chunk TYPE lv_type. " Describe is faster than RTTI classes CASE lv_type. WHEN 'C' OR 'g'. " Char or string APPEND ig_chunk TO mt_buffer. WHEN 'h'. " Table ASSIGN ig_chunk TO <lt_tab>. " Assuming table of strings ! Will dump otherwise APPEND LINES OF <lt_tab> TO mt_buffer. WHEN 'r'. " Object ref ASSERT ig_chunk IS BOUND. " Dev mistake TRY. lo_html ?= ig_chunk. CATCH cx_sy_move_cast_error. ASSERT 1 = 0. " Dev mistake ENDTRY. APPEND LINES OF lo_html->mt_buffer TO mt_buffer. WHEN OTHERS. ASSERT 1 = 0. " Dev mistake ENDCASE. ENDMETHOD. METHOD add_a. add( a( iv_txt = iv_txt iv_act = iv_act iv_typ = iv_typ iv_opt = iv_opt iv_class = iv_class iv_id = iv_id iv_style = iv_style iv_title = iv_title ) ). ENDMETHOD. METHOD add_icon. add( icon( iv_name = iv_name iv_class = iv_class iv_hint = iv_hint iv_onclick = iv_onclick ) ). ENDMETHOD. METHOD checkbox. DATA: lv_checked TYPE string. IF iv_checked = abap_true. lv_checked = |checked|. ENDIF. rv_html = |<input type="checkbox" id="{ iv_id }" { lv_checked }>|. ENDMETHOD. METHOD class_constructor. CREATE OBJECT go_single_tags_re EXPORTING pattern = '<(AREA|BASE|BR|COL|COMMAND|EMBED|HR|IMG|INPUT|LINK|META|PARAM|SOURCE|!)' ignore_case = abap_false. ENDMETHOD. METHOD create. CREATE OBJECT ro_html. ENDMETHOD. METHOD icon. DATA: lv_hint TYPE string, lv_name TYPE string, lv_color TYPE string, lv_class TYPE string, lv_large_icon TYPE string, lv_xpixel TYPE i, lv_onclick TYPE string. SPLIT iv_name AT '/' INTO lv_name lv_color. IF iv_hint IS NOT INITIAL. lv_hint = | title="{ iv_hint }"|. ENDIF. IF iv_onclick IS NOT INITIAL. lv_onclick = | onclick="{ iv_onclick }"|. ENDIF. IF iv_class IS NOT INITIAL. lv_class = | { iv_class }|. ENDIF. IF lv_color IS NOT INITIAL. lv_color = | { lv_color }|. ENDIF. lv_xpixel = cl_gui_cfw=>compute_pixel_from_metric( x_or_y = 'X' in = 1 ). IF lv_xpixel >= 2. lv_large_icon = ' large'. ENDIF. rv_str = |<i class="icon{ lv_large_icon } icon-{ lv_name }{ lv_color }|. rv_str = |{ rv_str }{ lv_class }"{ lv_onclick }{ lv_hint }></i>|. ENDMETHOD. METHOD indent_line. DATA: ls_study TYPE ty_study_result, lv_x_str TYPE string. ls_study = study_line( is_context = cs_context iv_line = cv_line ). " First closing tag - shift back exceptionally IF ( ls_study-script_close = abap_true OR ls_study-style_close = abap_true OR ls_study-curly_close = abap_true OR ls_study-tag_close = abap_true ) AND cs_context-indent > 0. lv_x_str = repeat( val = ` ` occ = ( cs_context-indent - 1 ) * c_indent_size ). cv_line = lv_x_str && cv_line. ELSE. cv_line = cs_context-indent_str && cv_line. ENDIF. " Context status update CASE abap_true. WHEN ls_study-script_open. cs_context-within_js = abap_true. cs_context-within_style = abap_false. WHEN ls_study-style_open. cs_context-within_js = abap_false. cs_context-within_style = abap_true. WHEN ls_study-script_close OR ls_study-style_close. cs_context-within_js = abap_false. cs_context-within_style = abap_false. ls_study-closings = ls_study-closings + 1. ENDCASE. " More-less logic chosen due to possible double tags in a line '<a><b>' IF ls_study-openings <> ls_study-closings. IF ls_study-openings > ls_study-closings. cs_context-indent = cs_context-indent + 1. ELSEIF cs_context-indent > 0. " AND ls_study-openings < ls_study-closings cs_context-indent = cs_context-indent - 1. ENDIF. cs_context-indent_str = repeat( val = ` ` occ = cs_context-indent * c_indent_size ). ENDIF. ENDMETHOD. METHOD is_empty. rv_yes = boolc( lines( mt_buffer ) = 0 ). ENDMETHOD. METHOD render. DATA: ls_context TYPE ty_indent_context, lt_temp TYPE string_table. FIELD-SYMBOLS: <lv_line> LIKE LINE OF lt_temp, <lv_line_c> LIKE LINE OF lt_temp. ls_context-no_indent_jscss = iv_no_indent_jscss. LOOP AT mt_buffer ASSIGNING <lv_line>. APPEND <lv_line> TO lt_temp ASSIGNING <lv_line_c>. indent_line( CHANGING cs_context = ls_context cv_line = <lv_line_c> ). ENDLOOP. CONCATENATE LINES OF lt_temp INTO rv_html SEPARATED BY cl_abap_char_utilities=>newline. ENDMETHOD. METHOD study_line. DATA: lv_line TYPE string, lv_len TYPE i. lv_line = to_upper( shift_left( val = iv_line sub = ` ` ) ). lv_len = strlen( lv_line ). " Some assumptions for simplification and speed " - style & scripts tag should be opened/closed in a separate line " - style & scripts opening and closing in one line is possible but only once " TODO & Issues " - What if the string IS a well formed html already not just single line ? IF is_context-within_js = abap_true OR is_context-within_style = abap_true. IF is_context-within_js = abap_true AND lv_len >= 8 AND lv_line(8) = '</SCRIPT'. rs_result-script_close = abap_true. ELSEIF is_context-within_style = abap_true AND lv_len >= 7 AND lv_line(7) = '</STYLE'. rs_result-style_close = abap_true. ENDIF. IF is_context-no_indent_jscss = abap_false. IF lv_len >= 1 AND lv_line(1) = '}'. rs_result-curly_close = abap_true. ENDIF. FIND ALL OCCURRENCES OF '{' IN lv_line MATCH COUNT rs_result-openings. FIND ALL OCCURRENCES OF '}' IN lv_line MATCH COUNT rs_result-closings. ENDIF. ELSE. IF lv_len >= 7 AND lv_line(7) = '<SCRIPT'. FIND FIRST OCCURRENCE OF '</SCRIPT' IN lv_line. IF sy-subrc > 0. " Not found rs_result-script_open = abap_true. ENDIF. ENDIF. IF lv_len >= 6 AND lv_line(6) = '<STYLE'. FIND FIRST OCCURRENCE OF '</STYLE' IN lv_line. IF sy-subrc > 0. " Not found rs_result-style_open = abap_true. ENDIF. ENDIF. IF lv_len >= 2 AND lv_line(2) = '</'. rs_result-tag_close = abap_true. ENDIF. FIND ALL OCCURRENCES OF '<' IN lv_line MATCH COUNT rs_result-openings. FIND ALL OCCURRENCES OF '</' IN lv_line MATCH COUNT rs_result-closings. FIND ALL OCCURRENCES OF REGEX go_single_tags_re IN lv_line MATCH COUNT rs_result-singles. rs_result-openings = rs_result-openings - rs_result-closings - rs_result-singles. ENDIF. ENDMETHOD. METHOD zif_abapgit_html~add_checkbox. add( checkbox( iv_id = iv_id iv_checked = iv_checked ) ). ENDMETHOD. METHOD zif_abapgit_html~set_title. zif_abapgit_html~mv_chunk_title = iv_title. ENDMETHOD. ENDCLASS.
28.019465
95
0.616273
c76923bef24511919e4492bd5257946447fe7e67
435
abap
ABAP
src/w3mi/zw3mi.fugr.wwwparams_read.abap
sbcgua/open-abap
98d939658ec0db2a1ff2bd6979d7c9b52dc9dc5e
[ "MIT" ]
20
2020-10-02T09:37:08.000Z
2022-03-26T15:29:11.000Z
src/w3mi/zw3mi.fugr.wwwparams_read.abap
sbcgua/open-abap
98d939658ec0db2a1ff2bd6979d7c9b52dc9dc5e
[ "MIT" ]
28
2020-12-02T15:19:10.000Z
2022-03-24T06:12:47.000Z
src/w3mi/zw3mi.fugr.wwwparams_read.abap
sbcgua/open-abap
98d939658ec0db2a1ff2bd6979d7c9b52dc9dc5e
[ "MIT" ]
2
2020-11-17T13:21:38.000Z
2021-11-07T14:35:54.000Z
FUNCTION wwwparams_read. *"---------------------------------------------------------------------- *"*"Local Interface: *" IMPORTING *" VALUE(RELID) LIKE WWWPARAMS-RELID *" VALUE(OBJID) LIKE WWWPARAMS-OBJID *" VALUE(NAME) TYPE C *" EXPORTING *" VALUE(VALUE) TYPE C *" EXCEPTIONS *" ENTRY_NOT_EXISTS *"---------------------------------------------------------------------- ASSERT 1 = 'todo'. ENDFUNCTION.
25.588235
72
0.429885
c7692f82d9f80daf8b0292054176bdbd4bfc2b85
1,140
abap
ABAP
zif_mocka_mocker_attribute.intf.abap
uweku/mockA
cd519afdac3bdda0e61095740572c591d43abaee
[ "Apache-2.0" ]
37
2015-02-11T22:11:04.000Z
2021-03-31T11:26:07.000Z
zif_mocka_mocker_attribute.intf.abap
uweku/mockA
cd519afdac3bdda0e61095740572c591d43abaee
[ "Apache-2.0" ]
16
2015-02-13T05:45:07.000Z
2020-12-04T06:46:37.000Z
zif_mocka_mocker_attribute.intf.abap
uweku/mockA
cd519afdac3bdda0e61095740572c591d43abaee
[ "Apache-2.0" ]
7
2015-03-27T00:05:20.000Z
2018-11-22T14:06:07.000Z
interface ZIF_MOCKA_MOCKER_ATTRIBUTE public . type-pools ABAP . type-pools SEOS . types TY_T_CLASS type SWF_CLASSES . types: BEGIN OF ty_s_name_value_pair, parameter TYPE seosconame, value TYPE REF TO data, END OF ty_s_name_value_pair . types: ty_t_name_value_pair TYPE STANDARD TABLE OF ty_s_name_value_pair WITH KEY parameter . types: BEGIN OF ty_s_method_call_pattern, importing TYPE ty_t_name_value_pair, changing_in TYPE ty_t_name_value_pair, changing_out TYPE ty_t_name_value_pair, exporting TYPE ty_t_name_value_pair, returning TYPE REF TO data, raises TYPE REF TO cx_root, raises_by_name TYPE seoclsname, times_resolved TYPE i, END OF ty_s_method_call_pattern . types: ty_t_method_call_pattern TYPE TABLE OF ty_s_method_call_pattern . methods RETURNS importing !I_RETURN type ANY returning value(RO_MOCKER) type ref to ZIF_MOCKA_MOCKER . methods RETURN returning value(R_RESULT) type ref to DATA . methods IS_VALUE_SPECIFIED returning value(RV_IS_VALUE_SPECIFIED) type ABAP_BOOL . endinterface.
38
254
0.746491
c769c55c1c7e66246a50acdc6cd1b799e504fad1
352
abap
ABAP
src/zssf_con/zssf_fg.fugr.tableproc_zssf_fg.abap
hobru/ABAP-SDK-for-Azure
7e0f2dbf484a87deacae3fe62e2d8fd6357a1d05
[ "MIT" ]
null
null
null
src/zssf_con/zssf_fg.fugr.tableproc_zssf_fg.abap
hobru/ABAP-SDK-for-Azure
7e0f2dbf484a87deacae3fe62e2d8fd6357a1d05
[ "MIT" ]
null
null
null
src/zssf_con/zssf_fg.fugr.tableproc_zssf_fg.abap
hobru/ABAP-SDK-for-Azure
7e0f2dbf484a87deacae3fe62e2d8fd6357a1d05
[ "MIT" ]
1
2018-12-10T10:55:02.000Z
2018-12-10T10:55:02.000Z
*---------------------------------------------------------------------* * program for: TABLEPROC_ZSSF_FG * generation date: 19.03.2018 at 12:06:49 * view maintenance generator version: #001407# *---------------------------------------------------------------------* FUNCTION TABLEPROC_ZSSF_FG . PERFORM TABLEPROC. ENDFUNCTION.
32
71
0.414773
c76bbc515f1d2faa10638b8a130e4a27ae0f8f36
6,281
abap
ABAP
src/ui/zcl_abapgit_ui_factory.clas.abap
habrahams/abapGit
1f3abfd8eccf6cc90351320cac80b84d8a94702c
[ "MIT" ]
1
2020-11-12T17:34:15.000Z
2020-11-12T17:34:15.000Z
src/ui/zcl_abapgit_ui_factory.clas.abap
habrahams/abapGit
1f3abfd8eccf6cc90351320cac80b84d8a94702c
[ "MIT" ]
1
2017-10-27T09:32:58.000Z
2017-10-27T09:32:58.000Z
src/ui/zcl_abapgit_ui_factory.clas.abap
habrahams/abapGit
1f3abfd8eccf6cc90351320cac80b84d8a94702c
[ "MIT" ]
1
2021-07-09T02:07:11.000Z
2021-07-09T02:07:11.000Z
CLASS zcl_abapgit_ui_factory DEFINITION PUBLIC CREATE PRIVATE GLOBAL FRIENDS zcl_abapgit_ui_injector . PUBLIC SECTION. CLASS-METHODS get_asset_manager RETURNING VALUE(ri_asset_man) TYPE REF TO zif_abapgit_gui_asset_manager RAISING zcx_abapgit_exception . CLASS-METHODS get_popups RETURNING VALUE(ri_popups) TYPE REF TO zif_abapgit_popups . CLASS-METHODS get_tag_popups RETURNING VALUE(ri_tag_popups) TYPE REF TO zif_abapgit_tag_popups . CLASS-METHODS get_gui_functions RETURNING VALUE(ri_gui_functions) TYPE REF TO zif_abapgit_gui_functions . CLASS-METHODS get_gui RETURNING VALUE(ro_gui) TYPE REF TO zcl_abapgit_gui RAISING zcx_abapgit_exception . CLASS-METHODS get_gui_services RETURNING VALUE(ri_gui_services) TYPE REF TO zif_abapgit_gui_services RAISING zcx_abapgit_exception . CLASS-METHODS get_frontend_services RETURNING VALUE(ri_fe_serv) TYPE REF TO zif_abapgit_frontend_services . CLASS-METHODS get_html_viewer RETURNING VALUE(ri_viewer) TYPE REF TO zif_abapgit_html_viewer . PROTECTED SECTION. PRIVATE SECTION. CLASS-DATA gi_popups TYPE REF TO zif_abapgit_popups . CLASS-DATA gi_tag_popups TYPE REF TO zif_abapgit_tag_popups . CLASS-DATA gi_gui_functions TYPE REF TO zif_abapgit_gui_functions . CLASS-DATA gi_html_viewer TYPE REF TO zif_abapgit_html_viewer . CLASS-DATA go_gui TYPE REF TO zcl_abapgit_gui . CLASS-DATA gi_fe_services TYPE REF TO zif_abapgit_frontend_services . CLASS-DATA gi_gui_services TYPE REF TO zif_abapgit_gui_services . ENDCLASS. CLASS ZCL_ABAPGIT_UI_FACTORY IMPLEMENTATION. METHOD get_asset_manager. DATA lo_buf TYPE REF TO lcl_string_buffer. DATA lo_asset_man TYPE REF TO zcl_abapgit_gui_asset_manager. CREATE OBJECT lo_buf. CREATE OBJECT lo_asset_man. " @@abapmerge include zabapgit_css_common.w3mi.data.css > lo_buf->add( '$$' ). lo_asset_man->register_asset( iv_url = 'css/common.css' iv_type = 'text/css' iv_mime_name = 'ZABAPGIT_CSS_COMMON' iv_inline = lo_buf->join_w_newline_and_flush( ) ). " @@abapmerge include zabapgit_css_theme_default.w3mi.data.css > lo_buf->add( '$$' ). lo_asset_man->register_asset( iv_url = 'css/theme-default.css' iv_type = 'text/css' iv_cachable = abap_false iv_mime_name = 'ZABAPGIT_CSS_THEME_DEFAULT' iv_inline = lo_buf->join_w_newline_and_flush( ) ). " @@abapmerge include zabapgit_css_theme_dark.w3mi.data.css > lo_buf->add( '$$' ). lo_asset_man->register_asset( iv_url = 'css/theme-dark.css' iv_type = 'text/css' iv_cachable = abap_false iv_mime_name = 'ZABAPGIT_CSS_THEME_DARK' iv_inline = lo_buf->join_w_newline_and_flush( ) ). " @@abapmerge include zabapgit_css_theme_belize_blue.w3mi.data.css > lo_buf->add( '$$' ). lo_asset_man->register_asset( iv_url = 'css/theme-belize-blue.css' iv_type = 'text/css' iv_cachable = abap_false iv_mime_name = 'ZABAPGIT_CSS_THEME_BELIZE_BLUE' iv_inline = lo_buf->join_w_newline_and_flush( ) ). " @@abapmerge include zabapgit_js_common.w3mi.data.js > lo_buf->add( '$$' ). lo_asset_man->register_asset( iv_url = 'js/common.js' iv_type = 'text/javascript' iv_mime_name = 'ZABAPGIT_JS_COMMON' iv_inline = lo_buf->join_w_newline_and_flush( ) ). " @@abapmerge include zabapgit_icon_font_css.w3mi.data.css > lo_buf->add( '$$' ). lo_asset_man->register_asset( iv_url = 'css/ag-icons.css' iv_type = 'text/css' iv_mime_name = 'ZABAPGIT_ICON_FONT_CSS' iv_inline = lo_buf->join_w_newline_and_flush( ) ). " @@abapmerge include-base64 zabapgit_icon_font.w3mi.data.woff > lo_buf->add( '$$' ). lo_asset_man->register_asset( iv_url = 'font/ag-icons.woff' iv_type = 'font/woff' iv_mime_name = 'ZABAPGIT_ICON_FONT' iv_base64 = lo_buf->join_and_flush( ) ). ri_asset_man = lo_asset_man. ENDMETHOD. METHOD get_frontend_services. IF gi_fe_services IS INITIAL. CREATE OBJECT gi_fe_services TYPE zcl_abapgit_frontend_services. ENDIF. ri_fe_serv = gi_fe_services. ENDMETHOD. METHOD get_gui. DATA: li_hotkey_ctl TYPE REF TO zif_abapgit_gui_hotkey_ctl, li_router TYPE REF TO zif_abapgit_gui_event_handler, li_asset_man TYPE REF TO zif_abapgit_gui_asset_manager. DATA lo_html_preprocessor TYPE REF TO zcl_abapgit_gui_html_processor. IF go_gui IS INITIAL. li_asset_man = get_asset_manager( ). CREATE OBJECT lo_html_preprocessor EXPORTING ii_asset_man = li_asset_man. lo_html_preprocessor->preserve_css( 'css/ag-icons.css' ). lo_html_preprocessor->preserve_css( 'css/common.css' ). CREATE OBJECT li_router TYPE zcl_abapgit_gui_router. CREATE OBJECT li_hotkey_ctl TYPE zcl_abapgit_hotkeys. CREATE OBJECT go_gui EXPORTING io_component = li_router ii_hotkey_ctl = li_hotkey_ctl ii_html_processor = lo_html_preprocessor ii_asset_man = li_asset_man. ENDIF. ro_gui = go_gui. ENDMETHOD. METHOD get_gui_functions. IF gi_gui_functions IS INITIAL. CREATE OBJECT gi_gui_functions TYPE zcl_abapgit_gui_functions. ENDIF. ri_gui_functions = gi_gui_functions. ENDMETHOD. METHOD get_gui_services. IF gi_gui_services IS NOT BOUND. gi_gui_services ?= get_gui( ). ENDIF. ri_gui_services = gi_gui_services. ENDMETHOD. METHOD get_html_viewer. IF gi_html_viewer IS BOUND. ri_viewer = gi_html_viewer. RETURN. ENDIF. CREATE OBJECT ri_viewer TYPE zcl_abapgit_html_viewer_gui. ENDMETHOD. METHOD get_popups. IF gi_popups IS INITIAL. CREATE OBJECT gi_popups TYPE zcl_abapgit_popups. ENDIF. ri_popups = gi_popups. ENDMETHOD. METHOD get_tag_popups. IF gi_tag_popups IS INITIAL. CREATE OBJECT gi_tag_popups TYPE zcl_abapgit_tag_popups. ENDIF. ri_tag_popups = gi_tag_popups. ENDMETHOD. ENDCLASS.
29.350467
93
0.700844
c76bc5cd2db252954ae1b8b6e7bde3aa2409f3b7
7,544
abap
ABAP
src/ycl_addict_domain.clas.abap
tricktresor/addict
558afbc66aa9716b2223660d237106421d071de2
[ "Apache-2.0" ]
8
2020-10-30T13:19:02.000Z
2022-01-04T19:28:37.000Z
src/ycl_addict_domain.clas.abap
aufaraditya/addict
4f2e19ea1d2ffbf228bfd5cc0231cd17b792b372
[ "Apache-2.0" ]
22
2020-10-19T13:35:53.000Z
2022-02-10T12:55:54.000Z
src/ycl_addict_domain.clas.abap
aufaraditya/addict
4f2e19ea1d2ffbf228bfd5cc0231cd17b792b372
[ "Apache-2.0" ]
6
2020-11-03T21:39:50.000Z
2022-03-10T02:21:41.000Z
CLASS ycl_addict_domain DEFINITION PUBLIC FINAL CREATE PRIVATE . PUBLIC SECTION. TYPES: BEGIN OF line_dict, value TYPE val_single, text TYPE val_text, END OF line_dict, line_set TYPE HASHED TABLE OF line_dict WITH UNIQUE KEY primary_key COMPONENTS value. DATA def TYPE dd01l READ-ONLY. CLASS-METHODS get_instance IMPORTING !domname TYPE domname RETURNING VALUE(output) TYPE REF TO ycl_addict_domain RAISING ycx_addict_table_content. CLASS-METHODS get_value_text_safe IMPORTING !domname TYPE domname !value TYPE val_single RETURNING VALUE(output) TYPE val_text. METHODS get_text RETURNING VALUE(output) TYPE ddtext. METHODS get_value_line IMPORTING value TYPE val_single RETURNING VALUE(output) TYPE line_dict RAISING ycx_addict_domain. METHODS get_value_tab RETURNING VALUE(output) TYPE line_set. METHODS get_value_text IMPORTING !value TYPE val_single RETURNING VALUE(output) TYPE val_text RAISING ycx_addict_domain. METHODS validate_value IMPORTING !value TYPE val_single RAISING ycx_addict_domain ycx_addict_table_content. PROTECTED SECTION. PRIVATE SECTION. TYPES: BEGIN OF lazy_flag_dict, text_read TYPE abap_bool, value_text_read TYPE abap_bool, END OF lazy_flag_dict. TYPES: BEGIN OF multiton_dict, domname TYPE domname, obj TYPE REF TO ycl_addict_domain, END OF multiton_dict, multiton_set TYPE HASHED TABLE OF multiton_dict WITH UNIQUE KEY primary_key COMPONENTS domname. CONSTANTS: BEGIN OF table, def TYPE tabname VALUE 'DD01L', END OF table. CLASS-DATA multitons TYPE multiton_set. DATA lazy_flag TYPE lazy_flag_dict. DATA lines TYPE line_set. DATA text TYPE ddtext. METHODS ensure_text_read. METHODS ensure_value_read. ENDCLASS. CLASS ycl_addict_domain IMPLEMENTATION. METHOD ensure_text_read. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Lazy reads texts """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" CHECK me->lazy_flag-text_read = abap_false. SELECT SINGLE ddtext FROM dd01t "#EC CI_NOORDER WHERE domname = @me->def-domname AND ddlanguage = @sy-langu INTO @me->text ##WARN_OK. IF sy-subrc <> 0. SELECT SINGLE ddtext FROM dd01t "#EC CI_NOORDER WHERE domname = @me->def-domname INTO @me->text ##WARN_OK. ENDIF. me->lazy_flag-text_read = abap_true. ENDMETHOD. METHOD ensure_value_read. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Lazy read values """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" CHECK me->lazy_flag-value_text_read = abap_false. SELECT dd07l~domvalue_l AS value, "#EC CI_BUFFJOIN dd07t~ddtext AS text FROM dd07l LEFT JOIN dd07t ON dd07t~domname = dd07l~domname AND dd07t~ddlanguage = @sy-langu AND dd07t~as4local = dd07l~as4local AND dd07t~valpos = dd07l~valpos AND dd07t~as4vers = dd07l~as4vers WHERE dd07l~domname = @me->def-domname INTO CORRESPONDING FIELDS OF TABLE @me->lines. me->lazy_flag-value_text_read = abap_true. ENDMETHOD. METHOD get_instance. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Multiton factory """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ASSIGN ycl_addict_domain=>multitons[ KEY primary_key COMPONENTS domname = domname ] TO FIELD-SYMBOL(<multiton>). IF sy-subrc <> 0. DATA(multiton) = VALUE multiton_dict( domname = domname ). multiton-obj = NEW #( ). SELECT SINGLE * FROM dd01l "#EC CI_NOORDER WHERE domname = @multiton-domname INTO @multiton-obj->def ##WARN_OK. IF sy-subrc <> 0. RAISE EXCEPTION TYPE ycx_addict_table_content EXPORTING textid = ycx_addict_table_content=>no_entry_for_objectid objectid = CONV #( multiton-domname ) tabname = ycl_addict_domain=>table-def. ENDIF. INSERT multiton INTO TABLE ycl_addict_domain=>multitons ASSIGNING <multiton>. ENDIF. output = <multiton>-obj. ENDMETHOD. METHOD get_text. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Returns domain text """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ensure_text_read( ). output = me->text. ENDMETHOD. METHOD get_value_line. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Returns a value line """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ensure_value_read( ). ASSIGN me->lines[ KEY primary_key COMPONENTS value = value ] TO FIELD-SYMBOL(<line>). IF sy-subrc <> 0. RAISE EXCEPTION TYPE ycx_addict_domain EXPORTING textid = ycx_addict_domain=>invalid_value domname = me->def-domname domvalue_l = value. ENDIF. output = <line>. ENDMETHOD. METHOD get_value_tab. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Returns all domain values """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" ensure_value_read( ). output = me->lines. ENDMETHOD. METHOD get_value_text. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Returns the text of a given domain value """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" output = get_value_line( value )-text. ENDMETHOD. METHOD get_value_text_safe. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Returns the text of a value without generating an exception """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" TRY. output = get_instance( domname )->get_value_text( value ). CATCH cx_root. output = value. ENDTRY. ENDMETHOD. METHOD validate_value. """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Ensures that the passed value is valid within the domain """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" DATA dummy TYPE string. ensure_value_read( ). IF me->lines IS NOT INITIAL. get_value_line( value ). RETURN. ENDIF. IF me->def-entitytab IS NOT INITIAL. DATA(table_keys) = ycl_addict_table=>get_instance( me->def-entitytab )->get_key_fields( with_mandt = abap_false ). DATA(table_key) = table_keys[ 1 ]-fieldname. DATA(where) = |{ table_key } = '{ value }'|. SELECT SINGLE (table_key) INTO dummy FROM (me->def-entitytab) WHERE (where). IF sy-subrc <> 0. RAISE EXCEPTION TYPE ycx_addict_domain EXPORTING textid = ycx_addict_domain=>invalid_value domname = me->def-domname domvalue_l = value. ENDIF. ENDIF. ENDMETHOD. ENDCLASS.
30.54251
120
0.514581
c77668c16bbe79abe619a8ec753658f2f53e8132
2,257
abap
ABAP
src/zcx_ajson_error.clas.abap
fistofzen/ajson
5fb234652053cd858c8090c4b9c10e1e63ba12bc
[ "MIT" ]
23
2020-07-13T17:11:24.000Z
2022-03-16T07:40:50.000Z
src/zcx_ajson_error.clas.abap
MikeSidorochkin/ajson
bcc0a2889c98f8399bbf4f01e0e9eb42d0a66bf6
[ "MIT" ]
86
2020-07-13T16:56:37.000Z
2022-03-26T10:37:59.000Z
src/zcx_ajson_error.clas.abap
MikeSidorochkin/ajson
bcc0a2889c98f8399bbf4f01e0e9eb42d0a66bf6
[ "MIT" ]
14
2020-07-29T19:10:14.000Z
2021-11-08T08:45:58.000Z
class ZCX_AJSON_ERROR definition public inheriting from CX_STATIC_CHECK final create public . public section. interfaces IF_T100_MESSAGE . types: ty_rc type c length 4 . constants: begin of ZCX_AJSON_ERROR, msgid type symsgid value '00', msgno type symsgno value '001', attr1 type scx_attrname value 'A1', attr2 type scx_attrname value 'A2', attr3 type scx_attrname value 'A3', attr4 type scx_attrname value 'A4', end of ZCX_AJSON_ERROR . data RC type TY_RC read-only . data MESSAGE type STRING read-only . data LOCATION type STRING read-only . data A1 type SYMSGV read-only . data A2 type SYMSGV read-only . data A3 type SYMSGV read-only . data A4 type SYMSGV read-only . methods CONSTRUCTOR importing !TEXTID like IF_T100_MESSAGE=>T100KEY optional !PREVIOUS like PREVIOUS optional !RC type TY_RC optional !MESSAGE type STRING optional !LOCATION type STRING optional !A1 type SYMSGV optional !A2 type SYMSGV optional !A3 type SYMSGV optional !A4 type SYMSGV optional . class-methods RAISE importing !IV_MSG type STRING !IV_LOCATION type STRING optional raising ZCX_AJSON_ERROR . protected section. private section. ENDCLASS. CLASS ZCX_AJSON_ERROR IMPLEMENTATION. method CONSTRUCTOR. CALL METHOD SUPER->CONSTRUCTOR EXPORTING PREVIOUS = PREVIOUS . me->RC = RC . me->MESSAGE = MESSAGE . me->LOCATION = LOCATION . me->A1 = A1 . me->A2 = A2 . me->A3 = A3 . me->A4 = A4 . clear me->textid. if textid is initial. IF_T100_MESSAGE~T100KEY = ZCX_AJSON_ERROR . else. IF_T100_MESSAGE~T100KEY = TEXTID. endif. endmethod. method raise. data: begin of ls_msg, a1 like a1, a2 like a1, a3 like a1, a4 like a1, end of ls_msg. if iv_location is initial. ls_msg = iv_msg. else. data lv_tmp type string. lv_tmp = iv_msg && | @{ iv_location }|. ls_msg = lv_tmp. endif. raise exception type zcx_ajson_error exporting textid = zcx_ajson_error message = iv_msg location = iv_location a1 = ls_msg-a1 a2 = ls_msg-a2 a3 = ls_msg-a3 a4 = ls_msg-a4. endmethod. ENDCLASS.
20.898148
52
0.667257
c777c89c9d73727ce38818fa11d34f7898f486fb
1,634
abap
ABAP
src/cross/zcx_dbbr_ui_exception.clas.abap
reichr-dev/abap-db-browser
d513d49692f1f0ee613c8eab2c99e325ef5b78fe
[ "MIT" ]
15
2020-02-05T10:38:12.000Z
2022-02-11T18:06:17.000Z
src/cross/zcx_dbbr_ui_exception.clas.abap
reichr-dev/abap-db-browser
d513d49692f1f0ee613c8eab2c99e325ef5b78fe
[ "MIT" ]
10
2021-01-19T07:45:37.000Z
2021-07-15T19:08:54.000Z
src/cross/zcx_dbbr_ui_exception.clas.abap
reichr-dev/abap-db-browser
d513d49692f1f0ee613c8eab2c99e325ef5b78fe
[ "MIT" ]
9
2020-04-08T19:13:18.000Z
2021-10-02T12:53:39.000Z
CLASS ZCX_DBBR_ui_exception DEFINITION PUBLIC INHERITING FROM cx_no_check FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES if_t100_message . DATA msgv1 TYPE sy-msgv1 . DATA msgv2 TYPE sy-msgv2 . DATA msgv3 TYPE sy-msgv3 . DATA msgv4 TYPE sy-msgv4 . METHODS constructor IMPORTING !textid LIKE if_t100_message=>t100key OPTIONAL !previous LIKE previous OPTIONAL !msgv1 TYPE sy-msgv1 OPTIONAL !msgv2 TYPE sy-msgv2 OPTIONAL !msgv3 TYPE sy-msgv3 OPTIONAL !msgv4 TYPE sy-msgv4 OPTIONAL . METHODS show_message IMPORTING !iv_message_type LIKE sy-msgty DEFAULT 'E' !iv_display_type TYPE sy-msgty DEFAULT 'E' . PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS ZCX_DBBR_ui_exception IMPLEMENTATION. METHOD constructor ##ADT_SUPPRESS_GENERATION. super->constructor( previous = previous ). me->msgv1 = msgv1 . me->msgv2 = msgv2 . me->msgv3 = msgv3 . me->msgv4 = msgv4 . CLEAR me->textid. IF textid IS INITIAL. if_t100_message~t100key = if_t100_message=>default_textid. ELSE. if_t100_message~t100key = textid. ENDIF. ENDMETHOD. METHOD show_message. *& Description: Prints message "only" from current exception *&---------------------------------------------------------------------* MESSAGE ID if_t100_message~t100key-msgid TYPE iv_message_type NUMBER if_t100_message~t100key-msgno WITH msgv1 msgv2 msgv3 msgv4 DISPLAY LIKE iv_display_type. ENDMETHOD. ENDCLASS.
25.138462
72
0.633415
c77b8599a7226fb6a390171e90f82a7dbb6bc543
12,709
abap
ABAP
src/ui/zcl_abapgit_gui_page_boverview.clas.abap
ravishankarojha/abapGit
4bc4b63e0fcf5389457db5a36de643fe75977c2a
[ "MIT" ]
1
2019-09-11T20:57:34.000Z
2019-09-11T20:57:34.000Z
src/ui/zcl_abapgit_gui_page_boverview.clas.abap
ravishankarojha/abapGit
4bc4b63e0fcf5389457db5a36de643fe75977c2a
[ "MIT" ]
null
null
null
src/ui/zcl_abapgit_gui_page_boverview.clas.abap
ravishankarojha/abapGit
4bc4b63e0fcf5389457db5a36de643fe75977c2a
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_gui_page_boverview DEFINITION PUBLIC FINAL CREATE PUBLIC INHERITING FROM zcl_abapgit_gui_page. PUBLIC SECTION. INTERFACES: zif_abapgit_gui_page_hotkey. METHODS: constructor IMPORTING io_repo TYPE REF TO zcl_abapgit_repo_online RAISING zcx_abapgit_exception, zif_abapgit_gui_page~on_event REDEFINITION. PROTECTED SECTION. METHODS render_content REDEFINITION. PRIVATE SECTION. DATA: mo_repo TYPE REF TO zcl_abapgit_repo_online, mv_compress TYPE abap_bool VALUE abap_false, mt_commits TYPE zif_abapgit_definitions=>ty_commit_tt, mi_branch_overview TYPE REF TO zif_abapgit_branch_overview. CONSTANTS: BEGIN OF c_actions, uncompress TYPE string VALUE 'uncompress' ##NO_TEXT, compress TYPE string VALUE 'compress' ##NO_TEXT, refresh TYPE string VALUE 'refresh' ##NO_TEXT, merge TYPE string VALUE 'merge' ##NO_TEXT, END OF c_actions. TYPES: BEGIN OF ty_merge, source TYPE string, target TYPE string, END OF ty_merge. METHODS: refresh RAISING zcx_abapgit_exception, body RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html RAISING zcx_abapgit_exception, form_select IMPORTING iv_name TYPE string RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html, render_merge RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html RAISING zcx_abapgit_exception, decode_merge IMPORTING it_postdata TYPE cnht_post_data_tab RETURNING VALUE(rs_merge) TYPE ty_merge RAISING zcx_abapgit_exception, build_menu RETURNING VALUE(ro_menu) TYPE REF TO zcl_abapgit_html_toolbar, escape_branch IMPORTING iv_string TYPE string RETURNING VALUE(rv_string) TYPE string, escape_message IMPORTING iv_string TYPE string RETURNING VALUE(rv_string) TYPE string, render_commit_popups RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html RAISING zcx_abapgit_exception. ENDCLASS. CLASS zcl_abapgit_gui_page_boverview IMPLEMENTATION. METHOD body. DATA: lv_tag TYPE string, lv_branch_display_name TYPE string. FIELD-SYMBOLS: <ls_commit> LIKE LINE OF mt_commits, <ls_create> LIKE LINE OF <ls_commit>-create. CREATE OBJECT ro_html. ro_html->add( zcl_abapgit_gui_chunk_lib=>render_repo_top( io_repo = mo_repo iv_show_package = abap_false iv_show_branch = abap_false ) ). ro_html->add( '<br>' ). ro_html->add( '<br>' ). ro_html->add( render_merge( ) ). ro_html->add( '<br>' ). ro_html->add( build_menu( )->render( ) ). * see http://stackoverflow.com/questions/6081483/maximum-size-of-a-canvas-element ro_html->add( '<canvas id="gitGraph"></canvas>' ). ro_html->add( '<script type="text/javascript" src="https://cdnjs.' && 'cloudflare.com/ajax/libs/gitgraph.js/1.14.0/gitgraph.min.js">' && '</script>' ) ##NO_TEXT. ro_html->add( '<script type="text/javascript">' ). ro_html->add( 'var myTemplateConfig = {' ). ro_html->add( 'colors: [ "#979797", "#008fb5", "#f1c109", "' && '#095256", "#087F8C", "#5AAA95", "#86A873", "#BB9F06" ],' ) ##NO_TEXT. ro_html->add( 'branch: {' ). ro_html->add( ' lineWidth: 8,' ). ro_html->add( ' spacingX: 50' ). ro_html->add( '},' ). ro_html->add( 'commit: {' ). ro_html->add( ' spacingY: -40,' ). ro_html->add( ' dot: { size: 12 },' ). ro_html->add( ' message: { font: "normal 14pt Arial" }' ). ro_html->add( '}' ). ro_html->add( '};' ). ro_html->add( 'var gitgraph = new GitGraph({' ). ro_html->add( ' template: myTemplateConfig,' ). ro_html->add( ' orientation: "vertical-reverse"' ). ro_html->add( '});' ). ro_html->add( 'var gBranchOveriew = new BranchOverview();' ). LOOP AT mt_commits ASSIGNING <ls_commit>. IF sy-tabix = 1. " assumption: all branches are created from master, todo ro_html->add( |var { escape_branch( <ls_commit>-branch ) } = gitgraph.branch("{ <ls_commit>-branch }");| ). ENDIF. IF <ls_commit>-branch IS INITIAL. CONTINUE. " we skip orphaned commits ENDIF. IF <ls_commit>-compressed = abap_true. ro_html->add( |{ escape_branch( <ls_commit>-branch ) }.commit(\{message: "{ escape_message( <ls_commit>-message ) }", dotColor: "black", dotSize: 15, messageHashDisplay: false, messageAuthorDisplay: false\});| ). ELSEIF <ls_commit>-merge IS INITIAL. " gitgraph doesn't support multiple tags per commit yet. " Therefore we concatenate them. " https://github.com/nicoespeon/gitgraph.js/issues/143 lv_tag = concat_lines_of( table = <ls_commit>-tags sep = ` | ` ). ro_html->add( |{ escape_branch( <ls_commit>-branch ) }.commit(\{message: "{ escape_message( <ls_commit>-message ) }", long: "{ escape_message( concat_lines_of( table = <ls_commit>-body sep = ` ` ) ) }", author: "{ <ls_commit>-author }", sha1: "{ <ls_commit>-sha1(7) }", tag: "{ lv_tag }", onClick:gBranchOveriew.onCommitClick.bind(gBranchOveriew)\});| ). ELSE. ro_html->add( |{ escape_branch( <ls_commit>-merge ) }.merge({ escape_branch( <ls_commit>-branch ) }, \{message: "{ escape_message( <ls_commit>-message ) }", long: "{ escape_message( concat_lines_of( table = <ls_commit>-body sep = ` ` ) ) }", author: "{ <ls_commit>-author }", sha1: "{ <ls_commit>-sha1(7) }", onClick:gBranchOveriew.onCommitClick.bind(gBranchOveriew)\});| ). ENDIF. LOOP AT <ls_commit>-create ASSIGNING <ls_create>. IF <ls_create>-name CS zcl_abapgit_branch_overview=>c_deleted_branch_name_prefix. lv_branch_display_name = ''. ELSE. lv_branch_display_name = <ls_create>-name. ENDIF. ro_html->add( |var { escape_branch( <ls_create>-name ) } = { escape_branch( <ls_create>-parent ) }.branch("{ lv_branch_display_name }");| ). ENDLOOP. ENDLOOP. ro_html->add( |gitGraph.addEventListener( "commit:mouseover", gBranchOveriew.showCommit.bind(gBranchOveriew) );| ). ro_html->add( |gitGraph.addEventListener( "commit:mouseout", gBranchOveriew.hideCommit.bind(gBranchOveriew) );| ). ro_html->add( '</script>' ). ro_html->add( render_commit_popups( ) ). ENDMETHOD. METHOD build_menu. CREATE OBJECT ro_menu. IF mv_compress = abap_true. ro_menu->add( iv_txt = 'Uncompress Graph' iv_act = c_actions-uncompress ) ##NO_TEXT. ELSE. ro_menu->add( iv_txt = 'Compress Graph' iv_act = c_actions-compress ) ##NO_TEXT. ENDIF. ro_menu->add( iv_txt = 'Refresh' iv_act = c_actions-refresh ) ##NO_TEXT. ENDMETHOD. METHOD constructor. super->constructor( ). ms_control-page_title = 'BRANCH_OVERVIEW'. mo_repo = io_repo. refresh( ). ENDMETHOD. METHOD decode_merge. DATA: lv_string TYPE string, lt_fields TYPE tihttpnvp. FIELD-SYMBOLS: <ls_field> LIKE LINE OF lt_fields. CONCATENATE LINES OF it_postdata INTO lv_string. lt_fields = zcl_abapgit_html_action_utils=>parse_fields( lv_string ). READ TABLE lt_fields ASSIGNING <ls_field> WITH KEY name = 'source' ##NO_TEXT. ASSERT sy-subrc = 0. rs_merge-source = <ls_field>-value. READ TABLE lt_fields ASSIGNING <ls_field> WITH KEY name = 'target' ##NO_TEXT. ASSERT sy-subrc = 0. rs_merge-target = <ls_field>-value. ENDMETHOD. METHOD escape_branch. rv_string = iv_string. TRANSLATE rv_string USING '-_._'. rv_string = |branch_{ rv_string }|. ENDMETHOD. METHOD escape_message. rv_string = iv_string. REPLACE ALL OCCURRENCES OF '"' IN rv_string WITH '\"'. ENDMETHOD. METHOD form_select. DATA: lv_name TYPE string, lt_branches TYPE zif_abapgit_definitions=>ty_git_branch_list_tt. FIELD-SYMBOLS: <ls_branch> LIKE LINE OF lt_branches. CREATE OBJECT ro_html. lt_branches = mi_branch_overview->get_branches( ). ro_html->add( |<select name="{ iv_name }">| ). LOOP AT lt_branches ASSIGNING <ls_branch>. lv_name = <ls_branch>-name+11. ro_html->add( |<option value="{ lv_name }">{ lv_name }</option>| ). ENDLOOP. ro_html->add( '</select>' ). ENDMETHOD. METHOD refresh. mi_branch_overview = zcl_abapgit_factory=>get_branch_overview( mo_repo ). mt_commits = mi_branch_overview->get_commits( ). IF mv_compress = abap_true. mt_commits = mi_branch_overview->compress( mt_commits ). ENDIF. ENDMETHOD. METHOD render_content. CREATE OBJECT ro_html. ro_html->add( '<div id="toc">' ). ro_html->add( body( ) ). ro_html->add( '</div>' ). ENDMETHOD. METHOD render_merge. CREATE OBJECT ro_html. ro_html->add( '<form id="commit_form" method="post" action="sapevent:merge">' ). ro_html->add( 'Merge' ) ##NO_TEXT. ro_html->add( form_select( 'source' ) ) ##NO_TEXT. ro_html->add( 'into' ) ##NO_TEXT. ro_html->add( form_select( 'target' ) ) ##NO_TEXT. ro_html->add( '<input type="submit" value="Submit">' ). ro_html->add( '</form>' ). ENDMETHOD. METHOD zif_abapgit_gui_page_hotkey~get_hotkey_actions. ENDMETHOD. METHOD zif_abapgit_gui_page~on_event. DATA: ls_merge TYPE ty_merge, lo_merge TYPE REF TO zcl_abapgit_gui_page_merge. CASE iv_action. WHEN c_actions-refresh. refresh( ). ev_state = zif_abapgit_definitions=>c_event_state-re_render. WHEN c_actions-uncompress. mv_compress = abap_false. refresh( ). ev_state = zif_abapgit_definitions=>c_event_state-re_render. WHEN c_actions-compress. mv_compress = abap_true. refresh( ). ev_state = zif_abapgit_definitions=>c_event_state-re_render. WHEN c_actions-merge. ls_merge = decode_merge( it_postdata ). CREATE OBJECT lo_merge EXPORTING io_repo = mo_repo iv_source = ls_merge-source iv_target = ls_merge-target. ei_page = lo_merge. ev_state = zif_abapgit_definitions=>c_event_state-new_page. ENDCASE. ENDMETHOD. METHOD render_commit_popups. DATA: lv_time TYPE char10, lv_date TYPE sy-datum, lv_content TYPE string. FIELD-SYMBOLS: <ls_commit> LIKE LINE OF mt_commits. CREATE OBJECT ro_html. LOOP AT mt_commits ASSIGNING <ls_commit>. CLEAR: lv_time, lv_date. PERFORM p6_to_date_time_tz IN PROGRAM rstr0400 USING <ls_commit>-time lv_time lv_date. lv_content = |<table class="commit">| && | <tr>| && | <td class="title">Author</td>| && | <td>{ <ls_commit>-author }</td>| && | </tr>| && | <tr>| && | <td class="title">SHA1</td>| && | <td>{ <ls_commit>-sha1 }</td>| && | </tr>| && | <tr>| && | <td class="title">Date/Time</td>| && | <td>{ lv_date DATE = USER }</td>| && | </tr>| && | <tr>| && | <td class="title">Message</td>| && | <td>{ <ls_commit>-message }</td>| && | </tr>| && | <tr>|. IF <ls_commit>-body IS NOT INITIAL. lv_content = lv_content && |<td class="title">Body</td>| && |<td>{ concat_lines_of( table = <ls_commit>-body sep = |<br/>| ) }</td>|. ENDIF. lv_content = lv_content && | </tr>| && |</table>|. ro_html->add( zcl_abapgit_gui_chunk_lib=>render_commit_popup( iv_id = <ls_commit>-sha1(7) iv_content = lv_content ) ). ENDLOOP. ENDMETHOD. ENDCLASS.
30.772397
118
0.585884
c77fdf7eed710e4718ad5fbb815b7062c0f1b14c
15,186
abap
ABAP
lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zcl_gtt_mia_ctp_snd_sh_to_dli.clas.abap
rakshitha-1234/logistics-business-network-gtt-standardapps-samples
3d1e3249046c0112ff33f524d30cde2ac9f38b4c
[ "Apache-2.0" ]
null
null
null
lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zcl_gtt_mia_ctp_snd_sh_to_dli.clas.abap
rakshitha-1234/logistics-business-network-gtt-standardapps-samples
3d1e3249046c0112ff33f524d30cde2ac9f38b4c
[ "Apache-2.0" ]
null
null
null
lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zcl_gtt_mia_ctp_snd_sh_to_dli.clas.abap
rakshitha-1234/logistics-business-network-gtt-standardapps-samples
3d1e3249046c0112ff33f524d30cde2ac9f38b4c
[ "Apache-2.0" ]
null
null
null
CLASS zcl_gtt_mia_ctp_snd_sh_to_dli DEFINITION PUBLIC INHERITING FROM zcl_gtt_mia_ctp_snd CREATE PRIVATE . PUBLIC SECTION. CLASS-METHODS get_instance RETURNING VALUE(ro_sender) TYPE REF TO zcl_gtt_mia_ctp_snd_sh_to_dli RAISING cx_udm_message . METHODS prepare_idoc_data IMPORTING !io_ship_data TYPE REF TO zcl_gtt_mia_ctp_shipment_data RAISING cx_udm_message . PROTECTED SECTION. METHODS get_aotype_restriction_id REDEFINITION . METHODS get_object_type REDEFINITION . PRIVATE SECTION. CONSTANTS: BEGIN OF cs_mapping, vbeln TYPE /saptrx/paramname VALUE 'YN_DLV_NO', posnr TYPE /saptrx/paramname VALUE 'YN_DLV_ITEM_NO', END OF cs_mapping . METHODS fill_idoc_appobj_ctabs IMPORTING !is_aotype TYPE zif_gtt_mia_ctp_tor_types=>ts_aotype !is_lips TYPE zcl_gtt_mia_ctp_shipment_data=>ts_lips CHANGING !cs_idoc_data TYPE zif_gtt_mia_ctp_tor_types=>ts_idoc_data . METHODS fill_idoc_control_data IMPORTING !is_aotype TYPE zif_gtt_mia_ctp_tor_types=>ts_aotype !is_ship TYPE zcl_gtt_mia_ctp_shipment_data=>ts_shipment_merge !is_likp TYPE zcl_gtt_mia_ctp_shipment_data=>ts_likpex !is_lips TYPE zcl_gtt_mia_ctp_shipment_data=>ts_lips !is_stops TYPE zcl_gtt_mia_ctp_shipment_data=>ts_stops CHANGING !cs_idoc_data TYPE zif_gtt_mia_ctp_tor_types=>ts_idoc_data RAISING cx_udm_message . METHODS fill_idoc_exp_event IMPORTING !is_aotype TYPE zif_gtt_mia_ctp_tor_types=>ts_aotype !is_ship TYPE zcl_gtt_mia_ctp_shipment_data=>ts_shipment_merge !is_likp TYPE zcl_gtt_mia_ctp_shipment_data=>ts_likpex !is_lips TYPE zcl_gtt_mia_ctp_shipment_data=>ts_lips !is_stops TYPE zcl_gtt_mia_ctp_shipment_data=>ts_stops CHANGING !cs_idoc_data TYPE zif_gtt_mia_ctp_tor_types=>ts_idoc_data RAISING cx_udm_message . METHODS fill_idoc_tracking_id IMPORTING !is_aotype TYPE zif_gtt_mia_ctp_tor_types=>ts_aotype !is_ship TYPE zcl_gtt_mia_ctp_shipment_data=>ts_shipment_merge !is_likp TYPE zcl_gtt_mia_ctp_shipment_data=>ts_likpex !is_lips TYPE zcl_gtt_mia_ctp_shipment_data=>ts_lips CHANGING !cs_idoc_data TYPE zif_gtt_mia_ctp_tor_types=>ts_idoc_data RAISING cx_udm_message . METHODS get_shipment_stop IMPORTING !is_stops TYPE zcl_gtt_mia_ctp_shipment_data=>ts_stops !is_vbfa TYPE zcl_gtt_mia_ctp_shipment_data=>ts_vbfaex !iv_arrival TYPE abap_bool RETURNING VALUE(rv_stop) TYPE zif_gtt_mia_app_types=>tv_stopid . CLASS-METHODS get_delivery_item_tracking_id IMPORTING !is_lips TYPE zcl_gtt_mia_ctp_shipment_data=>ts_lips RETURNING VALUE(rv_tracking_id) TYPE /saptrx/trxid . METHODS is_pod_relevant IMPORTING !is_ship TYPE zcl_gtt_mia_ctp_shipment_data=>ts_shipment_merge !is_lips TYPE zcl_gtt_mia_ctp_shipment_data=>ts_lips !is_stops TYPE zif_gtt_mia_app_types=>ts_stops RETURNING VALUE(rv_result) TYPE abap_bool . ENDCLASS. CLASS ZCL_GTT_MIA_CTP_SND_SH_TO_DLI IMPLEMENTATION. METHOD fill_idoc_appobj_ctabs. cs_idoc_data-appobj_ctabs = VALUE #( BASE cs_idoc_data-appobj_ctabs ( trxservername = cs_idoc_data-trxserv-trx_server_id appobjtype = is_aotype-aot_type appobjid = get_delivery_item_tracking_id( is_lips = is_lips ) ) ). ENDMETHOD. METHOD fill_idoc_control_data. DATA: lt_control TYPE /saptrx/bapi_trk_control_tab . " DLV Item key data (obligatory) lt_control = VALUE #( ( paramname = cs_mapping-vbeln value = is_lips-vbeln ) ( paramname = cs_mapping-posnr value = is_lips-posnr ) ( paramname = zif_gtt_mia_ef_constants=>cs_system_fields-actual_bisiness_timezone value = zcl_gtt_mia_tools=>get_system_time_zone( ) ) ( paramname = zif_gtt_mia_ef_constants=>cs_system_fields-actual_bisiness_datetime value = |0{ sy-datum }{ sy-uzeit }| ) ( paramname = zif_gtt_mia_ef_constants=>cs_system_fields-actual_technical_timezone value = zcl_gtt_mia_tools=>get_system_time_zone( ) ) ( paramname = zif_gtt_mia_ef_constants=>cs_system_fields-actual_technical_datetime value = |0{ sy-datum }{ sy-uzeit }| ) ). " fill technical data into all control data records LOOP AT lt_control ASSIGNING FIELD-SYMBOL(<ls_control>). <ls_control>-appsys = mv_appsys. <ls_control>-appobjtype = is_aotype-aot_type. <ls_control>-appobjid = get_delivery_item_tracking_id( is_lips = is_lips ). ENDLOOP. cs_idoc_data-control = VALUE #( BASE cs_idoc_data-control ( LINES OF lt_control ) ). ENDMETHOD. METHOD fill_idoc_exp_event. DATA: lt_exp_event TYPE /saptrx/bapi_trk_ee_tab, lt_exp_event_dlv TYPE /saptrx/bapi_trk_ee_tab, lv_milestonenum TYPE /saptrx/seq_num VALUE 1, lv_tknum TYPE tknum. " delivery item events zcl_gtt_mia_ctp_tools=>get_delivery_item_planned_evt( EXPORTING iv_appsys = mv_appsys is_aotype = is_aotype is_likp = CORRESPONDING #( is_likp ) is_lips = CORRESPONDING #( is_lips ) IMPORTING et_exp_event = lt_exp_event_dlv ). LOOP AT lt_exp_event_dlv TRANSPORTING NO FIELDS WHERE ( milestone = zif_gtt_mia_app_constants=>cs_milestone-sh_arrival OR milestone = zif_gtt_mia_app_constants=>cs_milestone-sh_departure OR milestone = zif_gtt_mia_app_constants=>cs_milestone-sh_pod ). DELETE lt_exp_event_dlv. ENDLOOP. " shipment events LOOP AT is_stops-watching ASSIGNING FIELD-SYMBOL(<ls_watching>) WHERE vbeln = is_lips-vbeln. IF lv_tknum <> <ls_watching>-stopid(10). lv_tknum = <ls_watching>-stopid(10). lv_milestonenum = 1. ENDIF. READ TABLE is_stops-stops ASSIGNING FIELD-SYMBOL(<ls_stops>) WITH KEY stopid = <ls_watching>-stopid loccat = <ls_watching>-loccat. IF sy-subrc = 0. " Departure / Arrival lt_exp_event = VALUE #( BASE lt_exp_event ( milestone = COND #( WHEN <ls_watching>-loccat = zif_gtt_mia_app_constants=>cs_loccat-departure THEN zif_gtt_mia_app_constants=>cs_milestone-sh_departure ELSE zif_gtt_mia_app_constants=>cs_milestone-sh_arrival ) locid2 = <ls_stops>-stopid loctype = <ls_stops>-loctype locid1 = zcl_gtt_mia_tools=>get_pretty_location_id( iv_locid = <ls_stops>-locid iv_loctype = <ls_stops>-loctype ) evt_exp_datetime = <ls_stops>-pln_evt_datetime evt_exp_tzone = <ls_stops>-pln_evt_timezone milestonenum = lv_milestonenum ) ). ADD 1 TO lv_milestonenum. " POD IF <ls_stops>-loccat = zif_gtt_mia_app_constants=>cs_loccat-arrival AND <ls_stops>-loctype = zif_gtt_mia_ef_constants=>cs_loc_types-plant AND is_pod_relevant( is_ship = is_ship is_lips = is_lips is_stops = <ls_stops> ) = abap_true. lt_exp_event = VALUE #( BASE lt_exp_event ( milestone = zif_gtt_mia_app_constants=>cs_milestone-sh_pod locid2 = <ls_stops>-stopid loctype = <ls_stops>-loctype locid1 = zcl_gtt_mia_tools=>get_pretty_location_id( iv_locid = <ls_stops>-locid iv_loctype = <ls_stops>-loctype ) evt_exp_datetime = <ls_stops>-pln_evt_datetime evt_exp_tzone = <ls_stops>-pln_evt_timezone milestonenum = lv_milestonenum ) ). ADD 1 TO lv_milestonenum. ENDIF. ELSE. MESSAGE e005(zgtt_mia) WITH |{ <ls_watching>-stopid }{ <ls_watching>-loccat }| 'STOPS' INTO DATA(lv_dummy). zcl_gtt_mia_tools=>throw_exception( ). ENDIF. ENDLOOP. " fill sequence number in DLV events lv_milestonenum = zcl_gtt_mia_tools=>get_next_sequence_id( it_expeventdata = lt_exp_event ). LOOP AT lt_exp_event_dlv ASSIGNING FIELD-SYMBOL(<ls_exp_event_dlv>). <ls_exp_event_dlv>-milestonenum = lv_milestonenum. ADD 1 TO lv_milestonenum. ENDLOOP. lt_exp_event = VALUE #( BASE lt_exp_event ( LINES OF lt_exp_event_dlv ) ). IF lt_exp_event[] IS INITIAL. lt_exp_event = VALUE #( ( milestone = '' locid2 = '' loctype = '' locid1 = '' evt_exp_datetime = '000000000000000' evt_exp_tzone = '' ) ). ENDIF. LOOP AT lt_exp_event ASSIGNING FIELD-SYMBOL(<ls_exp_event>). <ls_exp_event>-appsys = mv_appsys. <ls_exp_event>-appobjtype = is_aotype-aot_type. <ls_exp_event>-appobjid = get_delivery_item_tracking_id( is_lips = is_lips ). <ls_exp_event>-language = sy-langu. <ls_exp_event>-evt_exp_tzone = zcl_gtt_mia_tools=>get_system_time_zone( ). ENDLOOP. cs_idoc_data-exp_event = VALUE #( BASE cs_idoc_data-exp_event ( LINES OF lt_exp_event ) ). ENDMETHOD. METHOD fill_idoc_tracking_id. * "another tip is that: for tracking ID type 'SHIPMENT_ORDER' of delivery header, * "and for tracking ID type 'RESOURCE' of shipment header, * "DO NOT enable START DATE and END DATE " Delivery Item cs_idoc_data-tracking_id = VALUE #( BASE cs_idoc_data-tracking_id ( appsys = mv_appsys appobjtype = is_aotype-aot_type appobjid = get_delivery_item_tracking_id( is_lips = is_lips ) trxcod = zif_gtt_mia_app_constants=>cs_trxcod-dl_position trxid = get_delivery_item_tracking_id( is_lips = is_lips ) timzon = zcl_gtt_mia_tools=>get_system_time_zone( ) ) ). ENDMETHOD. METHOD get_aotype_restriction_id. rv_rst_id = 'SH_TO_IDLI'. ENDMETHOD. METHOD get_delivery_item_tracking_id. rv_tracking_id = |{ is_lips-vbeln }{ is_lips-posnr }|. ENDMETHOD. METHOD get_instance. DATA(lt_trk_obj_type) = VALUE zif_gtt_mia_ctp_tor_types=>tt_trk_obj_type( ( zif_gtt_mia_ef_constants=>cs_trk_obj_type-esc_shipmt ) ( zif_gtt_mia_ef_constants=>cs_trk_obj_type-esc_deliv ) ). IF is_gtt_enabled( it_trk_obj_type = lt_trk_obj_type ) = abap_true. ro_sender = NEW #( ). ro_sender->initiate( ). ELSE. MESSAGE e006(zgtt_mia) INTO DATA(lv_dummy). zcl_gtt_mia_tools=>throw_exception( ). ENDIF. ENDMETHOD. METHOD get_object_type. rv_objtype = zif_gtt_mia_ef_constants=>cs_trk_obj_type-esc_deliv. ENDMETHOD. METHOD get_shipment_stop. LOOP AT is_stops-watching ASSIGNING FIELD-SYMBOL(<ls_watching>) WHERE vbeln = is_vbfa-vbelv AND stopid(10) = is_vbfa-vbeln. rv_stop = <ls_watching>-stopid. IF iv_arrival = abap_false. EXIT. ENDIF. ENDLOOP. ENDMETHOD. METHOD is_pod_relevant. CLEAR: rv_result. IF is_stops-locid = is_lips-werks AND is_stops-loctype = zif_gtt_mia_ef_constants=>cs_loc_types-plant. READ TABLE is_ship-ee_rel ASSIGNING FIELD-SYMBOL(<ls_ee_rel>) WITH TABLE KEY appobjid = |{ is_lips-vbeln }{ is_lips-posnr }|. rv_result = boolc( sy-subrc = 0 AND <ls_ee_rel>-z_pdstk = abap_true ). ENDIF. ENDMETHOD. METHOD prepare_idoc_data. " fill DLV Item " control data " YN_DLV_NO " YN_DLV_ITEM_NO " ACTUAL_BUSINESS_TIMEZONE " ACTUAL_BUSINESS_DATETIME " planned events " PUTAWAY " PACKING " GOODS_RECEIPT " DEPARTURE " ARRIV_DEST " POD DATA: ls_idoc_data TYPE zif_gtt_mia_ctp_tor_types=>ts_idoc_data. DATA(lr_ship) = io_ship_data->get_data( ). DATA(lr_stops) = io_ship_data->get_stops( ). FIELD-SYMBOLS: <ls_ship> TYPE zcl_gtt_mia_ctp_shipment_data=>ts_shipment_merge, <lt_stops> TYPE zcl_gtt_mia_ctp_shipment_data=>tt_stops_srt. ASSIGN lr_ship->* TO <ls_ship>. ASSIGN lr_stops->* TO <lt_stops>. LOOP AT mt_aotype ASSIGNING FIELD-SYMBOL(<ls_aotype>). CLEAR: ls_idoc_data. ls_idoc_data-appsys = mv_appsys. fill_idoc_trxserv( EXPORTING is_aotype = <ls_aotype> CHANGING cs_idoc_data = ls_idoc_data ). LOOP AT <ls_ship>-likp ASSIGNING FIELD-SYMBOL(<ls_likp>). READ TABLE <lt_stops> ASSIGNING FIELD-SYMBOL(<ls_stops>) WITH TABLE KEY tknum = <ls_likp>-tknum. IF sy-subrc = 0. LOOP AT <ls_ship>-likp\lips[ <ls_likp> ] ASSIGNING FIELD-SYMBOL(<ls_lips>). fill_idoc_appobj_ctabs( EXPORTING is_aotype = <ls_aotype> is_lips = <ls_lips> CHANGING cs_idoc_data = ls_idoc_data ). fill_idoc_control_data( EXPORTING is_aotype = <ls_aotype> is_ship = <ls_ship> is_likp = <ls_likp> is_lips = <ls_lips> is_stops = <ls_stops> CHANGING cs_idoc_data = ls_idoc_data ). fill_idoc_exp_event( EXPORTING is_aotype = <ls_aotype> is_ship = <ls_ship> is_likp = <ls_likp> is_lips = <ls_lips> is_stops = <ls_stops> CHANGING cs_idoc_data = ls_idoc_data ). fill_idoc_tracking_id( EXPORTING is_aotype = <ls_aotype> is_ship = <ls_ship> is_likp = <ls_likp> is_lips = <ls_lips> CHANGING cs_idoc_data = ls_idoc_data ). ENDLOOP. ELSE. MESSAGE e005(zgtt_mia) WITH |{ <ls_likp>-tknum }| 'STOPS' INTO DATA(lv_dummy). zcl_gtt_mia_tools=>throw_exception( ). ENDIF. ENDLOOP. IF ls_idoc_data-appobj_ctabs[] IS NOT INITIAL AND ls_idoc_data-control[] IS NOT INITIAL AND ls_idoc_data-tracking_id[] IS NOT INITIAL. APPEND ls_idoc_data TO mt_idoc_data. ENDIF. ENDLOOP. ENDMETHOD. ENDCLASS.
33.013043
114
0.62235
c784398bd866df9228b7e222ea2595a25aef2f29
45,908
abap
ABAP
src/objects/zcl_abapgit_objects.clas.abap
absap/abapGit
5468985b5760da157ee4089bbf872ed5700a74e2
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_objects.clas.abap
absap/abapGit
5468985b5760da157ee4089bbf872ed5700a74e2
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_objects.clas.abap
absap/abapGit
5468985b5760da157ee4089bbf872ed5700a74e2
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_objects DEFINITION PUBLIC CREATE PUBLIC . PUBLIC SECTION. TYPES: ty_types_tt TYPE SORTED TABLE OF tadir-object WITH UNIQUE KEY table_line. TYPES: BEGIN OF ty_deserialization, obj TYPE REF TO zif_abapgit_object, xml TYPE REF TO zcl_abapgit_xml_input, package TYPE devclass, item TYPE zif_abapgit_definitions=>ty_item, END OF ty_deserialization . TYPES: ty_deserialization_tt TYPE STANDARD TABLE OF ty_deserialization WITH DEFAULT KEY . TYPES: BEGIN OF ty_serialization, files TYPE zif_abapgit_definitions=>ty_files_tt, item TYPE zif_abapgit_definitions=>ty_item, END OF ty_serialization . CLASS-METHODS serialize IMPORTING !is_item TYPE zif_abapgit_definitions=>ty_item !iv_language TYPE spras !iv_serialize_master_lang_only TYPE abap_bool DEFAULT abap_false RETURNING VALUE(rs_files_and_item) TYPE ty_serialization RAISING zcx_abapgit_exception . CLASS-METHODS deserialize IMPORTING !io_repo TYPE REF TO zcl_abapgit_repo !is_checks TYPE zif_abapgit_definitions=>ty_deserialize_checks !ii_log TYPE REF TO zif_abapgit_log RETURNING VALUE(rt_accessed_files) TYPE zif_abapgit_definitions=>ty_file_signatures_tt RAISING zcx_abapgit_exception . CLASS-METHODS deserialize_checks IMPORTING !io_repo TYPE REF TO zcl_abapgit_repo RETURNING VALUE(rs_checks) TYPE zif_abapgit_definitions=>ty_deserialize_checks RAISING zcx_abapgit_exception . CLASS-METHODS delete IMPORTING !it_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt !is_checks TYPE zif_abapgit_definitions=>ty_delete_checks OPTIONAL RAISING zcx_abapgit_exception . CLASS-METHODS jump IMPORTING !is_item TYPE zif_abapgit_definitions=>ty_item !iv_line_number TYPE i OPTIONAL iv_sub_obj_name TYPE zif_abapgit_definitions=>ty_item-obj_name OPTIONAL iv_sub_obj_type TYPE zif_abapgit_definitions=>ty_item-obj_type OPTIONAL RAISING zcx_abapgit_exception . CLASS-METHODS changed_by IMPORTING !is_item TYPE zif_abapgit_definitions=>ty_item RETURNING VALUE(rv_user) TYPE xubname RAISING zcx_abapgit_exception . CLASS-METHODS is_supported IMPORTING !is_item TYPE zif_abapgit_definitions=>ty_item !iv_native_only TYPE abap_bool DEFAULT abap_false RETURNING VALUE(rv_bool) TYPE abap_bool . CLASS-METHODS exists IMPORTING !is_item TYPE zif_abapgit_definitions=>ty_item RETURNING VALUE(rv_bool) TYPE abap_bool . CLASS-METHODS supported_list RETURNING VALUE(rt_types) TYPE ty_types_tt . CLASS-METHODS is_active IMPORTING !is_item TYPE zif_abapgit_definitions=>ty_item RETURNING VALUE(rv_active) TYPE abap_bool RAISING zcx_abapgit_exception . PROTECTED SECTION. PRIVATE SECTION. TYPES: BEGIN OF ty_obj_serializer_map, item TYPE zif_abapgit_definitions=>ty_item, metadata TYPE zif_abapgit_definitions=>ty_metadata, END OF ty_obj_serializer_map . TYPES: tty_obj_serializer_map TYPE SORTED TABLE OF ty_obj_serializer_map WITH UNIQUE KEY item . CLASS-DATA gt_obj_serializer_map TYPE tty_obj_serializer_map . CLASS-METHODS files_to_deserialize IMPORTING !io_repo TYPE REF TO zcl_abapgit_repo !ii_log TYPE REF TO zif_abapgit_log OPTIONAL RETURNING VALUE(rt_results) TYPE zif_abapgit_definitions=>ty_results_tt RAISING zcx_abapgit_exception . CLASS-METHODS check_duplicates IMPORTING !it_files TYPE zif_abapgit_definitions=>ty_files_tt RAISING zcx_abapgit_exception . CLASS-METHODS prioritize_deser IMPORTING !it_results TYPE zif_abapgit_definitions=>ty_results_tt RETURNING VALUE(rt_results) TYPE zif_abapgit_definitions=>ty_results_tt . CLASS-METHODS class_name IMPORTING !is_item TYPE zif_abapgit_definitions=>ty_item RETURNING VALUE(rv_class_name) TYPE string . CLASS-METHODS warning_overwrite_adjust IMPORTING !it_overwrite TYPE zif_abapgit_definitions=>ty_overwrite_tt CHANGING !ct_results TYPE zif_abapgit_definitions=>ty_results_tt RAISING zcx_abapgit_exception . CLASS-METHODS checks_adjust IMPORTING !io_repo TYPE REF TO zcl_abapgit_repo !is_checks TYPE zif_abapgit_definitions=>ty_deserialize_checks CHANGING !ct_results TYPE zif_abapgit_definitions=>ty_results_tt RAISING zcx_abapgit_exception . CLASS-METHODS warning_overwrite_find IMPORTING !it_results TYPE zif_abapgit_definitions=>ty_results_tt RETURNING VALUE(rt_overwrite) TYPE zif_abapgit_definitions=>ty_overwrite_tt . CLASS-METHODS warning_package_adjust IMPORTING !io_repo TYPE REF TO zcl_abapgit_repo !it_overwrite TYPE zif_abapgit_definitions=>ty_overwrite_tt CHANGING !ct_results TYPE zif_abapgit_definitions=>ty_results_tt RAISING zcx_abapgit_exception . CLASS-METHODS warning_package_find IMPORTING !it_results TYPE zif_abapgit_definitions=>ty_results_tt !io_repo TYPE REF TO zcl_abapgit_repo RETURNING VALUE(rt_overwrite) TYPE zif_abapgit_definitions=>ty_overwrite_tt RAISING zcx_abapgit_exception . CLASS-METHODS update_package_tree IMPORTING !iv_package TYPE devclass . CLASS-METHODS delete_obj IMPORTING !iv_package TYPE devclass !is_item TYPE zif_abapgit_definitions=>ty_item RAISING zcx_abapgit_exception . CLASS-METHODS compare_remote_to_local IMPORTING !ii_object TYPE REF TO zif_abapgit_object !it_remote TYPE zif_abapgit_definitions=>ty_files_tt !is_result TYPE zif_abapgit_definitions=>ty_result !ii_log TYPE REF TO zif_abapgit_log RAISING zcx_abapgit_exception . CLASS-METHODS deserialize_objects IMPORTING !is_step TYPE zif_abapgit_definitions=>ty_step_data !ii_log TYPE REF TO zif_abapgit_log CHANGING !ct_files TYPE zif_abapgit_definitions=>ty_file_signatures_tt RAISING zcx_abapgit_exception . CLASS-METHODS check_objects_locked IMPORTING !iv_language TYPE spras !it_items TYPE zif_abapgit_definitions=>ty_items_tt RAISING zcx_abapgit_exception . CLASS-METHODS create_object IMPORTING !is_item TYPE zif_abapgit_definitions=>ty_item !iv_language TYPE spras !is_metadata TYPE zif_abapgit_definitions=>ty_metadata OPTIONAL !iv_native_only TYPE abap_bool DEFAULT abap_false RETURNING VALUE(ri_obj) TYPE REF TO zif_abapgit_object RAISING zcx_abapgit_exception . CLASS-METHODS map_tadir_to_items IMPORTING !it_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt RETURNING VALUE(rt_items) TYPE zif_abapgit_definitions=>ty_items_tt . CLASS-METHODS map_results_to_items IMPORTING !it_results TYPE zif_abapgit_definitions=>ty_results_tt RETURNING VALUE(rt_items) TYPE zif_abapgit_definitions=>ty_items_tt . CLASS-METHODS filter_files_to_deserialize IMPORTING !it_results TYPE zif_abapgit_definitions=>ty_results_tt !ii_log TYPE REF TO zif_abapgit_log OPTIONAL RETURNING VALUE(rt_results) TYPE zif_abapgit_definitions=>ty_results_tt . CLASS-METHODS adjust_namespaces IMPORTING !it_results TYPE zif_abapgit_definitions=>ty_results_tt RETURNING VALUE(rt_results) TYPE zif_abapgit_definitions=>ty_results_tt . CLASS-METHODS get_deserialize_steps RETURNING VALUE(rt_steps) TYPE zif_abapgit_definitions=>ty_step_data_tt . ENDCLASS. CLASS ZCL_ABAPGIT_OBJECTS IMPLEMENTATION. METHOD adjust_namespaces. FIELD-SYMBOLS: <ls_result> LIKE LINE OF rt_results. rt_results = it_results. LOOP AT rt_results ASSIGNING <ls_result>. REPLACE ALL OCCURRENCES OF '#' IN <ls_result>-obj_name WITH '/'. ENDLOOP. ENDMETHOD. METHOD changed_by. DATA: li_obj TYPE REF TO zif_abapgit_object. IF is_item IS NOT INITIAL. li_obj = create_object( is_item = is_item iv_language = zif_abapgit_definitions=>c_english ). rv_user = li_obj->changed_by( ). ENDIF. IF rv_user IS INITIAL. * eg. ".abapgit.xml" file rv_user = zcl_abapgit_objects_super=>c_user_unknown. ENDIF. * todo, fallback to looking at transports if rv_user = 'UNKNOWN'? ENDMETHOD. METHOD checks_adjust. warning_overwrite_adjust( EXPORTING it_overwrite = is_checks-overwrite CHANGING ct_results = ct_results ). warning_package_adjust( EXPORTING io_repo = io_repo it_overwrite = is_checks-warning_package CHANGING ct_results = ct_results ). ENDMETHOD. METHOD check_duplicates. DATA: lt_files TYPE zif_abapgit_definitions=>ty_files_tt, lv_path TYPE string, lv_filename TYPE string, lt_duplicates TYPE STANDARD TABLE OF string WITH DEFAULT KEY, lv_duplicates LIKE LINE OF lt_duplicates, lv_all_duplicates TYPE string. FIELD-SYMBOLS: <ls_file> LIKE LINE OF it_files. lt_files = it_files. SORT lt_files BY path ASCENDING filename ASCENDING. LOOP AT lt_files ASSIGNING <ls_file>. IF lv_path = <ls_file>-path AND lv_filename = <ls_file>-filename. CONCATENATE <ls_file>-path <ls_file>-filename INTO lv_duplicates. APPEND lv_duplicates TO lt_duplicates. ENDIF. lv_path = <ls_file>-path. lv_filename = <ls_file>-filename. ENDLOOP. IF lt_duplicates IS NOT INITIAL. CONCATENATE LINES OF lt_duplicates INTO lv_all_duplicates SEPARATED BY `, `. zcx_abapgit_exception=>raise( |Duplicates: { lv_all_duplicates }| ). ENDIF. ENDMETHOD. METHOD check_objects_locked. DATA: li_obj TYPE REF TO zif_abapgit_object. FIELD-SYMBOLS: <ls_item> LIKE LINE OF it_items. LOOP AT it_items ASSIGNING <ls_item>. " You should remember that we ignore not supported objects here, " because otherwise the process aborts which is not desired IF is_supported( <ls_item> ) = abap_false. CONTINUE. ENDIF. li_obj = create_object( is_item = <ls_item> iv_language = iv_language ). IF li_obj->is_locked( ) = abap_true. zcx_abapgit_exception=>raise( |Object { <ls_item>-obj_type } { <ls_item>-obj_name } | && |is locked. Action not possible.| ). ENDIF. ENDLOOP. ENDMETHOD. METHOD class_name. CONCATENATE 'ZCL_ABAPGIT_OBJECT_' is_item-obj_type INTO rv_class_name. "#EC NOTEXT ENDMETHOD. METHOD compare_remote_to_local. * this method is used for comparing local with remote objects * before pull, this is useful eg. when overwriting a TABL object. * only the main XML file is used for comparison DATA: ls_remote_file TYPE zif_abapgit_definitions=>ty_file, lo_remote_version TYPE REF TO zcl_abapgit_xml_input, lv_count TYPE i, ls_result TYPE zif_abapgit_comparator=>ty_result, lv_answer TYPE string, li_comparator TYPE REF TO zif_abapgit_comparator, lv_gui_is_available TYPE abap_bool, ls_item TYPE zif_abapgit_definitions=>ty_item. FIND ALL OCCURRENCES OF '.' IN is_result-filename MATCH COUNT lv_count. IF is_result-filename CS '.XML' AND lv_count = 2. IF ii_object->exists( ) = abap_false. RETURN. ENDIF. READ TABLE it_remote WITH KEY filename = is_result-filename INTO ls_remote_file. IF sy-subrc <> 0. "if file does not exist in remote, we don't need to validate RETURN. ENDIF. li_comparator = ii_object->get_comparator( ). IF NOT li_comparator IS BOUND. RETURN. ENDIF. CREATE OBJECT lo_remote_version EXPORTING iv_xml = zcl_abapgit_convert=>xstring_to_string_utf8( ls_remote_file-data ) iv_filename = ls_remote_file-filename. ls_result = li_comparator->compare( io_remote = lo_remote_version ii_log = ii_log ). IF ls_result-text IS INITIAL. RETURN. ENDIF. "log comparison result ls_item-obj_type = is_result-obj_type. ls_item-obj_name = is_result-obj_name. ii_log->add_warning( iv_msg = ls_result-text is_item = ls_item ). "continue or abort? lv_gui_is_available = zcl_abapgit_ui_factory=>get_gui_functions( )->gui_is_available( ). IF lv_gui_is_available = abap_true. CALL FUNCTION 'POPUP_TO_CONFIRM' EXPORTING titlebar = 'Warning' text_question = ls_result-text text_button_1 = 'Abort' icon_button_1 = 'ICON_CANCEL' text_button_2 = 'Pull anyway' icon_button_2 = 'ICON_OKAY' default_button = '2' display_cancel_button = abap_false IMPORTING answer = lv_answer EXCEPTIONS text_not_found = 1 OTHERS = 2. "#EC NOTEXT IF sy-subrc <> 0 OR lv_answer = 1. zcx_abapgit_exception=>raise( |Deserialization for object { is_result-obj_name } | & |(type { is_result-obj_type }) aborted by user| ). ENDIF. ELSE. zcx_abapgit_exception=>raise( |Deserialization for object { is_result-obj_name } | & |(type { is_result-obj_type }) aborted, user descision required| ). ENDIF. ENDIF. ENDMETHOD. METHOD create_object. DATA: lv_message TYPE string, lv_class_name TYPE string, ls_obj_serializer_map LIKE LINE OF gt_obj_serializer_map. READ TABLE gt_obj_serializer_map INTO ls_obj_serializer_map WITH KEY item = is_item. IF sy-subrc = 0. lv_class_name = ls_obj_serializer_map-metadata-class. ELSEIF is_metadata IS NOT INITIAL. * Metadata is provided only on serialization * Once this has been triggered, the same serializer shall be used * for subsequent processes. * Thus, buffer the metadata afterwards ls_obj_serializer_map-item = is_item. ls_obj_serializer_map-metadata = is_metadata. INSERT ls_obj_serializer_map INTO TABLE gt_obj_serializer_map. lv_class_name = is_metadata-class. ELSE. lv_class_name = class_name( is_item ). ENDIF. REPLACE FIRST OCCURRENCE OF 'LCL' IN lv_class_name WITH 'ZCL_ABAPGIT'. TRY. CREATE OBJECT ri_obj TYPE (lv_class_name) EXPORTING is_item = is_item iv_language = iv_language. CATCH cx_sy_create_object_error. lv_message = |Object type { is_item-obj_type } not supported, serialize|. "#EC NOTEXT IF iv_native_only = abap_false. TRY. " 2nd step, try looking for plugins CREATE OBJECT ri_obj TYPE zcl_abapgit_objects_bridge EXPORTING is_item = is_item. CATCH cx_sy_create_object_error. zcx_abapgit_exception=>raise( lv_message ). ENDTRY. ELSE. " No native support? -> fail zcx_abapgit_exception=>raise( lv_message ). ENDIF. ENDTRY. ENDMETHOD. METHOD delete. DATA: ls_item TYPE zif_abapgit_definitions=>ty_item, li_progress TYPE REF TO zif_abapgit_progress, lt_tadir LIKE it_tadir, lt_items TYPE zif_abapgit_definitions=>ty_items_tt, lx_error TYPE REF TO zcx_abapgit_exception, lv_text TYPE string. FIELD-SYMBOLS: <ls_tadir> LIKE LINE OF it_tadir. lt_tadir = it_tadir. IF is_checks-transport-required = abap_true. zcl_abapgit_default_transport=>get_instance( )->set( is_checks-transport-transport ). ENDIF. TRY. zcl_abapgit_dependencies=>resolve( CHANGING ct_tadir = lt_tadir ). li_progress = zcl_abapgit_progress=>get_instance( lines( lt_tadir ) ). lt_items = map_tadir_to_items( lt_tadir ). check_objects_locked( iv_language = zif_abapgit_definitions=>c_english it_items = lt_items ). LOOP AT lt_tadir ASSIGNING <ls_tadir>. li_progress->show( iv_current = sy-tabix iv_text = |Delete { <ls_tadir>-obj_name }| ) ##NO_TEXT. CLEAR ls_item. ls_item-obj_type = <ls_tadir>-object. ls_item-obj_name = <ls_tadir>-obj_name. delete_obj( iv_package = <ls_tadir>-devclass is_item = ls_item ). * make sure to save object deletions COMMIT WORK. ENDLOOP. CATCH zcx_abapgit_exception INTO lx_error. zcl_abapgit_default_transport=>get_instance( )->reset( ). lv_text = lx_error->get_text( ). zcx_abapgit_exception=>raise( lv_text ). ENDTRY. zcl_abapgit_default_transport=>get_instance( )->reset( ). ENDMETHOD. METHOD delete_obj. DATA: li_obj TYPE REF TO zif_abapgit_object. IF is_supported( is_item ) = abap_true. li_obj = create_object( is_item = is_item iv_language = zif_abapgit_definitions=>c_english ). li_obj->delete( iv_package ). IF li_obj->get_metadata( )-delete_tadir = abap_true. CALL FUNCTION 'TR_TADIR_INTERFACE' EXPORTING wi_delete_tadir_entry = abap_true wi_tadir_pgmid = 'R3TR' wi_tadir_object = is_item-obj_type wi_tadir_obj_name = is_item-obj_name wi_test_modus = abap_false EXCEPTIONS OTHERS = 1 ##FM_SUBRC_OK. " We deliberately ignore the subrc, because throwing an exception would " break the deletion of lots of object types. On the other hand we have " to catch the exceptions because otherwise messages would directly be issued " by the function module and change the control flow. Thus breaking the " deletion of TOBJ and other object types. " TODO: This is not very clean and has to be improved in the future. See PR 2741. ENDIF. ENDIF. ENDMETHOD. METHOD deserialize. DATA: ls_item TYPE zif_abapgit_definitions=>ty_item, li_obj TYPE REF TO zif_abapgit_object, lt_remote TYPE zif_abapgit_definitions=>ty_files_tt, lv_package TYPE devclass, lo_files TYPE REF TO zcl_abapgit_objects_files, lo_xml TYPE REF TO zcl_abapgit_xml_input, lt_results TYPE zif_abapgit_definitions=>ty_results_tt, li_progress TYPE REF TO zif_abapgit_progress, lv_path TYPE string, lt_items TYPE zif_abapgit_definitions=>ty_items_tt, lt_steps_id TYPE zif_abapgit_definitions=>ty_deserialization_step_tt, lt_steps TYPE zif_abapgit_definitions=>ty_step_data_tt, lx_exc TYPE REF TO zcx_abapgit_exception. DATA: lo_folder_logic TYPE REF TO zcl_abapgit_folder_logic. FIELD-SYMBOLS: <ls_result> TYPE zif_abapgit_definitions=>ty_result, <lv_step_id> TYPE LINE OF zif_abapgit_definitions=>ty_deserialization_step_tt, <ls_step> TYPE LINE OF zif_abapgit_definitions=>ty_step_data_tt, <ls_deser> TYPE LINE OF ty_deserialization_tt. lt_steps = get_deserialize_steps( ). lv_package = io_repo->get_package( ). IF is_checks-transport-required = abap_true. zcl_abapgit_default_transport=>get_instance( )->set( is_checks-transport-transport ). ENDIF. zcl_abapgit_objects_activation=>clear( ). lt_remote = io_repo->get_files_remote( ). lt_results = files_to_deserialize( io_repo = io_repo ii_log = ii_log ). checks_adjust( EXPORTING io_repo = io_repo is_checks = is_checks CHANGING ct_results = lt_results ). li_progress = zcl_abapgit_progress=>get_instance( lines( lt_results ) ). lt_items = map_results_to_items( lt_results ). check_objects_locked( iv_language = io_repo->get_dot_abapgit( )->get_master_language( ) it_items = lt_items ). lo_folder_logic = zcl_abapgit_folder_logic=>get_instance( ). LOOP AT lt_results ASSIGNING <ls_result>. li_progress->show( iv_current = sy-tabix iv_text = |Deserialize { <ls_result>-obj_name }| ) ##NO_TEXT. CLEAR ls_item. ls_item-obj_type = <ls_result>-obj_type. ls_item-obj_name = <ls_result>-obj_name. "error handling & logging added TRY. lv_package = lo_folder_logic->path_to_package( iv_top = io_repo->get_package( ) io_dot = io_repo->get_dot_abapgit( ) iv_path = <ls_result>-path ). IF ls_item-obj_type = 'DEVC'. " Packages have the same filename across different folders. The path needs to be supplied " to find the correct file. lv_path = <ls_result>-path. ENDIF. CREATE OBJECT lo_files EXPORTING is_item = ls_item iv_path = lv_path. lo_files->set_files( lt_remote ). "analyze XML in order to instantiate the proper serializer lo_xml = lo_files->read_xml( ). li_obj = create_object( is_item = ls_item iv_language = io_repo->get_dot_abapgit( )->get_master_language( ) is_metadata = lo_xml->get_metadata( ) ). compare_remote_to_local( ii_object = li_obj it_remote = lt_remote is_result = <ls_result> ii_log = ii_log ). li_obj->mo_files = lo_files. "get required steps for deserialize the object lt_steps_id = li_obj->get_deserialize_steps( ). LOOP AT lt_steps_id ASSIGNING <lv_step_id>. READ TABLE lt_steps WITH KEY step_id = <lv_step_id> ASSIGNING <ls_step>. ASSERT sy-subrc = 0. IF <ls_step>-is_ddic = abap_true AND li_obj->get_metadata( )-ddic = abap_false. " DDIC only for DDIC objects zcx_abapgit_exception=>raise( |Step { <lv_step_id> } is only for DDIC objects| ). ENDIF. APPEND INITIAL LINE TO <ls_step>-objects ASSIGNING <ls_deser>. <ls_deser>-item = ls_item. <ls_deser>-obj = li_obj. <ls_deser>-xml = lo_xml. <ls_deser>-package = lv_package. ENDLOOP. CLEAR: lv_path, lv_package. CATCH zcx_abapgit_exception INTO lx_exc. ii_log->add_exception( ix_exc = lx_exc is_item = ls_item ). ii_log->add_error( iv_msg = |Import of object { ls_item-obj_name } failed| is_item = ls_item ). "object should not be part of any deserialization step CONTINUE. ENDTRY. ENDLOOP. "run deserialize for all steps and it's objects SORT lt_steps BY order. LOOP AT lt_steps ASSIGNING <ls_step>. deserialize_objects( EXPORTING is_step = <ls_step> ii_log = ii_log CHANGING ct_files = rt_accessed_files ). ENDLOOP. update_package_tree( io_repo->get_package( ) ). SORT rt_accessed_files BY path ASCENDING filename ASCENDING. DELETE ADJACENT DUPLICATES FROM rt_accessed_files. " Just in case zcl_abapgit_default_transport=>get_instance( )->reset( ). ENDMETHOD. METHOD deserialize_checks. DATA: lt_results TYPE zif_abapgit_definitions=>ty_results_tt, li_package TYPE REF TO zif_abapgit_sap_package. lt_results = files_to_deserialize( io_repo ). rs_checks-overwrite = warning_overwrite_find( lt_results ). rs_checks-warning_package = warning_package_find( io_repo = io_repo it_results = lt_results ). IF lines( lt_results ) > 0. li_package = zcl_abapgit_factory=>get_sap_package( io_repo->get_package( ) ). rs_checks-transport-required = li_package->are_changes_recorded_in_tr_req( ). IF NOT rs_checks-transport-required IS INITIAL. rs_checks-transport-type = li_package->get_transport_type( ). ENDIF. ENDIF. ENDMETHOD. METHOD deserialize_objects. DATA: li_progress TYPE REF TO zif_abapgit_progress, li_exit TYPE REF TO zif_abapgit_exit, lx_exc TYPE REF TO zcx_abapgit_exception. FIELD-SYMBOLS: <ls_obj> LIKE LINE OF is_step-objects. zcl_abapgit_objects_activation=>clear( ). li_progress = zcl_abapgit_progress=>get_instance( lines( is_step-objects ) ). LOOP AT is_step-objects ASSIGNING <ls_obj>. li_progress->show( iv_current = sy-tabix iv_text = |Deserialize { is_step-descr } - { <ls_obj>-item-obj_name }| ) ##NO_TEXT. TRY. <ls_obj>-obj->deserialize( iv_package = <ls_obj>-package io_xml = <ls_obj>-xml iv_step = is_step-step_id ii_log = ii_log ). APPEND LINES OF <ls_obj>-obj->mo_files->get_accessed_files( ) TO ct_files. ii_log->add_success( iv_msg = |Object { <ls_obj>-item-obj_name } imported| is_item = <ls_obj>-item ). CATCH zcx_abapgit_exception INTO lx_exc. ii_log->add_exception( ix_exc = lx_exc is_item = <ls_obj>-item ). ii_log->add_error( iv_msg = |Import of object { <ls_obj>-item-obj_name } failed| is_item = <ls_obj>-item ). ENDTRY. ENDLOOP. CASE is_step-step_id. WHEN zif_abapgit_object=>gc_step_id-ddic. zcl_abapgit_objects_activation=>activate( is_step-is_ddic ). WHEN zif_abapgit_object=>gc_step_id-abap. zcl_abapgit_objects_activation=>activate( is_step-is_ddic ). WHEN zif_abapgit_object=>gc_step_id-late. " late can have both DDIC (like TABL with REF TO) and non-DDIC objects zcl_abapgit_objects_activation=>activate( abap_true ). zcl_abapgit_objects_activation=>activate( abap_false ). ENDCASE. * Call postprocessing li_exit = zcl_abapgit_exit=>get_instance( ). li_exit->deserialize_postprocess( is_step = is_step ii_log = ii_log ). ENDMETHOD. METHOD exists. DATA: li_obj TYPE REF TO zif_abapgit_object. TRY. li_obj = create_object( is_item = is_item iv_language = zif_abapgit_definitions=>c_english ). rv_bool = li_obj->exists( ). CATCH zcx_abapgit_exception. * ignore all errors and assume the object exists rv_bool = abap_true. ENDTRY. ENDMETHOD. METHOD files_to_deserialize. rt_results = adjust_namespaces( prioritize_deser( filter_files_to_deserialize( it_results = zcl_abapgit_file_status=>status( io_repo ) ii_log = ii_log ) ) ). ENDMETHOD. METHOD filter_files_to_deserialize. DATA lt_objects LIKE rt_results. DATA lr_object TYPE REF TO zif_abapgit_definitions=>ty_result. DATA ls_item TYPE zif_abapgit_definitions=>ty_item. DATA lv_tabix TYPE sy-tabix. rt_results = it_results. "preparation for object logging, sort all file entries by objects IF ii_log IS BOUND. lt_objects = rt_results. SORT lt_objects BY obj_type obj_name. DELETE ADJACENT DUPLICATES FROM lt_objects COMPARING obj_type obj_name. DELETE lt_objects WHERE obj_type IS INITIAL AND obj_name IS INITIAL. ENDIF. "ignore objects w/o changes DELETE rt_results WHERE match = abap_true. " Full match "log objects w/o changes IF sy-subrc = 0 AND ii_log IS BOUND. SORT rt_results BY obj_type obj_name. LOOP AT lt_objects REFERENCE INTO lr_object. lv_tabix = sy-tabix. READ TABLE rt_results WITH KEY obj_type = lr_object->obj_type obj_name = lr_object->obj_name BINARY SEARCH TRANSPORTING NO FIELDS. IF sy-subrc <> 0. "all parts of the objects have not changed ls_item-devclass = lr_object->package. ls_item-obj_type = lr_object->obj_type. ls_item-obj_name = lr_object->obj_name. ii_log->add_success( iv_msg = |Object { ls_item-obj_name } (type { ls_item-obj_type }) not changed; no import required| is_item = ls_item ). "ignore object for further messages DELETE lt_objects INDEX lv_tabix. ENDIF. ENDLOOP. ENDIF. "ignore objects w/o object type DELETE rt_results WHERE obj_type IS INITIAL. "log objects w/o object type IF sy-subrc = 0 AND ii_log IS BOUND. LOOP AT lt_objects REFERENCE INTO lr_object WHERE obj_type IS INITIAL. CHECK lr_object->obj_name IS NOT INITIAL. ls_item-devclass = lr_object->package. ls_item-obj_type = lr_object->obj_type. ls_item-obj_name = lr_object->obj_name. ii_log->add_warning( iv_msg = |Object type for { ls_item-obj_name } not defined - will be ignored by abapGit| is_item = ls_item ). ENDLOOP. DELETE lt_objects WHERE obj_type IS INITIAL. ENDIF. "ignore objects that exists only local DELETE rt_results WHERE lstate = zif_abapgit_definitions=>c_state-added AND rstate IS INITIAL. "log objects that exists only local IF sy-subrc = 0 AND ii_log IS BOUND. SORT rt_results BY obj_type obj_name. LOOP AT lt_objects REFERENCE INTO lr_object. lv_tabix = sy-tabix. READ TABLE rt_results WITH KEY obj_type = lr_object->obj_type obj_name = lr_object->obj_name BINARY SEARCH TRANSPORTING NO FIELDS. IF sy-subrc <> 0. "all parts exists only local "no log message; ignore object for further messages DELETE lt_objects INDEX lv_tabix. ENDIF. ENDLOOP. ENDIF. SORT rt_results BY obj_type ASCENDING obj_name ASCENDING rstate DESCENDING " ensures that non-empty rstate is kept lstate DESCENDING. " ensures that non-empty lstate is kept DELETE ADJACENT DUPLICATES FROM rt_results COMPARING obj_type obj_name. ENDMETHOD. METHOD get_deserialize_steps. FIELD-SYMBOLS: <ls_step> TYPE LINE OF zif_abapgit_definitions=>ty_step_data_tt. APPEND INITIAL LINE TO rt_steps ASSIGNING <ls_step>. <ls_step>-step_id = zif_abapgit_object=>gc_step_id-ddic. <ls_step>-descr = 'Import DDIC objects'. <ls_step>-is_ddic = abap_true. <ls_step>-syntax_check = abap_false. <ls_step>-order = 1. APPEND INITIAL LINE TO rt_steps ASSIGNING <ls_step>. <ls_step>-step_id = zif_abapgit_object=>gc_step_id-abap. <ls_step>-descr = 'Import objects main'. <ls_step>-is_ddic = abap_false. <ls_step>-syntax_check = abap_false. <ls_step>-order = 2. APPEND INITIAL LINE TO rt_steps ASSIGNING <ls_step>. <ls_step>-step_id = zif_abapgit_object=>gc_step_id-late. <ls_step>-descr = 'Import late objects'. <ls_step>-is_ddic = abap_false. <ls_step>-syntax_check = abap_true. <ls_step>-order = 3. ENDMETHOD. METHOD is_active. DATA: li_object TYPE REF TO zif_abapgit_object. TRY. li_object = create_object( is_item = is_item iv_language = sy-langu ). rv_active = li_object->is_active( ). CATCH cx_sy_dyn_call_illegal_method cx_sy_ref_is_initial zcx_abapgit_exception. rv_active = abap_true. ENDTRY. ENDMETHOD. METHOD is_supported. TRY. create_object( is_item = is_item iv_language = zif_abapgit_definitions=>c_english iv_native_only = iv_native_only ). rv_bool = abap_true. CATCH zcx_abapgit_exception. rv_bool = abap_false. ENDTRY. ENDMETHOD. METHOD jump. DATA: li_obj TYPE REF TO zif_abapgit_object, lv_adt_jump_enabled TYPE abap_bool. li_obj = create_object( is_item = is_item iv_language = zif_abapgit_definitions=>c_english ). IF li_obj->exists( ) = abap_false. zcx_abapgit_exception=>raise( |Object { is_item-obj_type } { is_item-obj_name } doesn't exist| ). ENDIF. lv_adt_jump_enabled = zcl_abapgit_persist_settings=>get_instance( )->read( )->get_adt_jump_enabled( ). IF lv_adt_jump_enabled = abap_true. TRY. zcl_abapgit_objects_super=>jump_adt( iv_obj_name = is_item-obj_name iv_obj_type = is_item-obj_type iv_sub_obj_name = iv_sub_obj_name iv_sub_obj_type = iv_sub_obj_type iv_line_number = iv_line_number ). CATCH zcx_abapgit_exception. li_obj->jump( ). ENDTRY. ELSEIF iv_line_number IS NOT INITIAL AND iv_sub_obj_type IS NOT INITIAL AND iv_sub_obj_name IS NOT INITIAL. " For the line navigation we have to supply the sub object type (i_sub_obj_type). " If we use is_item-obj_type it navigates only to the object. CALL FUNCTION 'RS_TOOL_ACCESS' EXPORTING operation = 'SHOW' object_name = is_item-obj_name object_type = iv_sub_obj_type include = iv_sub_obj_name position = iv_line_number in_new_window = abap_true EXCEPTIONS not_executed = 1 invalid_object_type = 2 OTHERS = 3. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ELSE. li_obj->jump( ). ENDIF. ENDMETHOD. METHOD map_results_to_items. DATA: ls_item LIKE LINE OF rt_items. FIELD-SYMBOLS: <ls_result> TYPE zif_abapgit_definitions=>ty_result. LOOP AT it_results ASSIGNING <ls_result>. ls_item-devclass = <ls_result>-package. ls_item-obj_type = <ls_result>-obj_type. ls_item-obj_name = <ls_result>-obj_name. INSERT ls_item INTO TABLE rt_items. ENDLOOP. ENDMETHOD. METHOD map_tadir_to_items. DATA: ls_item LIKE LINE OF rt_items. FIELD-SYMBOLS: <ls_tadir> TYPE zif_abapgit_definitions=>ty_tadir. LOOP AT it_tadir ASSIGNING <ls_tadir>. ls_item-devclass = <ls_tadir>-devclass. ls_item-obj_type = <ls_tadir>-object. ls_item-obj_name = <ls_tadir>-obj_name. INSERT ls_item INTO TABLE rt_items. ENDLOOP. ENDMETHOD. METHOD prioritize_deser. * todo, refactor this method FIELD-SYMBOLS: <ls_result> LIKE LINE OF it_results. * WEBI has to be handled before SPRX. LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'WEBI'. APPEND <ls_result> TO rt_results. ENDLOOP. * SPRX has to be handled before depended objects CLAS/INFT/TABL etc. LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'SPRX'. APPEND <ls_result> TO rt_results. ENDLOOP. * XSLT has to be handled before CLAS/PROG LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'XSLT'. APPEND <ls_result> TO rt_results. ENDLOOP. * PROG before internet services, as the services might use the screens LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'PROG'. APPEND <ls_result> TO rt_results. ENDLOOP. * ISAP has to be handled before ISRP LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'IASP'. APPEND <ls_result> TO rt_results. ENDLOOP. * ENHS has to be handled before ENHO LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'ENHS'. APPEND <ls_result> TO rt_results. ENDLOOP. * DDLS has to be handled before DCLS LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'DDLS'. APPEND <ls_result> TO rt_results. ENDLOOP. * IOBJ has to be handled before ODSO LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'IOBJ'. APPEND <ls_result> TO rt_results. ENDLOOP. * TOBJ has to be handled before SCP1 LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'TOBJ'. APPEND <ls_result> TO rt_results. ENDLOOP. * OTGR has to be handled before CHAR LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'OTGR'. APPEND <ls_result> TO rt_results. ENDLOOP. LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type <> 'IASP' AND obj_type <> 'PROG' AND obj_type <> 'XSLT' AND obj_type <> 'PINF' AND obj_type <> 'DEVC' AND obj_type <> 'ENHS' AND obj_type <> 'DDLS' AND obj_type <> 'SPRX' AND obj_type <> 'WEBI' AND obj_type <> 'IOBJ' AND obj_type <> 'TOBJ' AND obj_type <> 'OTGR'. APPEND <ls_result> TO rt_results. ENDLOOP. * PINF after everything as it can expose objects LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'PINF'. APPEND <ls_result> TO rt_results. ENDLOOP. * DEVC after PINF, as it can refer for package interface usage LOOP AT it_results ASSIGNING <ls_result> WHERE obj_type = 'DEVC'. APPEND <ls_result> TO rt_results. ENDLOOP. ENDMETHOD. METHOD serialize. DATA: li_obj TYPE REF TO zif_abapgit_object, lo_xml TYPE REF TO zcl_abapgit_xml_output, lo_files TYPE REF TO zcl_abapgit_objects_files. FIELD-SYMBOLS: <ls_file> LIKE LINE OF rs_files_and_item-files. rs_files_and_item-item = is_item. IF is_supported( rs_files_and_item-item ) = abap_false. zcx_abapgit_exception=>raise( |Object type ignored, not supported: { rs_files_and_item-item-obj_type }-{ rs_files_and_item-item-obj_name }| ). ENDIF. CREATE OBJECT lo_files EXPORTING is_item = rs_files_and_item-item. li_obj = create_object( is_item = rs_files_and_item-item iv_language = iv_language ). li_obj->mo_files = lo_files. CREATE OBJECT lo_xml. IF iv_serialize_master_lang_only = abap_true. lo_xml->i18n_params( iv_serialize_master_lang_only = abap_true ). ENDIF. li_obj->serialize( lo_xml ). lo_files->add_xml( io_xml = lo_xml is_metadata = li_obj->get_metadata( ) ). rs_files_and_item-files = lo_files->get_files( ). check_duplicates( rs_files_and_item-files ). rs_files_and_item-item-inactive = boolc( li_obj->is_active( ) = abap_false ). LOOP AT rs_files_and_item-files ASSIGNING <ls_file>. <ls_file>-sha1 = zcl_abapgit_hash=>sha1( iv_type = zif_abapgit_definitions=>c_type-blob iv_data = <ls_file>-data ). ENDLOOP. ENDMETHOD. METHOD supported_list. DATA: lt_objects TYPE STANDARD TABLE OF ko100, lv_supported TYPE abap_bool, ls_item TYPE zif_abapgit_definitions=>ty_item. FIELD-SYMBOLS <ls_object> LIKE LINE OF lt_objects. CALL FUNCTION 'TR_OBJECT_TABLE' TABLES wt_object_text = lt_objects EXCEPTIONS OTHERS = 1 ##FM_SUBRC_OK. LOOP AT lt_objects ASSIGNING <ls_object> WHERE pgmid = 'R3TR'. ls_item-obj_type = <ls_object>-object. lv_supported = is_supported( is_item = ls_item iv_native_only = abap_true ). IF lv_supported = abap_true. INSERT <ls_object>-object INTO TABLE rt_types. ENDIF. ENDLOOP. ENDMETHOD. METHOD update_package_tree. DATA: lt_packages TYPE zif_abapgit_sap_package=>ty_devclass_tt, lv_package LIKE LINE OF lt_packages, lv_tree TYPE dirtree-tname. lt_packages = zcl_abapgit_factory=>get_sap_package( iv_package )->list_subpackages( ). APPEND iv_package TO lt_packages. LOOP AT lt_packages INTO lv_package. * update package tree for SE80 lv_tree = 'EU_' && lv_package. CALL FUNCTION 'WB_TREE_ACTUALIZE' EXPORTING tree_name = lv_tree without_crossreference = abap_true with_tcode_index = abap_true. ENDLOOP. ENDMETHOD. METHOD warning_overwrite_adjust. DATA: lt_overwrite LIKE it_overwrite, ls_overwrite LIKE LINE OF lt_overwrite. FIELD-SYMBOLS: <ls_overwrite> LIKE LINE OF lt_overwrite. * make sure to get the current status, as something might have changed in the meanwhile lt_overwrite = warning_overwrite_find( ct_results ). LOOP AT lt_overwrite ASSIGNING <ls_overwrite>. READ TABLE it_overwrite INTO ls_overwrite WITH TABLE KEY object_type_and_name COMPONENTS obj_type = <ls_overwrite>-obj_type obj_name = <ls_overwrite>-obj_name. IF sy-subrc <> 0 OR ls_overwrite-decision IS INITIAL. zcx_abapgit_exception=>raise( |Overwrite { <ls_overwrite>-obj_type } { <ls_overwrite>-obj_name } undecided| ). ENDIF. IF ls_overwrite-decision = 'N'. DELETE ct_results WHERE obj_type = <ls_overwrite>-obj_type AND obj_name = <ls_overwrite>-obj_name. ASSERT sy-subrc = 0. ENDIF. ENDLOOP. ENDMETHOD. METHOD warning_overwrite_find. DATA: ls_overwrite LIKE LINE OF rt_overwrite. FIELD-SYMBOLS: <ls_result> LIKE LINE OF it_results. LOOP AT it_results ASSIGNING <ls_result> WHERE NOT obj_type IS INITIAL. IF <ls_result>-lstate IS NOT INITIAL AND NOT ( <ls_result>-lstate = zif_abapgit_definitions=>c_state-added AND <ls_result>-rstate IS INITIAL ). " current object has been modified or deleted locally, add to table CLEAR ls_overwrite. MOVE-CORRESPONDING <ls_result> TO ls_overwrite. APPEND ls_overwrite TO rt_overwrite. ENDIF. ENDLOOP. SORT rt_overwrite. DELETE ADJACENT DUPLICATES FROM rt_overwrite. ENDMETHOD. METHOD warning_package_adjust. DATA: lt_overwrite LIKE it_overwrite, ls_overwrite LIKE LINE OF lt_overwrite. FIELD-SYMBOLS: <ls_overwrite> LIKE LINE OF lt_overwrite. * make sure to get the current status, as something might have changed in the meanwhile lt_overwrite = warning_package_find( it_results = ct_results io_repo = io_repo ). LOOP AT lt_overwrite ASSIGNING <ls_overwrite>. READ TABLE it_overwrite INTO ls_overwrite WITH TABLE KEY object_type_and_name COMPONENTS obj_type = <ls_overwrite>-obj_type obj_name = <ls_overwrite>-obj_name. IF sy-subrc <> 0 OR ls_overwrite-decision IS INITIAL. zcx_abapgit_exception=>raise( |Overwrite odd package { <ls_overwrite>-obj_type } { <ls_overwrite>-obj_name } undecided| ). ENDIF. IF ls_overwrite-decision = 'N'. DELETE ct_results WHERE obj_type = <ls_overwrite>-obj_type AND obj_name = <ls_overwrite>-obj_name. ASSERT sy-subrc = 0. ENDIF. ENDLOOP. ENDMETHOD. METHOD warning_package_find. DATA: lv_package TYPE devclass, lt_overwrite_uniqe TYPE HASHED TABLE OF zif_abapgit_definitions=>ty_overwrite WITH UNIQUE KEY obj_type obj_name devclass, ls_overwrite LIKE LINE OF rt_overwrite, ls_tadir TYPE zif_abapgit_definitions=>ty_tadir. DATA: lo_folder_logic TYPE REF TO zcl_abapgit_folder_logic. FIELD-SYMBOLS: <ls_result> LIKE LINE OF it_results. lo_folder_logic = zcl_abapgit_folder_logic=>get_instance( ). LOOP AT it_results ASSIGNING <ls_result>. lv_package = lo_folder_logic->path_to_package( iv_top = io_repo->get_package( ) io_dot = io_repo->get_dot_abapgit( ) iv_path = <ls_result>-path ). ls_tadir = zcl_abapgit_factory=>get_tadir( )->read_single( iv_object = <ls_result>-obj_type iv_obj_name = <ls_result>-obj_name ). IF NOT ls_tadir IS INITIAL AND ls_tadir-devclass <> lv_package. * overwriting object from different package than expected CLEAR ls_overwrite. ls_overwrite-obj_type = <ls_result>-obj_type. ls_overwrite-obj_name = <ls_result>-obj_name. ls_overwrite-devclass = ls_tadir-devclass. INSERT ls_overwrite INTO TABLE lt_overwrite_uniqe. ENDIF. ENDLOOP. rt_overwrite = lt_overwrite_uniqe. ENDMETHOD. ENDCLASS.
33.411936
111
0.648798
c78708dad568f4e5d4a84dd0b546e2efacf02f48
4,158
abap
ABAP
src/oea/zcl_advoat_oea_iwpr_env_srv.clas.abap
stockbal/abap-object-analysis-tools
a0619eb31a18a2469b491ed24ff913ca989b5bb5
[ "MIT" ]
1
2021-05-09T12:46:26.000Z
2021-05-09T12:46:26.000Z
src/oea/zcl_advoat_oea_iwpr_env_srv.clas.abap
stockbal/abap-object-analysis-tools
a0619eb31a18a2469b491ed24ff913ca989b5bb5
[ "MIT" ]
null
null
null
src/oea/zcl_advoat_oea_iwpr_env_srv.clas.abap
stockbal/abap-object-analysis-tools
a0619eb31a18a2469b491ed24ff913ca989b5bb5
[ "MIT" ]
null
null
null
"! <p class="shorttext synchronized" lang="en">Environment determination for SEGW Projects</p> CLASS zcl_advoat_oea_iwpr_env_srv DEFINITION PUBLIC FINAL CREATE PUBLIC. PUBLIC SECTION. INTERFACES: zif_advoat_oea_env_service . PROTECTED SECTION. PRIVATE SECTION. CONSTANTS: c_sadl_model_exp_data_intf TYPE string VALUE 'IF_SADL_GW_MODEL_EXPOSURE_DATA'. TYPES: BEGIN OF ty_generated_obj, tadir_type TYPE trobjtype, tadir_name TYPE sobj_name, gen_obj_type TYPE /iwbep/sbdm_gen_art_type, END OF ty_generated_obj, ty_generated_objs TYPE STANDARD TABLE OF ty_generated_obj WITH EMPTY KEY. METHODS: read_generated_objects IMPORTING segw_project TYPE /iwbep/sbdm_project RETURNING VALUE(result) TYPE ty_generated_objs, add_generated_objects IMPORTING generated_objects TYPE ty_generated_objs CHANGING used_objects TYPE zif_advoat_oea_used_object=>ty_table, add_sadl_objects IMPORTING mpc_name TYPE sobj_name CHANGING used_objects TYPE zif_advoat_oea_used_object=>ty_table. ENDCLASS. CLASS zcl_advoat_oea_iwpr_env_srv IMPLEMENTATION. METHOD zif_advoat_oea_env_service~determine_used_objects. DATA(generated_objects) = read_generated_objects( CONV #( name ) ). IF generated_objects IS NOT INITIAL. add_generated_objects( EXPORTING generated_objects = generated_objects CHANGING used_objects = result ). ASSIGN generated_objects[ gen_obj_type = 'MPCB' ] TO FIELD-SYMBOL(<mpc>). IF sy-subrc = 0. add_sadl_objects( EXPORTING mpc_name = <mpc>-tadir_name CHANGING used_objects = result ). ENDIF. ENDIF. ENDMETHOD. METHOD read_generated_objects. SELECT trobj_type AS tadir_type, trobj_name AS tadir_name, gen_art_type AS gen_obj_type FROM /iwbep/i_sbd_ga WHERE project = @segw_project AND ( trobj_type = @zif_advoat_c_tadir_type=>class OR trobj_type = @zif_advoat_c_tadir_type=>interface ) INTO CORRESPONDING FIELDS OF TABLE @result. ENDMETHOD. METHOD add_generated_objects. LOOP AT generated_objects ASSIGNING FIELD-SYMBOL(<generated_object>). APPEND zcl_advoat_oea_factory=>create_used_object( name = CONV #( <generated_object>-tadir_name ) external_type = <generated_object>-tadir_type ) TO used_objects. ENDLOOP. ENDMETHOD. METHOD add_sadl_objects. DATA: mpc TYPE REF TO object, model_exposure TYPE REF TO object, model_provider TYPE REF TO object, sadl_definition TYPE if_sadl_types=>ty_sadl_definition. cl_abap_typedescr=>describe_by_name( EXPORTING p_name = mpc_name RECEIVING p_descr_ref = DATA(type_descr) EXCEPTIONS type_not_found = 1 ). IF sy-subrc <> 0 OR type_descr->kind <> cl_abap_typedescr=>kind_class. RETURN. ENDIF. DATA(mpc_cls_descr) = CAST cl_abap_classdescr( type_descr ). IF NOT line_exists( mpc_cls_descr->interfaces[ name = c_sadl_model_exp_data_intf ] ). RETURN. ENDIF. TRY. CREATE OBJECT mpc TYPE (mpc_name). CALL METHOD mpc->('IF_SADL_GW_MODEL_EXPOSURE_DATA~GET_MODEL_EXPOSURE') RECEIVING ro_model_exposure = model_exposure. CALL METHOD model_exposure->('GET_MP') RECEIVING ro_mp = model_provider. CALL METHOD model_provider->('IF_BSA_SADL_MP~GET_SADL_DEFINITION') RECEIVING rs_sadl_definition = sadl_definition. CATCH cx_sy_create_object_error cx_sy_ref_is_initial cx_sy_dyn_call_error. RETURN. ENDTRY. LOOP AT sadl_definition-data_sources ASSIGNING FIELD-SYMBOL(<data_source>) WHERE type = 'CDS'. APPEND zcl_advoat_oea_factory=>create_used_object( name = CONV #( <data_source>-name ) external_type = zif_advoat_c_tadir_type=>data_definition ) TO used_objects. ENDLOOP. ENDMETHOD. ENDCLASS.
31.740458
98
0.684464
c788fe14cfe965dd8f7af1a693e3434de3d2bd48
17,660
abap
ABAP
src/zcl_xtt_xml_base.clas.abap
monty79/xtt
fab2320149a42fa9147836d98570b36a9208bd3e
[ "Apache-2.0" ]
null
null
null
src/zcl_xtt_xml_base.clas.abap
monty79/xtt
fab2320149a42fa9147836d98570b36a9208bd3e
[ "Apache-2.0" ]
null
null
null
src/zcl_xtt_xml_base.clas.abap
monty79/xtt
fab2320149a42fa9147836d98570b36a9208bd3e
[ "Apache-2.0" ]
null
null
null
class ZCL_XTT_XML_BASE definition public inheriting from ZCL_XTT create public . public section. type-pools ABAP . class ZCL_XTT_REPLACE_BLOCK definition load . types: BEGIN OF ts_text_match. INCLUDE TYPE zcl_xtt_replace_block=>ts_tree_group. types: text TYPE string, END OF ts_text_match . types: tt_text_match TYPE SORTED TABLE OF ts_text_match WITH UNIQUE KEY level top if_where . methods CONSTRUCTOR importing !IO_FILE type ref to ZIF_XTT_FILE !IV_BODY_TAG type CSEQUENCE !IV_ROW_TAG type CSEQUENCE !IV_PATH_IN_ARC type CSEQUENCE optional !IV_OLE_EXT type STRING optional !IV_OLE_EXT_FORMAT type I optional !IV_SKIP_TAGS type ABAP_BOOL optional !IV_TABLE_PAGE_BREAK type STRING optional . methods DOWNLOAD redefinition . methods GET_RAW redefinition . methods MERGE redefinition . protected section. data MV_OLE_EXT_FORMAT type I . data MV_BODY_TAG type STRING . data MV_ROW_TAG type STRING . data MV_FILE_CONTENT type STRING . data MV_VALUE type STRING . data MV_PREFIX type STRING . methods DO_MERGE importing !IV_FIRST_LEVEL_IS_TABLE type ABAP_BOOL default ABAP_FALSE !IO_REPLACE_BLOCK type ref to ZCL_XTT_REPLACE_BLOCK changing !CV_CONTENT type STRING . methods SPLIT_BY_TAG importing !IV_TAG type CSEQUENCE !IV_TAG_ADD type CSEQUENCE optional !IV_BLOCK_NAME type CSEQUENCE !IV_FIRST_LEVEL_IS_TABLE type ABAP_BOOL optional !IV_FIELD_TYPE type CSEQUENCE optional exporting !ET_TEXT_MATCH type TT_TEXT_MATCH changing !CV_BEFORE type CSEQUENCE !CV_AFTER type CSEQUENCE !CV_MIDDLE type CSEQUENCE . methods FIND_BOUNDS importing !IV_CONTEXT type CSEQUENCE !IV_TAG type CSEQUENCE !IV_TAG_ADD type CSEQUENCE !IV_BLOCK_NAME type CSEQUENCE !IV_FIRST_LEVEL_IS_TABLE type ABAP_BOOL exporting !ET_MATCH type MATCH_RESULT_TAB !EV_WITH_TAG type ABAP_BOOL !EV_FIRST_MATCH type I !EV_LAST_MATCH type I . methods ON_MATCH_FOUND for event MATCH_FOUND of ZCL_XTT_REPLACE_BLOCK importing !IV_CONTENT !IS_FIELD !IV_POS_BEG !IV_POS_END . private section. data MV_PATH_IN_ARC type STRING . data MV_SKIP_TAGS type ABAP_BOOL . data MO_ZIP type ref to CL_ABAP_ZIP . data MV_IS_TABLE type ABAP_BOOL . data MV_IF_TABLE_PAGE_BREAK type STRING . ENDCLASS. CLASS ZCL_XTT_XML_BASE IMPLEMENTATION. METHOD constructor. DATA: lv_value TYPE xstring. super->constructor( io_file = io_file iv_ole_ext = iv_ole_ext ). " For regex mv_body_tag = iv_body_tag. mv_row_tag = iv_row_tag. mv_path_in_arc = iv_path_in_arc. mv_skip_tags = iv_skip_tags. mv_if_table_page_break = iv_table_page_break. " For download & show methods mv_ole_ext_format = iv_ole_ext_format. " As text IF mv_path_in_arc IS INITIAL. io_file->get_content( IMPORTING ev_as_string = mv_file_content ). RETURN. ENDIF. " Load zip archive from XSTRING CREATE OBJECT mo_zip. io_file->get_content( IMPORTING ev_as_xstring = lv_value ). mo_zip->load( lv_value ). " Get content as a string from file zcl_eui_conv=>xml_from_zip( EXPORTING io_zip = mo_zip iv_name = mv_path_in_arc IMPORTING ev_sdoc = mv_file_content ). ENDMETHOD. METHOD download. DATA: lv_open TYPE string, lv_path TYPE string, lv_no_ext TYPE string. " If need saveAs lv_open = iv_open. IF iv_open IS NOT SUPPLIED AND mv_ole_ext IS NOT INITIAL AND mv_ole_ext_format IS NOT INITIAL. lv_open = mc_by_ole. ENDIF. super->download( EXPORTING iv_open = lv_open iv_zip = iv_zip CHANGING cv_ole_app = cv_ole_app cv_ole_doc = cv_ole_doc cv_fullpath = cv_fullpath ). " If opened as OLE IF lv_open <> mc_by_ole AND lv_open <> mc_by_ole_hide. RETURN. ENDIF. " New file name zcl_eui_file=>split_file_path( EXPORTING iv_fullpath = cv_fullpath IMPORTING ev_file_noext = lv_no_ext ev_path = lv_path ). CONCATENATE lv_path lv_no_ext `.` mv_ole_ext INTO cv_fullpath. " Already exist. Add date and time IF zcl_eui_file=>file_exist( cv_fullpath ) = abap_true. CONCATENATE lv_path lv_no_ext ` ` sy-datum ` ` sy-uzeit `.` mv_ole_ext INTO cv_fullpath. ENDIF. CALL METHOD OF cv_ole_doc 'SaveAs' EXPORTING #1 = cv_fullpath #2 = mv_ole_ext_format. IF lv_open = mc_by_ole_hide. CALL METHOD OF cv_ole_app 'QUIT'. FREE OBJECT: cv_ole_doc, cv_ole_app. ENDIF. ENDMETHOD. METHOD do_merge. DATA: lo_new_replace_block TYPE REF TO zcl_xtt_replace_block, ls_field TYPE REF TO zcl_xtt_replace_block=>ts_field, lv_before TYPE string, lv_after TYPE string, lv_middle TYPE string, lv_find_str TYPE string, lv_clone TYPE string, lt_text_match TYPE tt_text_match, lo_tree_handler TYPE REF TO lcl_tree_handler, lr_tree TYPE REF TO zcl_xtt_replace_block=>ts_tree. FIELD-SYMBOLS: <lt_table> TYPE ANY TABLE. *************************************** " merge-1 @see ME->MATCH_FOUND SET HANDLER on_match_found FOR io_replace_block ACTIVATION abap_true. " @see match_found " What will search in template. At first '{ROOT-' io_replace_block->find_match( EXPORTING iv_skip_tags = mv_skip_tags CHANGING cv_content = cv_content ). " Turn off event handler SET HANDLER on_match_found FOR io_replace_block ACTIVATION abap_false. *************************************** " merge-2 Structures and objects LOOP AT io_replace_block->mt_fields REFERENCE INTO ls_field WHERE typ = zcl_xtt_replace_block=>mc_type_struct OR typ = zcl_xtt_replace_block=>mc_type_object. "#EC CI_SORTSEQ " Based on nested structure CREATE OBJECT lo_new_replace_block EXPORTING is_field = ls_field. " Recursion if type is the same CHECK ls_field->typ = zcl_xtt_replace_block=>mc_type_struct OR ls_field->typ = zcl_xtt_replace_block=>mc_type_object. do_merge( EXPORTING io_replace_block = lo_new_replace_block CHANGING cv_content = cv_content ). ENDLOOP. *************************************** " merge-3 Array types LOOP AT io_replace_block->mt_fields REFERENCE INTO ls_field WHERE typ = zcl_xtt_replace_block=>mc_type_table OR typ = zcl_xtt_replace_block=>mc_type_tree. "#EC CI_SORTSEQ " if root is a table CLEAR: lv_before, lv_middle, lv_after. " Detect bounds IF iv_first_level_is_table <> abap_true. CONCATENATE `\{` ls_field->name `\b[^}]*\}` " INTO lv_find_str. " Divide to 3 parts split_by_tag( EXPORTING iv_tag = mv_row_tag iv_tag_add = lv_find_str iv_block_name = ls_field->name iv_field_type = ls_field->typ IMPORTING et_text_match = lt_text_match CHANGING cv_before = lv_before cv_middle = cv_content cv_after = lv_after ). " TODO silent mode? IF lv_before IS INITIAL AND lv_after IS INITIAL. CONTINUE. ENDIF. ENDIF. CASE ls_field->typ. ********************************************************************** WHEN zcl_xtt_replace_block=>mc_type_tree. lr_tree ?= ls_field->dref. CREATE OBJECT lo_tree_handler EXPORTING io_owner = me ir_tree = lr_tree iv_block_name = ls_field->name it_text_match = lt_text_match. lo_tree_handler->add_tree_data( EXPORTING ir_tree = lr_tree CHANGING cv_text = lv_before ). " And set result CONCATENATE lv_before lv_after INTO cv_content RESPECTING BLANKS. ********************************************************************** WHEN zcl_xtt_replace_block=>mc_type_table. " CHECK cv_content IS NOT INITIAL. lv_middle = cv_content. " Replicate middle ASSIGN ls_field->dref->* TO <lt_table>. LOOP AT <lt_table> REFERENCE INTO ls_field->dref. " Create merge description CREATE OBJECT lo_new_replace_block EXPORTING is_field = ls_field. " Recursion lv_clone = lv_middle. do_merge( EXPORTING io_replace_block = lo_new_replace_block CHANGING cv_content = lv_clone ). " Add CONCATENATE lv_before lv_clone INTO lv_before RESPECTING BLANKS. ENDLOOP. " End CONCATENATE lv_before lv_after INTO cv_content RESPECTING BLANKS. ENDCASE. ENDLOOP. ENDMETHOD. METHOD find_bounds. DATA: lv_pattern TYPE string, * lv_text TYPE string, lv_tabix TYPE sytabix. FIELD-SYMBOLS: <ls_match> LIKE LINE OF et_match, <ls_submatch> LIKE LINE OF <ls_match>-submatches. " Divide text by body tag. Usualy 2 matches. <body> and </body> CONCATENATE `(<` iv_tag `\b[^>]*>)|(<\/` iv_tag `>)` INTO lv_pattern. " Also finf this part IF iv_tag_add IS NOT INITIAL. CONCATENATE lv_pattern `|(` iv_tag_add `)` INTO lv_pattern. ENDIF. FIND ALL OCCURRENCES OF REGEX lv_pattern IN iv_context RESULTS et_match RESPECTING CASE. " Wrong template IF et_match IS INITIAL. MESSAGE x001(zsy_xtt). ENDIF. CASE iv_tag. WHEN mv_body_tag. " First and last matches ev_first_match = 1. ev_last_match = lines( et_match ). RETURN. WHEN mv_row_tag. ev_with_tag = abap_true. ev_first_match = 0. ev_last_match = 0. " {iv_block_name* - CONCATENATE zcl_xtt_replace_block=>mc_char_block_begin iv_block_name '*' INTO lv_pattern. LOOP AT et_match ASSIGNING <ls_match>. lv_tabix = sy-tabix. * lv_text = iv_context+<ls_match>-offset(<ls_match>-length). * CHECK lv_text CP lv_pattern. " Only READ TABLE <ls_match>-submatches ASSIGNING <ls_submatch> INDEX 3. CHECK sy-subrc = 0 AND <ls_match>-offset = <ls_submatch>-offset AND <ls_match>-length = <ls_submatch>-length. ev_last_match = lv_tabix. IF ev_first_match IS INITIAL. ev_first_match = lv_tabix. ENDIF. ENDLOOP. " Extend bounds for iv_tag ev_first_match = ev_first_match - 1. ev_last_match = ev_last_match + 1. ENDCASE. ENDMETHOD. METHOD get_raw. DATA: lr_content TYPE REF TO xstring, lv_len TYPE i, lt_match TYPE match_result_tab, ls_match TYPE REF TO match_result. " for Word format only DO 1 TIMES. CHECK mv_is_table = abap_true AND mv_if_table_page_break IS NOT INITIAL. " Delete last page break FIND ALL OCCURRENCES OF mv_if_table_page_break IN mv_file_content RESULTS lt_match. CHECK sy-subrc = 0. " Last OCCURRENCES OF page-break lv_len = lines( lt_match ). READ TABLE lt_match REFERENCE INTO ls_match INDEX lv_len. CHECK sy-subrc = 0. " Delete last page break lv_len = ls_match->offset + ls_match->length. CONCATENATE mv_file_content(ls_match->offset) mv_file_content+lv_len INTO mv_file_content. ENDDO. IF mv_path_in_arc IS INITIAL. " Can convert XML or HTML result to pdf or attach to email for example rv_content = zcl_eui_conv=>string_to_xstring( mv_file_content ). ELSE. " Replace XML file zcl_eui_conv=>xml_to_zip( io_zip = mo_zip iv_name = mv_path_in_arc iv_sdoc = mv_file_content ). " ZIP archive as xstring rv_content = mo_zip->save( ). ENDIF. " Change content in special cases GET REFERENCE OF rv_content INTO lr_content. RAISE EVENT prepare_raw EXPORTING ir_content = lr_content. ENDMETHOD. METHOD merge. DATA: lo_replace_block TYPE REF TO zcl_xtt_replace_block, lv_typekind TYPE abap_typekind, lv_before TYPE string, lv_after TYPE string. " Prepare for replacement CREATE OBJECT lo_replace_block EXPORTING is_block = is_block iv_block_name = iv_block_name. " Special case DESCRIBE FIELD is_block TYPE lv_typekind. IF lv_typekind = cl_abap_typedescr=>typekind_table. mv_is_table = abap_true. ENDIF. " Divide to 3 parts split_by_tag( EXPORTING iv_first_level_is_table = mv_is_table iv_tag = mv_body_tag iv_block_name = iv_block_name CHANGING cv_before = lv_before cv_middle = mv_file_content cv_after = lv_after ). *** " TODO silent mode? *** IF lv_before IS INITIAL AND lv_after IS INITIAL. *** RETURN. *** ENDIF. " Update middle part (Body) do_merge( EXPORTING iv_first_level_is_table = mv_is_table io_replace_block = lo_replace_block CHANGING cv_content = mv_file_content ). " And just concatenate CONCATENATE lv_before mv_file_content lv_after INTO mv_file_content RESPECTING BLANKS. ENDMETHOD. METHOD on_match_found. FIELD-SYMBOLS: <lv_content> TYPE string. " Just skip CHECK is_field->typ <> zcl_xtt_replace_block=>mc_type_tree. " Current document ASSIGN iv_content->* TO <lv_content>. " Try to get value as a string IF mv_value IS INITIAL. mv_value = zcl_xtt_replace_block=>get_as_string( is_field = is_field ). ENDIF. " Write new value iv_pos_end = iv_pos_end + 1. CONCATENATE <lv_content>(iv_pos_beg) mv_prefix mv_value <lv_content>+iv_pos_end INTO <lv_content> RESPECTING BLANKS. " Used in sub classes CLEAR: mv_prefix, mv_value. ENDMETHOD. METHOD split_by_tag. DATA: lt_match TYPE match_result_tab, lv_first_match TYPE i, lv_last_match TYPE i, lv_with_tag TYPE abap_bool, lv_beg TYPE i, lv_end TYPE i, lv_off TYPE i, lv_text TYPE string, ls_row_off TYPE zcl_xtt_replace_block=>ts_row_offset, lt_row_off TYPE zcl_xtt_replace_block=>tt_row_offset, lv_tabix TYPE sytabix, lv_from TYPE sytabix, lv_minus TYPE i, ls_text_match LIKE LINE OF et_text_match. FIELD-SYMBOLS: <ls_match> LIKE LINE OF lt_match, <ls_submatch> LIKE LINE OF <ls_match>-submatches, <ls_row_off> LIKE ls_row_off, <ls_row_off2> LIKE ls_row_off. ************* find_bounds( EXPORTING iv_context = cv_middle iv_tag = iv_tag iv_tag_add = iv_tag_add iv_first_level_is_table = iv_first_level_is_table iv_block_name = iv_block_name IMPORTING et_match = lt_match ev_with_tag = lv_with_tag ev_first_match = lv_first_match ev_last_match = lv_last_match ). ************* " 1 - Text before body READ TABLE lt_match ASSIGNING <ls_match> INDEX lv_first_match. " TODO silent mode ? IF sy-subrc <> 0. RETURN. ENDIF. " Does need an open tag? IF lv_with_tag = abap_true. lv_beg = <ls_match>-offset. ELSE. lv_beg = <ls_match>-offset + <ls_match>-length. ENDIF. cv_before = cv_middle(lv_beg). ************* " 2 - Text after body READ TABLE lt_match ASSIGNING <ls_match> INDEX lv_last_match. IF lv_with_tag = abap_true. lv_end = <ls_match>-offset + <ls_match>-length. ELSE. lv_end = <ls_match>-offset. ENDIF. cv_after = cv_middle+lv_end. ************* " 3 - Body lv_end = lv_end - lv_beg. cv_middle = cv_middle+lv_beg(lv_end). ********************************************************************** " For trees ********************************************************************** CHECK iv_field_type = zcl_xtt_replace_block=>mc_type_tree AND et_text_match IS REQUESTED. " Offset lv_minus = lv_beg. LOOP AT lt_match ASSIGNING <ls_match>. lv_tabix = sy-tabix. READ TABLE <ls_match>-submatches ASSIGNING <ls_submatch> INDEX 3. CHECK sy-subrc = 0 AND <ls_match>-offset = <ls_submatch>-offset AND <ls_match>-length = <ls_submatch>-length. " Get whole match lv_off = <ls_match>-offset - lv_beg - 1. lv_text = cv_middle+lv_off(<ls_match>-length). " Read from texts zcl_xtt_replace_block=>tree_detect_options( EXPORTING iv_text = lv_text iv_pos = lv_tabix CHANGING cs_row_offset = ls_row_off ct_row_offset = lt_row_off ). ENDLOOP. " Check overlaps LOOP AT lt_row_off ASSIGNING <ls_row_off>. lv_from = sy-tabix + 1. LOOP AT lt_row_off ASSIGNING <ls_row_off2> FROM lv_from WHERE ( first <= <ls_row_off>-last AND first >= <ls_row_off>-first ) OR ( last <= <ls_row_off>-last AND last >= <ls_row_off>-first ). MESSAGE x001(zsy_xtt). ENDLOOP. ENDLOOP. " And add LOOP AT lt_row_off ASSIGNING <ls_row_off>. lv_beg = <ls_row_off>-first - 1. READ TABLE lt_match ASSIGNING <ls_match> INDEX lv_beg. lv_beg = <ls_match>-offset - lv_minus. lv_end = <ls_row_off>-last + 1. READ TABLE lt_match ASSIGNING <ls_match> INDEX lv_end. lv_end = <ls_match>-offset + <ls_match>-length - lv_beg - lv_minus. " And add MOVE-CORRESPONDING <ls_row_off> TO ls_text_match. ls_text_match-text = cv_middle+lv_beg(lv_end). INSERT ls_text_match INTO TABLE et_text_match. ENDLOOP. ENDMETHOD. ENDCLASS.
27.59375
126
0.650793
c78b873d12a8d9c4efbb267c9b5c68f3c4b8366b
2,891
abap
ABAP
Chapter04/ZMSA_R_CHAPTER4_1.abap
PacktPublishing/Mastering-SAP-ABAP
b7ef4923463e30d5e2362ec262188ed20d01f0de
[ "MIT" ]
14
2019-10-07T22:03:21.000Z
2021-10-02T11:17:10.000Z
Chapter04/ZMSA_R_CHAPTER4_1.abap
PacktPublishing/Mastering-SAP-ABAP
b7ef4923463e30d5e2362ec262188ed20d01f0de
[ "MIT" ]
null
null
null
Chapter04/ZMSA_R_CHAPTER4_1.abap
PacktPublishing/Mastering-SAP-ABAP
b7ef4923463e30d5e2362ec262188ed20d01f0de
[ "MIT" ]
12
2019-05-23T07:36:09.000Z
2022-01-31T21:46:56.000Z
****************************************************************************** * Report : ZMSA_R_CHAPTER4_1 * Author : Pawel Grzeskowiak * Email : [email protected] * WWW : http://sapported.com *----------------------------------------------------------------------------* * Reading text file from ****************************************************************************** * CHANGE HISTORY : (Latest change first, descending order) * *----------------------------------------------------------------------------* * AUTHOR | YYYYMMDD | Description * *----------------------------------------------------------------------------* * PawelGrzeskowiak | 20180720 | Initial Version *---------------------------------------------------------------------------- REPORT zmsa_r_chapter4_1. CLASS lcl_demo DEFINITION. PUBLIC SECTION. CLASS-METHODS main. ENDCLASS. CLASS lcl_demo IMPLEMENTATION. METHOD main. DATA: lv_filepath TYPE string. DATA: lt_data TYPE TABLE OF string. DATA: lt_filetable TYPE filetable. DATA: lv_filetable TYPE file_table. DATA: lv_rc TYPE i. CALL METHOD cl_gui_frontend_services=>file_open_dialog CHANGING file_table = lt_filetable rc = lv_rc EXCEPTIONS file_open_dialog_failed = 1 cntl_error = 2 error_no_gui = 3 not_supported_by_gui = 4 OTHERS = 5. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. RETURN. ELSEIF lv_rc < 1. MESSAGE 'No File choosen' TYPE 'W'. RETURN. ENDIF. READ TABLE lt_filetable INTO lv_filepath INDEX 1. CALL METHOD cl_gui_frontend_services=>gui_upload EXPORTING filename = lv_filepath CHANGING data_tab = lt_data EXCEPTIONS file_open_error = 1 file_read_error = 2 no_batch = 3 gui_refuse_filetransfer = 4 invalid_type = 5 no_authority = 6 unknown_error = 7 bad_data_format = 8 header_not_allowed = 9 separator_not_allowed = 10 header_too_long = 11 unknown_dp_error = 12 access_denied = 13 dp_out_of_memory = 14 disk_full = 15 dp_timeout = 16 not_supported_by_gui = 17 error_no_gui = 18 others = 19 . IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. RETURN. ENDIF. cl_demo_output=>display_data( lt_data ). ENDMETHOD. ENDCLASS. START-OF-SELECTION. lcl_demo=>main( ).
31.769231
97
0.481148
c78ecb9b40a4933a31056aeb8cb0cc4c4a356e65
3,676
abap
ABAP
src/demo/zamq_send_message_rest.prog.abap
se38/abapMQ_deamon
4ad8c91853ea9656e311793768d789b2db561d3e
[ "MIT" ]
8
2021-05-16T16:12:16.000Z
2022-03-29T11:02:27.000Z
src/demo/zamq_send_message_rest.prog.abap
MikeSidorochkin/abapMQDaemons
ba02e43f63e1ebf355875b6e140c7bb811185bcf
[ "MIT" ]
4
2021-05-08T19:33:57.000Z
2021-05-16T11:52:28.000Z
src/demo/zamq_send_message_rest.prog.abap
MikeSidorochkin/abapMQDaemons
ba02e43f63e1ebf355875b6e140c7bb811185bcf
[ "MIT" ]
1
2021-05-16T16:12:20.000Z
2021-05-16T16:12:20.000Z
*&---------------------------------------------------------------------* *& Report zamq_send_message_rest *&---------------------------------------------------------------------* *& Demo send message via REST interface *&---------------------------------------------------------------------* ******************************************************************************** * The MIT License (MIT) * * Copyright (c) 2021 Uwe Fetzer and Contributors * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. ******************************************************************************** REPORT zamq_send_message_rest. CLASS app DEFINITION CREATE PUBLIC. PUBLIC SECTION. METHODS main. PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. NEW app( )->main( ). CLASS app IMPLEMENTATION. METHOD main. cl_http_client=>create_by_url( EXPORTING * url = 'http://192.168.38.xxx:8161/api/message/testTopic.abap?type=topic' url = 'http://192.168.38.xxx:8161/api/message/testQueue.abap?type=queue' IMPORTING client = DATA(client) EXCEPTIONS argument_not_found = 1 " Communication parameter (host or service) not available plugin_not_active = 2 " HTTP/HTTPS communication not available internal_error = 3 " Internal error (e.g. name too long) others = 4 ). IF sy-subrc <> 0. BREAK-POINT. RETURN. ENDIF. client->authenticate( EXPORTING username = 'xxx' password = 'xxx' ). client->request->set_method( if_http_request=>co_request_method_post ). client->request->set_form_field( name = 'body' value = 'yet another test' ). client->send( EXCEPTIONS http_communication_failure = 1 http_invalid_state = 2 http_processing_failed = 3 http_invalid_timeout = 4 OTHERS = 5 ). IF sy-subrc <> 0. BREAK-POINT. RETURN. ENDIF. client->receive( EXCEPTIONS http_communication_failure = 1 http_invalid_state = 2 http_processing_failed = 3 OTHERS = 4 ). IF sy-subrc <> 0. BREAK-POINT. RETURN. ENDIF. " Catch data DATA(stream) = client->response->get_cdata( ). client->close( EXCEPTIONS http_invalid_state = 1 OTHERS = 2 ). IF sy-subrc <> 0. BREAK-POINT. RETURN. ENDIF. cl_demo_output=>display( stream ). ENDMETHOD. ENDCLASS.
31.689655
103
0.566376
c78fdd6d9ccbc6ed8645b39ad0615caf11441deb
2,472
abap
ABAP
src/zcl_aoc_check_cloud_01.clas.abap
abapOpenChecks/abapOpenChecks-Steampunk
76452ec5f8c46e1755ba5e73391fc1edd02b9aae
[ "Apache-2.0" ]
2
2021-06-25T07:34:53.000Z
2021-07-04T08:38:01.000Z
src/zcl_aoc_check_cloud_01.clas.abap
abapOpenChecks/abapOpenChecks-Steampunk
76452ec5f8c46e1755ba5e73391fc1edd02b9aae
[ "Apache-2.0" ]
1
2022-01-03T11:06:35.000Z
2022-01-03T11:06:35.000Z
src/zcl_aoc_check_cloud_01.clas.abap
abapOpenChecks/abapOpenChecks-Steampunk
76452ec5f8c46e1755ba5e73391fc1edd02b9aae
[ "Apache-2.0" ]
1
2021-07-05T13:15:27.000Z
2021-07-05T13:15:27.000Z
CLASS zcl_aoc_check_cloud_01 DEFINITION PUBLIC CREATE PUBLIC. PUBLIC SECTION. CONSTANTS: BEGIN OF finding_codes, if_in_if TYPE if_ci_atc_check=>ty_finding_code VALUE 'IF_IN_IF', END OF finding_codes. INTERFACES if_ci_atc_check . ENDCLASS. CLASS zcl_aoc_check_cloud_01 IMPLEMENTATION. METHOD if_ci_atc_check~get_meta_data. meta_data = NEW lcl_meta_data( ). ENDMETHOD. METHOD if_ci_atc_check~run. DATA(code_provider) = data_provider->get_code_provider( ). DATA(procedures) = code_provider->get_procedures( code_provider->object_to_comp_unit( object ) ). LOOP AT procedures->* ASSIGNING FIELD-SYMBOL(<procedure>). LOOP AT <procedure>-statements ASSIGNING FIELD-SYMBOL(<statement>) WHERE keyword = 'IF' OR keyword = 'ELSE'. DATA(l_tabix) = sy-tabix. DATA(l_is_finding) = abap_true. IF <procedure>-statements[ l_tabix + 1 ]-keyword = 'IF'. * check if an else-follows DATA(l_open_ifs) = 1. LOOP AT <procedure>-statements FROM l_tabix + 2 ASSIGNING FIELD-SYMBOL(<l_next>). DATA(l_idx) = sy-tabix. CASE <l_next>-keyword. WHEN 'IF'. l_open_ifs += 1. WHEN 'ELSE' OR 'ELSEIF'. IF l_open_ifs <> 2. * no finding l_is_finding = abap_false. EXIT. ENDIF. WHEN 'ENDIF'. l_open_ifs -= 1. IF l_open_ifs = 0. IF lines( <procedure>-statements ) > l_idx AND <procedure>-statements[ l_idx + 1 ]-keyword <> 'ENDIF'. l_is_finding = abap_false. ENDIF. EXIT. ENDIF. WHEN OTHERS. IF l_open_ifs = 0. l_is_finding = abap_false. EXIT. ENDIF. ENDCASE. ENDLOOP. IF l_is_finding = abap_true. INSERT VALUE #( code = finding_codes-if_in_if location = code_provider->get_statement_location( <statement> ) checksum = code_provider->get_statement_checksum( <statement> ) ) INTO TABLE findings. ENDIF. ENDIF. ENDLOOP. ENDLOOP. ENDMETHOD. METHOD if_ci_atc_check~set_assistant_factory. ENDMETHOD. METHOD if_ci_atc_check~verify_prerequisites. ENDMETHOD. ENDCLASS.
31.692308
120
0.572816
c7961570a000c292aed426014c4f81619dbbb9fc
2,328
abap
ABAP
src/#mbtools#cx_ajson_error.clas.testclasses.abap
Marc-Bernard-Tools/Mirror-AJSON
4bc1b5b661a6e0197770da766293d9434c75e559
[ "MIT" ]
null
null
null
src/#mbtools#cx_ajson_error.clas.testclasses.abap
Marc-Bernard-Tools/Mirror-AJSON
4bc1b5b661a6e0197770da766293d9434c75e559
[ "MIT" ]
5
2021-07-12T19:07:01.000Z
2021-09-08T00:29:05.000Z
src/#mbtools#cx_ajson_error.clas.testclasses.abap
Marc-Bernard-Tools/Mirror-AJSON
4bc1b5b661a6e0197770da766293d9434c75e559
[ "MIT" ]
1
2022-03-21T23:27:43.000Z
2022-03-21T23:27:43.000Z
CLASS ltcl_error DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL. PRIVATE SECTION. METHODS raise FOR TESTING. METHODS raise_w_location FOR TESTING. METHODS set_location FOR TESTING. ENDCLASS. CLASS ltcl_error IMPLEMENTATION. METHOD raise. DATA lx TYPE REF TO /mbtools/cx_ajson_error. DATA lv_msg TYPE string. lv_msg = repeat( val = 'a' occ = 50 ) && repeat( val = 'b' occ = 50 ) && '123'. TRY. /mbtools/cx_ajson_error=>raise( lv_msg ). cl_abap_unit_assert=>fail( ). CATCH /mbtools/cx_ajson_error INTO lx. cl_abap_unit_assert=>assert_equals( exp = lv_msg act = lx->get_text( ) ). ENDTRY. ENDMETHOD. METHOD raise_w_location. DATA lx TYPE REF TO /mbtools/cx_ajson_error. TRY. /mbtools/cx_ajson_error=>raise( iv_msg = 'a' iv_location = 'b' ). cl_abap_unit_assert=>fail( ). CATCH /mbtools/cx_ajson_error INTO lx. cl_abap_unit_assert=>assert_equals( exp = 'a @b' act = lx->get_text( ) ). ENDTRY. ENDMETHOD. METHOD set_location. DATA lx TYPE REF TO /mbtools/cx_ajson_error. TRY. /mbtools/cx_ajson_error=>raise( iv_msg = 'a' iv_location = 'b' ). cl_abap_unit_assert=>fail( ). CATCH /mbtools/cx_ajson_error INTO lx. cl_abap_unit_assert=>assert_equals( exp = lx->location act = 'b' ). lx->set_location( 'c' ). cl_abap_unit_assert=>assert_equals( exp = lx->location act = 'c' ). cl_abap_unit_assert=>assert_equals( exp = 'a @c' act = lx->get_text( ) ). ENDTRY. TRY. /mbtools/cx_ajson_error=>raise( iv_msg = 'a' ). cl_abap_unit_assert=>fail( ). CATCH /mbtools/cx_ajson_error INTO lx. cl_abap_unit_assert=>assert_equals( exp = lx->location act = '' ). lx->set_location( 'c' ). cl_abap_unit_assert=>assert_equals( exp = lx->location act = 'c' ). cl_abap_unit_assert=>assert_equals( exp = 'a @c' act = lx->get_text( ) ). ENDTRY. ENDMETHOD. ENDCLASS.
25.032258
63
0.55756
c796e85c1b73dbae5b2df97b1b8711833dd41c58
6,930
abap
ABAP
src/#usi#bal_data_containers/#usi#cl_bal_dc_collection.clas.abap
SchwarzIT/sap-usi-logging-api
35eab62618409a75987fa90c655b00a98b5dbe76
[ "Apache-2.0" ]
19
2022-01-20T19:07:52.000Z
2022-03-15T19:14:34.000Z
src/#usi#bal_data_containers/#usi#cl_bal_dc_collection.clas.abap
SchwarzIT/sap-usi-logging-api
35eab62618409a75987fa90c655b00a98b5dbe76
[ "Apache-2.0" ]
4
2022-01-26T22:52:22.000Z
2022-01-26T23:33:59.000Z
src/#usi#bal_data_containers/#usi#cl_bal_dc_collection.clas.abap
SchwarzIT/sap-usi-logging-api
35eab62618409a75987fa90c655b00a98b5dbe76
[ "Apache-2.0" ]
null
null
null
CLASS /usi/cl_bal_dc_collection DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES /usi/if_exception_details . INTERFACES /usi/if_bal_data_container_col. ALIASES: deserialize FOR /usi/if_bal_data_container_col~deserialize, insert FOR /usi/if_bal_data_container_col~insert. PROTECTED SECTION. PRIVATE SECTION. TYPES: BEGIN OF ty_data_cont_coll_item, data_container_classname TYPE /usi/bal_data_cont_classname, data_container TYPE REF TO /usi/if_bal_data_container, END OF ty_data_cont_coll_item, ty_data_cont_coll_items TYPE SORTED TABLE OF ty_data_cont_coll_item WITH NON-UNIQUE KEY data_container_classname. TYPES: BEGIN OF ty_serialized_data_container, data_container_classname TYPE /usi/bal_data_cont_classname, serialized_data_container TYPE /usi/bal_xml_string, END OF ty_serialized_data_container, ty_serialized_data_containers TYPE STANDARD TABLE OF ty_serialized_data_container WITH NON-UNIQUE DEFAULT KEY. DATA: data_cont_coll_items TYPE ty_data_cont_coll_items. METHODS is_cardinality_violation IMPORTING i_data_container TYPE REF TO /usi/if_bal_data_container RETURNING VALUE(r_result) TYPE abap_bool. METHODS is_duplicate IMPORTING i_data_container TYPE REF TO /usi/if_bal_data_container RETURNING VALUE(r_result) TYPE abap_bool RAISING /usi/cx_bal_root. ENDCLASS. CLASS /usi/cl_bal_dc_collection IMPLEMENTATION. METHOD /usi/if_bal_data_container_col~deserialize. DATA: data_container TYPE REF TO /usi/if_bal_data_container, exception TYPE REF TO cx_root, exception_text TYPE string, serialized_data_containers TYPE ty_serialized_data_containers. FIELD-SYMBOLS <serialized_data_container> TYPE ty_serialized_data_container. TRY. CALL TRANSFORMATION id SOURCE XML i_serialized_data_cont_coll RESULT serialized_data_containers = serialized_data_containers. CATCH cx_transformation_error INTO exception. RAISE EXCEPTION TYPE /usi/cx_bal_type_mismatch EXPORTING textid = /usi/cx_bal_type_mismatch=>/usi/cx_bal_type_mismatch previous = exception. ENDTRY. CREATE OBJECT r_result TYPE /usi/cl_bal_dc_collection. LOOP AT serialized_data_containers ASSIGNING <serialized_data_container>. TRY. CALL METHOD (<serialized_data_container>-data_container_classname)=>/usi/if_bal_data_container~deserialize EXPORTING i_serialized_data_container = <serialized_data_container>-serialized_data_container RECEIVING r_result = data_container. r_result->insert( data_container ). CATCH cx_sy_dyn_call_error /usi/cx_bal_root INTO exception. exception_text = exception->get_text( ). ASSERT ID /usi/bal_log_writer FIELDS exception_text CONDITION exception IS NOT BOUND. CONTINUE. ENDTRY. ENDLOOP. ENDMETHOD. METHOD /usi/if_bal_data_container_col~get_data_containers. FIELD-SYMBOLS <data_cont_coll_item> TYPE ty_data_cont_coll_item. LOOP AT data_cont_coll_items ASSIGNING <data_cont_coll_item>. INSERT <data_cont_coll_item>-data_container INTO TABLE r_result. ENDLOOP. ENDMETHOD. METHOD /usi/if_bal_data_container_col~has_data_containers. IF data_cont_coll_items IS NOT INITIAL. r_result = abap_true. ENDIF. ENDMETHOD. METHOD /usi/if_bal_data_container_col~insert. DATA: new_data_cont_coll_item TYPE ty_data_cont_coll_item. r_result = me. TRY. IF is_cardinality_violation( i_data_container ) EQ abap_true OR is_duplicate( i_data_container ) EQ abap_true. RETURN. ENDIF. CATCH /usi/cx_bal_root. RETURN. ENDTRY. new_data_cont_coll_item-data_container_classname = i_data_container->get_classname( ). new_data_cont_coll_item-data_container = i_data_container. INSERT new_data_cont_coll_item INTO TABLE data_cont_coll_items. ENDMETHOD. METHOD /usi/if_bal_data_container_col~serialize. DATA: exception TYPE REF TO /usi/cx_bal_root, exception_text TYPE string, serialized_data_containers TYPE ty_serialized_data_containers, serialized_data_container TYPE ty_serialized_data_container. FIELD-SYMBOLS <data_cont_coll_item> TYPE ty_data_cont_coll_item. LOOP AT data_cont_coll_items ASSIGNING <data_cont_coll_item>. TRY. serialized_data_container-data_container_classname = <data_cont_coll_item>-data_container_classname. serialized_data_container-serialized_data_container = <data_cont_coll_item>-data_container->serialize( ). INSERT serialized_data_container INTO TABLE serialized_data_containers. CATCH /usi/cx_bal_root INTO exception. " Corrupt container data? Drop container! exception_text = exception->get_text( ). ASSERT ID /usi/bal_log_writer FIELDS exception_text CONDITION exception IS NOT BOUND. CONTINUE. ENDTRY. ENDLOOP. CALL TRANSFORMATION id SOURCE serialized_data_containers = serialized_data_containers RESULT XML r_result. ENDMETHOD. METHOD is_cardinality_violation. DATA: data_container_classname TYPE /usi/bal_data_cont_classname. IF i_data_container->is_multiple_use_allowed( ) EQ abap_true. " Not restricted RETURN. ENDIF. data_container_classname = i_data_container->get_classname( ). READ TABLE data_cont_coll_items TRANSPORTING NO FIELDS WITH KEY data_container_classname = data_container_classname. IF sy-subrc EQ 0. " Would violate Cardinality-Restriction [0-1] r_result = abap_true. ENDIF. ENDMETHOD. METHOD is_duplicate. DATA: data_container_classname TYPE /usi/bal_data_cont_classname, serialized_data_container TYPE /usi/bal_xml_string. FIELD-SYMBOLS: <data_cont_coll_item> TYPE ty_data_cont_coll_item. data_container_classname = i_data_container->get_classname( ). serialized_data_container = i_data_container->serialize( ). LOOP AT data_cont_coll_items ASSIGNING <data_cont_coll_item> WHERE data_container_classname EQ data_container_classname. CHECK <data_cont_coll_item>-data_container EQ i_data_container OR <data_cont_coll_item>-data_container->serialize( ) EQ serialized_data_container. r_result = abap_true. RETURN. ENDLOOP. ENDMETHOD. ENDCLASS.
35.538462
116
0.707504
c79bc02bae414c5a47da2fb1f0933575ca8c9ae8
21,383
abap
ABAP
src/ui/zcl_abapgit_gui_page_stage.clas.abap
stoamandl/abapGit
d0e3956df8420b14a65265bfc563803d4a16b9f0
[ "MIT" ]
null
null
null
src/ui/zcl_abapgit_gui_page_stage.clas.abap
stoamandl/abapGit
d0e3956df8420b14a65265bfc563803d4a16b9f0
[ "MIT" ]
null
null
null
src/ui/zcl_abapgit_gui_page_stage.clas.abap
stoamandl/abapGit
d0e3956df8420b14a65265bfc563803d4a16b9f0
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_gui_page_stage DEFINITION PUBLIC FINAL CREATE PUBLIC INHERITING FROM zcl_abapgit_gui_page. PUBLIC SECTION. INTERFACES: zif_abapgit_gui_page_hotkey. CONSTANTS: BEGIN OF c_action, stage_all TYPE string VALUE 'stage_all', stage_commit TYPE string VALUE 'stage_commit', stage_filter TYPE string VALUE 'stage_filter', END OF c_action. METHODS: constructor IMPORTING io_repo TYPE REF TO zcl_abapgit_repo_online iv_seed TYPE string OPTIONAL RAISING zcx_abapgit_exception, zif_abapgit_gui_event_handler~on_event REDEFINITION. PROTECTED SECTION. METHODS: render_content REDEFINITION, get_events REDEFINITION, scripts REDEFINITION. PRIVATE SECTION. TYPES: BEGIN OF ty_changed_by, item TYPE zif_abapgit_definitions=>ty_item, name TYPE xubname, END OF ty_changed_by . TYPES: ty_changed_by_tt TYPE SORTED TABLE OF ty_changed_by WITH UNIQUE KEY item. TYPES: BEGIN OF ty_transport, item TYPE zif_abapgit_definitions=>ty_item, transport TYPE trkorr, END OF ty_transport, ty_transport_tt TYPE SORTED TABLE OF ty_transport WITH UNIQUE KEY item. DATA mo_repo TYPE REF TO zcl_abapgit_repo_online . DATA ms_files TYPE zif_abapgit_definitions=>ty_stage_files . DATA mv_seed TYPE string . " Unique page id to bind JS sessionStorage DATA mv_filter_value TYPE string. METHODS find_changed_by IMPORTING !it_local TYPE zif_abapgit_definitions=>ty_files_item_tt RETURNING VALUE(rt_changed_by) TYPE ty_changed_by_tt . METHODS find_transports IMPORTING it_local TYPE zif_abapgit_definitions=>ty_files_item_tt RETURNING VALUE(rt_transports) TYPE ty_transport_tt. METHODS render_list RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html . METHODS render_file IMPORTING !iv_context TYPE string !is_file TYPE zif_abapgit_definitions=>ty_file !is_item TYPE zif_abapgit_definitions=>ty_item OPTIONAL !is_status TYPE zif_abapgit_definitions=>ty_result !iv_changed_by TYPE xubname OPTIONAL !iv_transport TYPE trkorr OPTIONAL RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html . METHODS render_actions RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html . METHODS process_stage_list IMPORTING !it_postdata TYPE cnht_post_data_tab !io_stage TYPE REF TO zcl_abapgit_stage RAISING zcx_abapgit_exception . METHODS build_menu RETURNING VALUE(ro_menu) TYPE REF TO zcl_abapgit_html_toolbar . METHODS get_page_patch IMPORTING iv_getdata TYPE clike iv_prev_page TYPE clike RETURNING VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable RAISING zcx_abapgit_exception. METHODS render_master_language_warning RETURNING VALUE(ro_html) TYPE REF TO zcl_abapgit_html. ENDCLASS. CLASS ZCL_ABAPGIT_GUI_PAGE_STAGE IMPLEMENTATION. METHOD build_menu. CREATE OBJECT ro_menu. IF lines( ms_files-local ) > 0. ro_menu->add( iv_txt = |All diffs| iv_act = |{ zif_abapgit_definitions=>c_action-go_diff }?key={ mo_repo->get_key( ) }| ). ENDIF. ENDMETHOD. METHOD constructor. DATA lv_ts TYPE timestamp. super->constructor( ). ms_control-page_title = 'STAGE'. mo_repo = io_repo. ms_files = zcl_abapgit_factory=>get_stage_logic( )->get( mo_repo ). mv_seed = iv_seed. IF mv_seed IS INITIAL. " Generate based on time unless obtained from diff page GET TIME STAMP FIELD lv_ts. mv_seed = |stage{ lv_ts }|. ENDIF. ms_control-page_menu = build_menu( ). ENDMETHOD. METHOD find_changed_by. DATA: ls_local LIKE LINE OF it_local, ls_changed_by LIKE LINE OF rt_changed_by. FIELD-SYMBOLS: <ls_changed_by> LIKE LINE OF rt_changed_by. LOOP AT it_local INTO ls_local WHERE NOT item IS INITIAL. ls_changed_by-item = ls_local-item. INSERT ls_changed_by INTO TABLE rt_changed_by. ENDLOOP. LOOP AT rt_changed_by ASSIGNING <ls_changed_by>. TRY. <ls_changed_by>-name = to_lower( zcl_abapgit_objects=>changed_by( <ls_changed_by>-item ) ). CATCH zcx_abapgit_exception. ENDTRY. ENDLOOP. ENDMETHOD. METHOD find_transports. DATA: li_cts_api TYPE REF TO zif_abapgit_cts_api, ls_new LIKE LINE OF rt_transports. FIELD-SYMBOLS: <ls_local> LIKE LINE OF it_local. li_cts_api = zcl_abapgit_factory=>get_cts_api( ). TRY. LOOP AT it_local ASSIGNING <ls_local> WHERE item IS NOT INITIAL. IF <ls_local>-item-obj_type IS NOT INITIAL AND <ls_local>-item-obj_name IS NOT INITIAL AND <ls_local>-item-devclass IS NOT INITIAL. IF li_cts_api->is_chrec_possible_for_package( <ls_local>-item-devclass ) = abap_false. EXIT. " Assume all other objects are also in packages without change recording ELSEIF li_cts_api->is_object_type_lockable( <ls_local>-item-obj_type ) = abap_true AND li_cts_api->is_object_locked_in_transport( iv_object_type = <ls_local>-item-obj_type iv_object_name = <ls_local>-item-obj_name ) = abap_true. ls_new-item = <ls_local>-item. ls_new-transport = li_cts_api->get_current_transport_for_obj( iv_object_type = <ls_local>-item-obj_type iv_object_name = <ls_local>-item-obj_name iv_resolve_task_to_request = abap_false ). INSERT ls_new INTO TABLE rt_transports. ENDIF. ENDIF. ENDLOOP. CATCH zcx_abapgit_exception. ASSERT 1 = 2. ENDTRY. ENDMETHOD. METHOD get_events. FIELD-SYMBOLS: <ls_event> TYPE zcl_abapgit_gui_page=>ty_event. APPEND INITIAL LINE TO rt_events ASSIGNING <ls_event>. <ls_event>-method = 'post'. <ls_event>-name = 'stage_commit'. ENDMETHOD. METHOD get_page_patch. DATA: lo_page TYPE REF TO zcl_abapgit_gui_page_diff, lv_key TYPE zif_abapgit_persistence=>ty_repo-key, lo_stage TYPE REF TO zcl_abapgit_stage. zcl_abapgit_html_action_utils=>file_obj_decode( EXPORTING iv_string = iv_getdata IMPORTING ev_key = lv_key ). CREATE OBJECT lo_stage. CREATE OBJECT lo_page EXPORTING iv_key = lv_key iv_patch_mode = abap_true io_stage = lo_stage. ri_page = lo_page. ENDMETHOD. METHOD process_stage_list. DATA: lv_string TYPE string, lt_fields TYPE tihttpnvp, ls_file TYPE zif_abapgit_definitions=>ty_file. FIELD-SYMBOLS: <ls_file> LIKE LINE OF ms_files-local, <ls_status> LIKE LINE OF ms_files-status, <ls_item> LIKE LINE OF lt_fields. CONCATENATE LINES OF it_postdata INTO lv_string. lt_fields = zcl_abapgit_html_action_utils=>parse_fields( lv_string ). IF lines( lt_fields ) = 0. zcx_abapgit_exception=>raise( 'process_stage_list: empty list' ). ENDIF. LOOP AT lt_fields ASSIGNING <ls_item>. zcl_abapgit_path=>split_file_location( EXPORTING iv_fullpath = <ls_item>-name IMPORTING ev_path = ls_file-path ev_filename = ls_file-filename ). READ TABLE ms_files-status ASSIGNING <ls_status> WITH TABLE KEY path = ls_file-path filename = ls_file-filename. ASSERT sy-subrc = 0. CASE <ls_item>-value. WHEN zcl_abapgit_stage=>c_method-add. READ TABLE ms_files-local ASSIGNING <ls_file> WITH KEY file-path = ls_file-path file-filename = ls_file-filename. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |process_stage_list: unknown file { ls_file-path }{ ls_file-filename }| ). ENDIF. io_stage->add( iv_path = <ls_file>-file-path iv_filename = <ls_file>-file-filename is_status = <ls_status> iv_data = <ls_file>-file-data ). WHEN zcl_abapgit_stage=>c_method-ignore. io_stage->ignore( iv_path = ls_file-path iv_filename = ls_file-filename ). WHEN zcl_abapgit_stage=>c_method-rm. io_stage->rm( iv_path = ls_file-path is_status = <ls_status> iv_filename = ls_file-filename ). WHEN zcl_abapgit_stage=>c_method-skip. " Do nothing WHEN OTHERS. zcx_abapgit_exception=>raise( |process_stage_list: unknown method { <ls_item>-value }| ). ENDCASE. ENDLOOP. ENDMETHOD. METHOD render_actions. DATA: lv_local_count TYPE i, lv_add_all_txt TYPE string, lv_param TYPE string, ls_file TYPE zif_abapgit_definitions=>ty_file. CREATE OBJECT ro_html. lv_local_count = lines( ms_files-local ). IF lv_local_count > 0. lv_add_all_txt = |Add all and commit ({ lv_local_count })|. " Otherwise empty, but the element (id) is preserved for JS ENDIF. ro_html->add( '<table class="w100 margin-v5"><tr>' ). " Action buttons ro_html->add( '<td class="indent5em">' ). ro_html->add_a( iv_act = 'errorStub(event)' " Will be reinit by JS iv_typ = zif_abapgit_html=>c_action_type-onclick iv_id = 'commitSelectedButton' iv_style = 'display: none' iv_txt = 'Commit selected (<span class="counter"></span>)' iv_opt = zif_abapgit_html=>c_html_opt-strong ) ##NO_TEXT. ro_html->add_a( iv_act = 'errorStub(event)' " Will be reinit by JS iv_typ = zif_abapgit_html=>c_action_type-onclick iv_id = 'commitFilteredButton' iv_style = 'display: none' iv_txt = 'Add <b>filtered</b> and commit (<span class="counter"></span>)' ) ##NO_TEXT. ro_html->add_a( iv_act = |{ c_action-stage_all }| iv_id = 'commitAllButton' iv_txt = lv_add_all_txt ) ##NO_TEXT. lv_param = zcl_abapgit_html_action_utils=>file_encode( iv_key = mo_repo->get_key( ) ig_file = ls_file ). ro_html->add( '</td>' ). ro_html->add( '<td class="pad-sides">' ). ro_html->add_a( iv_txt = |Patch| iv_act = |{ zif_abapgit_definitions=>c_action-go_patch }?{ lv_param }| ). ro_html->add( '</td>' ). " Filter bar ro_html->add( '<td class="right">' ). ro_html->add( '<input class="stage-filter" id="objectSearch"' && ' type="search" placeholder="Filter objects"' && | value={ mv_filter_value }>| ). ro_html->add( '</td>' ). ro_html->add( '</tr>' ). ro_html->add( '</table>' ). 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( mo_repo ) ). ro_html->add( zcl_abapgit_gui_chunk_lib=>render_js_error_banner( ) ). ro_html->add( render_master_language_warning( ) ). ro_html->add( '<div class="stage-container">' ). ro_html->add( render_actions( ) ). ro_html->add( render_list( ) ). ro_html->add( '</div>' ). ro_html->add( '</div>' ). ENDMETHOD. METHOD render_file. DATA: lv_param TYPE string, lv_filename TYPE string, lv_transport_string TYPE string, lv_transport_html TYPE string. CREATE OBJECT ro_html. lv_transport_string = iv_transport. lv_filename = is_file-path && is_file-filename. * make sure whitespace is preserved in the DOM REPLACE ALL OCCURRENCES OF ` ` IN lv_filename WITH '&nbsp;'. ro_html->add( |<tr class="{ iv_context }">| ). ro_html->add( '<td>' ). ro_html->add( zcl_abapgit_gui_chunk_lib=>render_item_state( iv_lstate = is_status-lstate iv_rstate = is_status-rstate ) ). ro_html->add( '</td>' ). CASE iv_context. WHEN 'local'. lv_param = zcl_abapgit_html_action_utils=>file_encode( iv_key = mo_repo->get_key( ) ig_file = is_file ). lv_filename = zcl_abapgit_html=>a( iv_txt = lv_filename iv_act = |{ zif_abapgit_definitions=>c_action-go_diff }?{ lv_param }| ). IF iv_transport IS NOT INITIAL. lv_transport_html = zcl_abapgit_html=>a( iv_txt = lv_transport_string iv_act = |{ zif_abapgit_definitions=>c_action-jump_transport }?{ iv_transport }| ). ENDIF. ro_html->add( |<td class="type">{ is_item-obj_type }</td>| ). ro_html->add( |<td class="name">{ lv_filename }</td>| ). ro_html->add( |<td class="user">{ iv_changed_by }</td>| ). ro_html->add( |<td class="transport">{ lv_transport_html }</td>| ). WHEN 'remote'. ro_html->add( '<td class="type">-</td>' ). " Dummy for object type ro_html->add( |<td class="name">{ lv_filename }</td>| ). ro_html->add( '<td></td>' ). " Dummy for changed-by ro_html->add( '<td></td>' ). " Dummy for transport ENDCASE. ro_html->add( |<td class="status">?</td>| ). ro_html->add( '<td class="cmd"></td>' ). " Command added in JS ro_html->add( '</tr>' ). ENDMETHOD. METHOD render_list. DATA: lt_changed_by TYPE ty_changed_by_tt, ls_changed_by LIKE LINE OF lt_changed_by, lt_transports TYPE ty_transport_tt, ls_transport LIKE LINE OF lt_transports. FIELD-SYMBOLS: <ls_remote> LIKE LINE OF ms_files-remote, <ls_status> LIKE LINE OF ms_files-status, <ls_local> LIKE LINE OF ms_files-local. CREATE OBJECT ro_html. ro_html->add( '<table id="stageTab" class="stage_tab w100">' ). lt_changed_by = find_changed_by( ms_files-local ). lt_transports = find_transports( ms_files-local ). " Local changes LOOP AT ms_files-local ASSIGNING <ls_local>. AT FIRST. ro_html->add( '<thead><tr class="local">' ). ro_html->add( '<th></th>' ). " Diff state ro_html->add( '<th>Type</th>' ). ro_html->add( '<th>Files to add (click to see diff)</th>' ). ro_html->add( '<th>Changed by</th>' ). ro_html->add( '<th>Transport</th>' ). ro_html->add( '<th></th>' ). " Status ro_html->add( '<th class="cmd">' ). ro_html->add( '<a>add</a>&#x2193; <a>reset</a>&#x2193;' ). ro_html->add( '</th>' ). ro_html->add( '</tr></thead>' ). ro_html->add( '<tbody>' ). ENDAT. READ TABLE lt_changed_by INTO ls_changed_by WITH KEY item = <ls_local>-item. "#EC CI_SUBRC READ TABLE lt_transports INTO ls_transport WITH KEY item = <ls_local>-item. "#EC CI_SUBRC READ TABLE ms_files-status ASSIGNING <ls_status> WITH TABLE KEY path = <ls_local>-file-path filename = <ls_local>-file-filename. ASSERT sy-subrc = 0. ro_html->add( render_file( iv_context = 'local' is_file = <ls_local>-file is_item = <ls_local>-item is_status = <ls_status> iv_changed_by = ls_changed_by-name iv_transport = ls_transport-transport ) ). CLEAR ls_transport. AT LAST. ro_html->add( '</tbody>' ). ENDAT. ENDLOOP. " Remote changes LOOP AT ms_files-remote ASSIGNING <ls_remote>. AT FIRST. ro_html->add( '<thead><tr class="remote">' ). ro_html->add( '<th></th>' ). " Diff state ro_html->add( '<th></th>' ). " Type ro_html->add( '<th colspan="3">Files to remove or non-code</th>' ). ro_html->add( '<th></th>' ). " Status ro_html->add( '<th class="cmd">' ). ro_html->add( '<a>ignore</a>&#x2193; <a>remove</a>&#x2193; <a>reset</a>&#x2193;' ). ro_html->add( '</th>' ). ro_html->add( '</tr></thead>' ). ro_html->add( '<tbody>' ). ENDAT. READ TABLE ms_files-status ASSIGNING <ls_status> WITH TABLE KEY path = <ls_local>-file-path filename = <ls_local>-file-filename. ASSERT sy-subrc = 0. ro_html->add( render_file( iv_context = 'remote' is_status = <ls_status> is_file = <ls_remote> ) ). AT LAST. ro_html->add( '</tbody>' ). ENDAT. ENDLOOP. ro_html->add( '</table>' ). ENDMETHOD. METHOD render_master_language_warning. DATA: ls_dot_abapgit TYPE zif_abapgit_dot_abapgit=>ty_dot_abapgit. CREATE OBJECT ro_html. ls_dot_abapgit = mo_repo->get_dot_abapgit( )->get_data( ). IF ls_dot_abapgit-master_language <> sy-langu. ro_html->add( zcl_abapgit_gui_chunk_lib=>render_warning_banner( |Caution: Master language of the repo is '{ ls_dot_abapgit-master_language }', | && |but you're logged on in '{ sy-langu }'| ) ). ENDIF. ENDMETHOD. METHOD scripts. ro_html = super->scripts( ). ro_html->add( 'var gStageParams = {' ). ro_html->add( | seed: "{ mv_seed }",| ). " Unique page id ro_html->add( | user: "{ to_lower( sy-uname ) }",| ). ro_html->add( ' formAction: "stage_commit",' ). ro_html->add( ' ids: {' ). ro_html->add( ' stageTab: "stageTab",' ). ro_html->add( ' commitAllBtn: "commitAllButton",' ). ro_html->add( ' commitSelectedBtn: "commitSelectedButton",' ). ro_html->add( ' commitFilteredBtn: "commitFilteredButton",' ). ro_html->add( ' objectSearch: "objectSearch",' ). ro_html->add( ' }' ). ro_html->add( '}' ). ro_html->add( 'var gHelper = new StageHelper(gStageParams);' ). ENDMETHOD. METHOD zif_abapgit_gui_event_handler~on_event. DATA: lo_stage TYPE REF TO zcl_abapgit_stage, lv_string TYPE string, lt_fields TYPE tihttpnvp. FIELD-SYMBOLS: <ls_file> LIKE LINE OF ms_files-local. FIELD-SYMBOLS: <ls_status> LIKE LINE OF ms_files-status. CREATE OBJECT lo_stage. CLEAR: ei_page, ev_state. CASE iv_action. WHEN c_action-stage_all. LOOP AT ms_files-local ASSIGNING <ls_file>. READ TABLE ms_files-status ASSIGNING <ls_status> WITH TABLE KEY path = <ls_file>-file-path filename = <ls_file>-file-filename. ASSERT sy-subrc = 0. lo_stage->add( iv_path = <ls_file>-file-path iv_filename = <ls_file>-file-filename is_status = <ls_status> iv_data = <ls_file>-file-data ). ENDLOOP. CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_commit EXPORTING io_repo = mo_repo io_stage = lo_stage. ev_state = zcl_abapgit_gui=>c_event_state-new_page. ev_state = zcl_abapgit_gui=>c_event_state-new_page. WHEN c_action-stage_commit. process_stage_list( it_postdata = it_postdata io_stage = lo_stage ). CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_commit EXPORTING io_repo = mo_repo io_stage = lo_stage. ev_state = zcl_abapgit_gui=>c_event_state-new_page. WHEN c_action-stage_filter. CONCATENATE LINES OF it_postdata INTO lv_string. lt_fields = zcl_abapgit_html_action_utils=>parse_fields( lv_string ). zcl_abapgit_html_action_utils=>get_field( EXPORTING iv_name = 'filterValue' it_field = lt_fields CHANGING cg_field = mv_filter_value ). ev_state = zcl_abapgit_gui=>c_event_state-no_more_act. WHEN zif_abapgit_definitions=>c_action-go_patch. " Go Patch page ei_page = get_page_patch( iv_getdata = iv_getdata iv_prev_page = iv_prev_page ). 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. DATA: ls_hotkey_action TYPE zif_abapgit_gui_page_hotkey=>ty_hotkey_with_name. ls_hotkey_action-name = |Patch|. ls_hotkey_action-action = zif_abapgit_definitions=>c_action-go_patch. ls_hotkey_action-hotkey = |p|. INSERT ls_hotkey_action INTO TABLE rt_hotkey_actions. ENDMETHOD. ENDCLASS.
32.546423
118
0.609971
c79d1330309036866db910dc66c1ae7213b777f0
1,242
abap
ABAP
src/zaps_tasks/zcl_aps_task_starter.clas.abap
BiberM/ABAPParallelizationService
d0fca92dfe05456e73fadafd8763b7953e49eb57
[ "MIT" ]
7
2021-09-13T20:09:13.000Z
2022-02-11T18:22:07.000Z
src/zaps_tasks/zcl_aps_task_starter.clas.abap
BiberM/ABAPParallelizationService
d0fca92dfe05456e73fadafd8763b7953e49eb57
[ "MIT" ]
8
2021-10-03T16:40:59.000Z
2022-01-23T21:06:37.000Z
src/zaps_tasks/zcl_aps_task_starter.clas.abap
BiberM/ABAPParallelizationService
d0fca92dfe05456e73fadafd8763b7953e49eb57
[ "MIT" ]
1
2021-12-22T16:56:37.000Z
2021-12-22T16:56:37.000Z
class zcl_aps_task_starter definition public abstract create protected. public section. interfaces: zif_aps_task_starter all methods abstract. methods: constructor importing i_settings type ref to zif_aps_settings. protected section. data: settings type ref to zif_aps_settings. methods: createTask importing taskData type ref to zaps_package returning value(result) type ref to zif_aps_task raising zcx_aps_task_creation_error. private section. endclass. class zcl_aps_task_starter implementation. method constructor. settings = i_settings. endmethod. method createTask. try. result = zcl_aps_task_factory=>provide( i_settings = settings i_packagedata = taskdata->* ). result->setstatuscreated( ). catch zcx_aps_task_invalid_class zcx_aps_task_instanciation_err zcx_aps_task_unknown_exec_type zcx_aps_task_status into data(detailedError). raise exception type zcx_aps_task_creation_error exporting i_previous = detailedError. endtry. endmethod. endclass.
20.360656
51
0.65942
c79f384d2205084a75a8ce281cd166566784bebe
3,875
abap
ABAP
Customer Payment/IF_EX_AC_DOCUMENT~CHANGE_INITIAL.abap
Qodepress/SAP
c7bedcb9d055fcee94f2716a31a729d3e8754997
[ "MIT" ]
null
null
null
Customer Payment/IF_EX_AC_DOCUMENT~CHANGE_INITIAL.abap
Qodepress/SAP
c7bedcb9d055fcee94f2716a31a729d3e8754997
[ "MIT" ]
null
null
null
Customer Payment/IF_EX_AC_DOCUMENT~CHANGE_INITIAL.abap
Qodepress/SAP
c7bedcb9d055fcee94f2716a31a729d3e8754997
[ "MIT" ]
null
null
null
*----------------------------------------------------------------------* * Modification Information *----------------------------------------------------------------------* * Date : <30-09-2020> * Author : <Dhananjayan/DK> * Transport number: <> * Description : <CHN1 sales order is already lost when K_COBL_CHECK is *called, forcing the system to send the error message KI235 when * FM AC_DOCUMENT_CREATE called. for that added Sales order No & item> *----------------------------------------------------------------------* METHOD if_ex_ac_document~change_initial. DATA: ls_item TYPE accit, ls_item_upd TYPE accit, ls_item_bsx TYPE accit, ls_ekpo TYPE ekpo, lt_update TYPE TABLE OF accit_sub, ls_update TYPE accit_sub. IF sy-tcode = 'MIGO' OR sy-tcode = 'MIGO_GR'. CLEAR: lt_update[]. LOOP AT im_document-item INTO ls_item WHERE ktosl = 'GBB' AND ebeln IS NOT INITIAL AND ebelp IS NOT INITIAL. SELECT SINGLE * FROM ekpo INTO ls_ekpo WHERE ebeln = ls_item-ebeln AND ebelp = ls_item-ebelp. IF sy-subrc = 0 AND ls_ekpo-knttp = 'X' AND ls_ekpo-pstyp = '3'. READ TABLE im_document-item INTO ls_item_upd WITH KEY ktosl = 'KBS' ebeln = ls_item-ebeln ebelp = ls_item-ebelp. IF sy-subrc = 0. CLEAR ls_update. ls_update-mandt = ls_item-mandt. ls_update-awtyp = ls_item-awtyp. ls_update-awref = ls_item-awref. ls_update-aworg = ls_item-aworg. ls_update-posnr = ls_item-posnr. ls_update-kdauf = ls_item-kdauf. "+CHN1 Changed by DK 0n 11.09.2020 ls_update-kdpos = ls_item-kdpos. "+CHN1 Changed by DK 0n 11.09.2020 ls_update-pprctr = ls_item_upd-pprctr. * ls_update-prctr = ls_item-pprctr. APPEND ls_update TO lt_update. ENDIF. *** LOOP AT im_document-item INTO ls_item_bsx *** WHERE ktosl = 'BSX' *** AND ebeln = ls_item-ebeln *** AND ebelp = ls_item-ebelp. *** CLEAR ls_update. *** ls_update-mandt = ls_item_bsx-mandt. *** ls_update-awtyp = ls_item_bsx-awtyp. *** ls_update-awref = ls_item_bsx-awref. *** ls_update-aworg = ls_item_bsx-aworg. *** ls_update-posnr = ls_item_bsx-posnr. *** ls_update-pprctr = ls_item_upd-pprctr. *** ls_update-prctr = ls_item-pprctr. *** APPEND ls_update TO lt_update. *** ENDLOOP. ENDIF. ENDLOOP. IF NOT lt_update IS INITIAL. *** DELETE ADJACENT DUPLICATES FROM lt_update COMPARING ALL FIELDS. ex_document-item[] = lt_update[]. ENDIF. ENDIF. " add by sherin 04 06 2014 DATA: wa_header TYPE acchd. IF sy-xprog NE 'SAPMSSY1'. *---<SAPLBPFC> is for Posting with BAPI: BAPI_ACC_DOCUMENT_POST *---<SAPCNVE > is for Posting(Tax) with BAPI: BAPI_ACC_DOCUMENT_POST *---<SAPMSSY1> is for Test(Check) with BAPI: BAPI_ACC_DOCUMENT_CHECK CLEAR wa_header. wa_header = im_document-header. ex_document-header-bktxt = wa_header-bktxt. CLEAR wa_header. ENDIF. " add by A.Kumar 13.07.2021 IF sy-tcode EQ 'ZARVTOPAY'. *---<SAPLBPFC> is for Posting with BAPI: BAPI_ACC_DOCUMENT_POST *---<SAPCNVE > is for Posting(Tax) with BAPI: BAPI_ACC_DOCUMENT_POST *---<SAPMSSY1> is for Test(Check) with BAPI: BAPI_ACC_DOCUMENT_CHECK CLEAR wa_header. wa_header = im_document-header. ex_document-header-bktxt = wa_header-bktxt. CLEAR wa_header. ENDIF. ENDMETHOD.
40.364583
78
0.554323
c7a176fdc6c4aaeee5e6d1f1637c0c7725e380aa
1,716
abap
ABAP
src/persist/zcl_abapgit_persist_packages.clas.testclasses.abap
Manny27nyc/abapGit
dc51247e9b8c0c792193aba857ec31df3a82db4a
[ "MIT" ]
797
2015-02-06T15:38:41.000Z
2020-09-23T02:57:02.000Z
src/persist/zcl_abapgit_persist_packages.clas.testclasses.abap
Manny27nyc/abapGit
dc51247e9b8c0c792193aba857ec31df3a82db4a
[ "MIT" ]
2,776
2015-01-13T03:59:55.000Z
2020-09-23T21:46:34.000Z
src/persist/zcl_abapgit_persist_packages.clas.testclasses.abap
wangdongcheng/abapGit
7cf4e4b5fe718cb95d12d0a439aa9f2cfb128eab
[ "MIT" ]
499
2015-01-13T03:41:36.000Z
2020-09-22T11:50:54.000Z
CLASS ltcl_packages DEFINITION FOR TESTING RISK LEVEL CRITICAL DURATION SHORT FINAL. PRIVATE SECTION. CONSTANTS: c_package TYPE tdevc-devclass VALUE '$TEST$ABAPGIT$', c_component TYPE tdevc-component VALUE 'HLB0009083', "BC-ABA c_comp_posid TYPE scompkdtln-comp_posid VALUE 'BC-ABA'. METHODS: test_package FOR TESTING, teardown. ENDCLASS. CLASS ltcl_packages IMPLEMENTATION. METHOD test_package. DATA lo_packages TYPE REF TO zcl_abapgit_persist_packages. DATA ls_package TYPE zcl_abapgit_persist_packages=>ty_package. DATA lx_error TYPE REF TO zcx_abapgit_exception. lo_packages = zcl_abapgit_persist_packages=>get_instance( ). TRY. lo_packages->modify( iv_package = c_package iv_component = c_component iv_comp_posid = c_comp_posid ). CATCH zcx_abapgit_exception INTO lx_error. cl_abap_unit_assert=>fail( msg = lx_error->get_text( ) ). ENDTRY. TRY. ls_package = lo_packages->read( c_package ). cl_abap_unit_assert=>assert_equals( act = ls_package-component exp = c_component ). cl_abap_unit_assert=>assert_equals( act = ls_package-comp_posid exp = c_comp_posid ). CATCH zcx_abapgit_exception INTO lx_error. cl_abap_unit_assert=>fail( msg = lx_error->get_text( ) ). ENDTRY. ENDMETHOD. METHOD teardown. DATA lo_packages TYPE REF TO zcl_abapgit_persist_packages. lo_packages = zcl_abapgit_persist_packages=>get_instance( ). " Remove test data TRY. lo_packages->modify( c_package ). CATCH zcx_abapgit_exception. ENDTRY. ENDMETHOD. ENDCLASS.
24.869565
68
0.688228
c7a1af9d96d4c2a40c72fafad18324bfce862dd3
577
abap
ABAP
src/ui/zdbbr_field_jump_list.fugr.lzdbbr_field_jump_listo01.abap
reichr-dev/abap-db-browser
d513d49692f1f0ee613c8eab2c99e325ef5b78fe
[ "MIT" ]
15
2020-02-05T10:38:12.000Z
2022-02-11T18:06:17.000Z
src/ui/zdbbr_field_jump_list.fugr.lzdbbr_field_jump_listo01.abap
reichr-dev/abap-db-browser
d513d49692f1f0ee613c8eab2c99e325ef5b78fe
[ "MIT" ]
10
2021-01-19T07:45:37.000Z
2021-07-15T19:08:54.000Z
src/ui/zdbbr_field_jump_list.fugr.lzdbbr_field_jump_listo01.abap
reichr-dev/abap-db-browser
d513d49692f1f0ee613c8eab2c99e325ef5b78fe
[ "MIT" ]
9
2020-04-08T19:13:18.000Z
2021-10-02T12:53:39.000Z
********************************************************************** * Forms for PBO-events ********************************************************************** MODULE pbo_0100 OUTPUT. gr_jumplist_controller->ZIF_UITB_SCREEN_CONTROLLER~pbo( ). ENDMODULE. MODULE table_line_pbo_0100 OUTPUT. gr_jumplist_table->ZIF_UITB_TABLE~pbo( ). ENDMODULE. MODULE pbo_0101 OUTPUT. gr_jumplist_param_controller->ZIF_UITB_SCREEN_CONTROLLER~pbo( ). ENDMODULE. MODULE table_line_pbo_0101 OUTPUT. gr_jumplist_param_table->ZIF_UITB_TABLE~pbo( ). ENDMODULE.
28.85
70
0.584055
c7a475cf007e624ad55e1d6d84f1bbcdf59fe2ea
7,576
abap
ABAP
src/zcl_excel_converter_result_wd.clas.abap
cadaxo/abap2xlsx
3a4270c11e8aa60fcd1082631c908a8ab4889e71
[ "Apache-2.0" ]
null
null
null
src/zcl_excel_converter_result_wd.clas.abap
cadaxo/abap2xlsx
3a4270c11e8aa60fcd1082631c908a8ab4889e71
[ "Apache-2.0" ]
null
null
null
src/zcl_excel_converter_result_wd.clas.abap
cadaxo/abap2xlsx
3a4270c11e8aa60fcd1082631c908a8ab4889e71
[ "Apache-2.0" ]
null
null
null
CLASS zcl_excel_converter_result_wd DEFINITION PUBLIC INHERITING FROM zcl_excel_converter_result FINAL CREATE PUBLIC . *"* public components of class ZCL_EXCEL_CONVERTER_RESULT_WD *"* do not include other source files here!!! PUBLIC SECTION. METHODS zif_excel_converter~can_convert_object REDEFINITION . METHODS zif_excel_converter~create_fieldcatalog REDEFINITION . METHODS zif_excel_converter~get_supported_class REDEFINITION . *"* protected components of class ZCL_EXCEL_CONVERTER_RESULT_WD *"* do not include other source files here!!! *"* protected components of class ZCL_EXCEL_CONVERTER_RESULT_WD *"* do not include other source files here!!! *"* protected components of class ZCL_EXCEL_CONVERTER_RESULT_WD *"* do not include other source files here!!! PROTECTED SECTION. PRIVATE SECTION. DATA wo_config TYPE REF TO cl_salv_wd_config_table . DATA wt_fields TYPE salv_wd_t_field_ref . DATA wt_columns TYPE salv_wd_t_column_ref . METHODS get_columns_info CHANGING !xs_fcat TYPE lvc_s_fcat . METHODS get_fields_info CHANGING !xs_fcat TYPE lvc_s_fcat . METHODS create_wt_sort . METHODS create_wt_filt . METHODS create_wt_fcat IMPORTING !io_table TYPE REF TO data . ENDCLASS. CLASS zcl_excel_converter_result_wd IMPLEMENTATION. METHOD create_wt_fcat. 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 lvc_s_fcat. FIELD-SYMBOLS: <fs_tab> TYPE ANY TABLE. ASSIGN io_table->* 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-col_pos = ls_dfies-position. ls_fcat-key = ls_dfies-keyflag. get_fields_info( CHANGING xs_fcat = ls_fcat ) . ls_fcat-col_opt = abap_true. get_columns_info( CHANGING xs_fcat = ls_fcat ) . INSERT ls_fcat INTO TABLE wt_fcat. ENDLOOP. ENDMETHOD. METHOD create_wt_filt. * No neeed for superclass. * Only for WD DATA: lt_filters TYPE salv_wd_t_filter_rule_ref, ls_filt TYPE lvc_s_filt. FIELD-SYMBOLS: <fs_fields> TYPE salv_wd_s_field_ref, <fs_filter> TYPE salv_wd_s_filter_rule_ref. LOOP AT wt_fields ASSIGNING <fs_fields>. REFRESH lt_filters. lt_filters = <fs_fields>-r_field->if_salv_wd_filter~get_filter_rules( ) . LOOP AT lt_filters ASSIGNING <fs_filter>. ls_filt-fieldname = <fs_fields>-fieldname. IF <fs_filter>-r_filter_rule->get_included( ) = abap_true. ls_filt-sign = 'I'. ELSE. ls_filt-sign = 'E'. ENDIF. ls_filt-option = <fs_filter>-r_filter_rule->get_operator( ). ls_filt-high = <fs_filter>-r_filter_rule->get_high_value( ) . ls_filt-low = <fs_filter>-r_filter_rule->get_low_value( ) . INSERT ls_filt INTO TABLE wt_filt. ENDLOOP. ENDLOOP. ENDMETHOD. METHOD create_wt_sort. DATA: lo_sort TYPE REF TO cl_salv_wd_sort_rule, l_sort_order TYPE salv_wd_constant, ls_sort TYPE lvc_s_sort. FIELD-SYMBOLS: <fs_fields> TYPE salv_wd_s_field_ref. LOOP AT wt_fields ASSIGNING <fs_fields>. lo_sort = <fs_fields>-r_field->if_salv_wd_sort~get_sort_rule( ) . IF lo_sort IS BOUND. l_sort_order = lo_sort->get_sort_order( ). IF l_sort_order <> if_salv_wd_c_sort=>sort_order. CLEAR ls_sort. ls_sort-spos = lo_sort->get_sort_position( ). ls_sort-fieldname = <fs_fields>-fieldname. ls_sort-subtot = lo_sort->get_group_aggregation( ). IF l_sort_order = if_salv_wd_c_sort=>sort_order_ascending. ls_sort-up = abap_true. ELSE. ls_sort-down = abap_true. ENDIF. INSERT ls_sort INTO TABLE wt_sort. ENDIF. ENDIF. ENDLOOP. ENDMETHOD. METHOD get_columns_info. DATA: l_numc2 TYPE salv_wd_constant. FIELD-SYMBOLS: <fs_column> TYPE salv_wd_s_column_ref. READ TABLE wt_columns ASSIGNING <fs_column> WITH KEY id = xs_fcat-fieldname . IF sy-subrc = 0. xs_fcat-col_pos = <fs_column>-r_column->get_position( ) . l_numc2 = <fs_column>-r_column->get_fixed_position( ). IF l_numc2 = '02'. xs_fcat-fix_column = abap_true . ENDIF. l_numc2 = <fs_column>-r_column->get_visible( ). IF l_numc2 = '01'. xs_fcat-no_out = abap_true . ENDIF. ENDIF. ENDMETHOD. METHOD get_fields_info. DATA: lo_aggr TYPE REF TO cl_salv_wd_aggr_rule, l_aggrtype TYPE salv_wd_constant. FIELD-SYMBOLS: <fs_fields> TYPE salv_wd_s_field_ref. READ TABLE wt_fields ASSIGNING <fs_fields> WITH KEY fieldname = xs_fcat-fieldname. IF sy-subrc = 0. lo_aggr = <fs_fields>-r_field->if_salv_wd_aggr~get_aggr_rule( ) . IF lo_aggr IS BOUND. l_aggrtype = lo_aggr->get_aggregation_type( ) . CASE l_aggrtype. WHEN if_salv_wd_c_aggregation=>aggrtype_total. xs_fcat-do_sum = abap_true. WHEN if_salv_wd_c_aggregation=>aggrtype_minimum. xs_fcat-do_sum = 'A'. WHEN if_salv_wd_c_aggregation=>aggrtype_maximum . xs_fcat-do_sum = 'B'. WHEN if_salv_wd_c_aggregation=>aggrtype_average . xs_fcat-do_sum = 'C'. WHEN OTHERS. CLEAR xs_fcat-do_sum . ENDCASE. ENDIF. ENDIF. ENDMETHOD. METHOD zif_excel_converter~get_supported_class. rv_supported_class = 'CL_SALV_WD_RESULT_DATA_TABLE'. ENDMETHOD. METHOD zif_excel_converter~can_convert_object. DATA: lo_result TYPE REF TO cl_salv_wd_result_data_table. TRY. lo_result ?= io_object. CATCH cx_sy_move_cast_error . RAISE EXCEPTION TYPE zcx_excel. ENDTRY. ENDMETHOD. METHOD zif_excel_converter~create_fieldcatalog. DATA: lo_result TYPE REF TO cl_salv_wd_result_data_table, lo_data TYPE REF TO data. FIELD-SYMBOLS: <fs_table> TYPE STANDARD TABLE. zif_excel_converter~can_convert_object( io_object = io_object ). ws_option = is_option. lo_result ?= io_object. CLEAR: es_layout, et_fieldcatalog. IF lo_result IS BOUND. lo_data = get_table( io_object = lo_result->r_model->r_data ). IF lo_data IS BOUND. ASSIGN lo_data->* TO <fs_table> . wo_config ?= lo_result->r_model->r_model. IF wo_config IS BOUND. wt_fields = wo_config->if_salv_wd_field_settings~get_fields( ) . wt_columns = wo_config->if_salv_wd_column_settings~get_columns( ) . ENDIF. create_wt_fcat( io_table = lo_data ). create_wt_sort( ). create_wt_filt( ). apply_sort( EXPORTING it_table = <fs_table> IMPORTING eo_table = eo_table ) . get_filter( IMPORTING et_filter = et_filter CHANGING xo_table = eo_table ) . update_catalog( CHANGING cs_layout = es_layout ct_fieldcatalog = et_fieldcatalog ). ELSE. * We have a problem and should stop here ENDIF. ENDIF. ENDMETHOD. ENDCLASS.
30.183267
86
0.664731
c7a7f022609c06788359bedd4d13e83a5499b1c5
21,901
abap
ABAP
src/objects/zcl_abapgit_object_tran.clas.abap
hf-kklein/abapGit
3e64854e567570b58c7298e118143c8198a49512
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_tran.clas.abap
hf-kklein/abapGit
3e64854e567570b58c7298e118143c8198a49512
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_tran.clas.abap
hf-kklein/abapGit
3e64854e567570b58c7298e118143c8198a49512
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_object_tran DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL. PUBLIC SECTION. INTERFACES zif_abapgit_object. ALIASES mo_files FOR zif_abapgit_object~mo_files. PROTECTED SECTION. PRIVATE SECTION. TYPES: tty_param_values TYPE STANDARD TABLE OF rsparam WITH NON-UNIQUE DEFAULT KEY . CONSTANTS: c_oo_program TYPE c LENGTH 9 VALUE '\PROGRAM=' ##NO_TEXT, c_oo_class TYPE c LENGTH 7 VALUE '\CLASS=' ##NO_TEXT, c_oo_method TYPE c LENGTH 8 VALUE '\METHOD=' ##NO_TEXT, c_oo_tcode TYPE tcode VALUE 'OS_APPLICATION' ##NO_TEXT, c_oo_frclass TYPE c LENGTH 30 VALUE 'CLASS' ##NO_TEXT, c_oo_frmethod TYPE c LENGTH 30 VALUE 'METHOD' ##NO_TEXT, c_oo_frupdtask TYPE c LENGTH 30 VALUE 'UPDATE_MODE' ##NO_TEXT, c_oo_synchron TYPE c VALUE 'S' ##NO_TEXT, c_oo_asynchron TYPE c VALUE 'U' ##NO_TEXT, c_true TYPE c VALUE 'X' ##NO_TEXT, c_false TYPE c VALUE space ##NO_TEXT. DATA: mt_bcdata TYPE STANDARD TABLE OF bdcdata . METHODS shift_param CHANGING !ct_rsparam TYPE s_param !cs_tstcp TYPE tstcp . METHODS add_data IMPORTING !iv_fnam TYPE bdcdata-fnam !iv_fval TYPE clike . METHODS call_se93 RAISING zcx_abapgit_exception . METHODS set_oo_parameters IMPORTING !it_rsparam TYPE s_param CHANGING !cs_rsstcd TYPE rsstcd . METHODS split_parameters CHANGING !ct_rsparam TYPE s_param !cs_rsstcd TYPE rsstcd !cs_tstcp TYPE tstcp !cs_tstc TYPE tstc . METHODS split_parameters_comp IMPORTING !ig_type TYPE any !ig_param TYPE any CHANGING !cg_value TYPE any . METHODS serialize_texts IMPORTING !io_xml TYPE REF TO zcl_abapgit_xml_output RAISING zcx_abapgit_exception . METHODS deserialize_texts IMPORTING !io_xml TYPE REF TO zcl_abapgit_xml_input RAISING zcx_abapgit_exception . METHODS deserialize_oo_transaction IMPORTING !iv_package TYPE devclass !is_tstc TYPE tstc !is_tstcc TYPE tstcc !is_tstct TYPE tstct !is_rsstcd TYPE rsstcd RAISING zcx_abapgit_exception . ENDCLASS. CLASS zcl_abapgit_object_tran IMPLEMENTATION. METHOD add_data. DATA: ls_bcdata LIKE LINE OF mt_bcdata. ls_bcdata-fnam = iv_fnam. ls_bcdata-fval = iv_fval. APPEND ls_bcdata TO mt_bcdata. ENDMETHOD. METHOD call_se93. DATA: lt_message TYPE STANDARD TABLE OF bdcmsgcoll. FIELD-SYMBOLS: <ls_message> TYPE bdcmsgcoll. CALL FUNCTION 'ABAP4_CALL_TRANSACTION' EXPORTING tcode = 'SE93' mode_val = 'N' TABLES using_tab = mt_bcdata mess_tab = lt_message EXCEPTIONS OTHERS = 1. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( |Error deserializing { ms_item-obj_type } { ms_item-obj_name }| ). ENDIF. LOOP AT lt_message ASSIGNING <ls_message> WHERE msgtyp CA 'EAX'. MESSAGE ID <ls_message>-msgid TYPE <ls_message>-msgtyp NUMBER <ls_message>-msgnr WITH <ls_message>-msgv1 <ls_message>-msgv2 <ls_message>-msgv3 <ls_message>-msgv4 INTO sy-msgli. zcx_abapgit_exception=>raise_t100( ). ENDLOOP. ENDMETHOD. METHOD deserialize_oo_transaction. " You should remember that we don't use batch input just for fun, " but because FM RPY_TRANSACTION_INSERT doesn't support OO transactions. DATA: ls_bcdata TYPE bdcdata. CLEAR mt_bcdata. ls_bcdata-program = 'SAPLSEUK'. ls_bcdata-dynpro = '0390'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO mt_bcdata. add_data( iv_fnam = 'TSTC-TCODE' iv_fval = is_tstc-tcode ). IF zif_abapgit_object~exists( ) = abap_true. add_data( iv_fnam = 'BDC_OKCODE' iv_fval = '=CHNG' ). ELSE. add_data( iv_fnam = 'BDC_OKCODE' iv_fval = '=ADD' ). ENDIF. ls_bcdata-program = 'SAPLSEUK'. ls_bcdata-dynpro = '0300'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO mt_bcdata. add_data( iv_fnam = 'TSTCT-TTEXT' iv_fval = is_tstct-ttext ). add_data( iv_fnam = 'RSSTCD-S_CLASS' iv_fval = 'X' ). add_data( iv_fnam = 'BDC_OKCODE' iv_fval = '=ENTR' ). ls_bcdata-program = 'SAPLSEUK'. ls_bcdata-dynpro = '0360'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO mt_bcdata. add_data( iv_fnam = 'RSSTCD-S_TRFRAME' iv_fval = is_rsstcd-s_trframe ). add_data( iv_fnam = 'RSSTCD-S_UPDTASK' iv_fval = is_rsstcd-s_updtask ). add_data( iv_fnam = 'BDC_OKCODE' iv_fval = '=TR_FRAMEWORK' ). ls_bcdata-program = 'SAPLSEUK'. ls_bcdata-dynpro = '0360'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO mt_bcdata. add_data( iv_fnam = 'RSSTCD-CLASSNAME' iv_fval = is_rsstcd-classname ). add_data( iv_fnam = 'RSSTCD-METHOD' iv_fval = is_rsstcd-method ). IF is_rsstcd-s_local IS NOT INITIAL. add_data( iv_fnam = 'RSSTCD-S_LOCAL' iv_fval = is_rsstcd-s_local ). ENDIF. IF is_rsstcd-s_updlok IS NOT INITIAL. add_data( iv_fnam = 'RSSTCD-S_UPDLOK' iv_fval = is_rsstcd-s_updlok ). ENDIF. add_data( iv_fnam = 'TSTC-PGMNA' iv_fval = is_tstc-pgmna ). IF is_tstcc-s_webgui = '2'. add_data( iv_fnam = 'G_IAC_EWT' iv_fval = abap_true ). add_data( iv_fnam = 'BDC_OKCODE' iv_fval = 'MAKE_PROFI' ). ls_bcdata-program = 'SAPLSEUK'. ls_bcdata-dynpro = '0360'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO mt_bcdata. ELSEIF is_tstcc-s_webgui IS NOT INITIAL. add_data( iv_fnam = 'TSTCC-S_WEBGUI' iv_fval = is_tstcc-s_webgui ). ENDIF. IF is_tstcc-s_pervas IS NOT INITIAL. add_data( iv_fnam = 'TSTCC-S_PERVAS' iv_fval = is_tstcc-s_pervas ). ENDIF. IF is_tstcc-s_service IS NOT INITIAL. add_data( iv_fnam = 'TSTCC-S_SERVICE' iv_fval = is_tstcc-s_service ). ENDIF. IF is_tstcc-s_platin IS NOT INITIAL. add_data( iv_fnam = 'TSTCC-S_PLATIN' iv_fval = is_tstcc-s_platin ). ENDIF. IF is_tstcc-s_win32 IS NOT INITIAL. add_data( iv_fnam = 'TSTCC-S_WIN32' iv_fval = is_tstcc-s_win32 ). ENDIF. add_data( iv_fnam = 'BDC_OKCODE' iv_fval = '=WB_SAVE' ). ls_bcdata-program = 'SAPLSTRD'. ls_bcdata-dynpro = '0100'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO mt_bcdata. add_data( iv_fnam = 'KO007-L_DEVCLASS' iv_fval = iv_package ). add_data( iv_fnam = 'BDC_OKCODE' iv_fval = '=ADD' ). ls_bcdata-program = 'BDC_OKCODE'. ls_bcdata-dynpro = '0360'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO mt_bcdata. add_data( iv_fnam = 'BDC_OKCODE' iv_fval = '=WB_BACK' ). ls_bcdata-program = 'BDC_OKCODE'. ls_bcdata-dynpro = '0360'. ls_bcdata-dynbegin = 'X'. APPEND ls_bcdata TO mt_bcdata. add_data( iv_fnam = 'BDC_OKCODE' iv_fval = '=WB_BACK' ). call_se93( ). ENDMETHOD. METHOD deserialize_texts. DATA lt_tpool_i18n TYPE TABLE OF tstct. FIELD-SYMBOLS <ls_tpool> LIKE LINE OF lt_tpool_i18n. " Read XML-files data io_xml->read( EXPORTING iv_name = 'I18N_TPOOL' CHANGING cg_data = lt_tpool_i18n ). " Force t-code name (security reasons) LOOP AT lt_tpool_i18n ASSIGNING <ls_tpool>. <ls_tpool>-tcode = ms_item-obj_name. ENDLOOP. IF lines( lt_tpool_i18n ) > 0. MODIFY tstct FROM TABLE lt_tpool_i18n. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'Update of t-code translations failed' ). ENDIF. ENDIF. ENDMETHOD. METHOD serialize_texts. DATA lt_tpool_i18n TYPE TABLE OF tstct. IF io_xml->i18n_params( )-serialize_master_lang_only = abap_true. RETURN. ENDIF. " Skip master language - it was already serialized " Don't serialize t-code itself SELECT sprsl ttext INTO CORRESPONDING FIELDS OF TABLE lt_tpool_i18n FROM tstct WHERE sprsl <> mv_language AND tcode = ms_item-obj_name. "#EC CI_GENBUFF IF lines( lt_tpool_i18n ) > 0. SORT lt_tpool_i18n BY sprsl ASCENDING. io_xml->add( iv_name = 'I18N_TPOOL' ig_data = lt_tpool_i18n ). ENDIF. ENDMETHOD. METHOD set_oo_parameters. DATA: ls_param LIKE LINE OF it_rsparam. IF cs_rsstcd-call_tcode = c_oo_tcode. cs_rsstcd-s_trframe = c_true. LOOP AT it_rsparam INTO ls_param. CASE ls_param-field. WHEN c_oo_frclass. cs_rsstcd-classname = ls_param-value. WHEN c_oo_frmethod. cs_rsstcd-method = ls_param-value. WHEN c_oo_frupdtask. IF ls_param-value = c_oo_synchron. cs_rsstcd-s_upddir = c_true. cs_rsstcd-s_updtask = c_false. cs_rsstcd-s_updlok = c_false. ELSEIF ls_param-value = c_oo_asynchron. cs_rsstcd-s_upddir = c_false. cs_rsstcd-s_updtask = c_true. cs_rsstcd-s_updlok = c_false. ELSE. cs_rsstcd-s_upddir = c_false. cs_rsstcd-s_updtask = c_false. cs_rsstcd-s_updlok = c_true. ENDIF. ENDCASE. ENDLOOP. ENDIF. ENDMETHOD. METHOD shift_param. DATA: ls_param LIKE LINE OF ct_rsparam, lv_length TYPE i. FIELD-SYMBOLS <lg_f> TYPE any. DO 254 TIMES. IF cs_tstcp-param = space. EXIT. ENDIF. CLEAR ls_param. IF cs_tstcp-param CA '='. CHECK sy-fdpos <> 0. ASSIGN cs_tstcp-param(sy-fdpos) TO <lg_f>. ls_param-field = <lg_f>. IF ls_param-field(1) = space. SHIFT ls_param-field. ENDIF. sy-fdpos = sy-fdpos + 1. SHIFT cs_tstcp-param BY sy-fdpos PLACES. IF cs_tstcp-param CA ';'. IF sy-fdpos <> 0. ASSIGN cs_tstcp-param(sy-fdpos) TO <lg_f>. ls_param-value = <lg_f>. IF ls_param-value(1) = space. SHIFT ls_param-value. ENDIF. ENDIF. sy-fdpos = sy-fdpos + 1. SHIFT cs_tstcp-param BY sy-fdpos PLACES. APPEND ls_param TO ct_rsparam. ELSE. lv_length = strlen( cs_tstcp-param ). CHECK lv_length > 0. ASSIGN cs_tstcp-param(lv_length) TO <lg_f>. ls_param-value = <lg_f>. IF ls_param-value(1) = space. SHIFT ls_param-value. ENDIF. lv_length = lv_length + 1. SHIFT cs_tstcp-param BY lv_length PLACES. APPEND ls_param TO ct_rsparam. ENDIF. ENDIF. ENDDO. ENDMETHOD. METHOD split_parameters. * see subroutine split_parameters in include LSEUKF01 DATA: lv_off TYPE i, lv_param_beg TYPE i. CLEAR cs_rsstcd-s_vari. IF cs_tstcp-param(1) = '\'. " OO-Transaktion ohne FR split_parameters_comp( EXPORTING ig_type = c_oo_program ig_param = cs_tstcp-param CHANGING cg_value = cs_tstc-pgmna ). split_parameters_comp( EXPORTING ig_type = c_oo_class ig_param = cs_tstcp-param CHANGING cg_value = cs_rsstcd-classname ). split_parameters_comp( EXPORTING ig_type = c_oo_method ig_param = cs_tstcp-param CHANGING cg_value = cs_rsstcd-method ). IF NOT cs_tstc-pgmna IS INITIAL. cs_rsstcd-s_local = c_true. ENDIF. RETURN. ELSEIF cs_tstcp-param(1) = '@'. " Transaktionsvariante cs_rsstcd-s_vari = c_true. IF cs_tstcp-param(2) = '@@'. cs_rsstcd-s_ind_vari = c_true. lv_off = 2. ELSE. CLEAR cs_rsstcd-s_ind_vari. lv_off = 1. ENDIF. IF cs_tstcp-param CA ' '. ENDIF. sy-fdpos = sy-fdpos - lv_off. IF sy-fdpos > 0. cs_rsstcd-call_tcode = cs_tstcp-param+lv_off(sy-fdpos). sy-fdpos = sy-fdpos + 1 + lv_off. cs_rsstcd-variant = cs_tstcp-param+sy-fdpos. ENDIF. ELSEIF cs_tstcp-param(1) = '/'. cs_rsstcd-st_tcode = c_true. cs_rsstcd-st_prog = space. IF cs_tstcp-param+1(1) = '*'. cs_rsstcd-st_skip_1 = c_true. ELSE. CLEAR cs_rsstcd-st_skip_1. ENDIF. IF cs_tstcp-param CA ' '. ENDIF. lv_param_beg = sy-fdpos + 1. sy-fdpos = sy-fdpos - 2. IF sy-fdpos > 0. cs_rsstcd-call_tcode = cs_tstcp-param+2(sy-fdpos). ENDIF. SHIFT cs_tstcp-param BY lv_param_beg PLACES. ELSE. cs_rsstcd-st_tcode = space. cs_rsstcd-st_prog = c_true. ENDIF. shift_param( CHANGING ct_rsparam = ct_rsparam cs_tstcp = cs_tstcp ). set_oo_parameters( EXPORTING it_rsparam = ct_rsparam CHANGING cs_rsstcd = cs_rsstcd ). ENDMETHOD. METHOD split_parameters_comp. DATA: lv_off TYPE i. IF ig_param CS ig_type. lv_off = sy-fdpos + strlen( ig_type ). cg_value = ig_param+lv_off. IF cg_value CA '\'. CLEAR cg_value+sy-fdpos. ENDIF. ENDIF. ENDMETHOD. METHOD zif_abapgit_object~changed_by. rv_user = c_user_unknown. " todo ENDMETHOD. METHOD zif_abapgit_object~delete. DATA: lv_transaction TYPE tstc-tcode. lv_transaction = ms_item-obj_name. CALL FUNCTION 'RPY_TRANSACTION_DELETE' EXPORTING transaction = lv_transaction EXCEPTIONS not_excecuted = 1 object_not_found = 0 OTHERS = 3. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'Error from RPY_TRANSACTION_DELETE' ). ENDIF. ENDMETHOD. METHOD zif_abapgit_object~deserialize. CONSTANTS: lc_hex_tra TYPE x VALUE '00', * lc_hex_men TYPE x VALUE '01', lc_hex_par TYPE x VALUE '02', lc_hex_rep TYPE x VALUE '80', * lc_hex_rpv TYPE x VALUE '10', lc_hex_obj TYPE x VALUE '08'. DATA: lv_dynpro TYPE d020s-dnum, ls_tstc TYPE tstc, lv_type TYPE rglif-docutype, ls_tstct TYPE tstct, ls_tstcc TYPE tstcc, ls_tstcp TYPE tstcp, lt_param_values TYPE tty_param_values, ls_rsstcd TYPE rsstcd. IF zif_abapgit_object~exists( ) = abap_true. zif_abapgit_object~delete( iv_package ). ENDIF. io_xml->read( EXPORTING iv_name = 'TSTC' CHANGING cg_data = ls_tstc ). io_xml->read( EXPORTING iv_name = 'TSTCC' CHANGING cg_data = ls_tstcc ). io_xml->read( EXPORTING iv_name = 'TSTCT' CHANGING cg_data = ls_tstct ). io_xml->read( EXPORTING iv_name = 'TSTCP' CHANGING cg_data = ls_tstcp ). lv_dynpro = ls_tstc-dypno. IF ls_tstc-cinfo O lc_hex_rep. lv_type = ststc_c_type_report. ELSEIF ls_tstc-cinfo O lc_hex_obj. lv_type = ststc_c_type_object. " todo, or ststc_c_type_variant? ELSEIF ls_tstc-cinfo O lc_hex_par. lv_type = ststc_c_type_parameters. ELSEIF ls_tstc-cinfo O lc_hex_tra. lv_type = ststc_c_type_dialog. ELSE. zcx_abapgit_exception=>raise( 'Transaction, unknown CINFO' ). ENDIF. IF ls_tstcp IS NOT INITIAL. split_parameters( CHANGING ct_rsparam = lt_param_values cs_rsstcd = ls_rsstcd cs_tstcp = ls_tstcp cs_tstc = ls_tstc ). ENDIF. CASE lv_type. WHEN ststc_c_type_object. deserialize_oo_transaction( iv_package = iv_package is_tstc = ls_tstc is_tstcc = ls_tstcc is_tstct = ls_tstct is_rsstcd = ls_rsstcd ). WHEN OTHERS. CALL FUNCTION 'RPY_TRANSACTION_INSERT' EXPORTING transaction = ls_tstc-tcode program = ls_tstc-pgmna dynpro = lv_dynpro language = mv_language development_class = iv_package transaction_type = lv_type shorttext = ls_tstct-ttext called_transaction = ls_rsstcd-call_tcode called_transaction_skip = ls_rsstcd-st_skip_1 variant = ls_rsstcd-variant cl_independend = ls_rsstcd-s_ind_vari html_enabled = ls_tstcc-s_webgui java_enabled = ls_tstcc-s_platin wingui_enabled = ls_tstcc-s_win32 TABLES param_values = lt_param_values EXCEPTIONS cancelled = 1 already_exist = 2 permission_error = 3 name_not_allowed = 4 name_conflict = 5 illegal_type = 6 object_inconsistent = 7 db_access_error = 8 OTHERS = 9. IF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'Error from RPY_TRANSACTION_INSERT' ). ENDIF. ENDCASE. " Texts deserializing (translations) deserialize_texts( io_xml ). ENDMETHOD. METHOD zif_abapgit_object~exists. DATA: lv_tcode TYPE tstc-tcode. SELECT SINGLE tcode FROM tstc INTO lv_tcode WHERE tcode = 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-abap TO rt_steps. ENDMETHOD. METHOD zif_abapgit_object~get_metadata. rs_metadata = get_metadata( ). ENDMETHOD. METHOD zif_abapgit_object~is_active. rv_active = is_active( ). ENDMETHOD. METHOD zif_abapgit_object~is_locked. DATA: lv_object TYPE eqegraarg. lv_object = |TN{ ms_item-obj_name }|. OVERLAY lv_object WITH ' '. lv_object = lv_object && '*'. rv_is_locked = exists_a_lock_entry_for( iv_lock_object = 'EEUDB' iv_argument = lv_object ). ENDMETHOD. METHOD zif_abapgit_object~jump. DATA: lt_bdcdata TYPE TABLE OF bdcdata. FIELD-SYMBOLS: <ls_bdcdata> LIKE LINE OF lt_bdcdata. APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>. <ls_bdcdata>-program = 'SAPLSEUK'. <ls_bdcdata>-dynpro = '0390'. <ls_bdcdata>-dynbegin = abap_true. APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>. <ls_bdcdata>-fnam = 'BDC_OKCODE'. <ls_bdcdata>-fval = '=SHOW'. APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>. <ls_bdcdata>-fnam = 'TSTC-TCODE'. <ls_bdcdata>-fval = ms_item-obj_name. CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'GIT' EXPORTING tcode = 'SE93' mode_val = 'E' TABLES using_tab = lt_bdcdata EXCEPTIONS system_failure = 1 communication_failure = 2 resource_failure = 3 OTHERS = 4 ##fm_subrc_ok. "#EC CI_SUBRC ENDMETHOD. METHOD zif_abapgit_object~serialize. DATA: lv_transaction TYPE tstc-tcode, lt_tcodes TYPE TABLE OF tstc, ls_tcode LIKE LINE OF lt_tcodes, ls_tstct TYPE tstct, ls_tstcp TYPE tstcp, lt_gui_attr TYPE TABLE OF tstcc, ls_gui_attr LIKE LINE OF lt_gui_attr. lv_transaction = ms_item-obj_name. CALL FUNCTION 'RPY_TRANSACTION_READ' EXPORTING transaction = lv_transaction TABLES tcodes = lt_tcodes gui_attributes = lt_gui_attr EXCEPTIONS permission_error = 1 cancelled = 2 not_found = 3 object_not_found = 4 OTHERS = 5. IF sy-subrc = 4 OR sy-subrc = 3. RETURN. ELSEIF sy-subrc <> 0. zcx_abapgit_exception=>raise( 'Error from RPY_TRANSACTION_READ' ). ENDIF. SELECT SINGLE * FROM tstct INTO ls_tstct WHERE sprsl = mv_language AND tcode = lv_transaction. "#EC CI_SUBRC "#EC CI_GENBUFF SELECT SINGLE * FROM tstcp INTO ls_tstcp WHERE tcode = lv_transaction. "#EC CI_SUBRC "#EC CI_GENBUFF READ TABLE lt_tcodes INDEX 1 INTO ls_tcode. ASSERT sy-subrc = 0. READ TABLE lt_gui_attr INDEX 1 INTO ls_gui_attr. ASSERT sy-subrc = 0. io_xml->add( iv_name = 'TSTC' ig_data = ls_tcode ). io_xml->add( iv_name = 'TSTCC' ig_data = ls_gui_attr ). io_xml->add( iv_name = 'TSTCT' ig_data = ls_tstct ). IF ls_tstcp IS NOT INITIAL. io_xml->add( iv_name = 'TSTCP' ig_data = ls_tstcp ). ENDIF. " Texts serializing (translations) serialize_texts( io_xml ). ENDMETHOD. ENDCLASS.
28.006394
102
0.588238
c7acda8f1c819cef0faf1ea4c7bc72940c14d237
156
abap
ABAP
src/exceptions/cx_sy_conversion_no_number.clas.abap
sbcgua/open-abap
98d939658ec0db2a1ff2bd6979d7c9b52dc9dc5e
[ "MIT" ]
20
2020-10-02T09:37:08.000Z
2022-03-26T15:29:11.000Z
src/exceptions/cx_sy_conversion_no_number.clas.abap
sbcgua/open-abap
98d939658ec0db2a1ff2bd6979d7c9b52dc9dc5e
[ "MIT" ]
28
2020-12-02T15:19:10.000Z
2022-03-24T06:12:47.000Z
src/exceptions/cx_sy_conversion_no_number.clas.abap
sbcgua/open-abap
98d939658ec0db2a1ff2bd6979d7c9b52dc9dc5e
[ "MIT" ]
2
2020-11-17T13:21:38.000Z
2021-11-07T14:35:54.000Z
CLASS cx_sy_conversion_no_number DEFINITION PUBLIC INHERITING FROM cx_dynamic_check. ENDCLASS. CLASS cx_sy_conversion_no_number IMPLEMENTATION. ENDCLASS.
22.285714
84
0.884615
c7ace58d0c1ae0575edcdc233e635359a4ad02ff
15,104
abap
ABAP
src/objects/zcl_abapgit_object_ueno.clas.abap
goreraks/abapGit
e4bafbe7159650d0a465bb6584f950e4add6b21f
[ "MIT" ]
1
2020-08-05T05:25:41.000Z
2020-08-05T05:25:41.000Z
src/objects/zcl_abapgit_object_ueno.clas.abap
goreraks/abapGit
e4bafbe7159650d0a465bb6584f950e4add6b21f
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_ueno.clas.abap
goreraks/abapGit
e4bafbe7159650d0a465bb6584f950e4add6b21f
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_object_ueno DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL CREATE PUBLIC. 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. TYPES BEGIN OF ty_docu. TYPES language TYPE dm40t-sprache. TYPES header TYPE thead. TYPES content TYPE xstring. TYPES itf TYPE tsftext. TYPES END OF ty_docu. TYPES ty_docu_lines TYPE STANDARD TABLE OF ty_docu WITH DEFAULT KEY. DATA mv_entity_id TYPE udentity. CONSTANTS c_text_object_type TYPE lxeobjtype VALUE 'IM' ##NO_TEXT. CONSTANTS c_active_state TYPE as4local VALUE 'A' ##NO_TEXT. METHODS build_text_name IMPORTING VALUE(iv_id) TYPE tdid RETURNING VALUE(rv_result) TYPE doku_obj. METHODS is_name_permitted RAISING zcx_abapgit_exception. METHODS delete_docu_uen RAISING zcx_abapgit_exception. METHODS delete_docu_url RAISING zcx_abapgit_exception. METHODS delete_docu_usp RAISING zcx_abapgit_exception. METHODS deserialize_docu_uen IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_input RAISING zcx_abapgit_exception. METHODS deserialize_docu_url IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_input RAISING zcx_abapgit_exception. METHODS deserialize_docu_usp IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_input RAISING zcx_abapgit_exception. METHODS serialize_docu_uen IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_output RAISING zcx_abapgit_exception. METHODS serialize_docu_url IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_output RAISING zcx_abapgit_exception. METHODS serialize_docu_xxxx IMPORTING VALUE(iv_id) TYPE tdid RETURNING VALUE(rt_result) TYPE ty_docu_lines. METHODS serialize_docu_usp IMPORTING io_xml TYPE REF TO zcl_abapgit_xml_output RAISING zcx_abapgit_exception. METHODS deserialize_docu_xxxx IMPORTING it_docu TYPE ty_docu_lines RAISING zcx_abapgit_exception. ENDCLASS. CLASS zcl_abapgit_object_ueno IMPLEMENTATION. METHOD build_text_name. TYPES BEGIN OF ty_text_name. TYPES id TYPE c LENGTH 4. TYPES entity TYPE c LENGTH 26. TYPES modifier TYPE c LENGTH 2. TYPES END OF ty_text_name. DATA ls_text_name TYPE ty_text_name. ls_text_name-id = iv_id. ls_text_name-entity = me->mv_entity_id. ls_text_name-modifier = 'A%'. rv_result = ls_text_name. ENDMETHOD. METHOD constructor. super->constructor( is_item = is_item iv_language = iv_language ). me->mv_entity_id = is_item-obj_name. ENDMETHOD. METHOD delete_docu_uen. DATA lt_dm02l TYPE STANDARD TABLE OF dm02l WITH DEFAULT KEY. DATA ls_dm02l TYPE dm02l. SELECT * FROM dm02l INTO TABLE lt_dm02l WHERE entid = me->mv_entity_id. LOOP AT lt_dm02l INTO ls_dm02l. CALL FUNCTION 'SDU_DOCU_DELETE' EXPORTING key1 = ls_dm02l-entid key2 = ls_dm02l-as4local key3 = '00' langu = me->mv_language obj_id = 'UENC' "Entity Comments EXCEPTIONS ret_code = 0. CALL FUNCTION 'SDU_DOCU_DELETE' EXPORTING key1 = ls_dm02l-entid key2 = ls_dm02l-as4local key3 = '00' langu = me->mv_language obj_id = 'UEND' "Entity Definition EXCEPTIONS ret_code = 0. CALL FUNCTION 'SDU_DOCU_DELETE' EXPORTING key1 = ls_dm02l-entid key2 = ls_dm02l-as4local key3 = '00' langu = me->mv_language obj_id = 'UENE' "Entity Example EXCEPTIONS ret_code = 0. ENDLOOP. ENDMETHOD. METHOD delete_docu_url. DATA lt_dm42s TYPE STANDARD TABLE OF dm42s WITH DEFAULT KEY. DATA ls_dm42s LIKE LINE OF lt_dm42s. SELECT * FROM dm42s INTO TABLE lt_dm42s WHERE entidto = me->mv_entity_id. LOOP AT lt_dm42s INTO ls_dm42s. CALL FUNCTION 'SDU_DOCU_DELETE' EXPORTING langu = me->mv_language obj_id = 'URL1' key1 = ls_dm42s-entidto key2 = ls_dm42s-as4local key3 = ls_dm42s-entidfrom key4 = ls_dm42s-ebrolnr EXCEPTIONS ret_code = 0. CALL FUNCTION 'SDU_DOCU_DELETE' EXPORTING langu = me->mv_language obj_id = 'URL2' key1 = ls_dm42s-entidto key2 = ls_dm42s-as4local key3 = ls_dm42s-entidfrom key4 = ls_dm42s-ebrolnr EXCEPTIONS ret_code = 0. CALL FUNCTION 'SDU_DOCU_DELETE' EXPORTING langu = me->mv_language obj_id = 'URLC' key1 = ls_dm42s-entidto key2 = ls_dm42s-as4local key3 = ls_dm42s-entidfrom key4 = ls_dm42s-ebrolnr EXCEPTIONS ret_code = 0. ENDLOOP. ENDMETHOD. METHOD delete_docu_usp. DATA lt_dm45l TYPE STANDARD TABLE OF dm45l WITH DEFAULT KEY. DATA ls_dm45l LIKE LINE OF lt_dm45l. SELECT * FROM dm45l INTO TABLE lt_dm45l WHERE entid = me->ms_item-obj_name. LOOP AT lt_dm45l INTO ls_dm45l. CALL FUNCTION 'SDU_DOCU_DELETE' EXPORTING langu = me->mv_language obj_id = 'USPD' key1 = ls_dm45l-entid key2 = ls_dm45l-as4local key3 = ls_dm45l-spezid EXCEPTIONS ret_code = 0. ENDLOOP. ENDMETHOD. METHOD deserialize_docu_xxxx. DATA ls_docu LIKE LINE OF it_docu. DATA lv_objname TYPE lxeobjname. DATA lv_change_flag TYPE char1. DATA lv_error_status TYPE lxestatprc. LOOP AT it_docu INTO ls_docu. ls_docu-header-tdfuser = sy-uname. ls_docu-header-tdfdate = sy-datum. ls_docu-header-tdftime = sy-uzeit. ls_docu-header-tdluser = sy-uname. ls_docu-header-tdldate = sy-datum. ls_docu-header-tdltime = sy-uzeit. lv_objname = ls_docu-header-tdname. CALL FUNCTION 'LXE_OBJ_DOKU_PUT_XSTRING' EXPORTING slang = me->mv_language tlang = ls_docu-language objtype = ls_docu-header-tdid objname = lv_objname header = ls_docu-header content = ls_docu-content IMPORTING change_flag = lv_change_flag pstatus = lv_error_status. ENDLOOP. ENDMETHOD. METHOD deserialize_docu_uen. DATA lt_docu TYPE ty_docu_lines. io_xml->read( EXPORTING iv_name = 'DOCU_UENC' CHANGING cg_data = lt_docu ). deserialize_docu_xxxx( lt_docu ). CLEAR lt_docu. io_xml->read( EXPORTING iv_name = 'DOCU_UEND' CHANGING cg_data = lt_docu ). deserialize_docu_xxxx( lt_docu ). CLEAR lt_docu. io_xml->read( EXPORTING iv_name = 'DOCU_UENE' CHANGING cg_data = lt_docu ). deserialize_docu_xxxx( lt_docu ). ENDMETHOD. METHOD deserialize_docu_url. DATA lt_docu TYPE ty_docu_lines. io_xml->read( EXPORTING iv_name = 'DOCU_URL1' CHANGING cg_data = lt_docu ). deserialize_docu_xxxx( lt_docu ). CLEAR lt_docu. io_xml->read( EXPORTING iv_name = 'DOCU_URL2' CHANGING cg_data = lt_docu ). deserialize_docu_xxxx( lt_docu ). CLEAR lt_docu. io_xml->read( EXPORTING iv_name = 'DOCU_URLC' CHANGING cg_data = lt_docu ). deserialize_docu_xxxx( lt_docu ). ENDMETHOD. METHOD deserialize_docu_usp. DATA lt_docu TYPE ty_docu_lines. io_xml->read( EXPORTING iv_name = 'DOCU_USPD' CHANGING cg_data = lt_docu ). deserialize_docu_xxxx( lt_docu ). ENDMETHOD. METHOD is_name_permitted. " It is unlikely that a serialized entity will have a name that is not permitted. However " there may be reservations in TRESE which could prohibit the entity name. " So to be safe, we check. Tx SD11 does this check. CALL FUNCTION 'SDU_SAA_CHECK' EXPORTING obj_name = me->ms_item-obj_name obj_type = me->ms_item-obj_type EXCEPTIONS wrong_type = 01. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDMETHOD. METHOD serialize_docu_uen. DATA lt_docu TYPE ty_docu_lines. lt_docu = serialize_docu_xxxx( 'UENC' ). io_xml->add( iv_name = 'DOCU_UENC' ig_data = lt_docu ). lt_docu = serialize_docu_xxxx( 'UEND' ). io_xml->add( iv_name = 'DOCU_UEND' ig_data = lt_docu ). lt_docu = serialize_docu_xxxx( 'UENE' ). io_xml->add( iv_name = 'DOCU_UENE' ig_data = lt_docu ). ENDMETHOD. METHOD serialize_docu_url. DATA lt_docu TYPE ty_docu_lines. lt_docu = serialize_docu_xxxx( 'URL1' ). io_xml->add( iv_name = 'DOCU_URL1' ig_data = lt_docu ). lt_docu = serialize_docu_xxxx( 'URL2' ). io_xml->add( iv_name = 'DOCU_URL2' ig_data = lt_docu ). lt_docu = serialize_docu_xxxx( 'URLC' ). io_xml->add( iv_name = 'DOCU_URLC' ig_data = lt_docu ). ENDMETHOD. METHOD serialize_docu_usp. DATA lt_docu TYPE ty_docu_lines. lt_docu = serialize_docu_xxxx( 'USPD' ). io_xml->add( iv_name = 'DOCU_USPD' ig_data = lt_docu ). ENDMETHOD. METHOD serialize_docu_xxxx. DATA ls_docu TYPE ty_docu. DATA ls_dokvl TYPE dokvl. DATA lt_dokvl TYPE STANDARD TABLE OF dokvl. DATA lv_error_status TYPE lxestatprc. DATA lv_objname TYPE lxeobjname. ls_dokvl-object = me->build_text_name( iv_id = iv_id ). SELECT id object langu FROM dokvl INTO CORRESPONDING FIELDS OF TABLE lt_dokvl WHERE id = c_text_object_type AND object LIKE ls_dokvl-object ##TOO_MANY_ITAB_FIELDS. LOOP AT lt_dokvl INTO ls_dokvl. ls_docu-language = ls_dokvl-langu. lv_objname = ls_dokvl-object. " You are reminded that this function gets the most recent version of the texts. CALL FUNCTION 'LXE_OBJ_DOKU_GET_XSTRING' EXPORTING lang = ls_docu-language objtype = c_text_object_type objname = lv_objname IMPORTING header = ls_docu-header content = ls_docu-content itf = ls_docu-itf pstatus = lv_error_status. CHECK lv_error_status = 'S'. "Success " Administrative information is not CLEAR ls_docu-header-tdfuser. CLEAR ls_docu-header-tdfdate. CLEAR ls_docu-header-tdftime. CLEAR ls_docu-header-tdluser. CLEAR ls_docu-header-tdldate. CLEAR ls_docu-header-tdltime. APPEND ls_docu TO rt_result. ENDLOOP. ENDMETHOD. METHOD zif_abapgit_object~changed_by. SELECT SINGLE lstuser INTO rv_user FROM dm02l WHERE entid = me->mv_entity_id AND as4local = c_active_state. IF sy-subrc <> 0. rv_user = c_user_unknown. ENDIF. ENDMETHOD. METHOD zif_abapgit_object~delete. DATA lo_generic TYPE REF TO zcl_abapgit_objects_generic. CREATE OBJECT lo_generic EXPORTING is_item = ms_item. " The deletion of the documentation occurs before the deletion of " the associated tables - otherwise we don't know what " documentation needs deletion delete_docu_uen( ). delete_docu_url( ). delete_docu_usp( ). " the deletion of the tables of the entity lo_generic->delete( ). ENDMETHOD. METHOD zif_abapgit_object~deserialize. DATA lo_generic TYPE REF TO zcl_abapgit_objects_generic. CREATE OBJECT lo_generic EXPORTING is_item = ms_item. " Is the entity type name compliant with naming conventions? " Entity Type have their own conventions. is_name_permitted( ). lo_generic->deserialize( iv_package = iv_package io_xml = io_xml ). deserialize_docu_uen( io_xml ). deserialize_docu_url( io_xml ). deserialize_docu_usp( io_xml ). " You are reminded that entity types are not relevant for activation. ENDMETHOD. METHOD zif_abapgit_object~exists. DATA: lo_generic TYPE REF TO zcl_abapgit_objects_generic. CREATE OBJECT lo_generic EXPORTING is_item = ms_item. rv_bool = lo_generic->exists( ). 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 = exists_a_lock_entry_for( iv_lock_object = 'ESDUM' iv_argument = |{ ms_item-obj_type }{ ms_item-obj_name }| ). ENDMETHOD. METHOD zif_abapgit_object~jump. " The function module listed below do not open a new window - so we revert to BDC. " CALL FUNCTION 'SDU_MODEL_SHOW' " CALL FUNCTION 'RS_TOOL_ACCESS' DATA lt_bdcdata TYPE TABLE OF bdcdata. FIELD-SYMBOLS: <ls_bdcdata> LIKE LINE OF lt_bdcdata. APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>. <ls_bdcdata>-program = 'SAPMUD00'. <ls_bdcdata>-dynpro = '0100'. <ls_bdcdata>-dynbegin = abap_true. APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>. <ls_bdcdata>-fnam = 'BDC_OKCODE'. <ls_bdcdata>-fval = '=SHOW'. APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>. <ls_bdcdata>-fnam = 'RSUD3-ENTI'. <ls_bdcdata>-fval = abap_true. APPEND INITIAL LINE TO lt_bdcdata ASSIGNING <ls_bdcdata>. <ls_bdcdata>-fnam = 'RSUD3-OBJ_KEY'. <ls_bdcdata>-fval = ms_item-obj_name. CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'GIT' EXPORTING tcode = 'SD11' mode_val = 'E' TABLES using_tab = lt_bdcdata EXCEPTIONS system_failure = 1 communication_failure = 2 resource_failure = 3 OTHERS = 4 ##fm_subrc_ok. "#EC CI_SUBRC ENDMETHOD. METHOD zif_abapgit_object~serialize. DATA: lo_generic TYPE REF TO zcl_abapgit_objects_generic. CREATE OBJECT lo_generic EXPORTING is_item = ms_item. lo_generic->serialize( io_xml ). serialize_docu_uen( io_xml ). serialize_docu_url( io_xml ). serialize_docu_usp( io_xml ). ENDMETHOD. ENDCLASS.
23.489891
93
0.639566
c7af1d9079c0a39cee7ab9150d649f952112930b
2,576
abap
ABAP
src/ztranslate_tool_top.prog.abap
irodrigob/translate_tool
7d691051d9f11a31c0865fdc489b8e168ba35781
[ "MIT" ]
1
2020-05-18T23:39:55.000Z
2020-05-18T23:39:55.000Z
src/ztranslate_tool_top.prog.abap
irodrigob/translate_tool
7d691051d9f11a31c0865fdc489b8e168ba35781
[ "MIT" ]
null
null
null
src/ztranslate_tool_top.prog.abap
irodrigob/translate_tool
7d691051d9f11a31c0865fdc489b8e168ba35781
[ "MIT" ]
null
null
null
*&---------------------------------------------------------------------* *& Include Z_CA02701_TOP *&---------------------------------------------------------------------* *----------------------------------------------------------------------* * Dictionary tables *----------------------------------------------------------------------* TABLES: tadir, t002, lxe_log. *----------------------------------------------------------------------* * Types *----------------------------------------------------------------------* TYPE-POOLS: trwbo, icon, abap. *----------------------------------------------------------------------* * Constants *----------------------------------------------------------------------* * Se acepta propuesta CONSTANTS mc_ok_pprosal TYPE ui_func VALUE 'OK_PPROSAL'. * Confirmar propuestas CONSTANTS mc_pprosal TYPE ui_func VALUE 'PPROSAL'. * Transport data modified CONSTANTS mc_transport TYPE ui_func VALUE 'TRANSPORT'. * Selective transport CONSTANTS mc_trans_obj TYPE ui_func VALUE 'TRANS_OBJ'. *----------------------------------------------------------------------* * Variables *----------------------------------------------------------------------* DATA mo_proces TYPE REF TO ZCL_TRANSLATE_TOOL. " Clase que gestiona el proceso DATA mo_it_data TYPE REF TO data. " Tabla interna con los datos. FIELD-SYMBOLS <it_datos> TYPE table. " Puntero a la tabla interna de datos DATA mv_datos_modif TYPE sap_bool. " Controla si los datos han cambiado. *----------------------------------------------------------------------* * Internal tables *----------------------------------------------------------------------* * Objetos que pueden ser traducidos DATA mt_allowed_object TYPE tr_object_texts. *----------------------------------------------------------------------* * Declaración para los ALV *----------------------------------------------------------------------* * Catalogo de campos de la vista DATA mt_fieldcat TYPE lvc_t_fcat. * Catalogo de campos clave de la vista DATA mt_fieldcat_key TYPE lvc_t_fcat. * Lista de campos para las ordenes de transporte DATA mt_fieldlist TYPE ddfields. * Funciones de la barra del ALV que se excluiran DATA mt_excluding TYPE ui_functions. DATA ms_stable TYPE lvc_s_stbl. DATA ms_layout TYPE lvc_s_layo. DATA ms_variant TYPE disvariant. DATA mt_filters TYPE lvc_t_filt. DATA mo_alv TYPE REF TO cl_gui_alv_grid. DATA mo_container TYPE REF TO cl_gui_docking_container. CLASS lcl_event_alv DEFINITION DEFERRED. DATA mo_event_receiver_alv TYPE REF TO lcl_event_alv. DATA d_okcode TYPE syucomm.
38.447761
78
0.48486
c7b134073339b19302101698d9a8e95cba473c46
29,540
abap
ABAP
src/z4_01_business_objects/z4_012_monster/zcl_z_4_monster_dpc.clas.abap
larshp/ABAPToTheFuture04
43b686f8d9fd7b7fb5414249152dffa54fd05dd8
[ "MIT" ]
null
null
null
src/z4_01_business_objects/z4_012_monster/zcl_z_4_monster_dpc.clas.abap
larshp/ABAPToTheFuture04
43b686f8d9fd7b7fb5414249152dffa54fd05dd8
[ "MIT" ]
null
null
null
src/z4_01_business_objects/z4_012_monster/zcl_z_4_monster_dpc.clas.abap
larshp/ABAPToTheFuture04
43b686f8d9fd7b7fb5414249152dffa54fd05dd8
[ "MIT" ]
null
null
null
class ZCL_Z_4_MONSTER_DPC definition public inheriting from /IWBEP/CL_MGW_PUSH_ABS_DATA abstract create public . public section. interfaces /IWBEP/IF_SB_DPC_COMM_SERVICES . interfaces /IWBEP/IF_SB_GEN_DPC_INJECTION . methods /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITYSET redefinition . methods /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITY redefinition . methods /IWBEP/IF_MGW_APPL_SRV_RUNTIME~UPDATE_ENTITY redefinition . methods /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_ENTITY redefinition . methods /IWBEP/IF_MGW_APPL_SRV_RUNTIME~DELETE_ENTITY redefinition . protected section. data mo_injection type ref to /IWBEP/IF_SB_GEN_DPC_INJECTION . methods MONSTERITEMS_CREATE_ENTITY importing !IV_ENTITY_NAME type STRING !IV_ENTITY_SET_NAME type STRING !IV_SOURCE_NAME type STRING !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY_C optional !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH !IO_DATA_PROVIDER type ref to /IWBEP/IF_MGW_ENTRY_PROVIDER optional exporting !ER_ENTITY type ZCL_Z_4_MONSTER_MPC=>TS_MONSTERITEM raising /IWBEP/CX_MGW_BUSI_EXCEPTION /IWBEP/CX_MGW_TECH_EXCEPTION . methods MONSTERITEMS_DELETE_ENTITY importing !IV_ENTITY_NAME type STRING !IV_ENTITY_SET_NAME type STRING !IV_SOURCE_NAME type STRING !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY_D optional !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH raising /IWBEP/CX_MGW_BUSI_EXCEPTION /IWBEP/CX_MGW_TECH_EXCEPTION . methods MONSTERITEMS_GET_ENTITY importing !IV_ENTITY_NAME type STRING !IV_ENTITY_SET_NAME type STRING !IV_SOURCE_NAME type STRING !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR !IO_REQUEST_OBJECT type ref to /IWBEP/IF_MGW_REQ_ENTITY optional !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY optional !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH exporting !ER_ENTITY type ZCL_Z_4_MONSTER_MPC=>TS_MONSTERITEM !ES_RESPONSE_CONTEXT type /IWBEP/IF_MGW_APPL_SRV_RUNTIME=>TY_S_MGW_RESPONSE_ENTITY_CNTXT raising /IWBEP/CX_MGW_BUSI_EXCEPTION /IWBEP/CX_MGW_TECH_EXCEPTION . methods MONSTERITEMS_GET_ENTITYSET importing !IV_ENTITY_NAME type STRING !IV_ENTITY_SET_NAME type STRING !IV_SOURCE_NAME type STRING !IT_FILTER_SELECT_OPTIONS type /IWBEP/T_MGW_SELECT_OPTION !IS_PAGING type /IWBEP/S_MGW_PAGING !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH !IT_ORDER type /IWBEP/T_MGW_SORTING_ORDER !IV_FILTER_STRING type STRING !IV_SEARCH_STRING type STRING !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITYSET optional exporting !ET_ENTITYSET type ZCL_Z_4_MONSTER_MPC=>TT_MONSTERITEM !ES_RESPONSE_CONTEXT type /IWBEP/IF_MGW_APPL_SRV_RUNTIME=>TY_S_MGW_RESPONSE_CONTEXT raising /IWBEP/CX_MGW_BUSI_EXCEPTION /IWBEP/CX_MGW_TECH_EXCEPTION . methods MONSTERITEMS_UPDATE_ENTITY importing !IV_ENTITY_NAME type STRING !IV_ENTITY_SET_NAME type STRING !IV_SOURCE_NAME type STRING !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY_U optional !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH !IO_DATA_PROVIDER type ref to /IWBEP/IF_MGW_ENTRY_PROVIDER optional exporting !ER_ENTITY type ZCL_Z_4_MONSTER_MPC=>TS_MONSTERITEM raising /IWBEP/CX_MGW_BUSI_EXCEPTION /IWBEP/CX_MGW_TECH_EXCEPTION . methods MONSTERS_CREATE_ENTITY importing !IV_ENTITY_NAME type STRING !IV_ENTITY_SET_NAME type STRING !IV_SOURCE_NAME type STRING !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY_C optional !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH !IO_DATA_PROVIDER type ref to /IWBEP/IF_MGW_ENTRY_PROVIDER optional exporting !ER_ENTITY type ZCL_Z_4_MONSTER_MPC=>TS_MONSTER raising /IWBEP/CX_MGW_BUSI_EXCEPTION /IWBEP/CX_MGW_TECH_EXCEPTION . methods MONSTERS_DELETE_ENTITY importing !IV_ENTITY_NAME type STRING !IV_ENTITY_SET_NAME type STRING !IV_SOURCE_NAME type STRING !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY_D optional !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH raising /IWBEP/CX_MGW_BUSI_EXCEPTION /IWBEP/CX_MGW_TECH_EXCEPTION . methods MONSTERS_GET_ENTITY importing !IV_ENTITY_NAME type STRING !IV_ENTITY_SET_NAME type STRING !IV_SOURCE_NAME type STRING !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR !IO_REQUEST_OBJECT type ref to /IWBEP/IF_MGW_REQ_ENTITY optional !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY optional !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH exporting !ER_ENTITY type ZCL_Z_4_MONSTER_MPC=>TS_MONSTER !ES_RESPONSE_CONTEXT type /IWBEP/IF_MGW_APPL_SRV_RUNTIME=>TY_S_MGW_RESPONSE_ENTITY_CNTXT raising /IWBEP/CX_MGW_BUSI_EXCEPTION /IWBEP/CX_MGW_TECH_EXCEPTION . methods MONSTERS_GET_ENTITYSET importing !IV_ENTITY_NAME type STRING !IV_ENTITY_SET_NAME type STRING !IV_SOURCE_NAME type STRING !IT_FILTER_SELECT_OPTIONS type /IWBEP/T_MGW_SELECT_OPTION !IS_PAGING type /IWBEP/S_MGW_PAGING !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH !IT_ORDER type /IWBEP/T_MGW_SORTING_ORDER !IV_FILTER_STRING type STRING !IV_SEARCH_STRING type STRING !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITYSET optional exporting !ET_ENTITYSET type ZCL_Z_4_MONSTER_MPC=>TT_MONSTER !ES_RESPONSE_CONTEXT type /IWBEP/IF_MGW_APPL_SRV_RUNTIME=>TY_S_MGW_RESPONSE_CONTEXT raising /IWBEP/CX_MGW_BUSI_EXCEPTION /IWBEP/CX_MGW_TECH_EXCEPTION . methods MONSTERS_UPDATE_ENTITY importing !IV_ENTITY_NAME type STRING !IV_ENTITY_SET_NAME type STRING !IV_SOURCE_NAME type STRING !IT_KEY_TAB type /IWBEP/T_MGW_NAME_VALUE_PAIR !IO_TECH_REQUEST_CONTEXT type ref to /IWBEP/IF_MGW_REQ_ENTITY_U optional !IT_NAVIGATION_PATH type /IWBEP/T_MGW_NAVIGATION_PATH !IO_DATA_PROVIDER type ref to /IWBEP/IF_MGW_ENTRY_PROVIDER optional exporting !ER_ENTITY type ZCL_Z_4_MONSTER_MPC=>TS_MONSTER raising /IWBEP/CX_MGW_BUSI_EXCEPTION /IWBEP/CX_MGW_TECH_EXCEPTION . methods CHECK_SUBSCRIPTION_AUTHORITY redefinition . private section. ENDCLASS. CLASS ZCL_Z_4_MONSTER_DPC IMPLEMENTATION. method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~CREATE_ENTITY. *&----------------------------------------------------------------------------------------------* *& Include /IWBEP/DPC_TEMP_CRT_ENTITY_BASE *&* This class has been generated on 27.06.2021 15:16:16 in client 249 *&* *&* WARNING--> NEVER MODIFY THIS CLASS <--WARNING *&* If you want to change the DPC implementation, use the *&* generated methods inside the DPC provider subclass - ZCL_Z_4_MONSTER_DPC_EXT *&-----------------------------------------------------------------------------------------------* DATA monsters_create_entity TYPE zcl_z_4_monster_mpc=>ts_monster. DATA monsteritems_create_entity TYPE zcl_z_4_monster_mpc=>ts_monsteritem. DATA lv_entityset_name TYPE string. lv_entityset_name = io_tech_request_context->get_entity_set_name( ). CASE lv_entityset_name. *-------------------------------------------------------------------------* * EntitySet - Monsters *-------------------------------------------------------------------------* WHEN 'Monsters'. * Call the entity set generated method monsters_create_entity( EXPORTING iv_entity_name = iv_entity_name iv_entity_set_name = iv_entity_set_name iv_source_name = iv_source_name io_data_provider = io_data_provider it_key_tab = it_key_tab it_navigation_path = it_navigation_path io_tech_request_context = io_tech_request_context IMPORTING er_entity = monsters_create_entity ). * Send specific entity data to the caller interfaces copy_data_to_ref( EXPORTING is_data = monsters_create_entity CHANGING cr_data = er_entity ). *-------------------------------------------------------------------------* * EntitySet - Monsteritems *-------------------------------------------------------------------------* WHEN 'Monsteritems'. * Call the entity set generated method monsteritems_create_entity( EXPORTING iv_entity_name = iv_entity_name iv_entity_set_name = iv_entity_set_name iv_source_name = iv_source_name io_data_provider = io_data_provider it_key_tab = it_key_tab it_navigation_path = it_navigation_path io_tech_request_context = io_tech_request_context IMPORTING er_entity = monsteritems_create_entity ). * Send specific entity data to the caller interfaces copy_data_to_ref( EXPORTING is_data = monsteritems_create_entity CHANGING cr_data = er_entity ). when others. super->/iwbep/if_mgw_appl_srv_runtime~create_entity( EXPORTING iv_entity_name = iv_entity_name iv_entity_set_name = iv_entity_set_name iv_source_name = iv_source_name io_data_provider = io_data_provider it_key_tab = it_key_tab it_navigation_path = it_navigation_path IMPORTING er_entity = er_entity ). ENDCASE. endmethod. method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~DELETE_ENTITY. *&----------------------------------------------------------------------------------------------* *& Include /IWBEP/DPC_TEMP_DEL_ENTITY_BASE *&* This class has been generated on 27.06.2021 15:16:16 in client 249 *&* *&* WARNING--> NEVER MODIFY THIS CLASS <--WARNING *&* If you want to change the DPC implementation, use the *&* generated methods inside the DPC provider subclass - ZCL_Z_4_MONSTER_DPC_EXT *&-----------------------------------------------------------------------------------------------* DATA lv_entityset_name TYPE string. lv_entityset_name = io_tech_request_context->get_entity_set_name( ). CASE lv_entityset_name. *-------------------------------------------------------------------------* * EntitySet - Monsters *-------------------------------------------------------------------------* when 'Monsters'. * Call the entity set generated method monsters_delete_entity( EXPORTING iv_entity_name = iv_entity_name iv_entity_set_name = iv_entity_set_name iv_source_name = iv_source_name it_key_tab = it_key_tab it_navigation_path = it_navigation_path io_tech_request_context = io_tech_request_context ). *-------------------------------------------------------------------------* * EntitySet - Monsteritems *-------------------------------------------------------------------------* when 'Monsteritems'. * Call the entity set generated method monsteritems_delete_entity( EXPORTING iv_entity_name = iv_entity_name iv_entity_set_name = iv_entity_set_name iv_source_name = iv_source_name it_key_tab = it_key_tab it_navigation_path = it_navigation_path io_tech_request_context = io_tech_request_context ). when others. super->/iwbep/if_mgw_appl_srv_runtime~delete_entity( EXPORTING iv_entity_name = iv_entity_name iv_entity_set_name = iv_entity_set_name iv_source_name = iv_source_name it_key_tab = it_key_tab it_navigation_path = it_navigation_path ). ENDCASE. endmethod. method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITY. *&-----------------------------------------------------------------------------------------------* *& Include /IWBEP/DPC_TEMP_GETENTITY_BASE *&* This class has been generated on 27.06.2021 15:16:16 in client 249 *&* *&* WARNING--> NEVER MODIFY THIS CLASS <--WARNING *&* If you want to change the DPC implementation, use the *&* generated methods inside the DPC provider subclass - ZCL_Z_4_MONSTER_DPC_EXT *&-----------------------------------------------------------------------------------------------* DATA monsters_get_entity TYPE zcl_z_4_monster_mpc=>ts_monster. DATA monsteritems_get_entity TYPE zcl_z_4_monster_mpc=>ts_monsteritem. DATA lv_entityset_name TYPE string. DATA lr_entity TYPE REF TO data. "#EC NEEDED lv_entityset_name = io_tech_request_context->get_entity_set_name( ). CASE lv_entityset_name. *-------------------------------------------------------------------------* * EntitySet - Monsters *-------------------------------------------------------------------------* WHEN 'Monsters'. * Call the entity set generated method monsters_get_entity( EXPORTING iv_entity_name = iv_entity_name iv_entity_set_name = iv_entity_set_name iv_source_name = iv_source_name it_key_tab = it_key_tab it_navigation_path = it_navigation_path io_tech_request_context = io_tech_request_context IMPORTING er_entity = monsters_get_entity es_response_context = es_response_context ). IF monsters_get_entity IS NOT INITIAL. * Send specific entity data to the caller interface copy_data_to_ref( EXPORTING is_data = monsters_get_entity CHANGING cr_data = er_entity ). ELSE. * In case of initial values - unbind the entity reference er_entity = lr_entity. ENDIF. *-------------------------------------------------------------------------* * EntitySet - Monsteritems *-------------------------------------------------------------------------* WHEN 'Monsteritems'. * Call the entity set generated method monsteritems_get_entity( EXPORTING iv_entity_name = iv_entity_name iv_entity_set_name = iv_entity_set_name iv_source_name = iv_source_name it_key_tab = it_key_tab it_navigation_path = it_navigation_path io_tech_request_context = io_tech_request_context IMPORTING er_entity = monsteritems_get_entity es_response_context = es_response_context ). IF monsteritems_get_entity IS NOT INITIAL. * Send specific entity data to the caller interface copy_data_to_ref( EXPORTING is_data = monsteritems_get_entity CHANGING cr_data = er_entity ). ELSE. * In case of initial values - unbind the entity reference er_entity = lr_entity. ENDIF. WHEN OTHERS. super->/iwbep/if_mgw_appl_srv_runtime~get_entity( EXPORTING iv_entity_name = iv_entity_name iv_entity_set_name = iv_entity_set_name iv_source_name = iv_source_name it_key_tab = it_key_tab it_navigation_path = it_navigation_path IMPORTING er_entity = er_entity ). ENDCASE. endmethod. method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~GET_ENTITYSET. *&----------------------------------------------------------------------------------------------* *& Include /IWBEP/DPC_TMP_ENTITYSET_BASE *&* This class has been generated on 27.06.2021 15:16:16 in client 249 *&* *&* WARNING--> NEVER MODIFY THIS CLASS <--WARNING *&* If you want to change the DPC implementation, use the *&* generated methods inside the DPC provider subclass - ZCL_Z_4_MONSTER_DPC_EXT *&-----------------------------------------------------------------------------------------------* DATA monsters_get_entityset TYPE zcl_z_4_monster_mpc=>tt_monster. DATA monsteritems_get_entityset TYPE zcl_z_4_monster_mpc=>tt_monsteritem. DATA lv_entityset_name TYPE string. lv_entityset_name = io_tech_request_context->get_entity_set_name( ). CASE lv_entityset_name. *-------------------------------------------------------------------------* * EntitySet - Monsters *-------------------------------------------------------------------------* WHEN 'Monsters'. * Call the entity set generated method monsters_get_entityset( EXPORTING iv_entity_name = iv_entity_name iv_entity_set_name = iv_entity_set_name iv_source_name = iv_source_name it_filter_select_options = it_filter_select_options it_order = it_order is_paging = is_paging it_navigation_path = it_navigation_path it_key_tab = it_key_tab iv_filter_string = iv_filter_string iv_search_string = iv_search_string io_tech_request_context = io_tech_request_context IMPORTING et_entityset = monsters_get_entityset es_response_context = es_response_context ). * Send specific entity data to the caller interface copy_data_to_ref( EXPORTING is_data = monsters_get_entityset CHANGING cr_data = er_entityset ). *-------------------------------------------------------------------------* * EntitySet - Monsteritems *-------------------------------------------------------------------------* WHEN 'Monsteritems'. * Call the entity set generated method monsteritems_get_entityset( EXPORTING iv_entity_name = iv_entity_name iv_entity_set_name = iv_entity_set_name iv_source_name = iv_source_name it_filter_select_options = it_filter_select_options it_order = it_order is_paging = is_paging it_navigation_path = it_navigation_path it_key_tab = it_key_tab iv_filter_string = iv_filter_string iv_search_string = iv_search_string io_tech_request_context = io_tech_request_context IMPORTING et_entityset = monsteritems_get_entityset es_response_context = es_response_context ). * Send specific entity data to the caller interface copy_data_to_ref( EXPORTING is_data = monsteritems_get_entityset CHANGING cr_data = er_entityset ). WHEN OTHERS. super->/iwbep/if_mgw_appl_srv_runtime~get_entityset( EXPORTING iv_entity_name = iv_entity_name iv_entity_set_name = iv_entity_set_name iv_source_name = iv_source_name it_filter_select_options = it_filter_select_options it_order = it_order is_paging = is_paging it_navigation_path = it_navigation_path it_key_tab = it_key_tab iv_filter_string = iv_filter_string iv_search_string = iv_search_string io_tech_request_context = io_tech_request_context IMPORTING er_entityset = er_entityset ). ENDCASE. endmethod. method /IWBEP/IF_MGW_APPL_SRV_RUNTIME~UPDATE_ENTITY. *&----------------------------------------------------------------------------------------------* *& Include /IWBEP/DPC_TEMP_UPD_ENTITY_BASE *&* This class has been generated on 27.06.2021 15:16:16 in client 249 *&* *&* WARNING--> NEVER MODIFY THIS CLASS <--WARNING *&* If you want to change the DPC implementation, use the *&* generated methods inside the DPC provider subclass - ZCL_Z_4_MONSTER_DPC_EXT *&-----------------------------------------------------------------------------------------------* DATA monsters_update_entity TYPE zcl_z_4_monster_mpc=>ts_monster. DATA monsteritems_update_entity TYPE zcl_z_4_monster_mpc=>ts_monsteritem. DATA lv_entityset_name TYPE string. DATA lr_entity TYPE REF TO data. "#EC NEEDED lv_entityset_name = io_tech_request_context->get_entity_set_name( ). CASE lv_entityset_name. *-------------------------------------------------------------------------* * EntitySet - Monsters *-------------------------------------------------------------------------* WHEN 'Monsters'. * Call the entity set generated method monsters_update_entity( EXPORTING iv_entity_name = iv_entity_name iv_entity_set_name = iv_entity_set_name iv_source_name = iv_source_name io_data_provider = io_data_provider it_key_tab = it_key_tab it_navigation_path = it_navigation_path io_tech_request_context = io_tech_request_context IMPORTING er_entity = monsters_update_entity ). IF monsters_update_entity IS NOT INITIAL. * Send specific entity data to the caller interface copy_data_to_ref( EXPORTING is_data = monsters_update_entity CHANGING cr_data = er_entity ). ELSE. * In case of initial values - unbind the entity reference er_entity = lr_entity. ENDIF. *-------------------------------------------------------------------------* * EntitySet - Monsteritems *-------------------------------------------------------------------------* WHEN 'Monsteritems'. * Call the entity set generated method monsteritems_update_entity( EXPORTING iv_entity_name = iv_entity_name iv_entity_set_name = iv_entity_set_name iv_source_name = iv_source_name io_data_provider = io_data_provider it_key_tab = it_key_tab it_navigation_path = it_navigation_path io_tech_request_context = io_tech_request_context IMPORTING er_entity = monsteritems_update_entity ). IF monsteritems_update_entity IS NOT INITIAL. * Send specific entity data to the caller interface copy_data_to_ref( EXPORTING is_data = monsteritems_update_entity CHANGING cr_data = er_entity ). ELSE. * In case of initial values - unbind the entity reference er_entity = lr_entity. ENDIF. WHEN OTHERS. super->/iwbep/if_mgw_appl_srv_runtime~update_entity( EXPORTING iv_entity_name = iv_entity_name iv_entity_set_name = iv_entity_set_name iv_source_name = iv_source_name io_data_provider = io_data_provider it_key_tab = it_key_tab it_navigation_path = it_navigation_path IMPORTING er_entity = er_entity ). ENDCASE. endmethod. method /IWBEP/IF_SB_DPC_COMM_SERVICES~COMMIT_WORK. * Call RFC commit work functionality DATA lt_message TYPE bapiret2. "#EC NEEDED DATA lv_message_text TYPE BAPI_MSG. DATA lo_logger TYPE REF TO /iwbep/cl_cos_logger. DATA lv_subrc TYPE syst-subrc. lo_logger = /iwbep/if_mgw_conv_srv_runtime~get_logger( ). IF iv_rfc_dest IS INITIAL OR iv_rfc_dest EQ 'NONE'. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' EXPORTING wait = abap_true IMPORTING return = lt_message. ELSE. CALL FUNCTION 'BAPI_TRANSACTION_COMMIT' DESTINATION iv_rfc_dest EXPORTING wait = abap_true IMPORTING return = lt_message EXCEPTIONS communication_failure = 1000 MESSAGE lv_message_text system_failure = 1001 MESSAGE lv_message_text OTHERS = 1002. IF sy-subrc <> 0. lv_subrc = sy-subrc. /iwbep/cl_sb_gen_dpc_rt_util=>rfc_exception_handling( EXPORTING iv_subrc = lv_subrc iv_exp_message_text = lv_message_text io_logger = lo_logger ). ENDIF. ENDIF. endmethod. method /IWBEP/IF_SB_DPC_COMM_SERVICES~GET_GENERATION_STRATEGY. * Get generation strategy rv_generation_strategy = '1'. endmethod. method /IWBEP/IF_SB_DPC_COMM_SERVICES~LOG_MESSAGE. * Log message in the application log DATA lo_logger TYPE REF TO /iwbep/cl_cos_logger. DATA lv_text TYPE /iwbep/sup_msg_longtext. MESSAGE ID iv_msg_id TYPE iv_msg_type NUMBER iv_msg_number WITH iv_msg_v1 iv_msg_v2 iv_msg_v3 iv_msg_v4 INTO lv_text. lo_logger = mo_context->get_logger( ). lo_logger->log_message( EXPORTING iv_msg_type = iv_msg_type iv_msg_id = iv_msg_id iv_msg_number = iv_msg_number iv_msg_text = lv_text iv_msg_v1 = iv_msg_v1 iv_msg_v2 = iv_msg_v2 iv_msg_v3 = iv_msg_v3 iv_msg_v4 = iv_msg_v4 iv_agent = 'DPC' ). endmethod. method /IWBEP/IF_SB_DPC_COMM_SERVICES~RFC_EXCEPTION_HANDLING. * RFC call exception handling DATA lo_logger TYPE REF TO /iwbep/cl_cos_logger. lo_logger = /iwbep/if_mgw_conv_srv_runtime~get_logger( ). /iwbep/cl_sb_gen_dpc_rt_util=>rfc_exception_handling( EXPORTING iv_subrc = iv_subrc iv_exp_message_text = iv_exp_message_text io_logger = lo_logger ). endmethod. method /IWBEP/IF_SB_DPC_COMM_SERVICES~RFC_SAVE_LOG. DATA lo_logger TYPE REF TO /iwbep/cl_cos_logger. DATA lo_message_container TYPE REF TO /iwbep/if_message_container. lo_logger = /iwbep/if_mgw_conv_srv_runtime~get_logger( ). lo_message_container = /iwbep/if_mgw_conv_srv_runtime~get_message_container( ). " Save the RFC call log in the application log /iwbep/cl_sb_gen_dpc_rt_util=>rfc_save_log( EXPORTING is_return = is_return iv_entity_type = iv_entity_type it_return = it_return it_key_tab = it_key_tab io_logger = lo_logger io_message_container = lo_message_container ). endmethod. method /IWBEP/IF_SB_DPC_COMM_SERVICES~SET_INJECTION. * Unit test injection IF io_unit IS BOUND. mo_injection = io_unit. ELSE. mo_injection = me. ENDIF. endmethod. method CHECK_SUBSCRIPTION_AUTHORITY. RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc EXPORTING textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented method = 'CHECK_SUBSCRIPTION_AUTHORITY'. endmethod. method MONSTERITEMS_CREATE_ENTITY. RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc EXPORTING textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented method = 'MONSTERITEMS_CREATE_ENTITY'. endmethod. method MONSTERITEMS_DELETE_ENTITY. RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc EXPORTING textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented method = 'MONSTERITEMS_DELETE_ENTITY'. endmethod. method MONSTERITEMS_GET_ENTITY. RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc EXPORTING textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented method = 'MONSTERITEMS_GET_ENTITY'. endmethod. method MONSTERITEMS_GET_ENTITYSET. RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc EXPORTING textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented method = 'MONSTERITEMS_GET_ENTITYSET'. endmethod. method MONSTERITEMS_UPDATE_ENTITY. RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc EXPORTING textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented method = 'MONSTERITEMS_UPDATE_ENTITY'. endmethod. method MONSTERS_CREATE_ENTITY. RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc EXPORTING textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented method = 'MONSTERS_CREATE_ENTITY'. endmethod. method MONSTERS_DELETE_ENTITY. RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc EXPORTING textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented method = 'MONSTERS_DELETE_ENTITY'. endmethod. method MONSTERS_GET_ENTITY. RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc EXPORTING textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented method = 'MONSTERS_GET_ENTITY'. endmethod. method MONSTERS_GET_ENTITYSET. RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc EXPORTING textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented method = 'MONSTERS_GET_ENTITYSET'. endmethod. method MONSTERS_UPDATE_ENTITY. RAISE EXCEPTION TYPE /iwbep/cx_mgw_not_impl_exc EXPORTING textid = /iwbep/cx_mgw_not_impl_exc=>method_not_implemented method = 'MONSTERS_UPDATE_ENTITY'. endmethod. ENDCLASS.
37.392405
98
0.63585
c7b3429bf467fcf5f713dd2ac9ad0bda5fba4952
123
abap
ABAP
src/zabap_test_0010.prog.abap
larshp/ABAPTestSuite
afbcbaa387da13f5d9685b5cdc4d32dcda0461ed
[ "MIT" ]
null
null
null
src/zabap_test_0010.prog.abap
larshp/ABAPTestSuite
afbcbaa387da13f5d9685b5cdc4d32dcda0461ed
[ "MIT" ]
null
null
null
src/zabap_test_0010.prog.abap
larshp/ABAPTestSuite
afbcbaa387da13f5d9685b5cdc4d32dcda0461ed
[ "MIT" ]
1
2018-04-19T09:34:45.000Z
2018-04-19T09:34:45.000Z
REPORT zabap_test_0010 NO STANDARD PAGE HEADING. DATA: gv_c TYPE c LENGTH 2. CONCATENATE 'a' 'b' INTO gv_c. WRITE gv_c.
15.375
48
0.747967
c7b559a738137c7a8354db2abe7f31c0063cd894
334
abap
ABAP
zbugtracker_model/zbugtrackermodel.fugr.lzbugtrackermodeli00.abap
rayatus/sapbugtracker
c94439c3bb21908f7945fc5bf3bd88868903e8e8
[ "MIT" ]
3
2019-02-10T22:03:43.000Z
2021-05-26T06:49:55.000Z
zbugtracker_model/zbugtrackermodel.fugr.lzbugtrackermodeli00.abap
rayatus/sapbugtracker
c94439c3bb21908f7945fc5bf3bd88868903e8e8
[ "MIT" ]
2
2020-05-06T14:25:17.000Z
2022-01-13T10:06:40.000Z
zbugtracker_model/zbugtrackermodel.fugr.lzbugtrackermodeli00.abap
rayatus/sapbugtracker
c94439c3bb21908f7945fc5bf3bd88868903e8e8
[ "MIT" ]
1
2021-05-26T06:49:56.000Z
2021-05-26T06:49:56.000Z
*---------------------------------------------------------------------* * view related PAI modules * generation date: 17.03.2013 at 21:51:28 by user BCUSER * view maintenance generator version: #001407# *---------------------------------------------------------------------* INCLUDE LSVIMITX . "base table related PAI modules
41.75
71
0.422156
c7b8af754155c67afb31bbf09d5454f2a41ca7b1
384
abap
ABAP
src/ydk_alv.fugr.conversion_exit_ydk42_input.abap
DKiyanov/ydk_alv_fcat
e438be091901f96f69cea54a1a3a8578abd1029b
[ "MIT" ]
null
null
null
src/ydk_alv.fugr.conversion_exit_ydk42_input.abap
DKiyanov/ydk_alv_fcat
e438be091901f96f69cea54a1a3a8578abd1029b
[ "MIT" ]
null
null
null
src/ydk_alv.fugr.conversion_exit_ydk42_input.abap
DKiyanov/ydk_alv_fcat
e438be091901f96f69cea54a1a3a8578abd1029b
[ "MIT" ]
null
null
null
FUNCTION CONVERSION_EXIT_YDK42_INPUT . *"-------------------------------------------------------------------- *"*"Локальный интерфейс: *" IMPORTING *" REFERENCE(INPUT) *" EXPORTING *" REFERENCE(OUTPUT) *"-------------------------------------------------------------------- * see FM YDK_CONVERSION_EXIT_REGISTER PERFORM input USING '42' input CHANGING output. ENDFUNCTION.
32
70
0.473958
c7bdc0a8bc50734258568d0a65bc409bec092008
6,364
abap
ABAP
src/zabapgit_object_ensc.prog.abap
christian102094/abapGit
b8df5f1e80c3f944f745bdfae61d37931e037e09
[ "MIT" ]
null
null
null
src/zabapgit_object_ensc.prog.abap
christian102094/abapGit
b8df5f1e80c3f944f745bdfae61d37931e037e09
[ "MIT" ]
null
null
null
src/zabapgit_object_ensc.prog.abap
christian102094/abapGit
b8df5f1e80c3f944f745bdfae61d37931e037e09
[ "MIT" ]
null
null
null
*&---------------------------------------------------------------------* *& Include ZABAPGIT_OBJECT_ENSC *&---------------------------------------------------------------------* CLASS lcl_object_ensc DEFINITION INHERITING FROM lcl_objects_super FINAL. PUBLIC SECTION. INTERFACES lif_object. ALIASES mo_files FOR lif_object~mo_files. ENDCLASS. "lcl_object_ensc *----------------------------------------------------------------------* * CLASS lcl_object_ensc IMPLEMENTATION *----------------------------------------------------------------------* CLASS lcl_object_ensc IMPLEMENTATION. METHOD lif_object~has_changed_since. rv_changed = abap_true. ENDMETHOD. "lif_object~has_changed_since METHOD lif_object~changed_by. rv_user = c_user_unknown. " todo ENDMETHOD. METHOD lif_object~deserialize. DATA: lv_spot_name TYPE enhspotcompositename, lv_message TYPE string, lv_enh_shtext TYPE string, lv_enh_spot TYPE enhspotname, lt_enh_spots TYPE enhspotname_it, lt_comp_spots TYPE enhspotname_it, lx_root TYPE REF TO cx_root, lv_package LIKE iv_package, li_spot_ref TYPE REF TO if_enh_spot_composite, lo_spot_ref TYPE REF TO cl_enh_spot_composite. lv_spot_name = ms_item-obj_name. io_xml->read( EXPORTING iv_name = 'SHORTTEXT' CHANGING cg_data = lv_enh_shtext ). io_xml->read( EXPORTING iv_name = 'ENH_SPOTS' "Enhancement spots CHANGING cg_data = lt_enh_spots ). io_xml->read( EXPORTING iv_name = 'COMP_ENH_SPOTS' "Composite enhancement spots CHANGING cg_data = lt_comp_spots ). IF lif_object~exists( ) = abap_true. lif_object~delete( ). ENDIF. lv_package = iv_package. TRY. cl_enh_factory=>create_enhancement_spot_comp( EXPORTING name = lv_spot_name run_dark = abap_true IMPORTING composite = li_spot_ref CHANGING devclass = lv_package ). lo_spot_ref ?= li_spot_ref. lo_spot_ref->if_enh_object_docu~set_shorttext( lv_enh_shtext ). "Add subsequent enhancement spots LOOP AT lt_enh_spots INTO lv_enh_spot. lo_spot_ref->if_enh_spot_composite~add_enh_spot_child( lv_enh_spot ). ENDLOOP. "Add subsequent composite enhancement spots LOOP AT lt_comp_spots INTO lv_enh_spot. lo_spot_ref->if_enh_spot_composite~add_composite_child( lv_enh_spot ). ENDLOOP. lo_spot_ref->if_enh_object~save( ). lo_spot_ref->if_enh_object~activate( ). lo_spot_ref->if_enh_object~unlock( ). CATCH cx_enh_root INTO lx_root. lv_message = `Error occured while deserializing ENSC: ` && lx_root->get_text( ) ##NO_TEXT. lcx_exception=>raise( lv_message ). ENDTRY. ENDMETHOD. "deserialize METHOD lif_object~serialize. DATA: lv_spot_name TYPE enhspotcompositename, lv_message TYPE string, lv_enh_shtext TYPE string, lt_enh_spots TYPE enhspotname_it, lt_comp_spots TYPE enhspotname_it, lx_root TYPE REF TO cx_root, li_spot_ref TYPE REF TO if_enh_spot_composite, lo_spot_ref TYPE REF TO cl_enh_spot_composite. lv_spot_name = ms_item-obj_name. TRY. li_spot_ref = cl_enh_factory=>get_enhancement_spot_comp( lock = '' name = lv_spot_name ). lo_spot_ref ?= li_spot_ref. lv_enh_shtext = li_spot_ref->if_enh_object_docu~get_shorttext( ). "find parent = composite enhancement (ENSC) * lv_parent = cl_r3standard_persistence=>enh_find_parent_composite( lv_spot_name ). "find subsequent enhancement spots lt_enh_spots = lo_spot_ref->if_enh_spot_composite~get_enh_spot_childs( ). "find subsequent composite enhancement spots lt_comp_spots = lo_spot_ref->if_enh_spot_composite~get_composite_childs( ). io_xml->add( ig_data = lv_enh_shtext iv_name = 'SHORTTEXT' ). io_xml->add( ig_data = lt_enh_spots iv_name = 'ENH_SPOTS' ). "Enhancement spots io_xml->add( ig_data = lt_comp_spots iv_name = 'COMP_ENH_SPOTS' ). "Composite enhancement spots CATCH cx_enh_root INTO lx_root. lv_message = `Error occured while serializing ENSC: ` && lx_root->get_text( ) ##NO_TEXT. lcx_exception=>raise( lv_message ). ENDTRY. ENDMETHOD. "serialize METHOD lif_object~exists. DATA: lv_spot_name TYPE enhspotcompositename, li_spot_ref TYPE REF TO if_enh_spot_composite. lv_spot_name = ms_item-obj_name. TRY. li_spot_ref = cl_enh_factory=>get_enhancement_spot_comp( lock = '' name = lv_spot_name ). rv_bool = abap_true. CATCH cx_enh_root. rv_bool = abap_false. ENDTRY. ENDMETHOD. "exists METHOD lif_object~delete. DATA: lv_spot_name TYPE enhspotcompositename, lv_message TYPE string, lx_root TYPE REF TO cx_root, li_spot_ref TYPE REF TO if_enh_spot_composite. lv_spot_name = ms_item-obj_name. TRY. li_spot_ref = cl_enh_factory=>get_enhancement_spot_comp( lock = 'X' name = lv_spot_name ). IF li_spot_ref IS BOUND. li_spot_ref->if_enh_object~delete( nevertheless_delete = 'X' run_dark = 'X' ). ENDIF. li_spot_ref->if_enh_object~unlock( ). CATCH cx_enh_root INTO lx_root. lv_message = `Error occured while deleting ENSC: ` && lx_root->get_text( ) ##NO_TEXT. lcx_exception=>raise( lv_message ). ENDTRY. ENDMETHOD. "delete METHOD lif_object~get_metadata. rs_metadata = get_metadata( ). ENDMETHOD. "get_metadata METHOD lif_object~jump. CALL FUNCTION 'RS_TOOL_ACCESS' EXPORTING operation = 'SHOW' object_name = ms_item-obj_name object_type = 'ENSC' in_new_window = abap_true. ENDMETHOD. "jump METHOD lif_object~compare_to_remote_version. CREATE OBJECT ro_comparison_result TYPE lcl_null_comparison_result. ENDMETHOD. ENDCLASS. "lcl_object_ensc
32.141414
90
0.62555
c7be50fde1a53f466bc33654fa6bb388f0ab25ad
10,461
abap
ABAP
src/ui/zcl_abapgit_gui_page_addonline.clas.abap
RedWolf112/abapGit
4420de02971a3a61f3c526c2778a9ff669d21a0a
[ "MIT" ]
null
null
null
src/ui/zcl_abapgit_gui_page_addonline.clas.abap
RedWolf112/abapGit
4420de02971a3a61f3c526c2778a9ff669d21a0a
[ "MIT" ]
null
null
null
src/ui/zcl_abapgit_gui_page_addonline.clas.abap
RedWolf112/abapGit
4420de02971a3a61f3c526c2778a9ff669d21a0a
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_gui_page_addonline DEFINITION PUBLIC INHERITING FROM zcl_abapgit_gui_page FINAL CREATE PRIVATE . PUBLIC SECTION. CLASS-METHODS create " TODO importing prefilled form data RETURNING VALUE(ro_page) TYPE REF TO zcl_abapgit_gui_page_addonline RAISING zcx_abapgit_exception. METHODS zif_abapgit_gui_event_handler~on_event REDEFINITION . METHODS constructor RAISING zcx_abapgit_exception. PROTECTED SECTION. METHODS render_content REDEFINITION. PRIVATE SECTION. CONSTANTS: BEGIN OF c_id, url TYPE string VALUE 'url', package TYPE string VALUE 'package', branch_name TYPE string VALUE 'branch_name', display_name TYPE string VALUE 'display_name', folder_logic TYPE string VALUE 'folder_logic', ignore_subpackages TYPE string VALUE 'ignore_subpackages', master_lang_only TYPE string VALUE 'master_lang_only', END OF c_id. CONSTANTS: BEGIN OF c_event, go_back TYPE string VALUE 'go-back', choose_package TYPE string VALUE 'choose-package', create_package TYPE string VALUE 'create-package', choose_branch TYPE string VALUE 'choose-branch', add_online_repo TYPE string VALUE 'add-repo-online', END OF c_event. DATA mo_validation_log TYPE REF TO zcl_abapgit_string_map. DATA mo_form_data TYPE REF TO zcl_abapgit_string_map. METHODS parse_form IMPORTING it_post_data TYPE cnht_post_data_tab RETURNING VALUE(ro_form_data) TYPE REF TO zcl_abapgit_string_map RAISING zcx_abapgit_exception. METHODS validate_form IMPORTING io_form_data TYPE REF TO zcl_abapgit_string_map RETURNING VALUE(ro_validation_log) TYPE REF TO zcl_abapgit_string_map RAISING zcx_abapgit_exception. ENDCLASS. CLASS ZCL_ABAPGIT_GUI_PAGE_ADDONLINE IMPLEMENTATION. METHOD constructor. super->constructor( ). ms_control-page_title = 'Clone online repository'. " TODO refactor CREATE OBJECT mo_validation_log. CREATE OBJECT mo_form_data. ENDMETHOD. METHOD create. CREATE OBJECT ro_page. ENDMETHOD. METHOD parse_form. DATA lt_form TYPE tihttpnvp. DATA ls_field LIKE LINE OF lt_form. lt_form = zcl_abapgit_html_action_utils=>parse_post_data( it_post_data ). CREATE OBJECT ro_form_data. LOOP AT lt_form INTO ls_field. CASE ls_field-name. WHEN c_id-url OR c_id-package OR c_id-branch_name OR c_id-display_name OR c_id-folder_logic. ro_form_data->set( iv_key = ls_field-name iv_val = ls_field-value ). WHEN c_id-ignore_subpackages OR c_id-master_lang_only. " Flags ro_form_data->set( iv_key = ls_field-name iv_val = boolc( ls_field-value = 'on' ) ). WHEN OTHERS. zcx_abapgit_exception=>raise( |Unexpected form field [{ ls_field-name }]| ). ENDCASE. ENDLOOP. ENDMETHOD. METHOD render_content. DATA lo_form TYPE REF TO zcl_abapgit_html_form. ri_html = zcl_abapgit_html=>create( ). lo_form = zcl_abapgit_html_form=>create( iv_form_id = 'add-repo-online-form' ). lo_form->text( iv_name = c_id-url iv_required = abap_true iv_label = 'Git repository URL' iv_hint = 'HTTPS address of the repository to clone' iv_placeholder = 'https://github.com/...git' ). lo_form->text( iv_name = c_id-package iv_side_action = c_event-choose_package iv_required = abap_true iv_label = 'Package' iv_hint = 'SAP package for the code (should be a dedicated one)' iv_placeholder = 'Z... / $...' ). lo_form->text( iv_name = c_id-branch_name iv_side_action = c_event-choose_branch iv_label = 'Branch' iv_hint = 'Switch to a specific branch on clone (default: master)' iv_placeholder = 'master' ). lo_form->radio( iv_name = c_id-folder_logic iv_default_value = zif_abapgit_dot_abapgit=>c_folder_logic-prefix iv_label = 'Folder logic' iv_hint = 'Define how package folders are named in the repo (see https://docs.abapgit.org)' ). lo_form->option( iv_label = 'Prefix' iv_value = zif_abapgit_dot_abapgit=>c_folder_logic-prefix ). lo_form->option( iv_label = 'Full' iv_value = zif_abapgit_dot_abapgit=>c_folder_logic-full ). lo_form->text( iv_name = c_id-display_name iv_label = 'Display name' iv_hint = 'Name to show instead of original repo name (optional)' ). lo_form->checkbox( iv_name = c_id-ignore_subpackages iv_label = 'Ignore subpackages' iv_hint = 'Syncronize root package only (see https://docs.abapgit.org)' ). lo_form->checkbox( iv_name = c_id-master_lang_only iv_label = 'Serialize master language only' iv_hint = 'Ignore translations, serialize just master language' ). lo_form->command( iv_label = 'Clone online repo' iv_is_main = abap_true iv_action = c_event-add_online_repo ). lo_form->command( iv_label = 'Create package' iv_action = c_event-create_package ). lo_form->command( iv_label = 'Back' iv_action = c_event-go_back ). ri_html->add( lo_form->render( iv_form_class = 'dialog w600px m-em5-sides' " to center add wmax600px and auto-center instead io_values = mo_form_data io_validation_log = mo_validation_log ) ). ENDMETHOD. METHOD validate_form. DATA lx_err TYPE REF TO zcx_abapgit_exception. CREATE OBJECT ro_validation_log. IF io_form_data->get( c_id-url ) IS INITIAL. ro_validation_log->set( iv_key = c_id-url iv_val = 'Url cannot be empty' ). ELSE. TRY. zcl_abapgit_url=>validate( io_form_data->get( c_id-url ) ). CATCH zcx_abapgit_exception INTO lx_err. ro_validation_log->set( iv_key = c_id-url iv_val = lx_err->get_text( ) ). ENDTRY. ENDIF. IF io_form_data->get( c_id-package ) IS INITIAL. ro_validation_log->set( iv_key = c_id-package iv_val = 'Package cannot be empty' ). ELSE. TRY. zcl_abapgit_repo_srv=>get_instance( )->validate_package( iv_package = |{ io_form_data->get( c_id-package ) }| iv_ign_subpkg = |{ io_form_data->get( c_id-ignore_subpackages ) }| ). CATCH zcx_abapgit_exception INTO lx_err. ro_validation_log->set( iv_key = c_id-package iv_val = lx_err->get_text( ) ). ENDTRY. ENDIF. IF io_form_data->get( c_id-folder_logic ) <> zif_abapgit_dot_abapgit=>c_folder_logic-prefix AND io_form_data->get( c_id-folder_logic ) <> zif_abapgit_dot_abapgit=>c_folder_logic-full. ro_validation_log->set( iv_key = c_id-folder_logic iv_val = |Invalid folder logic { io_form_data->get( c_id-folder_logic ) }. Must be { zif_abapgit_dot_abapgit=>c_folder_logic-prefix } or { zif_abapgit_dot_abapgit=>c_folder_logic-full } | ). ENDIF. ENDMETHOD. METHOD zif_abapgit_gui_event_handler~on_event. DATA ls_repo_params TYPE zif_abapgit_services_repo=>ty_repo_params. mo_form_data = parse_form( it_postdata ). " import data from html before re-render CASE iv_action. WHEN c_event-go_back. ev_state = zcl_abapgit_gui=>c_event_state-go_back. WHEN c_event-create_package. mo_form_data->set( iv_key = c_id-package iv_val = zcl_abapgit_services_basis=>create_package( iv_prefill_package = |{ mo_form_data->get( 'package' ) }| ) ). IF mo_form_data->get( c_id-package ) IS NOT INITIAL. mo_validation_log = validate_form( mo_form_data ). ev_state = zcl_abapgit_gui=>c_event_state-re_render. ELSE. ev_state = zcl_abapgit_gui=>c_event_state-no_more_act. ENDIF. WHEN c_event-choose_package. mo_form_data->set( iv_key = c_id-package iv_val = zcl_abapgit_ui_factory=>get_popups( )->popup_search_help( 'TDEVC-DEVCLASS' ) ). IF mo_form_data->get( c_id-package ) IS NOT INITIAL. mo_validation_log = validate_form( mo_form_data ). ev_state = zcl_abapgit_gui=>c_event_state-re_render. ELSE. ev_state = zcl_abapgit_gui=>c_event_state-no_more_act. ENDIF. WHEN c_event-choose_branch. mo_validation_log = validate_form( mo_form_data ). IF mo_validation_log->has( c_id-url ) = abap_true. ev_state = zcl_abapgit_gui=>c_event_state-re_render. " Display errors RETURN. ENDIF. mo_form_data->set( iv_key = c_id-branch_name iv_val = zcl_abapgit_ui_factory=>get_popups( )->branch_list_popup( mo_form_data->get( c_id-url ) )-name ). IF mo_form_data->get( c_id-branch_name ) IS INITIAL. ev_state = zcl_abapgit_gui=>c_event_state-no_more_act. ELSE. mo_form_data->set( iv_key = c_id-branch_name iv_val = replace( " strip technical val = mo_form_data->get( c_id-branch_name ) sub = 'refs/heads/' with = '' ) ). ev_state = zcl_abapgit_gui=>c_event_state-re_render. ENDIF. WHEN c_event-add_online_repo. mo_validation_log = validate_form( mo_form_data ). IF mo_validation_log->is_empty( ) = abap_true. mo_form_data->to_abap( CHANGING cs_container = ls_repo_params ). zcl_abapgit_services_repo=>new_online( ls_repo_params ). ev_state = zcl_abapgit_gui=>c_event_state-go_back. ELSE. ev_state = zcl_abapgit_gui=>c_event_state-re_render. " Display errors ENDIF. ENDCASE. IF ev_state IS INITIAL. " TODO !!! Refactor this disaster !!! super->zif_abapgit_gui_event_handler~on_event( EXPORTING iv_action = iv_action iv_getdata = iv_getdata it_postdata = it_postdata IMPORTING ei_page = ei_page ev_state = ev_state ). ENDIF. ENDMETHOD. ENDCLASS.
33.315287
116
0.64621
c7bfd92f2098bb6246c5601a9645694782fd7ed8
6,249
abap
ABAP
zcl_glds_demo_check_abap_code.clas.abap
tricktresor/gladius
a052ff7a6bac5b4186e3ee3586e4883f34b17873
[ "MIT" ]
11
2018-06-26T07:58:31.000Z
2021-02-02T09:27:50.000Z
zcl_glds_demo_check_abap_code.clas.abap
tricktresor/gladius
a052ff7a6bac5b4186e3ee3586e4883f34b17873
[ "MIT" ]
2
2018-09-04T19:56:30.000Z
2020-08-11T19:38:52.000Z
zcl_glds_demo_check_abap_code.clas.abap
tricktresor/gladius
a052ff7a6bac5b4186e3ee3586e4883f34b17873
[ "MIT" ]
2
2018-08-13T16:07:21.000Z
2018-10-24T15:09:40.000Z
class ZCL_GLDS_DEMO_CHECK_ABAP_CODE definition public final create public . public section. types: BEGIN OF TS_METRICS, number_of_statements type i, used_statements type string_table, number_of_variables type i, number_of_words type i, number_of_tokens type i, number_of_characters type i, runtime type i, END OF ts_metrics . types: STRING_TABLE type STANDARD TABLE OF string with DEFAULT KEY . class-methods CHECK importing !SOURCE_CODE type STANDARD TABLE !BLACK_LIST type STRING_TABLE !WHITE_LIST type STRING_TABLE raising ZCX_GLDS_DEMO . class-methods RETRIEVE_METRICS importing !SOURCE_CODE type STANDARD TABLE returning value(METRICS) type ZIF_GLDS_DEMO_METRICS=>TS_METRICS . protected section. private section. class-methods PREPARE_CODE importing !SOURCE_CODE type STANDARD TABLE returning value(CODE) type STRING_TABLE . ENDCLASS. CLASS ZCL_GLDS_DEMO_CHECK_ABAP_CODE IMPLEMENTATION. METHOD check. DATA decl_code TYPE string_table. DATA first_word TYPE string. DATA operand TYPE string. DATA key_tab TYPE sana_keyword_tab. DATA(code) = prepare_code( source_code ). "Blacklist LOOP AT black_list INTO DATA(black). LOOP AT code ASSIGNING FIELD-SYMBOL(<code>). FIND black IN <code> IGNORING CASE MATCH OFFSET DATA(moff). IF sy-subrc = 0 AND <code>(moff) <> 'CL_DEMO_OUTPUT'. RAISE EXCEPTION TYPE zcx_glds_demo EXPORTING info = |command { black } is black-listed. do not use!|. ENDIF. ENDLOOP. ENDLOOP. "Keywords for check of = CALL FUNCTION 'RS_GET_ABAP_PATTERN' IMPORTING keywords = key_tab. LOOP AT code ASSIGNING <code>. first_word = match( val = <code> regex = '\<\S+\>' ). "No direct write access to system fields IF ( strlen( first_word ) >= 3 AND first_word(3) = 'SY-' ) OR ( strlen( first_word ) >= 5 AND first_word(5) = 'SYST-' ) OR first_word = 'SY' OR first_word = 'SYST'. EXIT. ENDIF. IF first_word = 'CLEAR' OR first_word = 'FREE'. FIND REGEX `\bSYST\b` IN <code>. IF sy-subrc = 0. EXIT. ENDIF. FIND REGEX `\bSY\b` IN <code>. IF sy-subrc = 0. EXIT. ENDIF. ENDIF. " = identifies and allows assignments if first word is not a keyword, method calls can be excluded by blacklist IF <code> CS ` = `. READ TABLE key_tab WITH KEY word = first_word TRANSPORTING NO FIELDS. "#EC WARNOK IF sy-subrc <> 0. CONTINUE. ENDIF. ENDIF. IF strlen( first_word ) > 16 AND first_word(16) = 'CL_DEMO_OUTPUT=>'. CONTINUE. ENDIF. "Check white list READ TABLE white_list WITH KEY table_line = first_word TRANSPORTING NO FIELDS. IF sy-subrc = 0. IF first_word <> 'INSERT' AND first_word <> 'MODIFY' AND first_word <> 'DELETE'. CONTINUE. ENDIF. ELSE. RAISE EXCEPTION TYPE zcx_glds_demo EXPORTING info = |command { first_word } is not in white list. do not use!|. ENDIF. "These internal table statements need to be identified by searching the internal table in local declarations * decl_code = declarations. * APPEND LINES OF source_code TO decl_code. * decl_code = prepare_code( decl_code ). IF first_word = 'INSERT'. REPLACE 'INTO TABLE' IN <code> WITH 'INTO'. FIND REGEX 'INSERT.+INTO\s(\S+).*' IN <code> SUBMATCHES operand. ELSEIF first_word = 'MODIFY'. REPLACE 'MODIFY TABLE' IN <code> WITH 'MODIFY'. FIND REGEX 'MODIFY\s(\S+).*' IN <code> SUBMATCHES operand. ELSEIF first_word = 'DELETE'. REPLACE 'DELETE TABLE' IN <code> WITH 'DELETE'. FIND REGEX 'DELETE\s(\S+).*' IN <code> SUBMATCHES operand. ENDIF. IF sy-subrc <> 0. RAISE EXCEPTION TYPE zcx_glds_demo EXPORTING info = |No database updates!!|. ENDIF. FIND REGEX 'DATA\s' && operand && '\s(?:TYPE)|(?:LIKE)' IN TABLE decl_code. IF sy-subrc = 0. CONTINUE. ELSE. RAISE EXCEPTION TYPE zcx_glds_demo EXPORTING info = |No data definitions!|. ENDIF. ENDLOOP. ENDMETHOD. METHOD PREPARE_CODE. DATA code_string TYPE string. DATA subcode TYPE TABLE OF string. DATA idx TYPE sy-tabix. DATA begin TYPE string. FIELD-SYMBOLS <code> TYPE string. FIELD-SYMBOLS <subcode> TYPE string. code = source_code. REPLACE ALL OCCURRENCES OF `''` IN TABLE code WITH `lit`. REPLACE ALL OCCURRENCES OF '``' IN TABLE code WITH `lit`. REPLACE ALL OCCURRENCES OF REGEX `'[^']+'` IN TABLE code WITH `literal` ##no_text. REPLACE ALL OCCURRENCES OF REGEX '`[^`]+`' IN TABLE code WITH `literal` ##no_text. REPLACE ALL OCCURRENCES OF REGEX '".*' IN TABLE code WITH ``. REPLACE ALL OCCURRENCES OF REGEX '\A\*.*' IN TABLE code WITH ``. CONCATENATE LINES OF code INTO code_string SEPARATED BY ` `. TRANSLATE code_string TO UPPER CASE. CONDENSE code_string. CLEAR code. SPLIT code_string AT '.' INTO TABLE code. LOOP AT code ASSIGNING <code>. CONDENSE <code>. ENDLOOP. CLEAR subcode. LOOP AT code ASSIGNING <code> WHERE table_line CS ':'. idx = sy-tabix. begin = substring_before( val = <code> sub = ':' ). SHIFT <code> LEFT UP TO ':'. SHIFT <code> LEFT. SPLIT <code> AT ',' INTO TABLE subcode. LOOP AT subcode ASSIGNING <subcode>. <subcode> = begin && ` ` && <subcode>. CONDENSE <subcode>. ENDLOOP. DELETE code INDEX idx. INSERT LINES OF subcode INTO code INDEX idx. ENDLOOP. DELETE code WHERE table_line IS INITIAL. ENDMETHOD. METHOD RETRIEVE_METRICS. DATA tkn TYPE STANDARD TABLE OF stokesx. DATA stm TYPE STANDARD TABLE OF sstmnt. clear metrics. SCAN ABAP-SOURCE source_code TOKENS INTO tkn STATEMENTS INTO stm * WITH DECLARATIONS WITH ANALYSIS. metrics-number_of_statements = lines( stm ). metrics-number_of_tokens = lines( tkn ). loop at tkn into data(t). data(len) = strlen( t-str ). add len to metrics-number_of_characters. endloop. ENDMETHOD. ENDCLASS.
28.930556
115
0.647144
c7c62ddf4a7afa1e14e9b6df67702adf9c759a8d
3,396
abap
ABAP
src/demos/zdemo_excel38.prog.abap
chrisaasan/abap2xlsx
cb315c557225928baacbbcfd42087c3a8ed34a12
[ "Apache-2.0" ]
251
2019-02-23T03:36:38.000Z
2021-12-10T21:39:23.000Z
src/demos/zdemo_excel38.prog.abap
chrisaasan/abap2xlsx
cb315c557225928baacbbcfd42087c3a8ed34a12
[ "Apache-2.0" ]
278
2019-02-17T10:42:59.000Z
2021-12-10T20:24:56.000Z
src/demos/zdemo_excel38.prog.abap
chrisaasan/abap2xlsx
cb315c557225928baacbbcfd42087c3a8ed34a12
[ "Apache-2.0" ]
130
2019-02-20T13:25:30.000Z
2021-12-09T03:20:31.000Z
REPORT zdemo_excel38. DATA: lo_excel TYPE REF TO zcl_excel, lo_worksheet TYPE REF TO zcl_excel_worksheet, lo_column TYPE REF TO zcl_excel_column, lo_drawing TYPE REF TO zcl_excel_drawing. TYPES: BEGIN OF gty_icon, * name TYPE icon_name, "Fix #228 name TYPE iconname, "Fix #228 objid TYPE w3objid, END OF gty_icon, gtyt_icon TYPE STANDARD TABLE OF gty_icon WITH NON-UNIQUE DEFAULT KEY. DATA: lt_icon TYPE gtyt_icon, lv_row TYPE sytabix, ls_wwwdatatab TYPE wwwdatatab, lt_mimedata TYPE STANDARD TABLE OF w3mime WITH NON-UNIQUE DEFAULT KEY, lv_xstring TYPE xstring. FIELD-SYMBOLS: <icon> LIKE LINE OF lt_icon, <mimedata> LIKE LINE OF lt_mimedata. CONSTANTS: gc_save_file_name TYPE string VALUE '38_SAP-Icons.xlsx'. INCLUDE zdemo_excel_outputopt_incl. TABLES: icon. SELECT-OPTIONS: s_icon FOR icon-name DEFAULT 'ICON_LED_*' OPTION CP. START-OF-SELECTION. " Creates active sheet CREATE OBJECT lo_excel. " Get active sheet lo_worksheet = lo_excel->get_active_worksheet( ). lo_worksheet->set_title( ip_title = 'Demo Icons' ). lo_column = lo_worksheet->get_column( ip_column = 'A' ). lo_column->set_auto_size( 'X' ). lo_column = lo_worksheet->get_column( ip_column = 'B' ). lo_column->set_auto_size( 'X' ). * Get all icons SELECT name INTO TABLE lt_icon FROM icon WHERE name IN s_icon ORDER BY name. LOOP AT lt_icon ASSIGNING <icon>. lv_row = sy-tabix. *--------------------------------------------------------------------* * Set name of icon *--------------------------------------------------------------------* lo_worksheet->set_cell( ip_row = lv_row ip_column = 'A' ip_value = <icon>-name ). *--------------------------------------------------------------------* * Check whether the mime-repository holds some icondata for us *--------------------------------------------------------------------* * Get key SELECT SINGLE objid INTO <icon>-objid FROM wwwdata WHERE text = <icon>-name. CHECK sy-subrc = 0. " :o( lo_worksheet->set_cell( ip_row = lv_row ip_column = 'B' ip_value = <icon>-objid ). * Load mimedata CLEAR lt_mimedata. CLEAR ls_wwwdatatab. ls_wwwdatatab-relid = 'MI' . ls_wwwdatatab-objid = <icon>-objid. CALL FUNCTION 'WWWDATA_IMPORT' EXPORTING key = ls_wwwdatatab TABLES mime = lt_mimedata EXCEPTIONS wrong_object_type = 1 import_error = 2 OTHERS = 3. CHECK sy-subrc = 0. " :o( lo_drawing = lo_excel->add_new_drawing( ). lo_drawing->set_position( ip_from_row = lv_row ip_from_col = 'C' ). CLEAR lv_xstring. LOOP AT lt_mimedata ASSIGNING <mimedata>. CONCATENATE lv_xstring <mimedata>-line INTO lv_xstring IN BYTE MODE. ENDLOOP. lo_drawing->set_media( ip_media = lv_xstring ip_media_type = zcl_excel_drawing=>c_media_type_jpg ip_width = 16 ip_height = 14 ). lo_worksheet->add_drawing( lo_drawing ). ENDLOOP. *** Create output lcl_output=>output( lo_excel ).
31.738318
78
0.566549
c7cdc871f1317bdb031b77d05db15961180b341a
3,706
abap
ABAP
src/day19/zcl_advent2020_day19_joltdx.clas.abap
joltdx/abap-advent-2020
5c33296066d7a1bd0bd60c7d1924f38e3471cece
[ "Unlicense" ]
1
2020-12-18T15:45:54.000Z
2020-12-18T15:45:54.000Z
src/day19/zcl_advent2020_day19_joltdx.clas.abap
joltdx/abap-advent-2020
5c33296066d7a1bd0bd60c7d1924f38e3471cece
[ "Unlicense" ]
1
2020-12-01T13:56:31.000Z
2020-12-01T14:15:22.000Z
src/day19/zcl_advent2020_day19_joltdx.clas.abap
joltdx/abap-advent-2020
5c33296066d7a1bd0bd60c7d1924f38e3471cece
[ "Unlicense" ]
null
null
null
CLASS zcl_advent2020_day19_joltdx DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. INTERFACES zif_advent2020_joltdx . PROTECTED SECTION. PRIVATE SECTION. TYPES: BEGIN OF ty_rules, id TYPE i, rule TYPE string, rule_regex TYPE string, END OF ty_rules. DATA mt_rules TYPE STANDARD TABLE OF ty_rules. DATA mv_input_rules TYPE string. DATA mt_messages TYPE STANDARD TABLE OF string. METHODS part_1 RETURNING VALUE(result) TYPE i. METHODS part_2 RETURNING VALUE(result) TYPE i. METHODS parse_rules IMPORTING rules_input TYPE string. METHODS get_regex_for_rule IMPORTING rule_id TYPE i RETURNING VALUE(result) TYPE string. ENDCLASS. CLASS ZCL_ADVENT2020_DAY19_joltdx IMPLEMENTATION. METHOD zif_advent2020_joltdx~solve. REPLACE ALL OCCURRENCES OF |\r| IN input WITH ||. SPLIT input AT |\n\n| INTO mv_input_rules DATA(input_messages). parse_rules( mv_input_rules ). SPLIT input_messages AT |\n| INTO TABLE mt_messages. output = |Part 1: { part_1( ) }\nPart 2: { part_2( ) }|. ENDMETHOD. METHOD part_1. DATA(monster_regex) = |^{ get_regex_for_rule( 0 ) }$|. LOOP AT mt_messages INTO DATA(message). FIND REGEX monster_regex IN message. IF sy-subrc = 0. result = result + 1. ENDIF. ENDLOOP. ENDMETHOD. METHOD part_2. DATA(rule_42) = get_regex_for_rule( 42 ). DATA(rule_31) = get_regex_for_rule( 31 ). DATA(rule_42_31) = |({ rule_42 }{ rule_31 })|. CLEAR mt_rules[]. parse_rules( mv_input_rules ). " 8: 42 | 42 8 READ TABLE mt_rules WITH KEY id = 8 ASSIGNING FIELD-SYMBOL(<rule>). <rule>-rule_regex = |({ rule_42 })+|. " 11: 42 31 | 42 11 31 READ TABLE mt_rules WITH KEY id = 11 ASSIGNING <rule>. " <rule>-rule_regex = |(({ rule_42_31 })\|({ rule_42 }(?R)?{ rule_31 }(?0)?))|. <rule>-rule_regex = |(|. DO 5 TIMES. IF sy-index > 1. <rule>-rule_regex = |{ <rule>-rule_regex }\||. ENDIF. <rule>-rule_regex = |{ <rule>-rule_regex }({ rule_42 }\{{ sy-index }\}{ rule_31 }\{{ sy-index }\})|. ENDDO. <rule>-rule_regex = |{ <rule>-rule_regex })|. DATA(monster_regex) = |^{ get_regex_for_rule( 0 ) }$|. LOOP AT mt_messages INTO DATA(message). FIND REGEX monster_regex IN message. IF sy-subrc = 0. result = result + 1. ENDIF. ENDLOOP. ENDMETHOD. METHOD parse_rules. DATA rule_entry TYPE ty_rules. SPLIT rules_input AT |\n| INTO TABLE DATA(rules_table). LOOP AT rules_table INTO DATA(rules_line). FIND REGEX '^(\d+): (.+)$' IN rules_line SUBMATCHES rule_entry-id rule_entry-rule. FIND REGEX '"(.)"' IN rule_entry-rule SUBMATCHES rule_entry-rule_regex. APPEND rule_entry TO mt_rules. ENDLOOP. ENDMETHOD. METHOD get_regex_for_rule. DATA this_rule TYPE string. DATA next_step_rule TYPE string. READ TABLE mt_rules WITH KEY id = rule_id ASSIGNING FIELD-SYMBOL(<rule>). IF <rule>-rule_regex IS NOT INITIAL. result = <rule>-rule_regex. RETURN. ENDIF. SPLIT <rule>-rule AT | \| | INTO TABLE DATA(next_rules). <rule>-rule_regex = |(|. LOOP AT next_rules INTO DATA(next_rule). IF sy-tabix > 1. <rule>-rule_regex = |{ <rule>-rule_regex }\||. ENDIF. SPLIT next_rule AT | | INTO TABLE DATA(tokens). LOOP AT tokens INTO DATA(token). <rule>-rule_regex = |{ <rule>-rule_regex }{ get_regex_for_rule( token ) }|. ENDLOOP. ENDLOOP. <rule>-rule_regex = |{ <rule>-rule_regex })|. result = <rule>-rule_regex. ENDMETHOD. ENDCLASS.
28.075758
106
0.632488
c7d02eef444e407b9de4314dde6cd161edde4e88
1,136
abap
ABAP
src/zcl_dp_deco_kontrol_yurutme.clas.abap
keremkoseoglu/MAR2022
1761a16ce4d180e9102d78b70859f69e56aeef04
[ "MIT" ]
null
null
null
src/zcl_dp_deco_kontrol_yurutme.clas.abap
keremkoseoglu/MAR2022
1761a16ce4d180e9102d78b70859f69e56aeef04
[ "MIT" ]
null
null
null
src/zcl_dp_deco_kontrol_yurutme.clas.abap
keremkoseoglu/MAR2022
1761a16ce4d180e9102d78b70859f69e56aeef04
[ "MIT" ]
null
null
null
CLASS zcl_dp_deco_kontrol_yurutme DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. TYPES: sonuc_list TYPE STANDARD TABLE OF text50 WITH EMPTY KEY. METHODS tum_kontrolleri_yurut IMPORTING !veri TYPE char15 EXPORTING !basarili TYPE abap_bool !sonuclar TYPE sonuc_list. PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS zcl_dp_deco_kontrol_yurutme IMPLEMENTATION. METHOD tum_kontrolleri_yurut. DATA obj TYPE REF TO object. basarili = abap_True. SELECT clsname FROM seometarel WHERE refclsname = 'ZIF_DP_DECO_KONTROL' INTO TABLE @DATA(siniflar). LOOP AT siniflar ASSIGNING FIELD-SYMBOL(<snf>). CREATE OBJECT obj TYPE (<snf>-clsname). DATA(decorator) = CAST zif_dp_deco_kontrol( obj ). " ?= decorator->kontrol_et( EXPORTING veri = veri IMPORTING basarili = DATA(deco_basarili) sonuc_msg = DATA(deco_sonuc_msg) ). IF deco_basarili = abap_False. basarili = abap_False. ENDIF. APPEND deco_sonuc_msg TO sonuclar. ENDLOOP. ENDMETHOD. ENDCLASS.
24.695652
67
0.676937
c7d119e9583a3ea7815699b2ff5c52da1be50d3b
17,693
abap
ABAP
zcl_html_kojs.clas.abap
hapejot/abapTools
8eaa4fec81e666825495fad8f150585a35a06b78
[ "MIT" ]
4
2018-06-07T08:54:25.000Z
2018-10-12T10:43:38.000Z
zcl_html_kojs.clas.abap
hapejot/abapTools
8eaa4fec81e666825495fad8f150585a35a06b78
[ "MIT" ]
null
null
null
zcl_html_kojs.clas.abap
hapejot/abapTools
8eaa4fec81e666825495fad8f150585a35a06b78
[ "MIT" ]
null
null
null
class ZCL_HTML_KOJS definition public final create private . public section. types: tt_nametab TYPE TABLE OF fieldname WITH DEFAULT KEY . class-methods GET_GUI_COLOR importing !ID_ID type I default CL_WF_GUI_RESOURCES_4_HTML=>COL_BACKGROUND_LEVEL1 returning value(RD_BGCOLOR) type STRING . class-methods CREATE importing !IR_PARENT type ref to CL_GUI_CONTAINER returning value(R_RESULT) type ref to ZCL_HTML_KOJS . class-methods PROJECT_TABLE importing !IT_TABLE type STANDARD TABLE !IT_NAMETAB type TT_NAMETAB returning value(RR_RESULT) type ref to DATA . class-methods PROJECT_STRUCT importing !IS_STRUCT type ANY !IT_NAMETAB type TT_NAMETAB returning value(RR_RESULT) type ref to DATA . class-methods STRING_TO_TABLE importing !I_STR type STRING optional returning value(R_RESULT) type SDYDO_TEXT_TABLE . class-methods HANDLE_DIALOG_CLOSE for event CLOSE of CL_GUI_DIALOGBOX_CONTAINER importing !SENDER . methods WRITE importing !I_NAME type STRING !I_DATA type ANY returning value(RR_OUTPUT) type ref to ZCL_HTML_KOJS . methods DISPLAY importing !IV_TEMPLATE type WWWDATAID-OBJID default 'ZORDERHEADER' . class-methods TEST . PROTECTED SECTION. PRIVATE SECTION. DATA: gt_parts TYPE TABLE OF string . DATA m_value TYPE string . DATA mr_container TYPE REF TO cl_gui_container . DATA mr_viewer TYPE REF TO cl_gui_html_viewer . DATA: m_url TYPE c LENGTH 2000 . DATA m_sep TYPE string . DATA m_cmd TYPE string . METHODS init . METHODS constructor . METHODS write_data IMPORTING !i_data TYPE any . METHODS write_elem_object IMPORTING !io_type TYPE REF TO cl_abap_elemdescr !i_value TYPE data . METHODS write_struct_object IMPORTING !io_type TYPE REF TO cl_abap_structdescr !i_struct TYPE data . METHODS write_table_object IMPORTING !io_type TYPE REF TO cl_abap_tabledescr !i_table TYPE table . METHODS install_files IMPORTING !iv_template TYPE wwwdataid-objid . METHODS generate_meta_header IMPORTING !io_struct_type TYPE REF TO cl_abap_structdescr !it_comps TYPE cl_abap_structdescr=>component_table . METHODS handle_sapevent FOR EVENT sapevent OF cl_gui_html_viewer IMPORTING !action !frame !getdata !postdata !query_table . ENDCLASS. CLASS ZCL_HTML_KOJS IMPLEMENTATION. METHOD constructor. ENDMETHOD. METHOD create. CREATE OBJECT r_result. r_result->mr_container = ir_parent. r_result->init( ). ENDMETHOD. METHOD display. DATA l_html TYPE string. INSERT |g_Model = \{\n| INTO gt_parts INDEX 1. APPEND |\};\n| TO gt_parts. CONCATENATE LINES OF gt_parts INTO l_html. DATA(l_data) = string_to_table( l_html ). install_files( iv_template ). CALL METHOD mr_viewer->load_data EXPORTING url = 'data.js' CHANGING data_table = l_data EXCEPTIONS dp_invalid_parameter = 1 dp_error_general = 2 cntl_error = 3 html_syntax_notcorrect = 4 OTHERS = 5. CALL METHOD mr_viewer->show_url EXPORTING url = m_url EXCEPTIONS cntl_error = 1 cnht_error_not_allowed = 2 cnht_error_parameter = 3 dp_error_general = 4 OTHERS = 5. CLEAR gt_parts[]. ENDMETHOD. METHOD generate_meta_header. DATA lo_elem_descr TYPE REF TO cl_abap_elemdescr. DATA lo_str_descr TYPE REF TO cl_abap_structdescr. DATA lo_descr TYPE REF TO cl_abap_datadescr. DATA l_sep0 TYPE string. DATA ls_comp TYPE abap_componentdescr. APPEND 'h: {' TO gt_parts. LOOP AT it_comps INTO ls_comp WHERE name IS NOT INITIAL. CALL METHOD io_struct_type->get_component_type EXPORTING p_name = ls_comp-name RECEIVING p_descr_ref = lo_descr EXCEPTIONS component_not_found = 1 unsupported_input_type = 2 OTHERS = 3. IF sy-subrc IS INITIAL. TRY. lo_elem_descr ?= lo_descr. DATA(l_fielddesc) = lo_elem_descr->get_ddic_field( sy-langu ). APPEND l_sep0 TO gt_parts. l_sep0 = ', '. APPEND |{ ls_comp-name }:\{width: { l_fielddesc-outputlen ALPHA = OUT }, title: '{ escape( val = l_fielddesc-scrtext_s format = cl_abap_format=>e_html_js ) }', title_m: '{ escape( val = l_fielddesc-scrtext_m format = cl_abap_format=>e_html_js ) }', title_l: '{ escape( val = l_fielddesc-scrtext_l format = cl_abap_format=>e_html_js ) }'\}\n| TO gt_parts. APPEND || TO gt_parts. APPEND || TO gt_parts. CATCH cx_sy_move_cast_error. * lo_str_descr ?= lo_descr. * DATA(lt_comps) = lo_str_descr->get_components( ). * generate_meta_header( io_struct_type = lo_str_descr it_comps = lt_comps ). ENDTRY. ELSE. APPEND |// ERROR: { ls_comp-name }| TO gt_parts. ENDIF. ENDLOOP. APPEND '}' TO gt_parts. ENDMETHOD. METHOD get_gui_color. DATA: ld_back_color_i TYPE i, ld_back_color_x TYPE x LENGTH 3, ld_back_color_string TYPE string. *Get default background color CALL METHOD cl_gui_resources=>get_background_color EXPORTING id = id_id state = 0 IMPORTING color = ld_back_color_i EXCEPTIONS OTHERS = 1. *Convert color to hex value ld_back_color_x = ld_back_color_i. ld_back_color_string = ld_back_color_x. CONCATENATE '#' ld_back_color_string+4(2) ld_back_color_string+2(2) ld_back_color_string+0(2) INTO rd_bgcolor. ENDMETHOD. METHOD handle_dialog_close. DATA lr_dialog TYPE REF TO cl_gui_dialogbox_container. lr_dialog ?= sender. IF lr_dialog IS BOUND. lr_dialog->set_visible( abap_false ). ENDIF. LEAVE PROGRAM. ENDMETHOD. METHOD handle_sapevent. m_cmd = action. MESSAGE |got { getdata }.| TYPE 'S'. ENDMETHOD. METHOD init. CREATE OBJECT mr_viewer EXPORTING parent = mr_container EXCEPTIONS cntl_error = 1 cntl_install_error = 2 dp_install_error = 3 dp_error = 4 OTHERS = 5. mr_viewer->set_registered_events( EXPORTING events = VALUE #( ( eventid = mr_viewer->m_id_sapevent ) ) ). SET HANDLER handle_sapevent FOR mr_viewer. ENDMETHOD. METHOD install_files. DATA lt_js TYPE TABLE OF tdline. CALL METHOD mr_viewer->load_mime_object EXPORTING object_id = 'Z_KNOCKOUTJS' object_url = 'knockoutjs.js' EXCEPTIONS object_not_found = 1 dp_invalid_parameter = 2 dp_error_general = 3 OTHERS = 4. CALL METHOD mr_viewer->load_mime_object EXPORTING object_id = 'Z_W3CSS' object_url = 'w3.css' EXCEPTIONS object_not_found = 1 dp_invalid_parameter = 2 dp_error_general = 3 OTHERS = 4. CALL METHOD mr_viewer->load_html_document EXPORTING document_id = iv_template "'ZORDERHEADER' document_url = 'main.html' IMPORTING assigned_url = m_url EXCEPTIONS document_not_found = 1 dp_error_general = 2 dp_invalid_parameter = 3 html_syntax_notcorrect = 4 OTHERS = 5. * APPEND 'var SimpleListModel = function(items) { ' TO lt_js. * APPEND ' this.items = ko.observableArray(items); ' TO lt_js. * APPEND ' this.itemToAdd = ko.observable(""); ' TO lt_js. * APPEND ' this.addItem = function() { ' TO lt_js. * APPEND ' if (this.itemToAdd() != "") { ' TO lt_js. * APPEND ' this.items.push(this.itemToAdd()); ' TO lt_js. * APPEND ' this.itemToAdd(""); ' TO lt_js. * APPEND ' } ' TO lt_js. * APPEND ' }.bind(this); ' TO lt_js. * APPEND ' ' TO lt_js. APPEND 'ko.applyBindings(g_Model);' TO lt_js. APPEND 'alert("binding completed"); ' TO lt_js. CALL METHOD mr_viewer->load_data EXPORTING url = 'custom.js' CHANGING data_table = lt_js EXCEPTIONS dp_invalid_parameter = 1 dp_error_general = 2 cntl_error = 3 html_syntax_notcorrect = 4 OTHERS = 5. ENDMETHOD. METHOD project_struct. DATA l_tab_desc TYPE REF TO cl_abap_tabledescr. DATA l_rec_desc TYPE REF TO cl_abap_structdescr. DATA l_new_rec_desc TYPE REF TO cl_abap_structdescr. DATA l_typ_desc TYPE REF TO cl_abap_typedescr. DATA l_fieldname TYPE fieldname. DATA lt_components TYPE cl_abap_structdescr=>component_table. l_rec_desc ?= cl_abap_typedescr=>describe_by_data( is_struct ). LOOP AT l_rec_desc->get_components( ) INTO DATA(ls_comp). l_fieldname = VALUE #( it_nametab[ table_line = ls_comp-name ] OPTIONAL ). IF l_fieldname IS NOT INITIAL. APPEND INITIAL LINE TO lt_components REFERENCE INTO DATA(lr_comp). lr_comp->name = ls_comp-name. lr_comp->type = l_rec_desc->get_component_type( p_name = ls_comp-name ). ENDIF. ENDLOOP. l_new_rec_desc = cl_abap_structdescr=>create( EXPORTING p_components = lt_components ). CREATE DATA rr_result TYPE HANDLE l_new_rec_desc. ASSIGN rr_result->* TO FIELD-SYMBOL(<fs_new_struct>). MOVE-CORRESPONDING is_struct TO <fs_new_struct>. ENDMETHOD. METHOD project_table. DATA l_tab_desc TYPE REF TO cl_abap_tabledescr. DATA l_rec_desc TYPE REF TO cl_abap_structdescr. DATA l_new_rec_desc TYPE REF TO cl_abap_structdescr. DATA l_new_tab_desc TYPE REF TO cl_abap_tabledescr. DATA l_typ_desc TYPE REF TO cl_abap_typedescr. DATA l_fieldname TYPE fieldname. DATA lt_components TYPE cl_abap_structdescr=>component_table. l_tab_desc ?= cl_abap_typedescr=>describe_by_data( p_data = it_table ). CHECK l_tab_desc IS BOUND. l_rec_desc ?= l_tab_desc->get_table_line_type( ). LOOP AT l_rec_desc->get_components( ) INTO DATA(ls_comp). l_fieldname = VALUE #( it_nametab[ table_line = ls_comp-name ] OPTIONAL ). IF l_fieldname IS NOT INITIAL. APPEND INITIAL LINE TO lt_components REFERENCE INTO DATA(lr_comp). lr_comp->name = ls_comp-name. lr_comp->type = l_rec_desc->get_component_type( p_name = ls_comp-name ). ENDIF. ENDLOOP. l_new_rec_desc = cl_abap_structdescr=>create( EXPORTING p_components = lt_components ). l_new_tab_desc = cl_abap_tabledescr=>create( p_line_type = l_new_rec_desc ). CREATE DATA rr_result TYPE HANDLE l_new_tab_desc. FIELD-SYMBOLS <fs_data> TYPE STANDARD TABLE. ASSIGN rr_result->* TO <fs_data> CASTING TYPE HANDLE l_new_tab_desc. LOOP AT it_table ASSIGNING FIELD-SYMBOL(<fs_src_row>). APPEND INITIAL LINE TO <fs_data> ASSIGNING FIELD-SYMBOL(<fs_dst_row>). MOVE-CORRESPONDING <fs_src_row> TO <fs_dst_row>. ENDLOOP. ENDMETHOD. METHOD string_to_table. DATA(l_str) = i_str. DATA(l_len) = strlen( l_str ). WHILE l_len > 255. APPEND l_str(255) TO r_result. SHIFT l_str LEFT BY 255 PLACES. l_len = strlen( l_str ). ENDWHILE. APPEND l_str TO r_result. ENDMETHOD. METHOD test. DATA(lr_html) = zcl_html_kojs=>create( cl_gui_container=>default_screen ). DATA(msg) = VALUE bapiret2( message = 'Meldung' ). lr_html->write( i_name = 'MSG' i_data = msg )->display( iv_template = 'Z_MAINJS' ). ENDMETHOD. METHOD write. DATA l_type TYPE c LENGTH 1. DATA l_comp TYPE i. APPEND |{ m_sep }{ i_name }:| TO gt_parts. m_sep = |,\n\n|. DESCRIBE FIELD i_data TYPE l_type COMPONENTS l_comp. CASE l_type. WHEN 'C'. APPEND escape( val = CONV string( i_data ) format = cl_abap_format=>e_xml_text ) TO gt_parts. WHEN OTHERS. write_data( i_data ). ENDCASE. rr_output = me. ENDMETHOD. METHOD write_data. FIELD-SYMBOLS <fs_data> TYPE any. ASSIGN i_data TO <fs_data>. DATA(lo_type) = cl_abap_typedescr=>describe_by_data( <fs_data> ). IF lo_type IS INSTANCE OF cl_abap_refdescr. ASSIGN i_data->* TO <fs_data>. lo_type = cl_abap_typedescr=>describe_by_data( <fs_data> ). ENDIF. CASE TYPE OF lo_type. WHEN TYPE cl_abap_elemdescr INTO DATA(lo_elem_type). write_elem_object( io_type = lo_elem_type i_value = <fs_data> ). WHEN TYPE cl_abap_structdescr INTO DATA(lo_struct_type). write_struct_object( io_type = lo_struct_type i_struct = <fs_data> ). WHEN TYPE cl_abap_tabledescr INTO DATA(lo_table_type). write_table_object( io_type = lo_table_type i_table = <fs_data> ). ENDCASE. ENDMETHOD. METHOD write_elem_object. DATA: l_string TYPE string. l_string = |'{ i_value }'|. APPEND escape( val = l_string format = cl_abap_format=>e_json_string ) TO gt_parts. ENDMETHOD. METHOD write_struct_object. DATA lo_elem_descr TYPE REF TO cl_abap_elemdescr. DATA l_outval TYPE c LENGTH 1000. DATA l_sep TYPE string. DATA(lt_comps) = io_type->get_components( ). FIELD-SYMBOLS <l_value> TYPE any. FIELD-SYMBOLS <fs_row> TYPE any. APPEND |\{| TO gt_parts. generate_meta_header( io_struct_type = io_type it_comps = lt_comps ). APPEND |, d:\{ | TO gt_parts. LOOP AT lt_comps INTO DATA(ls_comp). ASSIGN COMPONENT ls_comp-name OF STRUCTURE i_struct TO <l_value>. * DATA(ls_outval) = |{ <l_value> }|. DATA(lo_type) = cl_abap_typedescr=>describe_by_data( <l_value> ). CASE TYPE OF lo_type. WHEN TYPE cl_abap_elemdescr. WRITE <l_value> TO l_outval. IF l_outval IS NOT INITIAL. APPEND |{ l_sep }{ ls_comp-name } : '{ escape( val = CONV string( l_outval ) format = cl_abap_format=>e_html_js ) }'| TO gt_parts. l_sep = |, |. ENDIF. WHEN TYPE cl_abap_structdescr INTO DATA(lo_struct_type). APPEND |{ l_sep }{ ls_comp-name } : | TO gt_parts. l_sep = |, |. write_struct_object( io_type = lo_struct_type i_struct = <l_value> ). WHEN TYPE cl_abap_tabledescr INTO DATA(lo_table_type). APPEND |{ l_sep }{ ls_comp-name } : | TO gt_parts. l_sep = |, |. write_table_object( io_type = lo_table_type i_table = <l_value> ). ENDCASE. ENDLOOP. APPEND |\}\n\}| TO gt_parts. ENDMETHOD. METHOD write_table_object. DATA: lo_struct_type TYPE REF TO cl_abap_structdescr, lo_elem_descr TYPE REF TO cl_abap_elemdescr, l_strvalue TYPE c LENGTH 80, lo_descr TYPE REF TO cl_abap_datadescr. DATA(lo_line_type) = io_type->get_table_line_type( ). DATA l_sep0 TYPE string. DATA l_sep1 TYPE string. FIELD-SYMBOLS <l_value> TYPE any. FIELD-SYMBOLS <fs_row> TYPE any. lo_struct_type ?= lo_line_type. CHECK lo_struct_type IS BOUND. DATA(lt_comps) = lo_struct_type->get_components( ). DATA ls_comp TYPE abap_componentdescr. APPEND |\{| TO gt_parts. generate_meta_header( io_struct_type = lo_struct_type it_comps = lt_comps ). APPEND |,\n d: [| TO gt_parts. l_sep0 = ''. LOOP AT i_table ASSIGNING <fs_row>. APPEND l_sep0 TO gt_parts. l_sep0 = |,\n |. l_sep1 = ''. APPEND '{' TO gt_parts. LOOP AT lt_comps INTO ls_comp WHERE name IS NOT INITIAL. APPEND l_sep1 TO gt_parts. l_sep1 = |,\n |. ASSIGN COMPONENT ls_comp-name OF STRUCTURE <fs_row> TO <l_value>. WRITE <l_value> TO l_strvalue. IF strlen( l_strvalue ) > 70. APPEND |{ ls_comp-name }:'{ escape( val = CONV string( <l_value> ) format = cl_abap_format=>e_html_js ) }'| TO gt_parts. ELSE. APPEND |{ ls_comp-name }:'{ escape( val = conv string( l_strvalue ) format = cl_abap_format=>e_html_js ) }'| TO gt_parts. ENDIF. ENDLOOP. APPEND '}' TO gt_parts. ENDLOOP. APPEND ']}' TO gt_parts. ENDMETHOD. ENDCLASS.
31.149648
142
0.603289
c7d6028b8745ffedd56c3838f5991a3ee99fd407
50
abap
ABAP
src/zbranchtest.prog.abap
pokrakam/abapGitTestBranch
f710f2e9d03cc2bfdfa8191e0a7de7f4136d0281
[ "MIT" ]
null
null
null
src/zbranchtest.prog.abap
pokrakam/abapGitTestBranch
f710f2e9d03cc2bfdfa8191e0a7de7f4136d0281
[ "MIT" ]
null
null
null
src/zbranchtest.prog.abap
pokrakam/abapGitTestBranch
f710f2e9d03cc2bfdfa8191e0a7de7f4136d0281
[ "MIT" ]
null
null
null
REPORT zbranchtest. write / 'I am branch master'.
16.666667
29
0.74
c7dfa50d7b02c157eb94d434418c270a5f4eb4f7
950
abap
ABAP
src/zcl_abaplint_exit.clas.abap
sbcgua/abaplint-sci-client
9f269f4b3d12a7fd3f090bf615ffd2d9e1c371ff
[ "MIT" ]
16
2020-09-04T14:21:30.000Z
2022-02-16T11:28:18.000Z
src/zcl_abaplint_exit.clas.abap
sbcgua/abaplint-sci-client
9f269f4b3d12a7fd3f090bf615ffd2d9e1c371ff
[ "MIT" ]
149
2020-07-11T06:21:27.000Z
2022-02-19T06:49:00.000Z
src/zcl_abaplint_exit.clas.abap
sbcgua/abaplint-sci-client
9f269f4b3d12a7fd3f090bf615ffd2d9e1c371ff
[ "MIT" ]
15
2020-07-16T21:39:09.000Z
2022-01-01T18:46:10.000Z
CLASS zcl_abaplint_exit DEFINITION PUBLIC CREATE PUBLIC. PUBLIC SECTION. INTERFACES zif_abaplint_exit . CLASS-METHODS get_instance RETURNING VALUE(ri_exit) TYPE REF TO zif_abaplint_exit . PROTECTED SECTION. PRIVATE SECTION. CLASS-DATA gi_exit TYPE REF TO zif_abaplint_exit . ENDCLASS. CLASS ZCL_ABAPLINT_EXIT IMPLEMENTATION. METHOD get_instance. IF gi_exit IS INITIAL. TRY. CREATE OBJECT gi_exit TYPE ('ZCL_ABAPLINT_USER_EXIT'). CATCH cx_sy_create_object_error ##NO_HANDLER. ENDTRY. ENDIF. CREATE OBJECT ri_exit TYPE zcl_abaplint_exit. ENDMETHOD. METHOD zif_abaplint_exit~handle_special_abaps. TRY. gi_exit->handle_special_abaps( EXPORTING iv_program_name = iv_program_name CHANGING cs_files_item = cs_files_item ). CATCH cx_sy_ref_is_initial cx_sy_dyn_call_illegal_method ##NO_HANDLER. ENDTRY. ENDMETHOD. ENDCLASS.
20.212766
82
0.730526
c7eaf74e2e88ac85b140123a42a385f219fa0472
9,534
abap
ABAP
src/objects/zcl_abapgit_object_view.clas.abap
PeregrinTooc/abapGit
8e6fe2c785dd03faed5554d8255a4c4fa8358b2a
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_view.clas.abap
PeregrinTooc/abapGit
8e6fe2c785dd03faed5554d8255a4c4fa8358b2a
[ "MIT" ]
null
null
null
src/objects/zcl_abapgit_object_view.clas.abap
PeregrinTooc/abapGit
8e6fe2c785dd03faed5554d8255a4c4fa8358b2a
[ "MIT" ]
null
null
null
CLASS zcl_abapgit_object_view DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL. PUBLIC SECTION. INTERFACES zif_abapgit_object. ALIASES mo_files FOR zif_abapgit_object~mo_files. PROTECTED SECTION. PRIVATE SECTION. TYPES: ty_dd26v TYPE STANDARD TABLE OF dd26v WITH NON-UNIQUE DEFAULT KEY, ty_dd27p TYPE STANDARD TABLE OF dd27p WITH NON-UNIQUE DEFAULT KEY, ty_dd28j TYPE STANDARD TABLE OF dd28j WITH NON-UNIQUE DEFAULT KEY, ty_dd28v TYPE STANDARD TABLE OF dd28v WITH NON-UNIQUE DEFAULT KEY. CONSTANTS: BEGIN OF co_viewclass, help TYPE viewclass VALUE 'H', database TYPE viewclass VALUE 'D', projection TYPE viewclass VALUE 'P', structure TYPE viewclass VALUE 'S', maintenance TYPE viewclass VALUE 'C', entity TYPE viewclass VALUE 'E', view_variant TYPE viewclass VALUE 'V', append TYPE viewclass VALUE 'A', external TYPE viewclass VALUE 'X', replication TYPE viewclass VALUE 'R', END OF co_viewclass. METHODS: read_view EXPORTING es_dd25v TYPE dd25v es_dd09l TYPE dd09l et_dd26v TYPE ty_dd26v et_dd27p TYPE ty_dd27p et_dd28j TYPE ty_dd28j et_dd28v TYPE ty_dd28v RAISING zcx_abapgit_exception. ENDCLASS. CLASS zcl_abapgit_object_view IMPLEMENTATION. METHOD read_view. DATA: lv_name TYPE ddobjname. lv_name = ms_item-obj_name. CALL FUNCTION 'DDIF_VIEW_GET' EXPORTING name = lv_name state = 'A' langu = mv_language IMPORTING dd25v_wa = es_dd25v dd09l_wa = es_dd09l TABLES dd26v_tab = et_dd26v dd27p_tab = et_dd27p dd28j_tab = et_dd28j dd28v_tab = et_dd28v EXCEPTIONS illegal_input = 1 OTHERS = 2. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. ENDMETHOD. METHOD zif_abapgit_object~changed_by. SELECT SINGLE as4user FROM dd25l INTO rv_user WHERE viewname = ms_item-obj_name AND as4local = 'A' AND as4vers = '0000'. IF sy-subrc <> 0. rv_user = c_user_unknown. ENDIF. ENDMETHOD. METHOD zif_abapgit_object~delete. IF zif_abapgit_object~exists( ) = abap_false. RETURN. ENDIF. delete_ddic( 'V' ). ENDMETHOD. METHOD zif_abapgit_object~deserialize. DATA: lv_name TYPE ddobjname, ls_dd25v TYPE dd25v, ls_dd09l TYPE dd09l, lt_dd26v TYPE TABLE OF dd26v, lt_dd27p TYPE TABLE OF dd27p, lt_dd28j TYPE TABLE OF dd28j, lt_dd28v TYPE TABLE OF dd28v. FIELD-SYMBOLS: <ls_dd27p> LIKE LINE OF lt_dd27p, <ls_dd28j> LIKE LINE OF lt_dd28j. io_xml->read( EXPORTING iv_name = 'DD25V' CHANGING cg_data = ls_dd25v ). io_xml->read( EXPORTING iv_name = 'DD09L' CHANGING cg_data = ls_dd09l ). io_xml->read( EXPORTING iv_name = 'DD26V_TABLE' CHANGING cg_data = lt_dd26v ). io_xml->read( EXPORTING iv_name = 'DD27P_TABLE' CHANGING cg_data = lt_dd27p ). io_xml->read( EXPORTING iv_name = 'DD28J_TABLE' CHANGING cg_data = lt_dd28j ). io_xml->read( EXPORTING iv_name = 'DD28V_TABLE' CHANGING cg_data = lt_dd28v ). " Process maintenance views during LATE to avoid issues with missing foreign key relationships (#4306) IF iv_step = zif_abapgit_object=>gc_step_id-ddic AND ls_dd25v-viewclass = 'C'. RETURN. ELSEIF iv_step = zif_abapgit_object=>gc_step_id-late AND ls_dd25v-viewclass <> 'C'. RETURN. ENDIF. lv_name = ms_item-obj_name. " type conversion LOOP AT lt_dd27p ASSIGNING <ls_dd27p>. <ls_dd27p>-objpos = sy-tabix. <ls_dd27p>-viewname = lv_name. * rollname seems to be mandatory in the API, but is typically not defined in the VIEW SELECT SINGLE rollname FROM dd03l INTO <ls_dd27p>-rollname WHERE tabname = <ls_dd27p>-tabname AND fieldname = <ls_dd27p>-fieldname. IF <ls_dd27p>-rollnamevi IS INITIAL. <ls_dd27p>-rollnamevi = <ls_dd27p>-rollname. ENDIF. ENDLOOP. corr_insert( iv_package = iv_package ig_object_class = 'DICT' ). CALL FUNCTION 'DDIF_VIEW_PUT' EXPORTING name = lv_name dd25v_wa = ls_dd25v dd09l_wa = ls_dd09l TABLES dd26v_tab = lt_dd26v dd27p_tab = lt_dd27p dd28j_tab = lt_dd28j dd28v_tab = lt_dd28v EXCEPTIONS view_not_found = 1 name_inconsistent = 2 view_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 ). ENDMETHOD. METHOD zif_abapgit_object~exists. DATA: lv_viewname TYPE dd25l-viewname, lv_ddl_view TYPE abap_bool. SELECT SINGLE viewname FROM dd25l INTO lv_viewname WHERE viewname = ms_item-obj_name. rv_bool = boolc( sy-subrc = 0 ). IF rv_bool = abap_true. TRY. CALL METHOD ('CL_DD_DDL_UTILITIES')=>('CHECK_FOR_DDL_VIEW') EXPORTING objname = lv_viewname RECEIVING is_ddl_view = lv_ddl_view. IF lv_ddl_view = abap_true. rv_bool = abap_false. ENDIF. CATCH cx_root ##NO_HANDLER. ENDTRY. ENDIF. 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. 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 = abap_false. ENDMETHOD. METHOD zif_abapgit_object~jump. DATA: ls_dd25v TYPE dd25v. read_view( IMPORTING es_dd25v = ls_dd25v ). CASE ls_dd25v-viewclass. WHEN co_viewclass-view_variant. CALL FUNCTION 'RS_TOOL_ACCESS' EXPORTING operation = 'SHOW' object_name = ms_item-obj_name object_type = ms_item-obj_type in_new_window = abap_true EXCEPTIONS not_executed = 1 invalid_object_type = 2 OTHERS = 3. IF sy-subrc <> 0. zcx_abapgit_exception=>raise_t100( ). ENDIF. WHEN OTHERS. jump_se11( iv_radio = 'RSRD1-VIMA' iv_field = 'RSRD1-VIMA_VAL' ). ENDCASE. ENDMETHOD. METHOD zif_abapgit_object~serialize. DATA: ls_dd25v TYPE dd25v, ls_dd09l TYPE dd09l, lt_dd26v TYPE ty_dd26v, lt_dd27p TYPE ty_dd27p, lt_dd28j TYPE ty_dd28j, lt_dd28v TYPE ty_dd28v. FIELD-SYMBOLS: <ls_dd27p> LIKE LINE OF lt_dd27p. read_view( IMPORTING es_dd25v = ls_dd25v es_dd09l = ls_dd09l et_dd26v = lt_dd26v et_dd27p = lt_dd27p et_dd28j = lt_dd28j et_dd28v = lt_dd28v ). IF ls_dd25v IS INITIAL. RETURN. " does not exist in system ENDIF. CLEAR: ls_dd25v-as4user, ls_dd25v-as4date, ls_dd25v-as4time. CLEAR: ls_dd09l-as4user, ls_dd09l-as4date, ls_dd09l-as4time. LOOP AT lt_dd27p ASSIGNING <ls_dd27p>. CLEAR: <ls_dd27p>-ddtext, <ls_dd27p>-reptext, <ls_dd27p>-scrtext_s, <ls_dd27p>-scrtext_m, <ls_dd27p>-scrtext_l, <ls_dd27p>-outputlen, <ls_dd27p>-decimals, <ls_dd27p>-lowercase, <ls_dd27p>-convexit, <ls_dd27p>-signflag, <ls_dd27p>-flength, <ls_dd27p>-domname, <ls_dd27p>-datatype, <ls_dd27p>-entitytab, <ls_dd27p>-inttype, <ls_dd27p>-intlen, <ls_dd27p>-headlen, <ls_dd27p>-scrlen1, <ls_dd27p>-scrlen2, <ls_dd27p>-scrlen3, <ls_dd27p>-memoryid. IF <ls_dd27p>-rollchange = abap_false. CLEAR <ls_dd27p>-rollnamevi. ENDIF. CLEAR <ls_dd27p>-ddlanguage. CLEAR <ls_dd27p>-rollname. CLEAR <ls_dd27p>-viewname. CLEAR <ls_dd27p>-objpos. ENDLOOP. io_xml->add( iv_name = 'DD25V' ig_data = ls_dd25v ). io_xml->add( iv_name = 'DD09L' ig_data = ls_dd09l ). io_xml->add( ig_data = lt_dd26v iv_name = 'DD26V_TABLE' ). io_xml->add( ig_data = lt_dd27p iv_name = 'DD27P_TABLE' ). io_xml->add( ig_data = lt_dd28j iv_name = 'DD28J_TABLE' ). io_xml->add( ig_data = lt_dd28v iv_name = 'DD28V_TABLE' ). ENDMETHOD. ENDCLASS.
27.715116
106
0.587581
c7f0053ae146b8a16d680f977eebfe95bf918353
3,938
abap
ABAP
src/checks/zcl_aoc_check_12.clas.testclasses.abap
phaniacumen/SAPPROJ
dc4bf7a03d9ab2f4ac30bb77f6f38e6a55e5fcc4
[ "MIT" ]
1
2018-04-22T04:47:28.000Z
2018-04-22T04:47:28.000Z
src/checks/zcl_aoc_check_12.clas.testclasses.abap
phaniacumen/SAPPROJ
dc4bf7a03d9ab2f4ac30bb77f6f38e6a55e5fcc4
[ "MIT" ]
null
null
null
src/checks/zcl_aoc_check_12.clas.testclasses.abap
phaniacumen/SAPPROJ
dc4bf7a03d9ab2f4ac30bb77f6f38e6a55e5fcc4
[ "MIT" ]
null
null
null
*----------------------------------------------------------------------* * CLASS lcl_Test DEFINITION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* CLASS ltcl_test DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL. PRIVATE SECTION. * ================ DATA: mt_code TYPE string_table, ms_result TYPE scirest_ad, mo_check TYPE REF TO zcl_aoc_check_12. METHODS: setup, export_import FOR TESTING, test001_01 FOR TESTING, test001_02 FOR TESTING, test001_03 FOR TESTING, test001_04 FOR TESTING, test001_05 FOR TESTING, test001_06 FOR TESTING, test001_07 FOR TESTING, test001_08 FOR TESTING, test001_09 FOR TESTING. ENDCLASS. "lcl_Test *----------------------------------------------------------------------* * CLASS lcl_Test IMPLEMENTATION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* CLASS ltcl_test IMPLEMENTATION. * ============================== DEFINE _code. APPEND &1 TO mt_code. END-OF-DEFINITION. METHOD setup. CREATE OBJECT mo_check. zcl_aoc_unit_test=>set_check( mo_check ). ENDMETHOD. "setup METHOD export_import. zcl_aoc_unit_test=>export_import( mo_check ). ENDMETHOD. METHOD test001_01. * =========== _code 'SORT lt_foo BY bname.'. ms_result = zcl_aoc_unit_test=>check( mt_code ). cl_abap_unit_assert=>assert_equals( exp = '001' act = ms_result-code ). ENDMETHOD. "test1 METHOD test001_02. * =========== _code 'SORT lt_foo BY bname ASCENDING.'. ms_result = zcl_aoc_unit_test=>check( mt_code ). cl_abap_unit_assert=>assert_initial( ms_result ). ENDMETHOD. "test2 METHOD test001_03. * =========== _code 'SORT lt_foo STABLE BY bname ASCENDING.'. ms_result = zcl_aoc_unit_test=>check( mt_code ). cl_abap_unit_assert=>assert_initial( ms_result ). ENDMETHOD. "test001_03 METHOD test001_04. * =========== _code 'SORT lt_foo STABLE BY bname.'. ms_result = zcl_aoc_unit_test=>check( mt_code ). cl_abap_unit_assert=>assert_equals( exp = '001' act = ms_result-code ). ENDMETHOD. "test001_04 METHOD test001_05. * =========== _code 'SORT lt_foo BY bname AS TEXT ASCENDING accnt AS TEXT.'. ms_result = zcl_aoc_unit_test=>check( mt_code ). cl_abap_unit_assert=>assert_equals( exp = '001' act = ms_result-code ). ENDMETHOD. "test001_05 METHOD test001_06. * =========== _code 'SORT lt_bar BY field AS TEXT ASCENDING.'. ms_result = zcl_aoc_unit_test=>check( mt_code ). cl_abap_unit_assert=>assert_initial( ms_result ). ENDMETHOD. "test001_06 METHOD test001_07. * =========== _code 'SORT lt_foo BY bname last.'. ms_result = zcl_aoc_unit_test=>check( mt_code ). cl_abap_unit_assert=>assert_equals( exp = '001' act = ms_result-code ). ENDMETHOD. "test001_07 METHOD test001_08. * =========== _code 'SORT lt_foo BY (lt_tab).'. ms_result = zcl_aoc_unit_test=>check( mt_code ). cl_abap_unit_assert=>assert_initial( ms_result ). ENDMETHOD. "test001_08 METHOD test001_09. * =========== _code 'SORT lt_tab ASCENDING BY priority.'. ms_result = zcl_aoc_unit_test=>check( mt_code ). cl_abap_unit_assert=>assert_equals( exp = '001' act = ms_result-code ). ENDMETHOD. "test001_09 ENDCLASS. "lcl_Test
24.767296
72
0.520315
c7f0e2eb4f6a6215e1b2dffdea58fbf7ea98458e
6,230
abap
ABAP
src/zcl_excel_font.clas.abap
chrisaasan/abap2xlsx
cb315c557225928baacbbcfd42087c3a8ed34a12
[ "Apache-2.0" ]
251
2019-02-23T03:36:38.000Z
2021-12-10T21:39:23.000Z
src/zcl_excel_font.clas.abap
chrisaasan/abap2xlsx
cb315c557225928baacbbcfd42087c3a8ed34a12
[ "Apache-2.0" ]
278
2019-02-17T10:42:59.000Z
2021-12-10T20:24:56.000Z
src/zcl_excel_font.clas.abap
chrisaasan/abap2xlsx
cb315c557225928baacbbcfd42087c3a8ed34a12
[ "Apache-2.0" ]
130
2019-02-20T13:25:30.000Z
2021-12-09T03:20:31.000Z
CLASS zcl_excel_font DEFINITION PUBLIC FINAL CREATE PUBLIC . PUBLIC SECTION. TYPES: BEGIN OF mty_s_font_metric, char TYPE c LENGTH 1, char_width TYPE tdcwidths, END OF mty_s_font_metric . TYPES: mty_th_font_metrics TYPE HASHED TABLE OF mty_s_font_metric WITH UNIQUE KEY char . TYPES: BEGIN OF mty_s_font_cache, font_name TYPE zexcel_style_font_name, font_height TYPE tdfontsize, flag_bold TYPE abap_bool, flag_italic TYPE abap_bool, th_font_metrics TYPE mty_th_font_metrics, END OF mty_s_font_cache . TYPES: mty_th_font_cache TYPE HASHED TABLE OF mty_s_font_cache WITH UNIQUE KEY font_name font_height flag_bold flag_italic . CONSTANTS lc_default_font_height TYPE tdfontsize VALUE '110' ##NO_TEXT. CONSTANTS lc_default_font_name TYPE zexcel_style_font_name VALUE 'Calibri' ##NO_TEXT. CLASS-DATA mth_font_cache TYPE mty_th_font_cache . CLASS-METHODS calculate_text_width IMPORTING !iv_font_name TYPE zexcel_style_font_name !iv_font_height TYPE tdfontsize !iv_flag_bold TYPE abap_bool !iv_flag_italic TYPE abap_bool !iv_cell_value TYPE zexcel_cell_value RETURNING VALUE(rv_width) TYPE float . PROTECTED SECTION. PRIVATE SECTION. ENDCLASS. CLASS zcl_excel_font IMPLEMENTATION. METHOD calculate_text_width. CONSTANTS lc_excel_cell_padding TYPE float VALUE '0.75'. DATA: ld_current_character TYPE c LENGTH 1, lt_itcfc TYPE STANDARD TABLE OF itcfc, ld_offset TYPE i, ld_length TYPE i, ld_uccp TYPE i, ls_font_metric TYPE mty_s_font_metric, ld_width_from_font_metrics TYPE i, ld_font_family TYPE itcfh-tdfamily, lt_font_families LIKE STANDARD TABLE OF ld_font_family, ls_font_cache TYPE mty_s_font_cache. FIELD-SYMBOLS: <ls_font_cache> TYPE mty_s_font_cache, <ls_font_metric> TYPE mty_s_font_metric, <ls_itcfc> TYPE itcfc. " Check if the same font (font name and font attributes) was already " used before READ TABLE mth_font_cache WITH TABLE KEY font_name = iv_font_name font_height = iv_font_height flag_bold = iv_flag_bold flag_italic = iv_flag_italic ASSIGNING <ls_font_cache>. IF sy-subrc <> 0. " Font is used for the first time " Add the font to our local font cache ls_font_cache-font_name = iv_font_name. ls_font_cache-font_height = iv_font_height. ls_font_cache-flag_bold = iv_flag_bold. ls_font_cache-flag_italic = iv_flag_italic. INSERT ls_font_cache INTO TABLE mth_font_cache ASSIGNING <ls_font_cache>. " Determine the SAPscript font family name from the Excel " font name SELECT tdfamily FROM tfo01 INTO TABLE lt_font_families UP TO 1 ROWS WHERE tdtext = iv_font_name ORDER BY PRIMARY KEY. " Check if a matching font family was found " Fonts can be uploaded from TTF files using transaction SE73 IF lines( lt_font_families ) > 0. READ TABLE lt_font_families INDEX 1 INTO ld_font_family. " Load font metrics (returns a table with the size of each letter " in the font) CALL FUNCTION 'LOAD_FONT' EXPORTING family = ld_font_family height = iv_font_height printer = 'SWIN' bold = iv_flag_bold italic = iv_flag_italic TABLES metric = lt_itcfc EXCEPTIONS font_family = 1 codepage = 2 device_type = 3 OTHERS = 4. IF sy-subrc <> 0. CLEAR lt_itcfc. ENDIF. " For faster access, convert each character number to the actual " character, and store the characters and their sizes in a hash " table LOOP AT lt_itcfc ASSIGNING <ls_itcfc>. ld_uccp = <ls_itcfc>-cpcharno. ls_font_metric-char = cl_abap_conv_in_ce=>uccpi( ld_uccp ). ls_font_metric-char_width = <ls_itcfc>-tdcwidths. INSERT ls_font_metric INTO TABLE <ls_font_cache>-th_font_metrics. ENDLOOP. ENDIF. ENDIF. " Calculate the cell width " If available, use font metrics IF lines( <ls_font_cache>-th_font_metrics ) = 0. " Font metrics are not available " -> Calculate the cell width using only the font size ld_length = strlen( iv_cell_value ). rv_width = ld_length * iv_font_height / lc_default_font_height + lc_excel_cell_padding. ELSE. " Font metrics are available " Calculate the size of the text by adding the sizes of each " letter ld_length = strlen( iv_cell_value ). DO ld_length TIMES. " Subtract 1, because the first character is at offset 0 ld_offset = sy-index - 1. " Read the current character from the cell value ld_current_character = iv_cell_value+ld_offset(1). " Look up the size of the current letter READ TABLE <ls_font_cache>-th_font_metrics WITH TABLE KEY char = ld_current_character ASSIGNING <ls_font_metric>. IF sy-subrc = 0. " The size of the letter is known " -> Add the actual size of the letter ADD <ls_font_metric>-char_width TO ld_width_from_font_metrics. ELSE. " The size of the letter is unknown " -> Add the font height as the default letter size ADD iv_font_height TO ld_width_from_font_metrics. ENDIF. ENDDO. " Add cell padding (Excel makes columns a bit wider than the space " that is needed for the text itself) and convert unit " (division by 100) rv_width = ld_width_from_font_metrics / 100 + lc_excel_cell_padding. ENDIF. ENDMETHOD. ENDCLASS.
33.858696
93
0.630177
c7fa4e2ac954359dc72796e932fc18668617c499
1,271
abap
ABAP
src/zfugr3.fugr.saplzfugr3.abap
larshp/FUGR3
5cd9120bc6ac3be03b5575109b49f22da09bb5bf
[ "MIT" ]
null
null
null
src/zfugr3.fugr.saplzfugr3.abap
larshp/FUGR3
5cd9120bc6ac3be03b5575109b49f22da09bb5bf
[ "MIT" ]
null
null
null
src/zfugr3.fugr.saplzfugr3.abap
larshp/FUGR3
5cd9120bc6ac3be03b5575109b49f22da09bb5bf
[ "MIT" ]
null
null
null
* regenerated at 22.07.2020 06:08:15 ******************************************************************* * System-defined Include-files. * ******************************************************************* INCLUDE LZFUGR3TOP. " Global Declarations INCLUDE LZFUGR3UXX. " Function Modules ******************************************************************* * User-defined Include-files (if necessary). * ******************************************************************* * INCLUDE LZFUGR3F... " Subroutines * INCLUDE LZFUGR3O... " PBO-Modules * INCLUDE LZFUGR3I... " PAI-Modules * INCLUDE LZFUGR3E... " Events * INCLUDE LZFUGR3P... " Local class implement. * INCLUDE LZFUGR3T99. " ABAP Unit tests INCLUDE LZFUGR3F00 . " subprograms INCLUDE LZFUGR3I00 . " PAI modules INCLUDE LSVIMFXX . " subprograms INCLUDE LSVIMOXX . " PBO modules INCLUDE LSVIMIXX . " PAI modules
57.772727
69
0.350118
c7fc4e7cde96302b3f859fef7f6a424173536e0f
413
abap
ABAP
src/zcl_app_html_form.clas.abap
dreitagebart/abap-app-framework
376cf5156cb947c2fac947fc8779d2da0e1199c4
[ "MIT" ]
null
null
null
src/zcl_app_html_form.clas.abap
dreitagebart/abap-app-framework
376cf5156cb947c2fac947fc8779d2da0e1199c4
[ "MIT" ]
null
null
null
src/zcl_app_html_form.clas.abap
dreitagebart/abap-app-framework
376cf5156cb947c2fac947fc8779d2da0e1199c4
[ "MIT" ]
null
null
null
CLASS zcl_app_html_form DEFINITION PUBLIC INHERITING FROM zca_app_html FINAL CREATE PUBLIC. PUBLIC SECTION. METHODS: constructor. PROTECTED SECTION. METHODS: parse REDEFINITION. PRIVATE SECTION. ENDCLASS. CLASS zcl_app_html_form IMPLEMENTATION. METHOD constructor. super->constructor( zif_app_html=>tags-form ). ENDMETHOD. METHOD parse. ENDMETHOD. ENDCLASS.
13.766667
50
0.726392