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
sequencelengths 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
sequencelengths 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
sequencelengths 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
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f702dd98900e80f27b0ff4729f38a8f72faf6284 | 300 | abap | ABAP | zis_example.prog.abap | sbcgua/abap_include_assembler | 5660773df238668bf654ec322dc46fe8c0757dbb | [
"MIT"
] | 3 | 2016-03-20T09:52:55.000Z | 2020-05-18T23:30:45.000Z | zis_example.prog.abap | sbcgua/abap_include_assembler | 5660773df238668bf654ec322dc46fe8c0757dbb | [
"MIT"
] | 6 | 2016-03-20T10:14:01.000Z | 2020-08-27T16:48:13.000Z | zis_example.prog.abap | sbcgua/abap_include_assembler | 5660773df238668bf654ec322dc46fe8c0757dbb | [
"MIT"
] | 1 | 2020-08-27T14:14:59.000Z | 2020-08-27T14:14:59.000Z | *&---------------------------------------------------------------------*
*& Report ZIS_EXAMPLE
*&---------------------------------------------------------------------*
report zis_example.
include zis_example_top.
include zis_example_f01.
start-of-selection.
include = 'X'.
perform perform_write.
| 23.076923 | 72 | 0.406667 |
f7059ca25a13836de140134550b96c66d4d503dc | 2,640 | abap | ABAP | sap-data-retrieval/src/test/resources/sap/ZCAFM_CUSTOMER_DELETE.abap | mulesoft-consulting/anypoint-examples | 20f17b2f162c7a81787aafddd54b0ba196edd8d7 | [
"Apache-2.0"
] | 1 | 2019-03-08T16:08:23.000Z | 2019-03-08T16:08:23.000Z | sap-data-retrieval/src/test/resources/sap/ZCAFM_CUSTOMER_DELETE.abap | mulesoft-consulting/anypoint-examples | 20f17b2f162c7a81787aafddd54b0ba196edd8d7 | [
"Apache-2.0"
] | null | null | null | sap-data-retrieval/src/test/resources/sap/ZCAFM_CUSTOMER_DELETE.abap | mulesoft-consulting/anypoint-examples | 20f17b2f162c7a81787aafddd54b0ba196edd8d7 | [
"Apache-2.0"
] | 1 | 2019-03-08T16:08:28.000Z | 2019-03-08T16:08:28.000Z | FUNCTION zcafm_customer_delete.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(PI_CUSTOMER) TYPE KNA1-KUNNR
*" VALUE(PI_TEST) TYPE CHAR1
*" EXPORTING
*" VALUE(SE_RETURN) TYPE BAPIRET2
*"----------------------------------------------------------------------
*----------------------------------------------------------------------*
* Function Module ZCAFM_CUSTOMER_DELETE *
* *----------------------------------------------------------------------*
* * *
* * ID-Reference: MuleSoft templates *
* * *
* * This BAPI aims to set deletion flag for particular customer. If par. *
* * PI_TEST is provided no change is performed. *
* *----------------------------------------------------------------------*
* * Change Log: *
* * *
* * Who Date Text *
* * MMARUSKIN 03.07.2014 Init creation. *
* *----------------------------------------------------------------------*
* Global data declarations
CONSTANTS: lc_obj_task TYPE cmd_ei_object_task VALUE 'M', "M=Create/Change
lc_msg_cls TYPE sy-msgid VALUE 'ZMULESOFTINTEGRATION'.
DATA: ls_customer TYPE cmds_ei_extern,
lt_customers TYPE cmds_ei_main,
ls_mes_error TYPE cvis_message,
lv_par TYPE sy-msgv1.
*- Prepare data
ls_customer-header-object_instance-kunnr = pi_customer.
ls_customer-header-object_task = lc_obj_task.
ls_customer-central_data-central-data-loevm = 'X'.
ls_customer-central_data-central-datax-loevm = 'X'.
APPEND ls_customer TO lt_customers-customers.
lv_par = pi_customer.
*- Run change of material via standard functionality
CALL METHOD cmd_ei_api=>maintain_bapi
EXPORTING
iv_test_run = pi_test
iv_collect_messages = 'X'
is_master_data = lt_customers
IMPORTING
es_message_defective = ls_mes_error.
*- Error handling
IF ls_mes_error-is_error IS INITIAL AND pi_test IS INITIAL.
COMMIT WORK AND WAIT.
CALL FUNCTION 'BALW_BAPIRETURN_GET2' "okay: flag set!
EXPORTING
type = 'I'
cl = lc_msg_cls
number = 100
par1 = lv_par
parameter = ''
field = ''
IMPORTING
return = se_return.
ELSE.
ROLLBACK WORK. "#EC CI_ROLLBACK
CALL FUNCTION 'BALW_BAPIRETURN_GET2' "problem: flag NOT set!
EXPORTING
type = 'E'
cl = lc_msg_cls
number = 101
par1 = lv_par
parameter = ''
field = ''
IMPORTING
return = se_return.
ENDIF.
ENDFUNCTION. | 29.333333 | 76 | 0.524242 |
f706c5d249ab3a4ce3d3753967774b9920a31554 | 7,390 | abap | ABAP | src/fcat/zdemo_ain_cl25.prog.abap | fidley/ALVGridInNutschell | d3c95d7f31afbff001fff50edae0c2e09e51fe90 | [
"Apache-2.0"
] | 5 | 2019-07-08T11:40:25.000Z | 2021-10-02T12:26:06.000Z | src/fcat/zdemo_ain_cl25.prog.abap | fidley/ALVGridInNutschell | d3c95d7f31afbff001fff50edae0c2e09e51fe90 | [
"Apache-2.0"
] | null | null | null | src/fcat/zdemo_ain_cl25.prog.abap | fidley/ALVGridInNutschell | d3c95d7f31afbff001fff50edae0c2e09e51fe90 | [
"Apache-2.0"
] | 4 | 2020-03-21T12:44:33.000Z | 2021-09-27T08:43:38.000Z | *&---------------------------------------------------------------------*
*& Report zdemo_ain_cl25
*&---------------------------------------------------------------------*
*& This is the demo program written for book:
*& ALV grid in nutshell by Łukasz Pęgiel
*&---------------------------------------------------------------------*
*&- 1st character ='C' if we're using custom colour or 'X' for default *
*&- 2nd character = colour code (from 0 to 7) *
*& 0 = background colour *
*& 1 = blue *
*& 2 = gray *
*& 3 = yellow *
*& 4 = blue/gray *
*& 5 = green *
*& 6 = red *
*& 7 = orange *
*&- 3rd character = intensified (0=off, 1=on) *
*&- 4th character = inverse display (0=off, 1=on) *
*&---------------------------------------------------------------------*
report zdemo_ain_cl25.
include zdemo_ain_include_screen.
start-of-selection.
types: begin of t_data,
no_emphasize type spfli-carrid,
standard type spfli-carrid,
c100 type spfli-carrid,
c101 type spfli-carrid,
c110 type spfli-carrid,
c111 type spfli-carrid,
c200 type spfli-carrid,
c201 type spfli-carrid,
c210 type spfli-carrid,
c211 type spfli-carrid,
c300 type spfli-carrid,
c301 type spfli-carrid,
c310 type spfli-carrid,
c311 type spfli-carrid,
c400 type spfli-carrid,
c401 type spfli-carrid,
c410 type spfli-carrid,
c411 type spfli-carrid,
c500 type spfli-carrid,
c501 type spfli-carrid,
c510 type spfli-carrid,
c511 type spfli-carrid,
c600 type spfli-carrid,
c601 type spfli-carrid,
c610 type spfli-carrid,
c611 type spfli-carrid,
c700 type spfli-carrid,
c701 type spfli-carrid,
c710 type spfli-carrid,
c711 type spfli-carrid,
c000 type spfli-carrid,
c001 type spfli-carrid,
c010 type spfli-carrid,
c011 type spfli-carrid,
end of t_data.
data flights type standard table of t_data.
select carrid as no_emphasize
up to 50 rows from spfli
into corresponding fields of table @flights.
loop at flights assigning field-symbol(<fl>).
<fl>-standard = <fl>-c100 = <fl>-c101 = <fl>-c110 = <fl>-c111 =
<fl>-c200 = <fl>-c201 = <fl>-c210 = <fl>-c211 =
<fl>-c300 = <fl>-c301 = <fl>-c310 = <fl>-c311 =
<fl>-c400 = <fl>-c401 = <fl>-c410 = <fl>-c411 =
<fl>-c500 = <fl>-c501 = <fl>-c510 = <fl>-c511 =
<fl>-c600 = <fl>-c601 = <fl>-c610 = <fl>-c611 =
<fl>-c700 = <fl>-c701 = <fl>-c710 = <fl>-c711 =
<fl>-c000 = <fl>-c001 = <fl>-c010 = <fl>-c011 = <fl>-no_emphasize.
endloop.
data(grid) = new cl_gui_alv_grid(
i_parent = new cl_gui_custom_container( container_name = 'CC' )
).
data(fcat) = value lvc_t_fcat(
( fieldname = 'NO_EMPHASIZE' reptext = 'NO_EMPHASIZE' )
( fieldname = 'STANDARD' emphasize = abap_true reptext = 'STANDARD' )
( fieldname = 'C100' emphasize = 'C100' reptext = 'C100')
( fieldname = 'C101' emphasize = 'C101' reptext = 'C101')
( fieldname = 'C110' emphasize = 'C110' reptext = 'C110')
( fieldname = 'C111' emphasize = 'C111' reptext = 'C111')
( fieldname = 'C200' emphasize = 'C200' reptext = 'C200')
( fieldname = 'C201' emphasize = 'C201' reptext = 'C201')
( fieldname = 'C210' emphasize = 'C210' reptext = 'C210')
( fieldname = 'C211' emphasize = 'C211' reptext = 'C211')
( fieldname = 'C300' emphasize = 'C300' reptext = 'C300')
( fieldname = 'C301' emphasize = 'C301' reptext = 'C301')
( fieldname = 'C310' emphasize = 'C310' reptext = 'C310')
( fieldname = 'C311' emphasize = 'C311' reptext = 'C311')
( fieldname = 'C400' emphasize = 'C400' reptext = 'C400')
( fieldname = 'C401' emphasize = 'C401' reptext = 'C401')
( fieldname = 'C410' emphasize = 'C410' reptext = 'C410')
( fieldname = 'C411' emphasize = 'C411' reptext = 'C411')
( fieldname = 'C500' emphasize = 'C500' reptext = 'C500')
( fieldname = 'C501' emphasize = 'C501' reptext = 'C501')
( fieldname = 'C510' emphasize = 'C510' reptext = 'C510')
( fieldname = 'C511' emphasize = 'C511' reptext = 'C511')
( fieldname = 'C600' emphasize = 'C600' reptext = 'C600')
( fieldname = 'C601' emphasize = 'C601' reptext = 'C601')
( fieldname = 'C610' emphasize = 'C610' reptext = 'C610')
( fieldname = 'C611' emphasize = 'C611' reptext = 'C611')
( fieldname = 'C700' emphasize = 'C700' reptext = 'C700')
( fieldname = 'C701' emphasize = 'C701' reptext = 'C701')
( fieldname = 'C710' emphasize = 'C710' reptext = 'C710')
( fieldname = 'C711' emphasize = 'C711' reptext = 'C711')
( fieldname = 'C000' emphasize = 'C000' reptext = 'C000')
( fieldname = 'C001' emphasize = 'C001' reptext = 'C001')
( fieldname = 'C010' emphasize = 'C010' reptext = 'C010')
( fieldname = 'C011' emphasize = 'C011' reptext = 'C011')
).
grid->set_table_for_first_display(
exporting
is_layout = value #( col_opt = abap_true )
changing
it_fieldcatalog = fcat
it_outtab = flights
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4
).
if sy-subrc eq 0.
call screen 0100.
endif.
| 55.149254 | 102 | 0.407307 |
f707aa256126ec981696b25d4cbe9173d6a74a1f | 3,452 | abap | ABAP | src/#mbtools#cl_ajson_filter_lib.clas.locals_imp.abap | Marc-Bernard-Tools/Mirror-AJSON | 4bc1b5b661a6e0197770da766293d9434c75e559 | [
"MIT"
] | null | null | null | src/#mbtools#cl_ajson_filter_lib.clas.locals_imp.abap | Marc-Bernard-Tools/Mirror-AJSON | 4bc1b5b661a6e0197770da766293d9434c75e559 | [
"MIT"
] | 5 | 2021-07-12T19:07:01.000Z | 2021-09-08T00:29:05.000Z | src/#mbtools#cl_ajson_filter_lib.clas.locals_imp.abap | Marc-Bernard-Tools/Mirror-AJSON | 4bc1b5b661a6e0197770da766293d9434c75e559 | [
"MIT"
] | 1 | 2022-03-21T23:27:43.000Z | 2022-03-21T23:27:43.000Z | **********************************************************************
* FILTER EMPTY VALUES
**********************************************************************
CLASS lcl_empty_filter DEFINITION FINAL.
PUBLIC SECTION.
INTERFACES /mbtools/if_ajson_filter.
ENDCLASS.
CLASS lcl_empty_filter IMPLEMENTATION.
METHOD /mbtools/if_ajson_filter~keep_node.
rv_keep = boolc(
( iv_visit = /mbtools/if_ajson_filter=>visit_type-value AND is_node-value IS NOT INITIAL ) OR
( iv_visit <> /mbtools/if_ajson_filter=>visit_type-value AND is_node-children > 0 ) ).
" children = 0 on open for initially empty nodes and on close for filtered ones
ENDMETHOD.
ENDCLASS.
**********************************************************************
* FILTER PREDEFINED PATHS
**********************************************************************
CLASS lcl_paths_filter DEFINITION FINAL.
PUBLIC SECTION.
INTERFACES /mbtools/if_ajson_filter.
METHODS constructor
IMPORTING
it_skip_paths TYPE string_table OPTIONAL
iv_skip_paths TYPE string OPTIONAL
RAISING
/mbtools/cx_ajson_error.
PRIVATE SECTION.
DATA mt_skip_paths TYPE HASHED TABLE OF string WITH UNIQUE KEY table_line.
ENDCLASS.
CLASS lcl_paths_filter IMPLEMENTATION.
METHOD /mbtools/if_ajson_filter~keep_node.
DATA lv_path TYPE string.
lv_path = is_node-path && is_node-name.
READ TABLE mt_skip_paths WITH KEY table_line = lv_path TRANSPORTING NO FIELDS.
rv_keep = boolc( sy-subrc <> 0 ).
ENDMETHOD.
METHOD constructor.
DATA lv_s TYPE string.
DATA lt_tab TYPE string_table.
FIELD-SYMBOLS <s> TYPE string.
IF boolc( iv_skip_paths IS INITIAL ) = boolc( it_skip_paths IS INITIAL ). " XOR
/mbtools/cx_ajson_error=>raise( 'no filter path specified' ).
ENDIF.
LOOP AT it_skip_paths INTO lv_s.
lv_s = to_lower( lv_s ).
APPEND lv_s TO lt_tab.
ENDLOOP.
IF iv_skip_paths IS NOT INITIAL.
SPLIT iv_skip_paths AT ',' INTO TABLE lt_tab.
LOOP AT lt_tab ASSIGNING <s>.
IF <s> IS INITIAL.
DELETE lt_tab INDEX sy-tabix.
CONTINUE.
ENDIF.
<s> = condense( to_lower( <s> ) ).
ENDLOOP.
ENDIF.
SORT lt_tab BY table_line.
DELETE ADJACENT DUPLICATES FROM lt_tab.
mt_skip_paths = lt_tab.
ENDMETHOD.
ENDCLASS.
**********************************************************************
* MULTI FILTER
**********************************************************************
CLASS lcl_and_filter DEFINITION FINAL.
PUBLIC SECTION.
INTERFACES /mbtools/if_ajson_filter.
METHODS constructor
IMPORTING
it_filters TYPE /mbtools/if_ajson_filter=>ty_filter_tab
RAISING
/mbtools/cx_ajson_error.
PRIVATE SECTION.
DATA mt_filters TYPE /mbtools/if_ajson_filter=>ty_filter_tab.
ENDCLASS.
CLASS lcl_and_filter IMPLEMENTATION.
METHOD /mbtools/if_ajson_filter~keep_node.
DATA li_filter LIKE LINE OF mt_filters.
rv_keep = abap_true.
LOOP AT mt_filters INTO li_filter.
rv_keep = li_filter->keep_node(
is_node = is_node
iv_visit = iv_visit ).
IF rv_keep = abap_false.
RETURN.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD constructor.
DATA li_filter LIKE LINE OF it_filters.
LOOP AT it_filters INTO li_filter WHERE table_line IS BOUND.
APPEND li_filter TO mt_filters.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| 26.553846 | 99 | 0.614716 |
f70ff1b7c91543804aad129c14175a625e0efafb | 130 | abap | ABAP | src/zexpimp_vx_gener_test_code.fugr.lzexpimp_vx_gener_test_codetop.abap | sandraros/export-import-vx | a818910f825f6a19105bb1f6ad3563e93a477c38 | [
"MIT"
] | 1 | 2021-07-18T19:47:43.000Z | 2021-07-18T19:47:43.000Z | src/zexpimp_vx_gener_test_code.fugr.lzexpimp_vx_gener_test_codetop.abap | sandraros/export-import-vx | a818910f825f6a19105bb1f6ad3563e93a477c38 | [
"MIT"
] | null | null | null | src/zexpimp_vx_gener_test_code.fugr.lzexpimp_vx_gener_test_codetop.abap | sandraros/export-import-vx | a818910f825f6a19105bb1f6ad3563e93a477c38 | [
"MIT"
] | null | null | null | FUNCTION-POOL ZEXPIMP_VX_GENER_TEST_CODE. "MESSAGE-ID ..
* INCLUDE LZEXPIMP_GENERATE_TEST_CODED... " Local class definition
| 32.5 | 69 | 0.784615 |
f716c8b0d82be34e9fbe78fecb464a6889c1dfc6 | 7,465 | abap | ABAP | src/objects/zcl_abapgit_object_ssst.clas.abap | sb-sap/abapGit | 8d1f1c312f5cf70b97fb6f00530be53a5e968a5b | [
"MIT"
] | null | null | null | src/objects/zcl_abapgit_object_ssst.clas.abap | sb-sap/abapGit | 8d1f1c312f5cf70b97fb6f00530be53a5e968a5b | [
"MIT"
] | null | null | null | src/objects/zcl_abapgit_object_ssst.clas.abap | sb-sap/abapGit | 8d1f1c312f5cf70b97fb6f00530be53a5e968a5b | [
"MIT"
] | null | null | null | CLASS zcl_abapgit_object_ssst DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
CONSTANTS: c_style_active TYPE tdactivate VALUE 'A'.
PRIVATE SECTION.
METHODS validate_font
IMPORTING iv_tdfamily TYPE tdfamily
RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_SSST IMPLEMENTATION.
METHOD validate_font.
DATA: lv_tdfamily TYPE tfo01-tdfamily.
SELECT SINGLE tdfamily FROM tfo01 INTO lv_tdfamily
WHERE tdfamily = iv_tdfamily.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Font family not found' ).
ENDIF.
ENDMETHOD. "validate_font
METHOD zif_abapgit_object~changed_by.
SELECT SINGLE lastuser FROM stxsadm INTO rv_user
WHERE stylename = ms_item-obj_name.
IF sy-subrc <> 0.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~compare_to_remote_version.
CREATE OBJECT ro_comparison_result TYPE zcl_abapgit_comparison_null.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_stylename TYPE tdssname.
lv_stylename = ms_item-obj_name.
CALL FUNCTION 'SSF_DELETE_STYLE'
EXPORTING
i_stylename = lv_stylename
i_with_dialog = abap_false
i_with_confirm_dialog = abap_false
EXCEPTIONS
no_name = 1
no_style = 2
style_locked = 3
cancelled = 4
no_access_permission = 5
illegal_language = 6
OTHERS = 7.
IF sy-subrc <> 0 AND sy-subrc <> 2.
zcx_abapgit_exception=>raise( 'error from SSF_DELETE_STYLE' ).
ENDIF.
ENDMETHOD. "delete
METHOD zif_abapgit_object~deserialize.
* see fm SSF_UPLOAD_STYLE
DATA: ls_header TYPE ssfcats,
ls_new_header TYPE ssfcats,
lt_paragraphs TYPE TABLE OF ssfparas,
lt_strings TYPE TABLE OF ssfstrings,
lt_tabstops TYPE TABLE OF stxstab.
FIELD-SYMBOLS: <lv_spras> TYPE spras.
io_xml->read( EXPORTING iv_name = 'HEADER'
CHANGING cg_data = ls_header ).
io_xml->read( EXPORTING iv_name = 'SSFPARAS'
CHANGING cg_data = lt_paragraphs ).
io_xml->read( EXPORTING iv_name = 'SSFSTRINGS'
CHANGING cg_data = lt_strings ).
io_xml->read( EXPORTING iv_name = 'STXSTAB'
CHANGING cg_data = lt_tabstops ).
validate_font( ls_header-tdfamily ).
CALL FUNCTION 'SSF_READ_STYLE' "Just load FG
EXPORTING
i_style_name = ls_header-stylename
i_style_active_flag = 'A'
EXCEPTIONS
OTHERS = 0.
SET PARAMETER ID 'EUK' FIELD iv_package.
ASSIGN ('(SAPLSTXBS)MASTER_LANGUAGE') TO <lv_spras>.
IF sy-subrc = 0.
<lv_spras> = ls_header-masterlang.
ENDIF.
CALL FUNCTION 'SSF_SAVE_STYLE'
EXPORTING
i_header = ls_header
IMPORTING
e_header = ls_new_header
TABLES
i_paragraphs = lt_paragraphs
i_strings = lt_strings
i_tabstops = lt_tabstops.
IF ls_new_header IS NOT INITIAL.
CALL FUNCTION 'SSF_ACTIVATE_STYLE'
EXPORTING
i_stylename = ls_header-stylename
EXCEPTIONS
no_name = 1
no_style = 2
cancelled = 3
no_access_permission = 4
illegal_language = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SSF_ACTIVATE_STYLE' ).
ENDIF.
ENDIF.
ENDMETHOD. "deserialize
METHOD zif_abapgit_object~exists.
DATA: lv_stylename TYPE stxsadm-stylename.
SELECT SINGLE stylename
FROM stxshead INTO lv_stylename
WHERE active = c_style_active
AND stylename = ms_item-obj_name
AND vari = ''.
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD. "zif_abapgit_object~exists
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-delete_tadir = abap_true.
ENDMETHOD. "zif_abapgit_object~get_metadata
METHOD zif_abapgit_object~has_changed_since.
rv_changed = abap_true.
ENDMETHOD. "zif_abapgit_object~has_changed_since
METHOD zif_abapgit_object~jump.
DATA: ls_bcdata TYPE bdcdata,
lt_bcdata TYPE STANDARD TABLE OF bdcdata.
ls_bcdata-program = 'SAPMSSFS'.
ls_bcdata-dynpro = '0100'.
ls_bcdata-dynbegin = 'X'.
APPEND ls_bcdata TO lt_bcdata.
CLEAR ls_bcdata.
ls_bcdata-fnam = 'SSFSCREENS-SNAME'.
ls_bcdata-fval = ms_item-obj_name.
APPEND ls_bcdata TO lt_bcdata.
CLEAR ls_bcdata.
ls_bcdata-fnam = 'BDC_OKCODE'.
ls_bcdata-fval = '=DISPLAY'.
APPEND ls_bcdata TO lt_bcdata.
CALL FUNCTION 'ABAP4_CALL_TRANSACTION'
STARTING NEW TASK 'GIT'
EXPORTING
tcode = 'SMARTSTYLES'
mode_val = 'E'
TABLES
using_tab = lt_bcdata
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from ABAP4_CALL_TRANSACTION, SSST' ).
ENDIF.
ENDMETHOD. "jump
METHOD zif_abapgit_object~serialize.
* see fm SSF_DOWNLOAD_STYLE
DATA: lv_style_name TYPE tdssname,
ls_header TYPE ssfcats,
lt_paragraphs TYPE TABLE OF ssfparas,
lt_strings TYPE TABLE OF ssfstrings,
lt_tabstops TYPE TABLE OF stxstab.
lv_style_name = ms_item-obj_name.
CALL FUNCTION 'SSF_READ_STYLE'
EXPORTING
i_style_name = lv_style_name
i_style_active_flag = c_style_active
i_style_variant = '%MAIN'
i_style_language = mv_language
IMPORTING
e_header = ls_header
TABLES
e_paragraphs = lt_paragraphs
e_strings = lt_strings
e_tabstops = lt_tabstops
EXCEPTIONS
no_name = 1
no_style = 2
active_style_not_found = 3
inactive_style_not_found = 4
no_variant = 5
no_main_variant = 6
cancelled = 7
no_access_permission = 8
OTHERS = 9.
IF sy-subrc = 2.
RETURN.
ELSEIF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from SSF_READ_STYLE' ).
ENDIF.
CLEAR ls_header-version.
CLEAR ls_header-firstuser.
CLEAR ls_header-firstdate.
CLEAR ls_header-firsttime.
CLEAR ls_header-lastuser.
CLEAR ls_header-lastdate.
CLEAR ls_header-lasttime.
io_xml->add( iv_name = 'HEADER'
ig_data = ls_header ).
io_xml->add( ig_data = lt_paragraphs
iv_name = 'SSFPARAS' ).
io_xml->add( ig_data = lt_strings
iv_name = 'SSFSTRINGS' ).
io_xml->add( ig_data = lt_tabstops
iv_name = 'STXSTAB' ).
ENDMETHOD. "serialize
METHOD zif_abapgit_object~is_locked.
rv_is_locked = exists_a_lock_entry_for( iv_lock_object = 'E_SMSTYLE'
iv_argument = |{ ms_item-obj_name }| ).
ENDMETHOD.
ENDCLASS.
| 27.344322 | 96 | 0.609243 |
f71793fca6d480c5256f9bac057cd8998adf9969 | 591 | abap | ABAP | src/backend/zcx_aof_not_found.clas.abap | larshp/abapOpenFix | fe5ab30b5ee8e1354f26a87a93a4819e0a0a46c5 | [
"MIT"
] | null | null | null | src/backend/zcx_aof_not_found.clas.abap | larshp/abapOpenFix | fe5ab30b5ee8e1354f26a87a93a4819e0a0a46c5 | [
"MIT"
] | 5 | 2017-02-28T14:52:06.000Z | 2017-05-30T10:28:37.000Z | src/backend/zcx_aof_not_found.clas.abap | larshp/abapOpenFix | fe5ab30b5ee8e1354f26a87a93a4819e0a0a46c5 | [
"MIT"
] | 2 | 2017-03-08T08:31:57.000Z | 2019-02-28T08:43:34.000Z | class ZCX_AOF_NOT_FOUND definition
public
inheriting from ZCX_AOF_ERROR
create public .
public section.
methods CONSTRUCTOR
importing
!TEXTID like IF_T100_MESSAGE=>T100KEY optional
!PREVIOUS like PREVIOUS optional .
protected section.
private section.
ENDCLASS.
CLASS ZCX_AOF_NOT_FOUND IMPLEMENTATION.
method CONSTRUCTOR.
CALL METHOD SUPER->CONSTRUCTOR
EXPORTING
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.
| 17.382353 | 60 | 0.781726 |
f71f25604c7dc0814f2c072f313e45013ea5d59e | 416 | abap | ABAP | src/zmci_deneme10.prog.abap | Mcanipekci/test4 | 16ac6fd93850c5a8f55bab02baf6e7ed05585b4d | [
"Apache-2.0"
] | null | null | null | src/zmci_deneme10.prog.abap | Mcanipekci/test4 | 16ac6fd93850c5a8f55bab02baf6e7ed05585b4d | [
"Apache-2.0"
] | null | null | null | src/zmci_deneme10.prog.abap | Mcanipekci/test4 | 16ac6fd93850c5a8f55bab02baf6e7ed05585b4d | [
"Apache-2.0"
] | null | null | null | *&---------------------------------------------------------------------*
*& Report ZMCI_DENEME10
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZMCI_DENEME10.
select *
FROM lfa1
INTO TABLE @DATA(lt_lfa1).
"xxxx
LOOP AT lt_lfa1 INTO DATA(ls_lfa1).
WRITE:/ ls_lfa1-name1, ls_lfa1-name2.
ENDLOOP.
| 27.733333 | 72 | 0.336538 |
f71fe84d09efceb7fc43bc72fb7caf850b0028e5 | 1,212 | abap | ABAP | src/zamp_customizing/zcl_amp_customizing.clas.abap | treee111/abap-metrics-provider | fda1f2e21a91f5a6c04d31462970a5a9a1c40f2e | [
"MIT"
] | 12 | 2021-01-22T08:36:08.000Z | 2021-11-19T22:43:53.000Z | src/zamp_customizing/zcl_amp_customizing.clas.abap | treee111/abap-metrics-provider | fda1f2e21a91f5a6c04d31462970a5a9a1c40f2e | [
"MIT"
] | 163 | 2020-03-12T19:23:27.000Z | 2022-03-31T10:09:03.000Z | src/zamp_customizing/zcl_amp_customizing.clas.abap | treee111/abap-metrics-provider | fda1f2e21a91f5a6c04d31462970a5a9a1c40f2e | [
"MIT"
] | 6 | 2021-01-21T08:07:09.000Z | 2021-03-10T08:18:21.000Z | CLASS zcl_amp_customizing DEFINITION PUBLIC ABSTRACT.
PUBLIC SECTION.
TYPES ty_metric_collectors TYPE STANDARD TABLE OF zamp_config_prov WITH KEY metric_group.
METHODS constructor
IMPORTING scenario TYPE zamp_config_scen-metric_scenario.
METHODS get_metric_collectors ABSTRACT
RETURNING VALUE(metric_collectors) TYPE ty_metric_collectors.
METHODS get_metric_converter ABSTRACT
RETURNING VALUE(converter_class) TYPE REF TO zif_amp_converter.
PROTECTED SECTION.
DATA scenario TYPE zamp_config_scen-metric_scenario.
DATA metric_collectors TYPE ty_metric_collectors.
DATA metric_converter_class_name TYPE zamp_config_scen-converter_class.
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_amp_customizing IMPLEMENTATION.
METHOD constructor.
me->scenario = scenario.
SELECT SINGLE converter_class
FROM zamp_config_scen
INTO @me->metric_converter_class_name
WHERE metric_scenario = @me->scenario.
IF sy-subrc <> 0.
ASSERT 1 = 2.
ENDIF.
SELECT *
FROM zamp_config_prov
INTO TABLE @metric_collectors
WHERE metric_scenario = @me->scenario.
IF sy-subrc <> 0.
ASSERT 1 = 2.
ENDIF.
ENDMETHOD.
ENDCLASS.
| 24.24 | 93 | 0.75495 |
f720b74363c0db8dedfcc62920e9feb14bc355f1 | 475 | abap | ABAP | org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.dataflow.heuristics/abap/LSELECT_GROUPU02.abap | SvenPeldszus/conqat | 28fe004a49453894922aeb27ee3467b1748d23e9 | [
"Apache-2.0"
] | 1 | 2020-04-28T20:06:30.000Z | 2020-04-28T20:06:30.000Z | org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.shallowparser/abap/LSELECT_GROUPU02.abap | SvenPeldszus/conqat | 28fe004a49453894922aeb27ee3467b1748d23e9 | [
"Apache-2.0"
] | null | null | null | org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.shallowparser/abap/LSELECT_GROUPU02.abap | SvenPeldszus/conqat | 28fe004a49453894922aeb27ee3467b1748d23e9 | [
"Apache-2.0"
] | null | null | null | FUNCTION SELECT_COUNT.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(I_KEY) TYPE KEY
*" EXPORTING
*" REFERENCE(E_COUNT) TYPE SY-DBCNT
*"----------------------------------------------------------------------
SELECT COUNT(*) FROM some_table INTO e_count
WHERE key = i_key AND
state >= '000' AND state <= '999'.
ENDFUNCTION. | 29.6875 | 72 | 0.383158 |
f723a00c8be7aa075c6505ab3c175b101b9327a0 | 3,402 | abap | ABAP | src/zadf_demo/zadf_demo_azure_eventhub.prog.abap | hobru/ABAP-SDK-for-Azure | 7e0f2dbf484a87deacae3fe62e2d8fd6357a1d05 | [
"MIT"
] | null | null | null | src/zadf_demo/zadf_demo_azure_eventhub.prog.abap | hobru/ABAP-SDK-for-Azure | 7e0f2dbf484a87deacae3fe62e2d8fd6357a1d05 | [
"MIT"
] | null | null | null | src/zadf_demo/zadf_demo_azure_eventhub.prog.abap | hobru/ABAP-SDK-for-Azure | 7e0f2dbf484a87deacae3fe62e2d8fd6357a1d05 | [
"MIT"
] | 1 | 2018-12-10T10:55:02.000Z | 2018-12-10T10:55:02.000Z | *&---------------------------------------------------------------------*
*& Report ZADF_DEMO_AZURE_EVENTHUB
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zadf_demo_azure_eventhub.
CONSTANTS: gc_interface TYPE zinterface_id VALUE 'DEMO_EHUB'.
TYPES: BEGIN OF lty_data,
carrid TYPE s_carr_id,
connid TYPE s_conn_id,
fldate TYPE s_date,
planetype TYPE s_planetye,
END OF lty_data.
DATA: it_headers TYPE tihttpnvp,
wa_headers TYPE LINE OF tihttpnvp,
lv_string TYPE string,
lv_response TYPE string,
cx_interface TYPE REF TO zcx_interace_config_missing,
cx_http TYPE REF TO zcx_http_client_failed,
cx_adf_service TYPE REF TO zcx_adf_service,
oref_eventhub TYPE REF TO zcl_adf_service_eventhub,
oref TYPE REF TO zcl_adf_service,
filter TYPE zbusinessid,
lv_http_status TYPE i,
lo_json TYPE REF TO cl_trex_json_serializer,
lv1_string TYPE string,
lv_xstring TYPE xstring,
it_data TYPE STANDARD TABLE OF lty_data.
*Sample data population for sending it to Azure eventhub
SELECT carrid connid fldate planetype
FROM sflight UP TO 10 ROWS
INTO TABLE it_data.
IF sy-subrc EQ 0.
TRY.
**Calling Factory method to instantiate eventhub client
oref = zcl_adf_service_factory=>create( iv_interface_id = gc_interface
iv_business_identifier = filter ).
oref_eventhub ?= oref.
**Setting Expiry time
CALL METHOD oref_eventhub->add_expiry_time
EXPORTING
iv_expiry_hour = 0
iv_expiry_min = 15
iv_expiry_sec = 0.
CREATE OBJECT lo_json
EXPORTING
data = it_data.
lo_json->serialize( ).
lv1_string = lo_json->get_data( ).
*Convert input string data to Xstring format
CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
EXPORTING
text = lv1_string
IMPORTING
buffer = lv_xstring
EXCEPTIONS
failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
**Sending Converted SAP data to Azure Eventhub
CALL METHOD oref_eventhub->send
EXPORTING
request = lv_xstring "Input XSTRING of SAP Business Event data
it_headers = it_headers "Header attributes
IMPORTING
response = lv_response "Response from EventHub
ev_http_status = lv_http_status. "Status
CATCH zcx_interace_config_missing INTO cx_interface.
lv_string = cx_interface->get_text( ).
MESSAGE lv_string TYPE 'E'.
CATCH zcx_http_client_failed INTO cx_http .
lv_string = cx_http->get_text( ).
MESSAGE lv_string TYPE 'E'.
CATCH zcx_adf_service INTO cx_adf_service.
lv_string = cx_adf_service->get_text( ).
MESSAGE lv_string TYPE 'E'.
ENDTRY.
IF lv_http_status NE '201' AND
lv_http_status NE '200'.
MESSAGE 'SAP data not sent to Azure EventHub' TYPE 'E'.
ELSE.
MESSAGE 'SAP data sent to Azure EventHub' TYPE 'I'.
ENDIF.
ELSE.
MESSAGE 'No data in SFLIFHT' TYPE 'E'.
ENDIF.
| 32.711538 | 80 | 0.584068 |
f735197f8002d474d2c36a31e42a7ab06cd6cf5d | 31,751 | abap | ABAP | lbn-gtt-template-tso/ABAP/zsrc/zcl_im__gtt_sof_le_shipmnt.clas.abap | DanHaer/logistics-business-network-gtt-samples | 739978ac389da6f3530b26cd6402a3892f4b605a | [
"Apache-2.0"
] | null | null | null | lbn-gtt-template-tso/ABAP/zsrc/zcl_im__gtt_sof_le_shipmnt.clas.abap | DanHaer/logistics-business-network-gtt-samples | 739978ac389da6f3530b26cd6402a3892f4b605a | [
"Apache-2.0"
] | null | null | null | lbn-gtt-template-tso/ABAP/zsrc/zcl_im__gtt_sof_le_shipmnt.clas.abap | DanHaer/logistics-business-network-gtt-samples | 739978ac389da6f3530b26cd6402a3892f4b605a | [
"Apache-2.0"
] | null | null | null | class ZCL_IM__GTT_SOF_LE_SHIPMNT definition
public
final
create public .
public section.
interfaces IF_EX_BADI_LE_SHIPMENT .
protected section.
private section.
ENDCLASS.
CLASS ZCL_IM__GTT_SOF_LE_SHIPMNT IMPLEMENTATION.
method IF_EX_BADI_LE_SHIPMENT~AT_SAVE.
endmethod.
METHOD if_ex_badi_le_shipment~before_update.
INCLUDE /saptrx/constants.
TYPE-POOLS: trxas.
DATA: l_structure_package TYPE devclass,
l_extflag TYPE flag.
DATA: lv_count TYPE i,
ls_comwa5 TYPE vbco5,
ls_comwa6 TYPE vbco6,
lv_fstop TYPE char255,
lv_lstop TYPE char255,
* Location Id
lv_locid TYPE zgtt_locid,
lv_appobjid TYPE /saptrx/aoid.
DATA: ls_vttk_old TYPE vttkvb,
ls_vttk TYPE vttkvb,
ls_vttk_tmp TYPE vttk,
ls_vtts_old TYPE vttsvb,
ls_vtts_delta TYPE vttsvb,
ls_vttp_delta TYPE vttpvb,
ls_vtsp_delta TYPE vtspvb,
ls_likp_delta TYPE likpvb,
ls_likp TYPE likp,
ls_likp_tmp TYPE likp,
ls_vbfas TYPE vbfas,
ls_vbfa_new TYPE vbfavb,
ls_likp_new TYPE likp,
ls_lips TYPE lips,
ls_stop TYPE zgtt_stop_info,
ls_dlv_watching_stop TYPE zgtt_dlv_watch_stop,
ls_eerel TYPE zgtt_sof_ee_rel.
DATA: lt_vbfas TYPE STANDARD TABLE OF vbfas,
lt_vbfa_new TYPE STANDARD TABLE OF vbfavb,
lt_vttk TYPE STANDARD TABLE OF vttkvb,
lt_vtts_delta TYPE STANDARD TABLE OF vttsvb,
lt_vttp_delta TYPE STANDARD TABLE OF vttpvb,
lt_vttp_delta_tmp TYPE STANDARD TABLE OF vttpvb,
lt_vtsp_delta TYPE STANDARD TABLE OF vtspvb,
lt_vtsp_delta_tmp TYPE STANDARD TABLE OF vtspvb,
lt_likp_delta TYPE STANDARD TABLE OF likpvb,
lt_likp_new TYPE STANDARD TABLE OF likp,
lt_lips TYPE STANDARD TABLE OF lips.
DATA: lt_stops_tmp TYPE zgtt_stops,
lt_dlv_watching_stops_tmp TYPE zgtt_dlv_watch_stops,
lt_stops TYPE zgtt_stops,
lt_dlv_watching_stops TYPE zgtt_dlv_watch_stops.
DATA: lt_control TYPE /saptrx/bapi_trk_control_tab,
lt_tracking_id TYPE /saptrx/bapi_trk_trkid_tab,
ls_trxserv TYPE /saptrx/trxserv,
lv_appsys TYPE logsys,
lt_appobj_ctabs TYPE trxas_appobj_ctabs,
lt_bapireturn TYPE bapiret2_t,
lv_trxserver_id TYPE /saptrx/trxservername,
lv_tzone TYPE timezone,
lt_exp_events TYPE /saptrx/bapi_trk_ee_tab.
DATA: ls_control TYPE LINE OF /saptrx/bapi_trk_control_tab,
ls_tracking_id TYPE LINE OF /saptrx/bapi_trk_trkid_tab,
ls_appobj_ctabs TYPE LINE OF trxas_appobj_ctabs,
ls_expeventdata TYPE LINE OF /saptrx/bapi_trk_ee_tab.
DATA: BEGIN OF ls_aotype,
obj_type TYPE /saptrx/trk_obj_type,
aot_type TYPE /saptrx/aotype,
END OF ls_aotype.
DATA: lt_aotype LIKE STANDARD TABLE OF ls_aotype,
lt_aotype_item LIKE STANDARD TABLE OF ls_aotype.
* Check package dependent BADI disabling
l_structure_package = '/SAPTRX/SCEM_AI_R3'.
CALL FUNCTION 'GET_R3_EXTENSION_SWITCH'
EXPORTING
i_structure_package = l_structure_package
IMPORTING
e_active = l_extflag
EXCEPTIONS
not_existing = 1
object_not_existing = 2
no_extension_object = 3
OTHERS = 4.
IF sy-subrc <> 0.
EXIT.
ENDIF.
IF l_extflag <> 'X'.
EXIT.
ENDIF.
* Check if any tracking server defined
CHECK im_shipments_before_update-tra_save_caller <> 'TRX'.
CALL FUNCTION '/SAPTRX/EVENT_MGR_CHECK'
EXCEPTIONS
no_event_mgr_available = 1.
IF sy-subrc <> 0.
EXIT.
ENDIF.
* Check if at least 1 active extractor exists
SELECT COUNT(*) INTO lv_count FROM /saptrx/aotypes
WHERE trk_obj_type EQ 'ESC_SHIPMT'
AND torelevant EQ 'X'.
CHECK lv_count GE 1. CLEAR lv_count.
SELECT COUNT(*) INTO lv_count FROM /saptrx/aotypes
WHERE trk_obj_type EQ 'ESC_DELIV'
AND torelevant EQ 'X'.
CHECK lv_count GE 1.
* GET CURRENT LOGICAL SYSTEM
CALL FUNCTION 'OWN_LOGICAL_SYSTEM_GET'
IMPORTING
own_logical_system = lv_appsys.
* Actual Business Time zone
CALL FUNCTION 'GET_SYSTEM_TIMEZONE'
IMPORTING
timezone = lv_tzone
EXCEPTIONS
customizing_missing = 1
OTHERS = 2.
ls_aotype-obj_type = 'ESC_DELIV'. ls_aotype-aot_type = 'ZGTT_DE_ACC_HD'. APPEND ls_aotype TO lt_aotype.
ls_aotype-obj_type = 'ESC_DELIV'. ls_aotype-aot_type = 'ZGTT_DE_INT_HD'. APPEND ls_aotype TO lt_aotype.
ls_aotype-obj_type = 'ESC_DELIV'. ls_aotype-aot_type = 'ZGTT_DE_ACC_AZ_HD'. APPEND ls_aotype TO lt_aotype.
ls_aotype-obj_type = 'ESC_DELIV'. ls_aotype-aot_type = 'ZGTT_DE_ACC_IF_HD'. APPEND ls_aotype TO lt_aotype.
ls_aotype-obj_type = 'ESC_DELIV'. ls_aotype-aot_type = 'ZGTT_DE_ACC_PF_HD'. APPEND ls_aotype TO lt_aotype.
ls_aotype-obj_type = 'ESC_DELIV'. ls_aotype-aot_type = 'ZGTT_DE_ACC_PR_HD'. APPEND ls_aotype TO lt_aotype.
ls_aotype-obj_type = 'ESC_DELIV'. ls_aotype-aot_type = 'ZGTT_DE_ACC_PT_HD'. APPEND ls_aotype TO lt_aotype.
ls_aotype-obj_type = 'ESC_DELIV'. ls_aotype-aot_type = 'ZGTT_DE_ACC_DM_HD'. APPEND ls_aotype TO lt_aotype.
ls_aotype-obj_type = 'ESC_DELIV'. ls_aotype-aot_type = 'ZGTT_DE_ACC_ITEM'. APPEND ls_aotype TO lt_aotype_item.
ls_aotype-obj_type = 'ESC_DELIV'. ls_aotype-aot_type = 'ZGTT_DE_INT_ITEM'. APPEND ls_aotype TO lt_aotype_item.
ls_aotype-obj_type = 'ESC_DELIV'. ls_aotype-aot_type = 'ZGTT_DE_ACC_AZ_ITEM'. APPEND ls_aotype TO lt_aotype_item.
ls_aotype-obj_type = 'ESC_DELIV'. ls_aotype-aot_type = 'ZGTT_DE_ACC_IF_ITEM'. APPEND ls_aotype TO lt_aotype_item.
ls_aotype-obj_type = 'ESC_DELIV'. ls_aotype-aot_type = 'ZGTT_DE_ACC_PF_ITEM'. APPEND ls_aotype TO lt_aotype_item.
ls_aotype-obj_type = 'ESC_DELIV'. ls_aotype-aot_type = 'ZGTT_DE_ACC_PR_ITEM'. APPEND ls_aotype TO lt_aotype_item.
ls_aotype-obj_type = 'ESC_DELIV'. ls_aotype-aot_type = 'ZGTT_DE_ACC_PT_ITEM'. APPEND ls_aotype TO lt_aotype_item.
ls_aotype-obj_type = 'ESC_DELIV'. ls_aotype-aot_type = 'ZGTT_DE_ACC_DM_ITEM'. APPEND ls_aotype TO lt_aotype_item.
* get the shipment header
MOVE im_shipments_before_update-new_vttk TO lt_vttk.
LOOP AT im_shipments_before_update-old_vttk INTO ls_vttk_old WHERE updkz = 'D'.
APPEND ls_vttk_old TO lt_vttk.
ENDLOOP.
LOOP AT lt_vttk INTO ls_vttk WHERE shtyp EQ '0003'.
CLEAR: lt_vttp_delta, lt_likp_delta, lt_vttp_delta_tmp, lt_vtsp_delta, lt_vtsp_delta_tmp, lt_vtts_delta.
MOVE im_shipments_before_update-new_vttp TO lt_vttp_delta.
APPEND LINES OF im_shipments_before_update-old_vttp TO lt_vttp_delta.
MOVE lt_vttp_delta TO lt_vttp_delta_tmp.
DELETE lt_vttp_delta WHERE ( updkz NE 'I' AND updkz NE 'D' ) OR tknum NE ls_vttk-tknum.
IF lt_vttp_delta IS NOT INITIAL.
LOOP AT lt_vttp_delta INTO ls_vttp_delta.
MOVE ls_vttp_delta-vbeln TO ls_likp_delta-vbeln.
COLLECT ls_likp_delta INTO lt_likp_delta.
ENDLOOP.
ENDIF.
MOVE im_shipments_before_update-new_vtsp TO lt_vtsp_delta.
APPEND LINES OF im_shipments_before_update-old_vtsp TO lt_vtsp_delta.
MOVE lt_vtsp_delta TO lt_vtsp_delta_tmp.
DELETE lt_vtsp_delta WHERE ( updkz NE 'I' AND updkz NE 'D' ) OR tknum NE ls_vttk-tknum.
IF lt_vtsp_delta IS NOT INITIAL.
LOOP AT lt_vtsp_delta INTO ls_vtsp_delta.
READ TABLE lt_vttp_delta_tmp INTO ls_vttp_delta WITH KEY tknum = ls_vtsp_delta-tknum
tpnum = ls_vtsp_delta-tpnum BINARY SEARCH.
IF sy-subrc EQ 0.
MOVE ls_vttp_delta-vbeln TO ls_likp_delta-vbeln.
COLLECT ls_likp_delta INTO lt_likp_delta.
ENDIF.
ENDLOOP.
ENDIF.
MOVE im_shipments_before_update-new_vtts TO lt_vtts_delta.
APPEND LINES OF im_shipments_before_update-old_vtts TO lt_vtts_delta.
DELETE lt_vtts_delta WHERE tknum NE ls_vttk-tknum.
IF lt_vtts_delta IS NOT INITIAL.
LOOP AT lt_vtts_delta INTO ls_vtts_delta WHERE updkz = 'I' OR updkz = 'D'.
CLEAR: ls_vtsp_delta, ls_vttp_delta.
LOOP AT lt_vtsp_delta_tmp INTO ls_vtsp_delta WHERE tknum = ls_vtts_delta-tknum
AND tsnum = ls_vtts_delta-tsnum.
READ TABLE lt_vttp_delta_tmp INTO ls_vttp_delta WITH KEY tknum = ls_vtsp_delta-tknum
tpnum = ls_vtsp_delta-tpnum BINARY SEARCH.
IF sy-subrc EQ 0.
MOVE ls_vttp_delta-vbeln TO ls_likp_delta-vbeln.
COLLECT ls_likp_delta INTO lt_likp_delta.
ENDIF.
ENDLOOP.
ENDLOOP.
LOOP AT lt_vtts_delta INTO ls_vtts_delta WHERE updkz <> 'I' AND updkz <> 'D'.
READ TABLE im_shipments_before_update-old_vtts INTO ls_vtts_old WITH KEY tknum = ls_vtts_delta-tknum
tsnum = ls_vtts_delta-tsnum BINARY SEARCH.
CHECK sy-subrc IS INITIAL.
IF ls_vtts_delta-knota NE ls_vtts_old-knota OR
ls_vtts_delta-vstel NE ls_vtts_old-vstel OR
ls_vtts_delta-werka NE ls_vtts_old-werka OR
ls_vtts_delta-kunna NE ls_vtts_old-kunna OR
ls_vtts_delta-lifna NE ls_vtts_old-lifna OR
ls_vtts_delta-kunnz NE ls_vtts_old-kunnz OR
ls_vtts_delta-vstez NE ls_vtts_old-vstez OR
ls_vtts_delta-lifnz NE ls_vtts_old-lifnz OR
ls_vtts_delta-werkz NE ls_vtts_old-werkz OR
ls_vtts_delta-knotz NE ls_vtts_old-knotz OR
ls_vtts_delta-dptbg NE ls_vtts_old-dptbg OR
ls_vtts_delta-uptbg NE ls_vtts_old-uptbg OR
ls_vtts_delta-dpten NE ls_vtts_old-dpten OR
ls_vtts_delta-upten NE ls_vtts_old-upten. .
CLEAR: ls_vtsp_delta, ls_vttp_delta.
LOOP AT lt_vtsp_delta_tmp INTO ls_vtsp_delta WHERE tknum = ls_vtts_delta-tknum
AND tsnum = ls_vtts_delta-tsnum.
READ TABLE lt_vttp_delta_tmp INTO ls_vttp_delta WITH KEY tknum = ls_vtsp_delta-tknum
tpnum = ls_vtsp_delta-tpnum BINARY SEARCH.
IF sy-subrc EQ 0.
MOVE ls_vttp_delta-vbeln TO ls_likp_delta-vbeln.
COLLECT ls_likp_delta INTO lt_likp_delta.
ENDIF.
ENDLOOP.
ENDIF.
ENDLOOP.
ENDIF.
CLEAR: lt_vbfa_new, lt_likp_new.
LOOP AT lt_likp_delta INTO ls_likp_delta.
CLEAR: ls_comwa6, lt_vbfas.
MOVE-CORRESPONDING ls_likp_delta TO ls_comwa6.
CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
EXPORTING
comwa = ls_comwa6
TABLES
vbfa_tab = lt_vbfas.
LOOP AT lt_vbfas INTO ls_vbfas WHERE vbtyp_n EQ '8' AND vbtyp_v EQ 'J'.
SELECT SINGLE * INTO ls_likp FROM likp WHERE vbeln = ls_vbfas-vbelv
AND lfart = 'LBNP'.
CHECK sy-subrc EQ 0.
SELECT SINGLE * INTO ls_vttk_tmp FROM vttk WHERE tknum = ls_vbfas-vbeln
AND shtyp EQ '0003'.
CHECK sy-subrc EQ 0.
MOVE-CORRESPONDING ls_vbfas TO ls_vbfa_new.
APPEND ls_vbfa_new TO lt_vbfa_new.
ENDLOOP.
SELECT SINGLE * INTO ls_likp FROM likp WHERE vbeln = ls_likp_delta-vbeln
AND lfart = 'LBNP'.
IF sy-subrc = 0.
COLLECT ls_likp INTO lt_likp_new.
ENDIF.
ENDLOOP.
LOOP AT lt_vttp_delta INTO ls_vttp_delta WHERE updkz = 'D'.
DELETE lt_vbfa_new WHERE vbeln = ls_vttp_delta-tknum
AND vbelv = ls_vttp_delta-vbeln.
ENDLOOP.
LOOP AT lt_vttp_delta INTO ls_vttp_delta WHERE updkz = 'I'.
READ TABLE lt_vbfa_new WITH KEY vbeln = ls_vttp_delta-tknum
vbelv = ls_vttp_delta-vbeln
TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
SELECT SINGLE * INTO ls_likp FROM likp WHERE vbeln = ls_vttp_delta-vbeln
AND lfart = 'LBNP'.
CHECK sy-subrc EQ 0.
CLEAR ls_vbfa_new.
ls_vbfa_new-vbelv = ls_vttp_delta-vbeln.
ls_vbfa_new-vbeln = ls_vttp_delta-tknum.
COLLECT ls_vbfa_new INTO lt_vbfa_new.
ENDIF.
ENDLOOP.
CHECK lt_likp_new IS NOT INITIAL.
CLEAR: lt_stops, lt_dlv_watching_stops.
LOOP AT lt_vbfa_new INTO ls_vbfa_new.
CLEAR: lt_stops_tmp, lt_dlv_watching_stops_tmp.
IF ls_vbfa_new-vbeln = ls_vttk-tknum.
CALL FUNCTION 'ZGTT_GET_STOPS_FROM_SHIPMENT'
EXPORTING
iv_tknum = ls_vttk-tknum
it_vtts_new = im_shipments_before_update-new_vtts
it_vtsp_new = im_shipments_before_update-new_vtsp
it_vttp_new = im_shipments_before_update-new_vttp
IMPORTING
et_stops = lt_stops_tmp
et_dlv_watching_stops = lt_dlv_watching_stops_tmp.
ELSE.
CALL FUNCTION 'ZGTT_GET_STOPS_FROM_SHIPMENT'
EXPORTING
iv_tknum = ls_vbfa_new-vbeln
IMPORTING
et_stops = lt_stops_tmp
et_dlv_watching_stops = lt_dlv_watching_stops_tmp.
ENDIF.
APPEND LINES OF lt_stops_tmp TO lt_stops.
APPEND LINES OF lt_dlv_watching_stops_tmp TO lt_dlv_watching_stops.
ENDLOOP.
SORT lt_stops BY stopid loccat.
SORT lt_dlv_watching_stops BY vbeln stopid loccat.
DELETE ADJACENT DUPLICATES FROM lt_stops COMPARING stopid loccat.
DELETE ADJACENT DUPLICATES FROM lt_dlv_watching_stops COMPARING vbeln stopid loccat.
* *************************************************************COMPOSE IDOC->
LOOP AT lt_aotype INTO ls_aotype.
SELECT SINGLE trxservername INTO lv_trxserver_id FROM /saptrx/aotypes
WHERE trk_obj_type EQ ls_aotype-obj_type
AND aotype EQ ls_aotype-aot_type.
SELECT SINGLE trx_server_id trx_server INTO ( ls_trxserv-trx_server_id, ls_trxserv-trx_server )
FROM /saptrx/trxserv
WHERE trx_server_id = lv_trxserver_id.
CLEAR: lt_appobj_ctabs, lt_control, lt_tracking_id, lt_exp_events.
LOOP AT lt_likp_new INTO ls_likp_new.
CLEAR: ls_appobj_ctabs.
ls_appobj_ctabs-trxservername = ls_trxserv-trx_server_id.
ls_appobj_ctabs-appobjtype = ls_aotype-aot_type.
ls_appobj_ctabs-appobjid = ls_likp_new-vbeln.
APPEND ls_appobj_ctabs TO lt_appobj_ctabs.
* update the impacted deliveries' shipment composition and tracking id table=>
CLEAR: ls_control.
ls_control-appsys = lv_appsys.
ls_control-appobjtype = ls_aotype-aot_type.
ls_control-appobjid = ls_likp_new-vbeln.
ls_control-paramname = 'YN_DLV_NO'.
ls_control-value = ls_likp_new-vbeln.
APPEND ls_control TO lt_control.
ls_control-paramname = 'ACTUAL_BUSINESS_TIMEZONE'.
ls_control-value = lv_tzone.
APPEND ls_control TO lt_control.
ls_control-paramname = 'ACTUAL_BUSINESS_DATETIME'.
CONCATENATE '0' sy-datum sy-uzeit INTO ls_control-value.
APPEND ls_control TO lt_control.
CLEAR: lv_count.
LOOP AT lt_vbfa_new INTO ls_vbfa_new WHERE vbelv = ls_likp_new-vbeln.
lv_count = lv_count + 1.
ls_control-paramname = 'YN_SHP_LINE_COUNT'.
ls_control-paramindex = lv_count.
ls_control-value = lv_count.
SHIFT ls_control-value LEFT DELETING LEADING space.
APPEND ls_control TO lt_control.
ls_control-paramname = 'YN_SHP_NO'.
ls_control-paramindex = lv_count.
ls_control-value = ls_vbfa_new-vbeln.
APPEND ls_control TO lt_control.
CLEAR: lv_fstop, lv_lstop.
LOOP AT lt_dlv_watching_stops INTO ls_dlv_watching_stop WHERE vbeln = ls_vbfa_new-vbelv
AND stopid(10) = ls_vbfa_new-vbeln.
IF lv_fstop IS INITIAL.
lv_fstop = ls_dlv_watching_stop-stopid.
ENDIF.
lv_lstop = ls_dlv_watching_stop-stopid.
ENDLOOP.
ls_control-paramname = 'YN_SHP_FIRST_STOP'.
ls_control-paramindex = lv_count.
ls_control-value = lv_fstop.
APPEND ls_control TO lt_control.
ls_control-paramname = 'YN_SHP_LAST_STOP'.
ls_control-paramindex = lv_count.
ls_control-value = lv_lstop.
APPEND ls_control TO lt_control.
ENDLOOP.
IF sy-subrc NE 0.
ls_control-paramname = 'YN_SHP_LINE_COUNT'.
ls_control-paramindex = '1'.
ls_control-value = ''.
APPEND ls_control TO lt_control.
ENDIF.
CLEAR: ls_tracking_id.
ls_tracking_id-appsys = lv_appsys.
ls_tracking_id-appobjtype = ls_aotype-aot_type.
ls_tracking_id-appobjid = ls_likp_new-vbeln.
ls_tracking_id-trxcod = 'OUTBOUND_DELIVERY'.
ls_tracking_id-trxid = ls_likp_new-vbeln.
CONCATENATE '0' sy-datum sy-uzeit INTO ls_tracking_id-start_date.
ls_tracking_id-end_date = '099991231000000'.
ls_tracking_id-timzon = lv_tzone.
APPEND ls_tracking_id TO lt_tracking_id.
CLEAR ls_tracking_id-start_date.
CLEAR ls_tracking_id-end_date.
CLEAR ls_tracking_id-timzon.
LOOP AT lt_vttp_delta INTO ls_vttp_delta WHERE vbeln = ls_likp_new-vbeln.
CLEAR ls_tracking_id-action.
ls_tracking_id-trxcod = 'SHIPMENT_ORDER'.
ls_tracking_id-trxid = ls_vttp_delta-tknum.
IF ls_vttp_delta-updkz = 'D'.
ls_tracking_id-action = 'D'.
ENDIF.
APPEND ls_tracking_id TO lt_tracking_id.
ENDLOOP.
* update the impacted deliveries' shipment composition and tracking id table=<
* update the impacted deliveries' planned event table=>
CLEAR ls_expeventdata.
ls_expeventdata-appsys = lv_appsys.
ls_expeventdata-appobjtype = ls_aotype-aot_type.
ls_expeventdata-language = sy-langu.
ls_expeventdata-appobjid = ls_likp_new-vbeln.
ls_expeventdata-evt_exp_tzone = lv_tzone.
CLEAR ls_eerel.
SELECT SINGLE * INTO ls_eerel FROM zgtt_sof_ee_rel WHERE appobjid = ls_expeventdata-appobjid.
IF ls_eerel-z_wbstk = 'X'.
ls_expeventdata-milestone = 'GOODS_ISSUE'.
IF ls_likp_new-wadat IS INITIAL.
CLEAR ls_expeventdata-evt_exp_datetime.
ELSE.
CONCATENATE '0' ls_likp_new-wadat ls_likp_new-wauhr INTO ls_expeventdata-evt_exp_datetime.
ENDIF.
ls_expeventdata-loctype = 'ShippingPoint'.
ls_expeventdata-locid1 = ls_likp_new-vstel.
ls_expeventdata-locid2 = ''.
APPEND ls_expeventdata TO lt_exp_events.
ENDIF.
ls_expeventdata-milestone = 'DEPARTURE'.
LOOP AT lt_dlv_watching_stops INTO ls_dlv_watching_stop WHERE vbeln = ls_likp_new-vbeln
AND loccat = 'S'.
READ TABLE lt_stops INTO ls_stop WITH KEY stopid = ls_dlv_watching_stop-stopid
loccat = ls_dlv_watching_stop-loccat.
ls_expeventdata-locid2 = ls_stop-stopid.
ls_expeventdata-loctype = ls_stop-loctype.
ls_expeventdata-locid1 = ls_stop-locid.
ls_expeventdata-evt_exp_datetime = ls_stop-pln_evt_datetime.
ls_expeventdata-evt_exp_tzone = ls_stop-pln_evt_timezone.
APPEND ls_expeventdata TO lt_exp_events.
ENDLOOP.
ls_expeventdata-milestone = 'ARRIV_DEST'.
LOOP AT lt_dlv_watching_stops INTO ls_dlv_watching_stop WHERE vbeln = ls_likp_new-vbeln
AND loccat = 'D'.
READ TABLE lt_stops INTO ls_stop WITH KEY stopid = ls_dlv_watching_stop-stopid
loccat = ls_dlv_watching_stop-loccat.
ls_expeventdata-locid2 = ls_stop-stopid.
ls_expeventdata-loctype = ls_stop-loctype.
ls_expeventdata-locid1 = ls_stop-locid.
ls_expeventdata-evt_exp_datetime = ls_stop-pln_evt_datetime.
ls_expeventdata-evt_exp_tzone = ls_stop-pln_evt_timezone.
APPEND ls_expeventdata TO lt_exp_events.
ENDLOOP.
ls_expeventdata-milestone = 'POD'.
LOOP AT lt_dlv_watching_stops INTO ls_dlv_watching_stop WHERE vbeln = ls_likp_new-vbeln
AND loccat = 'D'.
READ TABLE lt_stops INTO ls_stop WITH KEY stopid = ls_dlv_watching_stop-stopid
loccat = ls_dlv_watching_stop-loccat.
CLEAR: lv_locid.
SELECT SINGLE kunnr INTO lv_locid FROM likp WHERE vbeln = ls_likp_new-vbeln.
IF lv_locid EQ ls_stop-locid AND ls_eerel-z_pdstk = 'X'.
ls_expeventdata-locid2 = ls_stop-stopid.
ls_expeventdata-loctype = ls_stop-loctype.
ls_expeventdata-locid1 = ls_stop-locid.
ls_expeventdata-evt_exp_datetime = ls_stop-pln_evt_datetime.
ls_expeventdata-evt_exp_tzone = ls_stop-pln_evt_timezone.
APPEND ls_expeventdata TO lt_exp_events.
ENDIF.
ENDLOOP.
READ TABLE lt_exp_events WITH KEY appobjid = ls_likp_new-vbeln TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
ls_expeventdata-evt_exp_datetime = '000000000000000'.
ls_expeventdata-milestone = ''.
ls_expeventdata-evt_exp_tzone = ''.
ls_expeventdata-loctype = ''.
ls_expeventdata-locid1 = ''.
ls_expeventdata-locid2 = ''.
APPEND ls_expeventdata TO lt_exp_events.
ENDIF.
* update the impacted deliveries' planned event table=<
ENDLOOP.
IF lt_control IS NOT INITIAL.
CALL METHOD zcl_gtt_sof_upd_xtp_references=>send_idoc_ehpost01
EXPORTING
it_control = lt_control
it_tracking_id = lt_tracking_id
it_exp_event = lt_exp_events
is_trxserv = ls_trxserv
iv_appsys = lv_appsys
it_appobj_ctabs = lt_appobj_ctabs.
ENDIF.
ENDLOOP.
* update the impacted delivery items' planned event table=>
CLEAR lt_lips.
IF lt_likp_new IS NOT INITIAL.
SELECT * INTO TABLE lt_lips FROM lips FOR ALL ENTRIES IN lt_likp_new WHERE vbeln = lt_likp_new-vbeln.
ENDIF.
LOOP AT lt_aotype_item INTO ls_aotype.
SELECT SINGLE trxservername INTO lv_trxserver_id FROM /saptrx/aotypes
WHERE trk_obj_type EQ ls_aotype-obj_type
AND aotype EQ ls_aotype-aot_type.
SELECT SINGLE trx_server_id trx_server INTO ( ls_trxserv-trx_server_id, ls_trxserv-trx_server )
FROM /saptrx/trxserv
WHERE trx_server_id = lv_trxserver_id.
CLEAR: lt_appobj_ctabs, lt_control, lt_tracking_id, lt_exp_events.
LOOP AT lt_lips INTO ls_lips.
CLEAR: ls_appobj_ctabs.
ls_appobj_ctabs-trxservername = ls_trxserv-trx_server_id.
ls_appobj_ctabs-appobjtype = ls_aotype-aot_type.
CONCATENATE ls_lips-vbeln ls_lips-posnr INTO ls_appobj_ctabs-appobjid.
APPEND ls_appobj_ctabs TO lt_appobj_ctabs.
CLEAR: ls_control.
ls_control-appsys = lv_appsys.
ls_control-appobjtype = ls_aotype-aot_type.
CONCATENATE ls_lips-vbeln ls_lips-posnr INTO ls_control-appobjid.
ls_control-paramname = 'YN_DLV_NO'.
ls_control-value = ls_lips-vbeln.
APPEND ls_control TO lt_control.
ls_control-paramname = 'YN_DLV_ITEM_NO'.
ls_control-value = ls_lips-posnr.
APPEND ls_control TO lt_control.
ls_control-paramname = 'ACTUAL_BUSINESS_TIMEZONE'.
ls_control-value = lv_tzone.
APPEND ls_control TO lt_control.
ls_control-paramname = 'ACTUAL_BUSINESS_DATETIME'.
CONCATENATE '0' sy-datum sy-uzeit INTO ls_control-value.
APPEND ls_control TO lt_control.
CLEAR: ls_tracking_id.
ls_tracking_id-appsys = lv_appsys.
ls_tracking_id-appobjtype = ls_aotype-aot_type.
CONCATENATE ls_lips-vbeln ls_lips-posnr INTO ls_tracking_id-appobjid.
ls_tracking_id-trxcod = 'OUTBOUND_DELIVERY_IT'.
CONCATENATE ls_lips-vbeln ls_lips-posnr INTO ls_tracking_id-trxid.
CONCATENATE '0' sy-datum sy-uzeit INTO ls_tracking_id-start_date.
ls_tracking_id-end_date = '099991231000000'.
ls_tracking_id-timzon = lv_tzone.
APPEND ls_tracking_id TO lt_tracking_id.
CLEAR ls_expeventdata.
ls_expeventdata-appsys = lv_appsys.
ls_expeventdata-appobjtype = ls_aotype-aot_type.
ls_expeventdata-language = sy-langu.
CONCATENATE ls_lips-vbeln ls_lips-posnr INTO ls_expeventdata-appobjid.
ls_expeventdata-evt_exp_tzone = lv_tzone.
SELECT SINGLE * INTO ls_likp_tmp FROM likp WHERE vbeln = ls_lips-vbeln.
CLEAR ls_eerel.
SELECT SINGLE * INTO ls_eerel FROM zgtt_sof_ee_rel WHERE appobjid = ls_expeventdata-appobjid.
IF ls_eerel-z_kostk = 'X'.
ls_expeventdata-milestone = 'PICKING'.
IF ls_likp_tmp-kodat IS INITIAL.
CLEAR ls_expeventdata-evt_exp_datetime.
ELSE.
CONCATENATE '0' ls_likp_tmp-kodat ls_likp_tmp-kouhr INTO ls_expeventdata-evt_exp_datetime.
ENDIF.
ls_expeventdata-loctype = 'ShippingPoint'.
ls_expeventdata-locid1 = ls_likp_tmp-vstel.
ls_expeventdata-locid2 = ''.
APPEND ls_expeventdata TO lt_exp_events.
ENDIF.
IF ls_eerel-z_pkstk = 'X'.
CLEAR ls_expeventdata-evt_exp_datetime.
ls_expeventdata-milestone = 'PACKING'.
ls_expeventdata-loctype = 'ShippingPoint'.
ls_expeventdata-locid1 = ls_likp_tmp-vstel.
ls_expeventdata-locid2 = ''.
APPEND ls_expeventdata TO lt_exp_events.
ENDIF.
IF ls_eerel-z_wbstk = 'X'.
ls_expeventdata-milestone = 'GOODS_ISSUE'.
IF ls_likp_tmp-wadat IS INITIAL.
CLEAR ls_expeventdata-evt_exp_datetime.
ELSE.
CONCATENATE '0' ls_likp_tmp-wadat ls_likp_tmp-wauhr INTO ls_expeventdata-evt_exp_datetime.
ENDIF.
ls_expeventdata-loctype = 'ShippingPoint'.
ls_expeventdata-locid1 = ls_likp_tmp-vstel.
ls_expeventdata-locid2 = ''.
APPEND ls_expeventdata TO lt_exp_events.
ENDIF.
IF ls_eerel-z_pdstk = 'X'.
CLEAR ls_expeventdata-evt_exp_datetime.
ls_expeventdata-milestone = 'POD'.
ls_expeventdata-loctype = 'Customer'.
ls_expeventdata-locid1 = ls_likp_tmp-kunnr.
ls_expeventdata-locid2 = ''.
APPEND ls_expeventdata TO lt_exp_events.
ENDIF.
ls_expeventdata-milestone = 'DEPARTURE'.
LOOP AT lt_dlv_watching_stops INTO ls_dlv_watching_stop WHERE vbeln = ls_lips-vbeln
AND loccat = 'S'.
READ TABLE lt_stops INTO ls_stop WITH KEY stopid = ls_dlv_watching_stop-stopid
loccat = ls_dlv_watching_stop-loccat.
ls_expeventdata-locid2 = ls_stop-stopid.
ls_expeventdata-loctype = ls_stop-loctype.
ls_expeventdata-locid1 = ls_stop-locid.
ls_expeventdata-evt_exp_datetime = ls_stop-pln_evt_datetime.
ls_expeventdata-evt_exp_tzone = ls_stop-pln_evt_timezone.
APPEND ls_expeventdata TO lt_exp_events.
ENDLOOP.
ls_expeventdata-milestone = 'ARRIV_DEST'.
LOOP AT lt_dlv_watching_stops INTO ls_dlv_watching_stop WHERE vbeln = ls_lips-vbeln
AND loccat = 'D'.
READ TABLE lt_stops INTO ls_stop WITH KEY stopid = ls_dlv_watching_stop-stopid
loccat = ls_dlv_watching_stop-loccat.
ls_expeventdata-locid2 = ls_stop-stopid.
ls_expeventdata-loctype = ls_stop-loctype.
ls_expeventdata-locid1 = ls_stop-locid.
ls_expeventdata-evt_exp_datetime = ls_stop-pln_evt_datetime.
ls_expeventdata-evt_exp_tzone = ls_stop-pln_evt_timezone.
APPEND ls_expeventdata TO lt_exp_events.
ENDLOOP.
ls_expeventdata-milestone = 'POD'.
LOOP AT lt_dlv_watching_stops INTO ls_dlv_watching_stop WHERE vbeln = ls_lips-vbeln
AND loccat = 'D'.
READ TABLE lt_stops INTO ls_stop WITH KEY stopid = ls_dlv_watching_stop-stopid
loccat = ls_dlv_watching_stop-loccat.
CLEAR: lv_locid.
SELECT SINGLE kunnr INTO lv_locid FROM likp WHERE vbeln = ls_lips-vbeln.
IF lv_locid EQ ls_stop-locid AND ls_eerel-z_pdstk = 'X'.
ls_expeventdata-locid2 = ls_stop-stopid.
ls_expeventdata-loctype = ls_stop-loctype.
ls_expeventdata-locid1 = ls_stop-locid.
ls_expeventdata-evt_exp_datetime = ls_stop-pln_evt_datetime.
ls_expeventdata-evt_exp_tzone = ls_stop-pln_evt_timezone.
APPEND ls_expeventdata TO lt_exp_events.
ENDIF.
ENDLOOP.
CONCATENATE ls_lips-vbeln ls_lips-posnr INTO lv_appobjid.
READ TABLE lt_exp_events WITH KEY appobjid = lv_appobjid TRANSPORTING NO FIELDS.
IF sy-subrc NE 0.
ls_expeventdata-evt_exp_datetime = '000000000000000'.
ls_expeventdata-milestone = ''.
ls_expeventdata-evt_exp_tzone = ''.
ls_expeventdata-loctype = ''.
ls_expeventdata-locid1 = ''.
ls_expeventdata-locid2 = ''.
APPEND ls_expeventdata TO lt_exp_events.
ENDIF.
ENDLOOP.
IF lt_control IS NOT INITIAL.
CALL METHOD zcl_gtt_sof_upd_xtp_references=>send_idoc_ehpost01
EXPORTING
it_control = lt_control
it_tracking_id = lt_tracking_id
it_exp_event = lt_exp_events
is_trxserv = ls_trxserv
iv_appsys = lv_appsys
it_appobj_ctabs = lt_appobj_ctabs.
ENDIF.
ENDLOOP.
* update the impacted delivery items' planned event table=<
ENDLOOP.
ENDMETHOD.
method IF_EX_BADI_LE_SHIPMENT~IN_UPDATE.
endmethod.
ENDCLASS.
| 44.782793 | 123 | 0.634468 |
f73619273b5dc49f93d9ddb109ac5c3b00fc701e | 122 | abap | ABAP | objects/CLAS/ZCL_IM_AS_CREDIT/CPUB ZCL_IM_AS_CREDIT.abap | abhilashhaa/HCL_Githup | 454be7f157c72fbb75550dea67c9167e405a4fdb | [
"Apache-2.0"
] | null | null | null | objects/CLAS/ZCL_IM_AS_CREDIT/CPUB ZCL_IM_AS_CREDIT.abap | abhilashhaa/HCL_Githup | 454be7f157c72fbb75550dea67c9167e405a4fdb | [
"Apache-2.0"
] | null | null | null | objects/CLAS/ZCL_IM_AS_CREDIT/CPUB ZCL_IM_AS_CREDIT.abap | abhilashhaa/HCL_Githup | 454be7f157c72fbb75550dea67c9167e405a4fdb | [
"Apache-2.0"
] | null | null | null | class ZCL_IM_AS_CREDIT definition
public
final
create public .
public section.
interfaces IF_EX_UKM_EV_FORMULA . | 15.25 | 35 | 0.795082 |
f736713dcc5ab864fa6449b685dbb7da33e04f2c | 6,818 | abap | ABAP | src/zcl_uom_alv_ida.clas.abap | Keller-Michael/ALV_with_IDA_example | 1b9495e2fcace5dd16e5d9d2cd2ec01f7f85b1f9 | [
"MIT"
] | 6 | 2021-01-31T12:56:46.000Z | 2022-03-10T00:40:50.000Z | src/zcl_uom_alv_ida.clas.abap | Keller-Michael/ALV_with_IDA_example | 1b9495e2fcace5dd16e5d9d2cd2ec01f7f85b1f9 | [
"MIT"
] | null | null | null | src/zcl_uom_alv_ida.clas.abap | Keller-Michael/ALV_with_IDA_example | 1b9495e2fcace5dd16e5d9d2cd2ec01f7f85b1f9 | [
"MIT"
] | 3 | 2021-08-30T06:20:32.000Z | 2022-03-10T00:38:44.000Z | CLASS zcl_uom_alv_ida DEFINITION PUBLIC FINAL CREATE PRIVATE.
PUBLIC SECTION.
INTERFACES zif_uom_alv_ida.
TYPES ty_uom_selection TYPE RANGE OF msehi.
TYPES ty_language_selection TYPE RANGE OF spras.
METHODS constructor
IMPORTING
it_uom_selection TYPE ty_uom_selection
it_language_selection TYPE ty_language_selection.
CLASS-METHODS get_instance
IMPORTING
it_uom_selection TYPE ty_uom_selection
it_language_selection TYPE ty_language_selection
RETURNING
VALUE(ro_result) TYPE REF TO zif_uom_alv_ida.
PROTECTED SECTION.
PRIVATE SECTION.
CONSTANTS mc_cds_view_name TYPE dbtabl VALUE 'zb_uom'.
CLASS-DATA mo_instance TYPE REF TO zcl_uom_alv_ida.
DATA mo_alv_with_ida TYPE REF TO if_salv_gui_table_ida.
METHODS on_double_click_on_cell FOR EVENT double_click OF if_salv_gui_table_display_opt
IMPORTING
ev_field_name
eo_row_data.
METHODS on_toolbar_function_selected FOR EVENT function_selected OF if_salv_gui_toolbar_ida
IMPORTING ev_fcode.
METHODS create_alv_with_ida.
METHODS provide_select_options
IMPORTING
it_uom_selection TYPE ty_uom_selection
it_language_selection TYPE ty_language_selection.
METHODS activate_text_search.
METHODS activate_layout_persistence.
METHODS register_double_click_event.
METHODS get_row_data
IMPORTING
row_object TYPE REF TO if_salv_gui_row_data_ida
RETURNING
VALUE(rs_result) TYPE zb_uom.
METHODS add_buttons_to_toolbar.
METHODS change_toolbar.
METHODS register_toolbar_event.
ENDCLASS.
CLASS zcl_uom_alv_ida IMPLEMENTATION.
METHOD activate_text_search.
mo_alv_with_ida->standard_functions( )->set_text_search_active( abap_true ).
TRY.
mo_alv_with_ida->field_catalog( )->enable_text_search( 'SHORT_TEXT' ).
mo_alv_with_ida->field_catalog( )->enable_text_search( 'LONG_TEXT' ).
CATCH cx_salv_ida_unknown_name.
CATCH cx_salv_call_after_1st_display.
ENDTRY.
ENDMETHOD.
METHOD activate_layout_persistence.
DATA(ls_persistence_key) = VALUE if_salv_gui_layout_persistence=>ys_persistence_key( report_name = sy-repid
handle = 'ZUOM' ).
TRY.
mo_alv_with_ida->layout_persistence( )->set_persistence_options(
EXPORTING
is_persistence_key = ls_persistence_key
* i_global_save_allowed = ABAP_TRUE
* i_user_specific_save_allowed = ABAP_TRUE
).
CATCH cx_salv_ida_layout_key_invalid.
ENDTRY.
ENDMETHOD.
METHOD constructor.
create_alv_with_ida( ).
provide_select_options( it_uom_selection = it_uom_selection
it_language_selection = it_language_selection ).
activate_text_search( ).
activate_layout_persistence( ).
change_toolbar( ).
register_double_click_event( ).
ENDMETHOD.
METHOD create_alv_with_ida.
TRY.
mo_alv_with_ida = cl_salv_gui_table_ida=>create_for_cds_view(
EXPORTING
iv_cds_view_name = mc_cds_view_name
* io_gui_container =
* io_calc_field_handler =
).
CATCH cx_salv_db_connection.
CATCH cx_salv_db_table_not_supported.
CATCH cx_salv_ida_contract_violation.
CATCH cx_salv_function_not_supported.
ENDTRY.
ENDMETHOD.
METHOD on_double_click_on_cell.
DATA(ls_row_data) = get_row_data( eo_row_data ).
DATA(lv_message_text) = |Double click on field in column { ev_field_name }|.
MESSAGE lv_message_text TYPE 'S'.
ENDMETHOD.
METHOD get_row_data.
TRY.
row_object->get_row_data(
EXPORTING
iv_request_type = if_salv_gui_selection_ida=>cs_request_type-all_fields
* its_requested_fields =
IMPORTING
es_row = rs_result ).
CATCH cx_salv_ida_contract_violation.
CATCH cx_salv_ida_sel_row_deleted.
ENDTRY.
ENDMETHOD.
METHOD provide_select_options.
DATA(lo_collector) = NEW cl_salv_range_tab_collector( ).
lo_collector->add_ranges_for_name( iv_name = 'UNIT_OF_MEASUREMENT'
it_ranges = it_uom_selection ).
lo_collector->add_ranges_for_name( iv_name = 'LANGUAGE'
it_ranges = it_language_selection ).
lo_collector->get_collected_ranges( IMPORTING et_named_ranges = DATA(lt_ranges) ).
TRY.
mo_alv_with_ida->set_select_options(
EXPORTING
it_ranges = lt_ranges
* io_condition =
).
CATCH cx_salv_ida_associate_invalid.
CATCH cx_salv_db_connection.
CATCH cx_salv_ida_condition_invalid.
CATCH cx_salv_ida_unknown_name.
ENDTRY.
ENDMETHOD.
METHOD register_double_click_event.
TRY.
mo_alv_with_ida->selection( )->set_selection_mode( if_salv_gui_selection_ida=>cs_selection_mode-single ).
CATCH cx_salv_ida_contract_violation.
ENDTRY.
mo_alv_with_ida->display_options( )->enable_double_click( ).
SET HANDLER on_double_click_on_cell FOR mo_alv_with_ida->display_options( ).
ENDMETHOD.
METHOD on_toolbar_function_selected.
mo_alv_with_ida->refresh( ).
ENDMETHOD.
METHOD add_buttons_to_toolbar.
mo_alv_with_ida->toolbar( )->add_button( iv_fcode = 'REFRESH'
iv_icon = icon_refresh
iv_is_checked = abap_false
iv_text = space
iv_quickinfo = 'Refresh list'
iv_before_standard_functions = abap_false ).
mo_alv_with_ida->toolbar( )->add_separator( EXPORTING iv_before_standard_functions = abap_true ).
ENDMETHOD.
METHOD change_toolbar.
add_buttons_to_toolbar( ).
register_toolbar_event( ).
ENDMETHOD.
METHOD register_toolbar_event.
SET HANDLER on_toolbar_function_selected FOR mo_alv_with_ida->toolbar( ).
ENDMETHOD.
METHOD zif_uom_alv_ida~display.
TRY.
mo_alv_with_ida->fullscreen( )->display( ).
CATCH cx_salv_ida_contract_violation.
ENDTRY.
ENDMETHOD.
METHOD get_instance.
IF mo_instance IS NOT BOUND.
mo_instance = NEW zcl_uom_alv_ida(
it_uom_selection = it_uom_selection
it_language_selection = it_language_selection ).
ENDIF.
ro_result = mo_instance.
ENDMETHOD.
ENDCLASS.
| 31.13242 | 113 | 0.659284 |
f737554adf6f5300c5ba291f32f1cd634fb72036 | 748 | abap | ABAP | src/zdemos_qrfc_modules.fugr.z_demos_qrfc_mod_process.abap | MDJoerg/Demos_QRFC | fe579ef444dea650ea89b73b7c8fe8a37edfa67a | [
"MIT"
] | null | null | null | src/zdemos_qrfc_modules.fugr.z_demos_qrfc_mod_process.abap | MDJoerg/Demos_QRFC | fe579ef444dea650ea89b73b7c8fe8a37edfa67a | [
"MIT"
] | null | null | null | src/zdemos_qrfc_modules.fugr.z_demos_qrfc_mod_process.abap | MDJoerg/Demos_QRFC | fe579ef444dea650ea89b73b7c8fe8a37edfa67a | [
"MIT"
] | null | null | null | FUNCTION Z_DEMOS_QRFC_MOD_PROCESS.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(IV_DATA) TYPE VTEXT OPTIONAL
*" EXCEPTIONS
*" ERROR_1
*" ERROR_2
*"----------------------------------------------------------------------
* ----------- local data
DATA: lv_rc TYPE i VALUE 0.
DATA: lr_qrfc TYPE REF TO ZCL_DEMOS_QRFC_UTIL.
* ----------- init
lr_qrfc ?= ZCL_DEMOS_QRFC_UTIL=>get_instance( ).
* ----------- process
WAIT UP TO 1 SECONDS.
* ---------- error handling
CASE lv_rc.
WHEN 0.
" OK
WHEN 1.
RAISE error_1.
WHEN 2.
RAISE error_2.
WHEN OTHERS.
lr_qrfc->set_status_retry_later( ).
ENDCASE.
ENDFUNCTION.
| 20.216216 | 72 | 0.48262 |
f73a744e3dbe5e0e7fdbf4a6b423aa20d0b43546 | 23,763 | abap | ABAP | src/ui/zcl_abapgit_gui_router.clas.abap | ElNovi/abapGit | fbe618002093887d023649f77165c6ecbad8c09b | [
"MIT"
] | null | null | null | src/ui/zcl_abapgit_gui_router.clas.abap | ElNovi/abapGit | fbe618002093887d023649f77165c6ecbad8c09b | [
"MIT"
] | null | null | null | src/ui/zcl_abapgit_gui_router.clas.abap | ElNovi/abapGit | fbe618002093887d023649f77165c6ecbad8c09b | [
"MIT"
] | null | null | null | CLASS zcl_abapgit_gui_router DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_abapgit_gui_event_handler.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_event_data,
action TYPE string,
prev_page TYPE string,
getdata TYPE string,
postdata TYPE cnht_post_data_tab,
END OF ty_event_data .
METHODS general_page_routing
IMPORTING
!is_event_data TYPE ty_event_data
EXPORTING
!ei_page TYPE REF TO zif_abapgit_gui_renderable
!ev_state TYPE i
RAISING
zcx_abapgit_exception.
METHODS abapgit_services_actions
IMPORTING
!is_event_data TYPE ty_event_data
EXPORTING
!ei_page TYPE REF TO zif_abapgit_gui_renderable
!ev_state TYPE i
RAISING
zcx_abapgit_exception.
METHODS db_actions
IMPORTING
!is_event_data TYPE ty_event_data
EXPORTING
!ei_page TYPE REF TO zif_abapgit_gui_renderable
!ev_state TYPE i
RAISING
zcx_abapgit_exception.
CLASS-METHODS file_download
IMPORTING
!iv_package TYPE devclass
!iv_xstr TYPE xstring
RAISING
zcx_abapgit_exception .
METHODS git_services
IMPORTING
!is_event_data TYPE ty_event_data
EXPORTING
!ei_page TYPE REF TO zif_abapgit_gui_renderable
!ev_state TYPE i
RAISING
zcx_abapgit_exception.
METHODS remote_origin_manipulations
IMPORTING
!is_event_data TYPE ty_event_data
EXPORTING
!ei_page TYPE REF TO zif_abapgit_gui_renderable
!ev_state TYPE i
RAISING
zcx_abapgit_exception.
METHODS sap_gui_actions
IMPORTING
!is_event_data TYPE ty_event_data
EXPORTING
!ei_page TYPE REF TO zif_abapgit_gui_renderable
!ev_state TYPE i
RAISING
zcx_abapgit_exception.
METHODS zip_services
IMPORTING
!is_event_data TYPE ty_event_data
EXPORTING
!ei_page TYPE REF TO zif_abapgit_gui_renderable
!ev_state TYPE i
RAISING
zcx_abapgit_exception.
METHODS repository_services
IMPORTING
!is_event_data TYPE ty_event_data
EXPORTING
!ei_page TYPE REF TO zif_abapgit_gui_renderable
!ev_state TYPE i
RAISING
zcx_abapgit_exception.
METHODS get_page_diff
IMPORTING
!iv_getdata TYPE clike
RETURNING
VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable
RAISING
zcx_abapgit_exception .
METHODS get_page_branch_overview
IMPORTING
!iv_getdata TYPE clike
RETURNING
VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable
RAISING
zcx_abapgit_exception .
METHODS get_page_stage
IMPORTING
!iv_getdata TYPE clike
RETURNING
VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable
RAISING
zcx_abapgit_exception .
METHODS get_page_background
IMPORTING
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
RETURNING
VALUE(ri_page) TYPE REF TO zif_abapgit_gui_renderable
RAISING
zcx_abapgit_exception .
CLASS-METHODS jump_display_transport
IMPORTING
!iv_getdata TYPE clike
RAISING
zcx_abapgit_exception.
ENDCLASS.
CLASS zcl_abapgit_gui_router IMPLEMENTATION.
METHOD abapgit_services_actions.
DATA: li_main_page TYPE REF TO zcl_abapgit_gui_page_main.
CASE is_event_data-action.
" ABAPGIT services actions
WHEN zif_abapgit_definitions=>c_action-abapgit_home.
CREATE OBJECT li_main_page.
ei_page = li_main_page.
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-abapgit_install. " Install abapGit
zcl_abapgit_services_abapgit=>install_abapgit( ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
ENDCASE.
ENDMETHOD.
METHOD db_actions.
CASE is_event_data-action.
" DB actions
WHEN zif_abapgit_definitions=>c_action-db_edit.
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_db_edit
EXPORTING
is_key = zcl_abapgit_html_action_utils=>dbkey_decode( is_event_data-getdata ).
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
IF is_event_data-prev_page = 'PAGE_DB_DIS'.
ev_state = zcl_abapgit_gui=>c_event_state-new_page_replacing.
ENDIF.
WHEN zif_abapgit_definitions=>c_action-db_display.
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_db_dis
EXPORTING
is_key = zcl_abapgit_html_action_utils=>dbkey_decode( is_event_data-getdata ).
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
ENDCASE.
ENDMETHOD.
METHOD file_download.
DATA:
lv_path TYPE string,
lv_default TYPE string,
li_fe_serv TYPE REF TO zif_abapgit_frontend_services,
lv_package TYPE devclass.
lv_package = iv_package.
TRANSLATE lv_package USING '/#'.
CONCATENATE lv_package '_' sy-datlo '_' sy-timlo INTO lv_default.
li_fe_serv = zcl_abapgit_ui_factory=>get_frontend_services( ).
lv_path = li_fe_serv->show_file_save_dialog(
iv_title = 'Export ZIP'
iv_extension = 'zip'
iv_default_filename = lv_default ).
li_fe_serv->file_download(
iv_path = lv_path
iv_xstr = iv_xstr ).
ENDMETHOD.
METHOD general_page_routing.
DATA: lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
lv_last_repo_key TYPE zif_abapgit_persistence=>ty_repo-key.
lv_key = is_event_data-getdata. " TODO refactor
CASE is_event_data-action.
" General PAGE routing
WHEN zcl_abapgit_gui=>c_action-go_home.
IF zcl_abapgit_persist_settings=>get_instance( )->read( )->get_show_default_repo( ) = abap_true.
lv_last_repo_key = zcl_abapgit_persistence_user=>get_instance( )->get_repo_show( ).
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_view_repo
EXPORTING iv_key = lv_last_repo_key.
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
ELSE.
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_main.
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
ENDIF.
WHEN zif_abapgit_definitions=>c_action-go_repo_overview. " Go Repository overview
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_repo_over.
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_db. " Go DB util page
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_db.
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_debuginfo.
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_debuginfo.
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_settings.
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_settings.
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_background_run. " Go background run page
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_bkg_run.
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_background. " Go Background page
ei_page = get_page_background( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_diff. " Go Diff page
ei_page = get_page_diff( is_event_data-getdata ).
ev_state = zcl_abapgit_gui=>c_event_state-new_page_w_bookmark.
WHEN zif_abapgit_definitions=>c_action-go_stage. " Go Staging page
ei_page = get_page_stage( is_event_data-getdata ).
IF is_event_data-prev_page = 'PAGE_DIFF'.
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
ELSE.
ev_state = zcl_abapgit_gui=>c_event_state-new_page_w_bookmark.
ENDIF.
WHEN zif_abapgit_definitions=>c_action-go_branch_overview. " Go repo branch overview
ei_page = get_page_branch_overview( is_event_data-getdata ).
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-go_tutorial. " Go to tutorial
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_tutorial.
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
ENDCASE.
ENDMETHOD.
METHOD get_page_background.
CREATE OBJECT ri_page TYPE zcl_abapgit_gui_page_bkg
EXPORTING
iv_key = iv_key.
ENDMETHOD.
METHOD get_page_branch_overview.
DATA: lo_repo TYPE REF TO zcl_abapgit_repo_online,
lo_page TYPE REF TO zcl_abapgit_gui_page_boverview,
lv_key TYPE zif_abapgit_persistence=>ty_repo-key.
lv_key = iv_getdata.
lo_repo ?= zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
CREATE OBJECT lo_page
EXPORTING
io_repo = lo_repo.
ri_page = lo_page.
ENDMETHOD.
METHOD get_page_diff.
DATA: ls_file TYPE zif_abapgit_definitions=>ty_file,
ls_object TYPE zif_abapgit_definitions=>ty_item,
lo_page TYPE REF TO zcl_abapgit_gui_page_diff,
lv_key TYPE zif_abapgit_persistence=>ty_repo-key.
zcl_abapgit_html_action_utils=>file_obj_decode(
EXPORTING
iv_string = iv_getdata
IMPORTING
ev_key = lv_key
eg_file = ls_file
eg_object = ls_object ).
CREATE OBJECT lo_page
EXPORTING
iv_key = lv_key
is_file = ls_file
is_object = ls_object.
ri_page = lo_page.
ENDMETHOD.
METHOD get_page_stage.
DATA: lo_repo TYPE REF TO zcl_abapgit_repo_online,
lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
lv_seed TYPE string,
lo_stage_page TYPE REF TO zcl_abapgit_gui_page_stage,
lo_code_inspector_page TYPE REF TO zcl_abapgit_gui_page_code_insp.
FIND FIRST OCCURRENCE OF '=' IN iv_getdata.
IF sy-subrc <> 0. " Not found ? -> just repo key in params
lv_key = iv_getdata.
ELSE.
zcl_abapgit_html_action_utils=>stage_decode(
EXPORTING iv_getdata = iv_getdata
IMPORTING ev_key = lv_key
ev_seed = lv_seed ).
ENDIF.
lo_repo ?= zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
IF lo_repo->get_local_settings( )-code_inspector_check_variant IS NOT INITIAL.
CREATE OBJECT lo_code_inspector_page
EXPORTING
io_repo = lo_repo.
ri_page = lo_code_inspector_page.
ELSE.
" force refresh on stage, to make sure the latest local and remote files are used
lo_repo->refresh( ).
CREATE OBJECT lo_stage_page
EXPORTING
io_repo = lo_repo
iv_seed = lv_seed.
ri_page = lo_stage_page.
ENDIF.
ENDMETHOD.
METHOD git_services.
DATA: lv_key TYPE zif_abapgit_persistence=>ty_repo-key.
lv_key = is_event_data-getdata. " TODO refactor
CASE is_event_data-action.
" GIT actions
WHEN zif_abapgit_definitions=>c_action-git_pull. " GIT Pull
zcl_abapgit_services_git=>pull( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_reset. " GIT Reset
zcl_abapgit_services_git=>reset( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_branch_create. " GIT Create new branch
zcl_abapgit_services_git=>create_branch( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_branch_delete. " GIT Delete remote branch
zcl_abapgit_services_git=>delete_branch( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_branch_switch. " GIT Switch branch
zcl_abapgit_services_git=>switch_branch( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-go_tag_overview. " GIT Tag overview
zcl_abapgit_services_git=>tag_overview( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_tag_create. " GIT Tag create
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_tag
EXPORTING
io_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-git_tag_delete. " GIT Tag create
zcl_abapgit_services_git=>delete_tag( lv_key ).
zcl_abapgit_services_repo=>refresh( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-git_tag_switch. " GIT Switch Tag
zcl_abapgit_services_git=>switch_tag( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
ENDCASE.
ENDMETHOD.
METHOD jump_display_transport.
DATA: lv_transport TYPE trkorr,
lv_transport_adt_uri TYPE string,
lv_adt_link TYPE string,
lv_adt_jump_enabled TYPE abap_bool.
lv_transport = iv_getdata.
lv_adt_jump_enabled = zcl_abapgit_persist_settings=>get_instance( )->read( )->get_adt_jump_enabled( ).
IF lv_adt_jump_enabled = abap_true.
TRY.
CALL METHOD ('CL_CTS_ADT_TM_URI_BUILDER')=>('CREATE_ADT_URI')
EXPORTING
trnumber = lv_transport
RECEIVING
result = lv_transport_adt_uri.
lv_adt_link = |adt://{ sy-sysid }{ lv_transport_adt_uri }|.
cl_gui_frontend_services=>execute( EXPORTING document = lv_adt_link
EXCEPTIONS OTHERS = 1 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'ADT Jump Error' ).
ENDIF.
CATCH cx_root.
CALL FUNCTION 'TR_DISPLAY_REQUEST'
EXPORTING
i_trkorr = lv_transport.
ENDTRY.
ELSE.
CALL FUNCTION 'TR_DISPLAY_REQUEST'
EXPORTING
i_trkorr = lv_transport.
ENDIF.
ENDMETHOD.
METHOD remote_origin_manipulations.
DATA: lv_key TYPE zif_abapgit_persistence=>ty_repo-key.
lv_key = is_event_data-getdata. " TODO refactor
CASE is_event_data-action.
" Remote ORIGIN manipulations
WHEN zif_abapgit_definitions=>c_action-repo_remote_attach. " Remote attach
zcl_abapgit_services_repo=>remote_attach( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_remote_detach. " Remote detach
zcl_abapgit_services_repo=>remote_detach( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_remote_change. " Remote change
zcl_abapgit_services_repo=>remote_change( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
ENDCASE.
ENDMETHOD.
METHOD repository_services.
DATA: lv_url TYPE string,
lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
li_log TYPE REF TO zif_abapgit_log.
lv_key = is_event_data-getdata. " TODO refactor
lv_url = is_event_data-getdata. " TODO refactor
CASE is_event_data-action.
" REPOSITORY services actions
WHEN zif_abapgit_definitions=>c_action-repo_newoffline. " New offline repo
zcl_abapgit_services_repo=>new_offline( ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_add_all_obj_to_trans_req.
zcl_abapgit_transport=>add_all_objects_to_trans_req( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_refresh. " Repo refresh
zcl_abapgit_services_repo=>refresh( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_syntax_check.
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_syntax
EXPORTING
io_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-repo_code_inspector.
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_code_insp
EXPORTING
io_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-repo_purge. " Repo remove & purge all objects
zcl_abapgit_services_repo=>purge( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_remove. " Repo remove
zcl_abapgit_services_repo=>remove( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_newonline.
zcl_abapgit_services_repo=>new_online( lv_url ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_refresh_checksums. " Rebuild local checksums
zcl_abapgit_services_repo=>refresh_local_checksums( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_toggle_fav. " Toggle repo as favorite
zcl_abapgit_services_repo=>toggle_favorite( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_transport_to_branch.
zcl_abapgit_services_repo=>transport_to_branch( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-repo_settings.
CREATE OBJECT ei_page TYPE zcl_abapgit_gui_page_repo_sett
EXPORTING
io_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-new_page.
WHEN zif_abapgit_definitions=>c_action-repo_log.
li_log = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key )->get_log( ).
zcl_abapgit_log_viewer=>show_log( ii_log = li_log
iv_header_text = li_log->get_title( ) ).
ev_state = zcl_abapgit_gui=>c_event_state-no_more_act.
ENDCASE.
ENDMETHOD.
METHOD sap_gui_actions.
DATA: ls_item TYPE zif_abapgit_definitions=>ty_item.
CASE is_event_data-action.
" SAP GUI actions
WHEN zif_abapgit_definitions=>c_action-jump. " Open object editor
zcl_abapgit_html_action_utils=>jump_decode(
EXPORTING iv_string = is_event_data-getdata
IMPORTING ev_obj_type = ls_item-obj_type
ev_obj_name = ls_item-obj_name ).
zcl_abapgit_objects=>jump( ls_item ).
ev_state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-jump_transport.
jump_display_transport( is_event_data-getdata ).
ev_state = zcl_abapgit_gui=>c_event_state-no_more_act.
ENDCASE.
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
DATA: ls_event_data TYPE ty_event_data.
ls_event_data-action = iv_action.
ls_event_data-getdata = iv_getdata.
ls_event_data-postdata = it_postdata.
general_page_routing(
EXPORTING
is_event_data = ls_event_data
IMPORTING
ei_page = ei_page
ev_state = ev_state ).
repository_services(
EXPORTING
is_event_data = ls_event_data
IMPORTING
ei_page = ei_page
ev_state = ev_state ).
git_services(
EXPORTING
is_event_data = ls_event_data
IMPORTING
ei_page = ei_page
ev_state = ev_state ).
zip_services(
EXPORTING
is_event_data = ls_event_data
IMPORTING
ei_page = ei_page
ev_state = ev_state ).
db_actions(
EXPORTING
is_event_data = ls_event_data
IMPORTING
ei_page = ei_page
ev_state = ev_state ).
abapgit_services_actions(
EXPORTING
is_event_data = ls_event_data
IMPORTING
ei_page = ei_page
ev_state = ev_state ).
remote_origin_manipulations(
EXPORTING
is_event_data = ls_event_data
IMPORTING
ei_page = ei_page
ev_state = ev_state ).
sap_gui_actions(
EXPORTING
is_event_data = ls_event_data
IMPORTING
ei_page = ei_page
ev_state = ev_state ).
IF ev_state IS INITIAL.
ev_state = zcl_abapgit_gui=>c_event_state-not_handled.
ENDIF.
ENDMETHOD.
METHOD zip_services.
DATA: lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
lo_repo TYPE REF TO zcl_abapgit_repo,
lv_package TYPE devclass,
lv_path TYPE string,
lv_xstr TYPE xstring.
lv_key = is_event_data-getdata. " TODO refactor
CASE is_event_data-action.
" ZIP services actions
WHEN zif_abapgit_definitions=>c_action-zip_import. " Import repo from ZIP
lo_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
lv_path = zcl_abapgit_ui_factory=>get_frontend_services( )->show_file_open_dialog(
iv_title = 'Import ZIP'
iv_extension = 'zip'
iv_default_filename = '*.zip' ).
lv_xstr = zcl_abapgit_ui_factory=>get_frontend_services( )->file_upload( lv_path ).
lo_repo->set_files_remote( zcl_abapgit_zip=>load( lv_xstr ) ).
zcl_abapgit_services_repo=>refresh( lv_key ).
ev_state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN zif_abapgit_definitions=>c_action-zip_export. " Export repo as ZIP
lo_repo = zcl_abapgit_repo_srv=>get_instance( )->get( lv_key ).
lv_xstr = zcl_abapgit_zip=>export( lo_repo ).
file_download( iv_package = lo_repo->get_package( )
iv_xstr = lv_xstr ).
ev_state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-zip_package. " Export package as ZIP
zcl_abapgit_zip=>export_package( IMPORTING
ev_xstr = lv_xstr
ev_package = lv_package ).
file_download( iv_package = lv_package
iv_xstr = lv_xstr ).
ev_state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-zip_transport. " Export transports as ZIP
zcl_abapgit_transport_mass=>run( ).
ev_state = zcl_abapgit_gui=>c_event_state-no_more_act.
WHEN zif_abapgit_definitions=>c_action-zip_object. " Export object as ZIP
zcl_abapgit_zip=>export_object( ).
ev_state = zcl_abapgit_gui=>c_event_state-no_more_act.
ENDCASE.
ENDMETHOD.
ENDCLASS.
| 35.733835 | 111 | 0.671548 |
f73c1491937fabc719756680162f0701848a2cfb | 24,158 | abap | ABAP | day09/task2.abap | julianschmuckli/adventofcode_2020 | 18c6aa2014f1994a9cccb36346bf52a46038242e | [
"Apache-2.0"
] | 1 | 2020-12-04T14:41:29.000Z | 2020-12-04T14:41:29.000Z | day09/task2.abap | julianschmuckli/adventofcode_2020 | 18c6aa2014f1994a9cccb36346bf52a46038242e | [
"Apache-2.0"
] | null | null | null | day09/task2.abap | julianschmuckli/adventofcode_2020 | 18c6aa2014f1994a9cccb36346bf52a46038242e | [
"Apache-2.0"
] | null | null | null | TYPES: BEGIN OF t_input,
row TYPE string,
END OF t_input.
* Input declaration
DATA: lv_input TYPE TABLE OF t_input,
wa_input LIKE LINE OF lv_input.
* Assign with the puzzle input.
lv_input = VALUE #(
( row = '33' )
( row = '18' )
( row = '22' )
( row = '44' )
( row = '49' )
( row = '15' )
( row = '12' )
( row = '38' )
( row = '41' )
( row = '46' )
( row = '3' )
( row = '42' )
( row = '37' )
( row = '19' )
( row = '13' )
( row = '7' )
( row = '21' )
( row = '29' )
( row = '34' )
( row = '40' )
( row = '39' )
( row = '35' )
( row = '27' )
( row = '25' )
( row = '48' )
( row = '87' )
( row = '10' )
( row = '16' )
( row = '17' )
( row = '45' )
( row = '18' )
( row = '30' )
( row = '20' )
( row = '22' )
( row = '23' )
( row = '73' )
( row = '24' )
( row = '26' )
( row = '28' )
( row = '53' )
( row = '31' )
( row = '37' )
( row = '51' )
( row = '32' )
( row = '33' )
( row = '34' )
( row = '36' )
( row = '35' )
( row = '54' )
( row = '27' )
( row = '38' )
( row = '39' )
( row = '40' )
( row = '74' )
( row = '70' )
( row = '41' )
( row = '93' )
( row = '144' )
( row = '45' )
( row = '63' )
( row = '87' )
( row = '66' )
( row = '65' )
( row = '55' )
( row = '58' )
( row = '62' )
( row = '72' )
( row = '105' )
( row = '59' )
( row = '76' )
( row = '61' )
( row = '67' )
( row = '68' )
( row = '77' )
( row = '106' )
( row = '78' )
( row = '79' )
( row = '183' )
( row = '86' )
( row = '117' )
( row = '96' )
( row = '100' )
( row = '108' )
( row = '104' )
( row = '123' )
( row = '113' )
( row = '114' )
( row = '116' )
( row = '129' )
( row = '119' )
( row = '178' )
( row = '120' )
( row = '196' )
( row = '126' )
( row = '177' )
( row = '184' )
( row = '135' )
( row = '182' )
( row = '192' )
( row = '201' )
( row = '174' )
( row = '360' )
( row = '186' )
( row = '190' )
( row = '210' )
( row = '248' )
( row = '214' )
( row = '282' )
( row = '217' )
( row = '227' )
( row = '229' )
( row = '304' )
( row = '235' )
( row = '370' )
( row = '308' )
( row = '261' )
( row = '302' )
( row = '300' )
( row = '542' )
( row = '376' )
( row = '309' )
( row = '317' )
( row = '356' )
( row = '364' )
( row = '375' )
( row = '407' )
( row = '396' )
( row = '400' )
( row = '404' )
( row = '585' )
( row = '599' )
( row = '514' )
( row = '444' )
( row = '907' )
( row = '456' )
( row = '633' )
( row = '687' )
( row = '496' )
( row = '665' )
( row = '561' )
( row = '563' )
( row = '832' )
( row = '1056' )
( row = '626' )
( row = '673' )
( row = '681' )
( row = '720' )
( row = '731' )
( row = '840' )
( row = '819' )
( row = '796' )
( row = '800' )
( row = '1033' )
( row = '1117' )
( row = '900' )
( row = '958' )
( row = '940' )
( row = '952' )
( row = '1017' )
( row = '1019' )
( row = '1748' )
( row = '1177' )
( row = '1422' )
( row = '1124' )
( row = '1578' )
( row = '1189' )
( row = '1299' )
( row = '1678' )
( row = '1307' )
( row = '1354' )
( row = '2702' )
( row = '2476' )
( row = '1689' )
( row = '3775' )
( row = '1740' )
( row = '2813' )
( row = '2706' )
( row = '1977' )
( row = '1898' )
( row = '1840' )
( row = '2630' )
( row = '2864' )
( row = '1971' )
( row = '2439' )
( row = '2143' )
( row = '2932' )
( row = '2301' )
( row = '2313' )
( row = '2423' )
( row = '2488' )
( row = '2496' )
( row = '3194' )
( row = '2661' )
( row = '2996' )
( row = '3043' )
( row = '4416' )
( row = '3429' )
( row = '3529' )
( row = '3580' )
( row = '3638' )
( row = '3738' )
( row = '3983' )
( row = '4830' )
( row = '3811' )
( row = '4114' )
( row = '4724' )
( row = '5782' )
( row = '4394' )
( row = '4444' )
( row = '7143' )
( row = '6623' )
( row = '6882' )
( row = '7267' )
( row = '5149' )
( row = '7823' )
( row = '5855' )
( row = '5657' )
( row = '5704' )
( row = '6425' )
( row = '7026' )
( row = '6958' )
( row = '9666' )
( row = '7109' )
( row = '7218' )
( row = '10249' )
( row = '8535' )
( row = '7794' )
( row = '11512' )
( row = '14327' )
( row = '9969' )
( row = '15906' )
( row = '8838' )
( row = '10101' )
( row = '9593' )
( row = '12082' )
( row = '10806' )
( row = '10853' )
( row = '13451' )
( row = '17489' )
( row = '13073' )
( row = '11361' )
( row = '12129' )
( row = '17210' )
( row = '13383' )
( row = '13984' )
( row = '30562' )
( row = '16329' )
( row = '14903' )
( row = '15753' )
( row = '19306' )
( row = '16632' )
( row = '23920' )
( row = '26456' )
( row = '26113' )
( row = '18431' )
( row = '27032' )
( row = '19644' )
( row = '27882' )
( row = '20399' )
( row = '37885' )
( row = '21659' )
( row = '27976' )
( row = '24812' )
( row = '23490' )
( row = '24744' )
( row = '25345' )
( row = '25512' )
( row = '42785' )
( row = '27367' )
( row = '29737' )
( row = '30656' )
( row = '45579' )
( row = '31535' )
( row = '32385' )
( row = '35063' )
( row = '52788' )
( row = '38075' )
( row = '38830' )
( row = '44544' )
( row = '40090' )
( row = '40043' )
( row = '55249' )
( row = '57897' )
( row = '42058' )
( row = '45149' )
( row = '52712' )
( row = '48234' )
( row = '48302' )
( row = '72946' )
( row = '50089' )
( row = '64342' )
( row = '52879' )
( row = '103551' )
( row = '57104' )
( row = '72428' )
( row = '62191' )
( row = '79837' )
( row = '63920' )
( row = '71215' )
( row = '73138' )
( row = '80133' )
( row = '84587' )
( row = '82148' )
( row = '156430' )
( row = '90132' )
( row = '152323' )
( row = '113146' )
( row = '90360' )
( row = '197733' )
( row = '100946' )
( row = '105591' )
( row = '101113' )
( row = '98391' )
( row = '288093' )
( row = '154280' )
( row = '109983' )
( row = '204497' )
( row = '164424' )
( row = '152975' )
( row = '137058' )
( row = '126111' )
( row = '191473' )
( row = '181079' )
( row = '144353' )
( row = '153271' )
( row = '170265' )
( row = '166735' )
( row = '183261' )
( row = '180492' )
( row = '188523' )
( row = '236094' )
( row = '235449' )
( row = '188751' )
( row = '202059' )
( row = '262815' )
( row = '305610' )
( row = '199504' )
( row = '208374' )
( row = '247041' )
( row = '312042' )
( row = '254336' )
( row = '440591' )
( row = '353175' )
( row = '442859' )
( row = '263169' )
( row = '270464' )
( row = '616344' )
( row = '297624' )
( row = '311088' )
( row = '320006' )
( row = '402829' )
( row = '377274' )
( row = '363753' )
( row = '369015' )
( row = '501377' )
( row = '388255' )
( row = '390810' )
( row = '397125' )
( row = '401563' )
( row = '407878' )
( row = '446545' )
( row = '455415' )
( row = '471543' )
( row = '732768' )
( row = '524800' )
( row = '751679' )
( row = '1043856' )
( row = '533633' )
( row = '626922' )
( row = '568088' )
( row = '581552' )
( row = '608712' )
( row = '699343' )
( row = '631094' )
( row = '697280' )
( row = '779065' )
( row = '926958' )
( row = '921925' )
( row = '868668' )
( row = '785380' )
( row = '969651' )
( row = '856978' )
( row = '798688' )
( row = '809441' )
( row = '989430' )
( row = '901960' )
( row = '1036967' )
( row = '996343' )
( row = '1285312' )
( row = '1133512' )
( row = '1101721' )
( row = '1195010' )
( row = '1115185' )
( row = '1149640' )
( row = '1330437' )
( row = '1911355' )
( row = '1239806' )
( row = '1328374' )
( row = '1912577' )
( row = '1476345' )
( row = '3239729' )
( row = '1654048' )
( row = '1655666' )
( row = '1594821' )
( row = '1584068' )
( row = '1608129' )
( row = '1758938' )
( row = '1700648' )
( row = '1711401' )
( row = '2365341' )
( row = '1898303' )
( row = '2895658' )
( row = '2098064' )
( row = '2216906' )
( row = '4654596' )
( row = '3293074' )
( row = '2769233' )
( row = '2354991' )
( row = '3039775' )
( row = '2834627' )
( row = '3238116' )
( row = '3810880' )
( row = '3132011' )
( row = '3060413' )
( row = '3178889' )
( row = '3284716' )
( row = '3192197' )
( row = '3202950' )
( row = '3295469' )
( row = '4253294' )
( row = '3928307' )
( row = '3412049' )
( row = '4720332' )
( row = '4993722' )
( row = '4867297' )
( row = '3996367' )
( row = '4571897' )
( row = '8152013' )
( row = '4986139' )
( row = '5124224' )
( row = '5189618' )
( row = '6472462' )
( row = '5394766' )
( row = '5874402' )
( row = '5895040' )
( row = '7003077' )
( row = '6192424' )
( row = '7385305' )
( row = '8181601' )
( row = '6476913' )
( row = '6395147' )
( row = '6487666' )
( row = '8716699' )
( row = '6707518' )
( row = '7408416' )
( row = '8398188' )
( row = '7983946' )
( row = '8568264' )
( row = '8863664' )
( row = '8982506' )
( row = '9120591' )
( row = '13184431' )
( row = '10860541' )
( row = '10110363' )
( row = '10313842' )
( row = '10584384' )
( row = '11289806' )
( row = '15470172' )
( row = '11769442' )
( row = '12382706' )
( row = '16579789' )
( row = '15056088' )
( row = '12872060' )
( row = '13896082' )
( row = '12964579' )
( row = '13102665' )
( row = '25185888' )
( row = '24474237' )
( row = '14115934' )
( row = '20633106' )
( row = '16382134' )
( row = '16552210' )
( row = '23098440' )
( row = '19092869' )
( row = '18103097' )
( row = '24209924' )
( row = '24392471' )
( row = '27842016' )
( row = '24254385' )
( row = '28687481' )
( row = '24152148' )
( row = '23059248' )
( row = '38150467' )
( row = '24641502' )
( row = '25347285' )
( row = '25836639' )
( row = '42357482' )
( row = '36023827' )
( row = '26067244' )
( row = '27080513' )
( row = '35645079' )
( row = '49033973' )
( row = '30498068' )
( row = '39463219' )
( row = '42619454' )
( row = '32934344' )
( row = '34655307' )
( row = '29221323' )
( row = '37195966' )
( row = '60665329' )
( row = '62725592' )
( row = '47313633' )
( row = '50901264' )
( row = '47211396' )
( row = '82958712' )
( row = '47700750' )
( row = '48406533' )
( row = '49988787' )
( row = '50708746' )
( row = '51183924' )
( row = '51903883' )
( row = '53147757' )
( row = '88497192' )
( row = '77789259' )
( row = '56301836' )
( row = '86546343' )
( row = '67694034' )
( row = '59719391' )
( row = '70130310' )
( row = '81340877' )
( row = '101892670' )
( row = '63876630' )
( row = '66417289' )
( row = '84407362' )
( row = '96107283' )
( row = '94525029' )
( row = '146096070' )
( row = '94912146' )
( row = '95617929' )
( row = '103087807' )
( row = '101554290' )
( row = '180025291' )
( row = '103136544' )
( row = '102612629' )
( row = '110903315' )
( row = '105051640' )
( row = '109449593' )
( row = '116021227' )
( row = '120178466' )
( row = '122719125' )
( row = '178932391' )
( row = '197661573' )
( row = '123596021' )
( row = '167971579' )
( row = '130293919' )
( row = '283113098' )
( row = '199576669' )
( row = '245349680' )
( row = '199243827' )
( row = '189437175' )
( row = '213515944' )
( row = '190530075' )
( row = '196466436' )
( row = '197172219' )
( row = '233045614' )
( row = '390106744' )
( row = '223315010' )
( row = '225331754' )
( row = '207664269' )
( row = '214501233' )
( row = '396748888' )
( row = '225470820' )
( row = '291567600' )
( row = '312156300' )
( row = '478395294' )
( row = '343809863' )
( row = '253889940' )
( row = '298265498' )
( row = '509328519' )
( row = '319731094' )
( row = '472550273' )
( row = '379967250' )
( row = '385903611' )
( row = '386609394' )
( row = '479221694' )
( row = '711440908' )
( row = '545201914' )
( row = '393638655' )
( row = '629794502' )
( row = '422165502' )
( row = '439972053' )
( row = '680214542' )
( row = '461554209' )
( row = '433135089' )
( row = '468391173' )
( row = '1024423608' )
( row = '479360760' )
( row = '545457540' )
( row = '552155438' )
( row = '854294784' )
( row = '573621034' )
( row = '617996592' )
( row = '678232748' )
( row = '705634705' )
( row = '699698344' )
( row = '938840569' )
( row = '773605905' )
( row = '772513005' )
( row = '780248049' )
( row = '815804157' )
( row = '1170152030' )
( row = '826773744' )
( row = '855192864' )
( row = '1418201329' )
( row = '862137555' )
( row = '1794033433' )
( row = '1024818300' )
( row = '894689298' )
( row = '1051131681' )
( row = '1163454132' )
( row = '1031516198' )
( row = '1052981794' )
( row = '1119078574' )
( row = '1125776472' )
( row = '1191617626' )
( row = '1450745753' )
( row = '1485882754' )
( row = '1377931092' )
( row = '1405333049' )
( row = '1472211349' )
( row = '2266130803' )
( row = '1546118910' )
( row = '1552761054' )
( row = '2576522225' )
( row = '1642577901' )
( row = '1717330419' )
( row = '1681966608' )
( row = '1749882162' )
( row = '2300022347' )
( row = '1886955855' )
( row = '2216435926' )
( row = '1919507598' )
( row = '2242749307' )
( row = '2084497992' )
( row = '2150594772' )
( row = '2157292670' )
( row = '2172060368' )
( row = '2244855046' )
( row = '2317394098' )
( row = '2569548718' )
( row = '2891215803' )
( row = '2783264141' )
( row = '2850142441' )
( row = '2877544398' )
( row = '3762554836' )
( row = '3098879964' )
( row = '4533830024' )
( row = '3195338955' )
( row = '4384520339' )
( row = '5066578367' )
( row = '3399297027' )
( row = '3568922463' )
( row = '3636838017' )
( row = '8170668041' )
( row = '6514382415' )
( row = '4373728596' )
( row = '4467988870' )
( row = '4322655140' )
( row = '6446466861' )
( row = '4307887442' )
( row = '5674479944' )
( row = '4416915414' )
( row = '7406767406' )
( row = '5100658239' )
( row = '5352812859' )
( row = '5978603096' )
( row = '7105919281' )
( row = '6498176991' )
( row = '8669580702' )
( row = '6294218919' )
( row = '6735717981' )
( row = '11048212439' )
( row = '8021358356' )
( row = '6968219490' )
( row = '11573908151' )
( row = '7036135044' )
( row = '7205760480' )
( row = '7944725459' )
( row = '9423313379' )
( row = '8630542582' )
( row = '8790644010' )
( row = '17868127070' )
( row = '8724802856' )
( row = '9408545681' )
( row = '9982367386' )
( row = '10453471098' )
( row = '9517573653' )
( row = '11079261335' )
( row = '12792395910' )
( row = '18253972919' )
( row = '12272822015' )
( row = '13400138200' )
( row = '13233894972' )
( row = '13029936900' )
( row = '13262438409' )
( row = '14912944949' )
( row = '14004354534' )
( row = '27677286298' )
( row = '17188127866' )
( row = '20436273244' )
( row = '14241895524' )
( row = '21790395668' )
( row = '20502574714' )
( row = '17421186592' )
( row = '19499941039' )
( row = '17515446866' )
( row = '25912930722' )
( row = '23687366070' )
( row = '18926119334' )
( row = '20435838484' )
( row = '25672960215' )
( row = '24109198235' )
( row = '44865414164' )
( row = '25065217925' )
( row = '25302758915' )
( row = '25506716987' )
( row = '26263831872' )
( row = '30683625001' )
( row = '27034291434' )
( row = '27504333933' )
( row = '28246250058' )
( row = '31192482400' )
( row = '48104811593' )
( row = '36921127631' )
( row = '33168014858' )
( row = '31663082116' )
( row = '42486404517' )
( row = '34936633458' )
( row = '43188407081' )
( row = '50683461724' )
( row = '36441566200' )
( row = '43991337259' )
( row = '81786541795' )
( row = '39361957818' )
( row = '44545036719' )
( row = '49174416160' )
( row = '49411957150' )
( row = '61876107401' )
( row = '50367976840' )
( row = '53549008973' )
( row = '51770548859' )
( row = '53298123306' )
( row = '54538625367' )
( row = '55280541492' )
( row = '59909332174' )
( row = '84348590608' )
( row = '87706640225' )
( row = '64831096974' )
( row = '82346543840' )
( row = '71025039934' )
( row = '66599715574' )
( row = '71378199658' )
( row = '126331578514' )
( row = '75803524018' )
( row = '121746176498' )
( row = '93956993869' )
( row = '115923236377' )
( row = '89729934658' )
( row = '83906994537' )
( row = '93719452879' )
( row = '143131410029' )
( row = '99779933990' )
( row = '102138525699' )
( row = '136119139467' )
( row = '125563665301' )
( row = '106309174226' )
( row = '107836748673' )
( row = '109819166859' )
( row = '115189873666' )
( row = '126509047748' )
( row = '185622690877' )
( row = '147177640814' )
( row = '131430812548' )
( row = '287761216576' )
( row = '137624755508' )
( row = '192931294088' )
( row = '165533458676' )
( row = '159710518555' )
( row = '177626447416' )
( row = '201793742542' )
( row = '173636929195' )
( row = '183449387537' )
( row = '183686928527' )
( row = '186045520236' )
( row = '193499386869' )
( row = '206089108216' )
( row = '217655915532' )
( row = '208447699925' )
( row = '407882850758' )
( row = '423745023748' )
( row = '232818221974' )
( row = '239267561221' )
( row = '300145976943' )
( row = '241698921414' )
( row = '314880200085' )
( row = '269055568056' )
( row = '330627028351' )
( row = '291141331103' )
( row = '353209905424' )
( row = '343159906092' )
( row = '392134628452' )
( row = '325243977231' )
( row = '351263376611' )
( row = '363671967652' )
( row = '357086316732' )
( row = '416505150501' )
( row = '367136316064' )
( row = '399588495085' )
( row = '394493220161' )
( row = '745756596772' )
( row = '414536808141' )
( row = '426103615457' )
( row = '441265921899' )
( row = '472085783195' )
( row = '584858827506' )
( row = '474517143388' )
( row = '592477466645' )
( row = '709373420246' )
( row = '510754489470' )
( row = '783641466565' )
( row = '560196899159' )
( row = '841653459452' )
( row = '616385308334' )
( row = '694423282703' )
( row = '719737197392' )
( row = '676507353842' )
( row = '886622591336' )
( row = '720758284384' )
( row = '724222632796' )
( row = '1071000574003' )
( row = '810998370662' )
( row = '1010962442963' )
( row = '794081715246' )
( row = '1208618523387' )
( row = '1150639342145' )
( row = '1001462821058' )
( row = '867369537356' )
( row = '915783065287' )
( row = '946602926583' )
( row = '985271632858' )
( row = '1034714042547' )
( row = '1176582207493' )
( row = '1070951388629' )
( row = '1127139797804' )
( row = '1587106734748' )
( row = '1812461191720' )
( row = '2502889800035' )
( row = '1292892662176' )
( row = '1370930636545' )
( row = '1396244551234' )
( row = '1607380875720' )
( row = '3537603842582' )
( row = '1444980917180' )
( row = '1795174021425' )
( row = '1938370111359' )
( row = '1661451252602' )
( row = '1709864780533' )
( row = '2086974377422' )
( row = '1950497107834' )
( row = '1813972463939' )
( row = '1783152602643' )
( row = '2105665431176' )
( row = '1986734453916' )
( row = '1931874559441' )
( row = '2019985675405' )
( row = '3108456766934' )
( row = '2198091186433' )
( row = '2788591050406' )
( row = '2420032459980' )
( row = '2689137213410' )
( row = '3769887056559' )
( row = '4136461297792' )
( row = '2663823298721' )
( row = '2767175187779' )
( row = '3003625426954' )
( row = '4056162539010' )
( row = '3106432169782' )
( row = '3228133519823' )
( row = '3371316033135' )
( row = '3733649710477' )
( row = '4887228399843' )
( row = '3493017383176' )
( row = '3597125066582' )
( row = '5109290858130' )
( row = '3803138278048' )
( row = '5917270733233' )
( row = '4125651106581' )
( row = '3951860234846' )
( row = '4129965745874' )
( row = '4218076861838' )
( row = '4618123646413' )
( row = '4861914485154' )
( row = '5109169673390' )
( row = '7773114156851' )
( row = '6156840681897' )
( row = '6840081880259' )
( row = '5430998486500' )
( row = '5667448725675' )
( row = '6500824898256' )
( row = '6110057596736' )
( row = '6721150902999' )
( row = '10235708703317' )
( row = '7446210381661' )
( row = '6968441099717' )
( row = '7090142449758' )
( row = '8743774752994' )
( row = '7296155661224' )
( row = '7400263344630' )
( row = '8912307951438' )
( row = '8665052763202' )
( row = '8077511341427' )
( row = '8081825980720' )
( row = '9079991346992' )
( row = '15069148633335' )
( row = '10374917543735' )
( row = '13510320941366' )
( row = '9971084158544' )
( row = '11219227270126' )
( row = '14917593221686' )
( row = '12271080366759' )
( row = '11098447212175' )
( row = '12168273623931' )
( row = '11777506322411' )
( row = '12610882494992' )
( row = '12831208499735' )
( row = '13689592002716' )
( row = '14058583549475' )
( row = '14264596760941' )
( row = '14368704444347' )
( row = '14386298110982' )
( row = '14696419005854' )
( row = '23369527578934' )
( row = '20231471844365' )
( row = '16159337322147' )
( row = '24824390085349' )
( row = '25915646275980' )
( row = '26997180605974' )
( row = '25678594565297' )
( row = '22242164525303' )
( row = '22802292658279' )
( row = '22139357782475' )
( row = '21069531370719' )
( row = '22317674482301' )
( row = '22875953534586' )
( row = '25442090994727' )
( row = '28961015766795' )
( row = '25836089871886' )
( row = '26042103083352' )
( row = '26300474497708' )
( row = '40284350720327' )
( row = '28755002555329' )
( row = '28323180310416' )
( row = '35334128131660' )
( row = '51203180292098' )
( row = '36525655893457' )
( row = '45044457183582' )
( row = '45193628016887' )
( row = '36390809166512' )
( row = '42074983598127' )
( row = '48153764354187' )
( row = '43311695896022' )
( row = '49176428032294' )
( row = '43208889153194' )
( row = '43387205853020' )
( row = '43871824028998' )
( row = '44457032264776' )
( row = '73989854226073' )
( row = '47759765477028' )
( row = '48318044529313' )
( row = '51278180866613' )
( row = '54591092427215' )
( row = '69044979025080' )
( row = '52342577581060' )
( row = '54623654808124' )
( row = '57078182865745' )
( row = '76082945787444' )
( row = '92610796618963' )
( row = '71724937298172' )
( row = '72916465059969' )
( row = '78465792764639' )
( row = '79599698319706' )
( row = '81584437183399' )
( row = '79702505062534' )
( row = '122092893092263' )
( row = '86596095006214' )
( row = '86520585049216' )
( row = '87080713182192' )
( row = '96799609845836' )
( row = '87259029882018' )
( row = '99080687072900' ) ).
DATA: lv_checked TYPE abap_bool VALUE abap_false,
lv_current_index TYPE i VALUE 0.
" Task 1
LOOP AT lv_input INTO wa_input.
IF lines( lv_input ) GE ( sy-tabix + 25 ).
lv_checked = abap_false.
lv_current_index = sy-tabix + 25.
READ TABLE lv_input INTO DATA(wa_cur_result) INDEX lv_current_index.
" Go through the preamble
DO 25 TIMES.
DATA(lv_cur_index_a) = sy-index.
DO 25 TIMES.
DATA(lv_cur_index_b) = sy-index.
READ TABLE lv_input INTO DATA(lv_number_a) INDEX lv_current_index - lv_cur_index_a.
READ TABLE lv_input INTO DATA(lv_number_b) INDEX lv_current_index - lv_cur_index_b.
DATA(lv_check_result) = lv_number_a-row + lv_number_b-row.
IF lv_check_result EQ wa_cur_result-row.
lv_checked = abap_true.
EXIT.
ENDIF.
ENDDO.
IF lv_checked EQ abap_true.
EXIT.
ENDIF.
ENDDO.
IF lv_checked EQ abap_false.
WRITE: 'Task 1 - Found value: ' && wa_cur_result-row.
EXIT.
ENDIF.
ELSE.
EXIT.
ENDIF.
ENDLOOP.
" Task 2
LOOP AT lv_input INTO DATA(wa_input_a).
DATA(lv_cur_range) = sy-tabix.
LOOP AT lv_input INTO DATA(wa_input_b).
DATA(lv_cur_range_sum) = 0.
DATA(lv_cur_range_index) = sy-tabix.
DO lv_cur_range TIMES.
READ TABLE lv_input INTO DATA(lv_cur_num) INDEX ( sy-index + lv_cur_range_index - 1 ).
IF sy-index EQ 1.
DATA(lv_cur_range_start) = lv_cur_num-row.
ENDIF.
lv_cur_range_sum = lv_cur_range_sum + lv_cur_num-row.
ENDDO.
DATA(lv_cur_range_end) = lv_cur_num-row.
IF lv_cur_range_sum EQ wa_cur_result-row.
EXIT.
ENDIF.
ENDLOOP.
IF lv_cur_range_sum EQ wa_cur_result-row.
EXIT.
ENDIF.
ENDLOOP.
DATA(lv_result) = lv_cur_range_start + lv_cur_range_end.
WRITE: 'Task 2 - Found range sum: ' && lv_result && ' (' && lv_cur_range_start && '-' && lv_cur_range_start && ')'.
| 22.451673 | 115 | 0.515067 |
f73c7613195632d2c87c14333d7e5b6272d854ea | 1,039 | abap | ABAP | src/zcx_idoc_data_not_for_send.clas.abap | engswee/equalize-idoc-framework | 0d08659a9633d7c54be5da959d7839ce4c38fb8f | [
"MIT"
] | 1 | 2019-04-23T07:12:21.000Z | 2019-04-23T07:12:21.000Z | src/zcx_idoc_data_not_for_send.clas.abap | engswee/equalize-idoc-framework | 0d08659a9633d7c54be5da959d7839ce4c38fb8f | [
"MIT"
] | null | null | null | src/zcx_idoc_data_not_for_send.clas.abap | engswee/equalize-idoc-framework | 0d08659a9633d7c54be5da959d7839ce4c38fb8f | [
"MIT"
] | null | null | null | class ZCX_IDOC_DATA_NOT_FOR_SEND definition
public
inheriting from CX_STATIC_CHECK
final
create public .
public section.
*"* public components of class ZCX_IDOC_DATA_NOT_FOR_SEND
*"* do not include other source files here!!!
constants ZCX_IDOC_DATA_NOT_FOR_SEND type SOTR_CONC value '00505697691A1ED98BBA9DB88013C51D' ##NO_TEXT.
data MSG type STRING .
methods CONSTRUCTOR
importing
!TEXTID like TEXTID optional
!PREVIOUS like PREVIOUS optional
!MSG type STRING optional .
protected section.
*"* protected components of class ZCX_IDOC_DATA_NOT_FOR_SEND
*"* do not include other source files here!!!
private section.
*"* private components of class ZCX_IDOC_DATA_NOT_FOR_SEND
*"* do not include other source files here!!!
ENDCLASS.
CLASS ZCX_IDOC_DATA_NOT_FOR_SEND IMPLEMENTATION.
method CONSTRUCTOR.
CALL METHOD SUPER->CONSTRUCTOR
EXPORTING
TEXTID = TEXTID
PREVIOUS = PREVIOUS
.
IF textid IS INITIAL.
me->textid = ZCX_IDOC_DATA_NOT_FOR_SEND .
ENDIF.
me->MSG = MSG .
endmethod.
ENDCLASS.
| 23.613636 | 105 | 0.775746 |
f73ea22c8aa6ae99a06e4f3304bdf45bd84922b8 | 6,951 | abap | ABAP | final_release/src/zex_f01.abap | abeljohny/ZEX_HTML_EDITOR | a8d43aeae35072ba118e55b987fe16a392fee0b3 | [
"MIT"
] | 2 | 2018-03-12T20:42:22.000Z | 2019-05-06T14:19:10.000Z | final_release/src/zex_f01.abap | abeljohny/ZEX_HTML_EDITOR | a8d43aeae35072ba118e55b987fe16a392fee0b3 | [
"MIT"
] | null | null | null | final_release/src/zex_f01.abap | abeljohny/ZEX_HTML_EDITOR | a8d43aeae35072ba118e55b987fe16a392fee0b3 | [
"MIT"
] | null | null | null | *----------------------------------------------------------------------*
*INCLUDE ZEX_F01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form create_instances
*&---------------------------------------------------------------------*
FORM create_instances .
IF editor IS INITIAL.
* create instance for HTML Editor custom control
CREATE OBJECT editor
EXPORTING
container_name = c_editor
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 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.
ENDIF.
IF g_editor IS INITIAL.
* create instance for HTML Editor text editor
CREATE OBJECT g_editor
EXPORTING
wordwrap_mode = cl_gui_textedit=>wordwrap_at_windowborder
wordwrap_to_linebreak_mode = cl_gui_textedit=>true
parent = editor
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
gui_type_not_supported = 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.
ENDIF.
PERFORM create_viewer_instances.
ENDFORM. " create_instances
*&---------------------------------------------------------------------*
*& Form display_initial
*&---------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM display_initial .
IF html_viewer IS NOT INITIAL.
REFRESH g_text.
APPEND '<HTML><BODY><H4>Press Execute HTML(F5) to view your HTML Output!</H4></BODY></HTML>'
TO g_text.
CALL METHOD html_viewer->load_data
IMPORTING
assigned_url = url
CHANGING
data_table = g_text
EXCEPTIONS
dp_invalid_parameter = 1
dp_error_general = 2
cntl_error = 3
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.
CALL METHOD html_viewer->show_url
EXPORTING
url = url
EXCEPTIONS
cntl_error = 1
cnht_error_not_allowed = 2
cnht_error_parameter = 3
dp_error_general = 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.
ENDIF.
ENDIF.
ENDFORM. " display_initial
*&---------------------------------------------------------------------*
*& Form check_editor_initial
*&---------------------------------------------------------------------*
FORM check_editor_initial .
IF g_editor IS NOT INITIAL.
CALL METHOD g_editor->get_text_as_stream
IMPORTING
text = g_text
EXCEPTIONS
error_dp = 1
error_cntl_call_method = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF g_text IS NOT INITIAL.
CALL FUNCTION 'C14A_POPUP_SAVE_BEFORE_ACTION'
EXPORTING
i_text1 = 'Unsaved Data will be lost.'
IMPORTING
e_continue = g_continue.
IF g_continue = 'X'.
LEAVE PROGRAM.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " check_editor_initial
*&---------------------------------------------------------------------*
*& Form EXEC_HTML
*&---------------------------------------------------------------------*
FORM exec_html .
DATA: url TYPE c LENGTH 255.
PERFORM free_instances.
REFRESH g_text.
PERFORM create_viewer_instances.
CALL METHOD g_editor->get_text_as_stream
IMPORTING
text = g_text
EXCEPTIONS
error_dp = 1
error_cntl_call_method = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF g_text IS INITIAL.
PERFORM display_initial.
EXIT.
ENDIF.
CALL METHOD html_viewer->load_data " generate url
IMPORTING
assigned_url = url
CHANGING
data_table = g_text
EXCEPTIONS
dp_invalid_parameter = 1
dp_error_general = 2
cntl_error = 3
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.
html_viewer->show_url( url = url ). " display HTML o/p
ENDFORM. " EXEC_HTML
*&---------------------------------------------------------------------*
*& Form free_instances
*&---------------------------------------------------------------------*
FORM free_instances .
IF html_viewer IS NOT INITIAL.
CALL METHOD html_viewer->free.
FREE html_viewer.
ENDIF.
IF viewer IS NOT INITIAL.
CALL METHOD viewer->free.
FREE viewer.
ENDIF.
ENDFORM. " free_instances
*&---------------------------------------------------------------------*
*& Form CREATE_VIEWER_INSTANCES
*&---------------------------------------------------------------------*
FORM create_viewer_instances .
IF viewer IS INITIAL.
CREATE OBJECT viewer
EXPORTING
container_name = c_viewer
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 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.
ENDIF.
CREATE OBJECT html_viewer
EXPORTING
parent = viewer
EXCEPTIONS
cntl_error = 1
cntl_install_error = 2
dp_install_error = 3
dp_error = 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.
ENDIF.
ENDFORM. " CREATE_VIEWER_INSTANCES
| 33.907317 | 96 | 0.470148 |
f73f763c8ae884165da019edda792eb97f109bb6 | 1,623 | abap | ABAP | src/zdbgl_get_locals.clas.abap | germanysources/regression_test | 41bca2f67036fbf89b56a0cc83ec5fcb41d95edc | [
"MIT"
] | 6 | 2019-12-09T16:47:39.000Z | 2022-02-23T15:16:05.000Z | src/zdbgl_get_locals.clas.abap | germanysources/regression_test | 41bca2f67036fbf89b56a0cc83ec5fcb41d95edc | [
"MIT"
] | 2 | 2020-01-14T17:50:27.000Z | 2020-11-10T12:21:24.000Z | src/zdbgl_get_locals.clas.abap | germanysources/regression_test | 41bca2f67036fbf89b56a0cc83ec5fcb41d95edc | [
"MIT"
] | 2 | 2021-01-05T11:38:44.000Z | 2021-12-10T10:33:30.000Z | class ZDBGL_GET_LOCALS definition
public
INHERITING FROM zdbgl_getter
final
create public .
public section.
TYPES: BEGIN OF _source_position,
abap_program TYPE tpda_program,
include TYPE tpda_include,
line TYPE tpda_sc_line,
END OF _source_position.
class-methods FACTORY
IMPORTING
key_testcase TYPE zdbgl_key_testcases
source_position TYPE _source_position
RETURNING VALUE(instance) TYPE REF TO zdbgl_get_locals
RAISING
zcx_dbgl_testcase.
protected section.
private section.
ENDCLASS.
CLASS ZDBGL_GET_LOCALS IMPLEMENTATION.
method FACTORY.
TYPES: BEGIN OF _record,
locals TYPE zdbgl_locals-locals,
END OF _record.
DATA: full_record TYPE STANDARD TABLE OF _record,
locals_json_string TYPE string,
record TYPE REF TO _record.
SELECT locals FROM zdbgl_locals
INTO CORRESPONDING FIELDS OF TABLE @full_record
WHERE abap_program = @source_position-abap_program
AND include = @source_position-include AND line = @source_position-line
AND key_testcase = @key_testcase.
IF sy-subrc <> 0.
RAISE EXCEPTION TYPE zcx_dbgl_testcase
EXPORTING
textid = zcx_dbgl_testcase=>testcase_not_found
key_testcase = key_testcase
program = source_position-abap_program.
ENDIF.
LOOP AT full_record REFERENCE INTO record.
locals_json_string = locals_json_string &&
record->*-locals.
ENDLOOP.
CREATE OBJECT instance
EXPORTING
values = locals_json_string
program = source_position-abap_program.
endmethod.
ENDCLASS.
| 25.761905 | 77 | 0.720271 |
f7409c204802080a4e46031b2bce25bc8dbd73b8 | 25,190 | abap | ABAP | src/objects/zcl_abapgit_object_tran.clas.abap | Fmueller17/abapGit | 0db2c9c0859403330726fc64913e133c854f2667 | [
"MIT"
] | 1 | 2022-01-19T05:10:00.000Z | 2022-01-19T05:10:00.000Z | src/objects/zcl_abapgit_object_tran.clas.abap | Fmueller17/abapGit | 0db2c9c0859403330726fc64913e133c854f2667 | [
"MIT"
] | null | null | null | src/objects/zcl_abapgit_object_tran.clas.abap | Fmueller17/abapGit | 0db2c9c0859403330726fc64913e133c854f2667 | [
"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( )-main_language_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 = iv_package
iv_transport = iv_transport ).
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.
zcl_abapgit_ui_factory=>get_gui_jumper( )->jump_batch_input(
iv_tcode = 'SE93'
it_bdcdata = lt_bdcdata ).
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.176734 | 102 | 0.595117 |
f7413ec96dcef18660c1c9193a3bf5ceb94585a0 | 10,730 | abap | ABAP | src/ui/zcl_abapgit_gui_page_tag.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_tag.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_tag.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 167 | 2020-09-24T18:31:37.000Z | 2022-03-24T10:07:04.000Z | CLASS zcl_abapgit_gui_page_tag DEFINITION PUBLIC FINAL
CREATE PUBLIC INHERITING FROM zcl_abapgit_gui_page.
PUBLIC SECTION.
CONSTANTS: BEGIN OF c_action,
commit_post TYPE string VALUE 'commit_post',
commit_cancel TYPE string VALUE 'commit_cancel',
change_tag_type TYPE string VALUE 'change_tag_type',
END OF c_action.
METHODS:
constructor
IMPORTING io_repo TYPE REF TO zcl_abapgit_repo
RAISING zcx_abapgit_exception,
zif_abapgit_gui_event_handler~on_event REDEFINITION.
PROTECTED SECTION.
METHODS:
render_content REDEFINITION.
PRIVATE SECTION.
CONSTANTS:
BEGIN OF c_tag_type,
lightweight TYPE string VALUE 'lightweight',
annotated TYPE string VALUE 'annotated',
END OF c_tag_type .
DATA mo_repo_online TYPE REF TO zcl_abapgit_repo_online .
DATA mv_selected_type TYPE string .
METHODS render_menu
RETURNING
VALUE(ri_html) TYPE REF TO zif_abapgit_html .
METHODS render_form
RETURNING
VALUE(ri_html) TYPE REF TO zif_abapgit_html
RAISING
zcx_abapgit_exception .
METHODS render_text_input
IMPORTING
!iv_name TYPE string
!iv_label TYPE string
!iv_value TYPE string OPTIONAL
!iv_max_length TYPE string OPTIONAL
RETURNING
VALUE(ri_html) TYPE REF TO zif_abapgit_html .
METHODS create_tag
IMPORTING
!ii_event TYPE REF TO zif_abapgit_gui_event
RAISING
zcx_abapgit_exception .
METHODS parse_tag_request
IMPORTING
!ii_event TYPE REF TO zif_abapgit_gui_event
RETURNING
VALUE(rs_git_tag) TYPE zif_abapgit_definitions=>ty_git_tag
RAISING
zcx_abapgit_exception .
METHODS parse_change_tag_type_request
IMPORTING
!it_postdata TYPE zif_abapgit_html_viewer=>ty_post_data .
METHODS render_scripts
RETURNING
VALUE(ri_html) TYPE REF TO zif_abapgit_html
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS ZCL_ABAPGIT_GUI_PAGE_TAG IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
mo_repo_online ?= io_repo.
ms_control-page_title = 'Tag'.
mv_selected_type = c_tag_type-lightweight.
ENDMETHOD.
METHOD create_tag.
DATA:
ls_tag TYPE zif_abapgit_definitions=>ty_git_tag,
lx_error TYPE REF TO zcx_abapgit_exception,
lv_text TYPE string.
ls_tag = parse_tag_request( ii_event ).
IF ls_tag-name IS INITIAL.
zcx_abapgit_exception=>raise( |Please supply a tag name| ).
ENDIF.
ls_tag-name = zcl_abapgit_git_tag=>add_tag_prefix( ls_tag-name ).
ASSERT ls_tag-name CP zif_abapgit_definitions=>c_git_branch-tags.
CASE mv_selected_type.
WHEN c_tag_type-lightweight.
ls_tag-type = zif_abapgit_definitions=>c_git_branch_type-lightweight_tag.
WHEN c_tag_type-annotated.
ls_tag-type = zif_abapgit_definitions=>c_git_branch_type-annotated_tag.
WHEN OTHERS.
zcx_abapgit_exception=>raise( |Invalid tag type: { mv_selected_type }| ).
ENDCASE.
TRY.
zcl_abapgit_git_porcelain=>create_tag( iv_url = mo_repo_online->get_url( )
is_tag = ls_tag ).
CATCH zcx_abapgit_exception INTO lx_error.
zcx_abapgit_exception=>raise( |Cannot create tag { ls_tag-name }. Error: '{ lx_error->get_text( ) }'| ).
ENDTRY.
IF ls_tag-type = zif_abapgit_definitions=>c_git_branch_type-lightweight_tag.
lv_text = |Lightweight tag { zcl_abapgit_git_tag=>remove_tag_prefix( ls_tag-name ) } created|.
ELSEIF ls_tag-type = zif_abapgit_definitions=>c_git_branch_type-annotated_tag.
lv_text = |Annotated tag { zcl_abapgit_git_tag=>remove_tag_prefix( ls_tag-name ) } created|.
ENDIF.
MESSAGE lv_text TYPE 'S'.
ENDMETHOD.
METHOD parse_change_tag_type_request.
FIELD-SYMBOLS <lv_postdata> LIKE LINE OF it_postdata.
READ TABLE it_postdata ASSIGNING <lv_postdata> INDEX 1.
IF sy-subrc = 0.
FIND FIRST OCCURRENCE OF REGEX `type=(.*)` IN <lv_postdata> SUBMATCHES mv_selected_type.
ENDIF.
mv_selected_type = condense( mv_selected_type ).
ENDMETHOD.
METHOD parse_tag_request.
DATA lo_map TYPE REF TO zcl_abapgit_string_map.
lo_map = ii_event->form_data( ).
lo_map->strict( abap_false ). " Hack, refactor !
lo_map->to_abap( CHANGING cs_container = rs_git_tag ).
REPLACE ALL OCCURRENCES
OF zif_abapgit_definitions=>c_crlf
IN rs_git_tag-body
WITH zif_abapgit_definitions=>c_newline.
ENDMETHOD.
METHOD render_content.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->add( '<div class="repo">' ).
ri_html->add( render_menu( ) ).
ri_html->add( render_form( ) ).
ri_html->add( '</div>' ).
register_deferred_script( render_scripts( ) ).
ENDMETHOD.
METHOD render_form.
CONSTANTS: lc_body_col_max TYPE i VALUE 150.
DATA: li_user TYPE REF TO zif_abapgit_persist_user,
lv_user TYPE string,
lv_email TYPE string,
lv_s_param TYPE string,
lo_settings TYPE REF TO zcl_abapgit_settings,
lv_body_size TYPE i,
lt_type TYPE string_table,
lv_selected TYPE string.
FIELD-SYMBOLS: <lv_type> LIKE LINE OF lt_type.
li_user = zcl_abapgit_persistence_user=>get_instance( ).
lv_user = li_user->get_repo_git_user_name( mo_repo_online->get_url( ) ).
IF lv_user IS INITIAL.
lv_user = li_user->get_default_git_user_name( ).
ENDIF.
IF lv_user IS INITIAL.
" get default from user record
lv_user = zcl_abapgit_user_record=>get_instance( sy-uname )->get_name( ).
ENDIF.
lv_email = li_user->get_repo_git_user_email( mo_repo_online->get_url( ) ).
IF lv_email IS INITIAL.
lv_email = li_user->get_default_git_user_email( ).
ENDIF.
IF lv_email IS INITIAL.
" get default from user record
lv_email = zcl_abapgit_user_record=>get_instance( sy-uname )->get_email( ).
ENDIF.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->add( '<div class="form-container">' ).
ri_html->add( '<form id="commit_form" class="aligned-form grey70"'
&& ' method="post" action="sapevent:commit_post">' ).
INSERT c_tag_type-lightweight
INTO TABLE lt_type.
INSERT c_tag_type-annotated
INTO TABLE lt_type.
ri_html->add( '<div class="row">' ).
ri_html->add( 'Tag type <select name="folder_logic" onchange="onTagTypeChange(this)">' ).
LOOP AT lt_type ASSIGNING <lv_type>.
IF mv_selected_type = <lv_type>.
lv_selected = 'selected'.
ELSE.
CLEAR: lv_selected.
ENDIF.
ri_html->add( |<option value="{ <lv_type> }" | && |{ lv_selected }>| && |{ <lv_type> }</option>| ).
ENDLOOP.
ri_html->add( '</div>' ).
ri_html->add( '</select>' ).
ri_html->add( '<br>' ).
ri_html->add( '<br>' ).
ri_html->add( render_text_input( iv_name = 'sha1'
iv_label = 'SHA1'
iv_value = mo_repo_online->get_current_remote( ) ) ).
ri_html->add( render_text_input( iv_name = 'name'
iv_label = 'tag name' ) ).
IF mv_selected_type = c_tag_type-annotated.
ri_html->add( render_text_input( iv_name = 'tagger_name'
iv_label = 'tagger name'
iv_value = lv_user ) ).
ri_html->add( render_text_input( iv_name = 'tagger_email'
iv_label = 'tagger e-mail'
iv_value = lv_email ) ).
lo_settings = zcl_abapgit_persist_factory=>get_settings( )->read( ).
lv_s_param = lo_settings->get_commitmsg_comment_length( ).
ri_html->add( render_text_input( iv_name = 'message'
iv_label = 'message'
iv_max_length = lv_s_param ) ).
ri_html->add( '<div class="row">' ).
ri_html->add( '<label for="c-body">body</label>' ).
lv_body_size = lo_settings->get_commitmsg_body_size( ).
IF lv_body_size > lc_body_col_max.
lv_body_size = lc_body_col_max.
ENDIF.
ri_html->add( |<textarea id="c-body" name="body" rows="10" cols="{ lv_body_size }"></textarea>| ).
ENDIF.
ri_html->add( '<input type="submit" class="hidden-submit">' ).
ri_html->add( '</div>' ).
ri_html->add( '</form>' ).
ri_html->add( '</div>' ).
ENDMETHOD.
METHOD render_menu.
DATA lo_toolbar TYPE REF TO zcl_abapgit_html_toolbar.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
CREATE OBJECT lo_toolbar.
lo_toolbar->add( iv_act = 'submitFormById(''commit_form'');'
iv_txt = 'Create'
iv_typ = zif_abapgit_html=>c_action_type-onclick
iv_opt = zif_abapgit_html=>c_html_opt-strong ).
lo_toolbar->add( iv_act = c_action-commit_cancel
iv_txt = 'Cancel'
iv_opt = zif_abapgit_html=>c_html_opt-cancel ).
ri_html->add( '<div class="paddings">' ).
ri_html->add( lo_toolbar->render( ) ).
ri_html->add( '</div>' ).
ENDMETHOD.
METHOD render_scripts.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
ri_html->set_title( cl_abap_typedescr=>describe_by_object_ref( me )->get_relative_name( ) ).
ri_html->add( 'setInitialFocus("name");' ).
ENDMETHOD.
METHOD render_text_input.
DATA lv_attrs TYPE string.
CREATE OBJECT ri_html TYPE zcl_abapgit_html.
IF iv_value IS NOT INITIAL.
lv_attrs = | value="{ iv_value }"|.
ENDIF.
IF iv_max_length IS NOT INITIAL.
lv_attrs = | maxlength="{ iv_max_length }"|.
ENDIF.
ri_html->add( '<div class="row">' ).
ri_html->add( |<label for="{ iv_name }">{ iv_label }</label>| ).
ri_html->add( |<input id="{ iv_name }" name="{ iv_name }" type="text"{ lv_attrs }>| ).
ri_html->add( '</div>' ).
ENDMETHOD.
METHOD zif_abapgit_gui_event_handler~on_event.
CASE ii_event->mv_action.
WHEN c_action-commit_post.
create_tag( ii_event ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-go_back.
WHEN c_action-change_tag_type.
parse_change_tag_type_request( ii_event->mt_postdata ).
rs_handled-state = zcl_abapgit_gui=>c_event_state-re_render.
WHEN c_action-commit_cancel.
rs_handled-state = zcl_abapgit_gui=>c_event_state-go_back.
ENDCASE.
ENDMETHOD.
ENDCLASS.
| 29.078591 | 112 | 0.642777 |
f74532499ffd342f4a5fb8748a1b0d4ce387d695 | 694 | abap | ABAP | objects/CLAS/ZCL_ZGWSO_DPC_EXT/CLSD ZCL_ZGWSO_DPC_EXT.abap | abhilashhaa/HCL_Githup | 454be7f157c72fbb75550dea67c9167e405a4fdb | [
"Apache-2.0"
] | null | null | null | objects/CLAS/ZCL_ZGWSO_DPC_EXT/CLSD ZCL_ZGWSO_DPC_EXT.abap | abhilashhaa/HCL_Githup | 454be7f157c72fbb75550dea67c9167e405a4fdb | [
"Apache-2.0"
] | null | null | null | objects/CLAS/ZCL_ZGWSO_DPC_EXT/CLSD ZCL_ZGWSO_DPC_EXT.abap | abhilashhaa/HCL_Githup | 454be7f157c72fbb75550dea67c9167e405a4fdb | [
"Apache-2.0"
] | null | null | null | class-pool .
*"* class pool for class ZCL_ZGWSO_DPC_EXT
*"* local type definitions
include ZCL_ZGWSO_DPC_EXT=============ccdef.
*"* class ZCL_ZGWSO_DPC_EXT definition
*"* public declarations
include ZCL_ZGWSO_DPC_EXT=============cu.
*"* protected declarations
include ZCL_ZGWSO_DPC_EXT=============co.
*"* private declarations
include ZCL_ZGWSO_DPC_EXT=============ci.
endclass. "ZCL_ZGWSO_DPC_EXT definition
*"* macro definitions
include ZCL_ZGWSO_DPC_EXT=============ccmac.
*"* local class implementation
include ZCL_ZGWSO_DPC_EXT=============ccimp.
class ZCL_ZGWSO_DPC_EXT implementation.
*"* method's implementations
include methods.
endclass. "ZCL_ZGWSO_DPC_EXT implementation
| 27.76 | 44 | 0.726225 |
f7532b2ae43780a7810db0f751386f3456db3171 | 11,675 | abap | ABAP | src/objects/zcl_abapgit_object_chdo.clas.abap | ed-holland/abapGit | 380508d72c02f37f15344165411fc5a145f73e72 | [
"MIT"
] | 1 | 2018-05-11T09:36:31.000Z | 2018-05-11T09:36:31.000Z | src/objects/zcl_abapgit_object_chdo.clas.abap | ed-holland/abapGit | 380508d72c02f37f15344165411fc5a145f73e72 | [
"MIT"
] | null | null | null | src/objects/zcl_abapgit_object_chdo.clas.abap | ed-holland/abapGit | 380508d72c02f37f15344165411fc5a145f73e72 | [
"MIT"
] | 2 | 2016-12-14T09:31:45.000Z | 2018-03-27T12:00:44.000Z | CLASS zcl_abapgit_object_chdo 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.
METHODS after_import
RAISING
zcx_abapgit_exception .
METHODS delete_tadir_cdnames
IMPORTING
!is_cdnames TYPE cdnames
RAISING
zcx_abapgit_exception .
METHODS delete_tadir_tabl
IMPORTING
!is_tcdrs TYPE tcdrs
RAISING
zcx_abapgit_exception .
PRIVATE SECTION.
TYPES: BEGIN OF ty_change_document,
reports_generated TYPE SORTED TABLE OF tcdrps WITH UNIQUE KEY object reportname,
objects TYPE SORTED TABLE OF tcdobs WITH UNIQUE KEY object tabname,
objects_text TYPE SORTED TABLE OF tcdobts WITH UNIQUE KEY spras object,
END OF ty_change_document.
DATA: mv_object TYPE cdobjectcl.
ENDCLASS.
CLASS zcl_abapgit_object_chdo IMPLEMENTATION.
METHOD after_import.
DATA: lt_cts_object_entry TYPE STANDARD TABLE OF e071 WITH DEFAULT KEY,
ls_cts_object_entry LIKE LINE OF lt_cts_object_entry,
lt_errormsg TYPE STANDARD TABLE OF sprot_u WITH DEFAULT KEY.
ls_cts_object_entry-pgmid = seok_pgmid_r3tr.
ls_cts_object_entry-object = ms_item-obj_type.
ls_cts_object_entry-obj_name = ms_item-obj_name.
INSERT ls_cts_object_entry INTO TABLE lt_cts_object_entry.
CALL FUNCTION 'AFTER_IMP_CHDO'
EXPORTING
iv_tarclient = sy-mandt
iv_is_upgrade = abap_false
TABLES
tt_e071 = lt_cts_object_entry
tt_errormsg = lt_errormsg.
LOOP AT lt_errormsg TRANSPORTING NO FIELDS WHERE severity = 'E' OR severity = 'A'.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
zcx_abapgit_exception=>raise( 'Error from AFTER_IMP_CHDO' ).
ENDIF.
ENDMETHOD.
METHOD constructor.
super->constructor( is_item = is_item
iv_language = iv_language ).
mv_object = is_item-obj_name.
ENDMETHOD.
METHOD delete_tadir_cdnames.
DATA: lv_obj_name TYPE sobj_name.
IF is_cdnames-repnamec IS NOT INITIAL.
lv_obj_name = is_cdnames-repnamec.
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_delete_tadir_entry = abap_true
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = 'PROG'
wi_tadir_obj_name = lv_obj_name
wi_test_modus = abap_false
EXCEPTIONS
tadir_entry_not_existing = 1
OTHERS = 2.
IF sy-subrc > 1.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDIF.
IF is_cdnames-repnamet IS NOT INITIAL.
lv_obj_name = is_cdnames-repnamet.
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_delete_tadir_entry = abap_true
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = 'PROG'
wi_tadir_obj_name = lv_obj_name
wi_test_modus = abap_false
EXCEPTIONS
tadir_entry_not_existing = 1
OTHERS = 2.
IF sy-subrc > 1.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDIF.
IF is_cdnames-repnamefix IS NOT INITIAL.
lv_obj_name = is_cdnames-repnamefix.
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_delete_tadir_entry = abap_true
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = 'PROG'
wi_tadir_obj_name = lv_obj_name
wi_test_modus = abap_false
EXCEPTIONS
tadir_entry_not_existing = 1
OTHERS = 2.
IF sy-subrc > 1.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDIF.
IF is_cdnames-repnamevar IS NOT INITIAL.
lv_obj_name = is_cdnames-repnamevar.
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_delete_tadir_entry = abap_true
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = 'PROG'
wi_tadir_obj_name = lv_obj_name
wi_test_modus = abap_false
EXCEPTIONS
tadir_entry_not_existing = 1
OTHERS = 2.
IF sy-subrc > 1.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDIF.
IF is_cdnames-fgrp IS NOT INITIAL.
lv_obj_name = is_cdnames-fgrp.
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_delete_tadir_entry = abap_true
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = 'FUGR'
wi_tadir_obj_name = lv_obj_name
wi_test_modus = abap_false
EXCEPTIONS
tadir_entry_not_existing = 1
OTHERS = 2.
IF sy-subrc > 1.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDIF.
ENDMETHOD.
METHOD delete_tadir_tabl.
DATA: lv_obj_name TYPE sobj_name.
IF is_tcdrs-tabname IS NOT INITIAL.
lv_obj_name = is_tcdrs-tabname.
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_delete_tadir_entry = abap_true
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = 'TABL'
wi_tadir_obj_name = lv_obj_name
wi_test_modus = abap_false
EXCEPTIONS
tadir_entry_not_existing = 1
OTHERS = 2.
IF sy-subrc > 1.
zcx_abapgit_exception=>raise( |Error from TR_TADIR_INTERFACE (subrc={ sy-subrc } ).| ).
ENDIF.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
SELECT SINGLE updname INTO rv_user
FROM tcdrp
WHERE object = mv_object.
IF sy-subrc <> 0.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lt_cdnames TYPE STANDARD TABLE OF cdnames,
ls_cdnames TYPE cdnames,
lt_tcdrs TYPE STANDARD TABLE OF tcdrs,
ls_tcdrs TYPE tcdrs,
lv_msg TYPE symsgv.
CALL FUNCTION 'CDNAMES_GET'
EXPORTING
iv_object = mv_object
TABLES
it_tcdrs = lt_tcdrs
it_names = lt_cdnames
EXCEPTIONS
object_space = 1
object_not_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
CALL FUNCTION 'CHDO_DELETE'
EXPORTING
iv_object = mv_object
iv_with_tadir = abap_true
EXCEPTIONS
object_is_space = 1
object_not_found = 2
other_error = 3
OTHERS = 4.
IF sy-subrc <> 0.
lv_msg = mv_object.
zcx_abapgit_exception=>raise_t100( iv_msgid = 'CD'
iv_msgno = '869'
iv_msgv1 = lv_msg ).
ENDIF.
LOOP AT lt_cdnames INTO ls_cdnames.
delete_tadir_cdnames( ls_cdnames ).
ENDLOOP.
LOOP AT lt_tcdrs INTO ls_tcdrs.
delete_tadir_tabl( ls_tcdrs ).
ENDLOOP.
corr_insert( iv_package ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_change_object TYPE ty_change_document.
FIELD-SYMBOLS: <ls_report_generated> LIKE LINE OF ls_change_object-reports_generated.
io_xml->read( EXPORTING iv_name = 'CHDO'
CHANGING cg_data = ls_change_object ).
DELETE FROM tcdobs WHERE object = mv_object.
DELETE FROM tcdobts WHERE object = mv_object.
DELETE FROM tcdrps WHERE object = mv_object.
LOOP AT ls_change_object-reports_generated ASSIGNING <ls_report_generated>.
<ls_report_generated>-devclass = iv_package.
ENDLOOP.
INSERT tcdobs FROM TABLE ls_change_object-objects.
INSERT tcdobts FROM TABLE ls_change_object-objects_text.
INSERT tcdrps FROM TABLE ls_change_object-reports_generated.
tadir_insert( iv_package ).
after_import( ).
corr_insert( iv_package ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
SELECT COUNT(*)
FROM tcdrp
WHERE object = mv_object.
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 STANDARD TABLE OF bdcdata,
ls_bdcdata LIKE LINE OF lt_bdcdata.
CLEAR: ls_bdcdata.
ls_bdcdata-program = 'SAPMSCDO_NEW'.
ls_bdcdata-dynpro = '0100'.
ls_bdcdata-dynbegin = abap_true.
APPEND ls_bdcdata TO lt_bdcdata.
CLEAR: ls_bdcdata.
ls_bdcdata-fnam = 'TCDOB-OBJECT'.
ls_bdcdata-fval = mv_object.
APPEND ls_bdcdata TO lt_bdcdata.
CLEAR: ls_bdcdata.
ls_bdcdata-fnam = 'BDC_OKCODE'.
ls_bdcdata-fval = '=DISP'.
APPEND ls_bdcdata TO lt_bdcdata.
zcl_abapgit_ui_factory=>get_gui_jumper( )->jump_batch_input(
iv_tcode = 'SCDO'
it_bdcdata = lt_bdcdata ).
rv_exit = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: ls_change_object TYPE ty_change_document,
lt_tcdrp TYPE STANDARD TABLE OF tcdrp,
lt_tcdob TYPE STANDARD TABLE OF tcdob,
lt_tcdobt TYPE STANDARD TABLE OF tcdobt,
BEGIN OF ls_nulldatetime, " hack ro reset fields when they exist without syntax errors when they don't
udate TYPE sy-datum,
utime TYPE sy-uzeit,
END OF ls_nulldatetime.
FIELD-SYMBOLS: <ls_reports_generated> LIKE LINE OF ls_change_object-reports_generated,
<ls_objects> LIKE LINE OF ls_change_object-objects,
<ls_objects_text> LIKE LINE OF ls_change_object-objects_text.
CALL FUNCTION 'CDNAMES_GET'
EXPORTING
iv_object = mv_object
TABLES
it_tcdrp = lt_tcdrp
it_tcdob = lt_tcdob
it_tcdobt = lt_tcdobt
EXCEPTIONS
object_space = 1
object_not_found = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ls_change_object-reports_generated = lt_tcdrp.
ls_change_object-objects = lt_tcdob.
ls_change_object-objects_text = lt_tcdobt.
" At import, when CHDO is generated date & time change, so always detects changes for this fields
LOOP AT ls_change_object-reports_generated ASSIGNING <ls_reports_generated>.
CLEAR: <ls_reports_generated>-datum, <ls_reports_generated>-uzeit,
<ls_reports_generated>-author, <ls_reports_generated>-updname,
<ls_reports_generated>-devclass.
ENDLOOP.
LOOP AT ls_change_object-objects ASSIGNING <ls_objects>.
MOVE-CORRESPONDING ls_nulldatetime TO <ls_objects>. " reset date and time
ENDLOOP.
LOOP AT ls_change_object-objects_text ASSIGNING <ls_objects_text>.
MOVE-CORRESPONDING ls_nulldatetime TO <ls_objects_text>. " reset date and time
ENDLOOP.
io_xml->add( iv_name = 'CHDO'
ig_data = ls_change_object ).
ENDMETHOD.
ENDCLASS.
| 28.268765 | 112 | 0.630749 |
f756435351f61ec883aa76732ed8248d8f467073 | 459 | abap | ABAP | src/zca_umdi_r_uml_diagram_top.prog.abap | irodrigob/uml_diagram | cd7c1e66ead68a3f2b93fbd9015986ac0c3c7c9a | [
"MIT"
] | null | null | null | src/zca_umdi_r_uml_diagram_top.prog.abap | irodrigob/uml_diagram | cd7c1e66ead68a3f2b93fbd9015986ac0c3c7c9a | [
"MIT"
] | null | null | null | src/zca_umdi_r_uml_diagram_top.prog.abap | irodrigob/uml_diagram | cd7c1e66ead68a3f2b93fbd9015986ac0c3c7c9a | [
"MIT"
] | null | null | null | *&---------------------------------------------------------------------*
*& Include ZCA_UMDI_R_UML_DIAGRAM_TOP
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
* Variables
*----------------------------------------------------------------------*
DATA mv_object TYPE seoclass-clsname.
DATA mv_package TYPE devclass.
DATA mv_report TYPE reposrc-progname.
| 41.727273 | 72 | 0.287582 |
f756f28cc99495bff3f5639d58f4f0970cca11f6 | 750 | abap | ABAP | app/templates/screen9000pai.abap | diesire/abap-boilerplate-alv | 5385cadec46fe48cb0e7fbedc2f6cc63f81bed80 | [
"MIT"
] | null | null | null | app/templates/screen9000pai.abap | diesire/abap-boilerplate-alv | 5385cadec46fe48cb0e7fbedc2f6cc63f81bed80 | [
"MIT"
] | null | null | null | app/templates/screen9000pai.abap | diesire/abap-boilerplate-alv | 5385cadec46fe48cb0e7fbedc2f6cc63f81bed80 | [
"MIT"
] | null | null | null | *----------------------------------------------------------------------*
* MODULE exit_command_9000 INPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
module exit_command_9000 input.
perform exit.
endmodule. "exit_command_9000 INPUT
*----------------------------------------------------------------------*
* MODULE user_command_9000 INPUT
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
module user_command_9000 input.
perform process_okcode_9000 changing gv_okcode.
endmodule. "user_command_9000 INPUT | 44.117647 | 72 | 0.304 |
f7575051012a8cfeb10c1acca4a76d5f02427a6f | 220 | abap | ABAP | src/zatt_connector/zif_att_trace_connector.intf.abap | JohannesKonings/abap-trace-tender | 18cdefe29c3b4d1fe5f4c5a090cca41d234a7b97 | [
"MIT"
] | 7 | 2021-02-14T17:40:37.000Z | 2021-03-10T12:23:26.000Z | src/zatt_connector/zif_att_trace_connector.intf.abap | JohannesKonings/abap-trace-tender | 18cdefe29c3b4d1fe5f4c5a090cca41d234a7b97 | [
"MIT"
] | 150 | 2021-03-01T08:59:24.000Z | 2022-03-31T02:08:10.000Z | src/zatt_connector/zif_att_trace_connector.intf.abap | JohannesKonings/abap-trace-tender | 18cdefe29c3b4d1fe5f4c5a090cca41d234a7b97 | [
"MIT"
] | 2 | 2021-02-14T17:17:24.000Z | 2021-12-17T21:50:17.000Z | INTERFACE zif_att_trace_connector
PUBLIC.
METHODS connect
IMPORTING converted_trace TYPE zif_att_trace_converter=>ty_converted_trace
customizing TYPE REF TO zcl_att_customizing.
ENDINTERFACE.
| 24.444444 | 78 | 0.781818 |
f758166213a13dd4b79e662824448c2e262b7d58 | 737 | abap | ABAP | org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.shallowparser/abap/LSTPDA_BP_SERVICES.abap | assessorgeneral/ConQAT | 2a462f23f22c22aa9d01a7a204453d1be670ba60 | [
"Apache-2.0"
] | null | null | null | org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.shallowparser/abap/LSTPDA_BP_SERVICES.abap | assessorgeneral/ConQAT | 2a462f23f22c22aa9d01a7a204453d1be670ba60 | [
"Apache-2.0"
] | null | null | null | org.conqat.engine.sourcecode/test-data/org.conqat.engine.sourcecode.shallowparser/abap/LSTPDA_BP_SERVICES.abap | assessorgeneral/ConQAT | 2a462f23f22c22aa9d01a7a204453d1be670ba60 | [
"Apache-2.0"
] | null | null | null | MODULE get_focus INPUT.
CALL FUNCTION 'TPDA_GET_FOCUS'.
ENDMODULE. " get_focus INPUT
MODULE exit INPUT.
CLEAR dynp_vars-set_bp.
lcl_dynpro_0300=>clear( ).
CLEAR tpda_bp_cr.
CLEAR: it_statements, it_functions, it_bp_set.
CLEAR ok_code.
LEAVE TO SCREEN 0.
ENDMODULE. " exit INPUT
MODULE init OUTPUT.
IF init IS INITIAL.
init = 'X'.
tab_ctrl_bp_create-activetab = start_tab.
CLEAR wa_condition_0210.
CLEAR wa_condition_0220.
CLEAR wa_condition_0230.
CLEAR wa_condition_0250.
ENDIF.
ENDMODULE. " init OUTPUT
MODULE exit_800 INPUT.
cancel_800 = 'X'.
LEAVE TO SCREEN 0.
ENDMODULE. " exit_800 INPUT
| 25.413793 | 49 | 0.640434 |
f761d60d08361d1b5e5cc05b22dc62cc81aeaceb | 3,733 | abap | ABAP | src/objects/zcl_abapgit_object_acid.clas.abap | ravishankarojha/abapGit | 4bc4b63e0fcf5389457db5a36de643fe75977c2a | [
"MIT"
] | null | null | null | src/objects/zcl_abapgit_object_acid.clas.abap | ravishankarojha/abapGit | 4bc4b63e0fcf5389457db5a36de643fe75977c2a | [
"MIT"
] | null | null | null | src/objects/zcl_abapgit_object_acid.clas.abap | ravishankarojha/abapGit | 4bc4b63e0fcf5389457db5a36de643fe75977c2a | [
"MIT"
] | null | null | null | CLASS zcl_abapgit_object_acid DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
PROTECTED SECTION.
PRIVATE SECTION.
METHODS: create_object
RETURNING VALUE(ro_aab) TYPE REF TO cl_aab_id
RAISING zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_ACID IMPLEMENTATION.
METHOD create_object.
DATA: lv_name TYPE aab_id_name.
lv_name = ms_item-obj_name.
CREATE OBJECT ro_aab
EXPORTING
im_name = lv_name
EXCEPTIONS
name_not_allowed = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error creating CL_AAB_ID object' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
* looks like "changed by user" is not stored in the database
rv_user = c_user_unknown.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lo_aab TYPE REF TO cl_aab_id.
lo_aab = create_object( ).
lo_aab->enqueue( ).
lo_aab->delete(
EXCEPTIONS
prop_error = 1
propt_error = 2
act_error = 3
cts_error = 4
cts_devclass = 5
id_not_found = 6
no_authorization = 7
id_still_used = 8
where_used_error = 9
OTHERS = 10 ).
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error deleting ACID object' ).
ENDIF.
lo_aab->dequeue( ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: lv_description TYPE aab_id_descript,
lo_aab TYPE REF TO cl_aab_id.
io_xml->read( EXPORTING iv_name = 'DESCRIPTION'
CHANGING cg_data = lv_description ).
lo_aab = create_object( ).
lo_aab->enqueue( ).
lo_aab->set_descript( lv_description ).
tadir_insert( iv_package ).
lo_aab->save( ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_state TYPE abap_bool,
lo_aab TYPE REF TO cl_aab_id.
lo_aab = create_object( ).
lo_aab->get_state(
IMPORTING
ex_state = lv_state ).
rv_bool = boolc( lv_state = abap_true ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
DATA: ls_meta TYPE zif_abapgit_definitions=>ty_metadata.
ls_meta = get_metadata( ).
IF ls_meta-late_deser = abap_true.
APPEND zif_abapgit_object=>gc_step_id-late TO rt_steps.
ELSEIF ls_meta-ddic = abap_true.
APPEND zif_abapgit_object=>gc_step_id-ddic TO rt_steps.
ELSE.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = ms_item-obj_name
object_type = 'ACID'
in_new_window = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lo_aab TYPE REF TO cl_aab_id,
lv_description TYPE aab_id_descript.
IF zif_abapgit_object~exists( ) = abap_false.
RETURN.
ENDIF.
lo_aab = create_object( ).
lo_aab->get_descript(
IMPORTING ex_descript = lv_description
EXCEPTIONS no_description_found = 1 ).
io_xml->add( iv_name = 'DESCRIPTION'
ig_data = lv_description ).
ENDMETHOD.
ENDCLASS.
| 20.854749 | 96 | 0.660327 |
f7669f186d2e6c8459352ce422ea09a1df446f2f | 299 | abap | ABAP | kapitel_04/mzbook_ticket_user_command_i04.prog.abap | abapkochbuch/Sources | 159775b787fcbc4c6b7eff01e505144b7c33a437 | [
"MIT"
] | 12 | 2018-06-22T10:55:06.000Z | 2022-03-22T12:10:48.000Z | kapitel_04/mzbook_ticket_user_command_i04.prog.abap | abapkochbuch/Sources | 159775b787fcbc4c6b7eff01e505144b7c33a437 | [
"MIT"
] | 5 | 2018-06-25T11:45:26.000Z | 2019-09-04T19:41:55.000Z | kapitel_04/mzbook_ticket_user_command_i04.prog.abap | abapkochbuch/Sources | 159775b787fcbc4c6b7eff01e505144b7c33a437 | [
"MIT"
] | 7 | 2018-07-02T14:20:28.000Z | 2022-03-25T19:33:33.000Z | *&---------------------------------------------------------------------*
*& Module USER_COMMAND_0500 INPUT
*&---------------------------------------------------------------------*
MODULE user_command_0500 INPUT.
PERFORM user_command.
ENDMODULE. " USER_COMMAND_0500 INPUT
| 33.222222 | 72 | 0.354515 |
f7683f017d9834257541670ad443a17586e27ae1 | 340 | abap | ABAP | src/rest/cl_rest_http_handler.clas.abap | FreHu/deps | cace18b54b325d99e4c54293624c1d2811a68ddd | [
"MIT"
] | 2 | 2020-04-19T14:38:41.000Z | 2020-10-03T07:50:28.000Z | src/rest/cl_rest_http_handler.clas.abap | FreHu/deps | cace18b54b325d99e4c54293624c1d2811a68ddd | [
"MIT"
] | 38 | 2019-08-13T17:30:13.000Z | 2022-03-08T12:54:56.000Z | src/rest/cl_rest_http_handler.clas.abap | FreHu/deps | cace18b54b325d99e4c54293624c1d2811a68ddd | [
"MIT"
] | 15 | 2019-11-19T13:45:29.000Z | 2022-03-08T11:18:00.000Z | CLASS cl_rest_http_handler DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES:
if_http_extension,
if_rest_application.
ENDCLASS.
CLASS cl_rest_http_handler IMPLEMENTATION.
METHOD if_http_extension~handle_request.
RETURN.
ENDMETHOD.
METHOD if_rest_application~get_root_handler.
RETURN.
ENDMETHOD.
ENDCLASS. | 17 | 46 | 0.773529 |
f77993c36b356dae0c9a1ddca61d92993d430e57 | 25,473 | abap | ABAP | lbn-gtt-standard-app/abap/zsrc/zgtt_sts/zcl_gtt_sts_actual_event.clas.abap | SAP-samples/logistics-business-network-gtt-standardapps-samples | eea4aae1bb74112a3a34f14c6f94f496ca708ea3 | [
"Apache-2.0"
] | 3 | 2021-07-08T07:16:53.000Z | 2021-10-18T07:56:18.000Z | lbn-gtt-standard-app/abap/zsrc/zgtt_sts/zcl_gtt_sts_actual_event.clas.abap | SAP-samples/logistics-business-network-gtt-standardapps-samples | eea4aae1bb74112a3a34f14c6f94f496ca708ea3 | [
"Apache-2.0"
] | null | null | null | lbn-gtt-standard-app/abap/zsrc/zgtt_sts/zcl_gtt_sts_actual_event.clas.abap | SAP-samples/logistics-business-network-gtt-standardapps-samples | eea4aae1bb74112a3a34f14c6f94f496ca708ea3 | [
"Apache-2.0"
] | 7 | 2021-06-03T09:47:37.000Z | 2022-03-25T12:20:07.000Z | class ZCL_GTT_STS_ACTUAL_EVENT definition
public
create public .
public section.
interfaces ZIF_GTT_STS_ACTUAL_EVENT .
class-methods GET_TOR_ACTUAL_EVENT_CLASS
importing
!IS_EVENT type TRXAS_EVT_CTAB_WA
returning
value(RO_ACTUAL_EVENT) type ref to ZIF_GTT_STS_ACTUAL_EVENT
raising
CX_UDM_MESSAGE .
methods GET_STOP
importing
!IT_ALL_APPL_TABLES type TRXAS_TABCONTAINER
returning
value(RT_STOP) type /SCMTMS/T_EM_BO_TOR_STOP .
methods GET_CAPA_STOP
importing
!IT_ALL_APPL_TABLES type TRXAS_TABCONTAINER
returning
value(RT_STOP) type /SCMTMS/T_EM_BO_TOR_STOP .
methods GET_CAPA_ROOT
importing
!IT_ALL_APPL_TABLES type TRXAS_TABCONTAINER
returning
value(RT_ROOT) type /SCMTMS/T_EM_BO_TOR_ROOT .
methods GET_EXECUTION
importing
!IT_ALL_APPL_TABLES type TRXAS_TABCONTAINER
!IV_OLD type ABAP_BOOL default ABAP_FALSE
exporting
value(ET_EXECUTION) type /SCMTMS/T_EM_BO_TOR_EXECINFO .
methods EXTRACT_GENERAL_EVENT_DATA
importing
!IS_EXECINFO type /SCMTMS/S_EM_BO_TOR_EXECINFO
!IV_EVT_CNT type /SAPTRX/EVTCNT
!IV_EVENTID type /SAPTRX/EVTCNT
!IS_TRACKINGHEADER type /SAPTRX/BAPI_EVM_HEADER
changing
!CS_TRACKINGHEADER type /SAPTRX/BAPI_EVM_HEADER
!CS_TRACKLOCATION type /SAPTRX/BAPI_EVM_LOCATIONID
!CT_TRACKPARAMETERS type ZIF_GTT_STS_ACTUAL_EVENT~TT_TRACKPARAMETERS
!CT_EVENTID_MAP type TRXAS_EVTID_EVTCNT_MAP
raising
CX_UDM_MESSAGE .
methods HANDLE_DELAY_EVENT
importing
!IS_TOR_ROOT type /SCMTMS/S_EM_BO_TOR_ROOT
!IS_EXECINFO type /SCMTMS/S_EM_BO_TOR_EXECINFO
!IV_EVT_CNT type /SAPTRX/EVTCNT
changing
!CS_TRACKLOCATION type /SAPTRX/BAPI_EVM_LOCATIONID
!CT_TRACKPARAMETERS type ZIF_GTT_STS_ACTUAL_EVENT~TT_TRACKPARAMETERS .
protected section.
class-data GV_EVENT_COUNT type /SAPTRX/EVTCNT .
methods GET_MODEL_EVENT_ID
importing
!IV_STANDARD_EVENT_ID type /SAPTRX/EV_EVTID
returning
value(RV_MODEL_EVENT_ID) type /SAPTRX/EV_EVTID .
methods CHECK_APPLICATION_EVENT_SOURCE
importing
!IT_ALL_APPL_TABLES type TRXAS_TABCONTAINER
!IV_EVENT_CODE type /SCMTMS/TOR_EVENT
!IS_EVENT type TRXAS_EVT_CTAB_WA
exporting
!EV_RESULT like SY-BINPT .
methods CHECK_TOR_SENT_TO_GTT
importing
!IS_EVENT type TRXAS_EVT_CTAB_WA
exporting
!EV_IS_SENT type ABAP_BOOL .
methods CHECK_TRXSERVERNAME
importing
!IS_EVENT type TRXAS_EVT_CTAB_WA
exporting
!EV_RESULT like SY-BINPT .
methods CHECK_TOR_TYPE_SPECIFIC_EVENTS
importing
!IV_EVENT_CODE type /SCMTMS/TOR_EVENT
returning
value(EV_RESULT) like SY-BINPT .
private section.
methods ADD_ADDITIONAL_MATCH_KEY
importing
!IV_EXECUTION_INFO_SOURCE type /SCMTMS/EXECINFO_SOURCE
!IV_EVTCNT type /SAPTRX/EVTCNT
changing
!CT_TRACKPARAMETERS type ZIF_GTT_STS_ACTUAL_EVENT=>TT_TRACKPARAMETERS .
ENDCLASS.
CLASS ZCL_GTT_STS_ACTUAL_EVENT IMPLEMENTATION.
METHOD check_application_event_source.
FIELD-SYMBOLS <ls_tor_root> TYPE /scmtms/s_em_bo_tor_root.
CLEAR ev_result.
get_execution(
EXPORTING
it_all_appl_tables = it_all_appl_tables
IMPORTING
et_execution = DATA(lt_tor_execinfo) ).
get_execution(
EXPORTING
it_all_appl_tables = it_all_appl_tables
iv_old = abap_true
IMPORTING
et_execution = DATA(lt_tor_execinfo_old) ).
ASSIGN is_event-maintabref->* TO <ls_tor_root>.
LOOP AT lt_tor_execinfo ASSIGNING FIELD-SYMBOL(<ls_tor_execinfo>) WHERE parent_node_id = <ls_tor_root>-node_id.
ASSIGN lt_tor_execinfo_old[ KEY node_id COMPONENTS node_id = <ls_tor_execinfo>-node_id ]
TO FIELD-SYMBOL(<ls_tor_execinfo_old>).
IF ( sy-subrc = 0 AND <ls_tor_execinfo_old> <> <ls_tor_execinfo> ) OR sy-subrc <> 0 ##BOOL_OK.
CHECK <ls_tor_execinfo>-event_code = iv_event_code.
CHECK NOT ( <ls_tor_execinfo>-execinfo_source = /scmtms/if_tor_const=>sc_tor_event_source-application OR
<ls_tor_execinfo>-execinfo_source = /scmtms/if_tor_const=>sc_tor_event_source-prop_predecessor OR
<ls_tor_execinfo>-execinfo_source = /scmtms/if_tor_const=>sc_tor_event_source-prop_successor ).
ev_result = zif_gtt_sts_ef_constants=>cs_condition-false.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD check_tor_sent_to_gtt.
FIELD-SYMBOLS: <ls_tor_root> TYPE /scmtms/s_em_bo_tor_root.
CLEAR ev_is_sent.
ASSIGN is_event-maintabref->* TO <ls_tor_root>.
IF sy-subrc <> 0.
RETURN.
ENDIF.
IF <ls_tor_root>-tspid IS NOT INITIAL AND
<ls_tor_root>-lifecycle = zif_gtt_sts_constants=>cs_lifecycle_status-in_process OR
<ls_tor_root>-lifecycle = zif_gtt_sts_constants=>cs_lifecycle_status-completed AND
( <ls_tor_root>-execution = zif_gtt_sts_constants=>cs_execution_status-in_execution OR
<ls_tor_root>-execution = zif_gtt_sts_constants=>cs_execution_status-executed OR
<ls_tor_root>-execution = zif_gtt_sts_constants=>cs_execution_status-ready_for_transp_exec ).
ev_is_sent = abap_true.
ELSE.
ev_is_sent = abap_false.
ENDIF.
ENDMETHOD.
METHOD check_tor_type_specific_events.
RETURN.
ENDMETHOD.
METHOD check_trxservername.
FIELD-SYMBOLS <ls_tor_root> TYPE /scmtms/s_em_bo_tor_root.
CLEAR ev_result.
ASSIGN is_event-maintabref->* TO <ls_tor_root>.
TEST-SEAM lv_trxservername.
SELECT SINGLE /saptrx/aotypes~trxservername
FROM /scmtms/c_torty
JOIN /saptrx/aotypes ON /scmtms/c_torty~aotype = /saptrx/aotypes~aotype
INTO @DATA(lv_trxservername)
WHERE /scmtms/c_torty~type = @<ls_tor_root>-tor_type AND
/saptrx/aotypes~trk_obj_type = @zif_gtt_sts_actual_event~cv_tor_trk_obj_typ ##WARN_OK. "#EC CI_BUFFJOIN
END-TEST-SEAM.
IF is_event-trxservername <> lv_trxservername.
ev_result = zif_gtt_sts_ef_constants=>cs_condition-false.
ENDIF.
ENDMETHOD.
METHOD extract_general_event_data.
DATA:
ls_eventid_map TYPE trxas_evtid_evtcnt_map_wa,
ls_trackparameters TYPE /saptrx/bapi_evm_parameters,
ls_loc_root TYPE /scmtms/s_bo_loc_root_k,
ls_loc_geo_addr_details TYPE /scmtms/s_bo_loc_addr_detailsk,
ls_loc_descr TYPE /scmtms/s_bo_loc_description_k.
ls_eventid_map-eventid = iv_eventid.
ls_eventid_map-evtcnt = iv_evt_cnt.
APPEND ls_eventid_map TO ct_eventid_map.
cs_trackingheader = is_trackingheader.
cs_trackingheader-evtcnt = iv_evt_cnt.
cs_tracklocation-evtcnt = iv_evt_cnt.
cs_tracklocation-addnum = iv_evt_cnt.
IF cs_trackingheader-datacs IS INITIAL AND cs_trackingheader-dataid IS INITIAL.
cs_trackingheader-datacs = is_execinfo-datacs.
cs_trackingheader-dataid = is_execinfo-dataid.
ENDIF.
IF is_execinfo-event_reason IS NOT INITIAL.
cs_trackingheader-srctx = is_execinfo-event_reason.
ENDIF.
IF is_execinfo-actual_date IS NOT INITIAL.
cs_trackingheader-evttst = is_execinfo-actual_date.
ENDIF.
CLEAR ls_loc_root.
CLEAR ls_loc_geo_addr_details.
CLEAR ls_loc_descr.
" Note: 2276001
cs_trackingheader-srcid = is_execinfo-event_reason_code.
IF is_execinfo-sndid IS NOT INITIAL. " Note: 2280769
cs_trackingheader-sndid = is_execinfo-sndid.
ENDIF. " Note: 2280769
IF is_execinfo-sndcod IS NOT INITIAL. " Note: 2280769
cs_trackingheader-sndcod = is_execinfo-sndcod.
ENDIF. " Note: 2280769
cs_trackingheader-msgsrctyp = /scmtms/cl_scem_int_c=>sc_ev_srctyp-tm.
IF is_execinfo-ext_loc_id IS NOT INITIAL.
/scmtms/cl_em_tm_helper=>get_loc_descr(
EXPORTING
iv_loc_id = is_execinfo-ext_loc_id
iv_loc_uuid = is_execinfo-ext_loc_uuid
CHANGING
cs_loc_geo_addr_details = ls_loc_geo_addr_details
cs_loc_root = ls_loc_root
cs_loc_descr = ls_loc_descr ).
ENDIF.
cs_trackingheader-evtzon = ls_loc_root-time_zone_code.
cs_tracklocation-locnam = ls_loc_descr-loc_description.
IF is_execinfo-actual_tzone IS NOT INITIAL.
cs_trackingheader-evtzon = is_execinfo-actual_tzone.
ENDIF.
CLEAR ls_trackparameters.
ls_trackparameters-evtcnt = cs_trackingheader-evtcnt.
ls_trackparameters-param_name = zif_gtt_sts_ef_constants=>cs_system_fields-actual_technical_timezone.
ls_trackparameters-param_value = zcl_gtt_sts_tools=>get_system_time_zone( ).
APPEND ls_trackparameters TO ct_trackparameters.
CLEAR ls_trackparameters.
ls_trackparameters-evtcnt = cs_trackingheader-evtcnt.
ls_trackparameters-param_name = zif_gtt_sts_ef_constants=>cs_system_fields-actual_technical_datetime.
ls_trackparameters-param_value = zcl_gtt_sts_tools=>get_system_date_time( ).
APPEND ls_trackparameters TO ct_trackparameters.
ENDMETHOD.
METHOD get_capa_root.
FIELD-SYMBOLS <lt_capa_root> TYPE /scmtms/t_em_bo_tor_root.
ASSIGN it_all_appl_tables[ tabledef = /scmtms/cl_scem_int_c=>sc_table_definition-bo_tor-capa_root ]-tableref
TO FIELD-SYMBOL(<lr_tabref>).
IF sy-subrc = 0.
ASSIGN <lr_tabref>->* TO <lt_capa_root>.
IF sy-subrc = 0.
rt_root = <lt_capa_root>.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD get_capa_stop.
FIELD-SYMBOLS <lt_capa_stop> TYPE /scmtms/t_em_bo_tor_stop.
ASSIGN it_all_appl_tables[ tabledef = /scmtms/cl_scem_int_c=>sc_table_definition-bo_tor-capa_stop ]-tableref
TO FIELD-SYMBOL(<lr_tabref>).
IF sy-subrc = 0.
ASSIGN <lr_tabref>->* TO <lt_capa_stop>.
IF sy-subrc = 0.
rt_stop = <lt_capa_stop>.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD get_execution.
FIELD-SYMBOLS <lt_execution> TYPE /scmtms/t_em_bo_tor_execinfo.
CLEAR et_execution.
ASSIGN it_all_appl_tables[ tabledef = SWITCH #( iv_old WHEN abap_false
THEN zif_gtt_sts_actual_event~cs_tabledef-tor_execution_info
ELSE zif_gtt_sts_actual_event~cs_tabledef-tor_execution_info_before )
]-tableref TO FIELD-SYMBOL(<lr_tabref>).
IF sy-subrc = 0.
ASSIGN <lr_tabref>->* TO <lt_execution>.
IF sy-subrc = 0.
et_execution = <lt_execution>.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD get_model_event_id.
CASE iv_standard_event_id.
WHEN zif_gtt_sts_actual_event~cs_event_id-standard-arrival.
rv_model_event_id = zif_gtt_sts_actual_event~cs_event_id-model-shp_arrival.
WHEN zif_gtt_sts_actual_event~cs_event_id-standard-departure.
rv_model_event_id = zif_gtt_sts_actual_event~cs_event_id-model-shp_departure.
WHEN zif_gtt_sts_actual_event~cs_event_id-standard-pod.
rv_model_event_id = zif_gtt_sts_actual_event~cs_event_id-model-shp_pod.
WHEN zif_gtt_sts_actual_event~cs_event_id-standard-popu.
rv_model_event_id = zif_gtt_sts_actual_event~cs_event_id-model-popu.
WHEN zif_gtt_sts_actual_event~cs_event_id-standard-load_begin.
rv_model_event_id = zif_gtt_sts_actual_event~cs_event_id-model-load_start.
WHEN zif_gtt_sts_actual_event~cs_event_id-standard-load_end.
rv_model_event_id = zif_gtt_sts_actual_event~cs_event_id-model-load_end.
WHEN zif_gtt_sts_actual_event~cs_event_id-standard-coupling.
rv_model_event_id = zif_gtt_sts_actual_event~cs_event_id-model-coupling.
WHEN zif_gtt_sts_actual_event~cs_event_id-standard-decoupling.
rv_model_event_id = zif_gtt_sts_actual_event~cs_event_id-model-decoupling.
WHEN zif_gtt_sts_actual_event~cs_event_id-standard-unload_begin.
rv_model_event_id = zif_gtt_sts_actual_event~cs_event_id-model-unload_begin.
WHEN zif_gtt_sts_actual_event~cs_event_id-standard-unload_end.
rv_model_event_id = zif_gtt_sts_actual_event~cs_event_id-model-unload_end.
WHEN zif_gtt_sts_actual_event~cs_event_id-standard-delay.
rv_model_event_id = zif_gtt_sts_actual_event~cs_event_id-model-delay.
WHEN zif_gtt_sts_actual_event~cs_event_id-standard-delay_fu.
rv_model_event_id = zif_gtt_sts_actual_event~cs_event_id-model-delay.
WHEN OTHERS.
RETURN.
ENDCASE.
ENDMETHOD.
METHOD get_stop.
FIELD-SYMBOLS <lt_stop> TYPE /scmtms/t_em_bo_tor_stop.
ASSIGN it_all_appl_tables[ tabledef = zif_gtt_sts_actual_event~cs_tabledef-tor_stop ]-tableref
TO FIELD-SYMBOL(<lr_tabref>) ##WARN_OK.
IF sy-subrc = 0.
ASSIGN <lr_tabref>->* TO <lt_stop>.
IF sy-subrc = 0.
rt_stop = <lt_stop>.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD get_tor_actual_event_class.
FIELD-SYMBOLS <ls_tor_root> TYPE /scmtms/s_em_bo_tor_root.
ASSIGN is_event-maintabref->* TO <ls_tor_root>.
IF sy-subrc = 0.
CASE <ls_tor_root>-tor_cat.
WHEN /scmtms/if_tor_const=>sc_tor_category-active.
ro_actual_event = NEW zcl_gtt_sts_fo_actual_event( ).
WHEN /scmtms/if_tor_const=>sc_tor_category-booking.
ro_actual_event = NEW zcl_gtt_sts_fb_actual_event( ).
WHEN /scmtms/if_tor_const=>sc_tor_category-freight_unit.
ro_actual_event = NEW zcl_gtt_sts_fu_actual_event( ).
WHEN OTHERS.
MESSAGE i009(zsst_gtt) WITH <ls_tor_root>-tor_cat INTO DATA(lv_dummy) ##needed.
zcl_gtt_sts_tools=>throw_exception( ).
ENDCASE.
ENDIF.
ENDMETHOD.
METHOD handle_delay_event.
DATA:
lt_execinfo_tr TYPE /scmtms/t_tor_exec_tr_k,
lv_timezone TYPE /scmtms/tzone,
lv_locno TYPE /sapapo/locno,
lv_loctype TYPE /saptrx/loc_id_type.
DATA(lo_tor_srv_mgr) = /bobf/cl_tra_serv_mgr_factory=>get_service_manager( iv_bo_key = /scmtms/if_tor_c=>sc_bo_key ).
TEST-SEAM lt_execinfo_tr.
lo_tor_srv_mgr->retrieve_by_association(
EXPORTING
iv_node_key = /scmtms/if_tor_c=>sc_node-root
it_key = VALUE #( ( key = is_tor_root-node_id ) )
iv_association = /scmtms/if_tor_c=>sc_association-root-executioninformation_tr
iv_fill_data = abap_true
IMPORTING
et_data = lt_execinfo_tr ).
END-TEST-SEAM.
ASSIGN lt_execinfo_tr[ parent_key = is_execinfo-parent_node_id
execution_id = is_execinfo-execution_id ] TO FIELD-SYMBOL(<ls_execinfo_tr>) ##PRIMKEY
##WARN_OK.
IF sy-subrc = 0.
IF <ls_execinfo_tr>-estimated_date IS NOT INITIAL.
INSERT VALUE #( evtcnt = iv_evt_cnt
param_name = zif_gtt_sts_ef_constants=>cs_parameter-estimated_datetime
param_index = 1
param_value = <ls_execinfo_tr>-estimated_date ) INTO TABLE ct_trackparameters.
INSERT VALUE #( evtcnt = iv_evt_cnt
param_name = zif_gtt_sts_ef_constants=>cs_parameter-stop_id
param_index = 1
param_value = cs_tracklocation-locid2 ) INTO TABLE ct_trackparameters.
IF <ls_execinfo_tr>-actual_date_tz_em IS NOT INITIAL.
lv_timezone = <ls_execinfo_tr>-actual_date_tz_em.
ELSE.
lv_timezone = <ls_execinfo_tr>-actual_tzone.
ENDIF.
IF lv_timezone IS NOT INITIAL.
INSERT VALUE #( evtcnt = iv_evt_cnt
param_name = zif_gtt_sts_ef_constants=>cs_parameter-estimated_timezone
param_index = 1
param_value = lv_timezone ) INTO TABLE ct_trackparameters.
ENDIF.
ENDIF.
ENDIF.
IF is_execinfo-ref_event_code IS NOT INITIAL.
lv_locno = cs_tracklocation-locid1.
lv_loctype = zcl_gtt_sts_tools=>get_location_type( iv_locno = lv_locno ).
INSERT VALUE #( evtcnt = iv_evt_cnt
param_name = zif_gtt_sts_ef_constants=>cs_parameter-ref_planned_event_milestone
param_value = is_execinfo-ref_event_code ) INTO TABLE ct_trackparameters.
INSERT VALUE #( evtcnt = iv_evt_cnt
param_name = zif_gtt_sts_ef_constants=>cs_parameter-ref_planned_event_loctype
param_value = lv_loctype ) INTO TABLE ct_trackparameters.
INSERT VALUE #( evtcnt = iv_evt_cnt
param_name = zif_gtt_sts_ef_constants=>cs_parameter-ref_planned_event_locid1
param_value = cs_tracklocation-locid1 ) INTO TABLE ct_trackparameters.
INSERT VALUE #( evtcnt = iv_evt_cnt
param_name = zif_gtt_sts_ef_constants=>cs_parameter-ref_planned_event_locid2
param_value = cs_tracklocation-locid2 ) INTO TABLE ct_trackparameters.
ENDIF.
CLEAR: cs_tracklocation-loccod,
cs_tracklocation-locid1,
cs_tracklocation-locid2.
ENDMETHOD.
METHOD zif_gtt_sts_actual_event~check_event_relevance.
CLEAR ev_result.
IF check_tor_type_specific_events( iv_event_code ) = zif_gtt_sts_ef_constants=>cs_condition-false.
RETURN.
ENDIF.
check_application_event_source(
EXPORTING
it_all_appl_tables = it_all_appl_tables
iv_event_code = iv_event_code
is_event = is_event
IMPORTING
ev_result = ev_result ).
IF ev_result = zif_gtt_sts_ef_constants=>cs_condition-false.
RETURN.
ENDIF.
check_tor_sent_to_gtt(
EXPORTING
is_event = is_event
IMPORTING
ev_is_sent = DATA(lv_is_sent) ).
IF lv_is_sent = abap_false.
ev_result = zif_gtt_sts_ef_constants=>cs_condition-false.
RETURN.
ENDIF.
check_trxservername(
EXPORTING
is_event = is_event
IMPORTING
ev_result = ev_result ).
ENDMETHOD.
METHOD zif_gtt_sts_actual_event~extract_event.
DATA:
ls_trackingheader TYPE /saptrx/bapi_evm_header,
ls_tracklocation TYPE /saptrx/bapi_evm_locationid,
lv_loctype TYPE /saptrx/loc_id_type,
lv_locno TYPE /sapapo/locno.
FIELD-SYMBOLS <ls_root> TYPE /scmtms/s_em_bo_tor_root.
extract_general_event_data(
EXPORTING
is_execinfo = is_execinfo
iv_evt_cnt = iv_evt_cnt
iv_eventid = is_event-eventid
is_trackingheader = is_trackingheader
CHANGING
cs_trackingheader = ls_trackingheader
cs_tracklocation = ls_tracklocation
ct_trackparameters = ct_trackparameters
ct_eventid_map = ct_eventid_map ).
add_additional_match_key(
EXPORTING
iv_evtcnt = iv_evt_cnt
iv_execution_info_source = is_execinfo-execinfo_source
CHANGING
ct_trackparameters = ct_trackparameters ).
ASSIGN is_event-maintabref->* TO <ls_root>.
IF sy-subrc <> 0.
RETURN.
ENDIF.
DATA(lt_stop) = get_stop( it_all_appl_tables ).
zcl_gtt_sts_tools=>get_stop_points(
EXPORTING
iv_root_id = <ls_root>-tor_id
it_stop = VALUE #( FOR <ls_stop> IN lt_stop USING KEY parent_seqnum
WHERE ( parent_node_id = <ls_root>-node_id ) ( <ls_stop> ) )
IMPORTING
et_stop_points = DATA(lt_stop_points) ).
lv_locno = is_execinfo-ext_loc_id.
ls_tracklocation-loccod = zcl_gtt_sts_tools=>get_location_type( iv_locno = lv_locno ).
ls_tracklocation-locid1 = is_execinfo-ext_loc_id.
ASSIGN lt_stop_points[ log_locid = is_execinfo-ext_loc_id ]-stop_id TO FIELD-SYMBOL(<lv_stop_id>) ##WARN_OK.
IF sy-subrc = 0.
SHIFT <lv_stop_id> LEFT DELETING LEADING '0'.
ls_tracklocation-locid2 = <lv_stop_id>.
ENDIF.
IF iv_event_code = /scmtms/if_tor_const=>sc_tor_event-delay OR
iv_event_code = /scmtms/if_tor_const=>sc_tor_event-delay_fu.
handle_delay_event(
EXPORTING
is_tor_root = <ls_root>
is_execinfo = is_execinfo
iv_evt_cnt = ls_trackingheader-evtcnt
CHANGING
cs_tracklocation = ls_tracklocation
ct_trackparameters = ct_trackparameters ).
ENDIF.
APPEND ls_trackingheader TO ct_trackingheader.
APPEND ls_tracklocation TO ct_tracklocation.
ENDMETHOD.
METHOD zif_gtt_sts_actual_event~process_actual_event.
FIELD-SYMBOLS: <ls_tor_root> TYPE /scmtms/s_em_bo_tor_root.
DATA:
ls_trackingheader TYPE /saptrx/bapi_evm_header,
lv_tmp_fotrxcod TYPE /saptrx/trxcod,
lv_tmp_futrxcod TYPE /saptrx/trxcod,
lv_fotrxcod TYPE /saptrx/trxcod,
lv_futrxcod TYPE /saptrx/trxcod.
get_execution(
EXPORTING
it_all_appl_tables = it_all_appl_tables
IMPORTING
et_execution = DATA(lt_tor_execinfo) ).
get_execution(
EXPORTING
it_all_appl_tables = it_all_appl_tables
iv_old = abap_true
IMPORTING
et_execution = DATA(lt_tor_execinfo_before) ).
LOOP AT it_events ASSIGNING FIELD-SYMBOL(<ls_event>).
CLEAR ls_trackingheader.
ls_trackingheader-language = sy-langu.
ls_trackingheader-evtid = get_model_event_id( CONV #( iv_event_code ) ).
DATA(zcl_gtt_sts_tor_actual_event) = get_tor_actual_event_class( <ls_event> ).
ASSIGN <ls_event>-maintabref->* TO <ls_tor_root>.
CHECK sy-subrc = 0.
ls_trackingheader-trxid = |{ <ls_tor_root>-tor_id ALPHA = OUT }|.
CASE <ls_tor_root>-tor_cat.
WHEN /scmtms/if_tor_const=>sc_tor_category-active.
ls_trackingheader-trxcod = zif_gtt_sts_constants=>cs_trxcod-fo_number.
WHEN /scmtms/if_tor_const=>sc_tor_category-booking.
ls_trackingheader-trxcod = zif_gtt_sts_constants=>cs_trxcod-fo_number.
WHEN /scmtms/if_tor_const=>sc_tor_category-freight_unit.
ls_trackingheader-trxcod = zif_gtt_sts_constants=>cs_trxcod-fu_number.
ENDCASE.
TRY.
CALL FUNCTION 'ZGTT_SOF_GET_TRACKID'
EXPORTING
iv_type = <ls_event>-eventtype
iv_app = 'STS'
IMPORTING
ev_shptrxcod = lv_tmp_fotrxcod
ev_futrxcod = lv_tmp_futrxcod.
CASE <ls_tor_root>-tor_cat.
WHEN /scmtms/if_tor_const=>sc_tor_category-active.
IF lv_tmp_fotrxcod IS NOT INITIAL.
ls_trackingheader-trxcod = lv_tmp_fotrxcod.
ENDIF.
WHEN /scmtms/if_tor_const=>sc_tor_category-booking.
IF lv_tmp_fotrxcod IS NOT INITIAL.
ls_trackingheader-trxcod = lv_tmp_fotrxcod.
ENDIF.
WHEN /scmtms/if_tor_const=>sc_tor_category-freight_unit.
IF lv_tmp_futrxcod IS NOT INITIAL.
ls_trackingheader-trxcod = lv_tmp_futrxcod.
ENDIF.
ENDCASE.
CATCH cx_sy_dyn_call_illegal_func.
ENDTRY.
GET TIME STAMP FIELD DATA(lv_timestamp).
ls_trackingheader-evttst = lv_timestamp.
ls_trackingheader-sndnam = /scmtms/cl_scem_int_c=>gc_sendername_tm.
" lt_tor_execinfo is SORTED by parent_node_id event_code
READ TABLE lt_tor_execinfo BINARY SEARCH TRANSPORTING NO FIELDS
WITH KEY parent_node_id = <ls_tor_root>-node_id
event_code = iv_event_code.
LOOP AT lt_tor_execinfo ASSIGNING FIELD-SYMBOL(<ls_tor_execinfo>) FROM sy-tabix.
IF <ls_tor_execinfo>-parent_node_id <> <ls_tor_root>-node_id OR
<ls_tor_execinfo>-event_code <> iv_event_code.
EXIT.
ENDIF.
READ TABLE lt_tor_execinfo_before WITH KEY node_id COMPONENTS node_id = <ls_tor_execinfo>-node_id
ASSIGNING FIELD-SYMBOL(<ls_tor_execinfo_before>).
IF ( sy-subrc = 0 AND <ls_tor_execinfo_before> <> <ls_tor_execinfo> ) OR sy-subrc <> 0 ##BOOL_OK.
zcl_gtt_sts_actual_event=>gv_event_count += 1.
zcl_gtt_sts_tor_actual_event->extract_event(
EXPORTING
is_execinfo = <ls_tor_execinfo>
iv_evt_cnt = zcl_gtt_sts_actual_event=>gv_event_count
is_event = <ls_event>
is_trackingheader = ls_trackingheader
it_all_appl_tables = it_all_appl_tables
iv_event_code = iv_event_code
CHANGING
ct_trackingheader = ct_trackingheader
ct_tracklocation = ct_tracklocation
ct_trackparameters = ct_trackparameters
ct_eventid_map = ct_eventid_map ).
ENDIF.
ENDLOOP.
ENDLOOP.
ENDMETHOD.
METHOD add_additional_match_key.
IF iv_execution_info_source = /scmtms/if_tor_const=>sc_tor_event_source-prop_predecessor.
INSERT VALUE #( evtcnt = iv_evtcnt
param_name = zif_gtt_sts_ef_constants=>cs_parameter-additional_match_key
param_value = 'TMFU' ) INTO TABLE ct_trackparameters.
ENDIF.
ENDMETHOD.
ENDCLASS.
| 36.338088 | 128 | 0.683233 |
f77a90eed11ad2fee5a718ebfa5fd7fed02a6ad5 | 1,122 | abap | ABAP | src/legacy/#dmo#flight_travel_api03.fugr.#dmo#flight_travel_delete03.abap | SAP-Cloud-Platform/flight03 | ad1cf6a14e72c57a6fe3d552fd759937e12e3ad7 | [
"BSD-Source-Code"
] | null | null | null | src/legacy/#dmo#flight_travel_api03.fugr.#dmo#flight_travel_delete03.abap | SAP-Cloud-Platform/flight03 | ad1cf6a14e72c57a6fe3d552fd759937e12e3ad7 | [
"BSD-Source-Code"
] | null | null | null | src/legacy/#dmo#flight_travel_api03.fugr.#dmo#flight_travel_delete03.abap | SAP-Cloud-Platform/flight03 | ad1cf6a14e72c57a6fe3d552fd759937e12e3ad7 | [
"BSD-Source-Code"
] | null | null | null | "! <h1>API for Deleting a Travel</h1>
"!
"! <p>
"! Function module to delete a single Travel instance.
"! It will also delete all related subnodes of Booking and Booking Supplement.
"! </p>
"!
"! @parameter iv_travel_id | ID of the Travel to be deleted
"! @parameter et_messages | Table of occurred messages
"!
FUNCTION /DMO/FLIGHT_TRAVEL_DELETE03.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IV_TRAVEL_ID) TYPE /DMO/TRAVEL_ID03
*" EXPORTING
*" REFERENCE(ET_MESSAGES) TYPE /DMO/IF_FLIGHT_LEGACY03=>TT_MESSAGE
*"----------------------------------------------------------------------
CLEAR et_messages.
/dmo/cl_flight_legacy03=>get_instance( )->delete_travel( EXPORTING iv_travel_id = iv_travel_id
IMPORTING et_messages = DATA(lt_messages) ).
/dmo/cl_flight_legacy03=>get_instance( )->convert_messages( EXPORTING it_messages = lt_messages
IMPORTING et_messages = et_messages ).
ENDFUNCTION.
| 41.555556 | 102 | 0.56328 |
f77b39720e40744784dcbcabbf251e00c319546b | 12,335 | abap | ABAP | src/zcl_mdg_bp_helper_active.clas.abap | selmayalcin/ZMEDEPIA_MDG_UTILITIES | 90b1c9d2deef08fcaa967281fa1f27535e8c39ac | [
"MIT"
] | null | null | null | src/zcl_mdg_bp_helper_active.clas.abap | selmayalcin/ZMEDEPIA_MDG_UTILITIES | 90b1c9d2deef08fcaa967281fa1f27535e8c39ac | [
"MIT"
] | null | null | null | src/zcl_mdg_bp_helper_active.clas.abap | selmayalcin/ZMEDEPIA_MDG_UTILITIES | 90b1c9d2deef08fcaa967281fa1f27535e8c39ac | [
"MIT"
] | null | null | null | class ZCL_MDG_BP_HELPER_ACTIVE definition
public
inheriting from ZCL_MDG_BP_HELPER
final
create private .
public section.
class-methods GET_INSTANCE
importing
!IV_BP_ID type BU_PARTNER
returning
value(RO_BP_DATA) type ref to ZCL_MDG_BP_HELPER
exceptions
INSTANCE_CREATION_FAILED
ENTITY_DATA_ALL_READ_ERROR
APP_CONTEXT_GET_FAILED
APPCONTEXT_ATTRIBUTE_GET_ERROR
UNEXPECTED_ERROR
MODEL_GET_FAILED .
class-methods DESTRUCT_INSTANCE
importing
!IV_BP_ID type BU_PARTNER .
class-methods DESTRUCT_INSTANCES .
protected section.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_s_instance,
bp TYPE bu_partner,
instance TYPE REF TO zcl_mdg_bp_helper,
END OF ty_s_instance .
TYPES:
ty_t_instance TYPE SORTED TABLE OF ty_s_instance WITH UNIQUE KEY bp .
DATA gt_all_changed_detail TYPE usmd_th_change_document_change . ##NEEDED
DATA gt_all_changed_value TYPE usmd_ts_change_document_value . ##NEEDED
DATA gt_change_documents TYPE zif_mdg_datatypes=>gty_t_change_document . ##NEEDED
CLASS-DATA gt_instances TYPE ty_t_instance .
METHODS constructor
IMPORTING
!iv_bp_id TYPE bu_partner
EXCEPTIONS
entity_data_all_read_error
app_context_get_failed
appcontext_attribute_get_error
model_get_failed
discard_instance
unexpected_error .
METHODS read_data_from_bp
IMPORTING
!iv_bp_id TYPE bu_partner .
ENDCLASS.
CLASS ZCL_MDG_BP_HELPER_ACTIVE IMPLEMENTATION.
METHOD constructor.
super->constructor( ).
IF iv_bp_id IS NOT INITIAL.
CALL METHOD read_data_from_bp
EXPORTING
iv_bp_id = iv_bp_id.
IF sy-subrc <> 0. ##SUBRC_OK
CASE sy-subrc.
WHEN 1.
RAISE entity_data_all_read_error.
WHEN 2.
RAISE app_context_get_failed.
WHEN 3.
RAISE appcontext_attribute_get_error.
WHEN 4.
RAISE model_get_failed.
WHEN 5.
RAISE discard_instance.
WHEN OTHERS.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 000 RAISING unexpected_error.
ENDCASE.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD destruct_instance.
DELETE gt_instances WHERE bp EQ iv_bp_id.
ENDMETHOD.
METHOD destruct_instances.
CLEAR gt_instances.
ENDMETHOD.
METHOD get_instance.
DATA:
ls_instance TYPE ty_s_instance,
lv_bp_id TYPE bu_partner.
FIELD-SYMBOLS:
<ls_instance> TYPE ty_s_instance.
IF NOT iv_bp_id(1) = '$'.
lv_bp_id = iv_bp_id.
ENDIF.
READ TABLE gt_instances ASSIGNING <ls_instance> WITH TABLE KEY bp = iv_bp_id.
IF sy-subrc = 0 AND <ls_instance>-instance IS NOT INITIAL.
ro_bp_data = <ls_instance>-instance.
ELSE.
* ls_instance-bp = iv_bp_id.
ls_instance-bp = lv_bp_id.
CREATE OBJECT ls_instance-instance TYPE zcl_mdg_bp_helper_active
EXPORTING
* iv_bp_id = iv_bp_id
iv_bp_id = lv_bp_id
EXCEPTIONS
entity_data_all_read_error = 1
app_context_get_failed = 2
appcontext_attribute_get_error = 3
model_get_failed = 4
discard_instance = 5
unexpected_error = 6
OTHERS = 7.
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN 1.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_bp TYPE 'X' NUMBER 001 RAISING entity_data_all_read_error.
WHEN 2.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_br_bp TYPE 'X' NUMBER 004 RAISING app_context_get_failed.
WHEN 3.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_br_bp TYPE 'X' NUMBER 004 RAISING app_context_get_failed .
WHEN 4.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 001 RAISING model_get_failed.
WHEN 5.
CALL METHOD destruct_instance
EXPORTING
iv_bp_id = iv_bp_id.
RETURN.
WHEN 6.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 000 RAISING unexpected_error.
WHEN OTHERS.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 000 RAISING unexpected_error.
ENDCASE.
ENDIF.
INSERT ls_instance INTO TABLE gt_instances.
ro_bp_data = ls_instance-instance.
ENDIF.
IF ro_bp_data IS NOT BOUND.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 002 RAISING instance_creation_failed.
ENDIF.
ENDMETHOD.
METHOD READ_DATA_FROM_BP.
CONSTANTS:
lc_prefix TYPE string VALUE 'GT_',
lc_suffix_text TYPE string VALUE '_TXT'.
DATA:
lt_data_entity_bp TYPE usmd_ts_data_entity,
lt_data_entity_bp_rel TYPE usmd_ts_data_entity,
lt_data_entity_bp_ad TYPE usmd_ts_data_entity,
lt_data_entity_all TYPE usmd_ts_data_entity,
lt_message TYPE usmd_t_message,
lv_entity_tabname TYPE seocpdname,
lt_bp_selection TYPE usmd_ts_sel,
ls_bp_selection TYPE usmd_s_sel,
lt_ad_selection TYPE usmd_ts_sel,
ls_ad_selection TYPE usmd_s_sel,
lt_bp_rel_sel TYPE usmd_ts_sel,
ls_bp_rel_sel TYPE usmd_s_sel,
lr_entity TYPE REF TO data,
lv_active TYPE abap_bool.
FIELD-SYMBOLS:
<ls_bp_entity_rel_data> TYPE usmd_sx_data_entity,
<lt_bp_rel_data> TYPE ANY TABLE,
<ls_bp_rel_data> TYPE any,
<lv_partner2> TYPE any,
<ls_data> TYPE any,
<ls_data_entity> TYPE usmd_sx_data_entity,
<lt_mt_entity> TYPE SORTED TABLE,
<ls_entity> TYPE any,
<lt_data> TYPE ANY TABLE,
<lv_addrno> TYPE ad_addrnum.
IF iv_bp_id IS INITIAL.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 000.
ENDIF.
IF iv_bp_id CA '$'.
lv_active = abap_false.
ELSE.
lv_active = abap_true.
ENDIF.
IF sy-subrc = 0 AND iv_bp_id IS NOT INITIAL.
ls_bp_selection-fieldname = if_mdg_bp_constants=>gc_bp_model_entity-bp.
ls_bp_selection-sign = usmd0_cs_ra-sign_i.
ls_bp_selection-option = usmd0_cs_ra-option_eq.
ls_bp_selection-low = iv_bp_id .
INSERT ls_bp_selection INTO TABLE lt_bp_selection.
*********************
*special handling for BP_REL and corresponding contact persons
** build selection parameters to read relevant relations
ls_bp_rel_sel-sign = usmd0_cs_ra-sign_i.
ls_bp_rel_sel-option = usmd0_cs_ra-option_eq.
ls_bp_rel_sel-fieldname = ZCL_MDG_BP_HELPER=>if_mdg_bp_constants~gc_field-partner1.
ls_bp_rel_sel-low = iv_bp_id .
INSERT ls_bp_rel_sel INTO TABLE lt_bp_rel_sel.
ENDIF.
IF lt_bp_rel_sel IS NOT INITIAL.
CALL METHOD go_model->read_entity_data_all
EXPORTING
i_fieldname = ZCL_MDG_BP_HELPER=>if_mdg_bp_constants~gc_field-bp_rel
it_sel = lt_bp_rel_sel
if_active = lv_active
IMPORTING
et_message = lt_message
et_data_entity = lt_data_entity_bp_rel.
IF lt_message IS NOT INITIAL.
RETURN.
ENDIF.
ENDIF.
* also fill contact person into selection of BPs that need to be read
LOOP AT lt_data_entity_bp_rel ASSIGNING <ls_bp_entity_rel_data>
WHERE usmd_entity = ZCL_MDG_BP_HELPER=>if_mdg_bp_constants~gc_bp_model_entity-relation
AND usmd_entity_cont IS INITIAL.
UNASSIGN: <lt_bp_rel_data>, <ls_bp_rel_data>, <lv_partner2>.
CLEAR ls_bp_selection-low.
ASSIGN <ls_bp_entity_rel_data>-r_t_data->* TO <lt_bp_rel_data>.
LOOP AT <lt_bp_rel_data> ASSIGNING <ls_bp_rel_data>. "#EC CI_NESTED
ASSIGN COMPONENT ZCL_MDG_BP_HELPER=>if_mdg_bp_constants~gc_field-partner2 OF STRUCTURE <ls_bp_rel_data> TO <lv_partner2>.
IF <lv_partner2> IS ASSIGNED AND <lv_partner2> IS NOT INITIAL.
ls_bp_selection-low = <lv_partner2>.
INSERT ls_bp_selection INTO TABLE lt_bp_selection.
ENDIF.
ENDLOOP.
ENDLOOP.
IF lt_bp_selection IS NOT INITIAL.
* Look for entity in active data, if an existent business partner is changed (business activity = BPP2)
* This call triggers the derivations BAdI
CALL METHOD go_model->read_entity_data_all
EXPORTING
i_fieldname = ZCL_MDG_BP_HELPER=>if_mdg_bp_constants~gc_field-bp_header
it_sel = lt_bp_selection
if_active = lv_active
IMPORTING
et_message = lt_message
et_data_entity = lt_data_entity_bp.
IF lt_message IS NOT INITIAL.
RETURN.
ENDIF.
ENDIF.
* Get all address numbers
LOOP AT lt_data_entity_bp ASSIGNING <ls_data_entity> WHERE usmd_entity_cont EQ ZCL_MDG_BP_HELPER=>if_mdg_bp_constants~gc_bp_model_entity-address. "#EC CI_SORTSEQ
CLEAR ls_ad_selection.
ls_ad_selection-sign = usmd0_cs_ra-sign_i.
ls_ad_selection-option = usmd0_cs_ra-option_eq.
ls_ad_selection-fieldname = ZCL_MDG_BP_HELPER=>if_mdg_bp_constants~gc_bp_model_entity-address_number.
ASSIGN <ls_data_entity>-r_t_data->* TO <lt_data>.
CHECK sy-subrc IS INITIAL.
LOOP AT <lt_data> ASSIGNING <ls_data>. "#EC CI_NESTED
ASSIGN COMPONENT if_mdg_bp_constants~gc_bp_model_entity-address_number OF STRUCTURE <ls_data> TO <lv_addrno>.
CHECK sy-subrc IS INITIAL.
ls_ad_selection-low = <lv_addrno>.
INSERT ls_ad_selection INTO TABLE lt_ad_selection.
ENDLOOP.
ENDLOOP.
IF lt_ad_selection IS NOT INITIAL.
CALL METHOD go_model->read_entity_data_all
EXPORTING
i_fieldname = 'ADDRNO'
it_sel = lt_ad_selection
if_active = lv_active
IMPORTING
et_message = lt_message
et_data_entity = lt_data_entity_bp_ad.
IF lt_message IS NOT INITIAL.
RETURN.
ENDIF.
ENDIF.
INSERT LINES OF lt_data_entity_bp INTO TABLE lt_data_entity_all.
INSERT LINES OF lt_data_entity_bp_rel INTO TABLE lt_data_entity_all.
INSERT LINES OF lt_data_entity_bp_ad INTO TABLE lt_data_entity_all.
* Transform untyped to typed data
LOOP AT lt_data_entity_all ASSIGNING <ls_data_entity>.
CLEAR: lv_entity_tabname, lr_entity.
UNASSIGN: <ls_entity>, <lt_mt_entity>.
* Construct export table name and assign it to field symbol (it's used to fill the related mt)
CASE <ls_data_entity>-struct.
WHEN if_usmd_model_ext=>gc_struct_key_attr.
IF <ls_data_entity>-usmd_entity_cont IS INITIAL.
CONCATENATE lc_prefix <ls_data_entity>-usmd_entity INTO lv_entity_tabname.
ELSE.
CONCATENATE lc_prefix <ls_data_entity>-usmd_entity_cont INTO lv_entity_tabname.
ENDIF.
WHEN if_usmd_model_ext=>gc_struct_key_txt_langu.
IF <ls_data_entity>-usmd_entity_cont IS INITIAL.
CONCATENATE lc_prefix <ls_data_entity>-usmd_entity lc_suffix_text INTO lv_entity_tabname.
ELSE.
CONCATENATE lc_prefix <ls_data_entity>-usmd_entity_cont lc_suffix_text INTO lv_entity_tabname.
ENDIF.
ENDCASE.
* write data to gt
ASSIGN (lv_entity_tabname) TO <lt_mt_entity>. "#EC CI_SUBRC
IF <lt_mt_entity> IS NOT ASSIGNED.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 000.
ENDIF.
CREATE DATA lr_entity LIKE LINE OF <lt_mt_entity>.
ASSIGN lr_entity->* TO <ls_entity>.
IF <ls_entity> IS NOT ASSIGNED.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 000.
ENDIF.
CLEAR: <ls_entity>, <lt_mt_entity>.
ASSIGN <ls_data_entity>-r_t_data->* TO <lt_data>.
IF sy-subrc <> 0.
MESSAGE ID zcl_mdg_general_functions=>gc_msg_class_dm_gen TYPE 'X' NUMBER 000.
ENDIF.
IF <lt_data> IS ASSIGNED.
MOVE-CORRESPONDING <lt_data> TO <lt_mt_entity>.
ENDIF.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| 33.980716 | 165 | 0.675395 |
f77cc46f76de6f3ff3dc10f8ac649246103665be | 673 | abap | ABAP | src/ui/zdbbr_output.fugr.lzdbbr_outputtop.abap | reichr-dev/abap-db-browser | d513d49692f1f0ee613c8eab2c99e325ef5b78fe | [
"MIT"
] | 15 | 2020-02-05T10:38:12.000Z | 2022-02-11T18:06:17.000Z | src/ui/zdbbr_output.fugr.lzdbbr_outputtop.abap | reichr-dev/abap-db-browser | d513d49692f1f0ee613c8eab2c99e325ef5b78fe | [
"MIT"
] | 10 | 2021-01-19T07:45:37.000Z | 2021-07-15T19:08:54.000Z | src/ui/zdbbr_output.fugr.lzdbbr_outputtop.abap | reichr-dev/abap-db-browser | d513d49692f1f0ee613c8eab2c99e325ef5b78fe | [
"MIT"
] | 9 | 2020-04-08T19:13:18.000Z | 2021-10-02T12:53:39.000Z | FUNCTION-POOL zdbbr_output. "MESSAGE-ID ..
* INCLUDE LZDBBR_SELECTD... " Local class definition
TABLES: sscrfields.
DATA: gr_controller TYPE REF TO zif_uitb_screen_controller,
ok_code TYPE sy-ucomm.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" dynamic functions
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
DATA: userfunc01 TYPE smp_dyntxt,
userfunc02 TYPE smp_dyntxt,
userfunc03 TYPE smp_dyntxt.
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" SELECTION SCREEN DEFINITIONS
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
| 33.65 | 70 | 0.413076 |
f77cd1410fdf3b5311e6651e9d9d539733959e69 | 2,319 | abap | ABAP | lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zgtt_mia.fugr.zgtt_mia_ee_sh_hdr.abap | rakshitha-1234/logistics-business-network-gtt-standardapps-samples | 3d1e3249046c0112ff33f524d30cde2ac9f38b4c | [
"Apache-2.0"
] | null | null | null | lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zgtt_mia.fugr.zgtt_mia_ee_sh_hdr.abap | rakshitha-1234/logistics-business-network-gtt-standardapps-samples | 3d1e3249046c0112ff33f524d30cde2ac9f38b4c | [
"Apache-2.0"
] | null | null | null | lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zgtt_mia.fugr.zgtt_mia_ee_sh_hdr.abap | rakshitha-1234/logistics-business-network-gtt-standardapps-samples | 3d1e3249046c0112ff33f524d30cde2ac9f38b4c | [
"Apache-2.0"
] | null | null | null | FUNCTION zgtt_mia_ee_sh_hdr.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(I_APPSYS) TYPE /SAPTRX/APPLSYSTEM
*" REFERENCE(I_APP_OBJ_TYPES) TYPE /SAPTRX/AOTYPES
*" REFERENCE(I_ALL_APPL_TABLES) TYPE TRXAS_TABCONTAINER
*" REFERENCE(I_APP_TYPE_CNTL_TABS) TYPE TRXAS_APPTYPE_TABS
*" REFERENCE(I_APP_OBJECTS) TYPE TRXAS_APPOBJ_CTABS
*" TABLES
*" E_EXPEVENTDATA STRUCTURE /SAPTRX/EXP_EVENTS
*" E_MEASRMNTDATA STRUCTURE /SAPTRX/MEASR_DATA OPTIONAL
*" E_INFODATA STRUCTURE /SAPTRX/INFO_DATA OPTIONAL
*" E_LOGTABLE STRUCTURE BAPIRET2 OPTIONAL
*" EXCEPTIONS
*" PARAMETER_ERROR
*" EXP_EVENT_DETERM_ERROR
*" TABLE_DETERMINATION_ERROR
*" STOP_PROCESSING
*"----------------------------------------------------------------------
DATA: lo_udm_message TYPE REF TO cx_udm_message,
ls_bapiret TYPE bapiret2.
CLEAR e_logtable[].
TRY.
zcl_gtt_mia_ef_performer=>get_planned_events(
EXPORTING
is_definition = VALUE #(
maintab = zif_gtt_mia_app_constants=>cs_tabledef-sh_header_new )
io_factory = NEW zcl_gtt_mia_tp_factory_shh( )
iv_appsys = i_appsys
is_app_obj_types = i_app_obj_types
it_all_appl_tables = i_all_appl_tables
it_app_type_cntl_tabs = i_app_type_cntl_tabs
it_app_objects = i_app_objects
CHANGING
ct_expeventdata = e_expeventdata[]
ct_measrmntdata = e_measrmntdata[]
ct_infodata = e_infodata[]
).
CATCH cx_udm_message INTO lo_udm_message.
zcl_gtt_mia_tools=>get_errors_log(
EXPORTING
io_umd_message = lo_udm_message
iv_appsys = i_appsys
IMPORTING
es_bapiret = ls_bapiret ).
" add error message
APPEND ls_bapiret TO e_logtable.
" throw corresponding exception
CASE lo_udm_message->textid.
WHEN zif_gtt_mia_ef_constants=>cs_errors-stop_processing.
RAISE stop_processing.
WHEN zif_gtt_mia_ef_constants=>cs_errors-table_determination.
RAISE table_determination_error.
ENDCASE.
ENDTRY.
ENDFUNCTION.
| 36.809524 | 102 | 0.619232 |
f77e384b7f1c3bc134baa43140f25d062c729309 | 13,800 | abap | ABAP | src/objects/zcl_abapgit_object_msag.clas.abap | wdecpacloudcourse01/abap_a07 | ad7809e4f2bc4da133c17c9a4c0536d7ea5ebbed | [
"MIT"
] | null | null | null | src/objects/zcl_abapgit_object_msag.clas.abap | wdecpacloudcourse01/abap_a07 | ad7809e4f2bc4da133c17c9a4c0536d7ea5ebbed | [
"MIT"
] | null | null | null | src/objects/zcl_abapgit_object_msag.clas.abap | wdecpacloudcourse01/abap_a07 | ad7809e4f2bc4da133c17c9a4c0536d7ea5ebbed | [
"MIT"
] | null | null | null | CLASS zcl_abapgit_object_msag DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_t100_texts,
sprsl TYPE t100-sprsl,
msgnr TYPE t100-msgnr,
text TYPE t100-text,
END OF ty_t100_texts .
TYPES:
tt_t100_texts TYPE STANDARD TABLE OF ty_t100_texts .
TYPES:
tty_t100 TYPE STANDARD TABLE OF t100
WITH NON-UNIQUE DEFAULT KEY .
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 serialize_longtexts_msag
IMPORTING
!it_t100 TYPE zcl_abapgit_object_msag=>tty_t100
!io_xml TYPE REF TO zcl_abapgit_xml_output
RAISING
zcx_abapgit_exception .
METHODS delete_msgid
IMPORTING
!iv_message_id TYPE arbgb .
METHODS free_access_permission
IMPORTING
!iv_message_id TYPE arbgb .
METHODS delete_documentation
IMPORTING
!iv_message_id TYPE arbgb .
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_MSAG IMPLEMENTATION.
METHOD delete_documentation.
DATA: lv_key_s TYPE dokhl-object.
CLEAR lv_key_s.
CALL FUNCTION 'DOCU_OBJECT_NAME_CONCATENATE'
EXPORTING
docu_id = 'NA'
element = iv_message_id
addition = ' '
IMPORTING
object = lv_key_s
EXCEPTIONS
OTHERS = 0.
CALL FUNCTION 'DOKU_DELETE_ALL'
EXPORTING
doku_id = 'NA'
doku_object = lv_key_s
generic_use = 'X'
suppress_authority = space
suppress_enqueue = space
suppress_transport = space
EXCEPTIONS
header_without_text = 01
index_without_header = 02
no_authority_for_devclass_xxxx = 03
no_docu_found = 04
object_is_already_enqueued = 05
object_is_enqueued_by_corr = 06
user_break = 07.
ENDMETHOD.
METHOD delete_msgid.
delete_documentation( iv_message_id ).
DELETE FROM t100a WHERE arbgb = iv_message_id.
IF sy-subrc = 0 OR sy-subrc = 4.
CALL FUNCTION 'RS_TREE_OBJECT_PLACEMENT'
EXPORTING
object = iv_message_id
operation = 'DELETE'
program = space
type = 'CN'.
DELETE FROM t100o WHERE arbgb = iv_message_id.
DELETE FROM t100t WHERE arbgb = iv_message_id. "#EC CI_NOFIRST
DELETE FROM t100u WHERE arbgb = iv_message_id.
DELETE FROM t100x WHERE arbgb = iv_message_id.
DELETE FROM t100 WHERE arbgb = iv_message_id.
ENDIF.
ENDMETHOD.
METHOD deserialize_texts.
DATA: lv_msg_id TYPE rglif-message_id,
ls_t100 TYPE t100,
lt_t100t TYPE TABLE OF t100t,
lt_t100_texts TYPE tt_t100_texts,
lt_t100u TYPE TABLE OF t100u.
FIELD-SYMBOLS: <ls_t100_text> TYPE ty_t100_texts.
lv_msg_id = ms_item-obj_name.
SELECT * FROM t100u INTO TABLE lt_t100u
WHERE arbgb = lv_msg_id ORDER BY PRIMARY KEY. "#EC CI_GENBUFF
io_xml->read( EXPORTING iv_name = 'T100_TEXTS'
CHANGING cg_data = lt_t100_texts ).
io_xml->read( EXPORTING iv_name = 'T100T'
CHANGING cg_data = lt_t100t ).
MODIFY t100t FROM TABLE lt_t100t. "#EC CI_SUBRC
LOOP AT lt_t100_texts ASSIGNING <ls_t100_text>.
"check if message exists
READ TABLE lt_t100u TRANSPORTING NO FIELDS
WITH KEY arbgb = lv_msg_id msgnr = <ls_t100_text>-msgnr BINARY SEARCH.
CHECK sy-subrc = 0. "if original message doesn't exist no translations added
MOVE-CORRESPONDING <ls_t100_text> TO ls_t100.
ls_t100-arbgb = lv_msg_id.
MODIFY t100 FROM ls_t100.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100 modify failed' ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD free_access_permission.
CALL FUNCTION 'RS_ACCESS_PERMISSION'
EXPORTING
mode = 'FREE'
object = iv_message_id
object_class = 'T100'.
ENDMETHOD.
METHOD serialize_longtexts_msag.
DATA: lv_object TYPE dokhl-object,
lt_objects TYPE STANDARD TABLE OF dokhl-object
WITH NON-UNIQUE DEFAULT KEY,
lt_dokil TYPE zif_abapgit_definitions=>tty_dokil.
FIELD-SYMBOLS: <ls_t100> TYPE t100.
IF lines( it_t100 ) = 0.
RETURN.
ENDIF.
LOOP AT it_t100 ASSIGNING <ls_t100>.
lv_object = <ls_t100>-arbgb && <ls_t100>-msgnr.
INSERT lv_object INTO TABLE lt_objects.
ENDLOOP.
SELECT * FROM dokil
INTO TABLE lt_dokil
FOR ALL ENTRIES IN lt_objects
WHERE id = 'NA'
AND object = lt_objects-table_line.
IF lines( lt_dokil ) > 0.
serialize_longtexts( io_xml = io_xml
it_dokil = lt_dokil ).
ENDIF.
ENDMETHOD.
METHOD serialize_texts.
DATA: lv_msg_id TYPE rglif-message_id,
lt_t100_texts TYPE tt_t100_texts,
lt_t100t TYPE TABLE OF t100t,
lt_i18n_langs TYPE TABLE OF langu.
lv_msg_id = ms_item-obj_name.
" Collect additional languages
" Skip master lang - it has been already serialized
SELECT DISTINCT sprsl AS langu INTO TABLE lt_i18n_langs
FROM t100t
WHERE arbgb = lv_msg_id
AND sprsl <> mv_language. "#EC CI_BYPASS "#EC CI_GENBUFF.
SORT lt_i18n_langs ASCENDING.
IF lines( lt_i18n_langs ) > 0.
SELECT * FROM t100t INTO CORRESPONDING FIELDS OF TABLE lt_t100t
WHERE sprsl <> mv_language
AND arbgb = lv_msg_id. "#EC CI_GENBUFF
SELECT * FROM t100 INTO CORRESPONDING FIELDS OF TABLE lt_t100_texts
FOR ALL ENTRIES IN lt_i18n_langs
WHERE sprsl = lt_i18n_langs-table_line
AND arbgb = lv_msg_id
ORDER BY PRIMARY KEY. "#EC CI_SUBRC "#EC CI_GENBUFF
SORT lt_t100t BY sprsl ASCENDING.
SORT lt_t100_texts BY sprsl msgnr ASCENDING.
io_xml->add( iv_name = 'I18N_LANGS'
ig_data = lt_i18n_langs ).
io_xml->add( iv_name = 'T100T'
ig_data = lt_t100t ).
io_xml->add( iv_name = 'T100_TEXTS'
ig_data = lt_t100_texts ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
SELECT SINGLE lastuser FROM t100a INTO rv_user
WHERE arbgb = ms_item-obj_name. "#EC CI_GENBUFF
IF sy-subrc <> 0 OR rv_user = ''.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~compare_to_remote_version.
CREATE OBJECT ro_comparison_result TYPE zcl_abapgit_comparison_null.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_t100a TYPE t100a,
lv_frozen TYPE abap_bool,
lv_message_id TYPE arbgb,
lv_access_granted TYPE abap_bool.
* parameter SUPPRESS_DIALOG doesnt exist in all versions of FM RS_DELETE_MESSAGE_ID
* replaced with a copy
lv_message_id = ms_item-obj_name.
IF ms_item-obj_name EQ space.
zcx_abapgit_exception=>raise( 'Error from (copy of) RS_DELETE_MESSAGE_ID' )."blank message id
ENDIF.
SELECT SINGLE * FROM t100a INTO lv_t100a WHERE arbgb = ms_item-obj_name.
IF sy-subrc NE 0.
zcx_abapgit_exception=>raise( 'Error from (copy of) RS_DELETE_MESSAGE_ID' )."not found
ENDIF.
CLEAR lv_frozen.
CALL FUNCTION 'RS_ACCESS_PERMISSION'
EXPORTING
authority_check = 'X'
global_lock = 'X'
mode = 'MODIFY'
object = lv_message_id
object_class = 'T100'
IMPORTING
frozen = lv_frozen
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0 OR lv_frozen NE space.
zcx_abapgit_exception=>raise( 'Error from (copy of) RS_DELETE_MESSAGE_ID' )."can't access
ENDIF.
lv_access_granted = abap_true.
CALL FUNCTION 'RS_CORR_INSERT'
EXPORTING
global_lock = 'X'
object = lv_message_id
object_class = 'MSAG'
mode = 'D'
EXCEPTIONS
cancelled = 01
permission_failure = 02.
IF sy-subrc NE 0.
IF lv_access_granted = abap_true.
free_access_permission( lv_message_id ).
ENDIF.
zcx_abapgit_exception=>raise( 'Error from (copy of) RS_DELETE_MESSAGE_ID' )."can't access
ENDIF.
delete_msgid( lv_message_id ).
IF lv_access_granted = abap_true.
free_access_permission( lv_message_id ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
* fm RPY_MESSAGE_ID_INSERT almost works, but not in older versions
DATA: ls_t100a TYPE t100a,
ls_t100t TYPE t100t,
ls_t100u TYPE t100u,
lt_t100 TYPE TABLE OF t100,
lt_before TYPE TABLE OF t100u.
FIELD-SYMBOLS: <ls_t100> LIKE LINE OF lt_t100.
io_xml->read( EXPORTING iv_name = 'T100A'
CHANGING cg_data = ls_t100a ).
io_xml->read( EXPORTING iv_name = 'T100'
CHANGING cg_data = lt_t100 ).
CALL FUNCTION 'RS_CORR_INSERT'
EXPORTING
global_lock = abap_true
devclass = iv_package
object = ls_t100a-arbgb
object_class = 'T100'
mode = 'INSERT'
EXCEPTIONS
cancelled = 01
permission_failure = 02
unknown_objectclass = 03.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error from RS_CORR_INSERT' ).
ENDIF.
SELECT * FROM t100u INTO TABLE lt_before
WHERE arbgb = ls_t100a-arbgb ORDER BY msgnr. "#EC CI_GENBUFF "#EC CI_BYPASS
LOOP AT lt_t100 ASSIGNING <ls_t100>.
DELETE lt_before WHERE msgnr = <ls_t100>-msgnr.
MODIFY t100 FROM <ls_t100>.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100 modify failed' ).
ENDIF.
CLEAR ls_t100u.
MOVE-CORRESPONDING <ls_t100> TO ls_t100u ##enh_ok.
ls_t100u-name = sy-uname.
ls_t100u-datum = sy-datum.
ls_t100u-selfdef = '3'.
MODIFY t100u FROM ls_t100u.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100U modify failed' ).
ENDIF.
ENDLOOP.
ls_t100a-masterlang = mv_language.
ls_t100a-lastuser = sy-uname.
ls_t100a-respuser = sy-uname.
ls_t100a-ldate = sy-datum.
ls_t100a-ltime = sy-uzeit.
MODIFY t100a FROM ls_t100a.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100A modify failed' ).
ENDIF.
ls_t100t-sprsl = mv_language.
ls_t100t-arbgb = ls_t100a-arbgb.
ls_t100t-stext = ls_t100a-stext.
MODIFY t100t FROM ls_t100t.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'MSAG: Table T100T modify failed' ).
ENDIF.
LOOP AT lt_before INTO ls_t100u.
DELETE FROM t100 WHERE arbgb = ls_t100u-arbgb
AND msgnr = ls_t100u-msgnr. "#EC CI_SUBRC
DELETE FROM t100u WHERE arbgb = ls_t100u-arbgb
AND msgnr = ls_t100u-msgnr. "#EC CI_SUBRC
ENDLOOP.
deserialize_longtexts( io_xml ).
deserialize_texts( io_xml ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_arbgb TYPE t100a-arbgb.
SELECT SINGLE arbgb FROM t100a INTO lv_arbgb
WHERE arbgb = ms_item-obj_name. "#EC CI_GENBUFF
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
ENDMETHOD.
METHOD zif_abapgit_object~has_changed_since.
rv_changed = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
DATA: lv_argument TYPE seqg3-garg.
lv_argument = |{ ms_item-obj_name }|.
OVERLAY lv_argument WITH ' '.
lv_argument = lv_argument && '*'.
rv_is_locked = exists_a_lock_entry_for( iv_lock_object = |ES_MSGSI|
iv_argument = lv_argument ).
ENDMETHOD.
METHOD zif_abapgit_object~jump.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = ms_item-obj_name
object_type = 'MSAG'
in_new_window = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lv_msg_id TYPE rglif-message_id,
ls_inf TYPE t100a,
lt_source TYPE tty_t100.
lv_msg_id = ms_item-obj_name.
SELECT SINGLE * FROM t100a INTO ls_inf
WHERE arbgb = lv_msg_id. "#EC CI_GENBUFF
IF sy-subrc <> 0.
RETURN.
ENDIF.
CLEAR ls_inf-respuser.
SELECT * FROM t100 INTO TABLE lt_source
WHERE sprsl = mv_language
AND arbgb = lv_msg_id
ORDER BY PRIMARY KEY. "#EC CI_SUBRC "#EC CI_GENBUFF
CLEAR: ls_inf-lastuser,
ls_inf-ldate,
ls_inf-ltime.
io_xml->add( iv_name = 'T100A'
ig_data = ls_inf ).
io_xml->add( ig_data = lt_source
iv_name = 'T100' ).
serialize_longtexts_msag( it_t100 = lt_source
io_xml = io_xml ).
serialize_texts( io_xml ).
ENDMETHOD.
ENDCLASS.
| 27.822581 | 99 | 0.620507 |
f788eef320faab40983989d4fed1d125b3df9ec5 | 713 | abap | ABAP | src/zcx_trs_no_key.clas.abap | DennstedtB/Transport-Services | 419c5dbbbc6730c7be4d52132b2539fab7bc64f8 | [
"MIT"
] | null | null | null | src/zcx_trs_no_key.clas.abap | DennstedtB/Transport-Services | 419c5dbbbc6730c7be4d52132b2539fab7bc64f8 | [
"MIT"
] | 1 | 2019-05-14T13:34:38.000Z | 2019-05-14T17:33:38.000Z | src/zcx_trs_no_key.clas.abap | DennstedtB/Transport-Services | 419c5dbbbc6730c7be4d52132b2539fab7bc64f8 | [
"MIT"
] | null | null | null | CLASS zcx_trs_no_key DEFINITION
PUBLIC
FINAL
CREATE PUBLIC
INHERITING FROM cx_static_check.
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_trs_no_key IMPLEMENTATION.
METHOD constructor ##ADT_SUPPRESS_GENERATION.
CALL METHOD super->constructor
EXPORTING
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.
| 18.763158 | 64 | 0.71669 |
f78ba75e83aedac591c1114bda1ad3e2d576a476 | 4,786 | abap | ABAP | src/parsing/zcl_aoc_boolean_tokens.clas.testclasses.abap | pcf0/abapOpenChecks | 594e2e62fec80308d666179e36fc7c4916e541ff | [
"MIT"
] | 1 | 2018-04-22T04:47:28.000Z | 2018-04-22T04:47:28.000Z | src/parsing/zcl_aoc_boolean_tokens.clas.testclasses.abap | pacheco7/abapOpenChecks | 57bbed6a922550c65754bde8f7fe6a385a6bc92a | [
"MIT"
] | null | null | null | src/parsing/zcl_aoc_boolean_tokens.clas.testclasses.abap | pacheco7/abapOpenChecks | 57bbed6a922550c65754bde8f7fe6a385a6bc92a | [
"MIT"
] | null | null | null | CLASS lcl_parse DEFINITION.
PUBLIC SECTION.
CLASS-METHODS:
parse
IMPORTING iv_string TYPE string
RETURNING VALUE(ro_tokens) TYPE REF TO zcl_aoc_boolean_tokens.
ENDCLASS.
CLASS lcl_parse IMPLEMENTATION.
METHOD parse.
DATA: lt_code TYPE string_table,
lt_tokens TYPE stokesx_tab,
lt_statements TYPE sstmnt_tab.
APPEND iv_string TO lt_code.
SCAN ABAP-SOURCE lt_code
TOKENS INTO lt_tokens
STATEMENTS INTO lt_statements
WITH ANALYSIS
WITH COMMENTS
WITH PRAGMAS abap_true.
cl_abap_unit_assert=>assert_subrc( ).
CREATE OBJECT ro_tokens EXPORTING it_tokens = lt_tokens.
ENDMETHOD.
ENDCLASS.
CLASS ltcl_find_end_paren DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL.
PRIVATE SECTION.
METHODS:
test
IMPORTING
iv_code TYPE string
iv_start TYPE i
iv_exp TYPE i,
find01 FOR TESTING,
find02 FOR TESTING,
find03 FOR TESTING.
ENDCLASS.
CLASS ltcl_find_end_paren IMPLEMENTATION.
METHOD test.
DATA: lv_end TYPE i,
lo_tokens TYPE REF TO zcl_aoc_boolean_tokens.
lo_tokens = lcl_parse=>parse( iv_code ).
lv_end = lo_tokens->find_end_paren( iv_start ).
cl_abap_unit_assert=>assert_equals(
act = lv_end
exp = iv_exp ).
ENDMETHOD.
METHOD find01.
test( iv_code = 'foo( )'
iv_start = 1
iv_exp = 2 ).
ENDMETHOD.
METHOD find02.
test( iv_code = 'foo( )->bar( )'
iv_start = 1
iv_exp = 3 ).
ENDMETHOD.
METHOD find03.
test( iv_code = 'foo( bar( ) )'
iv_start = 1
iv_exp = 4 ).
ENDMETHOD.
ENDCLASS.
CLASS ltcl_to_string DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL.
PRIVATE SECTION.
METHODS:
test_to_string IMPORTING iv_code TYPE string,
to_string01 FOR TESTING,
to_string02 FOR TESTING,
to_string03 FOR TESTING,
to_string04 FOR TESTING.
ENDCLASS.
CLASS ltcl_to_string IMPLEMENTATION.
METHOD test_to_string.
DATA: lo_tokens TYPE REF TO zcl_aoc_boolean_tokens.
lo_tokens = lcl_parse=>parse( iv_code ).
cl_abap_unit_assert=>assert_equals(
act = lo_tokens->to_string( )
exp = to_upper( iv_code ) ).
ENDMETHOD.
METHOD to_string01.
test_to_string( 'foo = bar' ).
ENDMETHOD.
METHOD to_string02.
test_to_string( 'moo = foo-bar' ).
ENDMETHOD.
METHOD to_string03.
test_to_string( 'moo = foo->bar' ).
ENDMETHOD.
METHOD to_string04.
test_to_string( 'moo = foo->bar( 2 )' ).
ENDMETHOD.
ENDCLASS.
CLASS ltcl_replace DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL.
PRIVATE SECTION.
METHODS:
test_replace
IMPORTING
iv_code TYPE string
iv_start TYPE i
iv_end TYPE i OPTIONAL
iv_replace TYPE string
iv_expected TYPE string,
replace01 FOR TESTING,
replace02 FOR TESTING.
ENDCLASS.
CLASS ltcl_replace IMPLEMENTATION.
METHOD test_replace.
DATA: lo_tokens TYPE REF TO zcl_aoc_boolean_tokens.
lo_tokens = lcl_parse=>parse( iv_code )->replace( iv_start = iv_start
iv_end = iv_end
iv_str = iv_replace ).
cl_abap_unit_assert=>assert_equals(
act = lo_tokens->to_string( )
exp = to_upper( iv_expected ) ).
ENDMETHOD.
METHOD replace01.
test_replace( iv_code = 'moo boo foo'
iv_start = 2
iv_replace = 'baa'
iv_expected = 'moo baa foo' ).
ENDMETHOD.
METHOD replace02.
test_replace( iv_code = 'moo boo foo'
iv_start = 2
iv_end = 3
iv_replace = 'baa'
iv_expected = 'moo baa' ).
ENDMETHOD.
ENDCLASS.
CLASS ltcl_test DEFINITION FOR TESTING DURATION SHORT RISK LEVEL HARMLESS FINAL.
PRIVATE SECTION.
METHODS:
test_remove IMPORTING iv_code TYPE string
iv_index TYPE i
iv_expected TYPE string,
remove01 FOR TESTING.
ENDCLASS. "ltcl_Test
CLASS ltcl_test IMPLEMENTATION.
METHOD test_remove.
DATA: lo_tokens TYPE REF TO zcl_aoc_boolean_tokens.
lo_tokens = lcl_parse=>parse( iv_code )->remove( iv_index ).
cl_abap_unit_assert=>assert_equals(
act = lo_tokens->to_string( )
exp = to_upper( iv_expected ) ).
ENDMETHOD.
METHOD remove01.
test_remove( iv_code = 'foo bar'
iv_index = 2
iv_expected = 'foo' ).
ENDMETHOD.
ENDCLASS.
| 21.271111 | 90 | 0.612829 |
f790ded2e6a5759189f09f310ab1b011da1d719f | 13,005 | abap | ABAP | src/zcl_excel_graph.clas.abap | gabrielros/abap2xlsx_ES | 3f913357547d18a28f09aae122e5464079458ff7 | [
"Apache-2.0"
] | 1 | 2021-04-30T19:32:09.000Z | 2021-04-30T19:32:09.000Z | src/zcl_excel_graph.clas.abap | egorovantony/abap2xlsx | 6356cad9f34610d5959573232cd675780233ccaf | [
"Apache-2.0"
] | null | null | null | src/zcl_excel_graph.clas.abap | egorovantony/abap2xlsx | 6356cad9f34610d5959573232cd675780233ccaf | [
"Apache-2.0"
] | null | null | null | class ZCL_EXCEL_GRAPH definition
public
create public .
public section.
types:
*"* public components of class ZCL_EXCEL_GRAPH
*"* do not include other source files here!!!
BEGIN OF s_style,
c14style type i,
cstyle type i,
end of s_style .
types:
BEGIN OF s_series,
idx TYPE i,
order TYPE i,
invertifnegative TYPE string,
symbol TYPE string,
smooth TYPE string,
lbl TYPE string,
ref TYPE string,
sername TYPE string,
END OF s_series .
types:
t_series TYPE STANDARD TABLE OF s_series .
types:
BEGIN OF s_pagemargins,
b TYPE string,
l TYPE string,
r TYPE string,
t TYPE string,
header TYPE string,
footer TYPE string,
END OF s_pagemargins .
data NS_1904VAL type STRING value '0'. "#EC NOTEXT . . . . . . . . . . " .
data NS_LANGVAL type STRING value 'it-IT'. "#EC NOTEXT . . . . . . . . . . " .
data NS_ROUNDEDCORNERSVAL type STRING value '0'. "#EC NOTEXT . . . . . . . . . . " .
data PAGEMARGINS type S_PAGEMARGINS .
data NS_AUTOTITLEDELETEDVAL type STRING value '0'. "#EC NOTEXT . . . . . . . . . . " .
data NS_PLOTVISONLYVAL type STRING value '1'. "#EC NOTEXT . . . . . . . . . . " .
data NS_DISPBLANKSASVAL type STRING value 'gap'. "#EC NOTEXT . . . . . . . . . . " .
data NS_SHOWDLBLSOVERMAXVAL type STRING value '0'. "#EC NOTEXT . . . . . . . . . . " .
data SERIES type T_SERIES .
data NS_C14STYLEVAL type STRING value '102'. "#EC NOTEXT . . . . . . . . . . " .
data PRINT_LABEL type C value 'X'. "#EC NOTEXT . . . . . . . . . . " .
data NS_STYLEVAL type STRING value '2'. "#EC NOTEXT . . . . . . . . . . " .
constants:
BEGIN OF c_style_default,
c14style type i value 102,
cstyle type i value 2,
END OF c_style_default .
constants:
BEGIN OF c_style_1,
c14style type i value 101,
cstyle type i value 1,
END OF c_style_1 .
constants:
BEGIN OF c_style_3,
c14style type i value 103,
cstyle type i value 3,
END OF c_style_3 .
constants:
BEGIN OF c_style_4,
c14style type i value 104,
cstyle type i value 4,
END OF c_style_4 .
constants:
BEGIN OF c_style_5,
c14style type i value 105,
cstyle type i value 5,
END OF c_style_5 .
constants:
BEGIN OF c_style_6,
c14style type i value 106,
cstyle type i value 6,
END OF c_style_6 .
constants:
BEGIN OF c_style_7,
c14style type i value 107,
cstyle type i value 7,
END OF c_style_7 .
constants:
BEGIN OF c_style_8,
c14style type i value 108,
cstyle type i value 8,
END OF c_style_8 .
constants:
BEGIN OF c_style_9,
c14style type i value 109,
cstyle type i value 9,
END OF c_style_9 .
constants:
BEGIN OF c_style_10,
c14style type i value 110,
cstyle type i value 10,
END OF c_style_10 .
constants:
BEGIN OF c_style_11,
c14style type i value 111,
cstyle type i value 11,
END OF c_style_11 .
constants:
BEGIN OF c_style_12,
c14style type i value 112,
cstyle type i value 12,
END OF c_style_12 .
constants:
BEGIN OF c_style_13,
c14style type i value 113,
cstyle type i value 13,
END OF c_style_13 .
constants:
BEGIN OF c_style_14,
c14style type i value 114,
cstyle type i value 14,
END OF c_style_14 .
constants:
BEGIN OF c_style_15,
c14style type i value 115,
cstyle type i value 15,
END OF c_style_15 .
constants:
BEGIN OF c_style_16,
c14style type i value 116,
cstyle type i value 16,
END OF c_style_16 .
constants:
BEGIN OF c_style_17,
c14style type i value 117,
cstyle type i value 17,
END OF c_style_17 .
constants:
BEGIN OF c_style_18,
c14style type i value 118,
cstyle type i value 18,
END OF c_style_18 .
constants:
BEGIN OF c_style_19,
c14style type i value 119,
cstyle type i value 19,
END OF c_style_19 .
constants:
BEGIN OF c_style_20,
c14style type i value 120,
cstyle type i value 20,
END OF c_style_20 .
constants:
BEGIN OF c_style_21,
c14style type i value 121,
cstyle type i value 21,
END OF c_style_21 .
constants:
BEGIN OF c_style_22,
c14style type i value 122,
cstyle type i value 22,
END OF c_style_22 .
constants:
BEGIN OF c_style_23,
c14style type i value 123,
cstyle type i value 23,
END OF c_style_23 .
constants:
BEGIN OF c_style_24,
c14style type i value 124,
cstyle type i value 24,
END OF c_style_24 .
constants:
BEGIN OF c_style_25,
c14style type i value 125,
cstyle type i value 25,
END OF c_style_25 .
constants:
BEGIN OF c_style_26,
c14style type i value 126,
cstyle type i value 26,
END OF c_style_26 .
constants:
BEGIN OF c_style_27,
c14style type i value 127,
cstyle type i value 27,
END OF c_style_27 .
constants:
BEGIN OF c_style_28,
c14style type i value 128,
cstyle type i value 28,
END OF c_style_28 .
constants:
BEGIN OF c_style_29,
c14style type i value 129,
cstyle type i value 29,
END OF c_style_29 .
constants:
BEGIN OF c_style_30,
c14style type i value 130,
cstyle type i value 30,
END OF c_style_30 .
constants:
BEGIN OF c_style_31,
c14style type i value 131,
cstyle type i value 31,
END OF c_style_31 .
constants:
BEGIN OF c_style_32,
c14style type i value 132,
cstyle type i value 32,
END OF c_style_32 .
constants:
BEGIN OF c_style_33,
c14style type i value 133,
cstyle type i value 33,
END OF c_style_33 .
constants:
BEGIN OF c_style_34,
c14style type i value 134,
cstyle type i value 34,
END OF c_style_34 .
constants:
BEGIN OF c_style_35,
c14style type i value 135,
cstyle type i value 35,
END OF c_style_35 .
constants:
BEGIN OF c_style_36,
c14style type i value 136,
cstyle type i value 36,
END OF c_style_36 .
constants:
BEGIN OF c_style_37,
c14style type i value 137,
cstyle type i value 37,
END OF c_style_37 .
constants:
BEGIN OF c_style_38,
c14style type i value 138,
cstyle type i value 38,
END OF c_style_38 .
constants:
BEGIN OF c_style_39,
c14style type i value 139,
cstyle type i value 39,
END OF c_style_39 .
constants:
BEGIN OF c_style_40,
c14style type i value 140,
cstyle type i value 40,
END OF c_style_40 .
constants:
BEGIN OF c_style_41,
c14style type i value 141,
cstyle type i value 41,
END OF c_style_41 .
constants:
BEGIN OF c_style_42,
c14style type i value 142,
cstyle type i value 42,
END OF c_style_42 .
constants:
BEGIN OF c_style_43,
c14style type i value 143,
cstyle type i value 43,
END OF c_style_43 .
constants:
BEGIN OF c_style_44,
c14style type i value 144,
cstyle type i value 44,
END OF c_style_44 .
constants:
BEGIN OF c_style_45,
c14style type i value 145,
cstyle type i value 45,
END OF c_style_45 .
constants:
BEGIN OF c_style_46,
c14style type i value 146,
cstyle type i value 46,
END OF c_style_46 .
constants:
BEGIN OF c_style_47,
c14style type i value 147,
cstyle type i value 47,
END OF c_style_47 .
constants:
BEGIN OF c_style_48,
c14style type i value 148,
cstyle type i value 48,
END OF c_style_48 .
constants C_SHOW_TRUE type C value '1'. "#EC NOTEXT
constants C_SHOW_FALSE type C value '0'. "#EC NOTEXT
constants C_PRINT_LBL_TRUE type C value '1'. "#EC NOTEXT
constants C_PRINT_LBL_FALSE type C value '0'. "#EC NOTEXT
methods CONSTRUCTOR .
methods CREATE_SERIE
importing
!IP_IDX type I optional
!IP_ORDER type I
!IP_INVERTIFNEGATIVE type STRING optional
!IP_SYMBOL type STRING optional
!IP_SMOOTH type C optional
!IP_LBL_FROM_COL type ZEXCEL_CELL_COLUMN_ALPHA optional
!IP_LBL_FROM_ROW type ZEXCEL_CELL_ROW optional
!IP_LBL_TO_COL type ZEXCEL_CELL_COLUMN_ALPHA optional
!IP_LBL_TO_ROW type ZEXCEL_CELL_ROW optional
!IP_LBL type STRING optional
!IP_REF_FROM_COL type ZEXCEL_CELL_COLUMN_ALPHA optional
!IP_REF_FROM_ROW type ZEXCEL_CELL_ROW optional
!IP_REF_TO_COL type ZEXCEL_CELL_COLUMN_ALPHA optional
!IP_REF_TO_ROW type ZEXCEL_CELL_ROW optional
!IP_REF type STRING optional
!IP_SERNAME type STRING
!IP_SHEET type ZEXCEL_SHEET_TITLE optional .
methods SET_STYLE
importing
!IP_STYLE type S_STYLE .
methods SET_PRINT_LBL
importing
!IP_VALUE type C .
protected section.
*"* protected components of class ZCL_EXCEL_GRAPH
*"* do not include other source files here!!!
private section.
*"* private components of class ZCL_EXCEL_GRAPH
*"* do not include other source files here!!!
ENDCLASS.
CLASS ZCL_EXCEL_GRAPH IMPLEMENTATION.
method CONSTRUCTOR.
"Load default values
me->pagemargins-b = '0.75'.
me->pagemargins-l = '0.7'.
me->pagemargins-r = '0.7'.
me->pagemargins-t = '0.75'.
me->pagemargins-header = '0.3'.
me->pagemargins-footer = '0.3'.
endmethod.
method CREATE_SERIE.
DATA ls_serie TYPE s_series.
DATA: lv_start_row_c TYPE char7,
lv_stop_row_c TYPE char7.
IF ip_lbl IS NOT SUPPLIED.
lv_stop_row_c = ip_lbl_to_row.
SHIFT lv_stop_row_c RIGHT DELETING TRAILING space.
SHIFT lv_stop_row_c LEFT DELETING LEADING space.
lv_start_row_c = ip_lbl_from_row.
SHIFT lv_start_row_c RIGHT DELETING TRAILING space.
SHIFT lv_start_row_c LEFT DELETING LEADING space.
ls_serie-lbl = ip_sheet.
ls_serie-lbl = zcl_excel_common=>escape_string( ip_value = ls_serie-lbl ).
CONCATENATE ls_serie-lbl '!$' ip_lbl_from_col '$' lv_start_row_c ':$' ip_lbl_to_col '$' lv_stop_row_c INTO ls_serie-lbl.
CLEAR: lv_start_row_c, lv_stop_row_c.
ELSE.
ls_serie-lbl = ip_lbl.
ENDIF.
IF ip_ref IS NOT SUPPLIED.
lv_stop_row_c = ip_ref_to_row.
SHIFT lv_stop_row_c RIGHT DELETING TRAILING space.
SHIFT lv_stop_row_c LEFT DELETING LEADING space.
lv_start_row_c = ip_ref_from_row.
SHIFT lv_start_row_c RIGHT DELETING TRAILING space.
SHIFT lv_start_row_c LEFT DELETING LEADING space.
ls_serie-ref = ip_sheet.
ls_serie-ref = zcl_excel_common=>escape_string( ip_value = ls_serie-ref ).
CONCATENATE ls_serie-ref '!$' ip_ref_from_col '$' lv_start_row_c ':$' ip_ref_to_col '$' lv_stop_row_c INTO ls_serie-ref.
CLEAR: lv_start_row_c, lv_stop_row_c.
ELSE.
ls_serie-ref = ip_ref.
ENDIF.
ls_serie-idx = ip_idx.
ls_serie-order = ip_order.
ls_serie-invertifnegative = ip_invertifnegative.
ls_serie-symbol = ip_symbol.
ls_serie-smooth = ip_smooth.
ls_serie-sername = ip_sername.
APPEND ls_serie TO me->series.
SORT me->series BY order ASCENDING.
endmethod.
method SET_PRINT_LBL.
me->print_label = ip_value.
endmethod.
method SET_STYLE.
me->ns_c14styleval = ip_style-c14style.
CONDENSE me->ns_c14styleval NO-GAPS.
me->ns_styleval = ip_style-cstyle.
CONDENSE me->ns_styleval NO-GAPS.
endmethod.
ENDCLASS.
| 32.350746 | 124 | 0.578624 |
f7952c3cc207b9a5900fa1755ae6fd057067fc39 | 4,912 | abap | ABAP | src/objects/zcl_abapgit_object_dsys.clas.abap | IvxLars/abapGit | bcdeebb3ad1432034b5ad1ea40683470956b8e07 | [
"MIT"
] | null | null | null | src/objects/zcl_abapgit_object_dsys.clas.abap | IvxLars/abapGit | bcdeebb3ad1432034b5ad1ea40683470956b8e07 | [
"MIT"
] | null | null | null | src/objects/zcl_abapgit_object_dsys.clas.abap | IvxLars/abapGit | bcdeebb3ad1432034b5ad1ea40683470956b8e07 | [
"MIT"
] | null | null | null | CLASS zcl_abapgit_object_dsys DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
METHODS constructor
IMPORTING
is_item TYPE zif_abapgit_definitions=>ty_item
iv_language TYPE spras.
PROTECTED SECTION.
PRIVATE SECTION.
CONSTANTS: c_typ TYPE dokhl-typ VALUE 'E',
c_id TYPE dokhl-id VALUE 'HY'.
DATA: mv_doc_object TYPE sobj_name.
TYPES: BEGIN OF ty_data,
doctitle TYPE dsyst-doktitle,
head TYPE thead,
lines TYPE tline_tab,
END OF ty_data.
METHODS deserialize_dsys
IMPORTING
ii_xml TYPE REF TO zif_abapgit_xml_input
RAISING
zcx_abapgit_exception.
METHODS get_main_lang
RETURNING
VALUE(rv_language) TYPE spras.
ENDCLASS.
CLASS zcl_abapgit_object_dsys IMPLEMENTATION.
METHOD constructor.
DATA: lv_prefix TYPE namespace,
lv_bare_name TYPE progname.
super->constructor( is_item = is_item
iv_language = iv_language ).
IF ms_item-obj_name(1) = '/'.
CALL FUNCTION 'RS_NAME_SPLIT_NAMESPACE'
EXPORTING
name_with_namespace = ms_item-obj_name
IMPORTING
namespace = lv_prefix
name_without_namespace = lv_bare_name.
ELSE.
lv_bare_name = ms_item-obj_name.
ENDIF.
mv_doc_object = |{ lv_bare_name+0(4) }{ lv_prefix }{ lv_bare_name+4(*) }|.
ENDMETHOD.
METHOD deserialize_dsys.
DATA: ls_data TYPE ty_data,
ls_docu_info TYPE dokil,
lv_version TYPE dokvers,
lv_doku_obj TYPE doku_obj.
lv_doku_obj = mv_doc_object.
ii_xml->read( EXPORTING iv_name = 'DSYS'
CHANGING cg_data = ls_data ).
CALL FUNCTION 'DOCU_INIT'
EXPORTING
id = c_id
langu = mv_language
object = lv_doku_obj
typ = c_typ
IMPORTING
xdokil = ls_docu_info.
lv_version = ls_docu_info-version.
CALL FUNCTION 'DOCU_UPDATE'
EXPORTING
head = ls_data-head
state = 'A'
typ = c_typ
version = lv_version
TABLES
line = ls_data-lines.
ENDMETHOD.
METHOD get_main_lang.
SELECT SINGLE langu FROM dokil INTO rv_language
WHERE id = c_id
AND object = mv_doc_object
AND masterlang = abap_true.
IF sy-subrc <> 0.
rv_language = mv_language.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
rv_user = zcl_abapgit_factory=>get_longtexts( )->changed_by(
iv_object_name = mv_doc_object
iv_longtext_id = c_id ).
ENDMETHOD.
METHOD zif_abapgit_object~delete.
zcl_abapgit_factory=>get_longtexts( )->delete(
iv_object_name = mv_doc_object
iv_longtext_id = c_id ).
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_metadata TYPE zif_abapgit_definitions=>ty_metadata.
ls_metadata = io_xml->get_metadata( ).
CASE ls_metadata-version.
WHEN 'v1.0.0'.
deserialize_dsys( io_xml ).
WHEN 'v2.0.0'.
zcl_abapgit_factory=>get_longtexts( )->deserialize(
ii_xml = io_xml
iv_main_language = mv_language ).
WHEN OTHERS.
zcx_abapgit_exception=>raise( 'unsupported DSYS version' ).
ENDCASE.
tadir_insert( iv_package ).
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_count TYPE i.
SELECT SINGLE COUNT( * ) FROM dokil INTO lv_count
WHERE id = c_id
AND object = mv_doc_object. "#EC CI_GENBUFF
rv_bool = boolc( lv_count > 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~get_comparator.
RETURN.
ENDMETHOD.
METHOD zif_abapgit_object~get_deserialize_steps.
APPEND zif_abapgit_object=>gc_step_id-abap TO rt_steps.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-delete_tadir = abap_true.
rs_metadata-version = 'v2.0.0'.
ENDMETHOD.
METHOD zif_abapgit_object~is_active.
rv_active = is_active( ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
DATA lv_lang TYPE sy-langu.
lv_lang = get_main_lang( ).
CALL FUNCTION 'DSYS_EDIT'
EXPORTING
dokclass = mv_doc_object+0(4)
dokname = mv_doc_object+4(*)
doklangu = lv_lang
EXCEPTIONS
class_unknown = 1
object_not_found = 2
OTHERS = 3.
rv_exit = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
zcl_abapgit_factory=>get_longtexts( )->serialize(
iv_object_name = mv_doc_object
iv_longtext_id = c_id
ii_xml = io_xml ).
ENDMETHOD.
ENDCLASS.
| 21.356522 | 96 | 0.638233 |
f796d93ec6e350aa6b4056918162d9d18deefc8c | 1,068 | abap | ABAP | src/legacy/flight_travel_api.fugr.flight_travel_delete.abap | anusurbab/Demo | a2838959321a113e80a856422f2ccaff48f90290 | [
"BSD-Source-Code"
] | null | null | null | src/legacy/flight_travel_api.fugr.flight_travel_delete.abap | anusurbab/Demo | a2838959321a113e80a856422f2ccaff48f90290 | [
"BSD-Source-Code"
] | null | null | null | src/legacy/flight_travel_api.fugr.flight_travel_delete.abap | anusurbab/Demo | a2838959321a113e80a856422f2ccaff48f90290 | [
"BSD-Source-Code"
] | null | null | null | "! <h1>API for Deleting a Travel</h1>
"!
"! <p>
"! Function module to delete a single Travel instance.
"! It will also delete all related subnodes of Booking and Booking Supplement.
"! </p>
"!
"! @parameter iv_travel_id | ID of the Travel to be deleted
"! @parameter et_messages | Table of occurred messages
"!
FUNCTION flight_travel_delete.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IV_TRAVEL_ID) TYPE TRAVEL_ID
*" EXPORTING
*" REFERENCE(ET_MESSAGES) TYPE T_MESSAGE
*"----------------------------------------------------------------------
CLEAR et_messages.
cl_flight_legacy=>get_instance( )->delete_travel( EXPORTING iv_travel_id = iv_travel_id
IMPORTING et_messages = DATA(lt_messages) ).
cl_flight_legacy=>get_instance( )->convert_messages( EXPORTING it_messages = lt_messages
IMPORTING et_messages = et_messages ).
ENDFUNCTION.
| 39.555556 | 102 | 0.552434 |
f79cc52cc0b09c0c5c70642ee83a0ca1f895186b | 459 | abap | ABAP | src/zunitdemo_simpl4.clas.abap | RainerWinkler/ABAP-Unit-Test-Demo | ab84490e0450c4bde65473f55042ab3ed6a4ea64 | [
"MIT"
] | 1 | 2020-09-26T11:09:54.000Z | 2020-09-26T11:09:54.000Z | src/zunitdemo_simpl4.clas.abap | RainerWinkler/ABAP-Unit-Test-Demo | ab84490e0450c4bde65473f55042ab3ed6a4ea64 | [
"MIT"
] | null | null | null | src/zunitdemo_simpl4.clas.abap | RainerWinkler/ABAP-Unit-Test-Demo | ab84490e0450c4bde65473f55042ab3ed6a4ea64 | [
"MIT"
] | 3 | 2019-11-25T17:30:22.000Z | 2022-02-11T06:38:02.000Z | CLASS zunitdemo_simpl4 DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
METHODS get_actual_day
RETURNING
VALUE(r_result) TYPE numc2.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zunitdemo_simpl4 IMPLEMENTATION.
METHOD get_actual_day.
DATA: date TYPE sy-datum.
" Test 002
TEST-SEAM sy_datum.
date = sy-datum.
END-TEST-SEAM.
r_result = date+6(2).
ENDMETHOD.
ENDCLASS.
| 13.114286 | 38 | 0.668845 |
f79eb92de63bb438e2e80da24785ada5ba1348fa | 9,893 | abap | ABAP | src/ycl_addict_alv.clas.abap | keremkoseoglu/addict | f33dc426aee267eb70c02ce8f4c3030ca99500e4 | [
"Apache-2.0"
] | 8 | 2020-10-30T13:19:02.000Z | 2022-01-04T19:28:37.000Z | src/ycl_addict_alv.clas.abap | aufaraditya/addict | 4f2e19ea1d2ffbf228bfd5cc0231cd17b792b372 | [
"Apache-2.0"
] | 22 | 2020-10-19T13:35:53.000Z | 2022-02-10T12:55:54.000Z | src/ycl_addict_alv.clas.abap | aufaraditya/addict | 4f2e19ea1d2ffbf228bfd5cc0231cd17b792b372 | [
"Apache-2.0"
] | 6 | 2020-11-03T21:39:50.000Z | 2022-03-10T02:21:41.000Z | CLASS ycl_addict_alv DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
TYPES: BEGIN OF form_dict,
html_end_of_list TYPE slis_formname,
pf_status TYPE slis_formname,
user_command TYPE slis_formname,
END OF form_dict.
TYPES field_list TYPE STANDARD TABLE OF fieldname WITH EMPTY KEY.
TYPES: BEGIN OF build_fcat_input_dict,
structure TYPE tabname,
itab_name TYPE tabname,
tech_fields TYPE field_list,
edit_fields TYPE field_list,
hotspot_fields TYPE field_list,
checkbox_fields TYPE field_list,
END OF build_fcat_input_dict.
CONSTANTS: BEGIN OF default_fields,
alvsl TYPE fieldname VALUE 'ALVSL',
celltab TYPE fieldname VALUE 'CELLTAB',
END OF default_fields.
CONSTANTS: BEGIN OF default_forms,
html_end_of_list TYPE slis_formname VALUE 'HTML_END_OF_LIST',
pf_status TYPE slis_formname VALUE 'PF_STATUS',
user_command TYPE slis_formname VALUE 'USER_COMMAND',
END OF default_forms.
DATA cprog TYPE sycprog.
DATA itab TYPE REF TO data.
DATA forms TYPE form_dict.
DATA layout TYPE slis_layout_alv.
DATA fcat TYPE slis_t_fieldcat_alv.
METHODS constructor
IMPORTING !itab TYPE REF TO data
!cprog TYPE sy-cprog OPTIONAL
!forms TYPE form_dict OPTIONAL
!layout TYPE slis_layout_alv OPTIONAL
!fcat TYPE slis_t_fieldcat_alv OPTIONAL
!fcat_param TYPE build_fcat_input_dict OPTIONAL
RAISING ycx_addict_alv.
METHODS build_fcat
IMPORTING !input TYPE build_fcat_input_dict
RAISING ycx_addict_alv.
METHODS show_grid RAISING ycx_addict_alv.
METHODS show_list RAISING ycx_addict_alv.
METHODS show RAISING ycx_addict_alv.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES field_range TYPE RANGE OF fieldname.
CONSTANTS alv_save TYPE char1 VALUE 'A'.
CLASS-METHODS conv_field_list_to_range
IMPORTING !list TYPE field_list
RETURNING VALUE(range) TYPE field_range.
METHODS set_fcat_from_itab RAISING ycx_addict_alv.
METHODS set_fcat_from_itab_line
IMPORTING !line TYPE REF TO data
RAISING ycx_addict_alv.
ENDCLASS.
CLASS ycl_addict_alv IMPLEMENTATION.
METHOD constructor.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Object creation
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
me->cprog = cprog.
me->itab = itab.
me->forms = forms.
IF fcat IS NOT INITIAL.
me->fcat = fcat.
ELSEIF fcat_param IS NOT INITIAL.
build_fcat( fcat_param ).
ELSE.
TRY.
set_fcat_from_itab( ).
CATCH cx_root ##no_handler .
ENDTRY.
ENDIF.
me->layout = COND #(
WHEN layout IS SUPPLIED THEN layout
ELSE VALUE #( zebra = abap_true
colwidth_optimize = abap_true ) ).
ENDMETHOD.
METHOD build_fcat.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Builds FCAT out of structure
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
TRY.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_internal_tabname = input-itab_name
i_structure_name = input-structure
CHANGING
ct_fieldcat = me->fcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3 ##FM_SUBRC_OK.
ycx_addict_function_subrc=>raise_if_sysubrc_not_initial( 'REUSE_ALV_FIELDCATALOG_MERGE' ).
IF input-edit_fields IS NOT INITIAL.
DATA(edit_rng) = conv_field_list_to_range( input-edit_fields ).
MODIFY me->fcat FROM VALUE #( edit = abap_true )
TRANSPORTING edit
WHERE fieldname IN edit_rng.
ENDIF.
IF input-tech_fields IS NOT INITIAL.
DATA(tech_rng) = conv_field_list_to_range( input-tech_fields ).
MODIFY me->fcat FROM VALUE #( tech = abap_true )
TRANSPORTING tech
WHERE fieldname IN tech_rng.
ENDIF.
IF input-hotspot_fields IS NOT INITIAL.
DATA(hotspot_rng) = conv_field_list_to_range( input-hotspot_fields ).
MODIFY me->fcat FROM VALUE #( hotspot = abap_true )
TRANSPORTING hotspot
WHERE fieldname IN hotspot_rng.
ENDIF.
IF input-checkbox_fields IS NOT INITIAL.
DATA(checkbox_rng) = conv_field_list_to_range( input-checkbox_fields ).
MODIFY me->fcat FROM VALUE #( checkbox = abap_true )
TRANSPORTING checkbox
WHERE fieldname IN checkbox_rng.
ENDIF.
CATCH ycx_addict_alv INTO DATA(alv_error).
RAISE EXCEPTION alv_error.
CATCH cx_root INTO DATA(diaper).
RAISE EXCEPTION TYPE ycx_addict_alv
EXPORTING
textid = ycx_addict_alv=>fcat_creation_error
previous = diaper.
ENDTRY.
ENDMETHOD.
METHOD show_grid.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Display grid
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
FIELD-SYMBOLS <itab> TYPE STANDARD TABLE.
TRY.
ASSIGN me->itab->* TO <itab>.
DATA(grid_settings) = VALUE lvc_s_glay( edt_cll_cb = ycl_addict_gui_toolkit=>is_gui_on( ) ).
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = me->cprog
i_callback_pf_status_set = me->forms-pf_status
i_callback_user_command = me->forms-user_command
i_callback_html_end_of_list = me->forms-html_end_of_list
i_grid_settings = grid_settings
is_layout = me->layout
it_fieldcat = me->fcat
i_save = me->alv_save
TABLES
t_outtab = <itab>
EXCEPTIONS
program_error = 1
OTHERS = 2 ##FM_SUBRC_OK.
ycx_addict_function_subrc=>raise_if_sysubrc_not_initial( 'REUSE_ALV_GRID_DISPLAY' ).
CATCH ycx_addict_alv INTO DATA(alv_error).
RAISE EXCEPTION alv_error.
CATCH cx_root INTO DATA(diaper).
RAISE EXCEPTION TYPE ycx_addict_alv
EXPORTING
textid = ycx_addict_alv=>grid_error
previous = diaper.
ENDTRY.
ENDMETHOD.
METHOD show_list.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Display list
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
FIELD-SYMBOLS <itab> TYPE STANDARD TABLE.
TRY.
ASSIGN me->itab->* TO <itab>.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = me->cprog
i_callback_pf_status_set = me->forms-pf_status
i_callback_user_command = me->forms-user_command
is_layout = me->layout
it_fieldcat = me->fcat
i_save = me->alv_save
TABLES
t_outtab = <itab>
EXCEPTIONS
program_error = 1
OTHERS = 2 ##FM_SUBRC_OK.
ycx_addict_function_subrc=>raise_if_sysubrc_not_initial( 'REUSE_ALV_LIST_DISPLAY' ).
CATCH ycx_addict_alv INTO DATA(alv_error).
RAISE EXCEPTION alv_error.
CATCH cx_root INTO DATA(diaper).
RAISE EXCEPTION TYPE ycx_addict_alv
EXPORTING
textid = ycx_addict_alv=>grid_error
previous = diaper.
ENDTRY.
ENDMETHOD.
METHOD show.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Display grid or list, depending on SY-BATCH
" Why? Grid produces an error in case the program is in the background
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
CASE sy-batch.
WHEN abap_true . show_list( ).
WHEN abap_false. show_grid( ).
ENDCASE.
ENDMETHOD.
METHOD conv_field_list_to_range.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Convert field list to field range
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
range = VALUE #(
FOR _field IN list (
sign = ycl_addict_toolkit=>sign-include
option = ycl_addict_toolkit=>option-eq
low = _field ) ).
ENDMETHOD.
METHOD set_fcat_from_itab.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sets the field catalog from the passed internal table
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
FIELD-SYMBOLS <itab> TYPE STANDARD TABLE.
ASSIGN me->itab->* TO <itab>.
IF <itab> IS INITIAL.
DATA(itab_was_initial) = abap_true.
APPEND INITIAL LINE TO <itab>.
ENDIF.
ASSIGN <itab>[ 1 ] TO FIELD-SYMBOL(<line>).
set_fcat_from_itab_line( REF #( <line> ) ).
IF itab_was_initial = abap_true.
CLEAR <itab>.
ENDIF.
ENDMETHOD.
METHOD set_fcat_from_itab_line.
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" Sets the field catalog from the passed internal table line
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
DATA(dscr) = cl_abap_typedescr=>describe_by_data_ref( line ).
DATA(name) = dscr->get_relative_name( ).
build_fcat( VALUE #( structure = name ) ).
ENDMETHOD.
ENDCLASS.
| 33.64966 | 100 | 0.538765 |
f7a0f04998313cf8a69e6baf61aebbde6402ef6f | 36,430 | abap | ABAP | src/zcl_eui_type.clas.abap | bizhuka/eui | 90695f86799f3baf15b99951e2f17281fc2ae3e9 | [
"Apache-2.0"
] | 43 | 2020-04-28T07:35:31.000Z | 2022-02-28T02:40:57.000Z | src/zcl_eui_type.clas.abap | bizhuka/eui | 90695f86799f3baf15b99951e2f17281fc2ae3e9 | [
"Apache-2.0"
] | 2 | 2020-04-23T16:07:01.000Z | 2020-04-25T07:29:54.000Z | src/zcl_eui_type.clas.abap | bizhuka/eui | 90695f86799f3baf15b99951e2f17281fc2ae3e9 | [
"Apache-2.0"
] | 5 | 2020-04-23T07:42:26.000Z | 2021-05-13T12:19:32.000Z | class ZCL_EUI_TYPE definition
public
final
create public .
public section.
*"* public components of class ZCL_EUI_TYPE
*"* do not include other source files here!!!
type-pools ABAP .
types:
BEGIN OF ts_field_desc,
name TYPE zdeui_attr_name, " abap_attrname, " 61 char
sys_type TYPE abap_typekind, " SYSTEM
ui_type TYPE zdeui_ui_type, " Only for KIND = P
length TYPE i, " Only for KIND = P
decimals TYPE i, " Only for KIND = P
" For editing in ALV
rollname TYPE zdeui_db_field,
label TYPE dfies-fieldtext,
f4_table TYPE zdeui_f4_table,
" Table description
table_kind TYPE abap_tablekind,
unique TYPE abap_bool,
key TYPE abap_keydescr_tab,
key_defkind TYPE abap_keydefkind,
sub_fdesc TYPE string,
END OF ts_field_desc .
types:
tt_field_desc TYPE HASHED TABLE OF ts_field_desc WITH UNIQUE KEY name .
types:
tt_unique_type TYPE SORTED TABLE OF string WITH UNIQUE KEY table_line .
constants:
BEGIN OF MC_UI_TYPE,
" Simple UI types
CHAR type ZDEUI_UI_TYPE value 'char',
NUMC type ZDEUI_UI_TYPE value 'numc',
NUMERIC type ZDEUI_UI_TYPE value 'numeric',
BOOLEAN type ZDEUI_UI_TYPE value 'boolean',
DATE type ZDEUI_UI_TYPE value 'date',
TIME type ZDEUI_UI_TYPE value 'time',
DATETIME type ZDEUI_UI_TYPE value 'datetime',
" Complext UI types
STRING type ZDEUI_UI_TYPE value 'string',
RANGE type ZDEUI_UI_TYPE value 'range',
TABLE type ZDEUI_UI_TYPE value 'table',
" For tech only
STRUCT type ZDEUI_UI_TYPE value 'struct',
OBJECT type ZDEUI_UI_TYPE value 'object',
END OF MC_UI_TYPE .
class-methods GET_CATALOG
importing
value(IO_SALV) type ref to CL_SALV_TABLE optional
!IR_TABLE type ref to DATA optional
value(IR_STRUC) type ref to DATA optional
!IO_STRUC type ref to CL_ABAP_STRUCTDESCR optional
!IV_SORT type ABAP_BOOL optional
!IV_TUNE_UP type ABAP_BOOL default ABAP_TRUE
returning
value(RT_FIELDCAT) type LVC_T_FCAT .
class-methods GET_MOD_CATALOG
importing
!IR_TABLE type ref to DATA
!IT_MOD_CATALOG type LVC_T_FCAT
returning
value(RT_CATALOG) type LVC_T_FCAT .
class-methods IS_LIST_BOX
importing
!IV_TABNAME type DFIES-TABNAME
!IV_FIELDNAME type DFIES-FIELDNAME
exporting
!EV_LIST_BOX type ABAP_BOOL
!ES_SH_DESC type SHLP_DESCR .
class-methods SPLIT_TYPE
importing
!IV_DATATYPE type CSEQUENCE
exporting
!EV_TABLE type CSEQUENCE
!EV_FIELD type CSEQUENCE .
class-methods FIND_DROPDOWN
importing
!IO_GRID type ref to CL_GUI_ALV_GRID
changing
!CS_FIELDCAT type LVC_S_FCAT
!CV_DRDN_HNDL type I .
class-methods GET_FIELD_DESC
importing
!IV_FIELD_NAME type CSEQUENCE optional
!IV_DATA type ANY optional
!IS_SH_FIELD type DFIES optional
!IR_UNIQUE_TYPE type ref to TT_UNIQUE_TYPE optional
!IV_TECH type ABAP_BOOL optional
returning
value(RS_FIELD_DESC) type TS_FIELD_DESC
raising
ZCX_EUI_EXCEPTION .
class-methods CREATE_TYPE_DESCR
importing
!IV_ROLLNAME type CSEQUENCE optional
!IS_FIELD_DESC type TS_FIELD_DESC optional
value(IR_TYPE) type ref to DATA optional
returning
value(RO_TYPE) type ref to CL_ABAP_DATADESCR
raising
ZCX_EUI_EXCEPTION .
class-methods CREATE_STRUCTURE
importing
!IO_RANGE type ref to CL_ABAP_DATADESCR optional
!IV_SUB_FDESC type STRING optional
!IT_FIELD_DESC type TT_FIELD_DESC optional
returning
value(RO_STRUCT) type ref to CL_ABAP_STRUCTDESCR
raising
ZCX_EUI_EXCEPTION .
class-methods FIND_TABLE_FIELDNAME
importing
!IR_UNIQUE_TYPE type ref to TT_UNIQUE_TYPE
changing
!CV_ROLLNAME type CSEQUENCE
!CV_LABEL type CSEQUENCE optional .
class-methods GET_SUB_FIELD_DESC
importing
!IS_FIELD_DESC type TS_FIELD_DESC
returning
value(RT_FIELD_DESC) type TT_FIELD_DESC .
protected section.
private section.
*"* private components of class ZCL_EUI_TYPE
*"* do not include other source files here!!!
class-methods _ADD_COMP_INFO
importing
!IO_STRUC type ref to CL_ABAP_STRUCTDESCR
!IS_ROW type ANY
!IV_TECH type ABAP_BOOL
!IR_UNIQUE_TYPE type ref to TT_UNIQUE_TYPE
changing
!CS_FIELD_DESC type TS_FIELD_DESC
raising
ZCX_EUI_EXCEPTION .
class-methods _ADD_COMP_INFO_CLASS
importing
!IO_CLASS type ref to CL_ABAP_CLASSDESCR
!IO_INST type ANY
!IV_TECH type ABAP_BOOL
!IR_UNIQUE_TYPE type ref to TT_UNIQUE_TYPE
changing
!CS_FIELD_DESC type TS_FIELD_DESC
raising
ZCX_EUI_EXCEPTION .
ENDCLASS.
CLASS ZCL_EUI_TYPE IMPLEMENTATION.
METHOD create_structure.
DATA:
lt_comp TYPE abap_component_tab,
lt_sub_fdesc TYPE tt_field_desc,
lv_ok TYPE abap_bool.
FIELD-SYMBOLS:
<ls_field_desc> TYPE ts_field_desc,
<ls_subfield> TYPE ts_field_desc,
<ls_comp> LIKE LINE OF lt_comp.
" №2 For select-options
IF io_range IS NOT INITIAL.
APPEND INITIAL LINE TO lt_comp ASSIGNING <ls_comp>.
<ls_comp>-name = 'SIGN'.
<ls_comp>-type = cl_abap_elemdescr=>get_c( p_length = 1 ).
APPEND INITIAL LINE TO lt_comp ASSIGNING <ls_comp>.
<ls_comp>-name = 'OPTION'.
<ls_comp>-type = cl_abap_elemdescr=>get_c( p_length = 2 ).
APPEND INITIAL LINE TO lt_comp ASSIGNING <ls_comp>.
<ls_comp>-name = 'LOW'.
<ls_comp>-type = io_range.
APPEND INITIAL LINE TO lt_comp ASSIGNING <ls_comp>.
<ls_comp>-name = 'HIGH'.
<ls_comp>-type = io_range.
ENDIF.
" №3 For table's strcuture
DO 1 TIMES.
CHECK iv_sub_fdesc IS NOT INITIAL.
zcl_eui_conv=>from_json(
EXPORTING
iv_json = iv_sub_fdesc
IMPORTING
ex_data = lt_sub_fdesc
ev_ok = lv_ok ).
CHECK lv_ok = abap_true.
LOOP AT lt_sub_fdesc ASSIGNING <ls_subfield>.
APPEND INITIAL LINE TO lt_comp ASSIGNING <ls_comp>.
<ls_comp>-name = <ls_subfield>-name.
<ls_comp>-type = create_type_descr( is_field_desc = <ls_subfield> ).
ENDLOOP.
ENDDO.
" №4 Called from constructor if have in DB cluster
LOOP AT it_field_desc ASSIGNING <ls_field_desc>.
" Create sub levels
APPEND INITIAL LINE TO lt_comp ASSIGNING <ls_comp>.
<ls_comp>-name = <ls_field_desc>-name.
<ls_comp>-type = create_type_descr( is_field_desc = <ls_field_desc> ).
ENDLOOP.
* TRY.
ro_struct = cl_abap_structdescr=>create( lt_comp ).
* CATCH cx_sy_type_creation INTO DATA(lo_prev_error).
* zcx_eui_exception=>raise_sys_error( io_error = lo_prev_error ).
* ENDTRY.
ENDMETHOD.
METHOD create_type_descr.
DATA:
lo_line TYPE REF TO cl_abap_datadescr,
lo_prev_error TYPE REF TO cx_root,
lo_type TYPE REF TO cl_abap_typedescr.
DATA lv_sys_type TYPE abap_typekind.
DATA lv_message TYPE string.
" No type
CLEAR ro_type.
TRY.
" №0
IF is_field_desc IS SUPPLIED.
* " structure for DB
* IF mo_ui_ext IS NOT INITIAL.
* TRY.
* ir_type = mo_ui_ext->create_field_type(
* iv_name = is_field_desc-name
* iv_type = zif_prog_params_ui_ext=>mc_type_db ).
* CATCH cx_sy_dyn_call_illegal_method.
* CLEAR ir_type.
* ENDTRY.
* CHECK ir_type IS INITIAL.
* ENDIF.
" For tables speed 1
IF is_field_desc-rollname IS NOT INITIAL.
" Try to create
TRY.
ro_type = create_type_descr(
iv_rollname = is_field_desc-rollname ).
CATCH zcx_eui_exception.
CLEAR ro_type.
ENDTRY.
ENDIF.
IF ro_type IS INITIAL AND is_field_desc-ui_type <> mc_ui_type-struct.
lv_sys_type = is_field_desc-sys_type.
" For old option wrong is_field_desc-sys_type
IF lv_sys_type = cl_abap_typedescr=>typekind_table AND is_field_desc-ui_type = mc_ui_type-range.
" usually char
lv_sys_type = cl_abap_typedescr=>typekind_char.
" Show waning
CONCATENATE `No right type for ` is_field_desc-name ` ` is_field_desc-rollname `!` INTO lv_message.
MESSAGE lv_message TYPE 'S' DISPLAY LIKE 'W'.
ENDIF.
CASE lv_sys_type.
WHEN cl_abap_typedescr=>typekind_char.
ro_type = cl_abap_elemdescr=>get_c( p_length = is_field_desc-length ).
WHEN cl_abap_typedescr=>typekind_date.
ro_type = cl_abap_elemdescr=>get_d( ).
WHEN cl_abap_typedescr=>typekind_int.
ro_type = cl_abap_elemdescr=>get_i( ).
WHEN cl_abap_typedescr=>typekind_float.
ro_type = cl_abap_elemdescr=>get_f( ).
WHEN cl_abap_typedescr=>typekind_num.
ro_type = cl_abap_elemdescr=>get_n( p_length = is_field_desc-length ).
WHEN cl_abap_typedescr=>typekind_packed.
ro_type = cl_abap_elemdescr=>get_p( p_length = is_field_desc-length p_decimals = is_field_desc-decimals ).
WHEN cl_abap_typedescr=>typekind_string.
ro_type = cl_abap_elemdescr=>get_string( ).
WHEN cl_abap_typedescr=>typekind_time.
ro_type = cl_abap_elemdescr=>get_t( ).
WHEN cl_abap_typedescr=>typekind_table.
" Below in code CASE is_field_desc-ui_type.
WHEN OTHERS.
MESSAGE s015(zeui_message) WITH is_field_desc-name INTO sy-msgli.
zcx_eui_exception=>raise_sys_error( ).
ENDCASE.
ENDIF.
CASE is_field_desc-ui_type.
WHEN mc_ui_type-range.
IF ro_type IS INITIAL.
CONCATENATE `Cannot create range for ` is_field_desc-name ` ` is_field_desc-rollname `!` INTO lv_message.
zcx_eui_exception=>raise_sys_error( iv_message = lv_message ).
ENDIF.
" Call №2 recursion
lo_line = create_structure( io_range = ro_type ).
ro_type = cl_abap_tabledescr=>create( p_line_type = lo_line ).
WHEN mc_ui_type-table.
" Call №3 recursion
IF ro_type IS INITIAL.
ro_type = create_structure( iv_sub_fdesc = is_field_desc-sub_fdesc ).
ENDIF.
IF is_field_desc-table_kind = cl_abap_tabledescr=>tablekind_std
AND is_field_desc-key_defkind = 'U' " From 7.40 KEYDEFKIND_USER
AND is_field_desc-key IS INITIAL.
ro_type = cl_abap_tabledescr=>create( p_line_type = ro_type ). " 'D' - KEYDEFKIND_DEFAULT
ELSE.
ro_type = cl_abap_tabledescr=>create(
p_line_type = ro_type
p_table_kind = is_field_desc-table_kind
p_unique = is_field_desc-unique
p_key = is_field_desc-key
p_key_kind = is_field_desc-key_defkind ).
ENDIF.
WHEN mc_ui_type-struct.
ro_type = create_structure( iv_sub_fdesc = is_field_desc-sub_fdesc ).
ENDCASE.
ENDIF.
CHECK ro_type IS INITIAL.
" №0
IF iv_rollname NP '*-*'.
cl_abap_datadescr=>describe_by_name(
EXPORTING
p_name = iv_rollname
RECEIVING
p_descr_ref = lo_type
EXCEPTIONS
type_not_found = 1 ).
" Handle somewhere else
IF sy-subrc <> 0.
MESSAGE s017(zeui_message) WITH iv_rollname INTO sy-msgli.
zcx_eui_exception=>raise_sys_error( ).
ENDIF.
ro_type ?= lo_type.
RETURN.
ENDIF.
" №1 - Create from text
IF ir_type IS INITIAL AND iv_rollname IS NOT INITIAL.
CREATE DATA ir_type TYPE (iv_rollname).
ENDIF.
" №2 - Based on incoming reference
cl_abap_datadescr=>describe_by_data_ref(
EXPORTING
p_data_ref = ir_type
RECEIVING
p_descr_ref = lo_type
EXCEPTIONS
reference_is_initial = 1 ).
" Handle somewhere else
IF sy-subrc <> 0.
MESSAGE s017(zeui_message) WITH iv_rollname INTO sy-msgli.
zcx_eui_exception=>raise_sys_error( ).
ENDIF.
ro_type ?= lo_type.
CATCH cx_root INTO lo_prev_error.
CLEAR ro_type.
zcx_eui_exception=>raise_sys_error( io_error = lo_prev_error ).
ENDTRY.
ENDMETHOD.
METHOD find_dropdown.
DATA:
ls_sh_desc TYPE shlp_descr,
lv_list_box TYPE abap_bool,
lt_fielddescr TYPE ddfields,
ls_field TYPE REF TO dfies,
lt_field_desc TYPE tt_field_desc,
ls_field_desc TYPE ts_field_desc,
lo_struc TYPE REF TO cl_abap_structdescr,
lo_table TYPE REF TO cl_abap_tabledescr,
lr_table TYPE REF TO data,
lt_shlp_return TYPE STANDARD TABLE OF ddshretval,
ls_shlp_return TYPE REF TO ddshretval,
lv_prev_pos TYPE i,
ls_call_control TYPE ddshf4ctrl,
ls_fld_prop TYPE REF TO ddshfprop,
lt_shlp_descr_tab TYPE shlp_desct,
lt_shlp_record TYPE STANDARD TABLE OF seahlpres,
lt_dropdown TYPE lvc_t_dral,
ls_dropdown TYPE lvc_s_dral.
FIELD-SYMBOLS:
<lt_table> TYPE STANDARD TABLE,
<ls_row> TYPE any,
<lv_value> TYPE any,
<lv_low> TYPE any,
<lv_txt> TYPE csequence.
" No need
IF cs_fieldcat-ref_table = abap_undefined AND cs_fieldcat-ref_field = abap_undefined.
CLEAR cs_fieldcat-ref_table.
CLEAR cs_fieldcat-ref_field.
RETURN.
ENDIF.
" No need
CHECK cs_fieldcat-checkbox <> abap_true
AND cs_fieldcat-hotspot <> abap_true
AND cs_fieldcat-inttype <> cl_abap_typedescr=>typekind_int
AND cs_fieldcat-inttype <> 'b' "cl_abap_typedescr=>typekind_int1
AND cs_fieldcat-inttype <> 's' "cl_abap_typedescr=>typekind_int2
AND cs_fieldcat-inttype <> '8'."cl_abap_typedescr=>typekind_int8.
" Get top SH
is_list_box(
EXPORTING
iv_tabname = cs_fieldcat-ref_table
iv_fieldname = cs_fieldcat-ref_field
IMPORTING
ev_list_box = lv_list_box
es_sh_desc = ls_sh_desc ).
CHECK lv_list_box = abap_true.
" Work with copy
lt_fielddescr[] = ls_sh_desc-fielddescr[].
TRY.
" Strucure fields
LOOP AT lt_fielddescr REFERENCE INTO ls_field.
ls_field_desc = get_field_desc( is_sh_field = ls_field->* ).
INSERT ls_field_desc INTO TABLE lt_field_desc.
ENDLOOP.
" Output table
lo_struc = create_structure( it_field_desc = lt_field_desc ).
lo_table = cl_abap_tabledescr=>create( p_line_type = lo_struc ).
CATCH zcx_eui_exception.
RETURN.
ENDTRY.
" Asign it
CREATE DATA lr_table TYPE HANDLE lo_table.
ASSIGN lr_table->* TO <lt_table>.
CALL FUNCTION 'F4IF_SELECT_VALUES'
EXPORTING
shlp = ls_sh_desc
maxrows = 0 " all values of domain
call_shlp_exit = abap_true " 'SELECT' only!
TABLES
return_tab = lt_shlp_return.
**********************************************************************
" Copied from --> METHOD get_sh_table.
**********************************************************************
" Show all fields
LOOP AT ls_sh_desc-fieldprop REFERENCE INTO ls_fld_prop.
ls_fld_prop->shlpoutput = abap_true.
ENDLOOP.
" Call with SELECT event only (probably no texts)
IF ls_sh_desc-intdescr-selmexit IS INITIAL.
CALL FUNCTION 'F4IF_SELECT_VALUES'
EXPORTING
shlp = ls_sh_desc
maxrows = 0 " all values of domain
call_shlp_exit = abap_true " 'SELECT' only!
TABLES
return_tab = lt_shlp_return.
ELSE.
" Get records first
CALL FUNCTION 'F4IF_SELECT_VALUES'
EXPORTING
shlp = ls_sh_desc
maxrows = 0 " all values of domain
call_shlp_exit = abap_true
TABLES
record_tab = lt_shlp_record.
" Disp event
ls_call_control-step = 'DISP'.
ls_call_control-maxrecords = 0. " all values of domain
APPEND ls_sh_desc TO lt_shlp_descr_tab.
CALL FUNCTION ls_sh_desc-intdescr-selmexit
TABLES
shlp_tab = lt_shlp_descr_tab
record_tab = lt_shlp_record
CHANGING
shlp = ls_sh_desc
callcontrol = ls_call_control.
" To normal state -> lt_shlp_return
CLEAR lt_shlp_return.
PERFORM transform_outval IN PROGRAM saplsdsd
TABLES lt_shlp_record lt_shlp_return
USING ls_call_control ls_sh_desc.
ENDIF.
" Write data to table
lv_prev_pos = 0.
SORT ls_sh_desc-fielddescr BY fieldname.
LOOP AT lt_shlp_return REFERENCE INTO ls_shlp_return.
" New row ?
IF lv_prev_pos <> ls_shlp_return->recordpos.
APPEND INITIAL LINE TO <lt_table> ASSIGNING <ls_row>.
ENDIF.
lv_prev_pos = ls_shlp_return->recordpos.
" value
ASSIGN COMPONENT ls_shlp_return->fieldname OF STRUCTURE <ls_row> TO <lv_value>.
CHECK sy-subrc = 0.
" Copy field field
READ TABLE ls_sh_desc-fielddescr REFERENCE INTO ls_field BINARY SEARCH
WITH KEY fieldname = ls_shlp_return->fieldname.
" Special case for certain types
CASE ls_field->inttype.
WHEN cl_abap_typedescr=>typekind_time.
CONCATENATE ls_shlp_return->fieldval+0(2)
ls_shlp_return->fieldval+3(2)
ls_shlp_return->fieldval+6(2) INTO <lv_value>.
WHEN cl_abap_typedescr=>typekind_date.
CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
EXPORTING
date_external = ls_shlp_return->fieldval
IMPORTING
date_internal = <lv_value>
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
CLEAR <lv_value>.
ENDIF.
" Integer, byte, short
WHEN cl_abap_typedescr=>typekind_int OR cl_abap_typedescr=>typekind_int1 OR cl_abap_typedescr=>typekind_int2.
REPLACE ALL OCCURRENCES OF '.' IN ls_shlp_return->fieldval WITH ''.
<lv_value> = ls_shlp_return->fieldval.
WHEN OTHERS.
<lv_value> = ls_shlp_return->fieldval.
ENDCASE.
ENDLOOP.
**********************************************************************
**********************************************************************
" Next handle
ADD 1 TO cv_drdn_hndl.
" Prepare field catalog
cs_fieldcat-drdn_hndl = cv_drdn_hndl.
cs_fieldcat-drdn_alias = abap_true.
LOOP AT <lt_table> ASSIGNING <ls_row>.
ASSIGN COMPONENT:
'_LOW' OF STRUCTURE <ls_row> TO <lv_low>,
'_TEXT' OF STRUCTURE <ls_row> TO <lv_txt>.
ls_dropdown-handle = cs_fieldcat-drdn_hndl.
ls_dropdown-int_value = <lv_low>.
ls_dropdown-value = <lv_low>.
CONCATENATE ls_dropdown-value ` - ` <lv_txt> INTO ls_dropdown-value.
" Add new item to dropdown
APPEND ls_dropdown TO lt_dropdown.
ENDLOOP.
io_grid->set_drop_down_table(
it_drop_down_alias = lt_dropdown ).
ENDMETHOD.
METHOD find_table_fieldname.
TYPES:
BEGIN OF ts_dd03l,
tabname TYPE dd03l-tabname,
fieldname TYPE dd03l-fieldname,
shlporigin TYPE dd03l-shlporigin,
"ddtext TYPE dd03t-ddtext,
tab_len TYPE i,
END OF ts_dd03l.
DATA:
lv_rollname TYPE rollname,
lt_dd03l TYPE STANDARD TABLE OF ts_dd03l,
ls_dd03l TYPE REF TO ts_dd03l,
lv_tabfld TYPE string,
ls_dd04t TYPE dd04t,
lo_type TYPE REF TO cl_abap_datadescr.
FIELD-SYMBOLS:
<lt_unique_type> TYPE tt_unique_type.
" Table Fields
CHECK cv_rollname IS NOT INITIAL.
lv_rollname = cv_rollname.
SELECT d~tabname d~fieldname d~shlporigin INTO CORRESPONDING FIELDS OF TABLE lt_dd03l "#EC TOO_MANY_ITAB_FIELDS
FROM dd03l AS d UP TO 100 ROWS
WHERE d~rollname = lv_rollname AND d~as4local = 'A' AND d~depth = 0.
" Find short table name
LOOP AT lt_dd03l REFERENCE INTO ls_dd03l.
ls_dd03l->tab_len = strlen( ls_dd03l->tabname ).
" In the end
IF ls_dd03l->shlporigin IS NOT INITIAL.
ls_dd03l->tab_len = ls_dd03l->tab_len - 1000.
ENDIF.
IF ls_dd03l->tabname CP '/*'.
ls_dd03l->tab_len = ls_dd03l->tab_len - 1000.
ENDIF.
ENDLOOP.
SORT lt_dd03l BY tab_len ASCENDING.
" Try to find
ASSIGN ir_unique_type->* TO <lt_unique_type>.
LOOP AT lt_dd03l REFERENCE INTO ls_dd03l.
CONCATENATE ls_dd03l->tabname '-' ls_dd03l->fieldname INTO lv_tabfld.
" if type exist
TRY.
lo_type = create_type_descr( iv_rollname = lv_tabfld ).
CATCH zcx_eui_exception.
CLEAR lo_type.
ENDTRY.
CHECK lo_type IS NOT INITIAL.
" Get next item
IF ir_unique_type IS NOT INITIAL.
READ TABLE <lt_unique_type> TRANSPORTING NO FIELDS
WITH TABLE KEY table_line = lv_tabfld.
CHECK sy-subrc <> 0.
" Do not repeat types
INSERT lv_tabfld INTO TABLE <lt_unique_type>.
ENDIF.
cv_rollname = lv_tabfld.
DO 1 TIMES.
" If have no text
CHECK cv_label IS SUPPLIED AND cv_label IS INITIAL.
" №2
SELECT SINGLE * INTO ls_dd04t
FROM dd04t
WHERE rollname = lv_rollname
AND ddlanguage = sy-langu
AND as4local = 'A'
AND as4vers = 0.
CHECK sy-subrc = 0.
IF ls_dd04t-ddtext IS NOT INITIAL.
cv_label = ls_dd04t-ddtext.
ELSE.
cv_label = ls_dd04t-reptext.
ENDIF.
ENDDO.
RETURN.
ENDLOOP.
ENDMETHOD.
METHOD get_catalog.
DATA:
lr_table TYPE REF TO data,
lr_columns TYPE REF TO cl_salv_columns_table,
lr_aggregations TYPE REF TO cl_salv_aggregations,
lo_error TYPE REF TO cx_salv_error.
FIELD-SYMBOLS:
<ls_data> TYPE any,
<lt_table> TYPE STANDARD TABLE,
<ls_fieldcat> LIKE LINE OF rt_fieldcat.
" №0 - If no SALV control
IF io_salv IS INITIAL.
" №1 - Based on structure description
IF io_struc IS NOT INITIAL.
CREATE DATA ir_struc TYPE HANDLE io_struc.
ENDIF.
" №2 - Based on standard table
IF ir_table IS NOT INITIAL.
ASSIGN ir_table->* TO <lt_table>.
ELSEIF ir_struc IS NOT INITIAL.
" №3 - Based on structure reference
ASSIGN ir_struc->* TO <ls_data>.
" Create table
CREATE DATA lr_table LIKE STANDARD TABLE OF <ls_data>.
ASSIGN lr_table->* TO <lt_table>.
ELSE. " zcx_eui_no_check=>raise_sys_error ?
zcx_eui_exception=>raise_dump( iv_message = `Pass 'IR_TABLE' or 'IR_STRUC' parameter` ).
ENDIF.
" Create temporary SALV control
TRY.
cl_salv_table=>factory(
IMPORTING
r_salv_table = io_salv
CHANGING
t_table = <lt_table> ).
CATCH cx_salv_error INTO lo_error. "#EC NO_HANDLER
MESSAGE lo_error TYPE 'S' DISPLAY LIKE 'E'.
RETURN.
ENDTRY.
ENDIF.
" Fields catalog
lr_columns = io_salv->get_columns( ).
lr_aggregations = io_salv->get_aggregations( ).
rt_fieldcat = cl_salv_controller_metadata=>get_lvc_fieldcatalog(
r_columns = lr_columns
r_aggregations = lr_aggregations ).
" For binary search only
IF iv_sort = abap_true.
SORT rt_fieldcat BY fieldname.
ENDIF.
" Default behaviour change field
CHECK iv_tune_up = abap_true.
" Small tune up
LOOP AT rt_fieldcat ASSIGNING <ls_fieldcat>.
<ls_fieldcat>-col_id = <ls_fieldcat>-col_pos = sy-tabix.
IF <ls_fieldcat>-coltext IS INITIAL.
<ls_fieldcat>-coltext = <ls_fieldcat>-reptext.
ENDIF.
IF <ls_fieldcat>-coltext IS INITIAL.
<ls_fieldcat>-coltext = <ls_fieldcat>-scrtext_l.
ENDIF.
IF <ls_fieldcat>-domname = 'XSDBOOLEAN'.
<ls_fieldcat>-checkbox = abap_true.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD get_field_desc.
FIELD-SYMBOLS <lv_row> TYPE any.
IF is_sh_field IS NOT INITIAL.
rs_field_desc-name = is_sh_field-fieldname.
rs_field_desc-sys_type = is_sh_field-inttype.
rs_field_desc-length = is_sh_field-leng.
rs_field_desc-decimals = is_sh_field-decimals.
rs_field_desc-label = is_sh_field-fieldtext.
rs_field_desc-rollname = is_sh_field-rollname.
ELSE.
DATA lo_type TYPE REF TO cl_abap_typedescr.
" №1 Type & value
lo_type = cl_abap_typedescr=>describe_by_data( iv_data ).
ASSIGN iv_data TO <lv_row>.
" With tech info
IF lo_type->type_kind = cl_abap_typedescr=>typekind_dref
AND iv_data IS NOT INITIAL
AND iv_tech = abap_true.
" №2 Type & value
lo_type = cl_abap_typedescr=>describe_by_data_ref( iv_data ).
ASSIGN iv_data->* TO <lv_row>.
ENDIF.
rs_field_desc-name = iv_field_name.
rs_field_desc-sys_type = lo_type->type_kind. "kind.
rs_field_desc-length = lo_type->length.
rs_field_desc-decimals = lo_type->decimals.
IF lo_type->is_ddic_type( ) = abap_true.
rs_field_desc-rollname = lo_type->get_relative_name( ).
ENDIF.
ENDIF.
CASE rs_field_desc-sys_type.
WHEN cl_abap_typedescr=>typekind_char.
" Get all boolean types
DATA lv_domname TYPE dd04l-domname.
SELECT SINGLE domname INTO lv_domname
FROM dd04l
WHERE rollname = rs_field_desc-rollname
AND as4local = 'A'
AND as4vers = 0000.
" Also CHAR
CASE lv_domname.
WHEN 'XSDBOOLEAN' OR 'OS_BOOLEAN'.
rs_field_desc-ui_type = mc_ui_type-boolean.
WHEN 'XSDDATETIME_Z' OR 'XSDDATETIME_LONG_Z' OR
'XSDDATETIME_OFFSET' OR 'XSDDATETIME_LOCAL' OR 'XSDDATETIME_LOCAL_DT'.
rs_field_desc-ui_type = mc_ui_type-datetime.
WHEN OTHERS.
rs_field_desc-ui_type = mc_ui_type-char.
" lv_find_db_field = abap_true.
ENDCASE.
WHEN cl_abap_typedescr=>typekind_num OR cl_abap_typedescr=>typekind_numeric.
rs_field_desc-ui_type = mc_ui_type-numc.
" lv_find_db_field = abap_true.
" Memo text
WHEN cl_abap_typedescr=>typekind_string.
rs_field_desc-ui_type = mc_ui_type-string.
rs_field_desc-rollname = 'STRINGVAL'.
WHEN cl_abap_typedescr=>typekind_struct1 OR cl_abap_typedescr=>typekind_struct2.
DATA lr_struct_descr TYPE REF TO cl_abap_structdescr.
IF iv_tech = abap_true.
lr_struct_descr ?= lo_type.
rs_field_desc-ui_type = mc_ui_type-struct.
ENDIF.
WHEN cl_abap_typedescr=>typekind_oref.
DATA lr_class_descr TYPE REF TO cl_abap_classdescr.
IF iv_tech = abap_true AND iv_data IS NOT INITIAL.
lr_class_descr ?= cl_abap_classdescr=>describe_by_object_ref( iv_data ).
rs_field_desc-ui_type = mc_ui_type-object.
ENDIF.
WHEN cl_abap_typedescr=>typekind_table.
DATA lr_table_descr TYPE REF TO cl_abap_tabledescr.
rs_field_desc-ui_type = mc_ui_type-table.
lr_table_descr ?= lo_type.
rs_field_desc-table_kind = lr_table_descr->table_kind.
rs_field_desc-unique = lr_table_descr->has_unique_key.
rs_field_desc-key = lr_table_descr->key.
rs_field_desc-key_defkind = lr_table_descr->key_defkind.
" No need for standardc table
IF rs_field_desc-table_kind = cl_abap_tabledescr=>tablekind_std.
CLEAR rs_field_desc-key.
ENDIF.
" Only for structures & objects
TRY.
lr_struct_descr ?= lr_table_descr->get_table_line_type( ).
CATCH cx_sy_move_cast_error.
MESSAGE s016(zeui_message) WITH rs_field_desc-name INTO sy-msgli.
zcx_eui_exception=>raise_sys_error( ).
ENDTRY.
" Get first row
FIELD-SYMBOLS <lt_value> TYPE ANY TABLE.
ASSIGN <lv_row> TO <lt_value>.
UNASSIGN <lv_row>.
LOOP AT <lt_value> ASSIGNING <lv_row>.
EXIT.
ENDLOOP.
" Create 1 row on a fly
IF <lv_row> IS NOT ASSIGNED.
" Create STANDARD table for field catalog!
DATA lr_row TYPE REF TO data.
CREATE DATA lr_row TYPE HANDLE lr_struct_descr.
ASSIGN lr_row->* TO <lv_row>.
ENDIF.
" Date
WHEN cl_abap_typedescr=>typekind_date.
rs_field_desc-ui_type = mc_ui_type-date.
" Time
WHEN cl_abap_typedescr=>typekind_time.
rs_field_desc-ui_type = mc_ui_type-time.
" Integer, byte, short
WHEN cl_abap_typedescr=>typekind_int OR cl_abap_typedescr=>typekind_int1 OR cl_abap_typedescr=>typekind_int2.
rs_field_desc-ui_type = mc_ui_type-numeric.
" Double
WHEN cl_abap_typedescr=>typekind_packed OR cl_abap_typedescr=>typekind_float OR
'/' OR 'a' OR 'e'. " cl_abap_typedescr=>typekind_decfloat OR cl_abap_typedescr=>typekind_decfloat16 OR cl_abap_typedescr=>typekind_decfloat34.
rs_field_desc-ui_type = mc_ui_type-numeric.
WHEN OTHERS.
ENDCASE.
" Structure & tables
IF lr_struct_descr IS NOT INITIAL.
_add_comp_info( EXPORTING io_struc = lr_struct_descr
iv_tech = iv_tech
ir_unique_type = ir_unique_type
is_row = <lv_row>
CHANGING cs_field_desc = rs_field_desc ).
ELSEIF lr_class_descr IS NOT INITIAL.
_add_comp_info_class( EXPORTING io_class = lr_class_descr
iv_tech = iv_tech
ir_unique_type = ir_unique_type
io_inst = <lv_row>
CHANGING cs_field_desc = rs_field_desc ).
ENDIF.
" TABLE-FIELDNAME from search help
IF is_sh_field-reffield IS NOT INITIAL.
CONCATENATE is_sh_field-reftable '-' is_sh_field-reffield INTO rs_field_desc-rollname.
ENDIF.
" Try to find TABLE-FIELDNAME
IF " lv_find_db_field = abap_true AND
rs_field_desc-ui_type <> mc_ui_type-table AND
rs_field_desc-ui_type <> mc_ui_type-string AND
rs_field_desc-rollname NP '*-*'.
find_table_fieldname(
EXPORTING
ir_unique_type = ir_unique_type
CHANGING
cv_rollname = rs_field_desc-rollname
cv_label = rs_field_desc-label ).
ENDIF.
" Set default text
IF rs_field_desc-label IS INITIAL.
rs_field_desc-label = rs_field_desc-name.
ENDIF.
ENDMETHOD.
METHOD get_mod_catalog.
DATA lt_catalog_fields TYPE abap_compdescr_tab. " Filled 1 time with all LVC_S_FCAT fields
DATA ls_mod_catalog LIKE LINE OF it_mod_catalog.
FIELD-SYMBOLS <ls_fieldcat> LIKE LINE OF rt_catalog.
FIELD-SYMBOLS <ls_mod_catalog> LIKE LINE OF it_mod_catalog.
" Get field catalog
rt_catalog = zcl_eui_type=>get_catalog( ir_table = ir_table ).
" Change field catalog
CLEAR lt_catalog_fields.
LOOP AT rt_catalog ASSIGNING <ls_fieldcat>.
LOOP AT it_mod_catalog ASSIGNING <ls_mod_catalog>.
" Start of group (1 symbol)
IF <ls_mod_catalog>-fieldname = '+'.
ls_mod_catalog = <ls_mod_catalog>.
CONTINUE.
ELSEIF <ls_mod_catalog>-fieldname(1) = '+'.
" Group continue
ls_mod_catalog-fieldname = <ls_mod_catalog>-fieldname+1.
ELSE.
" No group
ls_mod_catalog = <ls_mod_catalog>.
ENDIF.
" By mask ?
IF ls_mod_catalog-fieldname CS '*'.
CHECK <ls_fieldcat>-fieldname CP ls_mod_catalog-fieldname.
ELSE.
CHECK <ls_fieldcat>-fieldname = ls_mod_catalog-fieldname.
ENDIF.
CLEAR ls_mod_catalog-fieldname. " Do not copy field name
zcl_eui_conv=>move_corresponding(
EXPORTING
is_source = ls_mod_catalog
iv_except_initial = abap_true " <--- Move-corresponding except initial
CHANGING
cs_destination = <ls_fieldcat>
ct_component = lt_catalog_fields ).
ENDLOOP.
ENDLOOP.
ENDMETHOD.
METHOD get_sub_field_desc.
DATA lv_ok TYPE abap_bool.
zcl_eui_conv=>from_json( EXPORTING iv_json = is_field_desc-sub_fdesc
IMPORTING ev_ok = lv_ok
ex_data = rt_field_desc ).
CHECK lv_ok <> abap_true.
MESSAGE s022(zeui_message) WITH is_field_desc-name DISPLAY LIKE 'E'.
ENDMETHOD.
METHOD is_list_box.
CLEAR:
ev_list_box,
es_sh_desc.
CALL FUNCTION 'F4IF_DETERMINE_SEARCHHELP'
EXPORTING
tabname = iv_tabname
fieldname = iv_fieldname
IMPORTING
shlp = es_sh_desc
EXCEPTIONS
OTHERS = 1.
" Fixed values of domains
CHECK sy-subrc = 0 AND es_sh_desc-shlptype = 'FV'.
ev_list_box = abap_true.
ENDMETHOD.
METHOD split_type.
" Check is table and field name
CHECK iv_datatype CP '*-*'.
TRY.
" Exist in data dictionary?
zcl_eui_type=>create_type_descr( iv_rollname = iv_datatype ).
" DB and field
SPLIT iv_datatype AT '-' INTO ev_table ev_field.
CATCH zcx_eui_exception.
CLEAR:
ev_table,
ev_field.
ENDTRY.
ENDMETHOD.
METHOD _add_comp_info.
" For speed creation
IF io_struc->is_ddic_type( ) = abap_true.
DATA ls_header TYPE x030l.
ls_header = io_struc->get_ddic_header( ).
cs_field_desc-rollname = ls_header-tabname.
ENDIF.
CLEAR cs_field_desc-sub_fdesc.
DATA lt_sub_fdesc TYPE tt_field_desc. " lv_find_db_field TYPE abap_bool
DATA ls_subfield TYPE ts_field_desc.
FIELD-SYMBOLS <ls_comp_tab> TYPE abap_compdescr.
FIELD-SYMBOLS <lv_subvalue> TYPE any.
LOOP AT io_struc->components ASSIGNING <ls_comp_tab>.
ASSIGN COMPONENT <ls_comp_tab>-name OF STRUCTURE is_row TO <lv_subvalue>.
" Recursion
ls_subfield = get_field_desc( iv_field_name = <ls_comp_tab>-name
iv_data = <lv_subvalue>
ir_unique_type = ir_unique_type
iv_tech = iv_tech ).
" No need to save
IF cs_field_desc-ui_type = mc_ui_type-table AND iv_tech = abap_true
AND ls_subfield-ui_type IS INITIAL AND ls_subfield-sys_type = cl_abap_typedescr=>typekind_dref.
CONTINUE.
ENDIF.
INSERT ls_subfield INTO TABLE lt_sub_fdesc.
ENDLOOP.
cs_field_desc-sub_fdesc = zcl_eui_conv=>to_json( im_data = lt_sub_fdesc ).
**********************************************************************
" Select option ?
DATA lv_cnt TYPE i. "DO 1 TIMES.
lv_cnt = lines( lt_sub_fdesc ).
CHECK lv_cnt = 4
AND cs_field_desc-ui_type = mc_ui_type-table.
" Check by name
LOOP AT lt_sub_fdesc TRANSPORTING NO FIELDS WHERE
name = 'SIGN' OR name = 'OPTION' OR name = 'LOW' OR name = 'HIGH'. "#EC CI_HASHSEQ
lv_cnt = lv_cnt - 1.
ENDLOOP.
" Select-option
CHECK lv_cnt = 0.
cs_field_desc-ui_type = mc_ui_type-range.
" No need in components
CLEAR cs_field_desc-sub_fdesc.
" Where to find TABLE-FIELDNAME
FIELD-SYMBOLS <ls_subfield> LIKE ls_subfield.
READ TABLE lt_sub_fdesc ASSIGNING <ls_subfield>
WITH TABLE KEY name = 'LOW'.
cs_field_desc-rollname = <ls_subfield>-rollname.
cs_field_desc-label = <ls_subfield>-label.
" TODO Old options!!! cs_field_desc-sys_type = <ls_subfield>-sys_type.
" lv_find_db_field = abap_true.
ENDMETHOD.
METHOD _add_comp_info_class.
" For speed creation
IF io_class->is_ddic_type( ) = abap_true.
DATA ls_header TYPE x030l.
ls_header = io_class->get_ddic_header( ).
cs_field_desc-rollname = ls_header-tabname.
ENDIF.
CLEAR cs_field_desc-sub_fdesc.
DATA lt_sub_fdesc TYPE tt_field_desc. " lv_find_db_field TYPE abap_bool
DATA ls_subfield TYPE ts_field_desc.
FIELD-SYMBOLS <ls_attr> TYPE abap_attrdescr.
FIELD-SYMBOLS <lv_subvalue> TYPE any.
LOOP AT io_class->attributes ASSIGNING <ls_attr> WHERE visibility = cl_abap_objectdescr=>public.
DATA lv_field TYPE string.
CONCATENATE 'IO_INST->' <ls_attr>-name INTO lv_field.
ASSIGN (lv_field) TO <lv_subvalue>.
" Recursion
ls_subfield = get_field_desc( iv_field_name = <ls_attr>-name
iv_data = <lv_subvalue>
ir_unique_type = ir_unique_type
iv_tech = iv_tech ).
" No need to save
IF cs_field_desc-ui_type = mc_ui_type-table AND iv_tech = abap_true
AND ls_subfield-ui_type IS INITIAL AND ls_subfield-sys_type = cl_abap_typedescr=>typekind_dref.
CONTINUE.
ENDIF.
INSERT ls_subfield INTO TABLE lt_sub_fdesc.
ENDLOOP.
cs_field_desc-sub_fdesc = zcl_eui_conv=>to_json( im_data = lt_sub_fdesc ).
ENDMETHOD.
ENDCLASS.
| 32.012302 | 152 | 0.656959 |
f7a45f136ce291b186d627c9f2314c3ae859fde4 | 308 | abap | ABAP | objects/PROG/ZTEST_BIS/REPS ZTEST_BIS.abap | abhilashhaa/HCL_Githup | 454be7f157c72fbb75550dea67c9167e405a4fdb | [
"Apache-2.0"
] | null | null | null | objects/PROG/ZTEST_BIS/REPS ZTEST_BIS.abap | abhilashhaa/HCL_Githup | 454be7f157c72fbb75550dea67c9167e405a4fdb | [
"Apache-2.0"
] | null | null | null | objects/PROG/ZTEST_BIS/REPS ZTEST_BIS.abap | abhilashhaa/HCL_Githup | 454be7f157c72fbb75550dea67c9167e405a4fdb | [
"Apache-2.0"
] | null | null | null | *&---------------------------------------------------------------------*
*& Report ZTEST_BIS
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZTEST_BIS.
select single * from bsis INTO @data(lt_bsis). | 34.222222 | 72 | 0.211039 |
f7a58220b3e49b99411ec99efd59a00f072c41e5 | 774 | abap | ABAP | src/zfile_utils.fugr.lzfile_utilsf02.abap | alaible/abap_file_browser | 6263072f6365250982eb0486e384fccdb657fd1d | [
"MIT"
] | 1 | 2022-03-14T08:49:14.000Z | 2022-03-14T08:49:14.000Z | src/zfile_utils.fugr.lzfile_utilsf02.abap | alaible/abap_file_browser | 6263072f6365250982eb0486e384fccdb657fd1d | [
"MIT"
] | null | null | null | src/zfile_utils.fugr.lzfile_utilsf02.abap | alaible/abap_file_browser | 6263072f6365250982eb0486e384fccdb657fd1d | [
"MIT"
] | null | null | null | *----------------------------------------------------------------------*
***INCLUDE LZFILE_UTILSF02.
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form fill_labels
*&---------------------------------------------------------------------*
*& text
*&---------------------------------------------------------------------*
*& --> p1 text
*& <-- p2 text
*&---------------------------------------------------------------------*
FORM fill_labels .
l_sear3 = 'Searchterm'.
l_sosz = 'File-Size'.
* l_soow = 'Owner'.
l_chd = 'Changed on'.
* l_fil = 'Filter ALV_TREE'.
l_fdd = 'Filter-Opts'.
l_cur = 'R-Cursor'.
l_clear = 'Clear Search-Opts'.
ENDFORM.
| 33.652174 | 72 | 0.257106 |
f7a8c3873a59c60c049452ffdcc7cb12a7a6d4b3 | 2,975 | abap | ABAP | src/day05/zcl_advent2020_day05_joltdx.clas.abap | joltdx/abap-advent-2020 | 5c33296066d7a1bd0bd60c7d1924f38e3471cece | [
"Unlicense"
] | 1 | 2020-12-18T15:45:54.000Z | 2020-12-18T15:45:54.000Z | src/day05/zcl_advent2020_day05_joltdx.clas.abap | joltdx/abap-advent-2020 | 5c33296066d7a1bd0bd60c7d1924f38e3471cece | [
"Unlicense"
] | 1 | 2020-12-01T13:56:31.000Z | 2020-12-01T14:15:22.000Z | src/day05/zcl_advent2020_day05_joltdx.clas.abap | joltdx/abap-advent-2020 | 5c33296066d7a1bd0bd60c7d1924f38e3471cece | [
"Unlicense"
] | null | null | null | CLASS zcl_advent2020_day05_joltdx DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_advent2020_joltdx .
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF ty_boarding_pass,
id TYPE i,
input TYPE string,
row TYPE i,
column TYPE i,
END OF ty_boarding_pass.
DATA mt_input TYPE STANDARD TABLE OF string WITH EMPTY KEY.
DATA mt_boarding_passes TYPE STANDARD TABLE OF ty_boarding_pass WITH EMPTY KEY.
METHODS part_1
RETURNING
VALUE(result) TYPE string.
METHODS part_2
RETURNING
VALUE(result) TYPE string.
METHODS read_boarding_pass
IMPORTING
input TYPE string
RETURNING
VALUE(result) TYPE ty_boarding_pass.
ENDCLASS.
CLASS ZCL_ADVENT2020_DAY05_joltdx IMPLEMENTATION.
METHOD zif_advent2020_joltdx~solve.
SPLIT input AT |\n| INTO TABLE DATA(lt_input).
LOOP AT lt_input INTO DATA(input_line).
APPEND read_boarding_pass( input_line ) TO mt_boarding_passes.
ENDLOOP.
output = |Part 1: { part_1( ) }. Part 2: { part_2( ) }|.
ENDMETHOD.
METHOD read_boarding_pass.
DATA iteration TYPE i.
DATA low TYPE i.
DATA high TYPE i VALUE 128.
DATA half_range TYPE i.
result-input = input.
DO 7 TIMES.
half_range = ( high - low ) DIV 2.
IF input+iteration(1) = 'F'.
high = high - half_range.
ELSE.
low = low + half_range.
ENDIF.
iteration = iteration + 1.
ENDDO.
result-row = low.
low = 0.
high = 8.
DO 3 TIMES.
half_range = ( high - low ) DIV 2.
IF input+iteration(1) = 'L'.
high = high - half_range.
ELSE.
low = low + half_range.
ENDIF.
iteration = iteration + 1.
ENDDO.
result-column = low.
result-id = ( result-row * 8 ) + result-column.
ENDMETHOD.
METHOD part_1.
DATA highest_id TYPE i.
LOOP AT mt_boarding_passes INTO DATA(boarding_pass).
IF boarding_pass-id > highest_id.
highest_id = boarding_pass-id.
ENDIF.
ENDLOOP.
result = highest_id.
ENDMETHOD.
METHOD part_2.
DATA previous_id TYPE i.
DATA my_seat TYPE ty_boarding_pass.
" SORT mt_boarding_passes BY id.
" LOOP AT mt_boarding_passes INTO DATA(boarding_pass).
" IF previous_id IS INITIAL.
" previous_id = boarding_pass-id.
" ELSEIF boarding_pass-id = previous_id + 2.
" result = boarding_pass-id - 1.
" RETURN.
" ENDIF.
" ENDLOOP.
DATA lt_ids TYPE STANDARD TABLE OF i.
LOOP AT mt_boarding_passes INTO DATA(boarding_pass).
APPEND boarding_pass-id TO lt_ids.
ENDLOOP.
SORT lt_ids.
LOOP AT lt_ids INTO DATA(id).
IF previous_id IS INITIAL.
previous_id = id.
CONTINUE.
ELSEIF id = previous_id + 2.
result = id - 1.
RETURN.
ENDIF.
previous_id = id.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| 21.402878 | 83 | 0.627899 |
f7adc6e42088d51f71135ad00a52b4e7c8a30a6c | 2,626 | abap | ABAP | src/objects/core/zcl_abapgit_item_graph.clas.abap | IvxLars/abapGit | bcdeebb3ad1432034b5ad1ea40683470956b8e07 | [
"MIT"
] | 797 | 2015-02-06T15:38:41.000Z | 2020-09-23T02:57:02.000Z | src/objects/core/zcl_abapgit_item_graph.clas.abap | IvxLars/abapGit | bcdeebb3ad1432034b5ad1ea40683470956b8e07 | [
"MIT"
] | 2,776 | 2015-01-13T03:59:55.000Z | 2020-09-23T21:46:34.000Z | src/objects/core/zcl_abapgit_item_graph.clas.abap | IvxLars/abapGit | bcdeebb3ad1432034b5ad1ea40683470956b8e07 | [
"MIT"
] | 499 | 2015-01-13T03:41:36.000Z | 2020-09-22T11:50:54.000Z | CLASS zcl_abapgit_item_graph DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
METHODS constructor
IMPORTING
!it_items TYPE zif_abapgit_definitions=>ty_items_tt .
METHODS add_edge
IMPORTING
!is_from TYPE zif_abapgit_definitions=>ty_item
!is_to TYPE zif_abapgit_definitions=>ty_item .
METHODS has_vertices
RETURNING
VALUE(rv_bool) TYPE abap_bool .
METHODS get_next
IMPORTING
!ii_log TYPE REF TO zif_abapgit_log
RETURNING
VALUE(rs_item) TYPE zif_abapgit_definitions=>ty_item .
PRIVATE SECTION.
TYPES: BEGIN OF ty_edge,
from TYPE zif_abapgit_definitions=>ty_item,
to TYPE zif_abapgit_definitions=>ty_item,
END OF ty_edge.
DATA mt_vertices TYPE STANDARD TABLE OF zif_abapgit_definitions=>ty_item WITH DEFAULT KEY.
DATA mt_edges TYPE STANDARD TABLE OF ty_edge WITH DEFAULT KEY.
DATA mv_warning TYPE abap_bool.
METHODS remove_vertex IMPORTING iv_index TYPE i.
ENDCLASS.
CLASS ZCL_ABAPGIT_ITEM_GRAPH IMPLEMENTATION.
METHOD add_edge.
DATA ls_edge LIKE LINE OF mt_edges.
ASSERT is_from IS NOT INITIAL.
ASSERT is_to IS NOT INITIAL.
ls_edge-from = is_from.
ls_edge-to = is_to.
APPEND ls_edge TO mt_edges.
ENDMETHOD.
METHOD constructor.
INSERT LINES OF it_items INTO TABLE mt_vertices.
ENDMETHOD.
METHOD get_next.
* find a vertex with no inbound edges, if it does not exist pick anything
DATA ls_vertex LIKE LINE OF mt_vertices.
DATA lv_index TYPE i.
LOOP AT mt_vertices INTO ls_vertex.
lv_index = sy-tabix.
READ TABLE mt_edges WITH KEY
to-obj_type = ls_vertex-obj_type
to-obj_name = ls_vertex-obj_name
TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
remove_vertex( lv_index ).
rs_item = ls_vertex.
RETURN.
ENDIF.
ENDLOOP.
IF mv_warning = abap_false.
* only issue the warning once per graph
ii_log->add_warning( |Cycle detected in item graph| ).
mv_warning = abap_true.
ENDIF.
READ TABLE mt_vertices INTO rs_item INDEX 1.
ASSERT sy-subrc = 0.
remove_vertex( 1 ).
ENDMETHOD.
METHOD has_vertices.
rv_bool = boolc( lines( mt_vertices ) > 0 ).
ENDMETHOD.
METHOD remove_vertex.
DATA ls_vertex LIKE LINE OF mt_vertices.
READ TABLE mt_vertices INDEX iv_index INTO ls_vertex.
ASSERT sy-subrc = 0.
DELETE mt_vertices INDEX iv_index.
DELETE mt_edges WHERE
from-obj_type = ls_vertex-obj_type AND
from-obj_name = ls_vertex-obj_name.
ENDMETHOD.
ENDCLASS.
| 25.009524 | 94 | 0.690784 |
f7af4b4bcc7732b900a5682a0e37a46e6bef2191 | 19,134 | abap | ABAP | src/ui/ycl_abapgit_gui_page_settings.clas.abap | abapGit/y-version | 2c3a7e7d0f5abb860e34f8eb44e0c2170a0ccdfc | [
"MIT"
] | null | null | null | src/ui/ycl_abapgit_gui_page_settings.clas.abap | abapGit/y-version | 2c3a7e7d0f5abb860e34f8eb44e0c2170a0ccdfc | [
"MIT"
] | null | null | null | src/ui/ycl_abapgit_gui_page_settings.clas.abap | abapGit/y-version | 2c3a7e7d0f5abb860e34f8eb44e0c2170a0ccdfc | [
"MIT"
] | 2 | 2019-11-24T20:35:16.000Z | 2020-04-16T07:29:33.000Z | CLASS ycl_abapgit_gui_page_settings DEFINITION
PUBLIC
FINAL
CREATE PUBLIC INHERITING FROM ycl_abapgit_gui_page.
PUBLIC SECTION.
INTERFACES: yif_abapgit_gui_page_hotkey.
CONSTANTS:
BEGIN OF c_action,
save_settings TYPE string VALUE 'save_settings',
END OF c_action.
METHODS constructor.
METHODS yif_abapgit_gui_page~on_event REDEFINITION.
PROTECTED SECTION.
METHODS render_content REDEFINITION.
PRIVATE SECTION.
DATA:
mo_settings TYPE REF TO ycl_abapgit_settings,
mv_error TYPE abap_bool,
mt_post_fields TYPE tihttpnvp.
METHODS render_proxy
RETURNING VALUE(ro_html) TYPE REF TO ycl_abapgit_html.
METHODS render_development_internals
RETURNING VALUE(ro_html) TYPE REF TO ycl_abapgit_html.
METHODS render_form_begin
RETURNING VALUE(ro_html) TYPE REF TO ycl_abapgit_html.
METHODS render_form_end
RETURNING VALUE(ro_html) TYPE REF TO ycl_abapgit_html.
METHODS render_max_lines
RETURNING VALUE(ro_html) TYPE REF TO ycl_abapgit_html.
METHODS render_adt_jump_enabled
RETURNING VALUE(ro_html) TYPE REF TO ycl_abapgit_html.
METHODS render_commit_msg
RETURNING VALUE(ro_html) TYPE REF TO ycl_abapgit_html.
METHODS build_settings
IMPORTING
it_post_fields TYPE tihttpnvp.
METHODS validate_settings.
METHODS parse_post
IMPORTING
it_postdata TYPE cnht_post_data_tab
RETURNING
VALUE(rt_post_fields) TYPE tihttpnvp.
METHODS persist_settings
RAISING
ycx_abapgit_exception.
METHODS read_settings.
METHODS render_section_begin
IMPORTING
iv_header TYPE csequence
RETURNING VALUE(ro_html) TYPE REF TO ycl_abapgit_html.
METHODS render_section_end
RETURNING VALUE(ro_html) TYPE REF TO ycl_abapgit_html.
METHODS render_start_up
RETURNING
VALUE(ro_html) TYPE REF TO ycl_abapgit_html.
METHODS render_link_hints
RETURNING
VALUE(ro_html) TYPE REF TO ycl_abapgit_html
RAISING
ycx_abapgit_exception.
METHODS render_hotkeys
RETURNING
VALUE(ro_html) TYPE REF TO ycl_abapgit_html
RAISING
ycx_abapgit_exception.
METHODS get_possible_hotkey_actions
RETURNING
VALUE(rt_hotkey_actions) TYPE yif_abapgit_gui_page_hotkey=>tty_hotkey_action
RAISING
ycx_abapgit_exception.
METHODS get_default_hotkeys
RETURNING
VALUE(rt_default_hotkeys) TYPE yif_abapgit_definitions=>tty_hotkey
RAISING
ycx_abapgit_exception.
METHODS is_post_field_checked
IMPORTING
iv_name TYPE string
RETURNING
value(rv_return) TYPE abap_bool.
ENDCLASS.
CLASS YCL_ABAPGIT_GUI_PAGE_SETTINGS IMPLEMENTATION.
METHOD build_settings.
DATA: lv_i_param_value TYPE i,
lv_column TYPE string,
lt_key_bindings TYPE yif_abapgit_definitions=>tty_hotkey.
FIELD-SYMBOLS: <ls_post_field> TYPE ihttpnvp,
<ls_key_binding> TYPE yif_abapgit_definitions=>ty_hotkey.
CREATE OBJECT mo_settings.
mt_post_fields = it_post_fields.
READ TABLE mt_post_fields ASSIGNING <ls_post_field> WITH KEY name = 'proxy_url'.
IF sy-subrc <> 0.
mv_error = abap_true.
ENDIF.
mo_settings->set_proxy_url( <ls_post_field>-value ).
READ TABLE mt_post_fields ASSIGNING <ls_post_field> WITH KEY name = 'proxy_port'.
IF sy-subrc <> 0.
mv_error = abap_true.
ENDIF.
mo_settings->set_proxy_port( <ls_post_field>-value ).
IF is_post_field_checked( 'proxy_auth' ) = abap_true.
mo_settings->set_proxy_authentication( abap_true ).
ELSE.
mo_settings->set_proxy_authentication( abap_false ).
ENDIF.
IF is_post_field_checked( 'critical_tests' ) = abap_true.
mo_settings->set_run_critical_tests( abap_true ).
ELSE.
mo_settings->set_run_critical_tests( abap_false ).
ENDIF.
IF is_post_field_checked( 'experimental_features' ) = abap_true.
mo_settings->set_experimental_features( abap_true ).
ELSE.
mo_settings->set_experimental_features( abap_false ).
ENDIF.
IF is_post_field_checked( 'show_default_repo' ) = abap_true.
mo_settings->set_show_default_repo( abap_true ).
ELSE.
mo_settings->set_show_default_repo( abap_false ).
ENDIF.
READ TABLE mt_post_fields ASSIGNING <ls_post_field> WITH KEY name = 'max_lines'.
IF sy-subrc = 0.
lv_i_param_value = <ls_post_field>-value.
mo_settings->set_max_lines( lv_i_param_value ).
ELSE.
mo_settings->set_max_lines( 0 ).
ENDIF.
IF is_post_field_checked( 'adt_jump_enabled' ) = abap_true.
mo_settings->set_adt_jump_enanbled( abap_true ).
ELSE.
mo_settings->set_adt_jump_enanbled( abap_false ).
ENDIF.
IF is_post_field_checked( 'link_hints_enabled' ) = abap_true.
mo_settings->set_link_hints_enabled( abap_true ).
ELSE.
mo_settings->set_link_hints_enabled( abap_false ).
ENDIF.
READ TABLE mt_post_fields ASSIGNING <ls_post_field> WITH KEY name = 'link_hint_key'.
IF sy-subrc = 0.
mo_settings->set_link_hint_key( |{ <ls_post_field>-value }| ).
ENDIF.
READ TABLE mt_post_fields ASSIGNING <ls_post_field> WITH KEY name = 'link_hint_background_color'.
IF sy-subrc = 0.
mo_settings->set_link_hint_background_color( |{ <ls_post_field>-value }| ).
ENDIF.
READ TABLE mt_post_fields ASSIGNING <ls_post_field> WITH KEY name = 'comment_length'.
IF sy-subrc = 0.
lv_i_param_value = <ls_post_field>-value.
IF lv_i_param_value < ycl_abapgit_settings=>c_commitmsg_comment_length_dft.
lv_i_param_value = ycl_abapgit_settings=>c_commitmsg_comment_length_dft.
ENDIF.
mo_settings->set_commitmsg_comment_length( lv_i_param_value ).
ELSE.
mo_settings->set_commitmsg_comment_length( ycl_abapgit_settings=>c_commitmsg_comment_length_dft ).
ENDIF.
READ TABLE mt_post_fields ASSIGNING <ls_post_field> WITH KEY name = 'body_size'.
IF sy-subrc = 0.
lv_i_param_value = <ls_post_field>-value.
IF lv_i_param_value < ycl_abapgit_settings=>c_commitmsg_body_size_dft.
lv_i_param_value = ycl_abapgit_settings=>c_commitmsg_body_size_dft.
ENDIF.
mo_settings->set_commitmsg_body_size( lv_i_param_value ).
ELSE.
mo_settings->set_commitmsg_body_size( ycl_abapgit_settings=>c_commitmsg_body_size_dft ).
ENDIF.
LOOP AT mt_post_fields ASSIGNING <ls_post_field> WHERE name CP 'key*'.
FIND FIRST OCCURRENCE OF REGEX `key_(.*)_`
IN <ls_post_field>-name
SUBMATCHES lv_column.
INSERT INITIAL LINE INTO TABLE lt_key_bindings ASSIGNING <ls_key_binding>.
CASE lv_column.
WHEN 'sequence'.
<ls_key_binding>-sequence = <ls_post_field>-value.
WHEN 'action'.
<ls_key_binding>-action = <ls_post_field>-value.
ENDCASE.
ENDLOOP.
DELETE lt_key_bindings WHERE sequence IS INITIAL
OR action IS INITIAL.
mo_settings->set_hotkeys( lt_key_bindings ).
ENDMETHOD.
METHOD constructor.
super->constructor( ).
ms_control-page_title = 'SETTINGS'.
ENDMETHOD. " constructor.
METHOD get_default_hotkeys.
DATA: lt_actions TYPE yif_abapgit_gui_page_hotkey=>tty_hotkey_action,
ls_hotkey LIKE LINE OF rt_default_hotkeys.
FIELD-SYMBOLS: <ls_action> LIKE LINE OF lt_actions.
lt_actions = ycl_abapgit_hotkeys=>get_default_hotkeys_from_pages( ).
LOOP AT lt_actions ASSIGNING <ls_action>.
ls_hotkey-action = <ls_action>-action.
ls_hotkey-sequence = <ls_action>-default_hotkey.
INSERT ls_hotkey INTO TABLE rt_default_hotkeys.
ENDLOOP.
ENDMETHOD.
METHOD get_possible_hotkey_actions.
DATA: ls_hotkey_action LIKE LINE OF rt_hotkey_actions.
rt_hotkey_actions = ycl_abapgit_hotkeys=>get_default_hotkeys_from_pages( ).
" insert empty row at the beginning, so that we can unset a hotkey
INSERT ls_hotkey_action INTO rt_hotkey_actions INDEX 1.
ENDMETHOD.
METHOD parse_post.
DATA lv_serialized_post_data TYPE string.
CONCATENATE LINES OF it_postdata INTO lv_serialized_post_data.
rt_post_fields = ycl_abapgit_html_action_utils=>parse_fields( lv_serialized_post_data ).
ENDMETHOD.
METHOD persist_settings.
DATA lo_settings_persistence TYPE REF TO ycl_abapgit_persist_settings.
lo_settings_persistence = ycl_abapgit_persist_settings=>get_instance( ).
lo_settings_persistence->modify( mo_settings ).
MESSAGE 'Settings succesfully saved' TYPE 'S'.
ENDMETHOD.
METHOD read_settings.
DATA lo_settings_persistence TYPE REF TO ycl_abapgit_persist_settings.
lo_settings_persistence = ycl_abapgit_persist_settings=>get_instance( ).
mo_settings = lo_settings_persistence->read( ).
ENDMETHOD.
METHOD render_adt_jump_enabled.
DATA lv_checked TYPE string.
IF mo_settings->get_adt_jump_enabled( ) = abap_true.
lv_checked = 'checked'.
ENDIF.
CREATE OBJECT ro_html.
ro_html->add( |<h2>ABAP Development Tools (ADT)</h2>| ).
ro_html->add( `<input type="checkbox" name="adt_jump_enabled" value="X" `
&& lv_checked && ` > Enable jump to ADT first` ).
ro_html->add( |<br>| ).
ro_html->add( |<br>| ).
ENDMETHOD.
METHOD render_commit_msg.
CREATE OBJECT ro_html.
ro_html->add( |<h2>Commit Message</h2>| ).
ro_html->add( |<label for="comment_length">Max. length of comment (recommendation 50)</label>| ).
ro_html->add( |<br>| ).
ro_html->add( |<input name="comment_length" type="number" step="10" size="3" maxlength="3" min="50"| &&
| value="{ mo_settings->get_commitmsg_comment_length( ) }">| ).
ro_html->add( |<br>| ).
ro_html->add( |<label for="body_size">Max. line size of body (recommendation 72)</label>| ).
ro_html->add( |<br>| ).
ro_html->add( |<input name="body_size" type="number" size="3" maxlength="3" min="50"| &&
| value="{ mo_settings->get_commitmsg_body_size( ) }">| ).
ro_html->add( |<br>| ).
ro_html->add( |<br>| ).
ENDMETHOD.
METHOD render_content.
CREATE OBJECT ro_html.
read_settings( ).
ro_html->add( render_form_begin( ) ).
ro_html->add( render_section_begin( |Global settings| ) ).
ro_html->add( render_proxy( ) ).
ro_html->add( |<hr>| ).
ro_html->add( render_commit_msg( ) ).
ro_html->add( |<hr>| ).
ro_html->add( render_development_internals( ) ).
ro_html->add( render_section_end( ) ).
ro_html->add( render_section_begin( |User specific settings| ) ).
ro_html->add( render_start_up( ) ).
ro_html->add( render_max_lines( ) ).
ro_html->add( |<hr>| ).
ro_html->add( render_adt_jump_enabled( ) ).
ro_html->add( |<hr>| ).
ro_html->add( render_link_hints( ) ).
ro_html->add( |<hr>| ).
ro_html->add( render_hotkeys( ) ).
ro_html->add( render_section_end( ) ).
ro_html->add( render_form_end( ) ).
ENDMETHOD. "render_content
METHOD render_development_internals.
DATA: lv_critical_tests TYPE string,
lv_experimental TYPE string.
IF mo_settings->get_run_critical_tests( ) = abap_true.
lv_critical_tests = 'checked'.
ENDIF.
IF mo_settings->get_experimental_features( ) = abap_true.
lv_experimental = 'checked'.
ENDIF.
CREATE OBJECT ro_html.
ro_html->add( |<h2>abapGit Development Internals settings</h2>| ).
ro_html->add( `<input type="checkbox" name="critical_tests" `
&& lv_critical_tests && ` > Enable critical unit tests (see LTCL_DANGEROUS)` ).
ro_html->add( |<br>| ).
ro_html->add( `<input type="checkbox" name="experimental_features" `
&& lv_experimental && ` > Enable experimental features` ).
ro_html->add( |<br>| ).
ro_html->add( |<br>| ).
ENDMETHOD.
METHOD render_form_begin.
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 && `">` ).
ENDMETHOD.
METHOD render_form_end.
CREATE OBJECT ro_html.
ro_html->add( '<input type="submit" value="Save" class="submit">' ).
ro_html->add( '</form>' ).
ro_html->add( '</div>' ).
ENDMETHOD.
METHOD render_hotkeys.
DATA: lv_index TYPE i,
lt_hotkeys TYPE yif_abapgit_definitions=>tty_hotkey,
lv_selected TYPE string,
lt_actions TYPE yif_abapgit_gui_page_hotkey=>tty_hotkey_action.
FIELD-SYMBOLS: <ls_key_binding> LIKE LINE OF lt_hotkeys,
<ls_action> LIKE LINE OF lt_actions.
lt_hotkeys = mo_settings->get_hotkeys( ).
IF lines( lt_hotkeys ) = 0.
lt_hotkeys = get_default_hotkeys( ).
ENDIF.
DO 3 TIMES.
APPEND INITIAL LINE TO lt_hotkeys.
ENDDO.
CREATE OBJECT ro_html.
ro_html->add( |<h2>Hotkeys</h2>| ).
ro_html->add( |(Only available with installed abapGit repo)| ).
ro_html->add( |<br/>| ).
ro_html->add( |<br/>| ).
ro_html->add( '<table class="repo_tab" id="key_bindings" style="max-width: 300px;">' ).
ro_html->add( '<tr><th>key</th><th>action</th></tr>' ).
lt_actions = get_possible_hotkey_actions( ).
LOOP AT lt_hotkeys ASSIGNING <ls_key_binding>.
lv_index = sy-tabix.
ro_html->add( '<tr>' ).
ro_html->add( |<td><input name="key_sequence_{ lv_index }" maxlength=1 type="text" | &&
|value="{ <ls_key_binding>-sequence }"></td>| ).
ro_html->add( |<td><select name="key_action_{ lv_index }">| ).
LOOP AT lt_actions ASSIGNING <ls_action>.
IF <ls_key_binding>-action = <ls_action>-action.
lv_selected = 'selected'.
ELSE.
CLEAR: lv_selected.
ENDIF.
ro_html->add( |<option value="{ <ls_action>-action }" |
&& |{ lv_selected }>|
&& |{ <ls_action>-name }</option>| ).
ENDLOOP.
ro_html->add( '</select></td>' ).
ro_html->add( '</tr>' ).
ENDLOOP.
ro_html->add( '</select></td>' ).
ro_html->add( '</tr>' ).
ro_html->add( '</table>' ).
ro_html->add( |<br>| ).
ro_html->add( |<br>| ).
ENDMETHOD.
METHOD render_link_hints.
DATA: lv_checked TYPE string,
lv_link_hint_key TYPE char01,
lv_link_background_color TYPE string.
IF mo_settings->get_link_hints_enabled( ) = abap_true.
lv_checked = 'checked'.
ENDIF.
lv_link_hint_key = mo_settings->get_link_hint_key( ).
lv_link_background_color = mo_settings->get_link_hint_background_color( ).
CREATE OBJECT ro_html.
ro_html->add( |<h2>Vimium like link hints</h2>| ).
ro_html->add( `<input type="checkbox" name="link_hints_enabled" value="X" `
&& lv_checked && ` > Enable Vimium like link hints` ).
ro_html->add( |<br>| ).
ro_html->add( |<br>| ).
ro_html->add( |<input type="text" name="link_hint_key" size="1" maxlength="1" value="{ lv_link_hint_key }" |
&& |> Single key to activate links| ).
ro_html->add( |<br>| ).
ro_html->add( |<br>| ).
ro_html->add( |<input type="text" name="link_hint_background_color" size="20" maxlength="20"|
&& | value="{ lv_link_background_color }"|
&& |> Background Color (HTML colors e.g. lightgreen or #42f47a)| ).
ro_html->add( |<br>| ).
ro_html->add( |<br>| ).
ENDMETHOD.
METHOD render_max_lines.
CREATE OBJECT ro_html.
ro_html->add( |<h2>List size</h2>| ).
ro_html->add( |<label for="max_lines">Max. # of objects listed (0 = all)</label>| ).
ro_html->add( |<br>| ).
ro_html->add( `<input name="max_lines" type="text" size="5" value="` && mo_settings->get_max_lines( ) && `">` ).
ro_html->add( |<br>| ).
ro_html->add( |<br>| ).
ENDMETHOD.
METHOD render_proxy.
CREATE OBJECT ro_html.
ro_html->add( |<h2>Proxy</h2>| ).
ro_html->add( |<label for="proxy_url">Proxy URL</label>| ).
ro_html->add( |<br>| ).
ro_html->add( `<input name="proxy_url" type="text" size="50" value="` &&
mo_settings->get_proxy_url( ) && `">` ).
ro_html->add( |<br>| ).
ro_html->add( |<label for="proxy_port">Proxy Port</label>| ).
ro_html->add( |<br>| ).
ro_html->add( `<input name="proxy_port" type="text" size="5" value="` &&
mo_settings->get_proxy_port( ) && `">` ).
ro_html->add( |<br>| ).
ro_html->add( |<label for="proxy_auth">Proxy Authentication</label>| ).
IF mo_settings->get_proxy_authentication( ) = abap_true.
ro_html->add( `<input name="proxy_auth" type="checkbox" checked>` ).
ELSE.
ro_html->add( `<input name="proxy_auth" type="checkbox">` ).
ENDIF.
ro_html->add( |<br>| ).
ro_html->add( |<br>| ).
ENDMETHOD.
METHOD render_section_begin.
CREATE OBJECT ro_html.
ro_html->add( |<h1>{ iv_header }</h1>| ).
ro_html->add( |<div class="settings_section">| ).
ENDMETHOD.
METHOD render_section_end.
CREATE OBJECT ro_html.
ro_html->add( |</div>| ).
ENDMETHOD.
METHOD render_start_up.
DATA lv_checked TYPE string.
IF mo_settings->get_show_default_repo( ) = abap_true.
lv_checked = 'checked'.
ENDIF.
CREATE OBJECT ro_html.
ro_html->add( |<h2>Start up</h2>| ).
ro_html->add( `<input type="checkbox" name="show_default_repo" value="X" `
&& lv_checked && ` > Show last repo` ).
ro_html->add( |<br>| ).
ro_html->add( |<br>| ).
ENDMETHOD.
METHOD validate_settings.
IF ( mo_settings->get_proxy_url( ) IS NOT INITIAL AND mo_settings->get_proxy_port( ) IS INITIAL ) OR
( mo_settings->get_proxy_url( ) IS INITIAL AND mo_settings->get_proxy_port( ) IS NOT INITIAL ).
MESSAGE 'If specifying proxy, specify both URL and port' TYPE 'W'.
ENDIF.
ENDMETHOD.
METHOD yif_abapgit_gui_page_hotkey~get_hotkey_actions.
ENDMETHOD.
METHOD yif_abapgit_gui_page~on_event.
* todo, check input values eg INT
DATA:
lt_post_fields TYPE tihttpnvp.
CASE iv_action.
WHEN c_action-save_settings.
lt_post_fields = parse_post( it_postdata ).
build_settings( lt_post_fields ).
validate_settings( ).
IF mv_error = abap_true.
MESSAGE 'Error when saving settings. Open an issue at https://github.com/larshp/abapGit' TYPE 'E'.
ELSE.
persist_settings( ).
ENDIF.
ev_state = yif_abapgit_definitions=>c_event_state-go_back.
ENDCASE.
ENDMETHOD.
METHOD is_post_field_checked.
FIELD-SYMBOLS: <ls_post_field> TYPE ihttpnvp.
READ TABLE mt_post_fields ASSIGNING <ls_post_field> WITH KEY name = iv_name.
IF sy-subrc = 0.
IF <ls_post_field>-value = abap_true "HTML value when using standard netweaver GUI
OR <ls_post_field>-value = 'on'. "HTML value when using Netweaver Java GUI
rv_return = abap_true.
ENDIF.
ENDIF.
ENDMETHOD.
ENDCLASS.
| 30.419714 | 116 | 0.663061 |
f7afa31ab7b2a8716faad41fe4e7704a3d7b2af7 | 60,527 | abap | ABAP | src/zcl_excel_common.clas.abap | kvtorp/abap2xlsx | e72e4ea6a9fa6aa9c17162b9e88db65d3902af90 | [
"Apache-2.0"
] | null | null | null | src/zcl_excel_common.clas.abap | kvtorp/abap2xlsx | e72e4ea6a9fa6aa9c17162b9e88db65d3902af90 | [
"Apache-2.0"
] | null | null | null | src/zcl_excel_common.clas.abap | kvtorp/abap2xlsx | e72e4ea6a9fa6aa9c17162b9e88db65d3902af90 | [
"Apache-2.0"
] | null | null | null | CLASS zcl_excel_common DEFINITION
PUBLIC
FINAL
CREATE PUBLIC .
*"* public components of class ZCL_EXCEL_COMMON
*"* do not include other source files here!!!
PUBLIC SECTION.
CONSTANTS c_excel_baseline_date TYPE d VALUE '19000101'. "#EC NOTEXT
CLASS-DATA c_excel_numfmt_offset TYPE int1 VALUE 164. "#EC NOTEXT . . . . . . . . . . . . . . . . " .
CONSTANTS c_excel_sheet_max_col TYPE int4 VALUE 16384. "#EC NOTEXT
CONSTANTS c_excel_sheet_min_col TYPE int4 VALUE 1. "#EC NOTEXT
CONSTANTS c_excel_sheet_max_row TYPE int4 VALUE 1048576. "#EC NOTEXT
CONSTANTS c_excel_sheet_min_row TYPE int4 VALUE 1. "#EC NOTEXT
CLASS-DATA c_spras_en TYPE spras VALUE 'E'. "#EC NOTEXT . . . . . . . . . . . . . . . . " .
CLASS-DATA o_conv TYPE REF TO cl_abap_conv_out_ce .
CONSTANTS c_excel_1900_leap_year TYPE d VALUE '19000228'. "#EC NOTEXT
CLASS-DATA c_xlsx_file_filter TYPE string VALUE 'Excel Workbook (*.xlsx)|*.xlsx|'. "#EC NOTEXT . . . . . . . " .
CLASS-METHODS class_constructor .
CLASS-METHODS describe_structure
IMPORTING
!io_struct TYPE REF TO cl_abap_structdescr
RETURNING
VALUE(rt_dfies) TYPE ddfields .
CLASS-METHODS convert_column2alpha
IMPORTING
!ip_column TYPE simple
RETURNING
VALUE(ep_column) TYPE zexcel_cell_column_alpha
RAISING
zcx_excel .
CLASS-METHODS convert_column2int
IMPORTING
!ip_column TYPE simple
RETURNING
VALUE(ep_column) TYPE zexcel_cell_column
RAISING
zcx_excel .
CLASS-METHODS convert_columnrow2column_a_row
IMPORTING
!i_columnrow TYPE clike
EXPORTING
!e_column TYPE zexcel_cell_column_alpha
!e_row TYPE zexcel_cell_row .
CLASS-METHODS convert_range2column_a_row
IMPORTING
!i_range TYPE clike
EXPORTING
!e_column_start TYPE zexcel_cell_column_alpha
!e_column_end TYPE zexcel_cell_column_alpha
!e_row_start TYPE zexcel_cell_row
!e_row_end TYPE zexcel_cell_row
!e_sheet TYPE clike
RAISING
zcx_excel .
CLASS-METHODS date_to_excel_string
IMPORTING
!ip_value TYPE d
RETURNING
VALUE(ep_value) TYPE zexcel_cell_value .
CLASS-METHODS encrypt_password
IMPORTING
!i_pwd TYPE zexcel_aes_password
RETURNING
VALUE(r_encrypted_pwd) TYPE zexcel_aes_password .
CLASS-METHODS escape_string
IMPORTING
!ip_value TYPE clike
RETURNING
VALUE(ep_escaped_value) TYPE string .
CLASS-METHODS unescape_string
IMPORTING
!iv_escaped TYPE clike
RETURNING
VALUE(ev_unescaped_string) TYPE string
RAISING
zcx_excel .
CLASS-METHODS excel_string_to_date
IMPORTING
!ip_value TYPE zexcel_cell_value
RETURNING
VALUE(ep_value) TYPE d
RAISING
zcx_excel .
CLASS-METHODS excel_string_to_time
IMPORTING
!ip_value TYPE zexcel_cell_value
RETURNING
VALUE(ep_value) TYPE t
RAISING
zcx_excel .
CLASS-METHODS excel_string_to_number
IMPORTING
!ip_value TYPE zexcel_cell_value
RETURNING
VALUE(ep_value) TYPE f
RAISING
zcx_excel .
CLASS-METHODS get_fieldcatalog
IMPORTING
!ip_table TYPE STANDARD TABLE
!iv_hide_mandt TYPE abap_bool DEFAULT abap_true
RETURNING
VALUE(ep_fieldcatalog) TYPE zexcel_t_fieldcatalog .
CLASS-METHODS number_to_excel_string
IMPORTING
VALUE(ip_value) TYPE numeric
RETURNING
VALUE(ep_value) TYPE zexcel_cell_value .
CLASS-METHODS recursive_class_to_struct
IMPORTING
!i_source TYPE any
CHANGING
!e_target TYPE data
!e_targetx TYPE data .
CLASS-METHODS recursive_struct_to_class
IMPORTING
!i_source TYPE data
!i_sourcex TYPE data
CHANGING
!e_target TYPE any .
CLASS-METHODS time_to_excel_string
IMPORTING
!ip_value TYPE t
RETURNING
VALUE(ep_value) TYPE zexcel_cell_value .
TYPE-POOLS abap .
TYPES: t_char10 TYPE c LENGTH 10.
CLASS-METHODS split_file
IMPORTING
!ip_file TYPE text255
EXPORTING
!ep_file TYPE text255
!ep_extension TYPE t_char10
!ep_dotextension TYPE t_char10 .
CLASS-METHODS calculate_cell_distance
IMPORTING
!iv_reference_cell TYPE clike
!iv_current_cell TYPE clike
EXPORTING
!ev_row_difference TYPE i
!ev_col_difference TYPE i
RAISING
zcx_excel .
CLASS-METHODS determine_resulting_formula
IMPORTING
!iv_reference_cell TYPE clike
!iv_reference_formula TYPE clike
!iv_current_cell TYPE clike
RETURNING
VALUE(ev_resulting_formula) TYPE string
RAISING
zcx_excel .
CLASS-METHODS shift_formula
IMPORTING
!iv_reference_formula TYPE clike
VALUE(iv_shift_cols) TYPE i
VALUE(iv_shift_rows) TYPE i
RETURNING
VALUE(ev_resulting_formula) TYPE string
RAISING
zcx_excel .
CLASS-METHODS is_cell_in_range
IMPORTING
!ip_column TYPE simple
!ip_row TYPE zexcel_cell_row
!ip_range TYPE clike
RETURNING
VALUE(rp_in_range) TYPE abap_bool
RAISING
zcx_excel .
*"* protected components of class ZCL_EXCEL_COMMON
*"* do not include other source files here!!!
*"* protected components of class ZCL_EXCEL_COMMON
*"* do not include other source files here!!!
PROTECTED SECTION.
PRIVATE SECTION.
CLASS-DATA c_excel_col_module TYPE int2 VALUE 64. "#EC NOTEXT . . . . . . . . . . . . . . . " .
CLASS-METHODS structure_case
IMPORTING
!is_component TYPE abap_componentdescr
CHANGING
!xt_components TYPE abap_component_tab .
CLASS-METHODS structure_recursive
IMPORTING
!is_component TYPE abap_componentdescr
RETURNING
VALUE(rt_components) TYPE abap_component_tab .
CLASS-METHODS char2hex
IMPORTING
!i_char TYPE char1
RETURNING
VALUE(r_hex) TYPE zexcel_pwd_hash .
CLASS-METHODS shl01
IMPORTING
!i_pwd_hash TYPE zexcel_pwd_hash
RETURNING
VALUE(r_pwd_hash) TYPE zexcel_pwd_hash .
CLASS-METHODS shr14
IMPORTING
!i_pwd_hash TYPE zexcel_pwd_hash
RETURNING
VALUE(r_pwd_hash) TYPE zexcel_pwd_hash .
ENDCLASS.
CLASS zcl_excel_common IMPLEMENTATION.
METHOD calculate_cell_distance.
DATA: lv_reference_row TYPE i,
lv_reference_col_alpha TYPE zexcel_cell_column_alpha,
lv_reference_col TYPE i,
lv_current_row TYPE i,
lv_current_col_alpha TYPE zexcel_cell_column_alpha,
lv_current_col TYPE i.
*--------------------------------------------------------------------*
* Split reference cell into numerical row/column representation
*--------------------------------------------------------------------*
convert_columnrow2column_a_row( EXPORTING
i_columnrow = iv_reference_cell
IMPORTING
e_column = lv_reference_col_alpha
e_row = lv_reference_row ).
lv_reference_col = convert_column2int( lv_reference_col_alpha ).
*--------------------------------------------------------------------*
* Split current cell into numerical row/column representation
*--------------------------------------------------------------------*
convert_columnrow2column_a_row( EXPORTING
i_columnrow = iv_current_cell
IMPORTING
e_column = lv_current_col_alpha
e_row = lv_current_row ).
lv_current_col = convert_column2int( lv_current_col_alpha ).
*--------------------------------------------------------------------*
* Calculate row and column difference
* Positive: Current cell below reference cell
* or Current cell right of reference cell
* Negative: Current cell above reference cell
* or Current cell left of reference cell
*--------------------------------------------------------------------*
ev_row_difference = lv_current_row - lv_reference_row.
ev_col_difference = lv_current_col - lv_reference_col.
ENDMETHOD.
METHOD char2hex.
IF o_conv IS NOT BOUND.
o_conv = cl_abap_conv_out_ce=>create( endian = 'L'
ignore_cerr = abap_true
replacement = '#' ).
ENDIF.
CALL METHOD o_conv->reset( ).
CALL METHOD o_conv->write( data = i_char ).
r_hex+1 = o_conv->get_buffer( ). " x'65' must be x'0065'
ENDMETHOD.
METHOD class_constructor.
c_xlsx_file_filter = 'Excel Workbook (*.xlsx)|*.xlsx|'(005).
ENDMETHOD.
METHOD convert_column2alpha.
DATA: lv_uccpi TYPE i,
lv_text TYPE sychar02,
lv_module TYPE int4,
lv_column TYPE zexcel_cell_column.
STATICS: sv_prev_in LIKE lv_column,
sv_prev_out LIKE ep_column.
* Propagate zcx_excel if error occurs " issue #155 - less restrictive typing for ip_column
lv_column = convert_column2int( ip_column ). " issue #155 - less restrictive typing for ip_column
*--------------------------------------------------------------------*
* Check whether column is in allowed range for EXCEL to handle ( 1-16384 )
*--------------------------------------------------------------------*
IF lv_column > 16384
OR lv_column < 1.
zcx_excel=>raise_text( 'Index out of bounds' ).
ENDIF.
*--------------------------------------------------------------------*
* Look up for previous succesfull cached result
*--------------------------------------------------------------------*
IF lv_column = sv_prev_in AND sv_prev_out IS NOT INITIAL.
ep_column = sv_prev_out.
RETURN.
ELSE.
CLEAR sv_prev_out.
sv_prev_in = lv_column.
ENDIF.
*--------------------------------------------------------------------*
* Build alpha representation of column
*--------------------------------------------------------------------*
WHILE lv_column GT 0.
lv_module = ( lv_column - 1 ) MOD 26.
lv_uccpi = 65 + lv_module.
lv_column = ( lv_column - lv_module ) / 26.
lv_text = cl_abap_conv_in_ce=>uccpi( lv_uccpi ).
CONCATENATE lv_text ep_column INTO ep_column.
ENDWHILE.
*--------------------------------------------------------------------*
* Save succesfull output into cache
*--------------------------------------------------------------------*
sv_prev_out = ep_column.
ENDMETHOD.
METHOD convert_column2int.
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-12-29
* - ...
* changes: renaming variables to naming conventions
* removing unused variables
* removing commented out code that is inactive for more then half a year
* message made to support multilinguality
* adding comments to explain what we are trying to achieve
*--------------------------------------------------------------------*
* issue#246 - error converting lower case column names
* - Stefan Schmoecker, 2012-12-29
* changes: translating the correct variable to upper dase
* adding missing exception if input is a number
* that is out of bounds
* adding missing exception if input contains
* illegal characters like german umlauts
*--------------------------------------------------------------------*
DATA: lv_column TYPE zexcel_cell_column_alpha,
lv_column_c TYPE char10,
lv_column_s TYPE string,
lv_errormessage TYPE string, " Can't pass '...'(abc) to exception-class
lv_modulo TYPE i.
STATICS: sv_prev_in LIKE lv_column_c,
sv_prev_out LIKE ep_column.
*--------------------------------------------------------------------*
* This module tries to identify which column a user wants to access
* Numbers as input are just passed back, anything else will be converted
* using EXCEL nomenclatura A = 1, AA = 27, ..., XFD = 16384
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* Normalize input ( upper case , no gaps )
*--------------------------------------------------------------------*
lv_column_c = ip_column.
* TRANSLATE lv_column TO UPPER CASE. " Fix #246
TRANSLATE lv_column_c TO UPPER CASE. " Fix #246
CONDENSE lv_column_c NO-GAPS.
IF lv_column_c EQ ''.
* lv_errormessage = 'Unable to interpret input as column'(003).
MESSAGE e800(zabap2xlsx) INTO lv_errormessage.
zcx_excel=>raise_symsg( ).
ENDIF.
*--------------------------------------------------------------------*
* Look up for previous succesfull cached result
*--------------------------------------------------------------------*
IF lv_column_c = sv_prev_in AND sv_prev_out IS NOT INITIAL.
ep_column = sv_prev_out.
RETURN.
ELSE.
CLEAR sv_prev_out.
sv_prev_in = lv_column_c.
ENDIF.
*--------------------------------------------------------------------*
* If a number gets passed, just convert it to an integer and return
* the converted value
*--------------------------------------------------------------------*
TRY.
IF lv_column_c CO '1234567890 '. " Fix #164
ep_column = lv_column_c. " Fix #164
*--------------------------------------------------------------------*
* Maximum column for EXCEL: XFD = 16384 " if anyone has a reference for this information - please add here instead of this comment
*--------------------------------------------------------------------*
IF ep_column > 16384 OR ep_column < 1.
lv_errormessage = 'Index out of bounds'(004).
zcx_excel=>raise_text( lv_errormessage ).
ENDIF.
EXIT.
ENDIF.
CATCH cx_sy_conversion_no_number. "#EC NO_HANDLER
" Try the character-approach if approach via number has failed
ENDTRY.
*--------------------------------------------------------------------*
* Raise error if unexpected characters turns up
*--------------------------------------------------------------------*
lv_column_s = lv_column_c.
IF lv_column_s CN sy-abcde.
* lv_errormessage = 'Unable to interpret input as column'(003).
MESSAGE e800(zabap2xlsx) INTO lv_errormessage.
zcx_excel=>raise_symsg( ).
ENDIF.
DO 1 TIMES. "Because of using CHECK
*--------------------------------------------------------------------*
* Interpret input as number to base 26 with A=1, ... Z=26
* Raise error if unexpected character turns up
*--------------------------------------------------------------------*
* 1st character
*--------------------------------------------------------------------*
lv_column = lv_column_c.
lv_modulo = cl_abap_conv_out_ce=>uccpi( lv_column+0(1) ) MOD zcl_excel_common=>c_excel_col_module.
IF lv_modulo < 1 OR lv_modulo > 26.
* lv_errormessage = 'Unable to interpret input as column'(003).
MESSAGE e800(zabap2xlsx) INTO lv_errormessage.
zcx_excel=>raise_symsg( ).
ENDIF.
ep_column = lv_modulo. " Leftmost digit
*--------------------------------------------------------------------*
* 2nd character if present
*--------------------------------------------------------------------*
CHECK lv_column+1(1) IS NOT INITIAL. " No need to continue if string ended
lv_modulo = cl_abap_conv_out_ce=>uccpi( lv_column+1(1) ) MOD zcl_excel_common=>c_excel_col_module.
IF lv_modulo < 1 OR lv_modulo > 26.
* lv_errormessage = 'Unable to interpret input as column'(003).
MESSAGE e800(zabap2xlsx) INTO lv_errormessage.
zcx_excel=>raise_symsg( ).
ENDIF.
ep_column = 26 * ep_column + lv_modulo. " if second digit is present first digit is for 26^1
*--------------------------------------------------------------------*
* 3rd character if present
*--------------------------------------------------------------------*
CHECK lv_column+2(1) IS NOT INITIAL. " No need to continue if string ended
lv_modulo = cl_abap_conv_out_ce=>uccpi( lv_column+2(1) ) MOD zcl_excel_common=>c_excel_col_module.
IF lv_modulo < 1 OR lv_modulo > 26.
* lv_errormessage = 'Unable to interpret input as column'(003).
MESSAGE e800(zabap2xlsx) INTO lv_errormessage.
zcx_excel=>raise_symsg( ).
ENDIF.
ep_column = 26 * ep_column + lv_modulo. " if third digit is present first digit is for 26^2 and second digit for 26^1
ENDDO.
*--------------------------------------------------------------------*
* Maximum column for EXCEL: XFD = 16384 " if anyone has a reference for this information - please add here instead of this comment
*--------------------------------------------------------------------*
IF ep_column > 16384 OR ep_column < 1.
lv_errormessage = 'Index out of bounds'(004).
zcx_excel=>raise_text( lv_errormessage ).
ENDIF.
*--------------------------------------------------------------------*
* Save succesfull output into cache
*--------------------------------------------------------------------*
sv_prev_out = ep_column.
ENDMETHOD.
METHOD convert_columnrow2column_a_row.
*--------------------------------------------------------------------*
"issue #256 - replacing char processing with regex
*--------------------------------------------------------------------*
* Stefan Schmoecker, 2013-08-11
* Allow input to be CLIKE instead of STRING
*--------------------------------------------------------------------*
DATA: pane_cell_row_a TYPE string,
lv_columnrow TYPE string.
lv_columnrow = i_columnrow. " Get rid of trailing blanks
FIND REGEX '^(\D+)(\d+)$' IN lv_columnrow SUBMATCHES e_column
pane_cell_row_a.
e_row = pane_cell_row_a.
ENDMETHOD.
METHOD convert_range2column_a_row.
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-12-07
* - ...
* changes: renaming variables to naming conventions
* aligning code
* added exceptionclass
* added errorhandling for invalid range
* adding comments to explain what we are trying to achieve
*--------------------------------------------------------------------*
* issue#241 - error when sheetname contains "!"
* - sheetname should be returned unescaped
* - Stefan Schmoecker, 2012-12-07
* changes: changed coding to support sheetnames with "!"
* unescaping sheetname
*--------------------------------------------------------------------*
* issue#155 - lessening restrictions of input parameters
* - Stefan Schmoecker, 2012-12-07
* changes: i_range changed to clike
* e_sheet changed to clike
*--------------------------------------------------------------------*
DATA: lv_sheet TYPE string,
lv_range TYPE string,
lv_columnrow_start TYPE string,
lv_columnrow_end TYPE string,
lv_position TYPE i,
lv_errormessage TYPE string. " Can't pass '...'(abc) to exception-class
*--------------------------------------------------------------------*
* Split input range into sheetname and Area
* 4 cases - a) input empty --> nothing to do
* - b) sheetname existing - starts with ' example 'Sheet 1'!$B$6:$D$13
* - c) sheetname existing - does not start with ' example Sheet1!$B$6:$D$13
* - d) no sheetname - just area example $B$6:$D$13
*--------------------------------------------------------------------*
* Initialize output parameters
CLEAR: e_column_start,
e_column_end,
e_row_start,
e_row_end,
e_sheet.
IF i_range IS INITIAL. " a) input empty --> nothing to do
EXIT.
ELSEIF i_range(1) = `'`. " b) sheetname existing - starts with '
FIND REGEX '\![^\!]*$' IN i_range MATCH OFFSET lv_position. " Find last !
IF sy-subrc = 0.
lv_sheet = i_range(lv_position).
ADD 1 TO lv_position.
lv_range = i_range.
SHIFT lv_range LEFT BY lv_position PLACES.
ELSE.
lv_errormessage = 'Invalid range'(001).
zcx_excel=>raise_text( lv_errormessage ).
ENDIF.
ELSEIF i_range CS '!'. " c) sheetname existing - does not start with '
SPLIT i_range AT '!' INTO lv_sheet lv_range.
" begin Dennis Schaaf
IF lv_range CP '*#REF*'.
lv_errormessage = 'Invalid range'(001).
zcx_excel=>raise_text( lv_errormessage ).
ENDIF.
" end Dennis Schaaf
ELSE. " d) no sheetname - just area
lv_range = i_range.
ENDIF.
REPLACE ALL OCCURRENCES OF '$' IN lv_range WITH ''.
SPLIT lv_range AT ':' INTO lv_columnrow_start lv_columnrow_end.
convert_columnrow2column_a_row( EXPORTING
i_columnrow = lv_columnrow_start
IMPORTING
e_column = e_column_start
e_row = e_row_start ).
convert_columnrow2column_a_row( EXPORTING
i_columnrow = lv_columnrow_end
IMPORTING
e_column = e_column_end
e_row = e_row_end ).
e_sheet = unescape_string( lv_sheet ). " Return in unescaped form
ENDMETHOD.
METHOD date_to_excel_string.
DATA: lv_date_diff TYPE i.
CHECK ip_value IS NOT INITIAL
AND ip_value <> space.
" Needed hack caused by the problem that:
" Excel 2000 incorrectly assumes that the year 1900 is a leap year
" http://support.microsoft.com/kb/214326/en-us
IF ip_value > c_excel_1900_leap_year.
lv_date_diff = ip_value - c_excel_baseline_date + 2.
ELSE.
lv_date_diff = ip_value - c_excel_baseline_date + 1.
ENDIF.
ep_value = zcl_excel_common=>number_to_excel_string( ip_value = lv_date_diff ).
ENDMETHOD.
METHOD describe_structure.
DATA: lt_components TYPE abap_component_tab,
lt_comps TYPE abap_component_tab,
ls_component TYPE abap_componentdescr,
lo_elemdescr TYPE REF TO cl_abap_elemdescr,
ls_dfies TYPE dfies,
l_position TYPE tabfdpos.
"for DDIC structure get the info directly
IF io_struct->is_ddic_type( ) = abap_true.
rt_dfies = io_struct->get_ddic_field_list( ).
ELSE.
lt_components = io_struct->get_components( ).
LOOP AT lt_components INTO ls_component.
structure_case( EXPORTING is_component = ls_component
CHANGING xt_components = lt_comps ) .
ENDLOOP.
LOOP AT lt_comps INTO ls_component.
CLEAR ls_dfies.
IF ls_component-type->kind = cl_abap_typedescr=>kind_elem. "E Elementary Type
ADD 1 TO l_position.
lo_elemdescr ?= ls_component-type.
IF lo_elemdescr->is_ddic_type( ) = abap_true.
ls_dfies = lo_elemdescr->get_ddic_field( ).
ls_dfies-fieldname = ls_component-name.
ls_dfies-position = l_position.
ELSE.
ls_dfies-fieldname = ls_component-name.
ls_dfies-position = l_position.
ls_dfies-inttype = lo_elemdescr->type_kind.
ls_dfies-leng = lo_elemdescr->length.
ls_dfies-outputlen = lo_elemdescr->length.
ls_dfies-decimals = lo_elemdescr->decimals.
ls_dfies-fieldtext = ls_component-name.
ls_dfies-reptext = ls_component-name.
ls_dfies-scrtext_s = ls_component-name.
ls_dfies-scrtext_m = ls_component-name.
ls_dfies-scrtext_l = ls_component-name.
ls_dfies-dynpfld = abap_true.
ENDIF.
INSERT ls_dfies INTO TABLE rt_dfies.
ENDIF.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD determine_resulting_formula.
DATA: lv_row_difference TYPE i,
lv_col_difference TYPE i.
*--------------------------------------------------------------------*
* Calculate distance of reference and current cell
*--------------------------------------------------------------------*
calculate_cell_distance( EXPORTING
iv_reference_cell = iv_reference_cell
iv_current_cell = iv_current_cell
IMPORTING
ev_row_difference = lv_row_difference
ev_col_difference = lv_col_difference ).
*--------------------------------------------------------------------*
* and shift formula by using the row- and columndistance
*--------------------------------------------------------------------*
ev_resulting_formula = shift_formula( iv_reference_formula = iv_reference_formula
iv_shift_rows = lv_row_difference
iv_shift_cols = lv_col_difference ).
ENDMETHOD. "determine_resulting_formula
METHOD encrypt_password.
DATA lv_curr_offset TYPE i.
DATA lv_curr_char TYPE c LENGTH 1.
DATA lv_curr_hex TYPE zexcel_pwd_hash.
DATA lv_pwd_len TYPE zexcel_pwd_hash.
DATA lv_pwd_hash TYPE zexcel_pwd_hash.
CONSTANTS:
lv_0x7fff TYPE zexcel_pwd_hash VALUE '7FFF',
lv_0x0001 TYPE zexcel_pwd_hash VALUE '0001',
lv_0xce4b TYPE zexcel_pwd_hash VALUE 'CE4B'.
DATA lv_pwd TYPE zexcel_aes_password.
lv_pwd = i_pwd.
lv_pwd_len = strlen( lv_pwd ).
lv_curr_offset = lv_pwd_len - 1.
WHILE lv_curr_offset GE 0.
lv_curr_char = lv_pwd+lv_curr_offset(1).
lv_curr_hex = char2hex( lv_curr_char ).
lv_pwd_hash = ( shr14( lv_pwd_hash ) BIT-AND lv_0x0001 ) BIT-OR ( shl01( lv_pwd_hash ) BIT-AND lv_0x7fff ).
lv_pwd_hash = lv_pwd_hash BIT-XOR lv_curr_hex.
SUBTRACT 1 FROM lv_curr_offset.
ENDWHILE.
lv_pwd_hash = ( shr14( lv_pwd_hash ) BIT-AND lv_0x0001 ) BIT-OR ( shl01( lv_pwd_hash ) BIT-AND lv_0x7fff ).
lv_pwd_hash = lv_pwd_hash BIT-XOR lv_0xce4b.
lv_pwd_hash = lv_pwd_hash BIT-XOR lv_pwd_len.
WRITE lv_pwd_hash TO r_encrypted_pwd.
ENDMETHOD.
METHOD escape_string.
*--------------------------------------------------------------------*
* issue #230 - Pimp my Code
* - Stefan Schmoecker, (done) 2012-12-08
* - ...
* changes: aligning code
* adding comments to explain what we are trying to achieve
*--------------------------------------------------------------------*
* issue#242 - Support escaping for white-spaces
* - Escaping also necessary when ' encountered in input
* - Stefan Schmoecker, 2012-12-08
* changes: switched check if escaping is necessary to regular expression
* and moved the "REPLACE"
*--------------------------------------------------------------------*
* issue#155 - lessening restrictions of input parameters
* - Stefan Schmoecker, 2012-12-08
* changes: ip_value changed to clike
*--------------------------------------------------------------------*
DATA: lv_value TYPE string.
*--------------------------------------------------------------------*
* There exist various situations when a space will be used to separate
* different parts of a string. When we have a string consisting spaces
* that will cause errors unless we "escape" the string by putting ' at
* the beginning and at the end of the string.
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* When allowing clike-input parameters we might encounter trailing
* "real" blanks . These are automatically eliminated when moving
* the input parameter to a string.
* Now any remaining spaces ( white-spaces or normal spaces ) should
* trigger the escaping as well as any '
*--------------------------------------------------------------------*
lv_value = ip_value.
FIND REGEX `\s|'` IN lv_value. " \s finds regular and white spaces
IF sy-subrc = 0.
REPLACE ALL OCCURRENCES OF `'` IN lv_value WITH `''`.
CONCATENATE `'` lv_value `'` INTO lv_value .
ENDIF.
ep_escaped_value = lv_value.
ENDMETHOD.
METHOD excel_string_to_date.
DATA: lv_date_int TYPE i.
CHECK ip_value IS NOT INITIAL AND ip_value CN ' 0'.
TRY.
lv_date_int = ip_value.
IF lv_date_int NOT BETWEEN 1 AND 2958465.
zcx_excel=>raise_text( 'Unable to interpret date' ).
ENDIF.
ep_value = lv_date_int + c_excel_baseline_date - 2.
" Needed hack caused by the problem that:
" Excel 2000 incorrectly assumes that the year 1900 is a leap year
" http://support.microsoft.com/kb/214326/en-us
IF ep_value < c_excel_1900_leap_year.
ep_value = ep_value + 1.
ENDIF.
CATCH cx_sy_conversion_error.
zcx_excel=>raise_text( 'Index out of bounds' ).
ENDTRY.
ENDMETHOD.
METHOD excel_string_to_number.
* If we encounter anything more complicated in EXCEL we might have to extend this
* But currently this works fine - even for numbers in scientific notation
ep_value = ip_value.
ENDMETHOD.
METHOD excel_string_to_time.
DATA: lv_seconds_in_day TYPE i,
lv_day_fraction TYPE f,
lc_seconds_in_day TYPE i VALUE 86400.
TRY.
lv_day_fraction = ip_value.
lv_seconds_in_day = lv_day_fraction * lc_seconds_in_day.
ep_value = lv_seconds_in_day.
CATCH cx_sy_conversion_error.
zcx_excel=>raise_text( 'Unable to interpret time' ).
ENDTRY.
ENDMETHOD.
METHOD get_fieldcatalog.
DATA: lr_dref_tab TYPE REF TO data,
lo_salv_table TYPE REF TO cl_salv_table,
lo_salv_columns_table TYPE REF TO cl_salv_columns_table,
lt_salv_t_column_ref TYPE salv_t_column_ref,
ls_salv_t_column_ref LIKE LINE OF lt_salv_t_column_ref,
lo_salv_column_table TYPE REF TO cl_salv_column_table.
FIELD-SYMBOLS: <tab> TYPE STANDARD TABLE.
FIELD-SYMBOLS: <fcat> LIKE LINE OF ep_fieldcatalog.
* Get copy of IP_TABLE-structure <-- must be changeable to create salv
CREATE DATA lr_dref_tab LIKE ip_table.
ASSIGN lr_dref_tab->* TO <tab>.
* Create salv --> implicitly create fieldcat
TRY.
cl_salv_table=>factory( IMPORTING
r_salv_table = lo_salv_table
CHANGING
t_table = <tab> ).
lo_salv_columns_table = lo_salv_table->get_columns( ).
lt_salv_t_column_ref = lo_salv_columns_table->get( ).
CATCH cx_root.
* maybe some errorhandling here - just haven't made up my mind yet
ENDTRY.
* Loop through columns and set relevant fields ( fieldname, texts )
LOOP AT lt_salv_t_column_ref INTO ls_salv_t_column_ref.
lo_salv_column_table ?= ls_salv_t_column_ref-r_column.
APPEND INITIAL LINE TO ep_fieldcatalog ASSIGNING <fcat>.
<fcat>-position = sy-tabix.
<fcat>-fieldname = ls_salv_t_column_ref-columnname.
<fcat>-scrtext_s = ls_salv_t_column_ref-r_column->get_short_text( ).
<fcat>-scrtext_m = ls_salv_t_column_ref-r_column->get_medium_text( ).
<fcat>-scrtext_l = ls_salv_t_column_ref-r_column->get_long_text( ).
<fcat>-abap_type = lo_salv_column_table->get_ddic_inttype( ).
<fcat>-dynpfld = 'X'. " What in the world would we exclude here?
" except for the MANDT-field of most tables ( 1st column that is )
IF <fcat>-position = 1 AND lo_salv_column_table->get_ddic_datatype( ) = 'CLNT' AND iv_hide_mandt = abap_true.
CLEAR <fcat>-dynpfld.
ENDIF.
* For fields that don't a description ( i.e. defined by "field type i," )
* just use the fieldname as description - that is better than nothing
IF <fcat>-scrtext_s IS INITIAL
AND <fcat>-scrtext_m IS INITIAL
AND <fcat>-scrtext_l IS INITIAL.
CONCATENATE 'Col:' <fcat>-fieldname INTO <fcat>-scrtext_l SEPARATED BY space.
<fcat>-scrtext_m = <fcat>-scrtext_l.
<fcat>-scrtext_s = <fcat>-scrtext_l.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD is_cell_in_range.
DATA lv_column_start TYPE zexcel_cell_column_alpha.
DATA lv_column_end TYPE zexcel_cell_column_alpha.
DATA lv_row_start TYPE zexcel_cell_row.
DATA lv_row_end TYPE zexcel_cell_row.
DATA lv_column_start_i TYPE zexcel_cell_column.
DATA lv_column_end_i TYPE zexcel_cell_column.
DATA lv_column_i TYPE zexcel_cell_column.
* Split range and convert columns
convert_range2column_a_row(
EXPORTING
i_range = ip_range
IMPORTING
e_column_start = lv_column_start
e_column_end = lv_column_end
e_row_start = lv_row_start
e_row_end = lv_row_end ).
lv_column_start_i = convert_column2int( ip_column = lv_column_start ).
lv_column_end_i = convert_column2int( ip_column = lv_column_end ).
lv_column_i = convert_column2int( ip_column = ip_column ).
* Check if cell is in range
IF lv_column_i >= lv_column_start_i AND
lv_column_i <= lv_column_end_i AND
ip_row >= lv_row_start AND
ip_row <= lv_row_end.
rp_in_range = abap_true.
ENDIF.
ENDMETHOD.
METHOD number_to_excel_string.
DATA: lv_value_c TYPE c LENGTH 100.
WRITE ip_value TO lv_value_c EXPONENT 0 NO-GROUPING NO-SIGN.
REPLACE ALL OCCURRENCES OF ',' IN lv_value_c WITH '.'.
ep_value = lv_value_c.
CONDENSE ep_value.
IF ip_value < 0.
CONCATENATE '-' ep_value INTO ep_value.
ELSEIF ip_value EQ 0.
ep_value = '0'.
ENDIF.
ENDMETHOD.
METHOD recursive_class_to_struct.
" # issue 139
* is working for me - but after looking through this coding I guess
* I'll rewrite this to a version w/o recursion
* This is private an no one using it so far except me, so no need to hurry
DATA: descr TYPE REF TO cl_abap_structdescr,
wa_component LIKE LINE OF descr->components,
attribute_name TYPE fieldname,
flag_class TYPE flag.
FIELD-SYMBOLS: <field> TYPE any,
<fieldx> TYPE any,
<attribute> TYPE any.
descr ?= cl_abap_structdescr=>describe_by_data( e_target ).
LOOP AT descr->components INTO wa_component.
* Assign structure and X-structure
ASSIGN COMPONENT wa_component-name OF STRUCTURE e_target TO <field>.
ASSIGN COMPONENT wa_component-name OF STRUCTURE e_targetx TO <fieldx>.
* At least one field in the structure should be marked - otherwise continue with next field
CLEAR flag_class.
* maybe source is just a structure - try assign component...
ASSIGN COMPONENT wa_component-name OF STRUCTURE i_source TO <attribute>.
IF sy-subrc <> 0.
* not - then it is an attribute of the class - use different assign then
CONCATENATE 'i_source->' wa_component-name INTO attribute_name.
ASSIGN (attribute_name) TO <attribute>.
IF sy-subrc <> 0.
EXIT.
ENDIF. " Should not happen if structure is built properly - otherwise just exit to create no dumps
flag_class = abap_true.
ENDIF.
CASE wa_component-type_kind.
WHEN cl_abap_structdescr=>typekind_struct1 OR cl_abap_structdescr=>typekind_struct2. " Structure --> use recursio
* IF flag_class = abap_true.
** Only borders will be passed as unbound references. But since we want to set a value we have to create an instance
* ENDIF.
zcl_excel_common=>recursive_class_to_struct( EXPORTING i_source = <attribute>
CHANGING e_target = <field>
e_targetx = <fieldx> ).
WHEN OTHERS.
<field> = <attribute>.
<fieldx> = abap_true.
ENDCASE.
ENDLOOP.
ENDMETHOD.
METHOD recursive_struct_to_class.
" # issue 139
* is working for me - but after looking through this coding I guess
* I'll rewrite this to a version w/o recursion
* This is private an no one using it so far except me, so no need to hurry
DATA: descr TYPE REF TO cl_abap_structdescr,
wa_component LIKE LINE OF descr->components,
attribute_name TYPE fieldname,
flag_class TYPE flag,
o_border TYPE REF TO zcl_excel_style_border.
FIELD-SYMBOLS: <field> TYPE any,
<fieldx> TYPE any,
<attribute> TYPE any.
descr ?= cl_abap_structdescr=>describe_by_data( i_source ).
LOOP AT descr->components INTO wa_component.
* Assign structure and X-structure
ASSIGN COMPONENT wa_component-name OF STRUCTURE i_source TO <field>.
ASSIGN COMPONENT wa_component-name OF STRUCTURE i_sourcex TO <fieldx>.
* At least one field in the structure should be marked - otherwise continue with next field
CHECK <fieldx> CA abap_true.
CLEAR flag_class.
* maybe target is just a structure - try assign component...
ASSIGN COMPONENT wa_component-name OF STRUCTURE e_target TO <attribute>.
IF sy-subrc <> 0.
* not - then it is an attribute of the class - use different assign then
CONCATENATE 'E_TARGET->' wa_component-name INTO attribute_name.
ASSIGN (attribute_name) TO <attribute>.
IF sy-subrc <> 0.EXIT.ENDIF. " Should not happen if structure is built properly - otherwise just exit to create no dumps
flag_class = abap_true.
ENDIF.
CASE wa_component-type_kind.
WHEN cl_abap_structdescr=>typekind_struct1 OR cl_abap_structdescr=>typekind_struct2. " Structure --> use recursion
" To avoid dump with attribute GRADTYPE of class ZCL_EXCEL_STYLE_FILL
" quick and really dirty fix -> check the attribute name
" Border has to be initialized somewhere else
IF wa_component-name EQ 'GRADTYPE'.
flag_class = abap_false.
ENDIF.
IF flag_class = abap_true AND <attribute> IS INITIAL.
* Only borders will be passed as unbound references. But since we want to set a value we have to create an instance
CREATE OBJECT o_border.
<attribute> = o_border.
ENDIF.
zcl_excel_common=>recursive_struct_to_class( EXPORTING i_source = <field>
i_sourcex = <fieldx>
CHANGING e_target = <attribute> ).
* WHEN cl_abap_structdescr=>typekind_struct2. " String
* CHECK <fieldx> = abap_true. " Marked for change
* <attribute_s> = <field>.
WHEN OTHERS.
CHECK <fieldx> = abap_true. " Marked for change
<attribute> = <field>.
ENDCASE.
ENDLOOP.
ENDMETHOD.
METHOD shift_formula.
CONSTANTS: lcv_operators TYPE string VALUE '+-/*^%=<>&, !',
lcv_letters TYPE string VALUE 'ABCDEFGHIJKLMNOPQRSTUVWXYZ$',
lcv_digits TYPE string VALUE '0123456789',
lcv_cell_reference_error TYPE string VALUE '#REF!'.
DATA: lv_tcnt TYPE i, " Counter variable
lv_tlen TYPE i, " Temp variable length
lv_cnt TYPE i, " Counter variable
lv_cnt2 TYPE i, " Counter variable
lv_offset1 TYPE i, " Character offset
lv_numchars TYPE i, " Number of characters counter
lv_tchar(1) TYPE c, " Temp character
lv_tchar2(1) TYPE c, " Temp character
lv_cur_form(2000) TYPE c, " Formula for current cell
lv_ref_cell_addr TYPE string, " Reference cell address
lv_tcol1 TYPE string, " Temp column letter
lv_tcol2 TYPE string, " Temp column letter
lv_tcoln TYPE i, " Temp column number
lv_trow1 TYPE string, " Temp row number
lv_trow2 TYPE string, " Temp row number
lv_flen TYPE i, " Length of reference formula
lv_tlen2 TYPE i, " Temp variable length
lv_substr1 TYPE string, " Substring variable
lv_abscol TYPE string, " Absolute column symbol
lv_absrow TYPE string, " Absolute row symbol
lv_errormessage TYPE string.
*--------------------------------------------------------------------*
* When copying a cell in EXCEL to another cell any inherent formulas
* are copied as well. Cell-references in the formula are being adjusted
* by the distance of the new cell to the original one
*--------------------------------------------------------------------*
* §1 Parse reference formula character by character
* §2 Identify Cell-references
* §3 Shift cell-reference
* §4 Build resulting formula
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* No distance --> Reference = resulting cell/formula
*--------------------------------------------------------------------*
IF iv_shift_cols = 0
AND iv_shift_rows = 0.
ev_resulting_formula = iv_reference_formula.
EXIT. " done
ENDIF.
lv_flen = strlen( iv_reference_formula ).
lv_numchars = 1.
*--------------------------------------------------------------------*
* §1 Parse reference formula character by character
*--------------------------------------------------------------------*
DO lv_flen TIMES.
CLEAR: lv_tchar,
lv_substr1,
lv_ref_cell_addr.
lv_cnt2 = lv_cnt + 1.
IF lv_cnt2 > lv_flen.
EXIT. " Done
ENDIF.
*--------------------------------------------------------------------*
* Here we have the current character in the formula
*--------------------------------------------------------------------*
lv_tchar = iv_reference_formula+lv_cnt(1).
*--------------------------------------------------------------------*
* Operators or opening parenthesis will separate possible cellreferences
*--------------------------------------------------------------------*
IF ( lv_tchar CA lcv_operators
OR lv_tchar CA '(' )
AND lv_cnt2 = 1.
lv_substr1 = iv_reference_formula+lv_offset1(1).
CONCATENATE lv_cur_form lv_substr1 INTO lv_cur_form.
lv_cnt = lv_cnt + 1.
lv_offset1 = lv_cnt.
lv_numchars = 1.
CONTINUE. " --> next character in formula can be analyzed
ENDIF.
*--------------------------------------------------------------------*
* Quoted literal text holds no cell reference --> advance to end of text
*--------------------------------------------------------------------*
IF lv_tchar EQ '"'.
lv_cnt = lv_cnt + 1.
lv_numchars = lv_numchars + 1.
lv_tchar = iv_reference_formula+lv_cnt(1).
WHILE lv_tchar NE '"'.
lv_cnt = lv_cnt + 1.
lv_numchars = lv_numchars + 1.
lv_tchar = iv_reference_formula+lv_cnt(1).
ENDWHILE.
lv_cnt2 = lv_cnt + 1.
lv_substr1 = iv_reference_formula+lv_offset1(lv_numchars).
CONCATENATE lv_cur_form lv_substr1 INTO lv_cur_form.
lv_cnt = lv_cnt + 1.
IF lv_cnt = lv_flen.
EXIT.
ENDIF.
lv_offset1 = lv_cnt.
lv_numchars = 1.
lv_tchar = iv_reference_formula+lv_cnt(1).
lv_cnt2 = lv_cnt + 1.
CONTINUE. " --> next character in formula can be analyzed
ENDIF.
*--------------------------------------------------------------------*
* Operators or parenthesis or last character in formula will separate possible cellreferences
*--------------------------------------------------------------------*
IF lv_tchar CA lcv_operators
OR lv_tchar CA '():'
OR lv_cnt2 = lv_flen.
IF lv_cnt > 0.
lv_substr1 = iv_reference_formula+lv_offset1(lv_numchars).
*--------------------------------------------------------------------*
* Check for text concatenation and functions
*--------------------------------------------------------------------*
IF ( lv_tchar CA lcv_operators AND lv_tchar EQ lv_substr1 ) OR lv_tchar EQ '('.
CONCATENATE lv_cur_form lv_substr1 INTO lv_cur_form.
lv_cnt = lv_cnt + 1.
lv_offset1 = lv_cnt.
lv_cnt2 = lv_cnt + 1.
lv_numchars = 1.
CONTINUE. " --> next character in formula can be analyzed
ENDIF.
lv_tlen = lv_cnt2 - lv_offset1.
*--------------------------------------------------------------------*
* Exclude mathematical operators and closing parentheses
*--------------------------------------------------------------------*
IF lv_tchar CA lcv_operators
OR lv_tchar CA ':)'.
IF lv_cnt2 = lv_flen
AND lv_numchars = 1.
CONCATENATE lv_cur_form lv_substr1 INTO lv_cur_form.
lv_cnt = lv_cnt + 1.
lv_offset1 = lv_cnt.
lv_cnt2 = lv_cnt + 1.
lv_numchars = 1.
CONTINUE. " --> next character in formula can be analyzed
ELSE.
lv_tlen = lv_tlen - 1.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
* Capture reference cell address
*--------------------------------------------------------------------*
TRY.
MOVE: iv_reference_formula+lv_offset1(lv_tlen) TO lv_ref_cell_addr. "Ref cell address
CATCH cx_root.
lv_errormessage = 'Internal error in Class ZCL_EXCEL_COMMON Method SHIFT_FORMULA Spot 1 '. " Change to messageclass if possible
zcx_excel=>raise_text( lv_errormessage ).
ENDTRY.
*--------------------------------------------------------------------*
* Split cell address into characters and numbers
*--------------------------------------------------------------------*
CLEAR: lv_tlen,
lv_tcnt,
lv_tcol1,
lv_trow1.
lv_tlen = strlen( lv_ref_cell_addr ).
IF lv_tlen <> 0.
CLEAR: lv_tcnt.
DO lv_tlen TIMES.
CLEAR: lv_tchar2.
lv_tchar2 = lv_ref_cell_addr+lv_tcnt(1).
IF lv_tchar2 CA lcv_letters.
CONCATENATE lv_tcol1 lv_tchar2 INTO lv_tcol1.
ELSEIF lv_tchar2 CA lcv_digits.
CONCATENATE lv_trow1 lv_tchar2 INTO lv_trow1.
ENDIF.
lv_tcnt = lv_tcnt + 1.
ENDDO.
ENDIF.
*--------------------------------------------------------------------*
* Check for invalid cell address
*--------------------------------------------------------------------*
IF lv_tcol1 IS INITIAL OR lv_trow1 IS INITIAL.
CONCATENATE lv_cur_form lv_substr1 INTO lv_cur_form.
lv_cnt = lv_cnt + 1.
lv_offset1 = lv_cnt.
lv_cnt2 = lv_cnt + 1.
lv_numchars = 1.
CONTINUE.
ENDIF.
*--------------------------------------------------------------------*
* Check for range names
*--------------------------------------------------------------------*
CLEAR: lv_tlen.
lv_tlen = strlen( lv_tcol1 ).
IF lv_tlen GT 3.
CONCATENATE lv_cur_form lv_substr1 INTO lv_cur_form.
lv_cnt = lv_cnt + 1.
lv_offset1 = lv_cnt.
lv_cnt2 = lv_cnt + 1.
lv_numchars = 1.
CONTINUE.
ENDIF.
*--------------------------------------------------------------------*
* Check for valid row
*--------------------------------------------------------------------*
IF lv_trow1 GT 1048576.
CONCATENATE lv_cur_form lv_substr1 INTO lv_cur_form.
lv_cnt = lv_cnt + 1.
lv_offset1 = lv_cnt.
lv_cnt2 = lv_cnt + 1.
lv_numchars = 1.
CONTINUE.
ENDIF.
*--------------------------------------------------------------------*
* Check for absolute column or row reference
*--------------------------------------------------------------------*
CLEAR: lv_tcol2,
lv_trow2,
lv_abscol,
lv_absrow.
lv_tlen2 = strlen( lv_tcol1 ) - 1.
IF lv_tcol1 IS NOT INITIAL.
lv_abscol = lv_tcol1(1).
ENDIF.
IF lv_tlen2 GE 0.
lv_absrow = lv_tcol1+lv_tlen2(1).
ENDIF.
IF lv_abscol EQ '$' AND lv_absrow EQ '$'.
lv_tlen2 = lv_tlen2 - 1.
IF lv_tlen2 > 0.
lv_tcol1 = lv_tcol1+1(lv_tlen2).
ENDIF.
lv_tlen2 = lv_tlen2 + 1.
ELSEIF lv_abscol EQ '$'.
lv_tcol1 = lv_tcol1+1(lv_tlen2).
ELSEIF lv_absrow EQ '$'.
lv_tcol1 = lv_tcol1(lv_tlen2).
ENDIF.
*--------------------------------------------------------------------*
* Check for valid column
*--------------------------------------------------------------------*
TRY.
lv_tcoln = zcl_excel_common=>convert_column2int( lv_tcol1 ) + iv_shift_cols.
CATCH zcx_excel.
CONCATENATE lv_cur_form lv_substr1 INTO lv_cur_form.
lv_cnt = lv_cnt + 1.
lv_offset1 = lv_cnt.
lv_cnt2 = lv_cnt + 1.
lv_numchars = 1.
CONTINUE.
ENDTRY.
*--------------------------------------------------------------------*
* Check whether there is a referencing problem
*--------------------------------------------------------------------*
lv_trow2 = lv_trow1 + iv_shift_rows.
IF ( lv_tcoln < 1 AND lv_abscol <> '$' ) " Maybe we should add here max-column and max row-tests as well.
OR ( lv_trow2 < 1 AND lv_absrow <> '$' ). " Check how EXCEL behaves in this case
*--------------------------------------------------------------------*
* Referencing problem encountered --> set error
*--------------------------------------------------------------------*
CONCATENATE lv_cur_form lcv_cell_reference_error INTO lv_cur_form.
ELSE.
*--------------------------------------------------------------------*
* No referencing problems --> adjust row and column
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* Adjust column
*--------------------------------------------------------------------*
IF lv_abscol EQ '$'.
CONCATENATE lv_cur_form lv_abscol lv_tcol1 INTO lv_cur_form.
ELSEIF iv_shift_cols EQ 0.
CONCATENATE lv_cur_form lv_tcol1 INTO lv_cur_form.
ELSE.
TRY.
lv_tcol2 = zcl_excel_common=>convert_column2alpha( lv_tcoln ).
CONCATENATE lv_cur_form lv_tcol2 INTO lv_cur_form.
CATCH zcx_excel.
CONCATENATE lv_cur_form lv_substr1 INTO lv_cur_form.
lv_cnt = lv_cnt + 1.
lv_offset1 = lv_cnt.
lv_cnt2 = lv_cnt + 1.
lv_numchars = 1.
CONTINUE.
ENDTRY.
ENDIF.
*--------------------------------------------------------------------*
* Adjust row
*--------------------------------------------------------------------*
IF lv_absrow EQ '$'.
CONCATENATE lv_cur_form lv_absrow lv_trow1 INTO lv_cur_form.
ELSEIF iv_shift_rows = 0.
CONCATENATE lv_cur_form lv_trow1 INTO lv_cur_form.
* elseif lv_trow2 < 1.
* CONCATENATE lv_cur_form lc_cell_reference_error INTO lv_cur_form.
ELSE.
CONCATENATE lv_cur_form lv_trow2 INTO lv_cur_form.
ENDIF.
ENDIF.
lv_numchars = 0.
IF lv_tchar CA lcv_operators
OR lv_tchar CA ':)'.
CONCATENATE lv_cur_form lv_tchar INTO lv_cur_form.
ENDIF.
lv_offset1 = lv_cnt2.
ENDIF.
ENDIF.
lv_numchars = lv_numchars + 1.
lv_cnt = lv_cnt + 1.
lv_cnt2 = lv_cnt + 1.
ENDDO.
*--------------------------------------------------------------------*
* Return resulting formula
*--------------------------------------------------------------------*
IF lv_cur_form IS NOT INITIAL.
MOVE lv_cur_form TO ev_resulting_formula.
ENDIF.
ENDMETHOD.
METHOD shl01.
DATA:
lv_bit TYPE i,
lv_curr_pos TYPE i VALUE 2,
lv_prev_pos TYPE i VALUE 1.
DO 15 TIMES.
GET BIT lv_curr_pos OF i_pwd_hash INTO lv_bit.
SET BIT lv_prev_pos OF r_pwd_hash TO lv_bit.
ADD 1 TO lv_curr_pos.
ADD 1 TO lv_prev_pos.
ENDDO.
SET BIT 16 OF r_pwd_hash TO 0.
ENDMETHOD.
METHOD shr14.
DATA:
lv_bit TYPE i,
lv_curr_pos TYPE i,
lv_next_pos TYPE i.
r_pwd_hash = i_pwd_hash.
DO 14 TIMES.
lv_curr_pos = 15.
lv_next_pos = 16.
DO 15 TIMES.
GET BIT lv_curr_pos OF r_pwd_hash INTO lv_bit.
SET BIT lv_next_pos OF r_pwd_hash TO lv_bit.
SUBTRACT 1 FROM lv_curr_pos.
SUBTRACT 1 FROM lv_next_pos.
ENDDO.
SET BIT 1 OF r_pwd_hash TO 0.
ENDDO.
ENDMETHOD.
METHOD split_file.
DATA: lt_hlp TYPE TABLE OF text255,
ls_hlp TYPE text255.
DATA: lf_ext(10) TYPE c,
lf_dot_ext(10) TYPE c.
DATA: lf_anz TYPE i,
lf_len TYPE i.
** ---------------------------------------------------------------------
CLEAR: lt_hlp,
ep_file,
ep_extension,
ep_dotextension.
** Split the whole file at '.'
SPLIT ip_file AT '.' INTO TABLE lt_hlp.
** get the extenstion from the last line of table
DESCRIBE TABLE lt_hlp LINES lf_anz.
IF lf_anz <= 1.
ep_file = ip_file.
EXIT.
ENDIF.
READ TABLE lt_hlp INTO ls_hlp INDEX lf_anz.
ep_extension = ls_hlp.
lf_ext = ls_hlp.
IF NOT lf_ext IS INITIAL.
CONCATENATE '.' lf_ext INTO lf_dot_ext.
ENDIF.
ep_dotextension = lf_dot_ext.
** get only the filename
lf_len = strlen( ip_file ) - strlen( lf_dot_ext ).
IF lf_len > 0.
ep_file = ip_file(lf_len).
ENDIF.
ENDMETHOD.
METHOD structure_case.
DATA: lt_comp_str TYPE abap_component_tab.
CASE is_component-type->kind.
WHEN cl_abap_typedescr=>kind_elem. "E Elementary Type
INSERT is_component INTO TABLE xt_components.
WHEN cl_abap_typedescr=>kind_table. "T Table
INSERT is_component INTO TABLE xt_components.
WHEN cl_abap_typedescr=>kind_struct. "S Structure
lt_comp_str = structure_recursive( is_component = is_component ).
INSERT LINES OF lt_comp_str INTO TABLE xt_components.
WHEN OTHERS. "cl_abap_typedescr=>kind_ref or cl_abap_typedescr=>kind_class or cl_abap_typedescr=>kind_intf.
* We skip it. for now.
ENDCASE.
ENDMETHOD.
METHOD structure_recursive.
DATA: lo_struct TYPE REF TO cl_abap_structdescr,
lt_components TYPE abap_component_tab,
ls_components TYPE abap_componentdescr.
REFRESH rt_components.
lo_struct ?= is_component-type.
lt_components = lo_struct->get_components( ).
LOOP AT lt_components INTO ls_components.
structure_case( EXPORTING is_component = ls_components
CHANGING xt_components = rt_components ) .
ENDLOOP.
ENDMETHOD.
METHOD time_to_excel_string.
DATA: lv_seconds_in_day TYPE i,
lv_day_fraction TYPE f,
lc_time_baseline TYPE t VALUE '000000',
lc_seconds_in_day TYPE i VALUE 86400.
lv_seconds_in_day = ip_value - lc_time_baseline.
lv_day_fraction = lv_seconds_in_day / lc_seconds_in_day.
ep_value = zcl_excel_common=>number_to_excel_string( ip_value = lv_day_fraction ).
ENDMETHOD.
METHOD unescape_string.
CONSTANTS lcv_regex TYPE string VALUE `^'[^']` & `|` & " Beginning single ' OR
`[^']'$` & `|` & " Trailing single ' OR
`[^']'[^']`. " Single ' somewhere in between
DATA: lv_errormessage TYPE string. " Can't pass '...'(abc) to exception-class
*--------------------------------------------------------------------*
* This method is used to extract the "real" string from an escaped string.
* An escaped string can be identified by a beginning ' which must be
* accompanied by a trailing '
* All '' in between beginning and trailing ' are treated as single '
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
* When allowing clike-input parameters we might encounter trailing
* "real" blanks . These are automatically eliminated when moving
* the input parameter to a string.
*--------------------------------------------------------------------*
ev_unescaped_string = iv_escaped. " Pass through if not escaped
CHECK ev_unescaped_string IS NOT INITIAL. " Nothing to do if empty
CHECK ev_unescaped_string(1) = `'`. " Nothing to do if not escaped
*--------------------------------------------------------------------*
* Remove leading and trailing '
*--------------------------------------------------------------------*
REPLACE REGEX `^'(.*)'$` IN ev_unescaped_string WITH '$1'.
IF sy-subrc <> 0.
lv_errormessage = 'Input not properly escaped - &'(002).
zcx_excel=>raise_text( lv_errormessage ).
ENDIF.
*--------------------------------------------------------------------*
* Any remaining single ' should not be here
*--------------------------------------------------------------------*
FIND REGEX lcv_regex IN ev_unescaped_string.
IF sy-subrc = 0.
lv_errormessage = 'Input not properly escaped - &'(002).
zcx_excel=>raise_text( lv_errormessage ).
ENDIF.
*--------------------------------------------------------------------*
* Replace '' with '
*--------------------------------------------------------------------*
REPLACE ALL OCCURRENCES OF `''` IN ev_unescaped_string WITH `'`.
ENDMETHOD.
ENDCLASS.
| 38.700128 | 142 | 0.533564 |
f7b086b37979d1df2b440b23d651e6cf24274939 | 7,579 | abap | ABAP | src/core/zcl_abak.clas.testclasses.abap | Sdfraga/abaK | 04ec4a436429ec7f8145bbfad93adc41733929b1 | [
"MIT"
] | null | null | null | src/core/zcl_abak.clas.testclasses.abap | Sdfraga/abaK | 04ec4a436429ec7f8145bbfad93adc41733929b1 | [
"MIT"
] | null | null | null | src/core/zcl_abak.clas.testclasses.abap | Sdfraga/abaK | 04ec4a436429ec7f8145bbfad93adc41733929b1 | [
"MIT"
] | null | null | null | *"* use this source file for your ABAP unit test classes
CLASS lcl_unittest DEFINITION DEFERRED.
CLASS zcl_abak DEFINITION LOCAL FRIENDS lcl_unittest.
CLASS lcl_unittest DEFINITION FOR TESTING
INHERITING FROM zcl_abak_unit_tests
DURATION SHORT
RISK LEVEL HARMLESS
FINAL.
PRIVATE SECTION.
DATA:
f_cut TYPE REF TO zcl_abak,
f_iut TYPE REF TO zif_abak.
METHODS: setup RAISING zcx_abak.
METHODS: get_value_ok FOR TESTING RAISING zcx_abak.
METHODS: get_value_numeric_context FOR TESTING RAISING zcx_abak.
METHODS: get_value_nok FOR TESTING.
METHODS: get_value_if_exists FOR TESTING.
METHODS: get_value_default_scope FOR TESTING RAISING zcx_abak.
METHODS: check_value_ok FOR TESTING RAISING zcx_abak.
METHODS: check_value_range_ok FOR TESTING RAISING zcx_abak.
METHODS: check_value_range_nok FOR TESTING RAISING zcx_abak.
METHODS: check_value_nok FOR TESTING.
METHODS: check_value_if_exists FOR TESTING.
METHODS: get_range_ok FOR TESTING RAISING zcx_abak.
METHODS: get_range_nok FOR TESTING.
METHODS: get_range_if_exists FOR TESTING.
METHODS: null_data FOR TESTING.
ENDCLASS. "lcl_Unit_Test
CLASS lcl_unittest IMPLEMENTATION.
METHOD setup.
DATA: o_data_factory TYPE REF TO zcl_abak_data_factory.
generate_test_data( ).
CREATE OBJECT o_data_factory.
CREATE OBJECT f_cut
EXPORTING
io_data = o_data_factory->get_standard_instance( i_format_type = zif_abak_consts=>format_type-internal
i_source_type = zif_abak_consts=>source_type-database
i_content = gc_tablename-valid ).
f_iut = f_cut.
ENDMETHOD. "setup
METHOD get_value_ok.
cl_abap_unit_assert=>assert_equals(
exp = '0231'
act = f_iut->get_value( i_scope = gc_scope-utest
i_fieldname = 'BUKRS' )
msg = 'Value should be 0231' ).
ENDMETHOD. "get_Value
METHOD get_value_numeric_context.
cl_abap_unit_assert=>assert_equals(
exp = '1234567890'
act = f_iut->get_value( i_scope = gc_scope-utest
i_context = gc_context-c1
i_fieldname = 'KUNNR' )
msg = 'Value should be 1234567890' ).
ENDMETHOD. "get_Value
METHOD get_value_nok.
TRY.
f_iut->get_value( i_scope = gc_scope-utest
i_context = gc_context-does_not_exist
i_fieldname = 'BUKRS' ).
cl_abap_unit_assert=>fail( msg = 'Value does not exist and is not ignorable' ).
CATCH zcx_abak.
RETURN.
ENDTRY.
ENDMETHOD. "get_Value
METHOD get_value_if_exists.
cl_abap_unit_assert=>assert_equals(
exp = '0231'
act = f_iut->get_value_if_exists( i_scope = gc_scope-utest
i_fieldname = 'BUKRS' )
msg = 'Value exists and should be 0231' ).
cl_abap_unit_assert=>assert_equals(
exp = space
act = f_iut->get_value_if_exists( i_scope = gc_scope-utest
i_context = gc_context-does_not_exist
i_fieldname = 'BUKRS' )
msg = 'Not found value should return empty' ).
ENDMETHOD. "get_Value
METHOD get_value_default_scope.
cl_abap_unit_assert=>assert_equals(
exp = '0231'
act = f_iut->get_value( i_fieldname = 'BUKRS' ) ).
ENDMETHOD. "get_Value
METHOD check_value_ok.
cl_abap_unit_assert=>assert_equals(
exp = abap_true
act = f_iut->check_value( i_scope = gc_scope-utest
i_fieldname = 'BUKRS'
i_value = '0231' )
msg = 'Value is 0231 so result should be true' ).
ENDMETHOD. "get_Value
METHOD check_value_range_ok.
cl_abap_unit_assert=>assert_equals(
exp = abap_true
act = f_iut->check_value( i_scope = gc_scope-utest
i_fieldname = 'WAERS'
i_value = 'EUR' ) ).
ENDMETHOD. "get_Value
METHOD check_value_range_nok.
cl_abap_unit_assert=>assert_equals(
exp = abap_false
act = f_iut->check_value( i_scope = gc_scope-utest
i_fieldname = 'WAERS'
i_value = 'CAD' ) ).
ENDMETHOD. "get_Value
METHOD check_value_nok.
TRY.
f_iut->check_value( i_scope = gc_scope-utest
i_context = gc_context-does_not_exist
i_fieldname = 'BUKRS'
i_value = '0231' ).
cl_abap_unit_assert=>fail( msg = 'Value does not exist and is not ignorable' ).
CATCH zcx_abak.
RETURN.
ENDTRY.
ENDMETHOD. "get_Value
METHOD check_value_if_exists.
cl_abap_unit_assert=>assert_equals(
exp = abap_true
act = f_iut->check_value_if_exists( i_scope = gc_scope-utest
i_fieldname = 'BUKRS'
i_value = '0231' )
msg = 'Value exists and should be 0231' ).
cl_abap_unit_assert=>assert_equals(
exp = abap_false
act = f_iut->check_value_if_exists( i_scope = gc_scope-utest
i_context = gc_context-does_not_exist
i_fieldname = 'BUKRS'
i_value = '0231' )
msg = 'No value defined so it should be false' ).
ENDMETHOD. "get_Value
METHOD get_range_ok.
DATA: r_koart TYPE RANGE OF koart.
r_koart = f_iut->get_range( i_scope = gc_scope-utest
i_fieldname = 'KOART' ).
IF NOT ( 'D' IN r_koart AND 'K' IN r_koart ).
cl_abap_unit_assert=>fail( msg = 'Range should have D and K' ).
ENDIF.
ENDMETHOD. "get_Value
METHOD get_range_nok.
TRY.
f_iut->get_range( i_scope = gc_scope-utest
i_context = gc_context-does_not_exist
i_fieldname = 'KOART' ).
cl_abap_unit_assert=>fail( msg = 'Range does not exist and is not ignorable' ).
CATCH zcx_abak.
RETURN.
ENDTRY.
ENDMETHOD.
METHOD get_range_if_exists.
IF 'D' NOT IN f_iut->get_range_if_exists( i_scope = gc_scope-utest
i_context = gc_context-does_not_exist
i_fieldname = 'KOART' ).
cl_abap_unit_assert=>fail( msg = 'Defined range should include D' ).
ENDIF.
IF 'D' NOT IN f_iut->get_range_if_exists( i_scope = gc_scope-utest
i_fieldname = 'KOART' ).
cl_abap_unit_assert=>fail( msg = 'Undefined range should be empty and ok because it is ignorable' ).
ENDIF.
ENDMETHOD. "get_Value
METHOD null_data.
DATA: o_data TYPE REF TO zif_abak_data.
TRY.
CREATE OBJECT f_cut
EXPORTING
io_data = o_data.
cl_abap_unit_assert=>fail( msg = 'Null O_DATA should have been detected').
CATCH zcx_abak.
RETURN.
ENDTRY.
ENDMETHOD.
ENDCLASS. "lcl_Unit_Test
| 31.844538 | 110 | 0.570524 |
f7b1ab86451c9057ae0de176c0a66e6909489872 | 235 | abap | ABAP | exercises/practice/hello-world/.meta/zcl_hello_world.clas.abap | FaisalAfroz/abap | 39bf5deb61280d216bf5a4e3555bb37c434d1453 | [
"MIT"
] | null | null | null | exercises/practice/hello-world/.meta/zcl_hello_world.clas.abap | FaisalAfroz/abap | 39bf5deb61280d216bf5a4e3555bb37c434d1453 | [
"MIT"
] | null | null | null | exercises/practice/hello-world/.meta/zcl_hello_world.clas.abap | FaisalAfroz/abap | 39bf5deb61280d216bf5a4e3555bb37c434d1453 | [
"MIT"
] | null | null | null | CLASS zcl_hello_world DEFINITION PUBLIC.
PUBLIC SECTION.
INTERFACES if_oo_adt_classrun.
ENDCLASS.
CLASS zcl_hello_world IMPLEMENTATION.
METHOD if_oo_adt_classrun~main.
out->write( 'Hello, World' ).
ENDMETHOD.
ENDCLASS. | 19.583333 | 40 | 0.774468 |
f7b1e00980b632c8fde503ff038e3f5aa092459b | 4,648 | abap | ABAP | src/checks/zcl_aoc_check_48.clas.abap | oliver-huetkoeper/abapOpenChecks | e639f3a331046426d550f87618547d652722a63b | [
"MIT"
] | null | null | null | src/checks/zcl_aoc_check_48.clas.abap | oliver-huetkoeper/abapOpenChecks | e639f3a331046426d550f87618547d652722a63b | [
"MIT"
] | null | null | null | src/checks/zcl_aoc_check_48.clas.abap | oliver-huetkoeper/abapOpenChecks | e639f3a331046426d550f87618547d652722a63b | [
"MIT"
] | null | null | null | CLASS zcl_aoc_check_48 DEFINITION
PUBLIC
INHERITING FROM zcl_aoc_super
CREATE PUBLIC.
PUBLIC SECTION.
METHODS constructor.
METHODS check
REDEFINITION.
METHODS get_message_text
REDEFINITION.
PROTECTED SECTION.
METHODS check_table_body_access
IMPORTING
!io_scan TYPE REF TO zcl_aoc_scan .
METHODS check_table_key
IMPORTING
!io_scan TYPE REF TO zcl_aoc_scan .
METHODS support_empty_key
RETURNING
VALUE(rv_supported) TYPE abap_bool .
PRIVATE SECTION.
CLASS-DATA gv_checked TYPE abap_bool .
CLASS-DATA gv_supported TYPE abap_bool .
ENDCLASS.
CLASS ZCL_AOC_CHECK_48 IMPLEMENTATION.
METHOD check.
* abapOpenChecks
* https://github.com/larshp/abapOpenChecks
* MIT License
check_table_key( io_scan ).
check_table_body_access( io_scan ).
ENDMETHOD.
METHOD check_table_body_access.
DATA: lv_level LIKE sy-tabix.
FIELD-SYMBOLS: <ls_token> LIKE LINE OF io_scan->tokens,
<ls_statement> LIKE LINE OF io_scan->statements,
<ls_level> LIKE LINE OF io_scan->levels.
IF object_type <> 'CLAS'.
RETURN.
ENDIF.
LOOP AT io_scan->levels ASSIGNING <ls_level>.
lv_level = sy-tabix.
LOOP AT io_scan->statements ASSIGNING <ls_statement> WHERE level = lv_level.
LOOP AT io_scan->tokens ASSIGNING <ls_token> FROM <ls_statement>-from TO <ls_statement>-to
WHERE type <> io_scan->gc_token-literal
AND type <> io_scan->gc_token-comment.
IF <ls_token>-str CP '*+[]*'.
inform( p_sub_obj_name = io_scan->get_include( lv_level )
p_line = <ls_token>-row
p_kind = mv_errty
p_test = myname
p_code = '002' ).
ENDIF.
ENDLOOP.
ENDLOOP.
ENDLOOP.
ENDMETHOD.
METHOD check_table_key.
DATA: lt_statements TYPE zcl_aoc_scan=>ty_statements,
lv_code TYPE sci_errc.
FIELD-SYMBOLS: <ls_statement> LIKE LINE OF lt_statements.
lt_statements = io_scan->build_statements( ).
LOOP AT lt_statements ASSIGNING <ls_statement>.
CLEAR lv_code.
IF ( <ls_statement>-str CP 'DATA* WITH DEFAULT KEY*'
OR <ls_statement>-str CP 'TYPE* WITH DEFAULT KEY*' )
AND support_empty_key( ) = abap_true
AND <ls_statement>-include(8) <> '/1BCWDY/'.
lv_code = '001'.
ENDIF.
IF NOT lv_code IS INITIAL.
inform( p_sub_obj_name = <ls_statement>-include
p_line = <ls_statement>-start-row
p_kind = mv_errty
p_position = <ls_statement>-index
p_test = myname
p_code = lv_code ).
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD constructor.
DATA: ls_message LIKE LINE OF scimessages.
super->constructor( ).
version = '002'.
position = '048'.
has_attributes = abap_true.
attributes_ok = abap_true.
ls_message-test = myname.
ls_message-code = '001'.
ls_message-kind = c_error.
ls_message-pcom = '"#EC CI_DEFAULT_KEY'.
INSERT ls_message INTO TABLE scimessages.
enable_rfc( ).
ENDMETHOD.
METHOD get_message_text.
CLEAR p_text.
CASE p_code.
WHEN '001'.
p_text = 'DEFAULT KEY, add table key or EMPTY KEY'. "#EC NOTEXT
WHEN '002'.
p_text = 'Access table body is obsolete, no headers'. "#EC NOTEXT
WHEN OTHERS.
super->get_message_text( EXPORTING p_test = p_test
p_code = p_code
IMPORTING p_text = p_text ).
ENDCASE.
ENDMETHOD.
METHOD support_empty_key.
DATA: lt_itab TYPE STANDARD TABLE OF string,
lv_mess TYPE string,
lv_lin TYPE i,
ls_trdir TYPE trdir,
lv_code TYPE string,
lv_wrd TYPE string.
IF gv_checked = abap_true.
rv_supported = gv_supported.
RETURN.
ENDIF.
lv_code = 'REPORT zfoobar.' ##NO_TEXT.
APPEND lv_code TO lt_itab.
lv_code = 'TYPES: ty_table TYPE STANDARD TABLE OF usr02 WITH EMPTY KEY.' ##NO_TEXT.
APPEND lv_code TO lt_itab.
ls_trdir-uccheck = abap_true.
SYNTAX-CHECK FOR lt_itab
MESSAGE lv_mess
LINE lv_lin
WORD lv_wrd
DIRECTORY ENTRY ls_trdir.
IF sy-subrc = 0.
rv_supported = abap_true.
ELSE.
rv_supported = abap_false.
ENDIF.
gv_supported = rv_supported.
gv_checked = abap_true.
ENDMETHOD.
ENDCLASS.
| 23.593909 | 98 | 0.608649 |
f7b3a65d21eb68278689f40b2f3fed93feae708e | 12,618 | abap | ABAP | src/zcl_abapgit_repo_srv.clas.abap | Anjali-Mishra08/abapGit | 6491967d76797d984b81de2b43a61fdf7257b79f | [
"MIT"
] | 1 | 2019-11-29T05:30:57.000Z | 2019-11-29T05:30:57.000Z | src/zcl_abapgit_repo_srv.clas.abap | saurabh-bcone/abapGit | 0b5b1b60df883d5291c060c349810127e52bcac1 | [
"MIT"
] | null | null | null | src/zcl_abapgit_repo_srv.clas.abap | saurabh-bcone/abapGit | 0b5b1b60df883d5291c060c349810127e52bcac1 | [
"MIT"
] | null | null | null | CLASS zcl_abapgit_repo_srv DEFINITION
PUBLIC
FINAL
CREATE PRIVATE .
PUBLIC SECTION.
INTERFACES zif_abapgit_repo_srv .
INTERFACES zif_abapgit_repo_listener .
CLASS-METHODS get_instance
RETURNING
VALUE(ri_srv) TYPE REF TO zif_abapgit_repo_srv .
PROTECTED SECTION.
PRIVATE SECTION.
ALIASES delete
FOR zif_abapgit_repo_srv~delete .
ALIASES get
FOR zif_abapgit_repo_srv~get .
ALIASES list
FOR zif_abapgit_repo_srv~list .
ALIASES validate_package
FOR zif_abapgit_repo_srv~validate_package .
CLASS-DATA gi_ref TYPE REF TO zif_abapgit_repo_srv .
DATA mv_init TYPE abap_bool VALUE abap_false ##NO_TEXT.
DATA mt_list TYPE zif_abapgit_definitions=>ty_repo_ref_tt .
METHODS refresh
RAISING
zcx_abapgit_exception .
METHODS is_sap_object_allowed
RETURNING
VALUE(rv_allowed) TYPE abap_bool .
METHODS instantiate_and_add
IMPORTING
!is_repo_meta TYPE zif_abapgit_persistence=>ty_repo
RETURNING
VALUE(ro_repo) TYPE REF TO zcl_abapgit_repo
RAISING
zcx_abapgit_exception .
METHODS add
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo
RAISING
zcx_abapgit_exception .
METHODS reinstantiate_repo
IMPORTING
!iv_key TYPE zif_abapgit_persistence=>ty_repo-key
!is_meta TYPE zif_abapgit_persistence=>ty_repo_xml
RAISING
zcx_abapgit_exception .
METHODS validate_sub_super_packages
IMPORTING
!iv_package TYPE devclass
!it_repos TYPE zif_abapgit_persistence=>tt_repo
!iv_ign_subpkg TYPE abap_bool DEFAULT abap_false
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS zcl_abapgit_repo_srv IMPLEMENTATION.
METHOD add.
DATA: lo_repo LIKE LINE OF mt_list.
LOOP AT mt_list INTO lo_repo.
IF lo_repo->get_key( ) = io_repo->get_key( ).
IF lo_repo = io_repo.
RETURN.
ENDIF.
zcx_abapgit_exception=>raise( 'identical keys' ).
ENDIF.
ENDLOOP.
io_repo->bind_listener( me ).
APPEND io_repo TO mt_list.
ENDMETHOD.
METHOD get_instance.
IF gi_ref IS INITIAL.
CREATE OBJECT gi_ref TYPE zcl_abapgit_repo_srv.
ENDIF.
ri_srv = gi_ref.
ENDMETHOD.
METHOD instantiate_and_add.
IF is_repo_meta-offline = abap_false.
CREATE OBJECT ro_repo TYPE zcl_abapgit_repo_online
EXPORTING
is_data = is_repo_meta.
ELSE.
CREATE OBJECT ro_repo TYPE zcl_abapgit_repo_offline
EXPORTING
is_data = is_repo_meta.
ENDIF.
add( ro_repo ).
ENDMETHOD.
METHOD is_sap_object_allowed.
rv_allowed = cl_enh_badi_def_utility=>is_sap_system( ).
IF rv_allowed = abap_true.
RETURN.
ENDIF.
rv_allowed = zcl_abapgit_exit=>get_instance( )->allow_sap_objects( ).
ENDMETHOD.
METHOD refresh.
DATA: lt_list TYPE zif_abapgit_persistence=>tt_repo.
FIELD-SYMBOLS: <ls_list> LIKE LINE OF lt_list.
CLEAR mt_list.
lt_list = zcl_abapgit_persist_factory=>get_repo( )->list( ).
LOOP AT lt_list ASSIGNING <ls_list>.
instantiate_and_add( <ls_list> ).
ENDLOOP.
mv_init = abap_true.
ENDMETHOD.
METHOD reinstantiate_repo.
DATA lo_repo TYPE REF TO zcl_abapgit_repo.
DATA ls_full_meta TYPE zif_abapgit_persistence=>ty_repo.
lo_repo = get( iv_key ).
DELETE TABLE mt_list FROM lo_repo.
ASSERT sy-subrc IS INITIAL.
MOVE-CORRESPONDING is_meta TO ls_full_meta.
ls_full_meta-key = iv_key.
instantiate_and_add( ls_full_meta ).
ENDMETHOD.
METHOD validate_sub_super_packages.
DATA:
ls_repo LIKE LINE OF it_repos,
lo_package TYPE REF TO zif_abapgit_sap_package,
lt_packages TYPE zif_abapgit_sap_package=>ty_devclass_tt,
lo_repo TYPE REF TO zcl_abapgit_repo.
LOOP AT it_repos INTO ls_repo.
lo_repo = get( ls_repo-key ).
lo_package = zcl_abapgit_factory=>get_sap_package( ls_repo-package ).
IF lo_package->exists( ) = abap_false.
" Skip dangling repository
CONTINUE.
ENDIF.
CLEAR lt_packages.
IF lo_repo->get_local_settings( )-ignore_subpackages = abap_false.
APPEND LINES OF lo_package->list_subpackages( ) TO lt_packages.
READ TABLE lt_packages TRANSPORTING NO FIELDS
WITH KEY table_line = iv_package.
IF sy-subrc = 0.
zcx_abapgit_exception=>raise( |Repository { lo_repo->get_name( ) } already contains { iv_package } | ).
ENDIF.
ENDIF.
IF iv_ign_subpkg = abap_false.
APPEND LINES OF lo_package->list_superpackages( ) TO lt_packages.
READ TABLE lt_packages TRANSPORTING NO FIELDS
WITH KEY table_line = iv_package.
IF sy-subrc = 0.
zcx_abapgit_exception=>raise( |Repository { lo_repo->get_name( ) } |
&& |already contains subpackage of { iv_package } | ).
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD zif_abapgit_repo_listener~on_meta_change.
DATA li_persistence TYPE REF TO zif_abapgit_persist_repo.
li_persistence = zcl_abapgit_persist_factory=>get_repo( ).
li_persistence->update_metadata(
iv_key = iv_key
is_meta = is_meta
is_change_mask = is_change_mask ).
" Recreate repo instance if type changed
" Instances in mt_list are of *_online and *_offline type
" If type is changed object should be recreated from the proper class
" TODO refactor, e.g. unify repo logic in one class
IF is_change_mask-offline = abap_true.
reinstantiate_repo(
iv_key = iv_key
is_meta = is_meta ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_repo_srv~delete.
zcl_abapgit_persist_factory=>get_repo( )->delete( io_repo->get_key( ) ).
DELETE TABLE mt_list FROM io_repo.
ASSERT sy-subrc = 0.
ENDMETHOD.
METHOD zif_abapgit_repo_srv~get.
FIELD-SYMBOLS: <lo_list> LIKE LINE OF mt_list.
IF mv_init = abap_false.
refresh( ).
ENDIF.
LOOP AT mt_list ASSIGNING <lo_list>.
IF <lo_list>->get_key( ) = iv_key.
ro_repo = <lo_list>.
RETURN.
ENDIF.
ENDLOOP.
zcx_abapgit_exception=>raise( 'repo not found, get' ).
ENDMETHOD.
METHOD zif_abapgit_repo_srv~is_repo_installed.
DATA: lt_repo TYPE zif_abapgit_definitions=>ty_repo_ref_tt,
lo_repo TYPE REF TO zcl_abapgit_repo,
lv_url TYPE string,
lv_package TYPE devclass,
lo_repo_online TYPE REF TO zcl_abapgit_repo_online,
lv_err TYPE string.
lt_repo = list( ).
LOOP AT lt_repo INTO lo_repo.
CHECK lo_repo->is_offline( ) = abap_false.
lo_repo_online ?= lo_repo.
lv_url = lo_repo_online->get_url( ).
lv_package = lo_repo_online->get_package( ).
CHECK to_upper( lv_url ) = to_upper( iv_url ).
" Validate bindings
"TODO refactor: move this message out of this method
IF iv_target_package IS NOT INITIAL AND iv_target_package <> lv_package.
lv_err = |Installation to package { lv_package } detected. |
&& |Cancelling installation|.
zcx_abapgit_exception=>raise( lv_err ).
ENDIF.
rv_installed = abap_true.
EXIT.
ENDLOOP.
ENDMETHOD.
METHOD zif_abapgit_repo_srv~list.
IF mv_init = abap_false.
refresh( ).
ENDIF.
rt_list = mt_list.
ENDMETHOD.
METHOD zif_abapgit_repo_srv~new_offline.
DATA: ls_repo TYPE zif_abapgit_persistence=>ty_repo,
lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
lo_dot_abapgit TYPE REF TO zcl_abapgit_dot_abapgit.
IF zcl_abapgit_auth=>is_allowed( zif_abapgit_auth=>gc_authorization-create_repo ) = abap_false.
zcx_abapgit_exception=>raise( 'Not authorized' ).
ENDIF.
validate_package( iv_package ).
lo_dot_abapgit = zcl_abapgit_dot_abapgit=>build_default( ).
lo_dot_abapgit->set_folder_logic( iv_folder_logic ).
lv_key = zcl_abapgit_persist_factory=>get_repo( )->add(
iv_url = iv_url
iv_branch_name = ''
iv_package = iv_package
iv_offline = abap_true
is_dot_abapgit = lo_dot_abapgit->get_data( ) ).
TRY.
ls_repo = zcl_abapgit_persist_factory=>get_repo( )->read( lv_key ).
CATCH zcx_abapgit_not_found.
zcx_abapgit_exception=>raise( 'new_offline not found' ).
ENDTRY.
ro_repo ?= instantiate_and_add( ls_repo ).
ENDMETHOD.
METHOD zif_abapgit_repo_srv~new_online.
DATA: ls_repo TYPE zif_abapgit_persistence=>ty_repo,
lv_key TYPE zif_abapgit_persistence=>ty_repo-key,
ls_dot_abapgit TYPE zif_abapgit_dot_abapgit=>ty_dot_abapgit.
ASSERT NOT iv_url IS INITIAL
AND NOT iv_branch_name IS INITIAL
AND NOT iv_package IS INITIAL.
IF zcl_abapgit_auth=>is_allowed( zif_abapgit_auth=>gc_authorization-create_repo ) = abap_false.
zcx_abapgit_exception=>raise( 'Not authorized' ).
ENDIF.
validate_package( iv_package = iv_package
iv_ign_subpkg = iv_ign_subpkg ).
zcl_abapgit_url=>validate( |{ iv_url }| ).
ls_dot_abapgit = zcl_abapgit_dot_abapgit=>build_default( )->get_data( ).
ls_dot_abapgit-folder_logic = iv_folder_logic.
lv_key = zcl_abapgit_persist_factory=>get_repo( )->add(
iv_url = iv_url
iv_branch_name = iv_branch_name
iv_display_name = iv_display_name
iv_package = iv_package
iv_offline = abap_false
is_dot_abapgit = ls_dot_abapgit ).
TRY.
ls_repo = zcl_abapgit_persist_factory=>get_repo( )->read( lv_key ).
CATCH zcx_abapgit_not_found.
zcx_abapgit_exception=>raise( 'new_online not found' ).
ENDTRY.
ro_repo ?= instantiate_and_add( ls_repo ).
IF ls_repo-local_settings-ignore_subpackages <> iv_ign_subpkg.
ls_repo-local_settings-ignore_subpackages = iv_ign_subpkg.
ro_repo->set_local_settings( ls_repo-local_settings ).
ENDIF.
ro_repo->refresh( ).
ro_repo->find_remote_dot_abapgit( ).
ENDMETHOD.
METHOD zif_abapgit_repo_srv~purge.
* todo, this should be a method on the repo instead
DATA: lt_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt.
IF io_repo->get_local_settings( )-write_protected = abap_true.
zcx_abapgit_exception=>raise( 'Cannot purge. Local code is write-protected by repo config' ).
ELSEIF zcl_abapgit_auth=>is_allowed( zif_abapgit_auth=>gc_authorization-uninstall ) = abap_false.
zcx_abapgit_exception=>raise( 'Not authorized' ).
ENDIF.
lt_tadir = zcl_abapgit_factory=>get_tadir( )->read( io_repo->get_package( ) ).
zcl_abapgit_objects=>delete( it_tadir = lt_tadir
is_checks = is_checks ).
delete( io_repo ).
ENDMETHOD.
METHOD zif_abapgit_repo_srv~validate_package.
DATA: lv_as4user TYPE tdevc-as4user,
lt_repos TYPE zif_abapgit_persistence=>tt_repo,
lv_name TYPE zif_abapgit_persistence=>ty_local_settings-display_name,
lv_owner TYPE zif_abapgit_persistence=>ty_local_settings-display_name.
FIELD-SYMBOLS:
<ls_repo> LIKE LINE OF lt_repos.
IF iv_package IS INITIAL.
zcx_abapgit_exception=>raise( 'add, package empty' ).
ENDIF.
IF iv_package = '$TMP'.
zcx_abapgit_exception=>raise( 'not possible to use $TMP, create new (local) package' ).
ENDIF.
SELECT SINGLE as4user FROM tdevc
INTO lv_as4user
WHERE devclass = iv_package. "#EC CI_GENBUFF
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |Package { iv_package } not found| ).
ENDIF.
IF is_sap_object_allowed( ) = abap_false AND lv_as4user = 'SAP'.
zcx_abapgit_exception=>raise( |Package { iv_package } not allowed, responsible user = 'SAP'| ).
ENDIF.
" make sure its not already in use for a different repository
lt_repos = zcl_abapgit_persist_factory=>get_repo( )->list( ).
READ TABLE lt_repos WITH KEY package = iv_package ASSIGNING <ls_repo>.
IF sy-subrc = 0.
lv_name = zcl_abapgit_repo_srv=>get_instance( )->get( <ls_repo>-key )->get_name( ).
lv_owner = <ls_repo>-created_by.
zcx_abapgit_exception=>raise( |Package { iv_package } already versioned as { lv_name } by { lv_owner }| ).
ENDIF.
validate_sub_super_packages(
iv_package = iv_package
it_repos = lt_repos
iv_ign_subpkg = iv_ign_subpkg ).
ENDMETHOD.
ENDCLASS.
| 27.854305 | 113 | 0.678 |
f7b90d7a912a98b4576ef2841db6c6af1706d673 | 1,193 | abap | ABAP | src/zcl_excel_theme_extlst.clas.abap | bizhuka/abap2xlsx | d69d4d6fdfb4090c50991b56b16809cf1c092001 | [
"Apache-2.0"
] | 1 | 2022-01-20T23:59:28.000Z | 2022-01-20T23:59:28.000Z | src/zcl_excel_theme_extlst.clas.abap | gregorwolf/abap2xlsx | 5110f924b435e23f4474381d0e43f0686b9d0421 | [
"Apache-2.0"
] | null | null | null | src/zcl_excel_theme_extlst.clas.abap | gregorwolf/abap2xlsx | 5110f924b435e23f4474381d0e43f0686b9d0421 | [
"Apache-2.0"
] | 1 | 2021-07-09T02:06:21.000Z | 2021-07-09T02:06:21.000Z | class ZCL_EXCEL_THEME_EXTLST definition
public
final
create public .
public section.
methods LOAD
importing
!IO_EXTLST type ref to IF_IXML_ELEMENT .
methods BUILD_XML
importing
!IO_DOCUMENT type ref to IF_IXML_DOCUMENT .
protected section.
private section.
data EXTLST type ref to IF_IXML_ELEMENT .
ENDCLASS.
CLASS ZCL_EXCEL_THEME_EXTLST IMPLEMENTATION.
method build_xml.
data: lo_theme type ref to if_ixml_element.
data: lo_theme_objdef type ref to if_ixml_element.
check io_document is bound.
lo_theme ?= io_document->get_root_element( ).
check lo_theme is bound.
if extlst is initial.
lo_theme_objdef ?= io_document->create_simple_element_ns( prefix = zcl_excel_theme=>c_theme_prefix
name = zcl_excel_theme=>c_theme_extlst
parent = lo_theme ).
else.
lo_theme->append_child( new_child = extlst ).
endif.
endmethod. "build_xml
method load.
"! so far copy only existing values
extlst ?= io_extlst.
endmethod. "load
ENDCLASS.
| 24.854167 | 104 | 0.633697 |
f7ba2bc12641d8e7c981c908cc7d70db805e21b0 | 5,551 | abap | ABAP | src/objects/ycl_abapgit_object_enqu.clas.abap | abapGit/y-version | 2c3a7e7d0f5abb860e34f8eb44e0c2170a0ccdfc | [
"MIT"
] | null | null | null | src/objects/ycl_abapgit_object_enqu.clas.abap | abapGit/y-version | 2c3a7e7d0f5abb860e34f8eb44e0c2170a0ccdfc | [
"MIT"
] | null | null | null | src/objects/ycl_abapgit_object_enqu.clas.abap | abapGit/y-version | 2c3a7e7d0f5abb860e34f8eb44e0c2170a0ccdfc | [
"MIT"
] | 2 | 2019-11-24T20:35:16.000Z | 2020-04-16T07:29:33.000Z | CLASS ycl_abapgit_object_enqu DEFINITION PUBLIC INHERITING FROM ycl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES yif_abapgit_object.
ALIASES mo_files FOR yif_abapgit_object~mo_files.
PRIVATE SECTION.
TYPES: tyt_dd27p TYPE STANDARD TABLE OF dd27p WITH DEFAULT KEY.
METHODS _clear_dd27p_fields CHANGING ct_dd27p TYPE tyt_dd27p.
ENDCLASS.
CLASS YCL_ABAPGIT_OBJECT_ENQU IMPLEMENTATION.
METHOD yif_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 yif_abapgit_object~compare_to_remote_version.
CREATE OBJECT ro_comparison_result TYPE ycl_abapgit_comparison_null.
ENDMETHOD.
METHOD yif_abapgit_object~delete.
DATA: lv_objname TYPE rsedd0-ddobjname.
lv_objname = ms_item-obj_name.
CALL FUNCTION 'RS_DD_DELETE_OBJ'
EXPORTING
no_ask = abap_true
objname = lv_objname
objtype = 'L'
EXCEPTIONS
not_executed = 1
object_not_found = 2
object_not_specified = 3
permission_failure = 4.
IF sy-subrc <> 0.
ycx_abapgit_exception=>raise( 'error from RS_DD_DELETE_OBJ, ENQU' ).
ENDIF.
ENDMETHOD.
METHOD yif_abapgit_object~deserialize.
DATA: lv_name TYPE ddobjname,
ls_dd25v TYPE dd25v,
lt_dd26e TYPE TABLE OF dd26e,
lt_dd27p TYPE tyt_dd27p.
io_xml->read( EXPORTING iv_name = 'DD25V'
CHANGING cg_data = ls_dd25v ).
io_xml->read( EXPORTING iv_name = 'DD26E_TABLE'
CHANGING cg_data = lt_dd26e ).
io_xml->read( EXPORTING iv_name = 'DD27P_TABLE'
CHANGING cg_data = lt_dd27p ).
corr_insert( iv_package ).
lv_name = ms_item-obj_name.
CALL FUNCTION 'DDIF_ENQU_PUT'
EXPORTING
name = lv_name
dd25v_wa = ls_dd25v
TABLES
dd26e_tab = lt_dd26e
dd27p_tab = lt_dd27p
EXCEPTIONS
enqu_not_found = 1
name_inconsistent = 2
enqu_inconsistent = 3
put_failure = 4
put_refused = 5
OTHERS = 6.
IF sy-subrc <> 0.
ycx_abapgit_exception=>raise( 'error from DDIF_ENQU_PUT' ).
ENDIF.
ycl_abapgit_objects_activation=>add_item( ms_item ).
ENDMETHOD.
METHOD yif_abapgit_object~exists.
DATA: lv_viewname TYPE dd25l-viewname.
SELECT SINGLE viewname FROM dd25l INTO lv_viewname
WHERE viewname = ms_item-obj_name
AND as4local = 'A'
AND as4vers = '0000'.
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD yif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-ddic = abap_true.
ENDMETHOD.
METHOD yif_abapgit_object~has_changed_since.
DATA: lv_date TYPE dats,
lv_time TYPE tims.
SELECT SINGLE as4date as4time FROM dd25l
INTO (lv_date, lv_time)
WHERE viewname = ms_item-obj_name
AND as4local = 'A'
AND as4vers = '0000'.
rv_changed = check_timestamp(
iv_timestamp = iv_timestamp
iv_date = lv_date
iv_time = lv_time ).
ENDMETHOD.
METHOD yif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
METHOD yif_abapgit_object~jump.
jump_se11( iv_radio = 'RSRD1-ENQU'
iv_field = 'RSRD1-ENQU_VAL' ).
ENDMETHOD.
METHOD yif_abapgit_object~serialize.
DATA: lv_name TYPE ddobjname,
ls_dd25v TYPE dd25v,
lt_dd26e TYPE TABLE OF dd26e,
lt_dd27p TYPE tyt_dd27p.
lv_name = ms_item-obj_name.
CALL FUNCTION 'DDIF_ENQU_GET'
EXPORTING
name = lv_name
state = 'A'
langu = mv_language
IMPORTING
dd25v_wa = ls_dd25v
TABLES
dd26e_tab = lt_dd26e
dd27p_tab = lt_dd27p
EXCEPTIONS
illegal_input = 1
OTHERS = 2.
IF sy-subrc <> 0.
ycx_abapgit_exception=>raise( 'error from DDIF_ENQU_GET' ).
ENDIF.
IF ls_dd25v IS INITIAL.
RETURN. " does not exist in system
ENDIF.
CLEAR: ls_dd25v-as4user,
ls_dd25v-as4date,
ls_dd25v-as4time.
_clear_dd27p_fields( CHANGING ct_dd27p = lt_dd27p ).
io_xml->add( iv_name = 'DD25V'
ig_data = ls_dd25v ).
io_xml->add( ig_data = lt_dd26e
iv_name = 'DD26E_TABLE' ).
io_xml->add( ig_data = lt_dd27p
iv_name = 'DD27P_TABLE' ).
ENDMETHOD.
METHOD _clear_dd27p_fields.
FIELD-SYMBOLS <ls_dd27p> TYPE dd27p.
LOOP AT ct_dd27p ASSIGNING <ls_dd27p>.
"taken from table
CLEAR <ls_dd27p>-headlen.
CLEAR <ls_dd27p>-scrlen1.
CLEAR <ls_dd27p>-scrlen2.
CLEAR <ls_dd27p>-scrlen3.
CLEAR <ls_dd27p>-intlen.
CLEAR <ls_dd27p>-outputlen.
CLEAR <ls_dd27p>-flength.
CLEAR <ls_dd27p>-ddtext.
CLEAR <ls_dd27p>-reptext.
CLEAR <ls_dd27p>-scrtext_s.
CLEAR <ls_dd27p>-scrtext_m.
CLEAR <ls_dd27p>-scrtext_l.
CLEAR <ls_dd27p>-rollname.
CLEAR <ls_dd27p>-rollnamevi.
CLEAR <ls_dd27p>-entitytab.
CLEAR <ls_dd27p>-datatype.
CLEAR <ls_dd27p>-inttype.
CLEAR <ls_dd27p>-ddlanguage.
CLEAR <ls_dd27p>-domname.
CLEAR <ls_dd27p>-signflag.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| 24.030303 | 96 | 0.627815 |
f7bbad83421c8b083b37d12ff28583b0f3e0dd01 | 2,233 | abap | ABAP | src/zcl_translate_lxe_single_mess.clas.abap | irodrigob/translate_tool | 7d691051d9f11a31c0865fdc489b8e168ba35781 | [
"MIT"
] | 1 | 2020-05-18T23:39:55.000Z | 2020-05-18T23:39:55.000Z | src/zcl_translate_lxe_single_mess.clas.abap | irodrigob/translate_tool | 7d691051d9f11a31c0865fdc489b8e168ba35781 | [
"MIT"
] | null | null | null | src/zcl_translate_lxe_single_mess.clas.abap | irodrigob/translate_tool | 7d691051d9f11a31c0865fdc489b8e168ba35781 | [
"MIT"
] | null | null | null | CLASS zcl_translate_lxe_single_mess DEFINITION
PUBLIC
INHERITING FROM zcl_translate_lxe
FINAL
CREATE PUBLIC .
*"* public components of class ZCL_TRANSLATE_LXE_SINGLE_MESS
*"* do not include other source files here!!!
PUBLIC SECTION.
METHODS get_lxe_type
REDEFINITION .
METHODS has_proposed_text
REDEFINITION .
METHODS set_check_params
REDEFINITION .
PROTECTED SECTION.
*"* protected components of class ZCL_TRANSLATE_LXE_SINGLE_MESS
*"* do not include other source files here!!!
TYPES:
BEGIN OF ty_message_key,
message_id TYPE symsgid,
message_nr TYPE t100-msgnr,
END OF ty_message_key .
METHODS get_object_text
REDEFINITION .
PRIVATE SECTION.
*"* private components of class ZZC_CA02707
*"* do not include other source files here!!!
ENDCLASS.
CLASS zcl_translate_lxe_single_mess IMPLEMENTATION.
METHOD get_lxe_type.
APPEND 'MESS' TO rt_objects.
ENDMETHOD.
METHOD get_object_text.
rv_obj_text = 'MESS'.
ENDMETHOD.
METHOD has_proposed_text.
rv_has = abap_true.
ENDMETHOD.
METHOD set_check_params.
DATA ld_leng TYPE i.
DATA ld_obj_name TYPE sobj_name.
DATA ls_message_key TYPE ty_message_key.
* El nombre del mensaje requiere de un ajuste para poderlo traducir.
* En el nombre que se pasa los tres ultimos digitos es el numero de mensaje. Tengo que separarlos en dos
* para pasarlo a la estructura.
* Calculo la longitud total quitandole el espacio del numero de mensaje
ld_leng = strlen( iv_obj_name ) - 3.
* Hago un offset para recuperar los valores.
ls_message_key-message_id = iv_obj_name(ld_leng).
ls_message_key-message_nr = iv_obj_name+ld_leng(3).
* Finalmente muevo la estructura a una variable.
ld_obj_name = ls_message_key.
* Llamo al método de la clase padre para que se encargue del resto.
CALL METHOD super->set_check_params
EXPORTING
iv_object = iv_object
iv_obj_name = ld_obj_name
iv_olang = iv_olang
iv_tlang = iv_tlang
EXCEPTIONS
object_not_valid = 1
OTHERS = 2.
IF sy-subrc <> 0.
RAISE object_not_valid.
ENDIF.
ENDMETHOD.
ENDCLASS.
| 25.666667 | 104 | 0.708912 |
f7bcce9d7b760b12384e31979917605ffa43aa87 | 4,112 | abap | ABAP | src/objects/zcl_abapgit_object_prag.clas.abap | DiscoveryConsulting/abapGit | 437052cd6a32ddbd9a808730284c7f9f4ee100e7 | [
"MIT"
] | null | null | null | src/objects/zcl_abapgit_object_prag.clas.abap | DiscoveryConsulting/abapGit | 437052cd6a32ddbd9a808730284c7f9f4ee100e7 | [
"MIT"
] | null | null | null | src/objects/zcl_abapgit_object_prag.clas.abap | DiscoveryConsulting/abapGit | 437052cd6a32ddbd9a808730284c7f9f4ee100e7 | [
"MIT"
] | null | null | null | CLASS zcl_abapgit_object_prag DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
PRIVATE SECTION.
TYPES: BEGIN OF ty_pragma,
pragma TYPE c LENGTH 40,
extension TYPE c LENGTH 1,
signature TYPE c LENGTH 10,
description TYPE c LENGTH 255,
END OF ty_pragma.
METHODS:
_raise_pragma_not_exists
RAISING
zcx_abapgit_exception,
_raise_pragma_exists
RAISING
zcx_abapgit_exception,
_raise_pragma_enqueue
RAISING
zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_OBJECT_PRAG IMPLEMENTATION.
METHOD zif_abapgit_object~changed_by.
rv_user = c_user_unknown.
ENDMETHOD.
METHOD zif_abapgit_object~compare_to_remote_version.
CREATE OBJECT ro_comparison_result TYPE zcl_abapgit_comparison_null.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lo_pragma TYPE REF TO cl_abap_pragma.
TRY.
lo_pragma = cl_abap_pragma=>get_ref( ms_item-obj_name ).
lo_pragma->delete( ).
CATCH cx_abap_pragma_not_exists.
_raise_pragma_not_exists( ).
CATCH cx_abap_pragma_enqueue.
_raise_pragma_enqueue( ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_pragma TYPE ty_pragma,
lo_pragma TYPE REF TO cl_abap_pragma.
TRY.
io_xml->read(
EXPORTING
iv_name = 'PRAG'
CHANGING
cg_data = ls_pragma ).
lo_pragma = cl_abap_pragma=>create( p_pragma = ms_item-obj_name
p_package = iv_package ).
lo_pragma->set_info( p_description = ls_pragma-description
p_signature = ls_pragma-signature
p_extension = ls_pragma-extension ).
lo_pragma->save( ).
CATCH cx_abap_pragma_not_exists.
_raise_pragma_not_exists( ).
CATCH cx_abap_pragma_exists.
_raise_pragma_exists( ).
CATCH cx_abap_pragma_enqueue.
_raise_pragma_enqueue( ).
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
TRY.
cl_abap_pragma=>get_ref( ms_item-obj_name ).
CATCH cx_abap_pragma_not_exists.
rv_bool = abap_false.
RETURN.
ENDTRY.
rv_bool = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~get_metadata.
rs_metadata = get_metadata( ).
rs_metadata-delete_tadir = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~has_changed_since.
rv_changed = abap_true.
ENDMETHOD.
METHOD zif_abapgit_object~jump.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = ms_item-obj_name
object_type = ms_item-obj_type
EXCEPTIONS
not_executed = 1
invalid_object_type = 2
OTHERS = 3.
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: lo_pragma TYPE REF TO cl_abap_pragma,
ls_pragma TYPE zcl_abapgit_object_prag=>ty_pragma.
TRY.
lo_pragma = cl_abap_pragma=>get_ref( ms_item-obj_name ).
ls_pragma-pragma = lo_pragma->pragma.
ls_pragma-extension = lo_pragma->extension.
ls_pragma-signature = lo_pragma->signature.
ls_pragma-description = lo_pragma->description.
io_xml->add( iv_name = 'PRAG'
ig_data = ls_pragma ).
CATCH cx_abap_pragma_not_exists.
_raise_pragma_not_exists( ).
ENDTRY.
ENDMETHOD.
METHOD _raise_pragma_enqueue.
zcx_abapgit_exception=>raise( |Pragma { ms_item-obj_name } enqueue error| ).
ENDMETHOD.
METHOD _raise_pragma_exists.
zcx_abapgit_exception=>raise( |Pragma { ms_item-obj_name } exists| ).
ENDMETHOD.
METHOD _raise_pragma_not_exists.
zcx_abapgit_exception=>raise( |Pragma { ms_item-obj_name } doesn't exist| ).
ENDMETHOD.
METHOD zif_abapgit_object~is_locked.
rv_is_locked = abap_false.
ENDMETHOD.
ENDCLASS.
| 21.305699 | 96 | 0.651021 |
f7c1ecd04b31e1043a077892b7f6cfab3d2d4534 | 1,253 | abap | ABAP | src/ui/zif_abapgit_html_viewer.intf.abap | Heisenberg027/abapGit | cac7cd42fb6aeecc5320a6fde2b646e37893fe6e | [
"MIT"
] | null | null | null | src/ui/zif_abapgit_html_viewer.intf.abap | Heisenberg027/abapGit | cac7cd42fb6aeecc5320a6fde2b646e37893fe6e | [
"MIT"
] | null | null | null | src/ui/zif_abapgit_html_viewer.intf.abap | Heisenberg027/abapGit | cac7cd42fb6aeecc5320a6fde2b646e37893fe6e | [
"MIT"
] | null | null | null | INTERFACE zif_abapgit_html_viewer
PUBLIC .
CONSTANTS m_id_sapevent TYPE i VALUE 1 ##NO_TEXT.
EVENTS sapevent
EXPORTING
VALUE(action) TYPE c OPTIONAL
VALUE(frame) TYPE c OPTIONAL
VALUE(getdata) TYPE c OPTIONAL
VALUE(postdata) TYPE cnht_post_data_tab OPTIONAL
VALUE(query_table) TYPE cnht_query_table OPTIONAL .
METHODS load_data
IMPORTING
!iv_url TYPE c OPTIONAL
!iv_type TYPE c DEFAULT 'text'
!iv_subtype TYPE c DEFAULT 'html'
!iv_size TYPE i DEFAULT 0
EXPORTING
!ev_assigned_url TYPE c
CHANGING
!ct_data_table TYPE STANDARD TABLE
EXCEPTIONS
dp_invalid_parameter
dp_error_general
cntl_error
html_syntax_notcorrect .
METHODS set_registered_events
IMPORTING
!it_events TYPE cntl_simple_events
EXCEPTIONS
cntl_error
cntl_system_error
illegal_event_combination .
METHODS show_url
IMPORTING
!iv_url TYPE c
EXCEPTIONS
cntl_error
cnht_error_not_allowed
cnht_error_parameter
dp_error_general .
METHODS free .
METHODS close_document .
METHODS get_url
RETURNING
VALUE(rv_url) TYPE w3url.
METHODS back .
ENDINTERFACE.
| 24.096154 | 57 | 0.685555 |
f7c25d0f16b5837e34832423d36723a5d56cd38c | 429 | abap | ABAP | src/zcl_app_html_list_item.clas.abap | dreitagebart/abap-app-framework | 376cf5156cb947c2fac947fc8779d2da0e1199c4 | [
"MIT"
] | null | null | null | src/zcl_app_html_list_item.clas.abap | dreitagebart/abap-app-framework | 376cf5156cb947c2fac947fc8779d2da0e1199c4 | [
"MIT"
] | null | null | null | src/zcl_app_html_list_item.clas.abap | dreitagebart/abap-app-framework | 376cf5156cb947c2fac947fc8779d2da0e1199c4 | [
"MIT"
] | null | null | null | CLASS zcl_app_html_list_item DEFINITION
PUBLIC
INHERITING FROM zca_app_html
FINAL
CREATE PRIVATE.
PUBLIC SECTION.
PROTECTED SECTION.
METHODS:
parse REDEFINITION.
PRIVATE SECTION.
METHODS:
constructor.
ENDCLASS.
CLASS zcl_app_html_list_item IMPLEMENTATION.
METHOD parse.
ENDMETHOD.
METHOD constructor.
super->constructor( zif_app_html=>tags-list_item ).
ENDMETHOD.
ENDCLASS.
| 14.3 | 55 | 0.736597 |
f7c3edc607b7357f8a87b7e96cf3b0c4981fa51d | 3,950 | abap | ABAP | src/demo/z_xtt_demo_n120.prog.abap | bizhuka/x | 39fe24c6f62746215dc6e1e1f9ef6df8f0c25862 | [
"Apache-2.0"
] | 25 | 2019-03-08T08:03:41.000Z | 2021-11-28T20:19:12.000Z | src/demo/z_xtt_demo_n120.prog.abap | bizhuka/x | 39fe24c6f62746215dc6e1e1f9ef6df8f0c25862 | [
"Apache-2.0"
] | 10 | 2018-02-09T09:54:19.000Z | 2021-05-19T07:02:21.000Z | src/demo/z_xtt_demo_n120.prog.abap | bizhuka/x | 39fe24c6f62746215dc6e1e1f9ef6df8f0c25862 | [
"Apache-2.0"
] | 10 | 2019-03-08T08:03:42.000Z | 2021-04-03T12:54:54.000Z | *&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
CLASS lcl_demo_120_attr DEFINITION FINAL
FRIENDS zcl_xtt_replace_block. " <--- for private fields
PUBLIC SECTION.
METHODS:
constructor
IMPORTING
is_rand_data TYPE ts_rand_data.
" All fields are private!
PRIVATE SECTION.
DATA:
group TYPE string, "#EC NEEDED
caption TYPE string, "#EC NEEDED
date TYPE d, "#EC NEEDED
sum1 TYPE bf_rbetr, "#EC NEEDED
sum2 TYPE bf_rbetr. "#EC NEEDED
ENDCLASS.
**********************************************************************
CLASS lcl_demo_120 DEFINITION FINAL INHERITING FROM lcl_demo.
PUBLIC SECTION.
" INTERFACES if_serializable_object
METHODS:
get_desc_text REDEFINITION,
get_url_base REDEFINITION,
get_screen_opt REDEFINITION,
set_merge_info REDEFINITION,
get_templates REDEFINITION.
TYPES:
tt_demo_120_attr TYPE STANDARD TABLE OF REF TO lcl_demo_120_attr WITH DEFAULT KEY.
" Public fields are always accessible
DATA title TYPE string. "#EC NEEDED
DATA t TYPE tt_rand_data. "#EC NEEDED internal flat table ( In template {R-T} )
DATA a TYPE REF TO data. "#EC NEEDED tt_demo_120_attr, Cannot show in ALV
DATA date TYPE d. "#EC NEEDED 8
DATA time TYPE t. "#EC NEEDED 6
DATA datetime TYPE cpet_reftimestamp. "#EC NEEDED 14 = date(8) + time(6)
PROTECTED SECTION.
METHODS:
_make_a_obj_table.
ENDCLASS.
*&---------------------------------------------------------------------*
*&---------------------------------------------------------------------*
CLASS lcl_demo_120 IMPLEMENTATION.
METHOD get_desc_text.
rv_desc_text = 'Class attributes'(120).
ENDMETHOD.
METHOD get_url_base.
rv_url_base = '/xtt/class-attributes/'.
ENDMETHOD.
METHOD get_screen_opt.
rs_opt-row_count = abap_true.
ENDMETHOD.
METHOD set_merge_info.
" {R-T} in a temaplte. @see get_random_table description
io_report->get_random_table( IMPORTING et_table = me->t ).
" Fill {R-A} later. Cannot show TABLE OF OBJECTS
me->a = _make_string_message( 'Table of objects'(too) ).
" Document structure
me->title = 'Title'(tit).
" Date and time in header and footer
me->date = sy-datum.
me->time = sy-uzeit.
" obligatory only for datetime (;type=datetime)
CONCATENATE sy-datum sy-uzeit INTO me->datetime.
io_report->merge_add_one( me ).
" Make table of objects
_make_a_obj_table( ).
ENDMETHOD.
METHOD _make_a_obj_table.
" Fill {R-A}
DATA lt_demo_120_attr TYPE REF TO tt_demo_120_attr.
CREATE DATA lt_demo_120_attr.
me->a = lt_demo_120_attr.
" Convert 'T' table to 'A' table
FIELD-SYMBOLS <ls_rand_data> TYPE ts_rand_data.
LOOP AT me->t ASSIGNING <ls_rand_data>.
DATA lo_attr TYPE REF TO lcl_demo_120_attr.
CREATE OBJECT lo_attr
EXPORTING
is_rand_data = <ls_rand_data>.
APPEND lo_attr TO lt_demo_120_attr->*.
ENDLOOP.
ENDMETHOD.
METHOD get_templates.
APPEND 'ZXXT_DEMO_120-XLSX' TO rt_templates.
APPEND 'ZXXT_DEMO_120_EXCEL-XML' TO rt_templates.
ENDMETHOD.
ENDCLASS.
**********************************************************************
CLASS lcl_demo_120_attr IMPLEMENTATION.
METHOD constructor.
me->group = is_rand_data-group.
me->caption = is_rand_data-caption.
" Change a little bit from 'T' table
me->date = is_rand_data-date + 10.
" Swap
me->sum1 = is_rand_data-sum2.
me->sum2 = is_rand_data-sum1.
ENDMETHOD.
ENDCLASS.
| 32.644628 | 87 | 0.563291 |
f7c7fc1722b8b20cf7ea4f807957c267e7422203 | 1,463 | abap | ABAP | lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zif_gtt_mia_tp_factory.intf.abap | rakshitha-1234/logistics-business-network-gtt-standardapps-samples | 3d1e3249046c0112ff33f524d30cde2ac9f38b4c | [
"Apache-2.0"
] | 3 | 2021-07-08T07:16:53.000Z | 2021-10-18T07:56:18.000Z | lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zif_gtt_mia_tp_factory.intf.abap | rakshitha-1234/logistics-business-network-gtt-standardapps-samples | 3d1e3249046c0112ff33f524d30cde2ac9f38b4c | [
"Apache-2.0"
] | null | null | null | lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zif_gtt_mia_tp_factory.intf.abap | rakshitha-1234/logistics-business-network-gtt-standardapps-samples | 3d1e3249046c0112ff33f524d30cde2ac9f38b4c | [
"Apache-2.0"
] | 7 | 2021-06-03T09:47:37.000Z | 2022-03-25T12:20:07.000Z | INTERFACE zif_gtt_mia_tp_factory
PUBLIC .
METHODS get_tp_reader
IMPORTING
!io_ef_parameters TYPE REF TO zif_gtt_mia_ef_parameters
RETURNING
VALUE(ro_bo_reader) TYPE REF TO zif_gtt_mia_tp_reader .
METHODS get_ef_parameters
IMPORTING
!iv_appsys TYPE /saptrx/applsystem
!is_app_obj_types TYPE /saptrx/aotypes
!it_all_appl_tables TYPE trxas_tabcontainer
!it_app_type_cntl_tabs TYPE trxas_apptype_tabs OPTIONAL
!it_app_objects TYPE trxas_appobj_ctabs
RETURNING
VALUE(ro_ef_parameters) TYPE REF TO zif_gtt_mia_ef_parameters .
METHODS get_ef_processor
IMPORTING
!is_definition TYPE zif_gtt_mia_ef_types=>ts_definition
!io_bo_factory TYPE REF TO zif_gtt_mia_tp_factory
!iv_appsys TYPE /saptrx/applsystem
!is_app_obj_types TYPE /saptrx/aotypes
!it_all_appl_tables TYPE trxas_tabcontainer
!it_app_type_cntl_tabs TYPE trxas_apptype_tabs
!it_app_objects TYPE trxas_appobj_ctabs
RETURNING
VALUE(ro_ef_processor) TYPE REF TO zif_gtt_mia_ef_processor
RAISING
cx_udm_message .
METHODS get_pe_filler
IMPORTING
!io_ef_parameters TYPE REF TO zif_gtt_mia_ef_parameters
!io_bo_reader TYPE REF TO zif_gtt_mia_tp_reader
RETURNING
VALUE(ro_pe_filler) TYPE REF TO zif_gtt_mia_pe_filler
RAISING
cx_udm_message .
ENDINTERFACE.
| 35.682927 | 69 | 0.723172 |
f7ca347f534f9be1554510ac7f24754919f67e42 | 2,178 | abap | ABAP | lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zgtt_mia.fugr.zgtt_mia_ote_dl_item_rel.abap | SAP-samples/logistics-business-network-gtt-standardapps-samples | eea4aae1bb74112a3a34f14c6f94f496ca708ea3 | [
"Apache-2.0"
] | 3 | 2021-07-08T07:16:53.000Z | 2021-10-18T07:56:18.000Z | lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zgtt_mia.fugr.zgtt_mia_ote_dl_item_rel.abap | SAP-samples/logistics-business-network-gtt-standardapps-samples | eea4aae1bb74112a3a34f14c6f94f496ca708ea3 | [
"Apache-2.0"
] | null | null | null | lbn-gtt-standard-app/abap/zsrc/zgtt_mia/zgtt_mia.fugr.zgtt_mia_ote_dl_item_rel.abap | SAP-samples/logistics-business-network-gtt-standardapps-samples | eea4aae1bb74112a3a34f14c6f94f496ca708ea3 | [
"Apache-2.0"
] | 7 | 2021-06-03T09:47:37.000Z | 2022-03-25T12:20:07.000Z | FUNCTION zgtt_mia_ote_dl_item_rel.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(I_APPSYS) TYPE /SAPTRX/APPLSYSTEM
*" REFERENCE(I_APP_OBJ_TYPES) TYPE /SAPTRX/AOTYPES
*" REFERENCE(I_ALL_APPL_TABLES) TYPE TRXAS_TABCONTAINER
*" REFERENCE(I_APPTYPE_TAB) TYPE TRXAS_APPTYPE_TABS_WA
*" REFERENCE(I_APP_OBJECT) TYPE TRXAS_APPOBJ_CTAB_WA
*" EXPORTING
*" VALUE(E_RESULT) LIKE SY-BINPT
*" TABLES
*" C_LOGTABLE STRUCTURE BAPIRET2 OPTIONAL
*" EXCEPTIONS
*" PARAMETER_ERROR
*" RELEVANCE_DETERM_ERROR
*" STOP_PROCESSING
*"----------------------------------------------------------------------
DATA: lt_app_objects TYPE trxas_appobj_ctabs,
lo_udm_message TYPE REF TO cx_udm_message,
ls_bapiret TYPE bapiret2.
lt_app_objects = VALUE #( ( i_app_object ) ).
TRY.
e_result = zcl_gtt_mia_ef_performer=>check_relevance(
is_definition = VALUE #(
maintab = zif_gtt_mia_app_constants=>cs_tabledef-dl_item_new
mastertab = zif_gtt_mia_app_constants=>cs_tabledef-dl_header_new )
io_tp_factory = NEW zcl_gtt_mia_tp_factory_dli( )
iv_appsys = i_appsys
is_app_obj_types = i_app_obj_types
it_all_appl_tables = i_all_appl_tables
it_app_objects = lt_app_objects ).
CATCH cx_udm_message INTO lo_udm_message.
zcl_gtt_mia_tools=>get_errors_log(
EXPORTING
io_umd_message = lo_udm_message
iv_appsys = i_appsys
IMPORTING
es_bapiret = ls_bapiret ).
" add error message
APPEND ls_bapiret TO c_logtable.
" throw corresponding exception
CASE lo_udm_message->textid.
WHEN zif_gtt_mia_ef_constants=>cs_errors-stop_processing.
RAISE stop_processing.
WHEN zif_gtt_mia_ef_constants=>cs_errors-table_determination.
RAISE parameter_error.
ENDCASE.
ENDTRY.
ENDFUNCTION.
| 38.210526 | 112 | 0.591827 |
f7cad36b654b657ab6c219af0c3715f09036e13a | 7,817 | abap | ABAP | db/zcl_zintfmonitor012_read.clas.abap | rayatus/sapinterfacemonitor | 5a1792440e47e78ac37da795204d95887281a4c3 | [
"MIT"
] | 3 | 2019-02-10T18:36:12.000Z | 2019-12-09T17:37:55.000Z | db/zcl_zintfmonitor012_read.clas.abap | rayatus/sapinterfacemonitor | 5a1792440e47e78ac37da795204d95887281a4c3 | [
"MIT"
] | 3 | 2018-12-02T12:15:08.000Z | 2019-02-17T21:38:02.000Z | db/zcl_zintfmonitor012_read.clas.abap | rayatus/sapinterfacemonitor | 5a1792440e47e78ac37da795204d95887281a4c3 | [
"MIT"
] | null | null | null | "! <p class="shorttext synchronized" lang="en">Interface Parameters</p>
CLASS zcl_zintfmonitor012_read DEFINITION
PUBLIC
CREATE PRIVATE INHERITING FROM zcl_zintfmonitor_base_read.
PUBLIC SECTION.
CONSTANTS:
"! <p class="shorttext synchronized" lang="en">Parameter data types</p>
BEGIN OF mc_datatype,
processing TYPE zintfmonitor012-datatype VALUE 'P',
returning TYPE zintfmonitor012-datatype VALUE 'R',
undefined TYPE zintfmonitor012-datatype VALUE '?',
END OF mc_datatype.
"! <p class="shorttext synchronized" lang="en">Class constructor</p>
CLASS-METHODS class_constructor.
"! <p class="shorttext synchronized" lang="en">Delete Details</p>
"!
"! @parameter is_details | <p class="shorttext synchronized" lang="en">List Details</p>
CLASS-METHODS delete_details
IMPORTING
is_details TYPE zintfmonitor012
RAISING
zcx_intfmonitor .
"! <p class="shorttext synchronized" lang="en">Delete Multiple</p>
"!
"! @parameter it_list | <p class="shorttext synchronized" lang="en">List Details</p>
CLASS-METHODS delete_list
IMPORTING
it_list TYPE ztt_zintfmonitor012
RAISING
zcx_intfmonitor .
"! <p class="shorttext synchronized" lang="en">Find details by keys</p>
"!
"! @parameter id_intfid | <p class="shorttext synchronized" lang="en">Interface</p>
"! @parameter id_param | <p class="shorttext synchronized" lang="en">Parameter</p>
"! @parameter rs_result | <p class="shorttext synchronized" lang="en">Details</p>
CLASS-METHODS get_details
IMPORTING
id_intfid TYPE zintfmonitor012-intfid
id_param TYPE zintfmonitor012-param
RETURNING
VALUE(rs_result) TYPE zintfmonitor012
RAISING
zcx_intfmonitor .
"! <p class="shorttext synchronized" lang="en">Find Multiple details by keys</p>
"!
"! @parameter id_intfid | <p class="shorttext synchronized" lang="en">Interface</p>
"! @parameter id_param | <p class="shorttext synchronized" lang="en">Parameter</p>
"! @parameter et_list | <p class="shorttext synchronized" lang="en">List Details</p>
CLASS-METHODS get_list
IMPORTING
id_intfid TYPE zintfmonitor012-intfid OPTIONAL
id_param TYPE zintfmonitor012-param OPTIONAL
EXPORTING
et_list TYPE ztt_zintfmonitor012
RAISING
zcx_intfmonitor .
"! <p class="shorttext synchronized" lang="en">Initializes Buffer Data</p>
CLASS-METHODS init_buffer .
"! <p class="shorttext synchronized" lang="en">Save Details</p>
"!
"! @parameter is_details | <p class="shorttext synchronized" lang="en">Detail</p>
"! @parameter if_add_to_buffer | <p class="shorttext synchronized" lang="en">Add to buffer?</p>
"! @raising zcx_intfmonitor | Undefined error
CLASS-METHODS save_details
IMPORTING
is_details TYPE zintfmonitor012
if_add_to_buffer TYPE abap_bool DEFAULT abap_false
RAISING
zcx_intfmonitor .
"! <p class="shorttext synchronized" lang="en">Save Multiple</p>
"!
"! @parameter it_list | <p class="shorttext synchronized" lang="en">List Details</p>
"! @parameter if_add_to_buffer | <p class="shorttext synchronized" lang="en">Add to buffer?</p>
"! @raising zcx_intfmonitor | Undefined error
CLASS-METHODS save_list
IMPORTING
it_list TYPE ztt_zintfmonitor012
if_add_to_buffer TYPE abap_bool DEFAULT abap_false
RAISING
zcx_intfmonitor .
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
BEGIN OF mtyp_ranges,
intfid TYPE RANGE OF zintfmonitor012-intfid,
param TYPE RANGE OF zintfmonitor012-param,
END OF mtyp_ranges .
"! <p class="shorttext synchronized" lang="en">Selection Ranges</p>
CLASS-DATA gt_ranges TYPE mtyp_ranges .
"! <p class="shorttext synchronized" lang="en">Data Buffer</p>
CLASS-DATA gt_buffer TYPE ztt_zintfmonitor012 .
"! <p class="shorttext synchronized" lang="en">Reads DB Table</p>
CLASS-METHODS do_select.
ENDCLASS.
CLASS zcl_zintfmonitor012_read IMPLEMENTATION.
METHOD delete_details.
DATA lt_list TYPE ztt_zintfmonitor012 .
DATA ls_list LIKE LINE OF lt_list.
DATA lo_exception TYPE REF TO zcx_intfmonitor.
ASSERT is_details IS NOT INITIAL.
TRY .
MOVE-CORRESPONDING is_details TO ls_list.
INSERT ls_list INTO TABLE lt_list[].
delete_list( lt_list[] ).
CATCH zcx_intfmonitor INTO lo_exception.
RAISE EXCEPTION lo_exception.
ENDTRY.
ENDMETHOD.
METHOD delete_list.
ASSERT it_list[] IS NOT INITIAL.
DELETE zintfmonitor012 FROM TABLE it_list.
IF NOT sy-subrc IS INITIAL.
RAISE EXCEPTION TYPE zcx_intfmonitor.
ENDIF.
ENDMETHOD.
METHOD get_details.
DATA lt_list TYPE ztt_zintfmonitor012 .
DATA ls_list LIKE LINE OF lt_list.
DATA lo_exception TYPE REF TO zcx_intfmonitor.
READ TABLE gt_buffer INTO rs_result
WITH KEY intfid = id_intfid
param = id_param.
IF NOT sy-subrc IS INITIAL.
TRY.
get_list( EXPORTING id_intfid = id_intfid
id_param = id_param
IMPORTING et_list = lt_list ).
READ TABLE lt_list INDEX 1 INTO ls_list.
MOVE-CORRESPONDING ls_list TO rs_result.
CATCH zcx_intfmonitor INTO lo_exception.
RAISE EXCEPTION lo_exception.
ENDTRY.
ENDIF.
ENDMETHOD.
METHOD get_list.
CLEAR gt_ranges.
IF id_intfid IS SUPPLIED.
_add_range( EXPORTING id_low = id_intfid
CHANGING ct_range = gt_ranges-intfid ).
ENDIF.
IF id_param IS SUPPLIED.
_add_range( EXPORTING id_low = id_param
CHANGING ct_range = gt_ranges-param ).
ENDIF.
LOOP AT gt_buffer INTO DATA(ls_buffer) WHERE intfid IN gt_ranges-intfid
AND param IN gt_ranges-param.
INSERT INITIAL LINE INTO TABLE et_list ASSIGNING FIELD-SYMBOL(<ls_list>).
MOVE-CORRESPONDING ls_buffer TO <ls_list>.
ENDLOOP.
IF et_list IS INITIAL.
RAISE EXCEPTION TYPE zcx_intfmonitor.
ENDIF.
ENDMETHOD.
METHOD init_buffer.
CLEAR gt_buffer[].
do_select( ).
ENDMETHOD.
METHOD save_details.
DATA lt_list TYPE ztt_zintfmonitor012 .
DATA ls_list LIKE LINE OF lt_list.
DATA lo_exception TYPE REF TO zcx_intfmonitor.
ASSERT is_details IS NOT INITIAL.
TRY .
MOVE-CORRESPONDING is_details TO ls_list.
INSERT ls_list INTO TABLE lt_list[].
save_list( EXPORTING it_list = lt_list[]
if_add_to_buffer = if_add_to_buffer ).
CATCH zcx_intfmonitor INTO lo_exception.
RAISE EXCEPTION lo_exception.
ENDTRY.
ENDMETHOD.
METHOD save_list.
ASSERT it_list[] IS NOT INITIAL.
MODIFY zintfmonitor012 FROM TABLE it_list.
IF NOT sy-subrc IS INITIAL.
RAISE EXCEPTION TYPE zcx_intfmonitor.
ENDIF.
IF if_add_to_buffer = abap_true.
LOOP AT it_list INTO DATA(ls_list).
READ TABLE gt_buffer WITH KEY intfid = ls_list-intfid
param = ls_list-param
ASSIGNING FIELD-SYMBOL(<ls_buffer>).
IF sy-subrc IS INITIAL.
<ls_buffer>-datatype = ls_list-datatype.
<ls_buffer>-paramtype = ls_list-paramtype.
ELSE.
INSERT ls_list INTO TABLE gt_buffer.
ENDIF.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD class_constructor.
init_buffer( ).
ENDMETHOD.
METHOD do_select.
SELECT * INTO TABLE gt_buffer FROM zintfmonitor012 ORDER BY PRIMARY KEY.
ENDMETHOD.
ENDCLASS.
| 31.647773 | 99 | 0.660739 |
f7ce5fd70b626deb90ee0c7dcdcf4df921036a41 | 3,232 | abap | ABAP | src/utils/ycl_abapgit_convert.clas.testclasses.abap | abapGit/y-version | 2c3a7e7d0f5abb860e34f8eb44e0c2170a0ccdfc | [
"MIT"
] | null | null | null | src/utils/ycl_abapgit_convert.clas.testclasses.abap | abapGit/y-version | 2c3a7e7d0f5abb860e34f8eb44e0c2170a0ccdfc | [
"MIT"
] | null | null | null | src/utils/ycl_abapgit_convert.clas.testclasses.abap | abapGit/y-version | 2c3a7e7d0f5abb860e34f8eb44e0c2170a0ccdfc | [
"MIT"
] | 2 | 2019-11-24T20:35:16.000Z | 2020-04-16T07:29:33.000Z | *----------------------------------------------------------------------*
* CLASS ltcl_convert DEFINITION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS ltcl_convert DEFINITION FOR TESTING RISK LEVEL HARMLESS DURATION SHORT FINAL.
PRIVATE SECTION.
METHODS convert_int FOR TESTING RAISING ycx_abapgit_exception.
METHODS split_string FOR TESTING.
METHODS convert_bitbyte FOR TESTING RAISING ycx_abapgit_exception.
ENDCLASS.
*----------------------------------------------------------------------*
* CLASS ltcl_convert IMPLEMENTATION
*----------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
CLASS ltcl_convert IMPLEMENTATION.
METHOD convert_bitbyte.
DATA: lv_xstring TYPE xstring,
lv_byte TYPE x,
lv_input TYPE i,
lv_bitbyte TYPE yif_abapgit_definitions=>ty_bitbyte,
lv_byteint TYPE i,
lv_xbyteint TYPE xstring,
lv_xresult TYPE xstring,
lv_result TYPE i,
lv_offset TYPE i.
DO 1000 TIMES.
lv_result = 0.
CLEAR: lv_byteint, lv_xbyteint, lv_xresult.
lv_input = sy-index * 64.
lv_xstring = ycl_abapgit_convert=>int_to_xstring4( lv_input ).
DO 4 TIMES.
lv_offset = sy-index - 1.
lv_byte = lv_xstring+lv_offset(1).
lv_bitbyte = ycl_abapgit_convert=>x_to_bitbyte( lv_byte ).
lv_byteint = ycl_abapgit_convert=>bitbyte_to_int( lv_bitbyte ).
lv_xbyteint = lv_byteint.
CONCATENATE lv_xresult lv_xbyteint INTO lv_xresult
IN BYTE MODE.
ENDDO.
lv_result = ycl_abapgit_convert=>xstring_to_int( lv_xresult ).
cl_abap_unit_assert=>assert_equals(
exp = lv_input
act = lv_result ).
ENDDO.
ENDMETHOD.
METHOD convert_int.
DATA: lv_xstring TYPE xstring,
lv_input TYPE i,
lv_result TYPE i.
DO 1000 TIMES.
lv_input = sy-index.
lv_xstring = ycl_abapgit_convert=>int_to_xstring4( lv_input ).
lv_result = ycl_abapgit_convert=>xstring_to_int( lv_xstring ).
cl_abap_unit_assert=>assert_equals(
exp = lv_input
act = lv_result ).
ENDDO.
ENDMETHOD.
METHOD split_string.
DATA: lt_act TYPE string_table,
lt_exp TYPE string_table.
APPEND 'ABC' TO lt_exp.
APPEND '123' TO lt_exp.
" Case 1. String separated by CRLF
lt_act = ycl_abapgit_convert=>split_string( 'ABC' && cl_abap_char_utilities=>cr_lf && '123' ).
cl_abap_unit_assert=>assert_equals( exp = lt_exp
act = lt_act
msg = ' Error during string split: CRLF' ).
CLEAR: lt_act.
" Case 2. String separated by LF
lt_act = ycl_abapgit_convert=>split_string( 'ABC' && cl_abap_char_utilities=>newline && '123' ).
cl_abap_unit_assert=>assert_equals( exp = lt_exp
act = lt_act
msg = ' Error during string split: LF' ).
ENDMETHOD.
ENDCLASS.
| 30.490566 | 100 | 0.543936 |
f7d14400cc91d9fc4a57297c875ea45642e2d01c | 52,407 | abap | ABAP | src/zcl_guidrasil_builder.clas.abap | tricktresor/guidrasil | fe3c388c81e1443b7a4dc6e58db4ba0906582702 | [
"MIT"
] | 9 | 2018-10-11T15:14:09.000Z | 2022-03-19T06:50:29.000Z | src/zcl_guidrasil_builder.clas.abap | tricktresor/guidrasil | fe3c388c81e1443b7a4dc6e58db4ba0906582702 | [
"MIT"
] | 7 | 2018-10-11T15:30:25.000Z | 2019-01-16T16:04:34.000Z | src/zcl_guidrasil_builder.clas.abap | tricktresor/guidrasil | fe3c388c81e1443b7a4dc6e58db4ba0906582702 | [
"MIT"
] | 3 | 2018-10-11T15:30:59.000Z | 2020-06-02T21:55:39.000Z | class ZCL_GUIDRASIL_BUILDER definition
public
final
create public .
*"* public components of class ZCL_GUIDRASIL_BUILDER
*"* do not include other source files here!!!
public section.
type-pools ABAP .
type-pools CNTB .
type-pools ICON .
interfaces ZIF_GUIDRASIL_FUNC_RECEIVER .
constants ICON_CONTAINER type ZGUIDRASIL_ICON_NAME value ICON_WD_VIEW_CONTAINER ##NO_TEXT.
constants K_MODE_DESIGN type CHAR01 value 'D' ##NO_TEXT.
constants K_MODE_PATTERN type CHAR01 value 'P' ##NO_TEXT.
class-methods CLASS_CONSTRUCTOR .
class-methods INIT_CONTROL_NAME
importing
!IV_TEXT type C
returning
value(EV_NAME) type TEXT30 .
methods ADD_CONTAINER
importing
!IV_SIDE type I
!IV_CONTROL_ID type I optional .
methods ADD_CONTAINER_BOX .
methods ADD_CONTAINER_CC
importing
!CC_NAME type CLIKE optional .
methods BUILD .
methods CONSTRUCTOR
importing
!IV_PNAME type ZGUIDRASIL_PROJECT
!IV_MODE type CHAR01 default SPACE .
methods GET_CREATION_CODE
returning
value(CODE) type STRING_TABLE .
methods GET_EVENT_PATTERN
returning
value(PATTERN) type STRING_TABLE .
methods GET_EVENT_PATTERN_PLUS
returning
value(PATTERN) type STRING_TABLE .
methods GET_OBJECT_BY_NAME
importing
!NAME type CLIKE
returning
value(OBJECT) type ref to CL_GUI_OBJECT .
methods SAVE .
PROTECTED SECTION.
*"* protected components of class ZCL_GUIDRASIL_CONTROL_BUILDER
*"* do not include other source files here!!!
METHODS add_control_object
IMPORTING
VALUE(fcode) TYPE ui_func
VALUE(r_sender) TYPE REF TO object
VALUE(r_receiver) TYPE REF TO object
VALUE(r_toolbar) TYPE REF TO cl_gui_toolbar .
METHODS get_menu_functions
IMPORTING
!fcode TYPE clike
RETURNING
VALUE(it_functions) TYPE ttb_button .
private section.
types:
*"* private components of class ZCL_GUIDRASIL_BUILDER
*"* do not include other source files here!!!
BEGIN OF gys_control_classes,
id TYPE i, "numc5,
classname TYPE seoclsname,
END OF gys_control_classes .
types:
gyt_control_classes TYPE SORTED TABLE OF gys_control_classes
WITH UNIQUE KEY id .
types:
BEGIN OF gys_control_admin,
id TYPE i,
name TYPE string,
parent TYPE REF TO zcl_guidrasil_control_base,
parent_name TYPE zguidrasil_container_name,
control TYPE REF TO zcl_guidrasil_control_base,
END OF gys_control_admin .
types:
gyt_control_admin TYPE TABLE OF gys_control_admin .
class-data MT_IDX type TY_IDX_T .
class-data MT_CTLS type ZGUIDRASIL_CTLS_T .
class-data GV_CONTROL_ID type NUMC3 .
data CURRENT_CONTROL_ID type I .
data R_TOOLBAR type ref to CL_GUI_TOOLBAR .
data MT_CONTROLS type ZGUIDRASIL_OBJ_T .
data MODE type CHAR01 .
data PNAME type CHAR40 .
data R_DOCKING type ref to CL_GUI_DOCKING_CONTAINER .
data R_TOOLBAR_CONTAINER type ref to CL_GUI_DIALOGBOX_CONTAINER .
class-data GT_CONTROL_CLASSES type GYT_CONTROL_CLASSES .
data T_CONTROL_ADMIN type GYT_CONTROL_ADMIN .
class-data GT_DELETE_FUNCTION type TTB_BUTTON .
class-data GT_CLOSE_FUNCTION type TTB_BUTTON .
class-data GT_INSERT_FUNCTION type TTB_BUTTON .
class-data GT_PATTERN_FUNCTION type TTB_BUTTON .
data GT_CONTROL_LIST type ZGUIDRASIL_CONTROL_LIST_T .
class-methods GET_NAME_BUTTON
importing
!IR_CONTROL type ref to ZCL_GUIDRASIL_CONTROL_BASE
changing
!CT_FUNCTIONS type TTB_BUTTON .
methods ADD_CONTROL
importing
!IR_CONTROL type ref to ZCL_GUIDRASIL_CONTROL_BASE
!IR_PARENT type ref to ZCL_GUIDRASIL_CONTROL_BASE optional
!IV_PARENT_NAME type CLIKE optional .
methods BUILD_CONTROL_TOOLBAR
importing
!IR_WRAPPER type ref to ZCL_GUIDRASIL_DESIGN_CONTAINER .
methods BUILD_DESIGN_TOOLBAR .
methods BUILD_EDIT_TOOLBAR
importing
!IR_WRAPPER type ref to ZCL_GUIDRASIL_DESIGN_CONTAINER
!IR_CONTROL_BUILDER type ref to ZCL_GUIDRASIL_CONTROL_BASE .
methods BUILD_PATTERN_TOOLBAR
importing
!IR_WRAPPER type ref to ZCL_GUIDRASIL_DESIGN_CONTAINER
!IR_CONTROL_BUILDER type ref to ZCL_GUIDRASIL_CONTROL_BASE .
methods CODE_REPLACE
importing
!SEARCH type CLIKE
!REPLACE type CLIKE
!PREFIX type CLIKE
changing
!CODE type STRING_TABLE .
methods CREATE_WRAPPER
importing
!IV_CONTROL_TOOLBAR type XFELD optional
!IV_EDIT_TOOLBAR type XFELD optional
!IR_CONTAINER type ref to CL_GUI_CONTAINER optional
!IR_PARENT_BUILDER type ref to ZCL_GUIDRASIL_CONTROL_BASE
exporting
!ER_WRAPPER type ref to ZCL_GUIDRASIL_DESIGN_CONTAINER .
methods IS_CLOSE_FUNCTION_ENABLED
importing
!IR_WRAPPER type ref to ZCL_GUIDRASIL_DESIGN_CONTAINER
returning
value(RV_ENABLED) type XFELD .
methods ON_DESIGN_FUNCTION_SELECTED
for event FUNCTION_SELECTED of CL_GUI_TOOLBAR
importing
!FCODE .
methods SET_CURRENT_CONTROL_ID
returning
value(CONTROL_ID) type I .
methods UPDATE_CONTROLS .
ENDCLASS.
CLASS ZCL_GUIDRASIL_BUILDER IMPLEMENTATION.
METHOD add_container.
DATA lv_extension TYPE i.
DATA lv_control_id TYPE i.
DATA lr_control_builder TYPE REF TO zcl_guidrasil_control_base.
DATA lr_wrapper TYPE REF TO zcl_guidrasil_design_container.
DATA lr_docking_container TYPE REF TO cl_gui_docking_container.
IF iv_control_id IS INITIAL.
lv_control_id = set_current_control_id( ).
ELSE.
lv_control_id = iv_control_id.
ENDIF.
CASE iv_side.
WHEN cl_gui_docking_container=>dock_at_bottom
OR cl_gui_docking_container=>dock_at_top.
lv_extension = 160.
WHEN cl_gui_docking_container=>dock_at_left
OR cl_gui_docking_container=>dock_at_right.
lv_extension = 400.
ENDCASE.
* entsprechenden Control-Builder anlegen
CALL METHOD zcl_guidrasil_control_base=>get_instance
EXPORTING
iv_classname = 'ZCL_GUIDRASIL_CONTROL_DOCKING'
iv_control_id = lv_control_id
IMPORTING
er_control = lr_control_builder
EXCEPTIONS
OTHERS = 1.
zcl_guidrasil_tools=>todo( 'Setzen Daten innerhalb drasil-Control' ).
lr_control_builder->apply_settings( ).
* Seite und Größe festlegen
lr_docking_container ?= lr_control_builder->gr_control.
lr_docking_container->dock_at( side = iv_side ).
lr_docking_container->set_extension( extension = lv_extension ).
* Control zur Verwaltungstabelle hinzufügen
add_control( ir_control = lr_control_builder ).
* im Designmode Wrapper hinzufügen
create_wrapper( iv_control_toolbar = abap_true
ir_parent_builder = lr_control_builder ).
ENDMETHOD.
METHOD add_container_box.
DATA lv_extension TYPE i.
DATA lr_control_builder TYPE REF TO zcl_guidrasil_control_base.
DATA lr_wrapper TYPE REF TO zcl_guidrasil_design_container.
DATA lv_control_id TYPE i.
lv_control_id = set_current_control_id( ).
* entsprechenden Control-Builder anlegen
CALL METHOD zcl_guidrasil_control_base=>get_instance
EXPORTING
iv_classname = 'ZCL_GUIDRASIL_CONTROL_DIABOX'
ir_parent_container = cl_gui_container=>screen0
iv_control_id = 0
IMPORTING
er_control = lr_control_builder
EXCEPTIONS
OTHERS = 1.
* Control zur Verwaltungstabelle hinzufügen
add_control( lr_control_builder ).
* im Designmode Wrapper hinzufügen
CALL METHOD create_wrapper
EXPORTING
iv_control_toolbar = abap_true
ir_parent_builder = lr_control_builder.
ENDMETHOD.
METHOD add_container_cc.
DATA lv_extension TYPE i.
DATA lr_control_builder TYPE REF TO zcl_guidrasil_control_base.
DATA lr_wrapper TYPE REF TO zcl_guidrasil_design_container.
DATA lr_cc_container TYPE REF TO cl_gui_custom_container.
DATA lv_control_id TYPE i.
lv_control_id = set_current_control_id( ).
* entsprechenden Control-Builder anlegen
CALL METHOD zcl_guidrasil_control_base=>get_instance
EXPORTING
iv_classname = 'ZCL_GUIDRASIL_CONTROL_CUSTOM'
iv_name = cc_name
iv_control_id = 0
IMPORTING
er_control = lr_control_builder
EXCEPTIONS
OTHERS = 1.
* Seite und Größe festlegen
lr_cc_container ?= lr_control_builder->gr_control.
* Control zur Verwaltungstabelle hinzufügen
add_control( lr_control_builder ).
* im Designmode Wrapper hinzufügen
CALL METHOD create_wrapper
EXPORTING
iv_control_toolbar = abap_true
ir_parent_builder = lr_control_builder.
ENDMETHOD.
METHOD add_control.
DATA ls_control_admin TYPE gys_control_admin.
*== New Control
ls_control_admin-id = current_control_id.
ls_control_admin-name = ir_control->gv_control_name.
ls_control_admin-control = ir_control.
ls_control_admin-parent = ir_parent.
ls_control_admin-parent_name = iv_parent_name.
APPEND ls_control_admin TO t_control_admin.
set_current_control_id( ).
DATA ls_control_list TYPE zguidrasil_control_list.
CLEAR ls_control_list.
READ TABLE gt_control_list TRANSPORTING NO FIELDS WITH TABLE KEY guid = ir_control->gv_guid.
IF sy-subrc > 0.
ls_control_list-guid = ir_control->gv_guid.
ls_control_list-r_control_builder = ir_control.
ls_control_list-t_container = ir_control->get_container_list( ).
INSERT ls_control_list INTO TABLE gt_control_list.
ENDIF.
ENDMETHOD.
METHOD add_control_object.
DATA lr_container TYPE REF TO cl_gui_container.
DATA lr_wrapper TYPE REF TO zcl_guidrasil_design_container.
DATA lr_control_builder TYPE REF TO zcl_guidrasil_control_base.
DATA ls_control_list LIKE LINE OF gt_control_list. "ew20160609
FIELD-SYMBOLS <ls_control_classes> TYPE gys_control_classes.
CHECK fcode(1) <> '$'.
* Lesen, welches Control hinzugefügt werden soll
READ TABLE gt_control_classes
ASSIGNING <ls_control_classes>
WITH KEY
id = fcode.
* Hinzufüge-Funktion eines Controls?
CHECK sy-subrc = 0.
* Container vom Wrapper holen
lr_wrapper ?= r_sender.
lr_container = lr_wrapper->get_container_first( ).
ls_control_list-parent_container = lr_wrapper->get_container_name( ).
* entsprechenden Control-Builder anlegen
zcl_guidrasil_control_base=>get_instance(
EXPORTING
iv_classname = <ls_control_classes>-classname
ir_parent_container = lr_container
iv_parent_container = ls_control_list-parent_container
iv_control_id = <ls_control_classes>-id
IMPORTING
er_control = lr_control_builder
EXCEPTIONS
OTHERS = 1 ).
CHECK sy-subrc = 0.
READ TABLE gt_control_list TRANSPORTING NO FIELDS
WITH KEY guid = lr_control_builder->gv_guid.
IF sy-subrc > 0.
ls_control_list-guid = lr_control_builder->gv_guid.
ls_control_list-r_control_builder = lr_control_builder.
INSERT ls_control_list
INTO TABLE gt_control_list. "ew20160609
ENDIF.
* Untergeordnetes Control bekannt machen
lr_wrapper->add_child( lr_control_builder ).
add_control(
ir_control = lr_control_builder
ir_parent = lr_wrapper->get_parent( )
iv_parent_name = ls_control_list-parent_container ).
* Einfüge-Toolbar in Editiertoolbar ändern
build_edit_toolbar(
ir_wrapper = lr_wrapper
ir_control_builder = lr_control_builder ).
* Wrapper aufbauen, falls Control weitere Kindcontainer hat
create_wrapper(
iv_control_toolbar = abap_true
ir_parent_builder = lr_control_builder ).
ENDMETHOD.
METHOD build.
DATA lv_classname TYPE seoclsname.
DATA ls_control_list TYPE zguidrasil_control_list.
DATA lr_control_builder TYPE REF TO zcl_guidrasil_control_base.
DATA lr_container TYPE REF TO cl_gui_container.
DATA lr_wrapper TYPE REF TO zcl_guidrasil_design_container.
DATA lv_parent_container_found TYPE boolean.
FIELD-SYMBOLS <ls_object> TYPE zguidrasil_obj.
FIELD-SYMBOLS <ls_control_list> LIKE ls_control_list.
*TODO: Prüfung Klassennamen
CASE mode.
WHEN k_mode_design.
* CALL METHOD build_design_toolbar.
ENDCASE.
SORT mt_controls BY control_index.
* Controls aufbauen
LOOP AT mt_controls ASSIGNING <ls_object>.
READ TABLE gt_control_list
ASSIGNING <ls_control_list>
WITH TABLE KEY
guid = <ls_object>-parent_guid.
* Root -> erzeugen
IF sy-subrc <> 0.
* derzeit nur Docking-Container/ Custom Control
lv_classname = <ls_object>-parent.
CALL METHOD zcl_guidrasil_control_base=>get_instance
EXPORTING
iv_classname = lv_classname
iv_guid = <ls_object>-parent_guid
iv_control_id = <ls_object>-control_index
IMPORTING
er_control = lr_control_builder
EXCEPTIONS
OTHERS = 1.
CLEAR ls_control_list.
ls_control_list-guid = lr_control_builder->gv_guid.
ls_control_list-r_control_builder = lr_control_builder.
lr_container ?= lr_control_builder->gr_control.
APPEND lr_container TO ls_control_list-t_container.
INSERT ls_control_list
INTO TABLE gt_control_list
ASSIGNING <ls_control_list>.
* Control zur Verwaltungstabelle hinzufügen
set_current_control_id( ).
add_control( ir_control = lr_control_builder ).
ENDIF.
* 1. Container ermitteln
LOOP AT <ls_control_list>-t_container INTO lr_container.
IF lr_container->get_name( ) = <ls_object>-parent_container.
lv_parent_container_found = abap_true.
EXIT.
ENDIF.
ENDLOOP.
IF lv_parent_container_found = abap_false.
READ TABLE <ls_control_list>-t_container
INTO lr_container INDEX 1.
* nur freie Container behalten und aktuellen rausnehmen
DELETE <ls_control_list>-t_container INDEX 1.
ENDIF.
* es gibt keine?
CHECK sy-subrc = 0.
* im Designmode Wrapper mit Toolbar hinzufügen
CASE mode.
WHEN k_mode_design
OR k_mode_pattern.
CALL METHOD create_wrapper
EXPORTING
ir_container = lr_container
ir_parent_builder = <ls_control_list>-r_control_builder
IMPORTING
er_wrapper = lr_wrapper.
lr_container = lr_wrapper->get_container_first( ).
ENDCASE.
* Kind erzeugen
lv_classname = <ls_object>-object.
CALL METHOD zcl_guidrasil_control_base=>get_instance
EXPORTING
iv_classname = lv_classname
iv_guid = <ls_object>-object_guid
ir_parent_container = lr_container
iv_parent_container = <ls_object>-parent_container
iv_name = <ls_object>-control_name
iv_control_id = <ls_object>-control_index
* iv_dont_create = lv_dont_create
IMPORTING
er_control = lr_control_builder
EXCEPTIONS
OTHERS = 1.
CLEAR ls_control_list.
ls_control_list-guid = lr_control_builder->gv_guid.
ls_control_list-r_control_builder = lr_control_builder.
ls_control_list-t_container = lr_control_builder->get_container_list( ).
INSERT ls_control_list INTO TABLE gt_control_list.
CASE mode.
WHEN k_mode_design.
lr_wrapper->add_child( lr_control_builder ).
build_edit_toolbar(
ir_wrapper = lr_wrapper
ir_control_builder = lr_control_builder ).
WHEN k_mode_pattern.
lr_wrapper->add_child( lr_control_builder ).
build_pattern_toolbar(
ir_wrapper = lr_wrapper
ir_control_builder = lr_control_builder ).
ENDCASE.
add_control( ir_control = lr_control_builder
ir_parent = <ls_control_list>-r_control_builder ).
ENDLOOP.
* Falls noch Container übrig sind -> Wrapper mit Control-Hinzufügefunktionen
IF mode = k_mode_design.
LOOP AT gt_control_list ASSIGNING <ls_control_list>.
LOOP AT <ls_control_list>-t_container INTO lr_container.
create_wrapper(
iv_control_toolbar = abap_true
ir_container = lr_container
ir_parent_builder = <ls_control_list>-r_control_builder ).
ENDLOOP.
ENDLOOP.
ENDIF.
ENDMETHOD.
METHOD build_control_toolbar.
DATA lt_funcmenus TYPE ttb_btnmnu. "ew
DATA lt_functions TYPE ttb_button.
DATA ls_function TYPE stb_button.
* Buttons löschen
CALL METHOD ir_wrapper->clear_toolbar.
* Schließen Funktion
IF is_close_function_enabled( ir_wrapper ) = abap_true.
APPEND LINES OF gt_close_function TO lt_functions.
ENDIF.
*== MENÜ Eintrag für Auswahl "CONTAINER"
CLEAR ls_function.
ls_function-function = '$CONTAINER'.
ls_function-text = ''.
ls_function-icon = zcl_guidrasil_constants=>icon_container. "icon_wd_view_container.
ls_function-butn_type = cntb_btype_dropdown.
APPEND ls_function TO lt_functions.
*== MENÜ Eintrag für Auswahl "Control"
CLEAR ls_function.
ls_function-function = '$CONTROLS'.
ls_function-text = ''.
ls_function-icon = icon_oo_object.
ls_function-butn_type = zcl_guidrasil_constants=>icon_control. "cntb_btype_dropdown.
APPEND ls_function TO lt_functions.
*== MENÜ Eintrag für Auswahl "Control"
CLEAR ls_function.
ls_function-function = '$CUSTOM'.
ls_function-text = ''.
ls_function-icon = icon_interface.
ls_function-butn_type = zcl_guidrasil_constants=>icon_control. "cntb_btype_dropdown.
APPEND ls_function TO lt_functions.
* Hinzufügbare Controls
APPEND LINES OF gt_insert_function TO lt_functions.
CALL METHOD ir_wrapper->add_functions
EXPORTING
it_function = lt_functions
it_funcmenu = lt_funcmenus
ir_sender = ir_wrapper
ir_receiver = me.
ENDMETHOD.
METHOD build_design_toolbar.
DATA lt_events TYPE cntl_simple_events.
DATA ls_event TYPE cntl_simple_event.
* Design-Toolbar einmalig aufbauen
CHECK mode = k_mode_design.
CHECK r_toolbar_container IS NOT BOUND.
* Dialogbox-Container
CREATE OBJECT r_toolbar_container
EXPORTING
width = 30
height = 30
top = 0
left = 0
caption = 'Design-Toolbar'.
* Toolbar
CREATE OBJECT r_toolbar
EXPORTING
parent = r_toolbar_container.
* ls_event-eventid = cl_gui_toolbar=>m_id_dropdown_clicked. "ew
* APPEND ls_event TO lt_event.
ls_event-eventid = cl_gui_toolbar=>m_id_function_selected.
APPEND ls_event TO lt_events.
r_toolbar->set_registered_events( events = lt_events ).
SET HANDLER on_design_function_selected FOR r_toolbar.
* Funktionen für neue Docking-Container
CALL METHOD r_toolbar->add_button
EXPORTING
fcode = '$BOTTOM'
icon = icon_previous_value
butn_type = cntb_btype_button
quickinfo = 'Dockingcontainer unten'
EXCEPTIONS
cntb_error_fcode = 1.
CALL METHOD r_toolbar->add_button
EXPORTING
fcode = '$LEFT'
icon = icon_column_left
butn_type = cntb_btype_button
quickinfo = 'Dockingcontainer links'
EXCEPTIONS
cntb_error_fcode = 1.
CALL METHOD r_toolbar->add_button
EXPORTING
fcode = '$RIGHT'
icon = icon_column_right
butn_type = cntb_btype_button
quickinfo = 'Dockingcontainer rechts'
EXCEPTIONS
cntb_error_fcode = 1.
CALL METHOD r_toolbar->add_button
EXPORTING
fcode = '$TOP'
icon = icon_next_value
butn_type = cntb_btype_button
quickinfo = 'Dockingcontainer oben'
EXCEPTIONS
cntb_error_fcode = 1.
ENDMETHOD.
METHOD build_edit_toolbar.
DATA:
lt_funcmenu TYPE ttb_btnmnu, "ew
lt_function TYPE ttb_button,
lrt_container TYPE cwb_container.
* Buttons löschen
CALL METHOD ir_wrapper->clear_toolbar.
* Funktionen zum Container/Control löschen
IF is_close_function_enabled( ir_wrapper ) = abap_true.
APPEND LINES OF gt_close_function TO lt_function.
ENDIF.
APPEND LINES OF gt_delete_function TO lt_function.
*** add "Name of Control" Button
CALL METHOD get_name_button
EXPORTING
ir_control = ir_control_builder
CHANGING
ct_functions = lt_function.
CALL METHOD ir_wrapper->add_functions
EXPORTING
it_function = lt_function
it_funcmenu = lt_funcmenu "ew
ir_sender = ir_wrapper
ir_receiver = me.
* Prüfen, ob das Control weitere Container bereitstellt
lrt_container = ir_control_builder->get_container_list( ).
CHECK lrt_container IS INITIAL.
ir_control_builder->init( ).
* wennn nicht, evtl. Einstellungsfunktionen hinzufügen
ir_control_builder->get_design_functions(
IMPORTING
et_functions = lt_function
et_funcmenus = lt_funcmenu ).
ir_wrapper->add_functions(
it_function = lt_function
it_funcmenu = lt_funcmenu
ir_sender = ir_wrapper
ir_receiver = ir_control_builder ).
ENDMETHOD.
METHOD build_pattern_toolbar.
DATA lt_funcmenu TYPE ttb_btnmnu.
DATA lt_function TYPE ttb_button.
DATA lrt_container TYPE cwb_container.
* Buttons löschen
ir_wrapper->clear_toolbar( ).
IF ir_control_builder->has_pattern( ) > 0.
APPEND LINES OF gt_pattern_function TO lt_function.
ENDIF.
*** add "Name of Control" Button
get_name_button(
EXPORTING ir_control = ir_control_builder
CHANGING ct_functions = lt_function ).
ir_wrapper->add_functions(
it_function = lt_function
it_funcmenu = lt_funcmenu
ir_sender = ir_wrapper
ir_receiver = me ).
* Prüfen, ob das Control weitere Container bereitstellt
lrt_container = ir_control_builder->get_container_list( ).
CHECK lrt_container IS INITIAL.
* wennn nicht, evtl. Einstellungsfunktionen hinzufügen
* lt_function = ir_control_builder->get_design_functions( ).
ir_wrapper->add_functions(
it_function = lt_function
it_funcmenu = lt_funcmenu
ir_sender = ir_wrapper
ir_receiver = ir_control_builder ).
ENDMETHOD.
METHOD class_constructor.
DATA:
ls_ctls TYPE zguidrasil_ctls,
ls_control_classes TYPE gys_control_classes,
ls_function TYPE stb_button.
* Funktion zum Schließen von Containern
CLEAR ls_function.
ls_function-function = '$CLOSE'.
ls_function-icon = icon_close.
ls_function-butn_type = cntb_btype_button.
ls_function-quickinfo = 'Destroy Container'.
APPEND ls_function TO gt_close_function.
CLEAR ls_function.
ls_function-function = '$SEP0'.
ls_function-butn_type = cntb_btype_sep.
APPEND ls_function TO gt_close_function.
* Funktion zum Entfernen von Controls
CLEAR ls_function.
ls_function-function = '$DELETE'.
ls_function-icon = icon_delete.
ls_function-butn_type = cntb_btype_button.
ls_function-quickinfo = 'Delete Current Control'.
APPEND ls_function TO gt_delete_function.
CLEAR ls_function.
ls_function-function = '$SEP1'.
ls_function-butn_type = cntb_btype_sep.
APPEND ls_function TO gt_delete_function.
* Funktion für die Auswahl eines Controls für Pattern
CLEAR ls_function.
ls_function-function = '$SELECT'.
ls_function-icon = icon_system_okay.
ls_function-butn_type = cntb_btype_button.
APPEND ls_function TO gt_pattern_function.
CLEAR ls_function.
SELECT *
FROM zguidrasil_ctls
INTO TABLE mt_ctls
WHERE usable = abap_true.
LOOP AT mt_ctls INTO ls_ctls.
ls_control_classes-classname = ls_ctls-classname.
* verwendbare Klassen merken
ADD 1 TO ls_control_classes-id.
INSERT ls_control_classes INTO TABLE gt_control_classes.
* Funktionsliste aufbauen
SELECT SINGLE id FROM icon INTO ls_function-icon WHERE name = ls_ctls-iconname.
ls_function-function = ls_control_classes-id.
SHIFT ls_function-function LEFT DELETING LEADING space.
ls_function-quickinfo = ls_ctls-quickinfo.
ls_function-butn_type = cntb_btype_menu.
APPEND ls_function TO gt_insert_function.
ENDLOOP.
ENDMETHOD.
METHOD code_replace.
LOOP AT code ASSIGNING FIELD-SYMBOL(<line>).
REPLACE ALL OCCURRENCES OF search IN <line> WITH |{ prefix }_{ replace }|.
ENDLOOP.
ENDMETHOD.
METHOD constructor.
mode = iv_mode.
pname = iv_pname.
* gespeicherten Zustand laden
SELECT * FROM zguidrasil_obj
INTO TABLE mt_controls
WHERE report = iv_pname.
DATA ls_control LIKE LINE OF mt_controls.
FIELD-SYMBOLS <idx> LIKE LINE OF mt_idx.
DATA ls_idx LIKE LINE OF mt_idx.
DATA name TYPE zguidrasil_container_name.
DATA id LIKE ls_idx-control_id.
LOOP AT mt_controls INTO ls_control.
SPLIT ls_control-control_name AT '_' INTO name id.
READ TABLE mt_idx WITH TABLE KEY name = name ASSIGNING <idx>.
IF sy-subrc = 0.
IF id > <idx>-control_id.
<idx>-control_id = id .
ENDIF.
ELSE.
ls_idx-name = name.
ls_idx-control_id = id.
INSERT ls_idx INTO TABLE mt_idx.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD create_wrapper.
DATA lrt_container TYPE cwb_container.
DATA lr_container TYPE REF TO cl_gui_container.
CHECK mode = k_mode_design
OR mode = k_mode_pattern.
* wenn angegeben, nur den übergebenen Container verwenden
IF ir_container IS BOUND.
CLEAR lrt_container.
APPEND ir_container TO lrt_container.
ELSE.
* Container ermitteln
lrt_container = ir_parent_builder->get_container_list( ).
ENDIF.
* Wrapper für jeden Container hinzufügen
LOOP AT lrt_container INTO lr_container.
DATA(lv_container_name) = lr_container->get_name( ).
lr_container->set_name( |{ lr_container->get_name( ) }| ).
* Wrappercontrol aufbauen
CREATE OBJECT er_wrapper
EXPORTING
ir_parent_container = lr_container
ir_parent_control = ir_parent_builder.
* Übergeordnetes Control und Wrapper verlinken
CALL METHOD ir_parent_builder->add_child( er_wrapper ).
* Toolbar mit hinzufügbaren Controls
IF iv_control_toolbar = abap_true.
CALL METHOD build_control_toolbar
EXPORTING
ir_wrapper = er_wrapper.
* Toolbar mit Einstellungen zum Control
ELSEIF iv_edit_toolbar = abap_true.
CALL METHOD build_edit_toolbar
EXPORTING
ir_wrapper = er_wrapper
ir_control_builder = ir_parent_builder.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD get_creation_code.
DATA lt_data TYPE string_table.
DATA lt_code TYPE string_table.
DATA xt_data TYPE string_table.
DATA xt_code TYPE string_table.
LOOP AT mt_controls ASSIGNING FIELD-SYMBOL(<control>).
READ TABLE gt_control_list INTO DATA(ls_object) WITH TABLE KEY guid = <control>-object_guid.
IF sy-subrc = 0.
READ TABLE gt_control_list INTO DATA(ls_parent) WITH TABLE KEY guid = <control>-parent_guid.
IF sy-subrc > 0.
CLEAR ls_parent.
ENDIF.
IF ls_object-r_control_builder->return_creation_code( IMPORTING data = lt_data code = lt_code ) = abap_false.
code_replace( EXPORTING search = '$control'
prefix = 'lr'
replace = ls_object-r_control_builder->gv_control_name
CHANGING code = lt_data ).
code_replace( EXPORTING search = '$control'
prefix = 'lr'
replace = ls_object-r_control_builder->gv_control_name
CHANGING code = lt_code ).
IF ls_parent IS NOT INITIAL.
code_replace( EXPORTING search = '$parent'
prefix = 'lr'
replace = ls_parent-r_control_builder->gv_control_name
CHANGING code = lt_code ).
ENDIF.
APPEND LINES OF lt_data TO xt_data.
APPEND LINES OF lt_code TO xt_code.
ENDIF.
ENDIF.
ENDLOOP.
APPEND LINES OF xt_data TO code.
APPEND LINES OF xt_code TO code.
ENDMETHOD.
METHOD get_event_pattern.
DATA ls_control LIKE LINE OF gt_control_list.
DATA ls_object LIKE LINE OF mt_controls.
DATA lr_object TYPE REF TO cl_gui_object.
DATA line TYPE string.
DATA event TYPE string.
DATA lr_obj TYPE REF TO cl_abap_classdescr.
DATA lv_name TYPE string.
TYPES: BEGIN OF ty_event_ctrl,
event TYPE string,
control TYPE string,
name TYPE string,
END OF ty_event_ctrl,
BEGIN OF ty_event,
event TYPE string,
control TYPE string,
END OF ty_event.
DATA lt_events TYPE STANDARD TABLE OF ty_event.
DATA ls_event TYPE ty_event.
DATA lt_events_c TYPE STANDARD TABLE OF ty_event_ctrl.
DATA ls_event_c TYPE ty_event_ctrl.
DATA ls_event2 TYPE ty_event.
*clear t_controls.
* update_controls( ).
_code 'CLASS lcl_main DEFINITION.'.
_code ' PUBLIC SECTION.'.
_code ' DATA mr_guidrasil TYPE REF TO zcl_guidrasil_builder.'.
LOOP AT mt_controls INTO ls_object.
READ TABLE gt_control_list INTO ls_control WITH KEY guid = ls_object-object_guid.
IF sy-subrc = 0 .
*== DATA DEFINITION
lr_object ?= ls_control-r_control_builder->get_control( ).
IF lr_object IS BOUND.
lr_obj ?= cl_abap_typedescr=>describe_by_object_ref( lr_object ).
lv_name = lr_obj->get_relative_name( ).
line = | DATA mr_{ ls_object-control_name } TYPE REF TO { lv_name }.|.
ENDIF.
APPEND line TO pattern.
*== EVENT HANDLER
IF ls_control-r_control_builder->gt_events IS NOT INITIAL.
LOOP AT ls_control-r_control_builder->gt_events INTO ls_event-event.
ls_event-control = lv_name.
READ TABLE lt_events TRANSPORTING NO FIELDS
WITH KEY event = ls_event-event
control = ls_event-control.
IF sy-subrc > 0.
APPEND ls_event TO lt_events.
ENDIF.
ls_event_c-event = ls_event-event.
ls_event_c-control = lv_name.
ls_event_c-name = ls_object-control_name.
APPEND ls_event_c TO lt_events_c.
ENDLOOP.
ENDIF.
ENDIF.
ENDLOOP.
_code ' METHODS constructor.'.
LOOP AT lt_events_c INTO ls_event_c.
line = | METHODS h_{ ls_event_c-event } FOR EVENT { ls_event_c-event } OF { ls_event_c-control } IMPORTING sender.|.
APPEND line TO pattern.
ENDLOOP.
_code 'ENDCLASS.'.
_code 'CLASS lcl_main IMPLEMENTATION.'.
_code ' METHOD constructor.'.
_code ' CREATE OBJECT mr_guidrasil'.
_code ' EXPORTING'.
line = ` iv_pname = '$$PROJECT$$'.`.
REPLACE '$$PROJECT$$' WITH pname INTO line.
APPEND line TO pattern.
_code ' mr_guidrasil->build( ).'.
_code ' ENDMETHOD.'.
LOOP AT lt_events INTO ls_event.
line = | METHOD h_{ ls_event-event }.|. APPEND line TO pattern.
_code ' CASE sender.'.
LOOP AT lt_events_c INTO ls_event_c
WHERE event = ls_event-event
AND control = ls_event-control.
line = | WHEN mr_{ ls_event_c-name }.|.
APPEND line TO pattern.
line = | MESSAGE i000(oo) WITH '{ ls_event_c-event }' '{ ls_event_c-name }'.|.
APPEND line TO pattern.
ENDLOOP.
_code ' ENDCASE.'.
_code ' ENDMETHOD.'.
ENDLOOP.
_code 'ENDCLASS.'.
_code 'DATA gr_main TYPE REF TO lcl_main.'.
*CLASS lcl_main DEFINITION.
* PUBLIC SECTION.
* DATA mr_guidrasil TYPE REF TO zcl_guidrasil_builder.
* DATA mr_text1 TYPE REF TO cl_gui_textedit.
* DATA mr_pic TYPE REF TO cl_gui_picture.
* METHODS constructor.
* METHODS handle_pic_click
* FOR EVENT picture_click OF cl_gui_picture
* IMPORTING sender.
*
*ENDCLASS.
*
*CLASS lcl_main IMPLEMENTATION.
* METHOD constructor.
* CREATE OBJECT mr_guidrasil
* EXPORTING
* iv_pname = 'GF'
* EXCEPTIONS
* OTHERS = 3.
* IF sy-subrc = 0.
* mr_guidrasil->build( ).
*
* mr_text1 ?= mr_guidrasil->get_object_by_name( 'INFOTEXT' ).
* mr_pic ?= mr_guidrasil->get_object_by_name( 'MEINHAUS' ).
* IF mr_pic IS BOUND.
* SET HANDLER handle_pic_click FOR mr_pic.
* ENDIF.
*
* ENDIF.
* ENDMETHOD.
* METHOD handle_pic_click.
* MESSAGE i000(oo) WITH 'BildKlick!!'.
* ENDMETHOD.
*
*ENDCLASS.
*
*DATA gr_guidrasil TYPE REF TO lcl_main.
ENDMETHOD.
METHOD get_event_pattern_plus.
pattern = zcl_guidrasil_code_creation=>create_code_complete(
it_controls = mt_controls
it_control_list = gt_control_list ).
ENDMETHOD.
METHOD get_menu_functions.
DATA ls_function TYPE stb_button.
DATA ls_ctls TYPE zguidrasil_ctls.
DATA ls_control_class LIKE LINE OF gt_control_classes.
CASE fcode.
WHEN '$CONTAINER'.
LOOP AT mt_ctls INTO ls_ctls WHERE type = 'C'.
* Funktionsliste aufbauen für CONTAINER aufbauen
READ TABLE gt_control_classes INTO ls_control_class WITH KEY classname = ls_ctls-classname.
IF sy-subrc = 0.
ls_function-function = ls_control_class-id.
ENDIF.
ls_function-quickinfo = ls_ctls-quickinfo.
APPEND ls_function TO it_functions.
ENDLOOP.
WHEN '$CONTROLS'.
LOOP AT mt_ctls INTO ls_ctls WHERE type = 'O'.
* Funktionsliste aufbauen für CONTROLS aufbauen
READ TABLE gt_control_classes INTO ls_control_class WITH KEY classname = ls_ctls-classname.
IF sy-subrc = 0.
ls_function-function = ls_control_class-id.
ENDIF.
ls_function-quickinfo = ls_ctls-quickinfo.
APPEND ls_function TO it_functions.
ENDLOOP.
WHEN '$CUSTOM'.
LOOP AT mt_ctls INTO ls_ctls WHERE type = 'Q'.
* Funktionsliste aufbauen für CONTROLS aufbauen
READ TABLE gt_control_classes INTO ls_control_class WITH KEY classname = ls_ctls-classname.
IF sy-subrc = 0.
ls_function-function = ls_control_class-id.
ENDIF.
ls_function-quickinfo = ls_ctls-quickinfo.
APPEND ls_function TO it_functions.
ENDLOOP.
ENDCASE.
ENDMETHOD.
METHOD get_name_button.
DATA ls_function TYPE stb_button.
CHECK ir_control IS BOUND.
* Funktionen zur Controlsteuerung
CLEAR ls_function.
ls_function-function = '$NAME'.
ls_function-icon = icon_interface.
ls_function-butn_type = cntb_btype_button.
ls_function-text = ir_control->gv_control_name.
APPEND ls_function TO ct_functions.
"==> will now only use "CTRLFUNC
** Funktion für die Änderung des Namens
* CLEAR ls_function.
* ls_function-function = '$ATTRIBUTES'.
* ls_function-icon = icon_system_favorites.
* ls_function-butn_type = cntb_btype_button.
* ls_function-quickinfo = 'Change Control Attributes'.
* APPEND ls_function TO ct_functions.
* Funktion für die control eigenen Änderungen
CLEAR ls_function.
ls_function-function = '$CTRLFUNC'.
ls_function-icon = icon_system_favorites.
ls_function-butn_type = cntb_btype_dropdown.
ls_function-quickinfo = 'Control attributes'(cta).
APPEND ls_function TO ct_functions.
zcl_guidrasil_tools=>todo( 'Wenn control keine Funktionen zur Verfügung stellt, darf der Knopf nicht angezeigt werden...' ).
ENDMETHOD.
METHOD get_object_by_name.
DATA ls_control_list TYPE zguidrasil_control_list.
READ TABLE mt_controls ASSIGNING FIELD-SYMBOL(<control>) WITH KEY control_name = name.
IF sy-subrc = 0.
READ TABLE gt_control_list INTO ls_control_list WITH KEY guid = <control>-object_guid.
IF sy-subrc = 0.
TRY .
object ?= ls_control_list-r_control_builder->get_control( ).
CATCH cx_sy_move_cast_error.
ENDTRY.
ENDIF.
ENDIF.
ENDMETHOD.
METHOD init_control_name.
DATA lv_name TYPE zguidrasil_container_name.
FIELD-SYMBOLS <idx> LIKE LINE OF mt_idx.
DATA ls_idx LIKE LINE OF mt_idx.
IF iv_text IS INITIAL.
lv_name = 'CONTROL'.
ELSE.
lv_name = iv_text.
ENDIF.
READ TABLE mt_idx WITH TABLE KEY name = lv_name ASSIGNING <idx>.
IF sy-subrc = 0.
ADD 1 TO <idx>-control_id.
CONCATENATE iv_text '_' <idx>-control_id INTO ev_name.
ELSE.
ls_idx-name = lv_name.
ls_idx-control_id = 1.
INSERT ls_idx INTO TABLE mt_idx.
CONCATENATE iv_text '_' ls_idx-control_id INTO ev_name.
ENDIF.
ENDMETHOD.
METHOD is_close_function_enabled.
DATA lr_parent_builder TYPE REF TO zcl_guidrasil_control_base.
DATA lrt_container TYPE cwb_container.
rv_enabled = abap_true.
* Vater fragen, ob er mehrere Container bereitstellt
lr_parent_builder = ir_wrapper->get_parent( ).
lrt_container = lr_parent_builder->get_container_list( ).
* wenn ja, dann können diese nicht einzeln geschlossen werden
IF lines( lrt_container ) > 1.
rv_enabled = abap_false.
ENDIF.
ENDMETHOD.
METHOD on_design_function_selected.
CASE fcode.
WHEN '$BOTTOM'.
* add_container( cl_gui_docking_container=>dock_at_bottom ).
WHEN '$LEFT'.
* add_container( cl_gui_docking_container=>dock_at_left ).
WHEN '$RIGHT'.
* add_container( cl_gui_docking_container=>dock_at_right ).
WHEN '$TOP'.
* add_container( cl_gui_docking_container=>dock_at_top ).
WHEN OTHERS.
EXIT.
ENDCASE.
ENDMETHOD.
METHOD save.
DATA lv_id TYPE i.
DATA lv_name TYPE string.
DATA ls_object TYPE zguidrasil_obj.
DATA lt_objects TYPE TABLE OF zguidrasil_obj.
DATA ls_control_admin TYPE gys_control_admin.
DATA ls_control_list TYPE zguidrasil_ctl_hierarchy_s.
DATA lt_control_list TYPE zguidrasil_ctl_hierarchy_t.
DATA lr_control_builder TYPE REF TO zcl_guidrasil_control_base.
DATA lr_obj TYPE REF TO cl_abap_classdescr.
DATA lr_docking TYPE REF TO cl_gui_docking_container.
DATA lr_splitter TYPE REF TO cl_gui_easy_splitter_container.
* anfangen bei den Basiscontrols
LOOP AT t_control_admin INTO ls_control_admin.
ls_control_list-control = ls_control_admin-control.
APPEND ls_control_list TO lt_control_list.
* Liste untergeordneter Controls ermitteln
CALL METHOD ls_control_admin-control->get_control_list
EXPORTING
ir_parent_control = ls_control_list-control
CHANGING
ct_control_list = lt_control_list.
* Einstellungen der Controls speichern
CALL METHOD ls_control_admin-control->save_all.
ENDLOOP.
ls_object-report = pname.
LOOP AT lt_control_list INTO ls_control_list.
CHECK ls_control_list-parent IS BOUND.
* Control
IF ls_control_list-control IS BOUND.
lr_obj ?= cl_abap_typedescr=>describe_by_object_ref( ls_control_list-control ).
lv_name = lr_obj->get_relative_name( ).
* alles außer Wrapper speichern
IF lv_name <> 'ZCL_GUIDRASIL_DESIGN_CONTAINER'.
ls_object-object = lv_name.
ls_object-object_guid = ls_control_list-control->gv_guid.
ls_object-control_name = ls_control_list-control->gv_control_name.
ls_object-parent_container = ls_control_list-control->mv_parent_container_name.
ENDIF.
ENDIF.
* ggf. Parent speichern
IF ls_control_list-parent IS BOUND.
lr_obj ?= cl_abap_typedescr=>describe_by_object_ref( ls_control_list-parent ).
lv_name = lr_obj->get_relative_name( ).
* alles außer Wrapper speichern
IF lv_name <> 'ZCL_GUIDRASIL_DESIGN_CONTAINER'.
ls_object-parent = lv_name.
ls_object-parent_guid = ls_control_list-parent->gv_guid.
ENDIF.
ENDIF.
* wenn sowohl Parent als auch Child gesetzt sind
IF ls_object-parent IS NOT INITIAL AND
ls_object-object IS NOT INITIAL.
ADD 1 TO lv_id.
ls_object-control_index = lv_id.
APPEND ls_object TO lt_objects.
CLEAR ls_object.
ls_object-report = pname.
ENDIF.
ENDLOOP.
** update_controls( ).
*
** anfangen bei den Basiscontrols
* LOOP AT t_control_admin INTO ls_control_admin.
** Einstellungen der Controls speichern
* CALL METHOD ls_control_admin-control->save_all.
* ENDLOOP.
*
*
*
* bisheriges Projekt löschen
DELETE FROM zguidrasil_obj WHERE report = pname.
* und neuen Stand speichern
IF lt_objects IS NOT INITIAL.
INSERT zguidrasil_obj FROM TABLE lt_objects.
ENDIF.
COMMIT WORK.
mt_controls = lt_objects.
MESSAGE s001.
ENDMETHOD.
METHOD set_current_control_id.
ADD 1 TO current_control_id.
IF control_id IS REQUESTED.
control_id = current_control_id.
ENDIF.
ENDMETHOD.
METHOD update_controls.
* DATA:
* lv_id TYPE i,
* lv_name TYPE string,
* ls_guidrasil TYPE /inw/guidrasil,
** lt_guidrasil TYPE TABLE OF /INW/guidrasil,
* ls_control_admin TYPE gys_control_admin,
* ls_control_list TYPE /inw/guidrasil_ctl_hierarchy,
* lt_control_list TYPE /inw/guidrasil_ctl_hierarchy_t,
* lr_control_builder TYPE REF TO /inw/guidrasil_control_base,
* lr_obj TYPE REF TO cl_abap_classdescr,
* lr_docking TYPE REF TO cl_gui_docking_container,
* lr_splitter TYPE REF TO cl_gui_easy_splitter_container.
*
**== Geht noch nicht, wenn neue Controls hinzukommen.
**== es muss erst gespeichert werden... :/
*
zcl_guidrasil_tools=>todo( ).
*
** anfangen bei den Basiscontrols
* LOOP AT t_control_admin INTO ls_control_admin.
*
* ls_control_list-control = ls_control_admin-control.
* APPEND ls_control_list TO lt_control_list.
*
** Liste untergeordneter Controls ermitteln
* CALL METHOD ls_control_admin-control->get_control_list
* EXPORTING
* ir_parent_control = ls_control_list-control
* CHANGING
* ct_control_list = lt_control_list.
*
** Einstellungen der Controls speichern
** CALL METHOD ls_control_admin-control->save_all.
*
* ENDLOOP.
*
** CLEAR ls_control_list.
** ls_control_list-guid = ls_control-r_control_builder->gv_guid.
** ls_control_list-r_control_builder = lr_control_builder.
** lr_container ?= lr_control_builder->gr_control.
** APPEND lr_container TO ls_control_list-t_container.
** INSERT ls_control_list INTO TABLE gt_control_list
** ASSIGNING <ls_control_list>.
*
* ls_guidrasil-report = pname.
*
* LOOP AT lt_control_list INTO ls_control_list.
*
*
* CHECK ls_control_list-parent IS BOUND.
*
** Control
* IF ls_control_list-control IS BOUND.
*
* lr_obj ?= cl_abap_typedescr=>describe_by_object_ref( ls_control_list-control ).
* lv_name = lr_obj->get_relative_name( ).
*
** alles außer Wrapper speichern
* IF lv_name <> 'ZCL_GUIDRASIL_DESIGN_CONTAINER'.
* ls_guidrasil-object = lv_name.
* ls_guidrasil-object_guid = ls_control_list-control->gv_guid.
* ls_guidrasil-control_name = ls_control_list-control->gv_control_name.
* ENDIF.
*
* ENDIF.
*
*
** ggf. Parent speichern
* IF ls_control_list-parent IS BOUND.
*
* lr_obj ?= cl_abap_typedescr=>describe_by_object_ref( ls_control_list-parent ).
* lv_name = lr_obj->get_relative_name( ).
*
** alles außer Wrapper speichern
* IF lv_name <> 'ZCL_GUIDRASIL_DESIGN_CONTAINER'.
* ls_guidrasil-parent = lv_name.
* ls_guidrasil-parent_guid = ls_control_list-parent->gv_guid.
* ENDIF.
*
* ENDIF.
*
*
** wenn sowohl Parent als auch Child gesetzt sind
* IF ls_guidrasil-parent IS NOT INITIAL AND
* ls_guidrasil-object IS NOT INITIAL.
*
* ADD 1 TO lv_id.
* ls_guidrasil-control_index = lv_id.
* APPEND ls_guidrasil TO t_controls.
*
* CLEAR ls_guidrasil.
* ls_guidrasil-report = pname.
*
* ENDIF.
*
* ENDLOOP.
ENDMETHOD.
METHOD zif_guidrasil_func_receiver~on_dropdown_clicked.
"functions
DATA lt_functions TYPE ttb_button.
DATA ls_function TYPE stb_button.
"Menu
DATA lr_text TYPE REF TO cl_gui_textedit.
DATA lv_icon TYPE icon_d.
DATA lv_disabled TYPE cua_active.
DATA lv_checked TYPE cua_active.
DATA lv_text TYPE gui_text.
DATA lx_menu TYPE REF TO cl_ctmenu.
DATA lx_menu_sub TYPE REF TO cl_ctmenu.
DATA lv_flag TYPE i.
lt_functions = get_menu_functions( fcode ).
IF lt_functions IS NOT INITIAL.
*== Create menu
CREATE OBJECT lx_menu.
*== Set functions for Container and Controls
LOOP AT lt_functions INTO ls_function.
lv_text = ls_function-quickinfo.
SHIFT ls_function-function LEFT DELETING LEADING space.
CALL METHOD lx_menu->add_function
EXPORTING
fcode = ls_function-function
disabled = lv_disabled
checked = lv_checked
text = lv_text.
ENDLOOP.
* create object lx_menu_sub.
* CALL METHOD lx_menu_sub->add_function
* EXPORTING
* fcode = 'SUB1'
* text = 'Sub-Menu-Test 1'.
*
* CALL METHOD lx_menu_sub->add_function
* EXPORTING
* fcode = 'SUB2'
* text = 'Sub-Menu-Test 2'.
*
* lx_menu->add_submenu( menu = lx_menu_sub
* text = 'Sub1' ).
*== set menu
r_toolbar->track_context_menu(
context_menu = lx_menu
posx = posx
posy = posy ).
ENDIF.
ENDMETHOD.
METHOD zif_guidrasil_func_receiver~on_function_selected.
DATA lr_container TYPE REF TO cl_gui_container.
DATA lr_wrapper TYPE REF TO zcl_guidrasil_design_container.
DATA lr_control_builder TYPE REF TO zcl_guidrasil_control_base.
DATA lr_parent TYPE REF TO zcl_guidrasil_control_base.
DATA lrt_container TYPE cwb_container.
DATA ls_function TYPE stb_button.
DATA lt_function TYPE ttb_button.
DATA lt_controls TYPE zguidrasil_control_t.
DATA ls_control_admin TYPE gys_control_admin.
DATA lv_string TYPE string.
DATA lt_pattern TYPE STANDARD TABLE OF string.
DATA lt_child_controls TYPE zguidrasil_control_t.
DATA lr_child_control TYPE REF TO zcl_guidrasil_control_base.
DATA ls_control_list LIKE LINE OF gt_control_list.
FIELD-SYMBOLS <string> TYPE string.
FIELD-SYMBOLS <control> TYPE REF TO zcl_guidrasil_control_base.
FIELD-SYMBOLS <ls_control_classes> TYPE gys_control_classes.
* bin ich gemeint oder ein anderes Objekt?
CHECK r_receiver = me.
CASE fcode.
* Control wurde ausgewählt für Pattern
WHEN '$SELECT'.
lr_wrapper ?= r_sender.
CALL METHOD lr_wrapper->get_children
IMPORTING
er_first_control = lr_control_builder.
IF lr_control_builder IS BOUND.
lt_pattern = lr_control_builder->get_pattern( ).
IF lt_pattern IS NOT INITIAL.
CLEAR lv_string.
LOOP AT lt_pattern ASSIGNING <string>.
CONCATENATE lv_string cl_abap_char_utilities=>cr_lf <string> INTO lv_string.
ENDLOOP.
CALL FUNCTION 'SRM_DISPLAY_TEXT'
EXPORTING
im_text = lv_string.
ENDIF.
ENDIF.
* Control löschen
WHEN '$DELETE'.
lr_wrapper ?= r_sender.
CALL METHOD lr_wrapper->get_children
IMPORTING
et_controls = lt_child_controls
er_first_control = lr_control_builder.
LOOP AT lt_child_controls INTO lr_child_control.
DELETE t_control_admin
WHERE parent = lr_child_control
OR control = lr_child_control.
ENDLOOP.
IF lr_control_builder IS BOUND.
lr_control_builder->destroy( ).
lr_wrapper->remove_child( ).
ENDIF.
CALL METHOD build_control_toolbar
EXPORTING
ir_wrapper = lr_wrapper.
* Basis-Container schließen
WHEN '$CLOSE'.
lr_wrapper ?= r_sender.
lr_parent = lr_wrapper->get_parent( ).
IF lr_parent IS BOUND.
lr_parent->destroy( ).
ENDIF.
WHEN '$NAME'.
DATA lv_answer TYPE c LENGTH 1.
DATA lv_name TYPE char30.
lr_wrapper ?= r_sender.
CALL METHOD lr_wrapper->get_children
IMPORTING
er_first_control = lr_control_builder
et_controls = lt_controls.
READ TABLE lt_controls ASSIGNING <control> INDEX 1.
IF sy-subrc = 0.
lv_name = <control>->gv_control_name.
TRANSLATE lv_name TO UPPER CASE.
CALL FUNCTION 'POPUP_TO_GET_VALUE'
EXPORTING
fieldname = 'CONTROL_NAME'
tabname = 'ZGUIDRASIL_OBJ'
titel = 'Name Of Control'
valuein = lv_name
IMPORTING
answer = lv_answer
valueout = lv_name
EXCEPTIONS
fieldname_not_found = 1
OTHERS = 2.
IF sy-subrc = 0 AND lv_answer IS INITIAL.
TRANSLATE lv_name TO UPPER CASE.
<control>->gv_control_name = lv_name.
ENDIF.
* Container vom Wrapper holen
lr_wrapper ?= r_sender.
* Einfüge-Toolbar in Editiertoolbar ändern
build_edit_toolbar(
ir_wrapper = lr_wrapper
ir_control_builder = <control> ).
ENDIF.
WHEN '$CTRLFUNC'.
lr_wrapper ?= r_sender.
CALL METHOD lr_wrapper->get_children
IMPORTING
er_first_control = lr_control_builder
et_controls = lt_controls.
READ TABLE lt_controls ASSIGNING <control> INDEX 1.
IF sy-subrc = 0.
<control>->view_attributes( iv_edit = 'X' ).
* Container vom Wrapper holen
lr_wrapper ?= r_sender.
* Einfüge-Toolbar in Editiertoolbar ändern
build_edit_toolbar(
ir_wrapper = lr_wrapper
ir_control_builder = <control> ).
ENDIF.
* Control hinzufügen
WHEN OTHERS.
CHECK fcode(1) <> '$'.
add_control_object( fcode = fcode
r_sender = r_sender
r_receiver = r_receiver
r_toolbar = r_toolbar ).
ENDCASE.
ENDMETHOD.
ENDCLASS.
| 29.608475 | 128 | 0.663175 |
f7d23bcb41d7c38126af5038428cf53fd2779ffb | 13,883 | abap | ABAP | src/legacy/#dmo#cx_flight_legacy30.clas.abap | SAP-Cloud-Platform/flight30 | 452f9c62a52d24fc8305e648dd238677b0c9812d | [
"BSD-Source-Code"
] | 1 | 2020-07-16T22:28:09.000Z | 2020-07-16T22:28:09.000Z | src/legacy/#dmo#cx_flight_legacy30.clas.abap | SAP-Cloud-Platform/flight30 | 452f9c62a52d24fc8305e648dd238677b0c9812d | [
"BSD-Source-Code"
] | null | null | null | src/legacy/#dmo#cx_flight_legacy30.clas.abap | SAP-Cloud-Platform/flight30 | 452f9c62a52d24fc8305e648dd238677b0c9812d | [
"BSD-Source-Code"
] | 1 | 2020-05-26T14:03:49.000Z | 2020-05-26T14:03:49.000Z | CLASS /dmo/cx_flight_legacy30 DEFINITION
PUBLIC
INHERITING FROM cx_static_check
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_t100_message .
CONSTANTS:
gc_msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
BEGIN OF agency_unkown,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '001',
attr1 TYPE scx_attrname VALUE 'MV_AGENCY_ID',
attr2 TYPE scx_attrname VALUE '',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF agency_unkown,
BEGIN OF customer_unkown,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '002',
attr1 TYPE scx_attrname VALUE 'MV_CUSTOMER_ID',
attr2 TYPE scx_attrname VALUE '',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF customer_unkown,
BEGIN OF connection_unknown,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '004',
attr1 TYPE scx_attrname VALUE 'MV_CARRIER_ID',
attr2 TYPE scx_attrname VALUE 'MV_CONNECTION_ID',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF connection_unknown ,
BEGIN OF carrier_unknown,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '005',
attr1 TYPE scx_attrname VALUE 'MV_CARRIER_ID',
attr2 TYPE scx_attrname VALUE '',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF carrier_unknown ,
BEGIN OF supplement_unknown,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '006',
attr1 TYPE scx_attrname VALUE 'MV_SUPPLEMENT_ID',
attr2 TYPE scx_attrname VALUE '',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF supplement_unknown,
BEGIN OF travel_status_invalid,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '007',
attr1 TYPE scx_attrname VALUE 'MV_STATUS',
attr2 TYPE scx_attrname VALUE '',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF travel_status_invalid,
BEGIN OF currency_unknown,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '008',
attr1 TYPE scx_attrname VALUE 'MV_CURRENCY_CODE',
attr2 TYPE scx_attrname VALUE '',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF currency_unknown,
BEGIN OF travel_no_key,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '009',
attr1 TYPE scx_attrname VALUE '',
attr2 TYPE scx_attrname VALUE '',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF travel_no_key,
BEGIN OF no_begin_date,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '013',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE '',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF no_begin_date,
BEGIN OF no_end_date,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '014',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE '',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF no_end_date,
BEGIN OF end_date_before_begin_date,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '015',
attr1 TYPE scx_attrname VALUE 'MV_BEGIN_DATE',
attr2 TYPE scx_attrname VALUE 'MV_END_DATE',
attr3 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr4 TYPE scx_attrname VALUE '',
END OF end_date_before_begin_date,
BEGIN OF travel_unknown,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '016',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE '',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF travel_unknown,
BEGIN OF booking_unknown,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '017',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE 'MV_BOOKING_ID',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF booking_unknown,
BEGIN OF booking_no_key,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '018',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE '',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF booking_no_key,
BEGIN OF booking_booking_date_invalid,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '019',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE 'MV_BOOKING_ID',
attr3 TYPE scx_attrname VALUE 'MV_BOOKING_DATE',
attr4 TYPE scx_attrname VALUE '',
END OF booking_booking_date_invalid,
BEGIN OF flight_unknown,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '020',
attr1 TYPE scx_attrname VALUE 'MV_CARRIER_ID',
attr2 TYPE scx_attrname VALUE 'MV_CONNECTION_ID',
attr3 TYPE scx_attrname VALUE 'MV_FLIGHT_DATE',
attr4 TYPE scx_attrname VALUE '',
END OF flight_unknown,
BEGIN OF booking_supplement_unknown,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '021',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE 'MV_BOOKING_ID',
attr3 TYPE scx_attrname VALUE 'MV_BOOKING_SUPPLEMENT_ID',
attr4 TYPE scx_attrname VALUE '',
END OF booking_supplement_unknown,
BEGIN OF booking_supplement_no_key,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '022',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE 'MV_BOOKING_ID',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF booking_supplement_no_key,
BEGIN OF booking_exists,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '023',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE 'MV_BOOKING_ID',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF booking_exists,
BEGIN OF booking_supplement_exists,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '024',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE 'MV_BOOKING_ID',
attr3 TYPE scx_attrname VALUE 'MV_BOOKING_SUPPLEMENT_ID',
attr4 TYPE scx_attrname VALUE '',
END OF booking_supplement_exists,
BEGIN OF travel_no_control,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '025',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE '',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF travel_no_control,
BEGIN OF booking_no_control,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '026',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE 'MV_BOOKING_ID',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF booking_no_control,
BEGIN OF booking_supplement_no_control,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '027',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE 'MV_BOOKING_ID',
attr3 TYPE scx_attrname VALUE 'MV_BOOKING_SUPPLEMENT_ID',
attr4 TYPE scx_attrname VALUE '',
END OF booking_supplement_no_control,
BEGIN OF booking_supplement_suppl_id_u,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '028',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE 'MV_BOOKING_ID',
attr3 TYPE scx_attrname VALUE 'MV_BOOKING_SUPPLEMENT_ID',
attr4 TYPE scx_attrname VALUE '',
END OF booking_supplement_suppl_id_u,
BEGIN OF booking_supplement_pri_curr_u,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '029',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE 'MV_BOOKING_ID',
attr3 TYPE scx_attrname VALUE 'MV_BOOKING_SUPPLEMENT_ID',
attr4 TYPE scx_attrname VALUE '',
END OF booking_supplement_pri_curr_u,
BEGIN OF booking_flight_u,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '030',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE 'MV_BOOKING_ID',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF booking_flight_u,
BEGIN OF booking_price_currency_u,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '031',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE 'MV_BOOKING_ID',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF booking_price_currency_u,
BEGIN OF travel_lock,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '032',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE 'MV_UNAME',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF travel_lock,
BEGIN OF travel_already_exists,
msgid TYPE symsgid VALUE '/DMO/CM_FLIGHT_LE_30',
msgno TYPE symsgno VALUE '033',
attr1 TYPE scx_attrname VALUE 'MV_TRAVEL_ID',
attr2 TYPE scx_attrname VALUE '',
attr3 TYPE scx_attrname VALUE '',
attr4 TYPE scx_attrname VALUE '',
END OF travel_already_exists.
METHODS constructor
IMPORTING
textid LIKE if_t100_message=>t100key OPTIONAL
previous LIKE previous OPTIONAL
travel_id TYPE /dmo/travel_id30 OPTIONAL
booking_id TYPE /dmo/booking_id30 OPTIONAL
booking_supplement_id TYPE /dmo/booking_supplement_id30 OPTIONAL
agency_id TYPE /dmo/agency_id30 OPTIONAL
customer_id TYPE /dmo/customer_id30 OPTIONAL
carrier_id TYPE /dmo/carrier30-carrier_id OPTIONAL
connection_id TYPE /dmo/connecti_30-connection_id OPTIONAL
supplement_id TYPE /dmo/suppleme_30-supplement_id OPTIONAL
begin_date TYPE /dmo/begin_date30 OPTIONAL
end_date TYPE /dmo/end_date30 OPTIONAL
booking_date TYPE /dmo/booking_date30 OPTIONAL
flight_date TYPE /dmo/flight_date30 OPTIONAL
status TYPE /dmo/travel_status30 OPTIONAL
currency_code TYPE /dmo/currency_code30 OPTIONAL
uname TYPE syuname OPTIONAL.
DATA: mv_travel_id TYPE /dmo/travel_id30,
mv_booking_id TYPE /dmo/booking_id30,
mv_booking_supplement_id TYPE /dmo/booking_supplement_id30,
mv_agency_id TYPE /dmo/agency_id30,
mv_customer_id TYPE /dmo/customer_id30,
mv_carrier_id TYPE /dmo/carrier30-carrier_id,
mv_connection_id TYPE /dmo/connecti_30-connection_id,
mv_supplement_id TYPE /dmo/suppleme_30-supplement_id,
mv_begin_date TYPE /dmo/begin_date30,
mv_end_date TYPE /dmo/end_date30,
mv_booking_date TYPE /dmo/booking_date30,
mv_flight_date TYPE /dmo/flight_date30,
mv_status TYPE /dmo/travel_status30,
mv_currency_code TYPE /dmo/currency_code30,
mv_uname TYPE syuname.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS /dmo/cx_flight_legacy30 IMPLEMENTATION.
METHOD constructor ##ADT_SUPPRESS_GENERATION.
super->constructor( previous = previous ).
me->mv_travel_id = travel_id.
me->mv_booking_id = booking_id.
me->mv_booking_supplement_id = booking_supplement_id.
me->mv_agency_id = agency_id.
me->mv_customer_id = customer_id.
me->mv_carrier_id = carrier_id.
me->mv_connection_id = connection_id.
me->mv_supplement_id = supplement_id.
me->mv_begin_date = begin_date.
me->mv_end_date = end_date.
me->mv_booking_date = booking_date.
me->mv_flight_date = flight_date.
me->mv_status = status.
me->mv_currency_code = currency_code.
me->mv_uname = uname.
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.
| 39.893678 | 74 | 0.655262 |
f7d4b9279778c9d92ab00a1d944412f9507d0e21 | 8,014 | abap | ABAP | test/templates_tests.abap | abapgit-bunkai/abap-markdown | 7faea905034814c9ef388c3f7d7666125782c775 | [
"MIT"
] | 38 | 2015-03-15T07:28:48.000Z | 2021-08-31T08:31:21.000Z | test/templates_tests.abap | abapgit-bunkai/abap-markdown | 7faea905034814c9ef388c3f7d7666125782c775 | [
"MIT"
] | 3 | 2017-01-14T10:38:46.000Z | 2018-09-26T19:05:06.000Z | test/templates_tests.abap | koemaeda/abap-markdown | 7faea905034814c9ef388c3f7d7666125782c775 | [
"MIT"
] | 14 | 2016-12-27T11:55:48.000Z | 2020-05-11T13:53:31.000Z | "!
"! Unit test class for the string template class
"!
class string_tests definition for testing.
"#AU Risk_Level Harmless
"#AU Duration Short
private section.
data: o_string type ref to lcl_string.
methods:
copying for testing.
endclass. "string_tests DEFINITION
*!
class string_tests implementation.
method copying.
create object o_string.
o_string->data = 'SpongeBob'.
data: lo_new type ref to lcl_string.
create object lo_new.
lo_new->copy( o_string ).
cl_aunit_assert=>assert_equals(
exp = 'SpongeBob'
act = lo_new->data
).
endmethod. "copying
endclass. "string_tests IMPLEMENTATION
"!
"! Unit test class for the string array template class
"!
class string_array_tests definition for testing.
"#AU Risk_Level Harmless
"#AU Duration Short
private section.
data: o_sa type ref to lcl_string_array.
methods:
copying for testing,
append for testing,
append_array for testing,
delete for testing,
find for testing.
endclass. "string_array_tests DEFINITION
*!
class string_array_tests implementation.
method copying.
create object o_sa.
o_sa->append( 'One' ).
o_sa->append( 'Two' ).
o_sa->append( 'Three' ).
data: lo_new type ref to lcl_string_array,
lv_conc type string.
create object lo_new.
lo_new->copy( o_sa ).
concatenate lines of lo_new->data into lv_conc.
cl_aunit_assert=>assert_equals(
exp = 'OneTwoThree'
act = lv_conc
).
endmethod. "copying
method append.
create object o_sa.
o_sa->append( 'One' ).
o_sa->append( 'Two' ).
o_sa->append( 'Three' ).
data: lv_conc type string.
concatenate lines of o_sa->data into lv_conc.
cl_aunit_assert=>assert_equals(
exp = 'OneTwoThree'
act = lv_conc
).
endmethod. "append
method append_array.
create object o_sa.
o_sa->append( 'One' ).
o_sa->append( 'Two' ).
o_sa->append( 'Three' ).
data: lo_new type ref to lcl_string_array,
lv_conc type string.
create object lo_new.
lo_new->append_array( o_sa ).
concatenate lines of lo_new->data into lv_conc.
cl_aunit_assert=>assert_equals(
exp = 'OneTwoThree'
act = lv_conc
).
endmethod. "append_array
method delete.
create object o_sa.
o_sa->append( 'One' ).
o_sa->append( 'Two' ).
o_sa->append( 'Three' ).
o_sa->delete( 'Two' ).
data: lv_conc type string.
concatenate lines of o_sa->data into lv_conc.
cl_aunit_assert=>assert_equals(
exp = 'OneThree'
act = lv_conc
).
endmethod. "delete
method find.
create object o_sa.
o_sa->append( 'One' ).
o_sa->append( 'Two' ).
o_sa->append( 'Three' ).
data: lv_index type i.
lv_index = o_sa->find( 'Two' ).
cl_aunit_assert=>assert_equals(
exp = 2
act = lv_index
).
endmethod. "find
endclass. "string_array_tests IMPLEMENTATION
"!
"! Unit test class for the hashmap template class
"!
class hashmap_tests definition for testing.
"#AU Risk_Level Harmless
"#AU Duration Short
private section.
data: o_hm type ref to lcl_hashmap.
methods:
copying for testing,
create_string_hashmap for testing,
create_array_hashmap for testing,
create_hashmap_hashmap for testing,
create_4_dimension_hashmap for testing,
new for testing,
get for testing,
set for testing,
exists for testing,
delete for testing.
endclass. "hashmap_tests DEFINITION
*!
class hashmap_tests implementation.
method copying.
create object o_hm
exporting
value_type = 'lcl_string'.
data: lo_value type ref to lcl_string.
lo_value ?= o_hm->new( 'IdxOne' ).
lo_value->data = 'ValueOne'.
data: lo_new type ref to lcl_hashmap.
create object lo_new
exporting
value_type = 'lcl_string'.
lo_new->copy( o_hm ).
lo_value ?= lo_new->get( 'IdxOne' ).
cl_aunit_assert=>assert_equals(
exp = 'ValueOne'
act = lo_value->data
).
endmethod. "copying
method create_string_hashmap.
data: lo_string type ref to lcl_string.
create object o_hm. "// default
lo_string ?= o_hm->new( 'IdxOne' ).
create object o_hm
exporting
value_type = 'lcl_string'.
lo_string ?= o_hm->new( 'IdxOne' ).
endmethod. "create_string_hashmap
method create_array_hashmap.
data: lo_array type ref to lcl_string_array.
create object o_hm
exporting
value_type = 'lcl_string_array'.
lo_array ?= o_hm->new( 'IdxOne' ).
endmethod. "create_array_hashmap
method create_hashmap_hashmap.
data: lo_hashmap type ref to lcl_hashmap.
create object o_hm
exporting
value_type = 'lcl_hashmap'.
lo_hashmap ?= o_hm->new( 'IdxOne' ).
endmethod. "create_hashmap_hashmap
method create_4_dimension_hashmap.
data: lo_hashmap1 type ref to lcl_hashmap,
lo_hashmap2 type ref to lcl_hashmap,
lo_hashmap3 type ref to lcl_hashmap.
create object o_hm
exporting
value_type = 'lcl_hashmap:lcl_hashmap:lcl_hashmap'.
lo_hashmap1 ?= o_hm->new( 'IdxOne' ).
lo_hashmap2 ?= lo_hashmap1->new( 'IdxTwo' ).
lo_hashmap3 ?= lo_hashmap2->new( 'IdxThree' ).
endmethod. "create_4_dimension_hashmap
method new.
data: lo_string type ref to lcl_string.
create object o_hm.
lo_string ?= o_hm->new( 'IdxOne' ).
cl_aunit_assert=>assert_not_initial( lo_string ).
lo_string->data = 'ValueOne'.
lo_string ?= o_hm->new( 'IdxOne' ).
cl_aunit_assert=>assert_initial( lo_string ).
endmethod. "new
method get.
data: lo_string type ref to lcl_string.
create object o_hm.
lo_string ?= o_hm->get( 'IdxOne' ).
cl_aunit_assert=>assert_not_initial( lo_string ).
lo_string->data = 'ValueOne'.
lo_string ?= o_hm->get( 'IdxOne' ).
cl_aunit_assert=>assert_not_initial( lo_string ).
cl_aunit_assert=>assert_equals(
exp = 'ValueOne'
act = lo_string->data
).
endmethod. "get
method set.
data: lo_str1 type ref to lcl_string,
lo_str2 type ref to lcl_string.
create object lo_str1.
lo_str1->data = 'ValueOne'.
create object o_hm.
lo_str2 ?= o_hm->get( 'IdxOne' ).
cl_aunit_assert=>assert_not_initial( lo_str2 ).
cl_aunit_assert=>assert_initial( lo_str2->data ).
o_hm->set(
key = 'IdxOne'
value = lo_str1
).
lo_str2 ?= o_hm->get( 'IdxOne' ).
cl_aunit_assert=>assert_not_initial( lo_str2 ).
cl_aunit_assert=>assert_equals(
exp = 'ValueOne'
act = lo_str2->data
).
endmethod. "set
method exists.
create object o_hm.
data: lv_exists type flag.
o_hm->new( 'IdxOne' ).
lv_exists = o_hm->exists( 'IdxOne' ).
cl_aunit_assert=>assert_not_initial( lv_exists ).
lv_exists = o_hm->exists( 'IdxTwo' ).
cl_aunit_assert=>assert_initial( lv_exists ).
endmethod. "exists
method delete.
create object o_hm.
o_hm->new( 'IdxOne' ).
o_hm->new( 'IdxTwo' ).
o_hm->new( 'IdxThree' ).
data: lv_exists type flag.
lv_exists = o_hm->exists( 'IdxTwo' ).
cl_aunit_assert=>assert_not_initial( lv_exists ).
o_hm->delete( 'IdxTwo' ).
lv_exists = o_hm->exists( 'IdxOne' ).
cl_aunit_assert=>assert_not_initial( lv_exists ).
lv_exists = o_hm->exists( 'IdxTwo' ).
cl_aunit_assert=>assert_initial( lv_exists ).
lv_exists = o_hm->exists( 'IdxThree' ).
cl_aunit_assert=>assert_not_initial( lv_exists ).
endmethod. "delete
endclass. "hashmap_tests IMPLEMENTATION
| 27.445205 | 63 | 0.626653 |
f7d57157806c56f64bc21f5bd85f997716b94c23 | 6,968 | abap | ABAP | src/http/zcl_abapgit_http.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 797 | 2015-02-06T15:38:41.000Z | 2020-09-23T02:57:02.000Z | src/http/zcl_abapgit_http.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 2,776 | 2015-01-13T03:59:55.000Z | 2020-09-23T21:46:34.000Z | src/http/zcl_abapgit_http.clas.abap | Manny27nyc/abapGit | dc51247e9b8c0c792193aba857ec31df3a82db4a | [
"MIT"
] | 499 | 2015-01-13T03:41:36.000Z | 2020-09-22T11:50:54.000Z | CLASS zcl_abapgit_http DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
CONSTANTS:
BEGIN OF c_scheme,
digest TYPE string VALUE 'Digest',
END OF c_scheme .
CLASS-METHODS get_agent
RETURNING
VALUE(rv_agent) TYPE string .
CLASS-METHODS create_by_url
IMPORTING
!iv_url TYPE string
!iv_service TYPE string
RETURNING
VALUE(ro_client) TYPE REF TO zcl_abapgit_http_client
RAISING
zcx_abapgit_exception .
PROTECTED SECTION.
CLASS-METHODS check_auth_requested
IMPORTING
!ii_client TYPE REF TO if_http_client
RETURNING
VALUE(rv_auth_requested) TYPE abap_bool
RAISING
zcx_abapgit_exception .
CLASS-METHODS is_local_system
IMPORTING
!iv_url TYPE string
RETURNING
VALUE(rv_bool) TYPE abap_bool .
CLASS-METHODS acquire_login_details
IMPORTING
!ii_client TYPE REF TO if_http_client
!io_client TYPE REF TO zcl_abapgit_http_client
!iv_url TYPE string
RETURNING
VALUE(rv_scheme) TYPE string
RAISING
zcx_abapgit_exception .
PRIVATE SECTION.
ENDCLASS.
CLASS zcl_abapgit_http IMPLEMENTATION.
METHOD acquire_login_details.
DATA: lv_default_user TYPE string,
lv_user TYPE string,
lv_pass TYPE string,
lo_digest TYPE REF TO zcl_abapgit_http_digest.
lv_default_user = zcl_abapgit_persistence_user=>get_instance( )->get_repo_login( iv_url ).
lv_user = lv_default_user.
zcl_abapgit_password_dialog=>popup(
EXPORTING
iv_repo_url = iv_url
CHANGING
cv_user = lv_user
cv_pass = lv_pass ).
IF lv_user IS INITIAL.
zcx_abapgit_exception=>raise( 'Unauthorized access. Check your credentials' ).
ENDIF.
IF lv_user <> lv_default_user.
zcl_abapgit_persistence_user=>get_instance( )->set_repo_login(
iv_url = iv_url
iv_login = lv_user ).
ENDIF.
rv_scheme = ii_client->response->get_header_field( 'www-authenticate' ).
FIND REGEX '^(\w+)' IN rv_scheme SUBMATCHES rv_scheme.
CASE rv_scheme.
WHEN c_scheme-digest.
* https://en.wikipedia.org/wiki/Digest_access_authentication
* e.g. used by https://www.gerritcodereview.com/
CREATE OBJECT lo_digest
EXPORTING
ii_client = ii_client
iv_username = lv_user
iv_password = lv_pass.
lo_digest->run( ii_client ).
io_client->set_digest( lo_digest ).
WHEN OTHERS.
* https://en.wikipedia.org/wiki/Basic_access_authentication
ii_client->authenticate(
username = lv_user
password = lv_pass ).
ENDCASE.
ENDMETHOD.
METHOD check_auth_requested.
DATA: lv_code TYPE i.
ii_client->response->get_status( IMPORTING code = lv_code ).
IF lv_code = 401.
rv_auth_requested = abap_true.
ENDIF.
ENDMETHOD.
METHOD create_by_url.
DATA: lv_uri TYPE string,
lv_scheme TYPE string,
li_client TYPE REF TO if_http_client,
lo_proxy_configuration TYPE REF TO zcl_abapgit_proxy_config,
lv_text TYPE string.
CREATE OBJECT lo_proxy_configuration.
li_client = zcl_abapgit_exit=>get_instance( )->create_http_client( iv_url ).
IF li_client IS NOT BOUND.
cl_http_client=>create_by_url(
EXPORTING
url = zcl_abapgit_url=>host( iv_url )
ssl_id = zcl_abapgit_exit=>get_instance( )->get_ssl_id( )
proxy_host = lo_proxy_configuration->get_proxy_url( iv_url )
proxy_service = lo_proxy_configuration->get_proxy_port( iv_url )
IMPORTING
client = li_client
EXCEPTIONS
argument_not_found = 1
plugin_not_active = 2
internal_error = 3
OTHERS = 4 ).
IF sy-subrc <> 0.
CASE sy-subrc.
WHEN 1.
" make sure:
" a) SSL is setup properly in STRUST
lv_text = 'HTTPS ARGUMENT_NOT_FOUND | STRUST/SSL Setup correct?'.
WHEN OTHERS.
lv_text = 'While creating HTTP Client'.
ENDCASE.
zcx_abapgit_exception=>raise( lv_text ).
ENDIF.
ENDIF.
IF lo_proxy_configuration->get_proxy_authentication( iv_url ) = abap_true.
zcl_abapgit_proxy_auth=>run( li_client ).
ENDIF.
CREATE OBJECT ro_client
EXPORTING
ii_client = li_client.
IF is_local_system( iv_url ) = abap_true.
li_client->send_sap_logon_ticket( ).
ENDIF.
li_client->request->set_cdata( '' ).
li_client->request->set_header_field(
name = '~request_method'
value = 'GET' ).
li_client->request->set_header_field(
name = 'user-agent'
value = get_agent( ) ).
lv_uri = zcl_abapgit_url=>path_name( iv_url ) &&
'/info/refs?service=git-' &&
iv_service &&
'-pack'.
li_client->request->set_header_field(
name = '~request_uri'
value = lv_uri ).
" Disable internal auth dialog (due to its unclarity)
li_client->propertytype_logon_popup = if_http_client=>co_disabled.
zcl_abapgit_login_manager=>load(
iv_uri = iv_url
ii_client = li_client ).
zcl_abapgit_exit=>get_instance( )->http_client(
iv_url = iv_url
ii_client = li_client ).
ro_client->send_receive( ).
IF check_auth_requested( li_client ) = abap_true.
lv_scheme = acquire_login_details( ii_client = li_client
io_client = ro_client
iv_url = iv_url ).
ro_client->send_receive( ).
ENDIF.
ro_client->check_http_200( ).
IF lv_scheme <> c_scheme-digest.
zcl_abapgit_login_manager=>save( iv_uri = iv_url
ii_client = li_client ).
ENDIF.
ENDMETHOD.
METHOD get_agent.
* bitbucket require agent prefix = "git/"
* also see https://github.com/abapGit/abapGit/issues/1432
rv_agent = |git/2.0 (abapGit { zif_abapgit_version=>c_abap_version })|.
ENDMETHOD.
METHOD is_local_system.
DATA: lv_host TYPE string,
lt_list TYPE zif_abapgit_definitions=>ty_string_tt,
li_exit TYPE REF TO zif_abapgit_exit.
cl_http_server=>get_location( IMPORTING host = lv_host ).
APPEND lv_host TO lt_list.
APPEND 'localhost' TO lt_list.
li_exit = zcl_abapgit_exit=>get_instance( ).
li_exit->change_local_host( CHANGING ct_hosts = lt_list ).
FIND REGEX 'https?://([^/^:]*)' IN iv_url SUBMATCHES lv_host.
READ TABLE lt_list WITH KEY table_line = lv_host TRANSPORTING NO FIELDS.
rv_bool = boolc( sy-subrc = 0 ).
ENDMETHOD.
ENDCLASS.
| 28.210526 | 94 | 0.621412 |
f7d5d04ce487bb467978cf4781309cc552558c72 | 365 | abap | ABAP | src/zamp_converter/zif_amp_converter.intf.abap | treee111/abap-metrics-provider | fda1f2e21a91f5a6c04d31462970a5a9a1c40f2e | [
"MIT"
] | 12 | 2021-01-22T08:36:08.000Z | 2021-11-19T22:43:53.000Z | src/zamp_converter/zif_amp_converter.intf.abap | treee111/abap-metrics-provider | fda1f2e21a91f5a6c04d31462970a5a9a1c40f2e | [
"MIT"
] | 163 | 2020-03-12T19:23:27.000Z | 2022-03-31T10:09:03.000Z | src/zamp_converter/zif_amp_converter.intf.abap | treee111/abap-metrics-provider | fda1f2e21a91f5a6c04d31462970a5a9a1c40f2e | [
"MIT"
] | 6 | 2021-01-21T08:07:09.000Z | 2021-03-10T08:18:21.000Z | INTERFACE zif_amp_converter
PUBLIC .
TYPES metric_store TYPE STANDARD TABLE OF zamp_store WITH KEY metric_scenario metric_group metric_key.
METHODS convert
IMPORTING
metric_store TYPE metric_store
EXPORTING
content_type TYPE string
RETURNING VALUE(converted_metrics) TYPE string.
ENDINTERFACE.
| 26.071429 | 104 | 0.70411 |
f7d84ba4880daf302211a148ce53871e3a25cbd7 | 3,876 | abap | ABAP | src/legacy/#dmo#flight_travel_api28.fugr.#dmo#flight_travel_calc_pri_28.abap | SAP-Cloud-Platform/flight28 | 35f184474aa1fb65d95f0c4d259dd1b64c051906 | [
"BSD-Source-Code"
] | null | null | null | src/legacy/#dmo#flight_travel_api28.fugr.#dmo#flight_travel_calc_pri_28.abap | SAP-Cloud-Platform/flight28 | 35f184474aa1fb65d95f0c4d259dd1b64c051906 | [
"BSD-Source-Code"
] | null | null | null | src/legacy/#dmo#flight_travel_api28.fugr.#dmo#flight_travel_calc_pri_28.abap | SAP-Cloud-Platform/flight28 | 35f184474aa1fb65d95f0c4d259dd1b64c051906 | [
"BSD-Source-Code"
] | null | null | null | "! <h1>Flight Price Engine</h1>
"!
"! If no parameters are applied, the price of every flight will be recalculated.
"!
"! @parameter it_flight | Set of Flights which should be recalculate prices
FUNCTION /DMO/FLIGHT_TRAVEL_CALC_PRI_28.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IT_FLIGHT) TYPE /DMO/IF_FLIGHT_LEGACY28=>TT_FLIGHT
*" OPTIONAL
*"----------------------------------------------------------------------
TYPES BEGIN OF ty_seats_occupied.
INCLUDE TYPE /dmo/flight28.
TYPES distance TYPE /dmo/connecti_28-distance.
TYPES distance_unit TYPE /dmo/connecti_28-distance_unit.
TYPES END OF ty_seats_occupied.
TYPES: tt_flight TYPE STANDARD TABLE OF /dmo/flight28 WITH KEY client carrier_id connection_id flight_date.
DATA: lt_seats_occupied TYPE TABLE OF ty_seats_occupied.
IF it_flight IS SUPPLIED.
SELECT FROM /dmo/booking28 AS booking
JOIN /dmo/connecti_28 AS connection
ON booking~carrier_id = connection~carrier_id
AND booking~connection_id = connection~connection_id
JOIN /dmo/flight28 AS flight
ON booking~carrier_id = flight~carrier_id
AND booking~connection_id = flight~connection_id
AND booking~flight_date = flight~flight_date
JOIN @it_flight AS t
ON booking~carrier_id = t~carrier_id
AND booking~connection_id = t~connection_id
FIELDS booking~carrier_id, booking~connection_id, booking~flight_date, COUNT(*) AS seats_occupied,
connection~distance, connection~distance_unit,
flight~currency_code, flight~plane_type_id, flight~seats_max, flight~seats_occupied
GROUP BY booking~carrier_id, booking~connection_id, booking~flight_date,
connection~distance, connection~distance_unit,
flight~currency_code, flight~plane_type_id, flight~seats_max, flight~seats_occupied
INTO CORRESPONDING FIELDS OF TABLE @lt_seats_occupied.
ELSE.
SELECT FROM /dmo/booking28 AS booking
JOIN /dmo/connecti_28 AS connection
ON booking~carrier_id = connection~carrier_id
AND booking~connection_id = connection~connection_id
JOIN /dmo/flight28 AS flight
ON booking~carrier_id = flight~carrier_id
AND booking~connection_id = flight~connection_id
AND booking~flight_date = flight~flight_date
FIELDS booking~carrier_id, booking~connection_id, booking~flight_date, COUNT(*) AS seats_occupied,
connection~distance, connection~distance_unit,
flight~currency_code, flight~plane_type_id, flight~seats_max, flight~seats_occupied
GROUP BY booking~carrier_id, booking~connection_id, booking~flight_date,
connection~distance, connection~distance_unit,
flight~currency_code, flight~plane_type_id, flight~seats_max, flight~seats_occupied
INTO CORRESPONDING FIELDS OF TABLE @lt_seats_occupied.
ENDIF.
LOOP AT lt_seats_occupied ASSIGNING FIELD-SYMBOL(<seats_occupied>).
<seats_occupied>-price = ( ( 3 * ( <seats_occupied>-seats_occupied * 100 DIV <seats_occupied>-seats_max ) ** 2 DIV 400 ) + 25 ) * <seats_occupied>-distance DIV 100.
ENDLOOP.
UPDATE /dmo/flight28
FROM TABLE @(
CORRESPONDING tt_flight(
lt_seats_occupied MAPPING
carrier_id = carrier_id
connection_id = connection_id
flight_date = flight_date
price = price
currency_code = currency_code
plane_type_id = plane_type_id
seats_max = seats_max
seats_occupied = seats_occupied
)
).
ENDFUNCTION.
| 48.45 | 168 | 0.651445 |
f7dc68199536b2560829e4ed0eaa1054402003b4 | 3,463 | abap | ABAP | src/ycl_advent2020_day04.clas.abap | g-back/abap-advent-2020 | 95e6015efc25f75c867ceadbac34fabc924c2928 | [
"MIT"
] | 3 | 2020-12-06T21:10:23.000Z | 2020-12-18T15:46:34.000Z | src/ycl_advent2020_day04.clas.abap | g-back/abap-advent-2020 | 95e6015efc25f75c867ceadbac34fabc924c2928 | [
"MIT"
] | null | null | null | src/ycl_advent2020_day04.clas.abap | g-back/abap-advent-2020 | 95e6015efc25f75c867ceadbac34fabc924c2928 | [
"MIT"
] | null | null | null | CLASS ycl_advent2020_day04 DEFINITION
PUBLIC
FINAL
CREATE PUBLIC.
PUBLIC SECTION.
METHODS solve_part_one
IMPORTING
input TYPE string_table
RETURNING
VALUE(result) TYPE int8.
METHODS solve_part_two
IMPORTING
input TYPE string_table
RETURNING
VALUE(result) TYPE int8.
PROTECTED SECTION.
PRIVATE SECTION.
DATA m_valid_eye_colors TYPE RANGE OF string.
METHODS is_passport_valid
IMPORTING
passport TYPE string
RETURNING
VALUE(result) TYPE string.
METHODS is_passport_valid_strict
IMPORTING
passport TYPE string
RETURNING
VALUE(result) TYPE abap_bool.
METHODS is_field_valid
IMPORTING
field TYPE string
RETURNING
VALUE(result) TYPE string.
ENDCLASS.
CLASS ycl_advent2020_day04 IMPLEMENTATION.
METHOD solve_part_one.
DATA(in) = input.
APPEND VALUE #( ) TO in.
DATA(passport) = ||.
LOOP AT in ASSIGNING FIELD-SYMBOL(<i>).
IF <i> = || AND passport <> ||.
IF is_passport_valid( passport ).
ADD 1 TO result.
ENDIF.
passport = ||.
CONTINUE.
ENDIF.
passport = |{ passport } { <i> }|.
ENDLOOP.
ENDMETHOD.
METHOD solve_part_two.
m_valid_eye_colors = VALUE #( sign = 'I' option = 'EQ'
( low = 'amb' ) ( low = 'blu' ) ( low = 'brn' ) ( low = 'gry' )
( low = 'grn' ) ( low = 'hzl' ) ( low = 'oth' )
).
DATA(in) = input.
APPEND VALUE #( ) TO in.
DATA(passport) = ||.
LOOP AT in ASSIGNING FIELD-SYMBOL(<i>).
IF <i> = || AND passport <> ||.
IF is_passport_valid_strict( passport ).
ADD 1 TO result.
ENDIF.
passport = ||.
CONTINUE.
ENDIF.
passport = |{ passport } { <i> }|.
ENDLOOP.
ENDMETHOD.
METHOD is_passport_valid.
SPLIT passport AT ' ' INTO TABLE DATA(fields).
DELETE fields WHERE table_line CP 'cid:*' OR table_line = ||.
result = xsdbool( lines( fields ) = 7 ).
ENDMETHOD.
METHOD is_passport_valid_strict.
SPLIT passport AT ' ' INTO TABLE DATA(fields).
DELETE fields WHERE table_line CP 'cid:*' OR table_line = ||.
IF lines( fields ) <> 7.
result = abap_false.
RETURN.
ENDIF.
LOOP AT fields ASSIGNING FIELD-SYMBOL(<f>).
IF NOT is_field_valid( field = <f> ).
result = abap_false.
RETURN.
ENDIF.
ENDLOOP.
result = abap_true.
ENDMETHOD.
METHOD is_field_valid.
SPLIT field AT ':' INTO DATA(key) DATA(value).
CASE key.
WHEN 'byr'.
result = xsdbool( value BETWEEN 1920 AND 2002 ).
WHEN 'iyr'.
result = xsdbool( value BETWEEN 2010 AND 2020 ).
WHEN 'eyr'.
result = xsdbool( value BETWEEN 2020 AND 2030 ).
WHEN 'hgt'.
IF value CP '*cm'.
result = xsdbool( substring( val = value len = strlen( value ) - 2 ) BETWEEN 150 AND 193 ).
ELSEIF value CP '*in'.
result = xsdbool( substring( val = value len = strlen( value ) - 2 ) BETWEEN 59 AND 76 ).
ELSE.
result = abap_false.
ENDIF.
WHEN 'hcl'.
result = cl_abap_matcher=>contains( pattern = '^#[0-9a-f]{6}' text = value ).
WHEN 'ecl'.
result = xsdbool( value IN m_valid_eye_colors ).
WHEN 'pid'.
result = xsdbool( strlen( value ) = 9 ).
ENDCASE.
ENDMETHOD.
ENDCLASS.
| 25.094203 | 101 | 0.577245 |
f7dec5690e7b990ee9972a5e7a505063c1c1039f | 6,589 | abap | ABAP | src/zrest/zrest_sched_batch_f01.prog.abap | hobru/ABAP-SDK-for-Azure | 7e0f2dbf484a87deacae3fe62e2d8fd6357a1d05 | [
"MIT"
] | null | null | null | src/zrest/zrest_sched_batch_f01.prog.abap | hobru/ABAP-SDK-for-Azure | 7e0f2dbf484a87deacae3fe62e2d8fd6357a1d05 | [
"MIT"
] | null | null | null | src/zrest/zrest_sched_batch_f01.prog.abap | hobru/ABAP-SDK-for-Azure | 7e0f2dbf484a87deacae3fe62e2d8fd6357a1d05 | [
"MIT"
] | 1 | 2018-12-10T10:55:02.000Z | 2018-12-10T10:55:02.000Z | *&---------------------------------------------------------------------*
*& Include ZREST_SCHED_BATCH_F01
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
* Modification History *
*----------------------------------------------------------------------*
* Date | USER ID | VSTF | Transport | Remarks *
*-----------|----------|--------|------------|-------------------------*
*Feb' 2018 | V-MYAL | 3019845| MP2K905030 | Initial development *
*05/17/2018 | V-MYAL | 3454161| MP2K905442 | More enhancements *
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*& Form GET_DATA
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM get_data CHANGING pv_job_count TYPE i
pv_rec_cnt TYPE i
pv_rc TYPE sy-subrc.
SELECT zmessageid INTO TABLE gt_zmessageid FROM zrest_monitor
WHERE zmessageid IN s_messag
AND zuser IN s_user
AND zexedate IN s_exedat
AND zexetime IN s_exetim
AND zretrydate IN s_retdat
AND zretrytime IN s_rettim
AND submit_date IN s_subdat
AND submit_time IN s_subtim
AND ( httpstatus LT 200 OR httpstatus GE 300 )
AND interface_id IN s_id
AND calling_program IN s_callpr
AND calling_method IN s_callme
AND businessid IN s_busine
AND status = ''.
IF sy-subrc NE 0.
pv_rc = 1.
ELSE.
DESCRIBE TABLE gt_zmessageid LINES pv_rec_cnt.
***Begin of MP2K905442
* pv_job_count = round( val = pv_rec_cnt / p_batch dec = 0 ).
*
* IF pv_job_count = 0.
* pv_job_count = 1.
* ENDIF.
pv_job_count = round( val = pv_rec_cnt / p_batch dec = 0 mode = '1' ).
***End of MP2K905442
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form CREATE_JOB
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* --> p1 text
* <-- p2 text
*----------------------------------------------------------------------*
FORM create_job .
DATA: lv_jobcnt TYPE tbtcjob-jobcount,
ls_print_params TYPE pri_params.
ADD 1 TO gv_jobno.
lv_jobcnt = gv_jobno.
***Target Server
CLEAR gv_targetserver.
IF NOT p_bsname IS INITIAL.
gv_targetserver = p_bsname.
ENDIF.
***Build Job Name
CONCATENATE 'REST_SCHED_SUB'
sy-datum
sy-uzeit
'_'
gv_jobno
INTO gv_jobname.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = gv_jobname
IMPORTING
jobcount = lv_jobcnt
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE i026(bt) WITH gv_jobname .
ELSE.
* SUBMIT zrest_scheduler WITH s_messag IN gtr_zmessageid "MP2K905442
SUBMIT zrest_scheduler_telemetry WITH s_messag IN gtr_zmessageid "MP2K905442
TO SAP-SPOOL
SPOOL PARAMETERS ls_print_params
WITHOUT SPOOL DYNPRO
VIA JOB gv_jobname NUMBER lv_jobcnt
AND RETURN.
IF sy-subrc EQ 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = lv_jobcnt
jobname = gv_jobname
strtimmed = 'X'
targetserver = gv_targetserver
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
invalid_target = 8
OTHERS = 9.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
MESSAGE s000(55) WITH gv_msg_cnt text-004 gv_jobno gv_jobname.
ENDIF.
ELSE.
ENDIF.
ENDIF.
ENDFORM.
*&---------------------------------------------------------------------*
*& Form F4_BATCH_SERVER
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* <--P_P_BSNAME text
*----------------------------------------------------------------------*
FORM f4_batch_server CHANGING pv_bsname TYPE bpsrvgrp.
DATA: lt_list TYPE TABLE OF msxxlist,
ls_list TYPE msxxlist,
lt_tsrvgrp TYPE STANDARD TABLE OF tsrvgrp,
ls_tsrvgrp TYPE tsrvgrp,
lv_sel_server LIKE tbtcjob-execserver..
DATA BEGIN OF lt_sys_list OCCURS 10.
INCLUDE STRUCTURE btctgtsrvr.
DATA END OF lt_sys_list.
DATA BEGIN OF field_tbl OCCURS 10.
INCLUDE STRUCTURE help_value.
DATA END OF field_tbl.
CALL FUNCTION 'TH_SERVER_LIST'
EXPORTING
services = '08'
TABLES
list = lt_list
EXCEPTIONS
no_server_list = 1
OTHERS = 2.
IF sy-subrc <> 0.
EXIT.
ENDIF.
***Get custom server groups if any
SELECT * FROM tsrvgrp INTO TABLE lt_tsrvgrp.
LOOP AT lt_list INTO ls_list.
lt_sys_list-srvname = ls_list-name.
APPEND lt_sys_list.
ENDLOOP.
LOOP AT lt_tsrvgrp INTO ls_tsrvgrp.
lt_sys_list-srvname = ls_tsrvgrp-grpname.
APPEND lt_sys_list.
ENDLOOP.
FREE field_tbl.
field_tbl-tabname = 'BTCTGTSRVR'.
field_tbl-fieldname = 'SRVNAME'.
field_tbl-selectflag = 'X'.
APPEND field_tbl.
* read batch server
CALL FUNCTION 'F4TOOL_F4FUNCTION_BRIDGE'
EXPORTING
tabname = field_tbl-tabname
fieldname = field_tbl-fieldname
display_only = space
IMPORTING
selected_value = lv_sel_server
TABLES
value_tab = lt_sys_list
fields_tab = field_tbl.
pv_bsname = lv_sel_server.
ENDFORM.
| 30.646512 | 81 | 0.458947 |
f7e44692022dce243cf1ba9ff464f330f5cfdc4c | 7,381 | abap | ABAP | lbn-gtt-template-ts/abap/zsrc/zsst_gtt.fugr.lzsst_gttd00.abap | C5310110/logistics-business-network-gtt-samples | dddcbb5e50f67af627588448c0349cd5f92a1360 | [
"Apache-2.0"
] | null | null | null | lbn-gtt-template-ts/abap/zsrc/zsst_gtt.fugr.lzsst_gttd00.abap | C5310110/logistics-business-network-gtt-samples | dddcbb5e50f67af627588448c0349cd5f92a1360 | [
"Apache-2.0"
] | null | null | null | lbn-gtt-template-ts/abap/zsrc/zsst_gtt.fugr.lzsst_gttd00.abap | C5310110/logistics-business-network-gtt-samples | dddcbb5e50f67af627588448c0349cd5f92a1360 | [
"Apache-2.0"
] | null | null | null | *&---------------------------------------------------------------------*
*& Local interfaces definition - General + Transaction Processing
*&---------------------------------------------------------------------*
INTERFACE lif_factory DEFERRED.
INTERFACE lif_ef_types.
TYPES: ts_control_data TYPE /saptrx/control_data,
tt_control_data TYPE STANDARD TABLE OF ts_control_data.
TYPES: BEGIN OF ts_enh_track_id_data,
key TYPE char33.
INCLUDE TYPE /saptrx/track_id_data.
TYPES: END OF ts_enh_track_id_data.
TYPES: tt_enh_track_id_data TYPE STANDARD TABLE OF ts_enh_track_id_data.
TYPES: ts_track_id_data TYPE /saptrx/track_id_data,
tt_track_id_data TYPE STANDARD TABLE OF ts_track_id_data.
TYPES: ts_strucdatadef TYPE /saptrx/strucdatadef,
tt_strucdatadef TYPE STANDARD TABLE OF ts_strucdatadef.
TYPES: ts_expeventdata TYPE /saptrx/exp_events,
tt_expeventdata TYPE STANDARD TABLE OF ts_expeventdata.
TYPES: ts_measrmntdata TYPE /saptrx/measr_data,
tt_measrmntdata TYPE STANDARD TABLE OF ts_measrmntdata.
TYPES: ts_infodata TYPE /saptrx/info_data,
tt_infodata TYPE STANDARD TABLE OF ts_infodata.
TYPES: BEGIN OF ts_definition,
maintab TYPE /saptrx/strucdatadef,
mastertab TYPE /saptrx/strucdatadef,
END OF ts_definition.
TYPES: tt_tracklocation TYPE STANDARD TABLE OF /saptrx/bapi_evm_locationid.
TYPES: tt_trackingheader TYPE STANDARD TABLE OF /saptrx/bapi_evm_header.
TYPES: tv_condition TYPE sy-binpt.
TYPES: BEGIN OF ts_stop_points,
stop_id TYPE string,
log_locid TYPE /scmtms/location_id,
seq_num TYPE /scmtms/seq_num,
END OF ts_stop_points.
TYPES: tt_stop_points TYPE STANDARD TABLE OF ts_stop_points .
ENDINTERFACE.
"!Extractor Function Constants
INTERFACE lif_ef_constants.
CONSTANTS: BEGIN OF cs_system_fields,
actual_bisiness_timezone TYPE /saptrx/paramname VALUE 'ACTUAL_BUSINESS_TIMEZONE',
actual_bisiness_datetime TYPE /saptrx/paramname VALUE 'ACTUAL_BUSINESS_DATETIME',
actual_technical_timezone TYPE /saptrx/paramname VALUE 'ACTUAL_TECHNICAL_TIMEZONE',
actual_technical_datetime TYPE /saptrx/paramname VALUE 'ACTUAL_TECHNICAL_DATETIME',
END OF cs_system_fields.
CONSTANTS: BEGIN OF cs_errors,
wrong_parameter TYPE sotr_conc VALUE '1216f03004ce11ebbf450050c2490048',
cdata_determination TYPE sotr_conc VALUE '1216f03004ce11ebbf460050c2490048',
table_determination TYPE sotr_conc VALUE '1216f03004ce11ebbf470050c2490048',
stop_processing TYPE sotr_conc VALUE '1216f03004ce11ebbf480050c2490048',
END OF cs_errors.
CONSTANTS: BEGIN OF cs_condition,
true TYPE lif_ef_types=>tv_condition VALUE 'T',
false TYPE lif_ef_types=>tv_condition VALUE 'F',
END OF cs_condition.
CONSTANTS: BEGIN OF cs_change_mode,
insert TYPE updkz_d VALUE 'I',
update TYPE updkz_d VALUE 'U',
delete TYPE updkz_d VALUE 'D',
undefined TYPE updkz_d VALUE 'T',
END OF cs_change_mode.
CONSTANTS: cv_aot TYPE string VALUE 'AOT'.
CONSTANTS: cv_max_end_date TYPE /saptrx/tid_end_date_tsloc VALUE '099991231000000'.
ENDINTERFACE.
INTERFACE lif_ef_parameters.
METHODS get_appsys
RETURNING
VALUE(rv_appsys) TYPE /saptrx/applsystem.
METHODS get_app_obj_types
RETURNING
VALUE(rs_app_obj_types) TYPE /saptrx/aotypes.
METHODS get_app_objects
RETURNING
VALUE(rr_data) TYPE REF TO data.
METHODS get_appl_table
IMPORTING
iv_tabledef TYPE clike
RETURNING
VALUE(rr_data) TYPE REF TO data
RAISING
cx_udm_message.
ENDINTERFACE.
INTERFACE lif_bo_reader.
METHODS check_relevance
IMPORTING
is_app_object TYPE trxas_appobj_ctab_wa
RETURNING
VALUE(rv_result) TYPE lif_ef_types=>tv_condition
RAISING
cx_udm_message.
METHODS get_data
IMPORTING
is_app_object TYPE trxas_appobj_ctab_wa
iv_old_data TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(rr_data) TYPE REF TO data
RAISING
cx_udm_message.
METHODS get_mapping_structure
RETURNING
VALUE(rr_data) TYPE REF TO data.
METHODS get_track_id_data
IMPORTING
is_app_object TYPE trxas_appobj_ctab_wa
EXPORTING
et_track_id_data TYPE lif_ef_types=>tt_track_id_data
RAISING
cx_udm_message.
ENDINTERFACE.
INTERFACE lif_ef_processor.
METHODS check_app_objects
RAISING
cx_udm_message.
METHODS check_relevance
IMPORTING
io_bo_factory TYPE REF TO lif_factory
RETURNING
VALUE(rv_result) TYPE lif_ef_types=>tv_condition
RAISING
cx_udm_message.
METHODS get_control_data
IMPORTING
io_bo_factory TYPE REF TO lif_factory
CHANGING
ct_control_data TYPE lif_ef_types=>tt_control_data
RAISING
cx_udm_message.
METHODS get_planned_events
IMPORTING
io_factory TYPE REF TO lif_factory
CHANGING
ct_expeventdata TYPE lif_ef_types=>tt_expeventdata
ct_measrmntdata TYPE lif_ef_types=>tt_measrmntdata
ct_infodata TYPE lif_ef_types=>tt_infodata
RAISING
cx_udm_message.
METHODS get_track_id_data
IMPORTING
io_bo_factory TYPE REF TO lif_factory
EXPORTING
et_track_id_data TYPE lif_ef_types=>tt_track_id_data
RAISING
cx_udm_message.
ENDINTERFACE.
"!Planned Event Filler
INTERFACE lif_pe_filler.
METHODS get_planed_events
IMPORTING
is_app_objects TYPE trxas_appobj_ctab_wa
CHANGING
ct_expeventdata TYPE lif_ef_types=>tt_expeventdata
ct_measrmntdata TYPE lif_ef_types=>tt_measrmntdata
ct_infodata TYPE lif_ef_types=>tt_infodata
RAISING
cx_udm_message.
ENDINTERFACE.
INTERFACE lif_factory.
METHODS get_bo_reader
IMPORTING
is_appl_object TYPE trxas_appobj_ctab_wa
io_ef_parameters TYPE REF TO lif_ef_parameters
RETURNING
VALUE(ro_bo_reader) TYPE REF TO lif_bo_reader
RAISING
cx_udm_message.
METHODS get_ef_parameters
IMPORTING
iv_appsys TYPE /saptrx/applsystem
is_app_obj_types TYPE /saptrx/aotypes
it_all_appl_tables TYPE trxas_tabcontainer
it_app_type_cntl_tabs TYPE trxas_apptype_tabs OPTIONAL
it_app_objects TYPE trxas_appobj_ctabs
RETURNING
VALUE(ro_ef_parameters) TYPE REF TO lif_ef_parameters.
METHODS get_ef_processor
IMPORTING
is_definition TYPE lif_ef_types=>ts_definition
io_bo_factory TYPE REF TO lif_factory
iv_appsys TYPE /saptrx/applsystem
is_app_obj_types TYPE /saptrx/aotypes
it_all_appl_tables TYPE trxas_tabcontainer
it_app_type_cntl_tabs TYPE trxas_apptype_tabs
it_app_objects TYPE trxas_appobj_ctabs
RETURNING
VALUE(ro_ef_processor) TYPE REF TO lif_ef_processor.
METHODS get_pe_filler
IMPORTING
is_appl_object TYPE trxas_appobj_ctab_wa
io_ef_parameters TYPE REF TO lif_ef_parameters
RETURNING
VALUE(ro_pe_filler) TYPE REF TO lif_pe_filler
RAISING
cx_udm_message.
ENDINTERFACE.
| 31.542735 | 98 | 0.706137 |
f7ea2b830213a93139228794b057653d6139cf31 | 4,746 | abap | ABAP | src/checks/zcl_aoc_check_51.clas.testclasses.abap | DennstedtB/abapOpenChecks | 551dad876ce09d6b7cca32dd166827f1cdbf33e5 | [
"MIT"
] | 199 | 2015-02-17T07:08:01.000Z | 2022-03-23T09:50:05.000Z | src/checks/zcl_aoc_check_51.clas.testclasses.abap | DennstedtB/abapOpenChecks | 551dad876ce09d6b7cca32dd166827f1cdbf33e5 | [
"MIT"
] | 769 | 2015-01-03T07:09:11.000Z | 2022-03-21T11:59:53.000Z | src/checks/zcl_aoc_check_51.clas.testclasses.abap | DennstedtB/abapOpenChecks | 551dad876ce09d6b7cca32dd166827f1cdbf33e5 | [
"MIT"
] | 109 | 2015-03-09T10:22:34.000Z | 2022-03-08T08:47:41.000Z | CLASS ltcl_test DEFINITION DEFERRED.
CLASS zcl_aoc_check_51 DEFINITION LOCAL FRIENDS ltcl_test.
*----------------------------------------------------------------------*
* 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_51.
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,
test001_10 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 'SELECT SINGLE bname FROM usr02 INTO lv_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.
* ===========
IF mo_check->supported( ) = abap_false.
RETURN.
ENDIF.
_code 'SELECT SINGLE bname FROM usr02 INTO @lv_bname.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result-code ).
ENDMETHOD.
METHOD test001_03.
* ===========
IF mo_check->supported( ) = abap_false.
RETURN.
ENDIF.
_code 'SELECT SINGLE foo bar INTO (@<ls_data>-foo, @<ls_data>-bar) FROM zfoo.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result-code ).
ENDMETHOD.
METHOD test001_04.
* ===========
IF mo_check->supported( ) = abap_false.
RETURN.
ENDIF.
_code 'SELECT * FROM usr02 INTO TABLE lt_data.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD.
METHOD test001_05.
* ===========
IF mo_check->supported( ) = abap_false.
RETURN.
ENDIF.
_code 'SELECT * FROM usr02 INTO TABLE @lt_data.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result-code ).
ENDMETHOD.
METHOD test001_06.
* ===========
IF mo_check->supported( ) = abap_false.
RETURN.
ENDIF.
_code 'SELECT SINGLE foo bar INTO (<ls_data>-foo, <ls_data>-bar) FROM zfoo.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_equals( exp = '001'
act = ms_result-code ).
ENDMETHOD.
METHOD test001_07.
* ===========
IF mo_check->supported( ) = abap_false.
RETURN.
ENDIF.
_code 'SELECTION-SCREEN END OF BLOCK b1.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result-code ).
ENDMETHOD.
METHOD test001_08.
* ===========
IF mo_check->supported( ) = abap_false.
RETURN.
ENDIF.
_code 'SELECT * FROM usr02 APPENDING CORRESPONDING FIELDS OF TABLE @lt_data.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result-code ).
ENDMETHOD.
METHOD test001_09.
* ===========
IF mo_check->supported( ) = abap_false.
RETURN.
ENDIF.
_code 'SELECT * FROM usr02 APPENDING TABLE @lt_data.'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result-code ).
ENDMETHOD.
METHOD test001_10.
* ===========
IF mo_check->supported( ) = abap_false.
RETURN.
ENDIF.
_code 'SELECT SINGLE bname FROM usr02 INTO (@lv_bname).'.
ms_result = zcl_aoc_unit_test=>check( mt_code ).
cl_abap_unit_assert=>assert_initial( ms_result-code ).
ENDMETHOD.
ENDCLASS. "lcl_Test
| 22.817308 | 83 | 0.570375 |
f7eb47e76e4e4f4987fbc418322b4dbe3f968416 | 1,756 | abap | ABAP | src/zadu_transport_update.fugr.zadu_transport_update_imp_time.abap | jrodriguez-rc/abap-dev-tools | 6cbbd40e3739db038a878cdd1093dfe0cb9e406f | [
"MIT"
] | 35 | 2020-08-27T10:36:55.000Z | 2022-02-14T07:56:52.000Z | src/zadu_transport_update.fugr.zadu_transport_update_imp_time.abap | jrodriguez-rc/abap-dev-tools | 6cbbd40e3739db038a878cdd1093dfe0cb9e406f | [
"MIT"
] | 2 | 2020-11-01T09:53:44.000Z | 2022-02-10T08:10:53.000Z | src/zadu_transport_update.fugr.zadu_transport_update_imp_time.abap | jrodriguez-rc/abap-dev-tools | 6cbbd40e3739db038a878cdd1093dfe0cb9e406f | [
"MIT"
] | 6 | 2020-11-03T08:29:47.000Z | 2021-09-11T15:24:05.000Z | FUNCTION zadu_transport_update_imp_time.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(IMPORT_TIME_UPDATES) TYPE ZADU_T_CHKTR_IMTIM_UPDATE
*"----------------------------------------------------------------------
DATA: database_data TYPE zadu_chktr_imtim.
LOOP AT import_time_updates REFERENCE INTO DATA(import_time_update).
database_data = import_time_update->*.
CASE import_time_update->crud_ind.
WHEN zif_adu_constants=>crud-create.
INSERT zadu_chktr_imtim FROM @database_data.
IF sy-subrc <> 0.
MESSAGE ID zcx_adu_check_transport=>error_insert_table-msgid
TYPE 'X'
NUMBER zcx_adu_check_transport=>error_insert_table-msgno
WITH |{ database_data-run_code }{ database_data-sequence }| 'ZADU_CHKTR_IMTIM'.
ENDIF.
WHEN zif_adu_constants=>crud-update.
UPDATE zadu_chktr_imtim FROM @database_data.
IF sy-subrc <> 0.
MESSAGE ID zcx_adu_check_transport=>error_update_table-msgid
TYPE 'X'
NUMBER zcx_adu_check_transport=>error_update_table-msgno
WITH |{ database_data-run_code }{ database_data-sequence }| 'ZADU_CHKTR_IMTIM'.
ENDIF.
WHEN zif_adu_constants=>crud-delete.
DELETE zadu_chktr_imtim FROM @database_data.
IF sy-subrc <> 0.
MESSAGE ID zcx_adu_check_transport=>error_delete_table-msgid
TYPE 'X'
NUMBER zcx_adu_check_transport=>error_delete_table-msgno
WITH |{ database_data-run_code }{ database_data-sequence }| 'ZADU_CHKTR_IMTIM'.
ENDIF.
ENDCASE.
ENDLOOP.
ENDFUNCTION.
| 37.361702 | 97 | 0.611617 |
f7eb505ac42dcb2cc00024d05cfbc486d535478f | 8,766 | abap | ABAP | src/rest/cl_request.abap | lezamad/OOP-Library | ae74ea420b1768262b5aee0718e6c613ed06e5fa | [
"Unlicense",
"MIT"
] | 1 | 2020-06-24T22:15:05.000Z | 2020-06-24T22:15:05.000Z | src/rest/cl_request.abap | lezamad/OOP-Library | ae74ea420b1768262b5aee0718e6c613ed06e5fa | [
"Unlicense",
"MIT"
] | null | null | null | src/rest/cl_request.abap | lezamad/OOP-Library | ae74ea420b1768262b5aee0718e6c613ed06e5fa | [
"Unlicense",
"MIT"
] | null | null | null | class /OOP/CL_REQUEST definition
public
inheriting from /OOP/CL_OBJECT
final
create public .
public section.
*"* public components of class /OOP/CL_REQUEST
*"* do not include other source files here!!!
interfaces /OOP/IF_REQUEST .
aliases GET_BODY_BINARY
for /OOP/IF_REQUEST~GET_BODY_BINARY .
aliases GET_BODY_TEXT
for /OOP/IF_REQUEST~GET_BODY_TEXT .
aliases GET_CONTENT_TYPE
for /OOP/IF_REQUEST~GET_CONTENT_TYPE .
aliases GET_HEADER
for /OOP/IF_REQUEST~GET_HEADER .
aliases GET_METHOD
for /OOP/IF_REQUEST~GET_METHOD .
aliases GET_PARAMETER
for /OOP/IF_REQUEST~GET_PARAMETER .
aliases GET_RAW_MESSAGE
for /OOP/IF_REQUEST~GET_RAW_MESSAGE .
aliases GET_REQUESTURI
for /OOP/IF_REQUEST~GET_REQUESTURI .
aliases LIST_HEADERS
for /OOP/IF_REQUEST~LIST_HEADERS .
aliases LIST_PARAMETERS
for /OOP/IF_REQUEST~LIST_PARAMETERS .
methods CONSTRUCTOR
importing
!REQUEST type ref to IF_HTTP_REQUEST .
protected section.
*"* protected components of class /OOP/CL_REQUEST
*"* do not include other source files here!!!
private section.
*"* private components of class /OOP/CL_REQUEST
*"* do not include other source files here!!!
data REQUEST type ref to IF_HTTP_REQUEST .
ENDCLASS.
CLASS /OOP/CL_REQUEST IMPLEMENTATION.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method /OOP/CL_REQUEST->/OOP/IF_REQUEST~GET_BODY_BINARY
* +-------------------------------------------------------------------------------------------------+
* | [<-()] RETURNING TYPE XSTRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method /oop/if_request~get_body_binary.
*/**
* Retrieves the body of the request as binary data.
*/
returning = me->request->get_data( ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method /OOP/CL_REQUEST->/OOP/IF_REQUEST~GET_BODY_TEXT
* +-------------------------------------------------------------------------------------------------+
* | [<-()] RETURNING TYPE STRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method /oop/if_request~get_body_text.
*/**
* Retrieves the body of the request as a string.
*/
returning = me->request->get_cdata( ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method /OOP/CL_REQUEST->/OOP/IF_REQUEST~GET_CONTENT_TYPE
* +-------------------------------------------------------------------------------------------------+
* | [<-()] RETURNING TYPE STRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method /oop/if_request~get_content_type.
*/**
* Returns the MIME type of the body of the request, or null if the type is not known.
*/
returning = me->request->get_content_type( ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method /OOP/CL_REQUEST->/OOP/IF_REQUEST~GET_HEADER
* +-------------------------------------------------------------------------------------------------+
* | [--->] NAME TYPE STRING
* | [<-()] RETURNING TYPE STRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method /oop/if_request~get_header.
*/**
* Returns the value of the specified request header
* as a string. If the request did not include a header
* of the specified name, this method returns null.
*/
returning = me->request->get_header_field( name ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method /OOP/CL_REQUEST->/OOP/IF_REQUEST~GET_METHOD
* +-------------------------------------------------------------------------------------------------+
* | [<-()] RETURNING TYPE STRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method /oop/if_request~get_method.
*/**
* Returns the name of the HTTP method with which this request was made,
* for example, GET, POST, or PUT.
*/
returning = me->request->if_http_entity~get_header_field( '~request_method' ).
" returning = me->request->get_method( ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method /OOP/CL_REQUEST->/OOP/IF_REQUEST~GET_PARAMETER
* +-------------------------------------------------------------------------------------------------+
* | [--->] NAME TYPE STRING
* | [<-()] RETURNING TYPE STRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method /oop/if_request~get_parameter.
*/**
* Returns the value of a request parameter as a String,
* or null if the parameter does not exist.
* Request parameters are extra information sent with the request.
*/
returning = me->request->get_form_field_cs( name ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method /OOP/CL_REQUEST->/OOP/IF_REQUEST~GET_RAW_MESSAGE
* +-------------------------------------------------------------------------------------------------+
* | [<-()] RETURNING TYPE XSTRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method /oop/if_request~get_raw_message.
returning = me->request->get_raw_message( ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method /OOP/CL_REQUEST->/OOP/IF_REQUEST~GET_REQUESTURI
* +-------------------------------------------------------------------------------------------------+
* | [<-()] RETURNING TYPE STRING
* +--------------------------------------------------------------------------------------</SIGNATURE>
method /oop/if_request~get_requesturi.
*/**
* Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.
* Examples:
* First line of HTTP request Returned Value
* POST /some/path.html HTTP/1.1 /some/path.html
* GET http://foo.bar/a.html HTTP/1.0 /a.html
* HEAD /xyz?a=b HTTP/1.1 /xyz
*/
returning = me->request->get_header_field( '~path_info' ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method /OOP/CL_REQUEST->/OOP/IF_REQUEST~LIST_HEADERS
* +-------------------------------------------------------------------------------------------------+
* | [<-()] RETURNING TYPE TIHTTPNVP
* +--------------------------------------------------------------------------------------</SIGNATURE>
method /oop/if_request~list_headers.
*/**
* Returns all request headers
*/
me->request->get_header_fields( changing fields = returning ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method /OOP/CL_REQUEST->/OOP/IF_REQUEST~LIST_PARAMETERS
* +-------------------------------------------------------------------------------------------------+
* | [<-()] RETURNING TYPE TIHTTPNVP
* +--------------------------------------------------------------------------------------</SIGNATURE>
method /oop/if_request~list_parameters.
*/**
* Returns all request parameters
*/
me->request->get_form_fields_cs( changing fields = returning ).
endmethod.
* <SIGNATURE>---------------------------------------------------------------------------------------+
* | Instance Public Method /OOP/CL_REQUEST->CONSTRUCTOR
* +-------------------------------------------------------------------------------------------------+
* | [--->] REQUEST TYPE REF TO IF_HTTP_REQUEST
* +--------------------------------------------------------------------------------------</SIGNATURE>
method constructor.
super->constructor( ).
me->request = request.
endmethod.
ENDCLASS.
| 43.39604 | 126 | 0.424709 |
f7ecef41fd336684319e555fda80d4126cbfca3c | 1,957 | abap | ABAP | lbn-gtt-template-tpo/abap/zsrc/zpof_gtt.fugr.zpof_gtt_ee_po_item_conf_rel.abap | C5310110/logistics-business-network-gtt-samples | dddcbb5e50f67af627588448c0349cd5f92a1360 | [
"Apache-2.0"
] | 12 | 2020-09-25T07:54:40.000Z | 2021-09-27T12:29:34.000Z | lbn-gtt-template-tpo/abap/zsrc/zpof_gtt.fugr.zpof_gtt_ee_po_item_conf_rel.abap | C5310110/logistics-business-network-gtt-samples | dddcbb5e50f67af627588448c0349cd5f92a1360 | [
"Apache-2.0"
] | 2 | 2020-10-15T05:20:41.000Z | 2022-02-14T09:28:02.000Z | lbn-gtt-template-tpo/abap/zsrc/zpof_gtt.fugr.zpof_gtt_ee_po_item_conf_rel.abap | C5310110/logistics-business-network-gtt-samples | dddcbb5e50f67af627588448c0349cd5f92a1360 | [
"Apache-2.0"
] | 50 | 2020-09-29T03:06:01.000Z | 2022-03-28T16:04:45.000Z | FUNCTION zpof_gtt_ee_po_item_conf_rel.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(I_APPSYS) TYPE /SAPTRX/APPLSYSTEM
*" REFERENCE(I_EVENT_TYPES) TYPE /SAPTRX/EVTYPES
*" REFERENCE(I_ALL_APPL_TABLES) TYPE TRXAS_TABCONTAINER
*" REFERENCE(I_EVENTTYPE_TAB) TYPE TRXAS_EVENTTYPE_TABS_WA
*" REFERENCE(I_EVENT) TYPE TRXAS_EVT_CTAB_WA
*" EXPORTING
*" VALUE(E_RESULT) LIKE SY-BINPT
*" TABLES
*" C_LOGTABLE STRUCTURE BAPIRET2 OPTIONAL
*" EXCEPTIONS
*" PARAMETER_ERROR
*" RELEVANCE_DETERM_ERROR
*" STOP_PROCESSING
*"----------------------------------------------------------------------
DATA: lo_udm_message TYPE REF TO cx_udm_message,
ls_bapiret TYPE bapiret2.
TRY.
e_result = lcl_ae_performer=>check_relevance(
EXPORTING
is_definition = VALUE #(
maintab = lif_app_constants=>cs_tabledef-po_item_new
mastertab = lif_app_constants=>cs_tabledef-po_header_new )
io_ae_factory = NEW lcl_ae_factory_po_item_conf( )
iv_appsys = i_appsys
is_event_type = i_event_types
it_all_appl_tables = i_all_appl_tables
is_events = i_event
).
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 c_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 relevance_determ_error.
ENDCASE.
ENDTRY.
ENDFUNCTION.
| 34.946429 | 92 | 0.598876 |
f7ed1d735593dee5e802e1a14bb7c12a160ad59b | 6,381 | abap | ABAP | src/unit/kernel_unit_runner.clas.abap | mbtools/open-abap | 13274b1536752ec96edb68460ccdea7fe68625d9 | [
"MIT"
] | null | null | null | src/unit/kernel_unit_runner.clas.abap | mbtools/open-abap | 13274b1536752ec96edb68460ccdea7fe68625d9 | [
"MIT"
] | null | null | null | src/unit/kernel_unit_runner.clas.abap | mbtools/open-abap | 13274b1536752ec96edb68460ccdea7fe68625d9 | [
"MIT"
] | null | null | null | CLASS kernel_unit_runner DEFINITION PUBLIC.
PUBLIC SECTION.
* as of now, only global classes with local testclasses are supported
TYPES: BEGIN OF ty_input_item,
class_name TYPE c LENGTH 30,
testclass_name TYPE c LENGTH 30,
method_name TYPE c LENGTH 30,
END OF ty_input_item.
TYPES ty_input TYPE STANDARD TABLE OF ty_input_item WITH DEFAULT KEY.
TYPES ty_status TYPE string.
CONSTANTS: BEGIN OF gc_status,
success TYPE ty_status VALUE 'SUCCESS',
failed TYPE ty_status VALUE 'FAILED',
skipped TYPE ty_status VALUE 'SKIPPED',
END OF gc_status.
TYPES BEGIN OF ty_result_item.
INCLUDE TYPE ty_input_item.
TYPES: expected TYPE string,
actual TYPE string,
status TYPE ty_status,
runtime TYPE i,
message TYPE string,
js_location TYPE string,
END OF ty_result_item.
TYPES: BEGIN OF ty_result,
list TYPE STANDARD TABLE OF ty_result_item WITH DEFAULT KEY,
json TYPE string,
END OF ty_result.
CLASS-METHODS run
IMPORTING
it_input TYPE ty_input
RETURNING
VALUE(rs_result) TYPE ty_result.
PRIVATE SECTION.
TYPES: BEGIN OF ty_class_item,
class_name TYPE c LENGTH 30,
testclass_name TYPE c LENGTH 30,
END OF ty_class_item.
TYPES ty_classes TYPE STANDARD TABLE OF ty_class_item WITH DEFAULT KEY.
CLASS-METHODS unique_classes
IMPORTING
it_input TYPE ty_input
RETURNING
VALUE(rt_classes) TYPE ty_classes.
CLASS-METHODS to_json
IMPORTING it_list TYPE ty_result-list
RETURNING VALUE(rv_json) TYPE string.
CLASS-METHODS get_location
IMPORTING ix_error TYPE REF TO cx_root
RETURNING VALUE(rv_location) TYPE string.
ENDCLASS.
CLASS kernel_unit_runner IMPLEMENTATION.
METHOD get_location.
DATA lv_stack TYPE string.
DATA lt_lines TYPE STANDARD TABLE OF string WITH DEFAULT KEY.
DATA lv_found TYPE abap_bool.
WRITE '@KERNEL lv_stack.set(INPUT.ix_error.get().stack);'.
SPLIT lv_stack AT |\n| INTO TABLE lt_lines.
* find whatever comes after "cl_abap_unit_assert"
LOOP AT lt_lines INTO lv_stack.
IF lv_stack CP '*cl_abap_unit_assert*'.
lv_found = abap_true.
CONTINUE.
ELSEIF lv_found = abap_true.
REPLACE FIRST OCCURRENCE OF |at | IN lv_stack WITH ''.
rv_location = condense( lv_stack ).
EXIT.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD to_json.
* would like to keep the dependencies of this class minimal,
* so not using CALL TRANSFORMATION or any other ABAP classes
DATA ls_list LIKE LINE OF it_list.
DATA lt_strings TYPE STANDARD TABLE OF string WITH DEFAULT KEY.
DATA lv_string LIKE LINE OF lt_strings.
DATA lv_message TYPE string.
LOOP AT it_list INTO ls_list.
lv_message = ls_list-message.
REPLACE ALL OCCURENCES OF |"| IN lv_message WITH |\"|.
lv_string = |\{"class_name": "{ ls_list-class_name
}","testclass_name": "{ ls_list-testclass_name
}","method_name": "{ ls_list-method_name
}","expected": "{ ls_list-expected
}","actual": "{ ls_list-actual
}","status": "{ ls_list-status
}","runtime": { ls_list-runtime
},"message": "{ lv_message
}","js_location": "{ ls_list-js_location }"\}|.
APPEND lv_string TO lt_strings.
ENDLOOP.
CONCATENATE LINES OF lt_strings INTO rv_json SEPARATED BY ','.
rv_json = '[' && rv_json && ']'.
ENDMETHOD.
METHOD unique_classes.
DATA ls_input LIKE LINE OF it_input.
DATA ls_class LIKE LINE OF rt_classes.
LOOP AT it_input INTO ls_input.
MOVE-CORRESPONDING ls_input TO ls_class.
INSERT ls_class INTO TABLE rt_classes.
ENDLOOP.
SORT rt_classes.
DELETE ADJACENT DUPLICATES FROM rt_classes.
ENDMETHOD.
METHOD run.
DATA ls_input LIKE LINE OF it_input.
DATA lv_time TYPE i.
DATA lo_obj TYPE REF TO object.
DATA lv_name TYPE string.
DATA lt_classes TYPE ty_classes.
DATA ls_class LIKE LINE OF lt_classes.
DATA lx_root TYPE REF TO cx_root.
DATA lx_assert TYPE REF TO kernel_cx_assert.
FIELD-SYMBOLS <ls_result> LIKE LINE OF rs_result-list.
* todo, respect quit level, default = method?
lt_classes = unique_classes( it_input ).
LOOP AT lt_classes INTO ls_class.
* this is special, and must match the runtime:
lv_name = |CLAS-{ ls_class-class_name }-{ ls_class-testclass_name }|.
CREATE OBJECT lo_obj TYPE (lv_name).
TRY.
CALL METHOD lo_obj->('CLASS_SETUP').
CATCH cx_sy_dyn_call_illegal_method.
ENDTRY.
LOOP AT it_input INTO ls_input WHERE class_name = ls_class-class_name AND testclass_name = ls_class-testclass_name.
APPEND INITIAL LINE TO rs_result-list ASSIGNING <ls_result>.
MOVE-CORRESPONDING ls_input TO <ls_result>.
TRY.
CALL METHOD lo_obj->('SETUP').
CATCH cx_sy_dyn_call_illegal_method.
ENDTRY.
GET RUN TIME FIELD lv_time.
TRY.
CALL METHOD lo_obj->(ls_input-method_name).
<ls_result>-status = gc_status-success.
CATCH kernel_cx_assert INTO lx_assert.
<ls_result>-status = gc_status-failed.
<ls_result>-actual = lx_assert->actual.
<ls_result>-expected = lx_assert->expected.
<ls_result>-message = lx_assert->message.
<ls_result>-js_location = get_location( lx_assert ).
CATCH cx_root INTO lx_root.
<ls_result>-status = gc_status-failed.
<ls_result>-message = |Some exception raised|. " todo, use RTTI to find the class name?
<ls_result>-js_location = get_location( lx_root ).
ENDTRY.
GET RUN TIME FIELD lv_time.
<ls_result>-runtime = lv_time.
TRY.
CALL METHOD lo_obj->('TEARDOWN').
CATCH cx_sy_dyn_call_illegal_method.
ENDTRY.
ENDLOOP.
TRY.
CALL METHOD lo_obj->('CLASS_TEARDOWN').
CATCH cx_sy_dyn_call_illegal_method.
ENDTRY.
ENDLOOP.
rs_result-json = to_json( rs_result-list ).
ENDMETHOD.
ENDCLASS. | 33.761905 | 121 | 0.645824 |
f7ed37a1f65dec9a0f79f45ef1404d7ea0e8daaf | 764 | abap | ABAP | src/utils/zif_abapgit_log.intf.abap | qinhanguyun/abapGit | 272925fff7625a65a22825b546790948769f1556 | [
"MIT"
] | 1 | 2019-05-27T18:50:14.000Z | 2019-05-27T18:50:14.000Z | src/utils/zif_abapgit_log.intf.abap | qinhanguyun/abapGit | 272925fff7625a65a22825b546790948769f1556 | [
"MIT"
] | null | null | null | src/utils/zif_abapgit_log.intf.abap | qinhanguyun/abapGit | 272925fff7625a65a22825b546790948769f1556 | [
"MIT"
] | 1 | 2019-12-31T11:44:14.000Z | 2019-12-31T11:44:14.000Z | INTERFACE zif_abapgit_log
PUBLIC .
METHODS add
IMPORTING
!iv_msg TYPE csequence
!iv_type TYPE symsgty DEFAULT 'E'
!iv_rc TYPE balsort OPTIONAL .
METHODS add_error
IMPORTING
!iv_msg TYPE csequence .
METHODS add_info
IMPORTING
!iv_msg TYPE csequence .
METHODS add_warning
IMPORTING
!iv_msg TYPE csequence .
METHODS clear .
METHODS count
RETURNING
VALUE(rv_count) TYPE i .
METHODS has_rc
IMPORTING
!iv_rc TYPE balsort
RETURNING
VALUE(rv_yes) TYPE abap_bool .
METHODS show
IMPORTING
!iv_header_text TYPE csequence DEFAULT 'Log' .
METHODS to_html
RETURNING
VALUE(ro_html) TYPE REF TO zcl_abapgit_html .
METHODS write .
ENDINTERFACE.
| 21.222222 | 52 | 0.672775 |
f7ee7d7471933b932cad427761bd6a0c1f933e2a | 9,429 | abap | ABAP | src/zcl_oapi_parser.clas.abap | abap-openapi/abap-openapi-client | a3d259a151ceed72575e3d7d127d0ab66b339996 | [
"MIT"
] | 36 | 2021-01-19T17:49:01.000Z | 2022-02-10T07:49:43.000Z | src/zcl_oapi_parser.clas.abap | abap-openapi/abap-openapi-client | a3d259a151ceed72575e3d7d127d0ab66b339996 | [
"MIT"
] | 15 | 2021-02-01T14:34:06.000Z | 2022-02-11T06:40:42.000Z | src/zcl_oapi_parser.clas.abap | abap-openapi/abap-openapi-client | a3d259a151ceed72575e3d7d127d0ab66b339996 | [
"MIT"
] | 1 | 2021-08-25T07:17:48.000Z | 2021-08-25T07:17:48.000Z | CLASS zcl_oapi_parser DEFINITION PUBLIC.
PUBLIC SECTION.
METHODS parse
IMPORTING iv_json TYPE string
RETURNING VALUE(rs_schema) TYPE zif_oapi_specification_v3=>ty_specification.
PRIVATE SECTION.
DATA mo_json TYPE REF TO zcl_oapi_json.
METHODS parse_operations
RETURNING VALUE(rt_operations) TYPE zif_oapi_specification_v3=>ty_operations.
METHODS parse_servers
RETURNING VALUE(rt_servers) TYPE zif_oapi_specification_v3=>ty_servers.
METHODS parse_parameters
IMPORTING iv_prefix TYPE string
RETURNING VALUE(rt_parameters) TYPE zif_oapi_specification_v3=>ty_parameters.
METHODS parse_parameters_ref
IMPORTING iv_prefix TYPE string
RETURNING VALUE(rt_parameters) TYPE string_table.
METHODS parse_responses
IMPORTING iv_prefix TYPE string
RETURNING VALUE(rt_responses) TYPE zif_oapi_specification_v3=>ty_responses.
METHODS parse_media_types
IMPORTING iv_prefix TYPE string
RETURNING VALUE(rt_media_types) TYPE zif_oapi_specification_v3=>ty_media_types.
METHODS parse_components
RETURNING VALUE(rs_components) TYPE zif_oapi_specification_v3=>ty_components.
METHODS parse_schema
IMPORTING iv_prefix TYPE string
RETURNING VALUE(ri_schema) TYPE REF TO zif_oapi_schema.
METHODS parse_schemas
IMPORTING iv_prefix TYPE string
RETURNING VALUE(rt_schemas) TYPE zif_oapi_specification_v3=>ty_schemas.
ENDCLASS.
CLASS zcl_oapi_parser IMPLEMENTATION.
METHOD parse.
CREATE OBJECT mo_json EXPORTING iv_json = iv_json.
rs_schema-openapi = mo_json->value_string( '/openapi' ).
ASSERT rs_schema-openapi CP '3*'.
rs_schema-info-title = mo_json->value_string( '/info/title' ).
rs_schema-info-version = mo_json->value_string( '/info/version' ).
rs_schema-info-description = mo_json->value_string( '/info/description' ).
rs_schema-operations = parse_operations( ).
rs_schema-servers = parse_servers( ).
rs_schema-components = parse_components( ).
ENDMETHOD.
METHOD parse_schema.
DATA lt_names TYPE string_table.
DATA lv_name TYPE string.
DATA ls_property TYPE zif_oapi_schema=>ty_property.
DATA lo_names TYPE REF TO zcl_oapi_abap_name.
CREATE OBJECT lo_names.
CREATE OBJECT ri_schema TYPE zcl_oapi_schema.
ri_schema->type = mo_json->value_string( iv_prefix && '/type' ).
IF ri_schema->type IS INITIAL.
ri_schema->type = 'string'. " todo, handle "oneOf" and "anyOf"
RETURN.
ENDIF.
ri_schema->default = mo_json->value_string( iv_prefix && '/default' ).
ri_schema->items_ref = mo_json->value_string( iv_prefix && '/items/$ref' ).
lt_names = mo_json->members( iv_prefix && '/properties/' ).
LOOP AT lt_names INTO lv_name.
CLEAR ls_property.
ls_property-name = lv_name.
ls_property-abap_name = lo_names->to_abap_name( lv_name ).
ls_property-ref = mo_json->value_string( iv_prefix && '/properties/' && lv_name && '/$ref' ).
IF ls_property-ref IS INITIAL.
ls_property-schema = parse_schema( iv_prefix && '/properties/' && lv_name ).
ENDIF.
APPEND ls_property TO ri_schema->properties.
ENDLOOP.
ENDMETHOD.
METHOD parse_components.
rs_components-parameters = parse_parameters( '/components/parameters/' ).
rs_components-schemas = parse_schemas( '/components/schemas/' ).
ENDMETHOD.
METHOD parse_schemas.
DATA lt_names TYPE string_table.
DATA lv_name TYPE string.
DATA ls_schema LIKE LINE OF rt_schemas.
DATA lo_names TYPE REF TO zcl_oapi_abap_name.
CREATE OBJECT lo_names.
lt_names = mo_json->members( iv_prefix ).
LOOP AT lt_names INTO lv_name.
CLEAR ls_schema.
ls_schema-name = lv_name.
ls_schema-abap_name = lo_names->to_abap_name( ls_schema-name ).
ls_schema-abap_parser_method = lo_names->to_abap_name( |parse_{ ls_schema-abap_name }| ).
ls_schema-schema = parse_schema( iv_prefix && lv_name ).
APPEND ls_schema TO rt_schemas.
ENDLOOP.
ENDMETHOD.
METHOD parse_servers.
DATA lt_array TYPE string_table.
DATA lv_index TYPE string.
DATA ls_server LIKE LINE OF rt_servers.
lt_array = mo_json->members( '/servers/' ).
LOOP AT lt_array INTO lv_index.
CLEAR ls_server.
ls_server-url = mo_json->value_string( '/servers/' && lv_index && '/url' ).
APPEND ls_server TO rt_servers.
ENDLOOP.
ENDMETHOD.
METHOD parse_operations.
DATA lt_paths TYPE string_table.
DATA lv_path LIKE LINE OF lt_paths.
DATA lt_methods TYPE string_table.
DATA lv_method LIKE LINE OF lt_methods.
DATA lv_prefix TYPE string.
DATA ls_operation LIKE LINE OF rt_operations.
DATA lo_names TYPE REF TO zcl_oapi_abap_name.
CREATE OBJECT lo_names.
lt_paths = mo_json->members( '/paths/' ).
LOOP AT lt_paths INTO lv_path.
CLEAR ls_operation.
ls_operation-path = lv_path.
lt_methods = mo_json->members( '/paths/' && lv_path && '/' ).
LOOP AT lt_methods INTO lv_method.
ls_operation-method = lv_method.
lv_prefix = '/paths/' && lv_path && '/' && lv_method.
ls_operation-summary = mo_json->value_string( lv_prefix && '/summary' ).
ls_operation-deprecated = mo_json->value_boolean( lv_prefix && '/deprecated' ).
ls_operation-description = mo_json->value_string( lv_prefix && '/description' ).
ls_operation-operation_id = mo_json->value_string( lv_prefix && '/operationId' ).
ls_operation-parameters = parse_parameters( lv_prefix && '/parameters/' ).
ls_operation-parameters_ref = parse_parameters_ref( lv_prefix && '/parameters/' ).
ls_operation-responses = parse_responses( lv_prefix && '/responses/' ).
ls_operation-abap_name = lo_names->to_abap_name( ls_operation-operation_id ).
IF ls_operation-abap_name IS INITIAL.
ls_operation-abap_name = lo_names->to_abap_name( ls_operation-summary ).
ENDIF.
IF ls_operation-abap_name IS INITIAL.
CONTINUE.
ENDIF.
ls_operation-body_schema_ref = mo_json->value_string( lv_prefix && '/requestBody/content/application/json/schema/$ref' ).
IF ls_operation-body_schema_ref IS INITIAL AND lines( mo_json->members( lv_prefix && '/requestBody/content/application/json/schema/' ) ) > 0.
ls_operation-body_schema = parse_schema( lv_prefix && '/requestBody/content/application/json/schema' ).
ENDIF.
APPEND ls_operation TO rt_operations.
ENDLOOP.
ENDLOOP.
ENDMETHOD.
METHOD parse_parameters.
DATA lt_members TYPE string_table.
DATA lv_member LIKE LINE OF lt_members.
DATA ls_parameter LIKE LINE OF rt_parameters.
DATA lo_names TYPE REF TO zcl_oapi_abap_name.
lt_members = mo_json->members( iv_prefix ).
LOOP AT lt_members INTO lv_member.
CLEAR ls_parameter.
ls_parameter-id = lv_member.
ls_parameter-name = mo_json->value_string( iv_prefix && lv_member && '/name' ).
IF ls_parameter-name IS NOT INITIAL.
ls_parameter-in = mo_json->value_string( iv_prefix && lv_member && '/in' ).
ls_parameter-description = mo_json->value_string( iv_prefix && lv_member && '/description' ).
ls_parameter-required = mo_json->value_boolean( iv_prefix && lv_member && '/required' ).
CREATE OBJECT lo_names. " in this place the names are not connected
ls_parameter-abap_name = lo_names->to_abap_name( ls_parameter-name ).
ls_parameter-schema_ref = mo_json->value_string( iv_prefix && lv_member && '/schema/$ref' ).
IF ls_parameter-schema_ref IS INITIAL.
ls_parameter-schema = parse_schema( iv_prefix && lv_member && '/schema' ).
ENDIF.
APPEND ls_parameter TO rt_parameters.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD parse_parameters_ref.
DATA lt_members TYPE string_table.
DATA lv_member LIKE LINE OF lt_members.
DATA lv_ref TYPE string.
lt_members = mo_json->members( iv_prefix ).
LOOP AT lt_members INTO lv_member.
lv_ref = mo_json->value_string( iv_prefix && lv_member && '/$ref' ).
IF lv_ref IS NOT INITIAL.
APPEND lv_ref TO rt_parameters.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD parse_responses.
DATA lt_members TYPE string_table.
DATA lv_member LIKE LINE OF lt_members.
DATA ls_response LIKE LINE OF rt_responses.
lt_members = mo_json->members( iv_prefix ).
LOOP AT lt_members INTO lv_member.
CLEAR ls_response.
ls_response-code = lv_member.
ls_response-description = mo_json->value_string( iv_prefix && lv_member && '/description' ).
ls_response-content = parse_media_types( iv_prefix && lv_member && '/content/' ).
APPEND ls_response TO rt_responses.
ENDLOOP.
ENDMETHOD.
METHOD parse_media_types.
DATA lt_members TYPE string_table.
DATA lv_member LIKE LINE OF lt_members.
DATA ls_media_type LIKE LINE OF rt_media_types.
lt_members = mo_json->members( iv_prefix ).
LOOP AT lt_members INTO lv_member.
CLEAR ls_media_type.
ls_media_type-type = lv_member.
ls_media_type-schema_ref = mo_json->value_string( iv_prefix && lv_member && '/schema/$ref' ).
IF ls_media_type-schema_ref IS INITIAL.
ls_media_type-schema = parse_schema( iv_prefix && lv_member && '/schema' ).
ENDIF.
APPEND ls_media_type TO rt_media_types.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| 37.716 | 149 | 0.706756 |
f7f3e0268db8b50279c95890097590755ac516bb | 1,588 | abap | ABAP | src/zif_abapgit_repo_srv.intf.abap | wdecpacloudcourse01/abap_a07 | ad7809e4f2bc4da133c17c9a4c0536d7ea5ebbed | [
"MIT"
] | null | null | null | src/zif_abapgit_repo_srv.intf.abap | wdecpacloudcourse01/abap_a07 | ad7809e4f2bc4da133c17c9a4c0536d7ea5ebbed | [
"MIT"
] | null | null | null | src/zif_abapgit_repo_srv.intf.abap | wdecpacloudcourse01/abap_a07 | ad7809e4f2bc4da133c17c9a4c0536d7ea5ebbed | [
"MIT"
] | null | null | null | INTERFACE zif_abapgit_repo_srv
PUBLIC .
METHODS delete
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo
RAISING
zcx_abapgit_exception .
METHODS get
IMPORTING
!iv_key TYPE zif_abapgit_persistence=>ty_value
RETURNING
VALUE(ro_repo) TYPE REF TO zcl_abapgit_repo
RAISING
zcx_abapgit_exception .
METHODS is_repo_installed
IMPORTING
!iv_url TYPE string
!iv_target_package TYPE devclass OPTIONAL
RETURNING
VALUE(rv_installed) TYPE abap_bool
RAISING
zcx_abapgit_exception .
METHODS list
RETURNING
VALUE(rt_list) TYPE zif_abapgit_definitions=>ty_repo_ref_tt
RAISING
zcx_abapgit_exception .
METHODS new_offline
IMPORTING
!iv_url TYPE string
!iv_package TYPE devclass
iv_folder_logic TYPE string DEFAULT zif_abapgit_dot_abapgit=>c_folder_logic-full
RETURNING
VALUE(ro_repo) TYPE REF TO zcl_abapgit_repo_offline
RAISING
zcx_abapgit_exception .
METHODS new_online
IMPORTING
!iv_url TYPE string
!iv_branch_name TYPE string
!iv_package TYPE devclass
RETURNING
VALUE(ro_repo) TYPE REF TO zcl_abapgit_repo_online
RAISING
zcx_abapgit_exception .
METHODS purge
IMPORTING
!io_repo TYPE REF TO zcl_abapgit_repo
is_checks TYPE zif_abapgit_definitions=>ty_delete_checks
RAISING
zcx_abapgit_exception .
METHODS validate_package
IMPORTING
!iv_package TYPE devclass
RAISING
zcx_abapgit_exception .
ENDINTERFACE.
| 26.466667 | 86 | 0.705919 |
f7f52c6515a71956bad2b0662e8d34787d469734 | 4,148 | abap | ABAP | src/zabapgit_password_dialog.prog.abap | jeevanrajv1901/ABAPGIT | 6d2deece76a481da75a04e4bbafae2d286b64834 | [
"MIT"
] | 1 | 2021-01-21T15:34:26.000Z | 2021-01-21T15:34:26.000Z | src/zabapgit_password_dialog.prog.abap | jeevanrajv1901/ABAPGIT | 6d2deece76a481da75a04e4bbafae2d286b64834 | [
"MIT"
] | 1 | 2020-01-05T16:45:32.000Z | 2020-01-05T16:45:32.000Z | src/zabapgit_password_dialog.prog.abap | jeevanrajv1901/ABAPGIT | 6d2deece76a481da75a04e4bbafae2d286b64834 | [
"MIT"
] | null | null | null | *&---------------------------------------------------------------------*
*& Include ZABAPGIT_PASSWORD_DIALOG
*&---------------------------------------------------------------------*
SELECTION-SCREEN BEGIN OF SCREEN 1002 TITLE s_title.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(10) s_url FOR FIELD p_url.
PARAMETERS: p_url TYPE string LOWER CASE VISIBLE LENGTH 40 ##SEL_WRONG.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(10) s_user FOR FIELD p_user.
PARAMETERS: p_user TYPE string LOWER CASE VISIBLE LENGTH 40 ##SEL_WRONG.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(10) s_pass FOR FIELD p_pass.
PARAMETERS: p_pass TYPE string LOWER CASE VISIBLE LENGTH 40 ##SEL_WRONG.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF SCREEN 1002.
*-----------------------------------------------------------------------
* LCL_PASSWORD_DIALOG
*-----------------------------------------------------------------------
CLASS lcl_password_dialog DEFINITION FINAL.
**************
* This class will remain local in the report
**************
PUBLIC SECTION.
CONSTANTS c_dynnr TYPE char4 VALUE '1002'.
CLASS-METHODS popup
IMPORTING
iv_repo_url TYPE string
CHANGING
cv_user TYPE string
cv_pass TYPE string.
CLASS-METHODS on_screen_init.
CLASS-METHODS on_screen_output.
CLASS-METHODS on_screen_event
IMPORTING
iv_ucomm TYPE sy-ucomm.
PRIVATE SECTION.
CLASS-DATA gv_confirm TYPE abap_bool.
CLASS-METHODS enrich_title_by_hostname
IMPORTING
iv_repo_url TYPE string.
ENDCLASS.
CLASS lcl_password_dialog IMPLEMENTATION.
METHOD popup.
CLEAR p_pass.
p_url = iv_repo_url.
p_user = cv_user.
gv_confirm = abap_false.
enrich_title_by_hostname( iv_repo_url ).
CALL SELECTION-SCREEN c_dynnr STARTING AT 5 5 ENDING AT 60 8.
IF gv_confirm = abap_true.
cv_user = p_user.
cv_pass = p_pass.
ELSE.
CLEAR: cv_user, cv_pass.
ENDIF.
CLEAR: p_url, p_user, p_pass.
ENDMETHOD.
METHOD on_screen_init.
s_title = 'Login' ##NO_TEXT.
s_url = 'Repo URL' ##NO_TEXT.
s_user = 'User' ##NO_TEXT.
s_pass = 'Password' ##NO_TEXT.
ENDMETHOD.
METHOD on_screen_output.
DATA lt_ucomm TYPE TABLE OF sy-ucomm.
ASSERT sy-dynnr = c_dynnr.
LOOP AT SCREEN.
IF screen-name = 'P_URL'.
screen-input = '0'.
screen-intensified = '1'.
screen-display_3d = '0'.
MODIFY SCREEN.
ENDIF.
IF screen-name = 'P_PASS'.
screen-invisible = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
" Program RSSYSTDB, GUI Status %_CSP
PERFORM set_pf_status IN PROGRAM rsdbrunt IF FOUND.
APPEND 'NONE' TO lt_ucomm. "Button Check
APPEND 'SPOS' TO lt_ucomm. "Save as Variant
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
p_status = sy-pfkey
TABLES
p_exclude = lt_ucomm.
IF p_user IS NOT INITIAL.
SET CURSOR FIELD 'P_PASS'.
ENDIF.
ENDMETHOD.
METHOD on_screen_event.
ASSERT sy-dynnr = c_dynnr.
" CRET - F8
" OTHERS - simulate Enter press
CASE iv_ucomm.
WHEN 'CRET'.
gv_confirm = abap_true.
WHEN OTHERS. "TODO REFACTOR !!! A CLUTCH !
" This will work unless any new specific logic appear
" for other commands. The problem is that the password dialog
" does not have Enter event (or I don't know how to activate it ;)
" so Enter issues previous command from previous screen
" But for now this works :) Fortunately Esc produces another flow
gv_confirm = abap_true.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMETHOD.
METHOD enrich_title_by_hostname.
DATA lv_host TYPE string.
FIND REGEX 'https?://([^/^:]*)' IN iv_repo_url SUBMATCHES lv_host.
IF lv_host IS NOT INITIAL AND lv_host <> space.
CLEAR s_title.
CONCATENATE 'Login:' lv_host INTO s_title IN CHARACTER MODE SEPARATED BY space.
ENDIF.
ENDMETHOD.
ENDCLASS.
| 26.935065 | 85 | 0.620781 |
f7fbccdc18c4b6401d5c822fd42bdfa3c6e06b82 | 6,272 | abap | ABAP | src/ztechdocu_cld.prog.abap | sap-russia/abapTechDocu | 384a063785795b3498f08c5e166924d8716c707f | [
"MIT"
] | 2 | 2021-10-16T07:59:45.000Z | 2021-10-17T22:57:40.000Z | src/ztechdocu_cld.prog.abap | sap-russia/abapTechDocu | 384a063785795b3498f08c5e166924d8716c707f | [
"MIT"
] | null | null | null | src/ztechdocu_cld.prog.abap | sap-russia/abapTechDocu | 384a063785795b3498f08c5e166924d8716c707f | [
"MIT"
] | 1 | 2021-11-30T18:10:34.000Z | 2021-11-30T18:10:34.000Z | *&---------------------------------------------------------------------*
*& Include ZTECHDOCU_CLD
*&---------------------------------------------------------------------*
INTERFACE lif_techdocu_repo.
METHODS:
read RETURNING VALUE(ro_result) TYPE REF TO lif_techdocu_repo,
display.
ENDINTERFACE.
CLASS lcl_techdocu_repo_obj_metadata DEFINITION FINAL.
PUBLIC SECTION.
TYPES:
BEGIN OF ty_attributes,
title TYPE string,
cnam TYPE string,
cdat TYPE d,
unam TYPE string,
udat TYPE d,
END OF ty_attributes.
METHODS:
constructor IMPORTING is_attributes TYPE ty_attributes,
get RETURNING VALUE(rs_result) TYPE ty_attributes.
PRIVATE SECTION.
DATA ms_attributes TYPE ty_attributes.
ENDCLASS.
CLASS lcl_techdocu_repo DEFINITION FINAL.
PUBLIC SECTION.
INTERFACES lif_techdocu_repo.
ALIASES read FOR lif_techdocu_repo~read.
ALIASES display FOR lif_techdocu_repo~display.
TYPES ty_t_treq TYPE RANGE OF trkorr.
TYPES ty_t_devc TYPE RANGE OF devclass.
TYPES:
BEGIN OF ty_context,
treq_range TYPE ty_t_treq,
devc_range TYPE ty_t_devc,
lang TYPE sy-langu,
END OF ty_context.
TYPES ty_repo_data TYPE ztechdocu_data.
TYPES ty_t_repo_data TYPE STANDARD TABLE OF ty_repo_data WITH KEY primary_key COMPONENTS obj_type.
METHODS constructor IMPORTING is_context TYPE ty_context.
PRIVATE SECTION.
DATA ms_context TYPE ty_context.
DATA mt_repo_data TYPE ty_t_repo_data.
METHODS:
select_treqs RETURNING VALUE(rt_result) TYPE ty_t_treq,
read_repo_data,
repo_data_by_treqs RETURNING VALUE(rt_result) TYPE ty_t_repo_data,
repo_data_by_package RETURNING VALUE(rt_result) TYPE ty_t_repo_data,
is_tr_obj_exist IMPORTING is_repo_data TYPE ty_repo_data
RETURNING VALUE(rv_result) TYPE boole_d.
ENDCLASS.
CLASS lcl_techdocu_alv DEFINITION FINAL.
PUBLIC SECTION.
TYPES ty_t_outtab TYPE lcl_techdocu_repo=>ty_t_repo_data.
METHODS display CHANGING ct_outtab TYPE ty_t_outtab.
PRIVATE SECTION.
DATA mo_grid TYPE REF TO cl_gui_alv_grid.
METHODS:
create_grid CHANGING ct_outtab TYPE ty_t_outtab,
get_field_catalog RETURNING VALUE(rt_fcat) TYPE lvc_t_fcat.
ENDCLASS.
CLASS lcl_techdocu_scr_events DEFINITION FINAL.
PUBLIC SECTION.
CLASS-DATA go_repo TYPE REF TO lif_techdocu_repo.
CLASS-METHODS:
initialization,
at_selection_screen,
at_ssonvrf_treqs,
start_of_selection,
end_of_selection.
ENDCLASS.
INTERFACE lif_techdocu_repo_obj.
METHODS:
read_metadata RETURNING VALUE(ro_result) TYPE REF TO lcl_techdocu_repo_obj_metadata
RAISING cx_sy_create_object_error.
ENDINTERFACE.
CLASS lcl_techdocu_repo_obj DEFINITION ABSTRACT.
PUBLIC SECTION.
INTERFACES lif_techdocu_repo_obj.
CLASS-METHODS:
get_instance IMPORTING iv_object TYPE trobj_name
iv_object_type TYPE trobjtype
iv_lang TYPE sy-langu
RETURNING VALUE(ro_result) TYPE REF TO lif_techdocu_repo_obj
RAISING cx_sy_create_object_error.
METHODS:
constructor IMPORTING iv_object TYPE trobj_name
iv_object_type TYPE trobjtype
iv_lang TYPE sy-langu.
PROTECTED SECTION.
DATA mv_object TYPE trobj_name.
DATA mv_object_type TYPE trobjtype.
DATA mv_lang TYPE sy-langu.
METHODS:
attributes ABSTRACT RETURNING VALUE(rs_result) TYPE lcl_techdocu_repo_obj_metadata=>ty_attributes.
ENDCLASS.
CLASS lcl_techdocu_repo_obj_devc DEFINITION INHERITING FROM lcl_techdocu_repo_obj FINAL.
PROTECTED SECTION.
METHODS: attributes REDEFINITION.
ENDCLASS.
CLASS lcl_techdocu_repo_obj_prog DEFINITION INHERITING FROM lcl_techdocu_repo_obj FINAL.
PROTECTED SECTION.
METHODS: attributes REDEFINITION.
ENDCLASS.
CLASS lcl_techdocu_repo_obj_tran DEFINITION INHERITING FROM lcl_techdocu_repo_obj FINAL.
PROTECTED SECTION.
METHODS: attributes REDEFINITION.
ENDCLASS.
CLASS lcl_techdocu_repo_obj_intf DEFINITION INHERITING FROM lcl_techdocu_repo_obj FINAL.
PROTECTED SECTION.
METHODS: attributes REDEFINITION.
ENDCLASS.
CLASS lcl_techdocu_repo_obj_clas DEFINITION INHERITING FROM lcl_techdocu_repo_obj FINAL.
PROTECTED SECTION.
METHODS: attributes REDEFINITION.
ENDCLASS.
CLASS lcl_techdocu_repo_obj_tabl DEFINITION INHERITING FROM lcl_techdocu_repo_obj FINAL.
PROTECTED SECTION.
METHODS: attributes REDEFINITION.
ENDCLASS.
CLASS lcl_techdocu_repo_obj_msag DEFINITION INHERITING FROM lcl_techdocu_repo_obj FINAL.
PROTECTED SECTION.
METHODS: attributes REDEFINITION.
ENDCLASS.
CLASS lcl_techdocu_repo_obj_shlp DEFINITION INHERITING FROM lcl_techdocu_repo_obj FINAL.
PROTECTED SECTION.
METHODS: attributes REDEFINITION.
ENDCLASS.
CLASS lcl_techdocu_repo_obj_doma DEFINITION INHERITING FROM lcl_techdocu_repo_obj FINAL.
PROTECTED SECTION.
METHODS: attributes REDEFINITION.
ENDCLASS.
CLASS lcl_techdocu_repo_obj_dtel DEFINITION INHERITING FROM lcl_techdocu_repo_obj FINAL.
PROTECTED SECTION.
METHODS: attributes REDEFINITION.
ENDCLASS.
CLASS lcl_techdocu_repo_obj_ttyp DEFINITION INHERITING FROM lcl_techdocu_repo_obj FINAL.
PROTECTED SECTION.
METHODS: attributes REDEFINITION.
ENDCLASS.
CLASS lcl_techdocu_repo_obj_view DEFINITION INHERITING FROM lcl_techdocu_repo_obj FINAL.
PROTECTED SECTION.
METHODS: attributes REDEFINITION.
ENDCLASS.
CLASS lcl_techdocu_repo_obj_sfpi DEFINITION INHERITING FROM lcl_techdocu_repo_obj FINAL.
PROTECTED SECTION.
METHODS: attributes REDEFINITION.
ENDCLASS.
CLASS lcl_techdocu_repo_obj_sfpf DEFINITION INHERITING FROM lcl_techdocu_repo_obj FINAL.
PROTECTED SECTION.
METHODS: attributes REDEFINITION.
ENDCLASS.
CLASS lcl_techdocu_repo_obj_fugr DEFINITION INHERITING FROM lcl_techdocu_repo_obj FINAL.
PROTECTED SECTION.
METHODS: attributes REDEFINITION.
ENDCLASS.
CLASS lcl_techdocu_repo_obj_sxci DEFINITION INHERITING FROM lcl_techdocu_repo_obj FINAL.
PROTECTED SECTION.
METHODS: attributes REDEFINITION.
ENDCLASS.
| 28 | 104 | 0.74426 |
f7ff6d127dfa0ed72868bd5ef42a100c2804e0b2 | 12,151 | abap | ABAP | src/objects/core/zcl_abapgit_tadir.clas.abap | abap-weasel/abapGit | fcb079b651dd5ec9a0946241537dcb52b9282147 | [
"MIT"
] | 2 | 2021-03-20T20:27:04.000Z | 2021-03-20T20:34:58.000Z | src/objects/core/zcl_abapgit_tadir.clas.abap | abap-weasel/abapGit | fcb079b651dd5ec9a0946241537dcb52b9282147 | [
"MIT"
] | 37 | 2021-06-01T05:57:18.000Z | 2022-03-01T05:02:10.000Z | src/objects/core/zcl_abapgit_tadir.clas.abap | abap-weasel/abapGit | fcb079b651dd5ec9a0946241537dcb52b9282147 | [
"MIT"
] | null | null | null | CLASS zcl_abapgit_tadir DEFINITION
PUBLIC
FINAL
CREATE PRIVATE
GLOBAL FRIENDS zcl_abapgit_factory .
PUBLIC SECTION.
INTERFACES zif_abapgit_tadir .
PROTECTED SECTION.
PRIVATE SECTION.
METHODS exists
IMPORTING
!is_item TYPE zif_abapgit_definitions=>ty_item
RETURNING
VALUE(rv_exists) TYPE abap_bool .
METHODS check_exists
IMPORTING
!it_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
RETURNING
VALUE(rt_tadir) TYPE zif_abapgit_definitions=>ty_tadir_tt
RAISING
zcx_abapgit_exception .
METHODS build
IMPORTING
!iv_package TYPE tadir-devclass
!io_dot TYPE REF TO zcl_abapgit_dot_abapgit
!iv_ignore_subpackages TYPE abap_bool DEFAULT abap_false
!iv_only_local_objects TYPE abap_bool DEFAULT abap_false
!ii_log TYPE REF TO zif_abapgit_log OPTIONAL
RETURNING
VALUE(rt_tadir) TYPE zif_abapgit_definitions=>ty_tadir_tt
RAISING
zcx_abapgit_exception .
METHODS select_objects
IMPORTING
!iv_package TYPE tadir-devclass
!iv_ignore_subpackages TYPE abap_bool DEFAULT abap_false
!iv_only_local_objects TYPE abap_bool
EXPORTING
!et_packages TYPE zif_abapgit_sap_package=>ty_devclass_tt
!et_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
RAISING
zcx_abapgit_exception .
METHODS skip_objects
IMPORTING
!iv_package TYPE tadir-devclass
!io_dot TYPE REF TO zcl_abapgit_dot_abapgit
!ii_log TYPE REF TO zif_abapgit_log OPTIONAL
CHANGING
!ct_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
RAISING
zcx_abapgit_exception .
METHODS add_local_packages
IMPORTING
!it_packages TYPE zif_abapgit_sap_package=>ty_devclass_tt
CHANGING
!ct_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
RAISING
zcx_abapgit_exception .
METHODS add_namespaces
IMPORTING
!iv_package TYPE devclass
CHANGING
!ct_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
RAISING
zcx_abapgit_exception .
METHODS determine_path
IMPORTING
!iv_package TYPE tadir-devclass
!io_dot TYPE REF TO zcl_abapgit_dot_abapgit
CHANGING
!ct_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
RAISING
zcx_abapgit_exception .
METHODS adjust_objects
IMPORTING
!iv_package TYPE tadir-devclass
!io_dot TYPE REF TO zcl_abapgit_dot_abapgit
CHANGING
!ct_tadir TYPE zif_abapgit_definitions=>ty_tadir_tt
RAISING
zcx_abapgit_exception .
ENDCLASS.
CLASS zcl_abapgit_tadir IMPLEMENTATION.
METHOD add_local_packages.
FIELD-SYMBOLS:
<lv_package> LIKE LINE OF it_packages,
<ls_tadir> LIKE LINE OF ct_tadir.
LOOP AT it_packages ASSIGNING <lv_package>.
" Local packages are not in TADIR, only in TDEVC, act as if they were
IF <lv_package> CP '$*'. " OR <package> CP 'T*' ).
APPEND INITIAL LINE TO ct_tadir ASSIGNING <ls_tadir>.
<ls_tadir>-pgmid = 'R3TR'.
<ls_tadir>-object = 'DEVC'.
<ls_tadir>-obj_name = <lv_package>.
<ls_tadir>-devclass = <lv_package>.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD add_namespaces.
DATA:
lv_name TYPE progname,
lv_namespace TYPE namespace.
FIELD-SYMBOLS:
<ls_tadir> LIKE LINE OF ct_tadir,
<ls_nspc> LIKE LINE OF ct_tadir.
LOOP AT ct_tadir ASSIGNING <ls_tadir> WHERE obj_name(1) = '/'.
" Namespaces are not in TADIR, but are necessary for creating objects in transportable packages
lv_name = <ls_tadir>-obj_name.
CALL FUNCTION 'RS_NAME_SPLIT_NAMESPACE'
EXPORTING
name_with_namespace = lv_name
IMPORTING
namespace = lv_namespace
EXCEPTIONS
delimiter_error = 1
OTHERS = 2.
IF sy-subrc = 0 AND lv_namespace IS NOT INITIAL.
READ TABLE ct_tadir TRANSPORTING NO FIELDS
WITH KEY pgmid = 'R3TR' object = 'NSPC' obj_name = lv_namespace.
IF sy-subrc <> 0.
APPEND INITIAL LINE TO ct_tadir ASSIGNING <ls_nspc>.
<ls_nspc>-pgmid = 'R3TR'.
<ls_nspc>-object = 'NSPC'.
<ls_nspc>-obj_name = lv_namespace.
<ls_nspc>-devclass = iv_package.
ENDIF.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD adjust_objects.
" Todo, replace with solution that will work with any object type (might depend on iv_package and io_dot)
FIELD-SYMBOLS <ls_tadir> LIKE LINE OF ct_tadir.
LOOP AT ct_tadir ASSIGNING <ls_tadir>.
IF <ls_tadir>-object = 'SICF'.
" Replace the internal GUID with a hash of the path
TRY.
CALL METHOD ('ZCL_ABAPGIT_OBJECT_SICF')=>read_sicf_url
EXPORTING
iv_obj_name = <ls_tadir>-obj_name
RECEIVING
rv_hash = <ls_tadir>-obj_name+15.
CATCH cx_sy_dyn_call_illegal_method ##NO_HANDLER.
" SICF might not be supported in some systems, assume this code is not called
ENDTRY.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD build.
DATA lt_packages TYPE zif_abapgit_sap_package=>ty_devclass_tt.
select_objects(
EXPORTING
iv_package = iv_package
iv_ignore_subpackages = iv_ignore_subpackages
iv_only_local_objects = iv_only_local_objects
IMPORTING
et_tadir = rt_tadir
et_packages = lt_packages ).
skip_objects(
EXPORTING
iv_package = iv_package
io_dot = io_dot
ii_log = ii_log
CHANGING
ct_tadir = rt_tadir ).
add_local_packages(
EXPORTING
it_packages = lt_packages
CHANGING
ct_tadir = rt_tadir ).
add_namespaces(
EXPORTING
iv_package = iv_package
CHANGING
ct_tadir = rt_tadir ).
determine_path(
EXPORTING
iv_package = iv_package
io_dot = io_dot
CHANGING
ct_tadir = rt_tadir ).
adjust_objects(
EXPORTING
iv_package = iv_package
io_dot = io_dot
CHANGING
ct_tadir = rt_tadir ).
ENDMETHOD.
METHOD check_exists.
DATA: li_progress TYPE REF TO zif_abapgit_progress,
ls_item TYPE zif_abapgit_definitions=>ty_item.
FIELD-SYMBOLS: <ls_tadir> LIKE LINE OF it_tadir.
li_progress = zcl_abapgit_progress=>get_instance( lines( it_tadir ) ).
* rows from database table TADIR are not removed for
* transportable objects until the transport is released
LOOP AT it_tadir ASSIGNING <ls_tadir>.
IF sy-tabix MOD 200 = 0.
li_progress->show(
iv_current = sy-tabix
iv_text = |Check object exists { <ls_tadir>-object } { <ls_tadir>-obj_name }| ).
ENDIF.
ls_item-obj_type = <ls_tadir>-object.
ls_item-obj_name = <ls_tadir>-obj_name.
ls_item-devclass = <ls_tadir>-devclass.
IF exists( ls_item ) = abap_true.
APPEND <ls_tadir> TO rt_tadir.
ENDIF.
ENDLOOP.
li_progress->off( ).
ENDMETHOD.
METHOD determine_path.
DATA:
lv_path TYPE string,
lo_folder_logic TYPE REF TO zcl_abapgit_folder_logic,
lv_last_package TYPE devclass VALUE cl_abap_char_utilities=>horizontal_tab.
FIELD-SYMBOLS <ls_tadir> LIKE LINE OF ct_tadir.
lo_folder_logic = zcl_abapgit_folder_logic=>get_instance( ).
LOOP AT ct_tadir ASSIGNING <ls_tadir>.
IF lv_last_package <> <ls_tadir>-devclass.
"Change in Package
lv_last_package = <ls_tadir>-devclass.
IF NOT io_dot IS INITIAL.
lv_path = lo_folder_logic->package_to_path(
iv_top = iv_package
io_dot = io_dot
iv_package = <ls_tadir>-devclass ).
ENDIF.
ENDIF.
<ls_tadir>-path = lv_path.
ENDLOOP.
ENDMETHOD.
METHOD exists.
IF is_item IS INITIAL.
RETURN.
ENDIF.
IF zcl_abapgit_objects=>is_supported( is_item ) = abap_false.
rv_exists = abap_true.
RETURN.
ENDIF.
rv_exists = zcl_abapgit_objects=>exists( is_item ).
ENDMETHOD.
METHOD select_objects.
DATA:
lt_excludes TYPE RANGE OF trobjtype,
ls_exclude LIKE LINE OF lt_excludes,
lt_srcsystem TYPE RANGE OF tadir-srcsystem,
ls_srcsystem LIKE LINE OF lt_srcsystem.
" Determine packages to read
IF iv_ignore_subpackages = abap_false.
et_packages = zcl_abapgit_factory=>get_sap_package( iv_package )->list_subpackages( ).
ENDIF.
INSERT iv_package INTO et_packages INDEX 1.
" Exclude object types with tadir entries that are included elsewhere
ls_exclude-sign = 'I'.
ls_exclude-option = 'EQ'.
ls_exclude-low = 'SOTR'. " automatically create for sap packages (DEVC)
APPEND ls_exclude TO lt_excludes.
ls_exclude-low = 'SFB1'. " covered by business function sets (SFBS)
APPEND ls_exclude TO lt_excludes.
ls_exclude-low = 'SFB2'. " covered by business functions (SFBF)
APPEND ls_exclude TO lt_excludes.
ls_exclude-low = 'STOB'. " auto generated by core data services (DDLS)
APPEND ls_exclude TO lt_excludes.
" Limit to objects belonging to this system
IF iv_only_local_objects = abap_true.
ls_srcsystem-sign = 'I'.
ls_srcsystem-option = 'EQ'.
ls_srcsystem-low = sy-sysid.
APPEND ls_srcsystem TO lt_srcsystem.
ENDIF.
IF et_packages IS NOT INITIAL.
SELECT * FROM tadir INTO CORRESPONDING FIELDS OF TABLE et_tadir
FOR ALL ENTRIES IN et_packages
WHERE devclass = et_packages-table_line
AND pgmid = 'R3TR'
AND object NOT IN lt_excludes
AND delflag = abap_false
AND srcsystem IN lt_srcsystem
ORDER BY PRIMARY KEY ##TOO_MANY_ITAB_FIELDS. "#EC CI_GENBUFF "#EC CI_SUBRC
ENDIF.
SORT et_tadir BY devclass pgmid object obj_name.
ENDMETHOD.
METHOD skip_objects.
" Todo, replace with solution that will work with any object type (might depend on iv_package and io_dot)
DATA lo_skip_objects TYPE REF TO zcl_abapgit_skip_objects.
CREATE OBJECT lo_skip_objects.
ct_tadir = lo_skip_objects->skip_sadl_generated_objects(
it_tadir = ct_tadir
ii_log = ii_log ).
ENDMETHOD.
METHOD zif_abapgit_tadir~get_object_package.
DATA: ls_tadir TYPE zif_abapgit_definitions=>ty_tadir,
ls_item TYPE zif_abapgit_definitions=>ty_item.
ls_tadir = zif_abapgit_tadir~read_single(
iv_pgmid = iv_pgmid
iv_object = iv_object
iv_obj_name = iv_obj_name ).
IF ls_tadir-delflag = 'X'.
RETURN. "Mark for deletion -> return nothing
ENDIF.
ls_item-obj_type = ls_tadir-object.
ls_item-obj_name = ls_tadir-obj_name.
ls_item-devclass = ls_tadir-devclass.
IF exists( ls_item ) = abap_false.
RETURN.
ENDIF.
rv_devclass = ls_tadir-devclass.
ENDMETHOD.
METHOD zif_abapgit_tadir~read.
DATA: li_exit TYPE REF TO zif_abapgit_exit.
" Start recursion
" hmm, some problems here, should TADIR also build path?
rt_tadir = build(
iv_package = iv_package
io_dot = io_dot
iv_ignore_subpackages = iv_ignore_subpackages
iv_only_local_objects = iv_only_local_objects
ii_log = ii_log ).
li_exit = zcl_abapgit_exit=>get_instance( ).
li_exit->change_tadir(
EXPORTING
iv_package = iv_package
ii_log = ii_log
CHANGING
ct_tadir = rt_tadir ).
rt_tadir = check_exists( rt_tadir ).
ENDMETHOD.
METHOD zif_abapgit_tadir~read_single.
SELECT SINGLE * FROM tadir INTO CORRESPONDING FIELDS OF rs_tadir
WHERE pgmid = iv_pgmid
AND object = iv_object
AND obj_name = iv_obj_name. "#EC CI_SUBRC
ENDMETHOD.
ENDCLASS.
| 27.742009 | 109 | 0.651058 |
f7ffd320e83e447f5c8555824fd69f97c86fac0e | 4,091 | abap | ABAP | src/checks/zcl_aoc_check_11.clas.abap | oliver-huetkoeper/abapOpenChecks | e639f3a331046426d550f87618547d652722a63b | [
"MIT"
] | null | null | null | src/checks/zcl_aoc_check_11.clas.abap | oliver-huetkoeper/abapOpenChecks | e639f3a331046426d550f87618547d652722a63b | [
"MIT"
] | null | null | null | src/checks/zcl_aoc_check_11.clas.abap | oliver-huetkoeper/abapOpenChecks | e639f3a331046426d550f87618547d652722a63b | [
"MIT"
] | null | null | null | CLASS zcl_aoc_check_11 DEFINITION
PUBLIC
INHERITING FROM zcl_aoc_super
CREATE PUBLIC.
PUBLIC SECTION.
METHODS constructor.
METHODS check
REDEFINITION.
METHODS get_attributes
REDEFINITION.
METHODS get_message_text
REDEFINITION.
METHODS if_ci_test~query_attributes
REDEFINITION.
METHODS put_attributes
REDEFINITION.
PROTECTED SECTION.
DATA mv_skipc TYPE flag.
PRIVATE SECTION.
ENDCLASS.
CLASS ZCL_AOC_CHECK_11 IMPLEMENTATION.
METHOD check.
* abapOpenChecks
* https://github.com/larshp/abapOpenChecks
* MIT License
DATA: lv_position TYPE i,
lv_include TYPE program,
lv_prev_row TYPE token_row,
lv_prev_level TYPE stmnt_levl,
lv_prev_inform_row TYPE token_row,
lv_prev_inform_level TYPE stmnt_levl.
FIELD-SYMBOLS: <ls_statement> LIKE LINE OF io_scan->statements,
<ls_token_to> LIKE LINE OF io_scan->tokens,
<ls_level> LIKE LINE OF io_scan->levels,
<ls_token_from> LIKE LINE OF io_scan->tokens.
LOOP AT io_scan->statements ASSIGNING <ls_statement>
WHERE terminator = '.'
AND type <> io_scan->gc_statement-pragma.
lv_position = sy-tabix.
IF <ls_statement>-from > <ls_statement>-to.
CONTINUE.
ENDIF.
READ TABLE io_scan->tokens ASSIGNING <ls_token_to> INDEX <ls_statement>-to.
CHECK sy-subrc = 0.
READ TABLE io_scan->tokens ASSIGNING <ls_token_from> INDEX <ls_statement>-from.
CHECK sy-subrc = 0.
IF <ls_statement>-level = lv_prev_level AND <ls_token_from>-row = lv_prev_row.
READ TABLE io_scan->levels ASSIGNING <ls_level> INDEX <ls_statement>-level.
IF sy-subrc = 0 AND ( <ls_level>-type = io_scan->gc_level-macro_define
OR <ls_level>-type = io_scan->gc_level-macro_trmac ).
CONTINUE.
ENDIF.
lv_include = io_scan->get_include( <ls_statement>-level ).
IF mv_skipc = abap_true
AND is_class_definition( lv_include ) = abap_true.
CONTINUE. " current loop
ENDIF.
IF lv_prev_inform_row <> <ls_token_from>-row
OR lv_prev_inform_level <> <ls_statement>-level.
inform( p_sub_obj_name = lv_include
p_position = lv_position
p_line = <ls_token_from>-row
p_kind = mv_errty
p_test = myname
p_code = '001' ).
ENDIF.
lv_prev_inform_row = <ls_token_from>-row.
lv_prev_inform_level = <ls_statement>-level.
ENDIF.
lv_prev_row = <ls_token_to>-row.
lv_prev_level = <ls_statement>-level.
ENDLOOP.
ENDMETHOD.
METHOD constructor.
super->constructor( ).
version = '002'.
position = '011'.
has_attributes = abap_true.
attributes_ok = abap_true.
enable_rfc( ).
set_uses_checksum( ).
mv_skipc = abap_true.
ENDMETHOD.
METHOD get_attributes.
EXPORT
mv_errty = mv_errty
mv_skipc = mv_skipc
TO DATA BUFFER p_attributes.
ENDMETHOD.
METHOD get_message_text.
CLEAR p_text.
CASE p_code.
WHEN '001'.
p_text = 'Max one statement per line'. "#EC NOTEXT
WHEN OTHERS.
super->get_message_text( EXPORTING p_test = p_test
p_code = p_code
IMPORTING p_text = p_text ).
ENDCASE.
ENDMETHOD. "GET_MESSAGE_TEXT
METHOD if_ci_test~query_attributes.
zzaoc_top.
zzaoc_fill_att mv_errty 'Error Type' ''. "#EC NOTEXT
zzaoc_fill_att mv_skipc 'Skip global class definitions' 'C'. "#EC NOTEXT
zzaoc_popup.
ENDMETHOD.
METHOD put_attributes.
IMPORT
mv_errty = mv_errty
mv_skipc = mv_skipc
FROM DATA BUFFER p_attributes. "#EC CI_USE_WANTED
ASSERT sy-subrc = 0.
ENDMETHOD.
ENDCLASS.
| 24.793939 | 85 | 0.605964 |
7903134eb8ac3e7d83f871a08189972d27873ddf | 2,838 | abap | ABAP | src/zcl_as_directory_mock.clas.abap | alaible/abap_file_browser | 6263072f6365250982eb0486e384fccdb657fd1d | [
"MIT"
] | 1 | 2022-03-14T08:49:14.000Z | 2022-03-14T08:49:14.000Z | src/zcl_as_directory_mock.clas.abap | alaible/abap_file_browser | 6263072f6365250982eb0486e384fccdb657fd1d | [
"MIT"
] | null | null | null | src/zcl_as_directory_mock.clas.abap | alaible/abap_file_browser | 6263072f6365250982eb0486e384fccdb657fd1d | [
"MIT"
] | null | null | null | CLASS zcl_as_directory_mock DEFINITION PUBLIC CREATE PUBLIC INHERITING FROM zcl_as_directory.
PUBLIC SECTION.
METHODS:
set_mock_ref IMPORTING ir_ref TYPE REF TO zif_dir_service=>tt_mock_dir_data.
DATA: mr_mock_table TYPE REF TO zif_dir_service=>tt_mock_dir_data READ-ONLY.
PROTECTED SECTION.
METHODS:
read_sub_elements REDEFINITION,
read_dir_cont_via_ext REDEFINITION.
ENDCLASS.
CLASS ZCL_AS_DIRECTORY_MOCK IMPLEMENTATION.
METHOD read_dir_cont_via_ext.
DATA: lv_dir_name TYPE epsf-epsdirnam,
lv_file_counter TYPE epsf-epsfilsiz,
lv_error_counter TYPE epsf-epsfilsiz.
FIELD-SYMBOLS: <mock_table> TYPE zif_dir_service=>tt_mock_dir_data.
TRY.
mo_directory_service->read_directory_content(
EXPORTING
iv_dir_name = CONV eps2filnam( mv_base_path )
* file_mask = space
IMPORTING
dir_name = lv_dir_name
file_counter = lv_file_counter
error_counter = lv_error_counter
e_dir_list = mt_file_list
).
ASSIGN mr_mock_table->* TO <mock_table>.
INSERT VALUE #( i_dir_name = mv_base_path dir_name = lv_dir_name e_dir_list = mt_file_list ) INTO TABLE <mock_table>.
CATCH zcx_file_err. " zcx_file_err
mv_err_read = abap_true.
ENDTRY.
ENDMETHOD.
METHOD read_sub_elements.
DATA: lo_sub_dir TYPE REF TO zcl_as_directory_mock,
lo_file TYPE REF TO zcl_as_file.
LOOP AT mt_file_list ASSIGNING FIELD-SYMBOL(<sub_dir>) WHERE is_dir EQ abap_true.
lo_sub_dir = NEW #( io_dir_service = mo_directory_service iv_base_path = |{ mv_base_path }{ mo_fs_path->parse_separator_actual }{ <sub_dir>-name }| it_comp = mt_components iv_is_root = abap_false ).
*** Referenz auf Tabelle durchreichen (->Durch Rekursion fortschreiben)
lo_sub_dir->set_mock_ref( ir_ref = mr_mock_table ).
lo_sub_dir->read_dir_content( iv_continue_if_err ).
lo_sub_dir->set_size( CONV #( <sub_dir>-size / 1000 ) ).
lo_sub_dir->set_changed( CONV #( |{ <sub_dir>-mtim+6(4) }{ <sub_dir>-mtim+3(2) }{ <sub_dir>-mtim(2) }| ) ).
APPEND lo_sub_dir TO mt_content.
ENDLOOP.
*** -> beim generieren der Mock-Daten ist das nicht notwendig!
* LOOP AT mt_file_list ASSIGNING FIELD-SYMBOL(<file>) WHERE is_dir = abap_false.
* lo_file = NEW #( iv_base_path = |{ mv_base_path }{ mo_fs_path->parse_separator_actual }{ <file>-name }| it_comp = mt_components ).
* lo_file->set_size( CONV #( <file>-size / 1000 ) ).
* lo_file->set_changed( CONV #( |{ <file>-mtim+6(4) }{ <file>-mtim+3(2) }{ <file>-mtim(2) }| ) ).
* APPEND lo_file TO mt_content.
* ENDLOOP.
ENDMETHOD.
METHOD set_mock_ref.
mr_mock_table = ir_ref.
ENDMETHOD.
ENDCLASS.
| 42.358209 | 204 | 0.676885 |
7903abb598702876c17158c9d217eb916d126ee6 | 629 | abap | ABAP | src/ci/if_ci_atc_finding_stack.intf.abap | D072189/deps | 0fae80ced139556f2c2b6330ca0d3f1bfb0e8150 | [
"MIT"
] | 2 | 2021-06-25T07:34:53.000Z | 2021-07-04T08:38:01.000Z | src/ci/if_ci_atc_finding_stack.intf.abap | D072189/deps | 0fae80ced139556f2c2b6330ca0d3f1bfb0e8150 | [
"MIT"
] | 1 | 2021-09-30T12:57:51.000Z | 2022-01-03T10:46:43.000Z | deps2/if_ci_atc_finding_stack.intf.abap | abapOpenChecks/abapOpenChecks-Steampunk | 76452ec5f8c46e1755ba5e73391fc1edd02b9aae | [
"Apache-2.0"
] | 1 | 2021-07-05T13:15:27.000Z | 2021-07-05T13:15:27.000Z | INTERFACE if_ci_atc_finding_stack
PUBLIC.
TYPES:
BEGIN OF ty_stack_statement,
text TYPE string,
statement TYPE if_ci_atc_source_code_provider=>ty_statement,
END OF ty_stack_statement.
TYPES ty_stack_statements TYPE STANDARD TABLE OF ty_stack_statement WITH EMPTY KEY.
METHODS push_statement
IMPORTING statement TYPE ty_stack_statement.
METHODS pop_statement
RETURNING VALUE(statement) TYPE ty_stack_statement.
METHODS peek_statement
RETURNING VALUE(statement) TYPE ty_stack_statement.
METHODS peek_full_stack
RETURNING VALUE(statements) TYPE ty_stack_statements.
ENDINTERFACE.
| 31.45 | 85 | 0.804452 |
7903c21c0395ec861341433116cf2cdb4a8434bf | 45,665 | abap | ABAP | src/ui/zcl_abapgit_popups.clas.abap | se38/abapGit | 6d9320505c98e2a663d9564cb927e7d58721899f | [
"MIT"
] | null | null | null | src/ui/zcl_abapgit_popups.clas.abap | se38/abapGit | 6d9320505c98e2a663d9564cb927e7d58721899f | [
"MIT"
] | null | null | null | src/ui/zcl_abapgit_popups.clas.abap | se38/abapGit | 6d9320505c98e2a663d9564cb927e7d58721899f | [
"MIT"
] | null | null | null | CLASS zcl_abapgit_popups DEFINITION
PUBLIC
FINAL
CREATE PRIVATE
GLOBAL FRIENDS zcl_abapgit_ui_factory.
PUBLIC SECTION.
INTERFACES: zif_abapgit_popups.
ALIASES:
popup_package_export FOR zif_abapgit_popups~popup_package_export,
popup_folder_logic FOR zif_abapgit_popups~popup_folder_logic,
popup_object FOR zif_abapgit_popups~popup_object,
create_branch_popup FOR zif_abapgit_popups~create_branch_popup,
repo_new_offline FOR zif_abapgit_popups~repo_new_offline,
branch_list_popup FOR zif_abapgit_popups~branch_list_popup,
repo_popup FOR zif_abapgit_popups~repo_popup,
popup_to_confirm FOR zif_abapgit_popups~popup_to_confirm,
popup_to_inform FOR zif_abapgit_popups~popup_to_inform,
popup_to_create_package FOR zif_abapgit_popups~popup_to_create_package,
popup_to_create_transp_branch FOR zif_abapgit_popups~popup_to_create_transp_branch,
popup_to_select_transports FOR zif_abapgit_popups~popup_to_select_transports,
popup_to_select_from_list FOR zif_abapgit_popups~popup_to_select_from_list,
branch_popup_callback FOR zif_abapgit_popups~branch_popup_callback,
package_popup_callback FOR zif_abapgit_popups~package_popup_callback,
popup_transport_request FOR zif_abapgit_popups~popup_transport_request,
popup_proxy_bypass FOR zif_abapgit_popups~popup_proxy_bypass.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES:
ty_sval_tt TYPE STANDARD TABLE OF sval WITH DEFAULT KEY.
CONSTANTS c_fieldname_selected TYPE lvc_fname VALUE `SELECTED` ##NO_TEXT.
CONSTANTS c_answer_cancel TYPE c LENGTH 1 VALUE 'A' ##NO_TEXT.
DATA mo_select_list_popup TYPE REF TO cl_salv_table .
DATA mr_table TYPE REF TO data .
DATA mv_cancel TYPE abap_bool VALUE abap_false.
DATA mo_table_descr TYPE REF TO cl_abap_tabledescr .
METHODS add_field
IMPORTING
!iv_tabname TYPE sval-tabname
!iv_fieldname TYPE sval-fieldname
!iv_fieldtext TYPE sval-fieldtext
!iv_value TYPE clike DEFAULT ''
!iv_field_attr TYPE sval-field_attr DEFAULT ''
!iv_obligatory TYPE spo_obl OPTIONAL
CHANGING
!ct_fields TYPE ty_sval_tt .
METHODS create_new_table
IMPORTING
!it_list TYPE STANDARD TABLE .
METHODS get_selected_rows
EXPORTING
!et_list TYPE INDEX TABLE .
METHODS on_select_list_link_click
FOR EVENT link_click OF cl_salv_events_table
IMPORTING
!row
!column .
METHODS on_select_list_function_click
FOR EVENT added_function OF cl_salv_events_table
IMPORTING
!e_salv_function .
METHODS on_double_click
FOR EVENT double_click OF cl_salv_events_table
IMPORTING
!row
!column .
METHODS extract_field_values
IMPORTING
it_fields TYPE ty_sval_tt
EXPORTING
ev_url TYPE abaptxt255-line
ev_package TYPE tdevc-devclass
ev_branch TYPE textl-line
ev_display_name TYPE trm255-text
ev_folder_logic TYPE string
ev_ign_subpkg TYPE abap_bool
ev_master_lang_only TYPE abap_bool.
TYPES:
ty_lt_fields TYPE STANDARD TABLE OF sval WITH DEFAULT KEY.
METHODS _popup_3_get_values
IMPORTING iv_popup_title TYPE string
iv_no_value_check TYPE abap_bool DEFAULT abap_false
EXPORTING ev_value_1 TYPE spo_value
ev_value_2 TYPE spo_value
ev_value_3 TYPE spo_value
CHANGING ct_fields TYPE ty_lt_fields
RAISING zcx_abapgit_exception.
METHODS validate_folder_logic
IMPORTING
iv_folder_logic TYPE string
RAISING
zcx_abapgit_exception.
ENDCLASS.
CLASS ZCL_ABAPGIT_POPUPS IMPLEMENTATION.
METHOD add_field.
FIELD-SYMBOLS: <ls_field> LIKE LINE OF ct_fields.
APPEND INITIAL LINE TO ct_fields ASSIGNING <ls_field>.
<ls_field>-tabname = iv_tabname.
<ls_field>-fieldname = iv_fieldname.
<ls_field>-fieldtext = iv_fieldtext.
<ls_field>-value = iv_value.
<ls_field>-field_attr = iv_field_attr.
<ls_field>-field_obl = iv_obligatory.
ENDMETHOD.
METHOD create_new_table.
" create and populate a table on the fly derived from
" it_data with a select column
DATA: lr_struct TYPE REF TO data,
lt_components TYPE cl_abap_structdescr=>component_table,
lo_struct_descr TYPE REF TO cl_abap_structdescr,
lo_struct_descr2 TYPE REF TO cl_abap_structdescr.
FIELD-SYMBOLS: <lt_table> TYPE STANDARD TABLE,
<ls_component> TYPE abap_componentdescr,
<lg_line> TYPE data,
<lg_data> TYPE any.
mo_table_descr ?= cl_abap_tabledescr=>describe_by_data( it_list ).
lo_struct_descr ?= mo_table_descr->get_table_line_type( ).
lt_components = lo_struct_descr->get_components( ).
INSERT INITIAL LINE INTO lt_components ASSIGNING <ls_component> INDEX 1.
ASSERT sy-subrc = 0.
<ls_component>-name = c_fieldname_selected.
<ls_component>-type ?= cl_abap_datadescr=>describe_by_name( 'FLAG' ).
lo_struct_descr2 = cl_abap_structdescr=>create( lt_components ).
mo_table_descr = cl_abap_tabledescr=>create( lo_struct_descr2 ).
CREATE DATA mr_table TYPE HANDLE mo_table_descr.
ASSIGN mr_table->* TO <lt_table>.
ASSERT sy-subrc = 0.
CREATE DATA lr_struct TYPE HANDLE lo_struct_descr2.
ASSIGN lr_struct->* TO <lg_line>.
ASSERT sy-subrc = 0.
LOOP AT it_list ASSIGNING <lg_data>.
CLEAR <lg_line>.
MOVE-CORRESPONDING <lg_data> TO <lg_line>.
INSERT <lg_line> INTO TABLE <lt_table>.
ENDLOOP.
ENDMETHOD.
METHOD extract_field_values.
FIELD-SYMBOLS: <ls_field> LIKE LINE OF it_fields.
CLEAR: ev_url,
ev_package,
ev_branch,
ev_display_name,
ev_folder_logic,
ev_ign_subpkg.
READ TABLE it_fields INDEX 1 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_url = <ls_field>-value.
READ TABLE it_fields INDEX 2 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_package = <ls_field>-value.
TRANSLATE ev_package TO UPPER CASE.
READ TABLE it_fields INDEX 3 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_branch = <ls_field>-value.
READ TABLE it_fields INDEX 4 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_display_name = <ls_field>-value.
READ TABLE it_fields INDEX 5 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_folder_logic = <ls_field>-value.
TRANSLATE ev_folder_logic TO UPPER CASE.
READ TABLE it_fields INDEX 6 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_ign_subpkg = <ls_field>-value.
TRANSLATE ev_ign_subpkg TO UPPER CASE.
READ TABLE it_fields INDEX 7 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_master_lang_only = <ls_field>-value.
ENDMETHOD.
METHOD get_selected_rows.
DATA: lv_condition TYPE string,
lr_exporting TYPE REF TO data.
FIELD-SYMBOLS: <lg_exporting> TYPE any,
<lt_table> TYPE STANDARD TABLE,
<lg_line> TYPE any,
<lv_selected> TYPE abap_bool,
<lv_selected_row> TYPE LINE OF salv_t_row.
DATA: lo_selections TYPE REF TO cl_salv_selections,
lt_selected_rows TYPE salv_t_row.
ASSIGN mr_table->* TO <lt_table>.
ASSERT sy-subrc = 0.
lo_selections = mo_select_list_popup->get_selections( ).
IF lo_selections->get_selection_mode( ) = if_salv_c_selection_mode=>single.
lt_selected_rows = lo_selections->get_selected_rows( ).
LOOP AT lt_selected_rows ASSIGNING <lv_selected_row>.
READ TABLE <lt_table>
ASSIGNING <lg_line>
INDEX <lv_selected_row>.
CHECK <lv_selected_row> IS ASSIGNED.
ASSIGN COMPONENT c_fieldname_selected
OF STRUCTURE <lg_line>
TO <lv_selected>.
CHECK <lv_selected> IS ASSIGNED.
<lv_selected> = abap_true.
ENDLOOP.
ENDIF.
lv_condition = |{ c_fieldname_selected } = ABAP_TRUE|.
CREATE DATA lr_exporting LIKE LINE OF et_list.
ASSIGN lr_exporting->* TO <lg_exporting>.
LOOP AT <lt_table> ASSIGNING <lg_line> WHERE (lv_condition).
CLEAR <lg_exporting>.
MOVE-CORRESPONDING <lg_line> TO <lg_exporting>.
APPEND <lg_exporting> TO et_list.
ENDLOOP.
ENDMETHOD.
METHOD on_double_click.
DATA: lo_selections TYPE REF TO cl_salv_selections.
lo_selections = mo_select_list_popup->get_selections( ).
IF lo_selections->get_selection_mode( ) = if_salv_c_selection_mode=>single.
mo_select_list_popup->close_screen( ).
ENDIF.
ENDMETHOD.
METHOD on_select_list_function_click.
FIELD-SYMBOLS: <lt_table> TYPE STANDARD TABLE,
<lg_line> TYPE any,
<lv_selected> TYPE abap_bool.
ASSIGN mr_table->* TO <lt_table>.
ASSERT sy-subrc = 0.
CASE e_salv_function.
WHEN 'O.K.'.
mv_cancel = abap_false.
mo_select_list_popup->close_screen( ).
WHEN 'ABR'.
"Canceled: clear list to overwrite nothing
CLEAR <lt_table>.
mv_cancel = abap_true.
mo_select_list_popup->close_screen( ).
WHEN 'SALL'.
LOOP AT <lt_table> ASSIGNING <lg_line>.
ASSIGN COMPONENT c_fieldname_selected
OF STRUCTURE <lg_line>
TO <lv_selected>.
ASSERT sy-subrc = 0.
<lv_selected> = abap_true.
ENDLOOP.
mo_select_list_popup->refresh( ).
WHEN 'DSEL'.
LOOP AT <lt_table> ASSIGNING <lg_line>.
ASSIGN COMPONENT c_fieldname_selected
OF STRUCTURE <lg_line>
TO <lv_selected>.
ASSERT sy-subrc = 0.
<lv_selected> = abap_false.
ENDLOOP.
mo_select_list_popup->refresh( ).
WHEN OTHERS.
CLEAR <lt_table>.
mo_select_list_popup->close_screen( ).
ENDCASE.
ENDMETHOD.
METHOD on_select_list_link_click.
FIELD-SYMBOLS: <lt_table> TYPE STANDARD TABLE,
<lg_line> TYPE any,
<lv_selected> TYPE abap_bool.
ASSIGN mr_table->* TO <lt_table>.
ASSERT sy-subrc = 0.
READ TABLE <lt_table> ASSIGNING <lg_line> INDEX row.
IF sy-subrc = 0.
ASSIGN COMPONENT c_fieldname_selected
OF STRUCTURE <lg_line>
TO <lv_selected>.
ASSERT sy-subrc = 0.
IF <lv_selected> = abap_true.
<lv_selected> = abap_false.
ELSE.
<lv_selected> = abap_true.
ENDIF.
ENDIF.
mo_select_list_popup->refresh( ).
ENDMETHOD.
METHOD validate_folder_logic.
IF iv_folder_logic <> zif_abapgit_dot_abapgit=>c_folder_logic-prefix
AND iv_folder_logic <> zif_abapgit_dot_abapgit=>c_folder_logic-full.
zcx_abapgit_exception=>raise( |Invalid folder logic { iv_folder_logic }. |
&& |Choose either { zif_abapgit_dot_abapgit=>c_folder_logic-prefix } |
&& |or { zif_abapgit_dot_abapgit=>c_folder_logic-full } | ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~branch_list_popup.
DATA: lo_branches TYPE REF TO zcl_abapgit_git_branch_list,
lt_branches TYPE zif_abapgit_definitions=>ty_git_branch_list_tt,
lv_answer TYPE c LENGTH 1,
lv_default TYPE i,
lv_head_suffix TYPE string,
lv_head_symref TYPE string,
lv_text TYPE string,
lt_selection TYPE TABLE OF spopli.
FIELD-SYMBOLS: <ls_sel> LIKE LINE OF lt_selection,
<ls_branch> LIKE LINE OF lt_branches.
lo_branches = zcl_abapgit_git_transport=>branches( iv_url ).
lt_branches = lo_branches->get_branches_only( ).
lv_head_suffix = | ({ zif_abapgit_definitions=>c_head_name })|.
lv_head_symref = lo_branches->get_head_symref( ).
IF iv_hide_branch IS NOT INITIAL.
DELETE lt_branches WHERE name = iv_hide_branch.
ENDIF.
IF iv_hide_head IS NOT INITIAL.
DELETE lt_branches WHERE name = zif_abapgit_definitions=>c_head_name
OR is_head = abap_true.
ENDIF.
IF lt_branches IS INITIAL.
IF iv_hide_head IS NOT INITIAL.
lv_text = 'master'.
ENDIF.
IF iv_hide_branch IS NOT INITIAL AND iv_hide_branch <> 'refs/heads/master'.
IF lv_text IS INITIAL.
lv_text = iv_hide_branch && ' is'.
ELSE.
CONCATENATE lv_text 'and' iv_hide_branch 'are' INTO lv_text SEPARATED BY space.
ENDIF.
ELSE.
lv_text = lv_text && ' is'.
ENDIF.
IF lv_text IS NOT INITIAL.
zcx_abapgit_exception=>raise( 'No branches available to select (' && lv_text && ' hidden)' ).
ELSE.
zcx_abapgit_exception=>raise( 'No branches are available to select' ).
ENDIF.
ENDIF.
LOOP AT lt_branches ASSIGNING <ls_branch>.
CHECK <ls_branch>-name IS NOT INITIAL. " To ensure some below ifs
IF <ls_branch>-is_head = abap_true.
IF <ls_branch>-name = zif_abapgit_definitions=>c_head_name. " HEAD
IF <ls_branch>-name <> lv_head_symref AND lv_head_symref IS NOT INITIAL.
" HEAD but other HEAD symref exists - ignore
CONTINUE.
ELSE.
INSERT INITIAL LINE INTO lt_selection INDEX 1 ASSIGNING <ls_sel>.
<ls_sel>-varoption = <ls_branch>-name.
ENDIF.
ELSE.
INSERT INITIAL LINE INTO lt_selection INDEX 1 ASSIGNING <ls_sel>.
<ls_sel>-varoption = <ls_branch>-display_name && lv_head_suffix.
ENDIF.
IF lv_default > 0. " Shift down default if set
lv_default = lv_default + 1.
ENDIF.
ELSE.
APPEND INITIAL LINE TO lt_selection ASSIGNING <ls_sel>.
<ls_sel>-varoption = <ls_branch>-display_name.
ENDIF.
IF <ls_branch>-name = iv_default_branch.
IF <ls_branch>-is_head = abap_true.
lv_default = 1.
ELSE.
lv_default = sy-tabix.
ENDIF.
ENDIF.
ENDLOOP.
IF iv_show_new_option = abap_true.
APPEND INITIAL LINE TO lt_selection ASSIGNING <ls_sel>.
<ls_sel>-varoption = zif_abapgit_popups=>c_new_branch_label.
ENDIF.
CALL FUNCTION 'POPUP_TO_DECIDE_LIST'
EXPORTING
textline1 = 'Select branch'
titel = 'Select branch'
start_col = 30
start_row = 5
cursorline = lv_default
IMPORTING
answer = lv_answer
TABLES
t_spopli = lt_selection
EXCEPTIONS
OTHERS = 1. "#EC NOTEXT
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error from POPUP_TO_DECIDE_LIST' ).
ENDIF.
IF lv_answer = c_answer_cancel.
RETURN.
ENDIF.
READ TABLE lt_selection ASSIGNING <ls_sel> WITH KEY selflag = abap_true.
ASSERT sy-subrc = 0.
IF iv_show_new_option = abap_true AND <ls_sel>-varoption = zif_abapgit_popups=>c_new_branch_label.
rs_branch-name = zif_abapgit_popups=>c_new_branch_label.
ELSE.
REPLACE FIRST OCCURRENCE OF lv_head_suffix IN <ls_sel>-varoption WITH ''.
READ TABLE lt_branches WITH KEY display_name = <ls_sel>-varoption ASSIGNING <ls_branch>.
IF sy-subrc <> 0.
* branch name longer than 65 characters
LOOP AT lt_branches ASSIGNING <ls_branch> WHERE display_name CS <ls_sel>-varoption.
EXIT. " current loop
ENDLOOP.
ENDIF.
ASSERT <ls_branch> IS ASSIGNED.
rs_branch = lo_branches->find_by_name( <ls_branch>-name ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~branch_popup_callback.
DATA: lv_url TYPE string,
ls_package_data TYPE scompkdtln,
ls_branch TYPE zif_abapgit_definitions=>ty_git_branch,
lv_create TYPE abap_bool,
lv_text TYPE string.
FIELD-SYMBOLS: <ls_furl> LIKE LINE OF ct_fields,
<ls_fbranch> LIKE LINE OF ct_fields,
<ls_fpackage> LIKE LINE OF ct_fields.
CLEAR cs_error.
IF iv_code = 'COD1'.
cv_show_popup = abap_true.
READ TABLE ct_fields ASSIGNING <ls_furl> WITH KEY tabname = 'ABAPTXT255'.
IF sy-subrc <> 0 OR <ls_furl>-value IS INITIAL.
MESSAGE 'Fill URL' TYPE 'S' DISPLAY LIKE 'E'. "#EC NOTEXT
RETURN.
ENDIF.
lv_url = <ls_furl>-value.
ls_branch = branch_list_popup( lv_url ).
IF ls_branch IS INITIAL.
RETURN.
ENDIF.
READ TABLE ct_fields ASSIGNING <ls_fbranch> WITH KEY tabname = 'TEXTL'.
ASSERT sy-subrc = 0.
<ls_fbranch>-value = ls_branch-name.
ELSEIF iv_code = 'COD2'.
cv_show_popup = abap_true.
READ TABLE ct_fields ASSIGNING <ls_fpackage> WITH KEY fieldname = 'DEVCLASS'.
ASSERT sy-subrc = 0.
ls_package_data-devclass = <ls_fpackage>-value.
IF zcl_abapgit_factory=>get_sap_package( ls_package_data-devclass )->exists( ) = abap_true.
lv_text = |Package { ls_package_data-devclass } already exists|.
MESSAGE lv_text TYPE 'I' DISPLAY LIKE 'E'.
RETURN.
ENDIF.
popup_to_create_package(
IMPORTING
es_package_data = ls_package_data
ev_create = lv_create ).
IF lv_create = abap_false.
RETURN.
ENDIF.
zcl_abapgit_factory=>get_sap_package( ls_package_data-devclass )->create( ls_package_data ).
COMMIT WORK.
<ls_fpackage>-value = ls_package_data-devclass.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~create_branch_popup.
DATA: lt_fields TYPE TABLE OF sval.
DATA: lv_name TYPE spo_value.
CLEAR: ev_name, ev_cancel.
add_field( EXPORTING iv_tabname = 'TEXTL'
iv_fieldname = 'LINE'
iv_fieldtext = 'Name'
iv_value = 'new-branch-name'
CHANGING ct_fields = lt_fields ).
TRY.
_popup_3_get_values( EXPORTING iv_popup_title = 'Create branch' "#EC NOTEXT
IMPORTING ev_value_1 = lv_name
CHANGING ct_fields = lt_fields ).
ev_name = zcl_abapgit_git_branch_list=>complete_heads_branch_name(
zcl_abapgit_git_branch_list=>normalize_branch_name( lv_name ) ).
CATCH zcx_abapgit_cancel.
ev_cancel = abap_true.
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_popups~package_popup_callback.
DATA: ls_package_data TYPE scompkdtln,
lv_create TYPE abap_bool.
FIELD-SYMBOLS: <ls_fpackage> LIKE LINE OF ct_fields.
CLEAR cs_error.
IF iv_code = 'COD1'.
cv_show_popup = abap_true.
READ TABLE ct_fields ASSIGNING <ls_fpackage> WITH KEY fieldname = 'DEVCLASS'.
ASSERT sy-subrc = 0.
ls_package_data-devclass = <ls_fpackage>-value.
popup_to_create_package( IMPORTING es_package_data = ls_package_data
ev_create = lv_create ).
IF lv_create = abap_false.
RETURN.
ENDIF.
zcl_abapgit_factory=>get_sap_package( ls_package_data-devclass )->create( ls_package_data ).
COMMIT WORK.
<ls_fpackage>-value = ls_package_data-devclass.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_folder_logic.
DATA: lt_fields TYPE TABLE OF sval.
DATA: lv_folder_logic TYPE spo_value.
CLEAR: rv_folder_logic.
add_field( EXPORTING iv_tabname = 'TDEVC'
iv_fieldname = 'INTSYS'
iv_fieldtext = 'Folder logic'
iv_value = 'PREFIX'
CHANGING ct_fields = lt_fields ).
TRY.
_popup_3_get_values( EXPORTING iv_popup_title = 'Export package' "#EC NOTEXT
iv_no_value_check = abap_true
IMPORTING ev_value_1 = lv_folder_logic
CHANGING ct_fields = lt_fields ).
rv_folder_logic = to_upper( lv_folder_logic ).
CATCH zcx_abapgit_cancel.
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_object.
DATA: lt_fields TYPE TABLE OF sval.
DATA: lv_object_type TYPE spo_value.
DATA: lv_object_name TYPE spo_value.
CLEAR: rs_tadir-object, rs_tadir-obj_name.
add_field( EXPORTING iv_tabname = 'TADIR'
iv_fieldname = 'OBJECT'
iv_fieldtext = 'Type'
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'TADIR'
iv_fieldname = 'OBJ_NAME'
iv_fieldtext = 'Name'
CHANGING ct_fields = lt_fields ).
_popup_3_get_values( EXPORTING iv_popup_title = 'Object' "#EC NOTEXT
iv_no_value_check = abap_true
IMPORTING ev_value_1 = lv_object_type
ev_value_2 = lv_object_name
CHANGING ct_fields = lt_fields ).
rs_tadir = zcl_abapgit_factory=>get_tadir( )->read_single(
iv_object = to_upper( lv_object_type )
iv_obj_name = to_upper( lv_object_name ) ).
ENDMETHOD.
METHOD zif_abapgit_popups~popup_package_export.
DATA: lt_fields TYPE TABLE OF sval.
DATA: lv_package TYPE spo_value.
DATA: lv_folder_logic TYPE spo_value.
DATA: lv_serialize_master_lang_only TYPE spo_value.
add_field( EXPORTING iv_tabname = 'TDEVC'
iv_fieldname = 'DEVCLASS'
iv_fieldtext = 'Package'
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'TDEVC'
iv_fieldname = 'INTSYS'
iv_fieldtext = 'Folder logic'
iv_value = 'PREFIX'
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'TVDIR'
iv_fieldname = 'FLAG'
iv_fieldtext = 'Master lang only'
CHANGING ct_fields = lt_fields ).
TRY.
_popup_3_get_values( EXPORTING iv_popup_title = 'Export package' "#EC NOTEXT
iv_no_value_check = abap_true
IMPORTING ev_value_1 = lv_package
ev_value_2 = lv_folder_logic
ev_value_3 = lv_serialize_master_lang_only
CHANGING ct_fields = lt_fields ).
ev_package = to_upper( lv_package ).
ev_folder_logic = to_upper( lv_folder_logic ).
ev_serialize_master_lang_only = boolc( lv_serialize_master_lang_only IS NOT INITIAL ).
CATCH zcx_abapgit_cancel.
ENDTRY.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_proxy_bypass.
rt_proxy_bypass = it_proxy_bypass.
CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
EXPORTING
title = 'Bypass proxy settings for these Hosts & Domains'
signed = abap_false
lower_case = abap_true
no_interval_check = abap_true
TABLES
range = rt_proxy_bypass
EXCEPTIONS
no_range_tab = 1
cancelled = 2
internal_error = 3
invalid_fieldname = 4
OTHERS = 5.
CASE sy-subrc.
WHEN 0.
WHEN 2.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
WHEN OTHERS.
zcx_abapgit_exception=>raise( 'Error from COMPLEX_SELECTIONS_DIALOG' ).
ENDCASE.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_search_help.
DATA lt_ret TYPE TABLE OF ddshretval.
DATA ls_ret LIKE LINE OF lt_ret.
DATA lv_tabname TYPE dfies-tabname.
DATA lv_fieldname TYPE dfies-fieldname.
SPLIT iv_tab_field AT '-' INTO lv_tabname lv_fieldname.
lv_tabname = to_upper( lv_tabname ).
lv_fieldname = to_upper( lv_fieldname ).
CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
EXPORTING
tabname = lv_tabname
fieldname = lv_fieldname
TABLES
return_tab = lt_ret
EXCEPTIONS
OTHERS = 5.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( |F4IF_FIELD_VALUE_REQUEST error [{ iv_tab_field }]| ).
ENDIF.
IF lines( lt_ret ) > 0.
READ TABLE lt_ret INDEX 1 INTO ls_ret.
ASSERT sy-subrc = 0.
rv_value = ls_ret-fieldval.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_to_confirm.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = iv_titlebar
text_question = iv_text_question
text_button_1 = iv_text_button_1
icon_button_1 = iv_icon_button_1
text_button_2 = iv_text_button_2
icon_button_2 = iv_icon_button_2
default_button = iv_default_button
display_cancel_button = iv_display_cancel_button
IMPORTING
answer = rv_answer
EXCEPTIONS
text_not_found = 1
OTHERS = 2. "#EC NOTEXT
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'error from POPUP_TO_CONFIRM' ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_to_create_package.
CALL FUNCTION 'FUNCTION_EXISTS'
EXPORTING
funcname = 'PB_POPUP_PACKAGE_CREATE'
EXCEPTIONS
function_not_exist = 1
OTHERS = 2.
IF sy-subrc = 1.
* looks like the function module used does not exist on all
* versions since 702, so show an error
zcx_abapgit_exception=>raise( 'Your system does not support automatic creation of packages.' &&
'Please, create the package manually.' ).
ENDIF.
CALL FUNCTION 'PB_POPUP_PACKAGE_CREATE'
CHANGING
p_object_data = es_package_data
EXCEPTIONS
action_cancelled = 1.
IF sy-subrc = 0.
ev_create = abap_true.
ELSE.
ev_create = abap_false.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_to_create_transp_branch.
DATA: lt_fields TYPE TABLE OF sval,
lv_transports_as_text TYPE string,
lv_desc_as_text TYPE string,
ls_transport_header LIKE LINE OF it_transport_headers.
DATA: lv_branch_name TYPE spo_value.
DATA: lv_commit_text TYPE spo_value.
CLEAR: rs_transport_branch-branch_name, rs_transport_branch-commit_text.
" If we only have one transport selected set branch name to Transport
" name and commit description to transport description.
IF lines( it_transport_headers ) = 1.
READ TABLE it_transport_headers INDEX 1 INTO ls_transport_header.
lv_transports_as_text = ls_transport_header-trkorr.
SELECT SINGLE as4text FROM e07t INTO lv_desc_as_text WHERE
trkorr = ls_transport_header-trkorr AND
langu = sy-langu.
ELSE. " Else set branch name and commit message to 'Transport(s)_TRXXXXXX_TRXXXXX'
lv_transports_as_text = 'Transport(s)'.
LOOP AT it_transport_headers INTO ls_transport_header.
CONCATENATE lv_transports_as_text '_' ls_transport_header-trkorr INTO lv_transports_as_text.
ENDLOOP.
lv_desc_as_text = lv_transports_as_text.
ENDIF.
add_field( EXPORTING iv_tabname = 'TEXTL'
iv_fieldname = 'LINE'
iv_fieldtext = 'Branch name'
iv_value = lv_transports_as_text
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'ABAPTXT255'
iv_fieldname = 'LINE'
iv_fieldtext = 'Commit text'
iv_value = lv_desc_as_text
CHANGING ct_fields = lt_fields ).
_popup_3_get_values( EXPORTING iv_popup_title = 'Transport to new Branch' "#EC NOTEXT
IMPORTING ev_value_1 = lv_branch_name
ev_value_2 = lv_commit_text
CHANGING ct_fields = lt_fields ).
rs_transport_branch-branch_name = lv_branch_name.
rs_transport_branch-commit_text = lv_commit_text.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_to_inform.
DATA: lv_line1 TYPE c LENGTH 70,
lv_line2 TYPE c LENGTH 70.
lv_line1 = iv_text_message.
IF strlen( iv_text_message ) > 70.
lv_line2 = iv_text_message+70.
ENDIF.
CALL FUNCTION 'POPUP_TO_INFORM'
EXPORTING
titel = iv_titlebar
txt1 = lv_line1
txt2 = lv_line2.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_to_select_from_list.
DATA: lv_pfstatus TYPE sypfkey,
lo_events TYPE REF TO cl_salv_events_table,
lo_functions TYPE REF TO cl_salv_functions_list,
lo_columns TYPE REF TO cl_salv_columns_table,
lt_columns TYPE salv_t_column_ref,
ls_column TYPE salv_s_column_ref,
lo_column TYPE REF TO cl_salv_column_list,
lo_table_header TYPE REF TO cl_salv_form_text.
FIELD-SYMBOLS: <lt_table> TYPE STANDARD TABLE,
<ls_column_to_display> TYPE zif_abapgit_definitions=>ty_alv_column.
CLEAR: et_list.
create_new_table( it_list ).
ASSIGN mr_table->* TO <lt_table>.
ASSERT sy-subrc = 0.
TRY.
cl_salv_table=>factory( IMPORTING r_salv_table = mo_select_list_popup
CHANGING t_table = <lt_table> ).
CASE iv_selection_mode.
WHEN if_salv_c_selection_mode=>single.
lv_pfstatus = '110'.
WHEN OTHERS.
lv_pfstatus = '102'.
ENDCASE.
mo_select_list_popup->set_screen_status( pfstatus = lv_pfstatus
report = 'SAPMSVIM' ).
mo_select_list_popup->set_screen_popup( start_column = iv_start_column
end_column = iv_end_column
start_line = iv_start_line
end_line = iv_end_line ).
lo_events = mo_select_list_popup->get_event( ).
SET HANDLER on_select_list_link_click FOR lo_events.
SET HANDLER on_select_list_function_click FOR lo_events.
SET HANDLER on_double_click FOR lo_events.
IF iv_title CN ' _0'.
mo_select_list_popup->get_display_settings( )->set_list_header( iv_title ).
ENDIF.
IF iv_header_text CN ' _0'.
CREATE OBJECT lo_table_header
EXPORTING
text = iv_header_text.
mo_select_list_popup->set_top_of_list( lo_table_header ).
ENDIF.
mo_select_list_popup->get_display_settings( )->set_striped_pattern( iv_striped_pattern ).
mo_select_list_popup->get_selections( )->set_selection_mode( iv_selection_mode ).
lo_columns = mo_select_list_popup->get_columns( ).
lt_columns = lo_columns->get( ).
lo_columns->set_optimize( iv_optimize_col_width ).
LOOP AT lt_columns INTO ls_column.
lo_column ?= ls_column-r_column.
IF iv_selection_mode = if_salv_c_selection_mode=>multiple
AND ls_column-columnname = c_fieldname_selected.
lo_column->set_cell_type( if_salv_c_cell_type=>checkbox_hotspot ).
lo_column->set_output_length( 20 ).
lo_column->set_short_text( |{ iv_select_column_text }| ).
lo_column->set_medium_text( |{ iv_select_column_text }| ).
lo_column->set_long_text( |{ iv_select_column_text }| ).
CONTINUE.
ENDIF.
READ TABLE it_columns_to_display
ASSIGNING <ls_column_to_display>
WITH KEY name = ls_column-columnname.
CASE sy-subrc.
WHEN 0.
IF <ls_column_to_display>-text CN ' _0'.
lo_column->set_short_text( |{ <ls_column_to_display>-text }| ).
lo_column->set_medium_text( |{ <ls_column_to_display>-text }| ).
lo_column->set_long_text( |{ <ls_column_to_display>-text }| ).
ENDIF.
IF <ls_column_to_display>-length > 0.
lo_column->set_output_length( <ls_column_to_display>-length ).
ENDIF.
WHEN OTHERS.
" Hide column
lo_column->set_technical( abap_true ).
ENDCASE.
ENDLOOP.
mo_select_list_popup->display( ).
CATCH cx_salv_msg.
zcx_abapgit_exception=>raise( 'Error from POPUP_TO_SELECT_FROM_LIST' ).
ENDTRY.
IF mv_cancel = abap_true.
mv_cancel = abap_false.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
ENDIF.
get_selected_rows( IMPORTING et_list = et_list ).
CLEAR: mo_select_list_popup,
mr_table,
mo_table_descr.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_to_select_transports.
* todo, method to be renamed, it only returns one transport
DATA: lv_trkorr TYPE e070-trkorr,
ls_trkorr LIKE LINE OF rt_trkorr.
CALL FUNCTION 'TR_F4_REQUESTS'
IMPORTING
ev_selected_request = lv_trkorr.
IF NOT lv_trkorr IS INITIAL.
ls_trkorr-trkorr = lv_trkorr.
APPEND ls_trkorr TO rt_trkorr.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~popup_transport_request.
DATA: lt_e071 TYPE STANDARD TABLE OF e071,
lt_e071k TYPE STANDARD TABLE OF e071k.
CALL FUNCTION 'TRINT_ORDER_CHOICE'
EXPORTING
wi_order_type = is_transport_type-request
wi_task_type = is_transport_type-task
IMPORTING
we_order = rv_transport
TABLES
wt_e071 = lt_e071
wt_e071k = lt_e071k
EXCEPTIONS
no_correction_selected = 1
display_mode = 2
object_append_error = 3
recursive_call = 4
wrong_order_type = 5
OTHERS = 6.
IF sy-subrc = 1.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
ELSEIF sy-subrc > 1.
zcx_abapgit_exception=>raise( |Error from TRINT_ORDER_CHOICE { sy-subrc }| ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_popups~repo_new_offline.
DATA: lv_returncode TYPE c,
lt_fields TYPE TABLE OF sval,
lv_icon_ok TYPE icon-name,
lv_button1 TYPE svalbutton-buttontext,
lv_icon1 TYPE icon-name,
lv_finished TYPE abap_bool,
lx_error TYPE REF TO zcx_abapgit_exception.
FIELD-SYMBOLS: <ls_field> LIKE LINE OF lt_fields.
add_field( EXPORTING iv_tabname = 'ABAPTXT255'
iv_fieldname = 'LINE'
iv_fieldtext = 'Name'
iv_obligatory = abap_true
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'TDEVC'
iv_fieldname = 'DEVCLASS'
iv_fieldtext = 'Package'
iv_obligatory = abap_true
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'ZABAPGIT'
iv_fieldname = 'VALUE'
iv_fieldtext = 'Folder logic'
iv_obligatory = abap_true
iv_value = zif_abapgit_dot_abapgit=>c_folder_logic-prefix
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'DOKIL'
iv_fieldname = 'MASTERLANG'
iv_fieldtext = 'Master language only'
iv_value = abap_true
CHANGING ct_fields = lt_fields ).
WHILE lv_finished = abap_false.
lv_icon_ok = icon_okay.
lv_button1 = 'Create package' ##NO_TEXT.
lv_icon1 = icon_folder.
CALL FUNCTION 'POPUP_GET_VALUES_USER_BUTTONS'
EXPORTING
popup_title = 'New Offline Project'
programname = sy-cprog
formname = 'PACKAGE_POPUP'
ok_pushbuttontext = 'OK'
icon_ok_push = lv_icon_ok
first_pushbutton = lv_button1
icon_button_1 = lv_icon1
second_pushbutton = ''
icon_button_2 = ''
IMPORTING
returncode = lv_returncode
TABLES
fields = lt_fields
EXCEPTIONS
error_in_fields = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error from POPUP_GET_VALUES' ).
ENDIF.
IF lv_returncode = c_answer_cancel.
rs_popup-cancel = abap_true.
RETURN.
ENDIF.
READ TABLE lt_fields INDEX 1 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
rs_popup-url = <ls_field>-value.
READ TABLE lt_fields INDEX 2 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
TRANSLATE <ls_field>-value TO UPPER CASE.
rs_popup-package = <ls_field>-value.
READ TABLE lt_fields INDEX 3 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
TRANSLATE <ls_field>-value TO UPPER CASE.
rs_popup-folder_logic = <ls_field>-value.
READ TABLE lt_fields INDEX 4 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
rs_popup-master_lang_only = <ls_field>-value.
lv_finished = abap_true.
TRY.
zcl_abapgit_repo_srv=>get_instance( )->validate_package( iv_package = rs_popup-package
iv_chk_exists = abap_false ).
validate_folder_logic( rs_popup-folder_logic ).
CATCH zcx_abapgit_exception INTO lx_error.
" in case of validation errors we display the popup again
MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'.
CLEAR lv_finished.
ENDTRY.
ENDWHILE.
ENDMETHOD.
METHOD zif_abapgit_popups~repo_popup.
DATA: lv_returncode TYPE c,
lv_icon_ok TYPE icon-name,
lv_icon_br TYPE icon-name,
lt_fields TYPE TABLE OF sval,
lv_uattr TYPE spo_fattr,
lv_pattr TYPE spo_fattr,
lv_button2 TYPE svalbutton-buttontext,
lv_icon2 TYPE icon-name,
lv_package TYPE tdevc-devclass,
lv_url TYPE abaptxt255-line,
lv_branch TYPE textl-line,
lv_display_name TYPE trm255-text,
lv_folder_logic TYPE string,
lv_ign_subpkg TYPE abap_bool,
lv_finished TYPE abap_bool,
lv_master_lang_only TYPE abap_bool,
lx_error TYPE REF TO zcx_abapgit_exception.
IF iv_freeze_url = abap_true.
lv_uattr = '05'.
ENDIF.
IF iv_freeze_package = abap_true.
lv_pattr = '05'.
ENDIF.
IF iv_package IS INITIAL. " Empty package -> can be created
lv_button2 = 'Create package' ##NO_TEXT.
lv_icon2 = icon_folder.
ENDIF.
lv_display_name = iv_display_name.
lv_package = iv_package.
lv_url = iv_url.
lv_branch = iv_branch.
WHILE lv_finished = abap_false.
CLEAR: lt_fields.
add_field( EXPORTING iv_tabname = 'ABAPTXT255'
iv_fieldname = 'LINE'
iv_fieldtext = 'Git clone URL'
iv_value = lv_url
iv_field_attr = lv_uattr
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'TDEVC'
iv_fieldname = 'DEVCLASS'
iv_fieldtext = 'Package'
iv_value = lv_package
iv_field_attr = lv_pattr
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'TEXTL'
iv_fieldname = 'LINE'
iv_fieldtext = 'Branch'
iv_value = lv_branch
iv_field_attr = '05'
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'TRM255'
iv_fieldname = 'TEXT'
iv_fieldtext = 'Display name (opt.)'
iv_value = lv_display_name
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'TADIR'
iv_fieldname = 'AUTHOR'
iv_fieldtext = 'Folder logic'
iv_obligatory = abap_true
iv_value = zif_abapgit_dot_abapgit=>c_folder_logic-prefix
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'TDEVC'
iv_fieldname = 'IS_ENHANCEABLE'
iv_fieldtext = 'Ignore subpackages'
iv_value = abap_false
CHANGING ct_fields = lt_fields ).
add_field( EXPORTING iv_tabname = 'DOKIL'
iv_fieldname = 'MASTERLANG'
iv_fieldtext = 'Master language only'
iv_value = abap_true
CHANGING ct_fields = lt_fields ).
lv_icon_ok = icon_okay.
lv_icon_br = icon_workflow_fork.
CALL FUNCTION 'POPUP_GET_VALUES_USER_BUTTONS'
EXPORTING
popup_title = iv_title
programname = sy-cprog
formname = 'BRANCH_POPUP'
ok_pushbuttontext = 'OK'
icon_ok_push = lv_icon_ok
first_pushbutton = 'Select branch'
icon_button_1 = lv_icon_br
second_pushbutton = lv_button2
icon_button_2 = lv_icon2
IMPORTING
returncode = lv_returncode
TABLES
fields = lt_fields
EXCEPTIONS
error_in_fields = 1
OTHERS = 2. "#EC NOTEXT
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error from POPUP_GET_VALUES' ).
ENDIF.
IF lv_returncode = c_answer_cancel.
rs_popup-cancel = abap_true.
RETURN.
ENDIF.
extract_field_values(
EXPORTING
it_fields = lt_fields
IMPORTING
ev_url = lv_url
ev_package = lv_package
ev_branch = lv_branch
ev_display_name = lv_display_name
ev_folder_logic = lv_folder_logic
ev_ign_subpkg = lv_ign_subpkg
ev_master_lang_only = lv_master_lang_only ).
lv_finished = abap_true.
TRY.
IF iv_freeze_url = abap_false.
zcl_abapgit_url=>validate( |{ lv_url }| ).
ENDIF.
IF iv_freeze_package = abap_false.
zcl_abapgit_repo_srv=>get_instance( )->validate_package( iv_package = lv_package
iv_ign_subpkg = lv_ign_subpkg
iv_chk_exists = abap_false ).
ENDIF.
validate_folder_logic( lv_folder_logic ).
CATCH zcx_abapgit_exception INTO lx_error.
MESSAGE lx_error TYPE 'S' DISPLAY LIKE 'E'.
" in case of validation errors we display the popup again
CLEAR lv_finished.
ENDTRY.
ENDWHILE.
rs_popup-url = lv_url.
rs_popup-package = lv_package.
rs_popup-branch_name = lv_branch.
rs_popup-display_name = lv_display_name.
rs_popup-folder_logic = lv_folder_logic.
rs_popup-ign_subpkg = lv_ign_subpkg.
rs_popup-master_lang_only = lv_master_lang_only.
ENDMETHOD.
METHOD _popup_3_get_values.
DATA lv_answer TYPE c LENGTH 1.
FIELD-SYMBOLS: <ls_field> TYPE sval.
CALL FUNCTION 'POPUP_GET_VALUES'
EXPORTING
no_value_check = iv_no_value_check
popup_title = iv_popup_title
IMPORTING
returncode = lv_answer
TABLES
fields = ct_fields
EXCEPTIONS
OTHERS = 1 ##NO_TEXT.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'Error from POPUP_GET_VALUES' ).
ENDIF.
IF lv_answer = c_answer_cancel.
RAISE EXCEPTION TYPE zcx_abapgit_cancel.
ENDIF.
IF ev_value_1 IS SUPPLIED.
READ TABLE ct_fields INDEX 1 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_value_1 = <ls_field>-value.
ENDIF.
IF ev_value_2 IS SUPPLIED.
READ TABLE ct_fields INDEX 2 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_value_2 = <ls_field>-value.
ENDIF.
IF ev_value_3 IS SUPPLIED.
READ TABLE ct_fields INDEX 3 ASSIGNING <ls_field>.
ASSERT sy-subrc = 0.
ev_value_3 = <ls_field>-value.
ENDIF.
ENDMETHOD.
ENDCLASS.
| 32.594575 | 103 | 0.607424 |
7905f8dc8a3a8fbce83024c6716b379f63c26114 | 1,414 | abap | ABAP | src/test/ztcl_alog_test_utl.clas.abap | pcf0/abap-log | f3e5d269b52f05fe03fe152c5f8e88f8bf3b1080 | [
"MIT"
] | 27 | 2017-05-04T20:16:58.000Z | 2022-02-11T17:56:17.000Z | src/test/ztcl_alog_test_utl.clas.abap | pcf0/abap-log | f3e5d269b52f05fe03fe152c5f8e88f8bf3b1080 | [
"MIT"
] | 13 | 2017-04-23T15:35:10.000Z | 2019-09-03T17:10:04.000Z | src/test/ztcl_alog_test_utl.clas.abap | pcf0/abap-log | f3e5d269b52f05fe03fe152c5f8e88f8bf3b1080 | [
"MIT"
] | 14 | 2017-11-20T10:53:29.000Z | 2022-02-17T13:45:58.000Z | "! ABAP Unit test utilities
CLASS ztcl_alog_test_utl DEFINITION
PUBLIC
FINAL
CREATE PRIVATE
FOR TESTING.
PUBLIC SECTION.
CLASS-METHODS:
"! @parameter rv_text | Random text between 1 and 200 characters long
get_random_log_text RETURNING VALUE(rv_text) TYPE string,
"! @parameter ro_type | Random log entry type
get_random_log_type RETURNING VALUE(ro_type) TYPE REF TO zcl_alog_entry_type.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS ztcl_alog_test_utl IMPLEMENTATION.
METHOD get_random_log_text.
STATICS: so_rnd TYPE REF TO cl_abap_random_int.
IF so_rnd IS NOT BOUND.
so_rnd = cl_abap_random_int=>create( min = 1 max = 200 ).
ENDIF.
CALL FUNCTION 'GENERAL_GET_RANDOM_STRING'
EXPORTING
number_chars = so_rnd->get_next( )
IMPORTING
random_string = rv_text.
ENDMETHOD.
METHOD get_random_log_type.
STATICS: so_rnd TYPE REF TO cl_abap_random_int.
IF so_rnd IS NOT BOUND.
so_rnd = cl_abap_random_int=>create( min = 1 max = 4 ).
ENDIF.
ro_type = SWITCH #( LET rnd = so_rnd->get_next( ) IN rnd
WHEN 1 THEN zcl_alog_entry_type=>go_info
WHEN 2 THEN zcl_alog_entry_type=>go_warning
WHEN 3 THEN zcl_alog_entry_type=>go_error
WHEN 4 THEN zcl_alog_entry_type=>go_debug ).
ENDMETHOD.
ENDCLASS.
| 28.857143 | 83 | 0.677511 |
79062dd390a217a5ab83c6621fbde92821ba3bcb | 6,702 | abap | ABAP | src/zcx_abapgit_exception.clas.abap | habrahams/abapGit | 1f3abfd8eccf6cc90351320cac80b84d8a94702c | [
"MIT"
] | null | null | null | src/zcx_abapgit_exception.clas.abap | habrahams/abapGit | 1f3abfd8eccf6cc90351320cac80b84d8a94702c | [
"MIT"
] | null | null | null | src/zcx_abapgit_exception.clas.abap | habrahams/abapGit | 1f3abfd8eccf6cc90351320cac80b84d8a94702c | [
"MIT"
] | null | null | null | "! abapGit general error
CLASS zcx_abapgit_exception DEFINITION
PUBLIC
INHERITING FROM cx_static_check
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_t100_message .
DATA msgv1 TYPE symsgv READ-ONLY .
DATA msgv2 TYPE symsgv READ-ONLY .
DATA msgv3 TYPE symsgv READ-ONLY .
DATA msgv4 TYPE symsgv READ-ONLY .
DATA mt_callstack TYPE abap_callstack READ-ONLY .
"! Raise exception with text
"! @parameter iv_text | Text
"! @parameter ix_previous | Previous exception
"! @raising zcx_abapgit_exception | Exception
CLASS-METHODS raise
IMPORTING
!iv_text TYPE clike
!ix_previous TYPE REF TO cx_root OPTIONAL
RAISING
zcx_abapgit_exception .
"! Raise exception with T100 message
"! <p>
"! Will default to sy-msg* variables. These need to be set right before calling this method.
"! </p>
"! @parameter iv_msgid | Message ID
"! @parameter iv_msgno | Message number
"! @parameter iv_msgv1 | Message variable 1
"! @parameter iv_msgv2 | Message variable 2
"! @parameter iv_msgv3 | Message variable 3
"! @parameter iv_msgv4 | Message variable 4
"! @raising zcx_abapgit_exception | Exception
CLASS-METHODS raise_t100
IMPORTING
VALUE(iv_msgid) TYPE symsgid DEFAULT sy-msgid
VALUE(iv_msgno) TYPE symsgno DEFAULT sy-msgno
VALUE(iv_msgv1) TYPE symsgv DEFAULT sy-msgv1
VALUE(iv_msgv2) TYPE symsgv DEFAULT sy-msgv2
VALUE(iv_msgv3) TYPE symsgv DEFAULT sy-msgv3
VALUE(iv_msgv4) TYPE symsgv DEFAULT sy-msgv4
RAISING
zcx_abapgit_exception .
METHODS constructor
IMPORTING
!textid LIKE if_t100_message=>t100key OPTIONAL
!previous LIKE previous OPTIONAL
!msgv1 TYPE symsgv OPTIONAL
!msgv2 TYPE symsgv OPTIONAL
!msgv3 TYPE symsgv OPTIONAL
!msgv4 TYPE symsgv OPTIONAL .
CLASS-METHODS raise_with_text
IMPORTING
!ix_previous TYPE REF TO cx_root
RAISING
zcx_abapgit_exception .
METHODS get_source_position
REDEFINITION .
METHODS if_message~get_longtext
REDEFINITION .
PROTECTED SECTION.
PRIVATE SECTION.
CONSTANTS:
gc_generic_error_msg TYPE string VALUE `An error occured (ZCX_ABAPGIT_EXCEPTION)` ##NO_TEXT.
METHODS:
save_callstack.
ENDCLASS.
CLASS ZCX_ABAPGIT_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.
save_callstack( ).
ENDMETHOD.
METHOD get_source_position.
FIELD-SYMBOLS: <ls_callstack> TYPE abap_callstack_line.
READ TABLE mt_callstack ASSIGNING <ls_callstack>
INDEX 1.
IF sy-subrc = 0.
program_name = <ls_callstack>-mainprogram.
include_name = <ls_callstack>-include.
source_line = <ls_callstack>-line.
ELSE.
super->get_source_position(
IMPORTING
program_name = program_name
include_name = include_name
source_line = source_line ).
ENDIF.
ENDMETHOD.
METHOD if_message~get_longtext.
" You should remember that we have to call ZCL_ABAPGIT_MESSAGE_HELPER
" dynamically, because the compiled abapGit report puts the definition
" of the exception classes on the top and therefore ZCL_ABAPGIT_MESSAGE_HELPER
" isn't statically known
DATA: lo_message_helper TYPE REF TO object.
result = super->get_longtext( ).
IF if_t100_message~t100key IS NOT INITIAL.
CREATE OBJECT lo_message_helper TYPE ('ZCL_ABAPGIT_MESSAGE_HELPER')
EXPORTING
io_exception = me.
CALL METHOD lo_message_helper->('GET_T100_LONGTEXT')
RECEIVING
rv_longtext = result.
ENDIF.
ENDMETHOD.
METHOD raise.
DATA: lv_msgv1 TYPE symsgv,
lv_msgv2 TYPE symsgv,
lv_msgv3 TYPE symsgv,
lv_msgv4 TYPE symsgv,
ls_t100_key TYPE scx_t100key,
lv_text TYPE string.
IF iv_text IS INITIAL.
lv_text = gc_generic_error_msg.
ELSE.
lv_text = iv_text.
ENDIF.
CALL METHOD ('ZCL_ABAPGIT_MESSAGE_HELPER')=>set_msg_vars_for_clike
EXPORTING
iv_text = lv_text.
ls_t100_key-msgid = sy-msgid.
ls_t100_key-msgno = sy-msgno.
ls_t100_key-attr1 = 'MSGV1'.
ls_t100_key-attr2 = 'MSGV2'.
ls_t100_key-attr3 = 'MSGV3'.
ls_t100_key-attr4 = 'MSGV4'.
lv_msgv1 = sy-msgv1.
lv_msgv2 = sy-msgv2.
lv_msgv3 = sy-msgv3.
lv_msgv4 = sy-msgv4.
RAISE EXCEPTION TYPE zcx_abapgit_exception
EXPORTING
textid = ls_t100_key
msgv1 = lv_msgv1
msgv2 = lv_msgv2
msgv3 = lv_msgv3
msgv4 = lv_msgv4
previous = ix_previous.
ENDMETHOD.
METHOD raise_t100.
DATA: ls_t100_key TYPE scx_t100key.
ls_t100_key-msgid = iv_msgid.
ls_t100_key-msgno = iv_msgno.
ls_t100_key-attr1 = 'MSGV1'.
ls_t100_key-attr2 = 'MSGV2'.
ls_t100_key-attr3 = 'MSGV3'.
ls_t100_key-attr4 = 'MSGV4'.
IF iv_msgid IS INITIAL.
CLEAR ls_t100_key.
ENDIF.
RAISE EXCEPTION TYPE zcx_abapgit_exception
EXPORTING
textid = ls_t100_key
msgv1 = iv_msgv1
msgv2 = iv_msgv2
msgv3 = iv_msgv3
msgv4 = iv_msgv4.
ENDMETHOD.
METHOD raise_with_text.
raise(
iv_text = ix_previous->get_text( )
ix_previous = ix_previous ).
ENDMETHOD.
METHOD save_callstack.
FIELD-SYMBOLS: <ls_callstack> TYPE abap_callstack_line.
CALL FUNCTION 'SYSTEM_CALLSTACK'
IMPORTING
callstack = mt_callstack.
" You should remember that the first lines are from zcx_abapgit_exception
" and are removed so that highest level in the callstack is the position where
" the exception is raised.
"
" For the merged report it's hard to do that, because zcx_abapgit_exception
" isn't visible in the callstack. Therefore we have to check the Events.
LOOP AT mt_callstack ASSIGNING <ls_callstack>.
IF <ls_callstack>-mainprogram CP |ZCX_ABAPGIT_EXCEPTION*| " full
OR <ls_callstack>-blockname = `SAVE_CALLSTACK` " merged
OR <ls_callstack>-blockname = `CONSTRUCTOR` " merged
OR <ls_callstack>-blockname CP `RAISE*`. "merged
DELETE TABLE mt_callstack FROM <ls_callstack>.
ELSE.
EXIT.
ENDIF.
ENDLOOP.
ENDMETHOD.
ENDCLASS.
| 27.133603 | 98 | 0.667711 |
790f24b968dc808594fea3a32aaf6a42e56300b8 | 1,507 | abap | ABAP | src/zcl_ajson_mapping.clas.locals_def.abap | albertmink/ajson | 79a5d855e65ef71e6f28a02253701e23024d1ec8 | [
"MIT"
] | 23 | 2020-07-13T17:11:24.000Z | 2022-03-16T07:40:50.000Z | src/zcl_ajson_mapping.clas.locals_def.abap | albertmink/ajson | 79a5d855e65ef71e6f28a02253701e23024d1ec8 | [
"MIT"
] | 86 | 2020-07-13T16:56:37.000Z | 2022-03-26T10:37:59.000Z | src/zcl_ajson_mapping.clas.locals_def.abap | albertmink/ajson | 79a5d855e65ef71e6f28a02253701e23024d1ec8 | [
"MIT"
] | 14 | 2020-07-29T19:10:14.000Z | 2021-11-08T08:45:58.000Z | class lcl_mapping_fields definition.
public section.
interfaces zif_ajson_mapping.
aliases to_abap for zif_ajson_mapping~to_abap.
aliases to_json for zif_ajson_mapping~to_json.
methods constructor
importing
it_mapping_fields type zif_ajson_mapping~ty_mapping_fields optional.
protected section.
private section.
data mt_mapping_fields type zif_ajson_mapping~ty_mapping_fields.
endclass.
class lcl_mapping_to_upper definition.
public section.
interfaces zif_ajson_mapping.
methods constructor
importing
it_mapping_fields type zif_ajson_mapping~ty_mapping_fields optional.
protected section.
private section.
data mi_mapping_fields type ref to zif_ajson_mapping.
endclass.
class lcl_mapping_to_lower definition.
public section.
interfaces zif_ajson_mapping.
methods constructor
importing
it_mapping_fields type zif_ajson_mapping~ty_mapping_fields optional.
protected section.
private section.
data mi_mapping_fields type ref to zif_ajson_mapping.
endclass.
class lcl_mapping_camel definition.
public section.
interfaces zif_ajson_mapping.
methods constructor
importing
it_mapping_fields type zif_ajson_mapping~ty_mapping_fields optional
iv_first_json_upper type abap_bool default abap_true.
protected section.
private section.
data mv_first_json_upper type abap_bool.
data mi_mapping_fields type ref to zif_ajson_mapping.
endclass.
| 20.930556 | 77 | 0.778368 |
79123d0ad5f1be0560e04a880ae2e83a00ce5173 | 16,375 | abap | ABAP | src/ui/controllers/zcl_dbbr_variant_controller.clas.abap | reichr-dev/abap-db-browser | d513d49692f1f0ee613c8eab2c99e325ef5b78fe | [
"MIT"
] | 15 | 2020-02-05T10:38:12.000Z | 2022-02-11T18:06:17.000Z | src/ui/controllers/zcl_dbbr_variant_controller.clas.abap | reichr-dev/abap-db-browser | d513d49692f1f0ee613c8eab2c99e325ef5b78fe | [
"MIT"
] | 10 | 2021-01-19T07:45:37.000Z | 2021-07-15T19:08:54.000Z | src/ui/controllers/zcl_dbbr_variant_controller.clas.abap | reichr-dev/abap-db-browser | d513d49692f1f0ee613c8eab2c99e325ef5b78fe | [
"MIT"
] | 9 | 2020-04-08T19:13:18.000Z | 2021-10-02T12:53:39.000Z | "! <p class="shorttext synchronized" lang="en">Controlller zum Speichern/Lesen/Löschen von Varianten</p>
CLASS zcl_dbbr_variant_controller DEFINITION
PUBLIC
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES zif_uitb_screen_controller .
CONSTANTS:
BEGIN OF c_modes,
save TYPE int1 VALUE 1,
delete TYPE int1 VALUE 3,
END OF c_modes .
METHODS constructor
IMPORTING
iv_screen_mode TYPE zdbbr_selscreen_mode
if_default_variant_mode TYPE abap_bool OPTIONAL
if_alv_mode TYPE abap_bool OPTIONAL
iv_entity_id TYPE zsat_entity_id
iv_entity_name TYPE zsat_entity_id_raw
iv_mode TYPE int1
ir_s_global_data TYPE REF TO zdbbr_global_data
ir_t_selfields TYPE REF TO zdbbr_selfield_itab OPTIONAL
ir_t_selfields_multi TYPE REF TO zdbbr_selfield_itab OPTIONAL
ir_t_multi_or TYPE REF TO zdbbr_or_seltab_itab OPTIONAL
io_tabfields TYPE REF TO zcl_dbbr_tabfield_list
io_tabfields_grpd TYPE REF TO zcl_dbbr_tabfield_list .
METHODS call_variant_f4 .
PROTECTED SECTION.
PRIVATE SECTION.
ALIASES get_report_id
FOR zif_uitb_screen_controller~get_report_id .
ALIASES get_screen_id
FOR zif_uitb_screen_controller~get_screen_id .
DATA:
BEGIN OF ms_ui_refs,
variant_name TYPE REF TO zdbbr_variant_name,
variant_text TYPE REF TO ddtext,
xfilter_fields TYPE REF TO abap_bool,
xoutput_fields TYPE REF TO abap_bool,
xsort_fields TYPE REF TO abap_bool,
xcolumn_widths TYPE REF TO abap_bool,
variant_table_name TYPE REF TO tabname16,
variant_query_name TYPE REF TO zsat_query_name,
variant_for_table_title TYPE REF TO syst_title,
variant_for_query_title TYPE REF TO syst_title,
variant_for_cds_title TYPE REF TO syst_title,
variant_cds_name TYPE REF TO zsat_cds_view_name,
END OF ms_ui_refs .
DATA mr_t_selfields TYPE REF TO zdbbr_selfield_itab.
DATA mr_t_selfields_multi TYPE REF TO zdbbr_selfield_itab.
DATA mr_s_global_data TYPE REF TO zdbbr_global_data.
DATA mo_tabfields TYPE REF TO zcl_dbbr_tabfield_list .
DATA mo_tabfields_grouped TYPE REF TO zcl_dbbr_tabfield_list .
DATA mv_mode TYPE int1 .
DATA mr_multi_or_itab TYPE REF TO zdbbr_or_seltab_itab .
"! <p class="shorttext synchronized" lang="en">Mode for Seleciton Screen of DB Browser</p>
DATA mv_selscreen_mode TYPE zdbbr_selscreen_mode .
DATA mv_entity_id TYPE zsat_entity_id.
DATA mv_entity_name TYPE zsat_entity_id_raw.
DATA mf_default_variant_mode TYPE abap_bool.
DATA mf_alv_output TYPE abap_bool.
"! <p class="shorttext synchronized" lang="en">Delete variant</p>
METHODS delete_variant .
"! <p class="shorttext synchronized" lang="en">Create new variant</p>
METHODS create_variant .
"! <p class="shorttext synchronized" lang="en">Creates/updates default variant for given entity</p>
METHODS create_default_variant.
"! <p class="shorttext synchronized" lang="en">Returns 'X' if there are selection criteria</p>
METHODS exists_criteria
RETURNING
VALUE(rf_exists) TYPE abap_bool.
"! <p class="shorttext synchronized" lang="en">Persists the variant from the current data</p>
METHODS persist_variant
IMPORTING
iv_variant_id TYPE zdbbr_variant_id OPTIONAL.
ENDCLASS.
CLASS zcl_dbbr_variant_controller IMPLEMENTATION.
METHOD call_variant_f4.
*&---------------------------------------------------------------------*
*& Description: Calls value help for getting existing variant
*&---------------------------------------------------------------------*
TYPES: BEGIN OF lty_variant_f4,
variant_name TYPE zdbbr_variant_name,
description TYPE ddtext,
has_output_fields TYPE zdbbr_defined_outputfields,
has_sort_fields TYPE zdbbr_defined_sortfields,
created_by TYPE zsat_created_by,
END OF lty_variant_f4.
DATA: lt_variants TYPE TABLE OF lty_variant_f4.
" get variants from db
zcl_dbbr_variant_factory=>find_variants(
EXPORTING
iv_variant_name = ms_ui_refs-variant_name->*
iv_entity_id = mv_entity_id
iv_entity_type = mv_selscreen_mode
IMPORTING
et_variant_info = DATA(lt_variant_info)
).
lt_variants = CORRESPONDING #( lt_variant_info ).
DATA(lv_return) = zcl_dbbr_f4_helper=>call_int_table_f4(
it_table_search = lt_variants
iv_return_field_name = 'VARIANT_NAME'
).
IF lv_return IS NOT INITIAL.
ms_ui_refs-variant_name->* = lv_return.
ENDIF.
ENDMETHOD.
METHOD constructor.
mv_mode = iv_mode.
mf_default_variant_mode = if_default_variant_mode.
mf_alv_output = if_alv_mode.
mv_selscreen_mode = iv_screen_mode.
mv_entity_id = iv_entity_id.
mv_entity_name = iv_entity_name.
mo_tabfields = io_tabfields.
mo_tabfields_grouped = io_tabfields_grpd.
mr_multi_or_itab = ir_t_multi_or.
mr_s_global_data = ir_s_global_data.
mr_t_selfields = ir_t_selfields.
mr_t_selfields_multi = ir_t_selfields_multi.
" init some global data references
DATA(lr_data_cache) = zcl_uitb_data_cache=>get_instance( zif_dbbr_c_report_id=>main ).
ms_ui_refs-variant_name = CAST zdbbr_variant_name( lr_data_cache->get_data_ref( zif_dbbr_main_report_var_ids=>c_p_varnam ) ).
ms_ui_refs-variant_text = CAST ddtext( lr_data_cache->get_data_ref( zif_dbbr_main_report_var_ids=>c_p_vartxt ) ).
ms_ui_refs-xsort_fields = CAST boolean( lr_data_cache->get_data_ref( zif_dbbr_main_report_var_ids=>c_p_xsort ) ).
ms_ui_refs-xcolumn_widths = CAST abap_bool( lr_data_cache->get_data_ref( zif_dbbr_main_report_var_ids=>c_p_has_defined_column_widths ) ).
ms_ui_refs-xfilter_fields = CAST #( lr_data_cache->get_data_ref( zif_dbbr_main_report_var_ids=>c_p_has_selection_criteria ) ).
ms_ui_refs-xoutput_fields = CAST boolean( lr_data_cache->get_data_ref( zif_dbbr_main_report_var_ids=>c_p_xfield ) ).
ms_ui_refs-variant_table_name = CAST #( lr_data_cache->get_data_ref( zif_dbbr_main_report_var_ids=>c_p_tab ) ).
ms_ui_refs-variant_for_table_title = CAST syst_title( lr_data_cache->get_data_ref( zif_dbbr_main_report_var_ids=>c_tvar_t ) ).
ms_ui_refs-variant_for_query_title = CAST syst_title( lr_data_cache->get_data_ref( zif_dbbr_main_report_var_ids=>c_svar_t ) ).
ms_ui_refs-variant_for_cds_title = CAST syst_title( lr_data_cache->get_data_ref( zif_dbbr_main_report_var_ids=>c_t_cds_view_variant ) ).
ms_ui_refs-variant_query_name = CAST #( lr_data_cache->get_data_ref( zif_dbbr_main_report_var_ids=>c_p_scrnam ) ).
ms_ui_refs-variant_cds_name = CAST #( lr_data_cache->get_data_ref( zif_dbbr_main_report_var_ids=>c_p_cds_view_name ) ).
ENDMETHOD.
METHOD create_variant.
IF zcl_dbbr_variant_factory=>variant_exists( iv_variant_name = ms_ui_refs-variant_name->*
iv_entity_id = mv_entity_id
iv_entity_type = mv_selscreen_mode ).
IF zcl_dbbr_appl_util=>popup_to_confirm(
iv_title = |{ TEXT-ms2 }|
iv_query = |{ TEXT-013 } '{ ms_ui_refs-variant_name->* }'. { TEXT-014 } { TEXT-016 }|
iv_icon_type = 'ICON_MESSAGE_WARNING' ) <> zif_dbbr_c_global=>c_popup_answers-yes.
RETURN.
ENDIF.
zcl_dbbr_variant_factory=>get_variant(
EXPORTING
iv_variant_name = ms_ui_refs-variant_name->*
iv_entity_id = mv_entity_id
iv_entity_type = mv_selscreen_mode
if_load_completely = abap_false
IMPORTING
es_variant = DATA(ls_existing_variant)
).
ENDIF.
persist_variant( ls_existing_variant-variant_id ).
ENDMETHOD.
METHOD create_default_variant.
persist_variant( ).
ENDMETHOD.
METHOD persist_variant.
DATA(ls_variant) = zcl_dbbr_variant_creator=>create_variant(
iv_variant_id = iv_variant_id
iv_variant_name = ms_ui_refs-variant_name->*
iv_entity_id = mv_entity_id
iv_entity_type = mv_selscreen_mode
iv_variant_description = ms_ui_refs-variant_text->*
if_has_output_fields = ms_ui_refs-xoutput_fields->*
if_has_sort_fields = ms_ui_refs-xsort_fields->*
it_selfields = COND #( WHEN ms_ui_refs-xfilter_fields->* = abap_true AND mr_t_selfields IS BOUND THEN mr_t_selfields->* )
it_multi_selfields = COND #( WHEN ms_ui_refs-xfilter_fields->* = abap_true AND mr_t_selfields_multi IS BOUND THEN mr_t_selfields_multi->* )
it_multi_or = COND #( WHEN ms_ui_refs-xfilter_fields->* = abap_true AND mr_multi_or_itab IS BOUND THEN mr_multi_or_itab->* )
is_global_data = mr_s_global_data->*
).
*.. create user/ddic sort order for output / sorting fields
IF ms_ui_refs-xoutput_fields->* = abap_true OR
ms_ui_refs-xsort_fields->* = abap_true.
DATA(lr_tabfields) = mo_tabfields->copy( ).
lr_tabfields->switch_mode( zif_dbbr_c_global=>c_field_chooser_modes-output ).
lr_tabfields->sort( ).
lr_tabfields->switch_mode( zif_dbbr_c_global=>c_field_chooser_modes-sort ).
lr_tabfields->sort( ).
*.... clear flag for selected fields
lr_tabfields->clear_active_flag( if_clear_selection = abap_true
if_clear_output = xsdbool( ms_ui_refs-xoutput_fields->* = abap_false )
if_clear_sort = xsdbool( ms_ui_refs-xsort_fields->* = abap_false ) ).
*.... save output / order by fields
DATA(lt_fields_ui) = lr_tabfields->get_active_fields(
if_consider_output = ms_ui_refs-xoutput_fields->*
if_consider_sorted = ms_ui_refs-xsort_fields->*
if_consider_selected = abap_false ).
ls_variant-fields = CORRESPONDING #( lt_fields_ui ).
ENDIF.
" save the variant
IF mf_default_variant_mode = abap_true.
zcl_dbbr_variant_factory=>save_default_variant( ls_variant ).
MESSAGE s095(zdbbr_info) WITH mv_entity_name.
ELSE.
zcl_dbbr_variant_factory=>save_variant( ls_variant ).
MESSAGE s028(zdbbr_info) WITH ms_ui_refs-variant_name->*.
ENDIF.
zcl_dbbr_screen_helper=>leave_screen( ).
ENDMETHOD.
METHOD exists_criteria.
CLEAR rf_exists.
CHECK mr_t_selfields IS BOUND.
LOOP AT mr_t_selfields->* ASSIGNING FIELD-SYMBOL(<ls_selfield>) WHERE low IS NOT INITIAL
OR high IS NOT INITIAL
OR option IS NOT INITIAL.
EXIT.
ENDLOOP.
IF sy-subrc = 0.
rf_exists = abap_true.
ELSE.
*.. Are there any or tuple values
rf_exists = xsdbool( mr_multi_or_itab->* IS NOT INITIAL ).
ENDIF.
ENDMETHOD.
METHOD delete_variant.
zcl_dbbr_variant_factory=>get_variant(
EXPORTING
iv_variant_name = ms_ui_refs-variant_name->*
iv_entity_id = mv_entity_id
iv_entity_type = mv_selscreen_mode
if_load_completely = abap_false
IMPORTING
es_variant = DATA(ls_existing_variant)
).
IF ls_existing_variant IS INITIAL.
MESSAGE e030(zdbbr_info) WITH ms_ui_refs-variant_name->*.
RETURN.
ENDIF.
zcl_dbbr_variant_factory=>delete_variant( ls_existing_variant-variant_id ).
MESSAGE s029(zdbbr_info) WITH ms_ui_refs-variant_name->*.
zcl_dbbr_screen_helper=>leave_screen( ).
ENDMETHOD.
METHOD zif_uitb_screen_controller~call_screen.
IF mv_mode = c_modes-save AND
ms_ui_refs-variant_name->* IS INITIAL.
CLEAR: ms_ui_refs-xoutput_fields->*,
ms_ui_refs-xsort_fields->*.
ENDIF.
ms_ui_refs-xfilter_fields->* = exists_criteria( ).
CASE mv_selscreen_mode.
WHEN zif_dbbr_c_selscreen_mode=>table.
ms_ui_refs-variant_table_name->* = mv_entity_name.
WHEN zif_dbbr_c_selscreen_mode=>query.
ms_ui_refs-variant_query_name->* = mv_entity_name.
WHEN zif_dbbr_c_selscreen_mode=>cds_view.
ms_ui_refs-variant_cds_name->* = mv_entity_name.
ENDCASE.
zcl_uitb_screen_util=>call_screen(
iv_screen_id = get_screen_id( )
iv_report_id = get_report_id( )
if_selscreen = abap_true
it_object_map = VALUE #(
( variable_name = zif_dbbr_main_report_var_ids=>c_r_variant_controller
global_ref = me )
)
iv_start_line = 2
iv_start_column = 10
).
ENDMETHOD.
METHOD zif_uitb_screen_controller~cancel.
zcl_dbbr_screen_helper=>leave_screen( ).
ENDMETHOD.
METHOD zif_uitb_screen_controller~free_screen_resources.
ENDMETHOD.
METHOD zif_uitb_screen_controller~get_report_id.
result = zif_dbbr_c_report_id=>main.
ENDMETHOD.
METHOD zif_uitb_screen_controller~get_screen_id.
result = SWITCH #( mv_selscreen_mode
WHEN zif_dbbr_c_selscreen_mode=>table THEN zif_dbbr_screen_ids=>c_table_variant
WHEN zif_dbbr_c_selscreen_mode=>query THEN zif_dbbr_screen_ids=>c_query_variant
WHEN zif_dbbr_c_selscreen_mode=>cds_view THEN zif_dbbr_screen_ids=>c_cds_view_variant
).
ENDMETHOD.
METHOD zif_uitb_screen_controller~handle_user_command.
CASE cv_function_code.
WHEN 'ENTER'.
CASE mv_mode.
WHEN c_modes-delete.
delete_variant( ).
WHEN c_modes-save.
IF mf_default_variant_mode = abap_true.
create_default_variant( ).
ELSE.
create_variant( ).
ENDIF.
ENDCASE.
WHEN 'CANCEL'.
zcl_dbbr_screen_helper=>leave_screen( ).
ENDCASE.
CLEAR cv_function_code.
ENDMETHOD.
METHOD zif_uitb_screen_controller~pbo.
zif_uitb_screen_controller~set_status( ).
LOOP AT SCREEN.
IF mf_default_variant_mode = abap_true.
IF screen-group1 = 'TXT' OR screen-group1 = 'VRN'.
screen-active = 0.
MODIFY SCREEN.
CONTINUE.
ENDIF.
ENDIF.
IF screen-group1 = 'ALV' AND mf_alv_output = abap_false.
screen-active = 0.
MODIFY SCREEN.
CONTINUE.
ENDIF.
IF screen-name = zif_dbbr_main_report_var_ids=>c_p_tab OR
screen-name = zif_dbbr_main_report_var_ids=>c_p_scrnam OR
screen-name = zif_dbbr_main_report_var_ids=>c_p_cds_view_name.
screen-input = 0.
MODIFY SCREEN.
ELSEIF screen-group1 = 'GLO'.
screen-active = 0.
MODIFY SCREEN.
ELSEIF ( screen-name = zif_dbbr_main_report_var_ids=>c_p_vartxt OR
screen-group1 = 'TXT' ) AND
mv_mode <> c_modes-save.
screen-active = 0.
MODIFY SCREEN.
ELSEIF screen-group1 = 'PAR' AND mv_mode <> c_modes-save.
screen-active = 0.
MODIFY SCREEN FROM screen.
ENDIF.
ENDLOOP.
ENDMETHOD.
METHOD zif_uitb_screen_controller~set_status.
zcl_uitb_screen_util=>set_selscreen_status(
iv_status = '0600'
iv_repid = get_report_id( )
).
DATA(lv_title) = SWITCH #(
mf_default_variant_mode
WHEN abap_false THEN SWITCH string(
mv_mode
WHEN c_modes-save THEN
'Save variant'(v02)
WHEN c_modes-delete THEN
'Delete variant'(v03)
)
WHEN abap_true THEN SWITCH string(
mv_mode
WHEN c_modes-save THEN
'Save Default Variant'(017)
)
).
CASE mv_selscreen_mode.
WHEN zif_dbbr_c_selscreen_mode=>table.
ms_ui_refs-variant_for_table_title->* = lv_title.
WHEN zif_dbbr_c_selscreen_mode=>query.
ms_ui_refs-variant_for_query_title->* = lv_title.
WHEN zif_dbbr_c_selscreen_mode=>cds_view.
ms_ui_refs-variant_for_cds_title->* = lv_title.
ENDCASE.
ENDMETHOD.
METHOD zif_uitb_screen_controller~was_not_cancelled.
ENDMETHOD.
ENDCLASS.
| 35.290948 | 152 | 0.672305 |
79134d1b5e5283d1da511c8f16a1d0d8a88e187e | 13,015 | abap | ABAP | src/persist/zcl_abapgit_persist_migrate.clas.abap | stockbal/abapGit | f7de72c2aa4a8672c6b5d36c972ebd45eea147a4 | [
"MIT"
] | null | null | null | src/persist/zcl_abapgit_persist_migrate.clas.abap | stockbal/abapGit | f7de72c2aa4a8672c6b5d36c972ebd45eea147a4 | [
"MIT"
] | null | null | null | src/persist/zcl_abapgit_persist_migrate.clas.abap | stockbal/abapGit | f7de72c2aa4a8672c6b5d36c972ebd45eea147a4 | [
"MIT"
] | null | null | null | CLASS zcl_abapgit_persist_migrate DEFINITION PUBLIC CREATE PUBLIC.
PUBLIC SECTION.
CLASS-METHODS: run RAISING zcx_abapgit_exception.
PROTECTED SECTION.
PRIVATE SECTION.
TYPES: BEGIN OF ty_setting_to_migrate,
name TYPE string,
value TYPE string,
END OF ty_setting_to_migrate,
ty_settings_to_migrate TYPE STANDARD TABLE OF ty_setting_to_migrate
WITH NON-UNIQUE DEFAULT KEY.
CONSTANTS c_text TYPE string VALUE 'Generated by abapGit' ##NO_TEXT.
CLASS-METHODS table_create
RAISING
zcx_abapgit_exception .
CLASS-METHODS table_exists
RETURNING
VALUE(rv_exists) TYPE abap_bool .
CLASS-METHODS lock_create
RAISING
zcx_abapgit_exception .
CLASS-METHODS lock_exists
RETURNING
VALUE(rv_exists) TYPE abap_bool .
CLASS-METHODS migrate_settings
RAISING
zcx_abapgit_exception.
CLASS-METHODS migrate_setting
IMPORTING
iv_name TYPE string
CHANGING
ct_settings_to_migrate TYPE ty_settings_to_migrate
ci_document TYPE REF TO if_ixml_document.
CLASS-METHODS distribute_settings_to_users
IMPORTING
it_settings_to_migrate TYPE ty_settings_to_migrate
RAISING
zcx_abapgit_exception.
CLASS-METHODS update_global_settings
IMPORTING
ii_document TYPE REF TO if_ixml_document
RAISING
zcx_abapgit_exception.
CLASS-METHODS read_global_settings_xml
RETURNING
VALUE(rv_global_settings_xml) TYPE string
RAISING
zcx_abapgit_not_found.
CLASS-METHODS get_global_settings_document
RETURNING
VALUE(ri_global_settings_dom) TYPE REF TO if_ixml_document
RAISING
zcx_abapgit_not_found.
ENDCLASS.
CLASS zcl_abapgit_persist_migrate IMPLEMENTATION.
METHOD distribute_settings_to_users.
TYPES: ty_char12 TYPE c LENGTH 12.
DATA: lt_abapgit_users TYPE STANDARD TABLE OF ty_char12
WITH NON-UNIQUE DEFAULT KEY,
ls_user_settings TYPE zif_abapgit_definitions=>ty_s_user_settings,
li_user_persistence TYPE REF TO zif_abapgit_persist_user.
FIELD-SYMBOLS: <lv_user> LIKE LINE OF lt_abapgit_users,
<ls_setting_to_migrate> TYPE ty_setting_to_migrate,
<lg_user_specific_setting_val> TYPE data.
" distribute settings to all abapGit users
SELECT value FROM (zcl_abapgit_persistence_db=>c_tabname)
INTO TABLE lt_abapgit_users
WHERE type = zcl_abapgit_persistence_db=>c_type_user.
LOOP AT lt_abapgit_users ASSIGNING <lv_user>.
li_user_persistence = zcl_abapgit_persistence_user=>get_instance( <lv_user> ).
ls_user_settings = li_user_persistence->get_settings( ).
LOOP AT it_settings_to_migrate ASSIGNING <ls_setting_to_migrate>.
ASSIGN COMPONENT <ls_setting_to_migrate>-name
OF STRUCTURE ls_user_settings
TO <lg_user_specific_setting_val>.
ASSERT sy-subrc = 0.
<lg_user_specific_setting_val> = <ls_setting_to_migrate>-value.
ENDLOOP.
li_user_persistence->set_settings( ls_user_settings ).
ENDLOOP.
ENDMETHOD.
METHOD get_global_settings_document.
DATA: lv_global_settings_xml TYPE string.
lv_global_settings_xml = read_global_settings_xml( ).
ri_global_settings_dom = cl_ixml_80_20=>parse_to_document( stream_string = lv_global_settings_xml ).
ENDMETHOD.
METHOD lock_create.
DATA: lv_obj_name TYPE tadir-obj_name,
ls_dd25v TYPE dd25v,
lt_dd26e TYPE STANDARD TABLE OF dd26e WITH DEFAULT KEY,
lt_dd27p TYPE STANDARD TABLE OF dd27p WITH DEFAULT KEY.
FIELD-SYMBOLS: <ls_dd26e> LIKE LINE OF lt_dd26e,
<ls_dd27p> LIKE LINE OF lt_dd27p.
ls_dd25v-viewname = zcl_abapgit_persistence_db=>c_lock.
ls_dd25v-aggtype = 'E'.
ls_dd25v-roottab = zcl_abapgit_persistence_db=>c_tabname.
ls_dd25v-ddlanguage = zif_abapgit_definitions=>c_english.
ls_dd25v-ddtext = c_text.
APPEND INITIAL LINE TO lt_dd26e ASSIGNING <ls_dd26e>.
<ls_dd26e>-viewname = zcl_abapgit_persistence_db=>c_lock.
<ls_dd26e>-tabname = zcl_abapgit_persistence_db=>c_tabname.
<ls_dd26e>-tabpos = '0001'.
<ls_dd26e>-fortabname = zcl_abapgit_persistence_db=>c_tabname.
<ls_dd26e>-enqmode = 'E'.
APPEND INITIAL LINE TO lt_dd27p ASSIGNING <ls_dd27p>.
<ls_dd27p>-viewname = zcl_abapgit_persistence_db=>c_lock.
<ls_dd27p>-objpos = '0001'.
<ls_dd27p>-viewfield = 'TYPE'.
<ls_dd27p>-tabname = zcl_abapgit_persistence_db=>c_tabname.
<ls_dd27p>-fieldname = 'TYPE'.
<ls_dd27p>-keyflag = abap_true.
APPEND INITIAL LINE TO lt_dd27p ASSIGNING <ls_dd27p>.
<ls_dd27p>-viewname = zcl_abapgit_persistence_db=>c_lock.
<ls_dd27p>-objpos = '0002'.
<ls_dd27p>-viewfield = 'VALUE'.
<ls_dd27p>-tabname = zcl_abapgit_persistence_db=>c_tabname.
<ls_dd27p>-fieldname = 'VALUE'.
<ls_dd27p>-keyflag = abap_true.
CALL FUNCTION 'DDIF_ENQU_PUT'
EXPORTING
name = zcl_abapgit_persistence_db=>c_lock
dd25v_wa = ls_dd25v
TABLES
dd26e_tab = lt_dd26e
dd27p_tab = lt_dd27p
EXCEPTIONS
enqu_not_found = 1
name_inconsistent = 2
enqu_inconsistent = 3
put_failure = 4
put_refused = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
lv_obj_name = zcl_abapgit_persistence_db=>c_lock.
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = 'ENQU'
wi_tadir_obj_name = lv_obj_name
wi_set_genflag = abap_true
wi_test_modus = abap_false
wi_tadir_devclass = '$TMP'
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
CALL FUNCTION 'DDIF_ENQU_ACTIVATE'
EXPORTING
name = zcl_abapgit_persistence_db=>c_lock
EXCEPTIONS
not_found = 1
put_failure = 2
OTHERS = 3.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise( 'migrate, error from DDIF_ENQU_ACTIVATE' ).
ENDIF.
ENDMETHOD.
METHOD lock_exists.
DATA: lv_viewname TYPE dd25l-viewname.
SELECT SINGLE viewname FROM dd25l INTO lv_viewname
WHERE viewname = zcl_abapgit_persistence_db=>c_lock.
rv_exists = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD migrate_setting.
DATA: li_element TYPE REF TO if_ixml_element,
ls_setting_to_migrate LIKE LINE OF ct_settings_to_migrate.
li_element = ci_document->find_from_name( iv_name ).
IF li_element IS BOUND.
" The element is present in the global config.
" Therefore we have to migrate it
ls_setting_to_migrate-name = iv_name.
ls_setting_to_migrate-value = li_element->get_value( ).
INSERT ls_setting_to_migrate INTO TABLE ct_settings_to_migrate.
li_element->remove_node( ).
ENDIF.
ENDMETHOD.
METHOD migrate_settings.
DATA: li_global_settings_document TYPE REF TO if_ixml_document,
lt_settings_to_migrate TYPE ty_settings_to_migrate,
lx_error TYPE REF TO zcx_abapgit_not_found.
" migrate global settings to user specific settings
TRY.
li_global_settings_document = get_global_settings_document( ).
CATCH zcx_abapgit_not_found INTO lx_error.
" No global settings available, nothing todo.
RETURN.
ENDTRY.
migrate_setting(
EXPORTING
iv_name = |MAX_LINES|
CHANGING
ct_settings_to_migrate = lt_settings_to_migrate
ci_document = li_global_settings_document ).
migrate_setting(
EXPORTING
iv_name = |ADT_JUMP_ENABLED|
CHANGING
ct_settings_to_migrate = lt_settings_to_migrate
ci_document = li_global_settings_document ).
IF lines( lt_settings_to_migrate ) > 0.
distribute_settings_to_users( lt_settings_to_migrate ).
update_global_settings( li_global_settings_document ).
ENDIF.
ENDMETHOD.
METHOD read_global_settings_xml.
rv_global_settings_xml = zcl_abapgit_persistence_db=>get_instance( )->read(
iv_type = zcl_abapgit_persistence_db=>c_type_settings
iv_value = '' ).
ENDMETHOD.
METHOD run.
IF table_exists( ) = abap_false.
table_create( ).
ENDIF.
IF lock_exists( ) = abap_false.
lock_create( ).
ENDIF.
migrate_settings( ).
ENDMETHOD.
METHOD table_create.
DATA: lv_rc LIKE sy-subrc,
lv_obj_name TYPE tadir-obj_name,
ls_dd02v TYPE dd02v,
ls_dd09l TYPE dd09l,
lt_dd03p TYPE STANDARD TABLE OF dd03p WITH DEFAULT KEY.
FIELD-SYMBOLS: <ls_dd03p> LIKE LINE OF lt_dd03p.
ls_dd02v-tabname = zcl_abapgit_persistence_db=>c_tabname.
ls_dd02v-ddlanguage = zif_abapgit_definitions=>c_english.
ls_dd02v-tabclass = 'TRANSP'.
ls_dd02v-ddtext = c_text.
ls_dd02v-contflag = 'L'.
ls_dd02v-exclass = '1'.
ls_dd09l-tabname = zcl_abapgit_persistence_db=>c_tabname.
ls_dd09l-as4local = 'A'.
ls_dd09l-tabkat = '1'.
ls_dd09l-tabart = 'APPL1'.
ls_dd09l-bufallow = 'N'.
APPEND INITIAL LINE TO lt_dd03p ASSIGNING <ls_dd03p>.
<ls_dd03p>-tabname = zcl_abapgit_persistence_db=>c_tabname.
<ls_dd03p>-fieldname = 'TYPE'.
<ls_dd03p>-position = '0001'.
<ls_dd03p>-keyflag = 'X'.
<ls_dd03p>-datatype = 'CHAR'.
<ls_dd03p>-leng = '000012'.
APPEND INITIAL LINE TO lt_dd03p ASSIGNING <ls_dd03p>.
<ls_dd03p>-tabname = zcl_abapgit_persistence_db=>c_tabname.
<ls_dd03p>-fieldname = 'VALUE'.
<ls_dd03p>-position = '0002'.
<ls_dd03p>-keyflag = 'X'.
<ls_dd03p>-datatype = 'CHAR'.
<ls_dd03p>-leng = '000012'.
APPEND INITIAL LINE TO lt_dd03p ASSIGNING <ls_dd03p>.
<ls_dd03p>-tabname = zcl_abapgit_persistence_db=>c_tabname.
<ls_dd03p>-fieldname = 'DATA_STR'.
<ls_dd03p>-position = '0003'.
<ls_dd03p>-datatype = 'STRG'.
CALL FUNCTION 'DDIF_TABL_PUT'
EXPORTING
name = zcl_abapgit_persistence_db=>c_tabname
dd02v_wa = ls_dd02v
dd09l_wa = ls_dd09l
TABLES
dd03p_tab = lt_dd03p
EXCEPTIONS
tabl_not_found = 1
name_inconsistent = 2
tabl_inconsistent = 3
put_failure = 4
put_refused = 5
OTHERS = 6.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
lv_obj_name = zcl_abapgit_persistence_db=>c_tabname.
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = 'TABL'
wi_tadir_obj_name = lv_obj_name
wi_set_genflag = abap_true
wi_test_modus = abap_false
wi_tadir_devclass = '$TMP'
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
CALL FUNCTION 'DDIF_TABL_ACTIVATE'
EXPORTING
name = zcl_abapgit_persistence_db=>c_tabname
auth_chk = abap_false
IMPORTING
rc = lv_rc
EXCEPTIONS
not_found = 1
put_failure = 2
OTHERS = 3.
IF sy-subrc <> 0 OR lv_rc <> 0.
zcx_abapgit_exception=>raise( 'migrate, error from DDIF_TABL_ACTIVATE' ).
ENDIF.
ENDMETHOD.
METHOD table_exists.
DATA: lv_tabname TYPE dd02l-tabname.
SELECT SINGLE tabname FROM dd02l INTO lv_tabname
WHERE tabname = zcl_abapgit_persistence_db=>c_tabname.
rv_exists = boolc( sy-subrc = 0 ).
ENDMETHOD.
METHOD update_global_settings.
DATA: li_ixml TYPE REF TO if_ixml,
lv_settings_xml TYPE string,
li_ostream TYPE REF TO if_ixml_ostream,
li_renderer TYPE REF TO if_ixml_renderer,
li_streamfactory TYPE REF TO if_ixml_stream_factory.
" finally update global settings
" migrated elements are already removed from document
li_ixml = cl_ixml=>create( ).
li_streamfactory = li_ixml->create_stream_factory( ).
li_ostream = li_streamfactory->create_ostream_cstring( lv_settings_xml ).
li_renderer = li_ixml->create_renderer( ostream = li_ostream
document = ii_document ).
li_renderer->render( ).
zcl_abapgit_persistence_db=>get_instance( )->update(
iv_type = zcl_abapgit_persistence_db=>c_type_settings
iv_value = ''
iv_data = lv_settings_xml ).
ENDMETHOD.
ENDCLASS.
| 29.850917 | 104 | 0.655628 |
791647dc81e17aeaa68e510c714838f9ff1302db | 758 | abap | ABAP | src/zaps_demo/zaps_demo_report_executable.prog.abap | BiberM/ABAPParallelizationService | d0fca92dfe05456e73fadafd8763b7953e49eb57 | [
"MIT"
] | 7 | 2021-09-13T20:09:13.000Z | 2022-02-11T18:22:07.000Z | src/zaps_demo/zaps_demo_report_executable.prog.abap | BiberM/ABAPParallelizationService | d0fca92dfe05456e73fadafd8763b7953e49eb57 | [
"MIT"
] | 8 | 2021-10-03T16:40:59.000Z | 2022-01-23T21:06:37.000Z | src/zaps_demo/zaps_demo_report_executable.prog.abap | BiberM/ABAPParallelizationService | d0fca92dfe05456e73fadafd8763b7953e49eb57 | [
"MIT"
] | 1 | 2021-12-22T16:56:37.000Z | 2021-12-22T16:56:37.000Z | *&---------------------------------------------------------------------*
*& Report zaps_demo_report_executable
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
report zaps_demo_report_executable.
parameters:
p_index type i.
try.
data(randomWaitSeconds) = cl_abap_random_int=>create(
seed = cl_abap_random=>seed( )
min = 5
max = 20
)->get_next( ).
catch cx_abap_random.
randomWaitSeconds = 5.
endtry.
wait up to randomWaitSeconds seconds.
message i319(01)
with |This is task number { p_index }|.
| 31.583333 | 72 | 0.382586 |
7916f289544e1e7c3fcd5db36b047b2e112f6181 | 5,006 | abap | ABAP | src/deps/zcl_abaplint_deps_find.clas.testclasses.abap | sbcgua/abaplint-sci-client | 9f269f4b3d12a7fd3f090bf615ffd2d9e1c371ff | [
"MIT"
] | null | null | null | src/deps/zcl_abaplint_deps_find.clas.testclasses.abap | sbcgua/abaplint-sci-client | 9f269f4b3d12a7fd3f090bf615ffd2d9e1c371ff | [
"MIT"
] | null | null | null | src/deps/zcl_abaplint_deps_find.clas.testclasses.abap | sbcgua/abaplint-sci-client | 9f269f4b3d12a7fd3f090bf615ffd2d9e1c371ff | [
"MIT"
] | null | null | null | CLASS ltcl_find_by_item DEFINITION FOR TESTING DURATION LONG RISK LEVEL HARMLESS FINAL.
PRIVATE SECTION.
DATA:
mo_cut TYPE REF TO zcl_abaplint_deps_find.
DATA:
mo_log TYPE REF TO zif_abapgit_log.
METHODS:
setup,
usr02 FOR TESTING RAISING cx_static_check,
dd01v FOR TESTING RAISING cx_static_check,
swf_catt FOR TESTING RAISING cx_static_check,
upx_compare_cust FOR TESTING RAISING cx_static_check,
zcl_abapgit_object_dtel FOR TESTING RAISING cx_static_check,
zcl_abapgit_object_cus0 FOR TESTING RAISING cx_static_check,
txmilograw FOR TESTING RAISING cx_static_check.
ENDCLASS.
CLASS ltcl_find_by_item IMPLEMENTATION.
METHOD setup.
DATA ls_options TYPE zcl_abaplint_deps_find=>ty_options.
ls_options-continue_into_sap = abap_true.
CREATE OBJECT mo_cut
EXPORTING
is_options = ls_options.
CREATE OBJECT mo_log TYPE zcl_abapgit_log.
ENDMETHOD.
METHOD txmilograw.
DATA: lt_results TYPE zif_abapgit_definitions=>ty_tadir_tt.
lt_results = mo_cut->find_by_item(
iv_object_type = 'TABL'
iv_object_name = 'TXMILOGRAW' ).
READ TABLE lt_results WITH KEY object = 'DTEL' obj_name = 'XMILOGID' TRANSPORTING NO FIELDS.
cl_abap_unit_assert=>assert_subrc( ).
READ TABLE lt_results WITH KEY object = 'DOMA' obj_name = 'XMILOGID' TRANSPORTING NO FIELDS.
cl_abap_unit_assert=>assert_subrc( ).
READ TABLE lt_results WITH KEY object = 'TABL' obj_name = 'SXMILOGADM' TRANSPORTING NO FIELDS.
cl_abap_unit_assert=>assert_subrc( ).
READ TABLE lt_results WITH KEY object = 'TABL' obj_name = 'SXMIMSGRAW' TRANSPORTING NO FIELDS.
cl_abap_unit_assert=>assert_subrc( ).
* not sure the result is the same across systems/versions
cl_abap_unit_assert=>assert_number_between(
lower = 20
upper = 50
number = lines( lt_results ) ).
ENDMETHOD.
METHOD usr02.
DATA: lt_results TYPE zif_abapgit_definitions=>ty_tadir_tt.
lt_results = mo_cut->find_by_item(
iv_object_type = 'TABL'
iv_object_name = 'USR02' ).
* the check tables should not be found by the dependency analysis, they are not relevant to abaplint
READ TABLE lt_results WITH KEY object = 'TABL' obj_name = 'SEC_POLICY_CUST' TRANSPORTING NO FIELDS.
cl_abap_unit_assert=>assert_subrc( exp = 4 ).
ENDMETHOD.
METHOD zcl_abapgit_object_dtel.
DATA: lt_results TYPE zif_abapgit_definitions=>ty_tadir_tt.
lt_results = mo_cut->find_by_item(
iv_object_type = 'CLAS'
iv_object_name = 'ZCL_ABAPGIT_OBJECT_DTEL' ).
* the class calls function module DDIF_DTEL_PUT, so this function group is a dependency
READ TABLE lt_results WITH KEY object = 'FUGR' obj_name = 'SDIF' TRANSPORTING NO FIELDS.
cl_abap_unit_assert=>assert_subrc( ).
* for the function group SDIF, only minimal dependencies are needed, ie only types of the function modules
* READ TABLE lt_results WITH KEY object = 'PROG' obj_name = 'RADBTMAC' TRANSPORTING NO FIELDS
* cl_abap_unit_assert=>assert_subrc( exp = 4 )
* data element DDOBJNAME is used in the parameters for function module DDIF_DD_CHECK from SDIF
READ TABLE lt_results WITH KEY object = 'DTEL' obj_name = 'DDOBJNAME' TRANSPORTING NO FIELDS.
cl_abap_unit_assert=>assert_subrc( ).
* TABL DCOBJIF only used in the code for SDIF function group, so it should not be a dependency
READ TABLE lt_results WITH KEY object = 'TABL' obj_name = 'DCOBJIF' TRANSPORTING NO FIELDS.
cl_abap_unit_assert=>assert_subrc( exp = 4 ).
ENDMETHOD.
METHOD dd01v.
DATA: lt_results TYPE zif_abapgit_definitions=>ty_tadir_tt.
lt_results = mo_cut->find_by_item(
iv_object_type = 'VIEW'
iv_object_name = 'DD01V' ).
READ TABLE lt_results WITH KEY object = 'TABL' obj_name = 'DD01L' TRANSPORTING NO FIELDS.
cl_abap_unit_assert=>assert_subrc( ).
ENDMETHOD.
METHOD zcl_abapgit_object_cus0.
DATA: lt_results TYPE zif_abapgit_definitions=>ty_tadir_tt.
lt_results = mo_cut->find_by_item(
iv_object_type = 'CLAS'
iv_object_name = 'ZCL_ABAPGIT_OBJECT_CUS0' ).
* no direct transactions used
READ TABLE lt_results WITH KEY object = 'TRAN' TRANSPORTING NO FIELDS.
cl_abap_unit_assert=>assert_subrc( exp = 4 ).
ENDMETHOD.
METHOD upx_compare_cust.
DATA: lt_results TYPE zif_abapgit_definitions=>ty_tadir_tt.
lt_results = mo_cut->find_by_item(
iv_object_type = 'PROG'
iv_object_name = 'UPX_COMPARE_CUST' ).
READ TABLE lt_results WITH KEY object = 'PROG' obj_name = '<ICON>' TRANSPORTING NO FIELDS.
cl_abap_unit_assert=>assert_subrc( ).
ENDMETHOD.
METHOD swf_catt.
DATA: lt_results TYPE zif_abapgit_definitions=>ty_tadir_tt.
lt_results = mo_cut->find_by_item(
iv_object_type = 'FUGR'
iv_object_name = 'SWF_CATT' ).
READ TABLE lt_results WITH KEY object = 'PROG' obj_name = '<CNTN01>' TRANSPORTING NO FIELDS.
cl_abap_unit_assert=>assert_subrc( ).
ENDMETHOD.
ENDCLASS.
| 32.089744 | 106 | 0.734319 |
7919f90dd21a9d02c5abdb422dd669598db8d630 | 3,862 | abap | ABAP | src/kernel/kernel_ixml_json_to_data.clas.abap | mbtools/open-abap | 13274b1536752ec96edb68460ccdea7fe68625d9 | [
"MIT"
] | null | null | null | src/kernel/kernel_ixml_json_to_data.clas.abap | mbtools/open-abap | 13274b1536752ec96edb68460ccdea7fe68625d9 | [
"MIT"
] | null | null | null | src/kernel/kernel_ixml_json_to_data.clas.abap | mbtools/open-abap | 13274b1536752ec96edb68460ccdea7fe68625d9 | [
"MIT"
] | null | null | null | CLASS kernel_ixml_json_to_data DEFINITION PUBLIC.
PUBLIC SECTION.
CLASS-METHODS build
IMPORTING
iv_name TYPE string
iv_ref TYPE REF TO data
ii_doc TYPE REF TO if_ixml_document.
PRIVATE SECTION.
CLASS-METHODS get_field_name
IMPORTING ii_node TYPE REF TO if_ixml_node
RETURNING VALUE(rv_name) TYPE string.
CLASS-METHODS traverse
IMPORTING
ii_node TYPE REF TO if_ixml_node
iv_ref TYPE REF TO data.
ENDCLASS.
CLASS kernel_ixml_json_to_data IMPLEMENTATION.
METHOD get_field_name.
DATA li_aiterator TYPE REF TO if_ixml_node_iterator.
DATA li_anode TYPE REF TO if_ixml_node.
DATA attr TYPE REF TO if_ixml_named_node_map.
attr = ii_node->get_attributes( ).
IF attr IS NOT INITIAL.
li_aiterator = attr->create_iterator( ).
DO.
li_anode = li_aiterator->get_next( ).
IF li_anode IS INITIAL.
EXIT. " current loop
ENDIF.
* assume its the name,
rv_name = li_anode->get_value( ).
RETURN.
ENDDO.
ENDIF.
ENDMETHOD.
METHOD build.
* assumptions: the top level element is an object containing iv_name
DATA li_first TYPE REF TO if_ixml_node.
DATA li_node TYPE REF TO if_ixml_node.
DATA lv_name TYPE string.
DATA li_iterator TYPE REF TO if_ixml_node_iterator.
li_first = ii_doc->get_root( )->get_first_child( ).
ASSERT li_first->get_name( ) = 'object'.
li_iterator = li_first->get_children( )->create_iterator( ).
DO.
li_node = li_iterator->get_next( ).
IF li_node IS INITIAL.
EXIT. " current loop
ENDIF.
lv_name = get_field_name( li_node ).
IF lv_name = iv_name.
* WRITE '@KERNEL console.dir("found");'.
traverse(
iv_ref = iv_ref
ii_node = li_node ).
RETURN.
ENDIF.
ENDDO.
ENDMETHOD.
METHOD traverse.
DATA lo_type TYPE REF TO cl_abap_typedescr.
DATA li_child TYPE REF TO if_ixml_node.
DATA lv_name TYPE string.
DATA li_iterator TYPE REF TO if_ixml_node_iterator.
DATA lv_ref TYPE REF TO data.
FIELD-SYMBOLS <any> TYPE any.
FIELD-SYMBOLS <field> TYPE any.
FIELD-SYMBOLS <tab> TYPE ANY TABLE.
lo_type = cl_abap_typedescr=>describe_by_data( iv_ref->* ).
CASE lo_type->kind.
WHEN cl_abap_typedescr=>kind_struct.
ASSERT ii_node->get_name( ) = 'object'.
ASSIGN iv_ref->* TO <any>.
li_iterator = ii_node->get_children( )->create_iterator( ).
DO.
li_child = li_iterator->get_next( ).
IF li_child IS INITIAL.
EXIT. " current loop
ENDIF.
lv_name = get_field_name( li_child ).
ASSIGN COMPONENT lv_name OF STRUCTURE <any> TO <field>.
IF sy-subrc = 0.
GET REFERENCE OF <field> INTO lv_ref.
traverse( ii_node = li_child
iv_ref = lv_ref ).
ENDIF.
ENDDO.
WHEN cl_abap_typedescr=>kind_elem.
li_child = ii_node->get_first_child( ).
ASSERT li_child->get_name( ) = '#text'.
ASSIGN iv_ref->* TO <any>.
<any> = li_child->get_value( ).
WHEN cl_abap_typedescr=>kind_table.
ASSERT ii_node->get_name( ) = 'array'.
ASSIGN iv_ref->* TO <tab>.
li_iterator = ii_node->get_children( )->create_iterator( ).
DO.
li_child = li_iterator->get_next( ).
IF li_child IS INITIAL.
EXIT. " current loop
ENDIF.
CREATE DATA lv_ref LIKE LINE OF <tab>.
ASSIGN lv_ref->* TO <any>.
traverse( ii_node = li_child
iv_ref = lv_ref ).
INSERT <any> INTO TABLE <tab>.
ENDDO.
WHEN OTHERS.
WRITE '@KERNEL console.dir(lo_type.get().kind.get());'.
ENDCASE.
ENDMETHOD.
ENDCLASS. | 30.896 | 68 | 0.615484 |
791a669c52710709515b35595eef16416f85d88b | 3,687 | abap | ABAP | src/objects/zcl_abapgit_object_docv.clas.abap | abapGit/upport | 322935c225756b5107d7c835e6ccc13ba3dcbe4a | [
"MIT"
] | 2 | 2021-01-08T21:38:32.000Z | 2021-11-17T19:37:14.000Z | src/objects/zcl_abapgit_object_docv.clas.abap | abapGit/upport | 322935c225756b5107d7c835e6ccc13ba3dcbe4a | [
"MIT"
] | null | null | null | src/objects/zcl_abapgit_object_docv.clas.abap | abapGit/upport | 322935c225756b5107d7c835e6ccc13ba3dcbe4a | [
"MIT"
] | null | null | null | CLASS zcl_abapgit_object_docv DEFINITION PUBLIC INHERITING FROM zcl_abapgit_objects_super FINAL.
PUBLIC SECTION.
INTERFACES zif_abapgit_object.
ALIASES mo_files FOR zif_abapgit_object~mo_files.
PROTECTED SECTION.
PRIVATE SECTION.
CONSTANTS: c_typ TYPE dokhl-typ VALUE 'E',
c_version TYPE dokhl-dokversion VALUE '0001',
c_name TYPE string VALUE 'DOC'.
TYPES: BEGIN OF ty_data,
doctitle TYPE dsyst-doktitle,
head TYPE thead,
lines TYPE tline_tab,
END OF ty_data.
METHODS: read
RETURNING VALUE(rs_data) TYPE ty_data.
ENDCLASS.
CLASS zcl_abapgit_object_docv IMPLEMENTATION.
METHOD read.
DATA: lv_object TYPE dokhl-object,
lv_id TYPE dokhl-id.
lv_id = ms_item-obj_name(2).
lv_object = ms_item-obj_name+2.
CALL FUNCTION 'DOCU_READ'
EXPORTING
id = lv_id
langu = mv_language
object = lv_object
typ = c_typ
version = c_version
IMPORTING
doktitle = rs_data-doctitle
head = rs_data-head
TABLES
line = rs_data-lines.
ENDMETHOD.
METHOD zif_abapgit_object~changed_by.
rv_user = read( )-head-tdluser.
IF rv_user IS INITIAL.
rv_user = c_user_unknown.
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~delete.
DATA: lv_id TYPE dokhl-id,
lv_object TYPE dokhl-object.
lv_id = ms_item-obj_name(2).
lv_object = ms_item-obj_name+2.
CALL FUNCTION 'DOCU_DEL'
EXPORTING
id = lv_id
langu = mv_language
object = lv_object
typ = c_typ
EXCEPTIONS
ret_code = 1
OTHERS = 2.
IF sy-subrc <> 0.
zcx_abapgit_exception=>raise_t100( ).
ENDIF.
ENDMETHOD.
METHOD zif_abapgit_object~deserialize.
DATA: ls_data TYPE ty_data.
io_xml->read( EXPORTING iv_name = c_name
CHANGING cg_data = ls_data ).
CALL FUNCTION 'DOCU_UPDATE'
EXPORTING
head = ls_data-head
state = 'A'
typ = c_typ
version = c_version
TABLES
line = ls_data-lines.
ENDMETHOD.
METHOD zif_abapgit_object~exists.
DATA: lv_id TYPE dokhl-id,
lv_object TYPE dokhl-object.
lv_id = ms_item-obj_name(2).
lv_object = ms_item-obj_name+2.
SELECT SINGLE id FROM dokil INTO lv_id
WHERE id = lv_id
AND object = lv_object. "#EC CI_GENBUFF
rv_bool = xsdbool( 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.
zcx_abapgit_exception=>raise( 'todo, jump DOCV' ).
ENDMETHOD.
METHOD zif_abapgit_object~serialize.
DATA: ls_data TYPE ty_data.
ls_data = read( ).
CLEAR: ls_data-head-tdfuser,
ls_data-head-tdfreles,
ls_data-head-tdfdate,
ls_data-head-tdftime,
ls_data-head-tdluser,
ls_data-head-tdlreles,
ls_data-head-tdldate,
ls_data-head-tdltime.
io_xml->add( iv_name = c_name
ig_data = ls_data ).
ENDMETHOD.
ENDCLASS.
| 20.597765 | 96 | 0.623542 |
791c924d754831974d4349f3100d62f773b8566c | 4,979 | abap | ABAP | src/zcx_adu_transport_request.clas.abap | jrodriguez-rc/abap-dev-tools | 6cbbd40e3739db038a878cdd1093dfe0cb9e406f | [
"MIT"
] | 35 | 2020-08-27T10:36:55.000Z | 2022-02-14T07:56:52.000Z | src/zcx_adu_transport_request.clas.abap | jrodriguez-rc/abap-dev-tools | 6cbbd40e3739db038a878cdd1093dfe0cb9e406f | [
"MIT"
] | 2 | 2020-11-01T09:53:44.000Z | 2022-02-10T08:10:53.000Z | src/zcx_adu_transport_request.clas.abap | jrodriguez-rc/abap-dev-tools | 6cbbd40e3739db038a878cdd1093dfe0cb9e406f | [
"MIT"
] | 6 | 2020-11-03T08:29:47.000Z | 2021-09-11T15:24:05.000Z | "! <p class="shorttext synchronized" lang="en">Check transport Exceptions</p>
CLASS zcx_adu_transport_request DEFINITION
PUBLIC
INHERITING FROM cx_static_check
FINAL
CREATE PUBLIC .
PUBLIC SECTION.
INTERFACES if_t100_message.
CONSTANTS:
"! Transport request &1 doesn't exist
BEGIN OF not_exists,
msgid TYPE symsgid VALUE 'ZADU_TRANSPORT_REQ' ##NO_TEXT,
msgno TYPE symsgno VALUE '001' ##NO_TEXT,
attr1 TYPE scx_attrname VALUE 'TEXT1' ##NO_TEXT,
attr2 TYPE scx_attrname VALUE 'TEXT2' ##NO_TEXT,
attr3 TYPE scx_attrname VALUE 'TEXT3' ##NO_TEXT,
attr4 TYPE scx_attrname VALUE 'TEXT4' ##NO_TEXT,
END OF not_exists.
CONSTANTS:
"! Source client does not exist: &
BEGIN OF source_client_not_exists,
msgid TYPE symsgid VALUE 'TA' ##NO_TEXT,
msgno TYPE symsgno VALUE '008' ##NO_TEXT,
attr1 TYPE scx_attrname VALUE 'TEXT1' ##NO_TEXT,
attr2 TYPE scx_attrname VALUE 'TEXT2' ##NO_TEXT,
attr3 TYPE scx_attrname VALUE 'TEXT3' ##NO_TEXT,
attr4 TYPE scx_attrname VALUE 'TEXT4' ##NO_TEXT,
END OF source_client_not_exists.
CONSTANTS:
"! Source client & is protected against data export by client copy
BEGIN OF client_copy_protected,
msgid TYPE symsgid VALUE 'TA' ##NO_TEXT,
msgno TYPE symsgno VALUE '260' ##NO_TEXT,
attr1 TYPE scx_attrname VALUE 'TEXT1' ##NO_TEXT,
attr2 TYPE scx_attrname VALUE 'TEXT2' ##NO_TEXT,
attr3 TYPE scx_attrname VALUE 'TEXT3' ##NO_TEXT,
attr4 TYPE scx_attrname VALUE 'TEXT4' ##NO_TEXT,
END OF client_copy_protected.
CONSTANTS:
"! Client 000 is protected and may not be overwritten
BEGIN OF client_000_protected,
msgid TYPE symsgid VALUE 'TA' ##NO_TEXT,
msgno TYPE symsgno VALUE '011' ##NO_TEXT,
attr1 TYPE scx_attrname VALUE 'TEXT1' ##NO_TEXT,
attr2 TYPE scx_attrname VALUE 'TEXT2' ##NO_TEXT,
attr3 TYPE scx_attrname VALUE 'TEXT3' ##NO_TEXT,
attr4 TYPE scx_attrname VALUE 'TEXT4' ##NO_TEXT,
END OF client_000_protected.
CONSTANTS:
"! Source client is same as logon client
BEGIN OF source_client_same_logon,
msgid TYPE symsgid VALUE 'TA' ##NO_TEXT,
msgno TYPE symsgno VALUE '009' ##NO_TEXT,
attr1 TYPE scx_attrname VALUE 'TEXT1' ##NO_TEXT,
attr2 TYPE scx_attrname VALUE 'TEXT2' ##NO_TEXT,
attr3 TYPE scx_attrname VALUE 'TEXT3' ##NO_TEXT,
attr4 TYPE scx_attrname VALUE 'TEXT4' ##NO_TEXT,
END OF source_client_same_logon.
CONSTANTS:
"! Program ended with error or warning, return code: &
BEGIN OF program_ended_with_error,
msgid TYPE symsgid VALUE 'TA' ##NO_TEXT,
msgno TYPE symsgno VALUE '146' ##NO_TEXT,
attr1 TYPE scx_attrname VALUE 'TEXT1' ##NO_TEXT,
attr2 TYPE scx_attrname VALUE 'TEXT2' ##NO_TEXT,
attr3 TYPE scx_attrname VALUE 'TEXT3' ##NO_TEXT,
attr4 TYPE scx_attrname VALUE 'TEXT4' ##NO_TEXT,
END OF program_ended_with_error.
DATA:
text1 TYPE string READ-ONLY,
text2 TYPE string READ-ONLY,
text3 TYPE string READ-ONLY,
text4 TYPE string READ-ONLY.
"! <p class="shorttext synchronized" lang="en">Raise exception with system attribute message</p>
"!
"! @raising zcx_adu_transport_request | <p class="shorttext synchronized" lang="en">Exception</p>
CLASS-METHODS raise_system
RAISING
zcx_adu_transport_request.
"! <p class="shorttext synchronized" lang="en">CONSTRUCTOR</p>
METHODS constructor
IMPORTING
!textid LIKE if_t100_message=>t100key OPTIONAL
!text1 TYPE string OPTIONAL
!text2 TYPE string OPTIONAL
!text3 TYPE string OPTIONAL
!text4 TYPE string OPTIONAL
!previous LIKE previous OPTIONAL.
PROTECTED SECTION.
PRIVATE SECTION.
ENDCLASS.
CLASS zcx_adu_transport_request IMPLEMENTATION.
METHOD constructor ##ADT_SUPPRESS_GENERATION.
CALL METHOD super->constructor
EXPORTING
previous = previous.
me->text1 = text1.
me->text2 = text2.
me->text3 = text3.
me->text4 = text4.
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 raise_system.
RAISE EXCEPTION TYPE zcx_adu_transport_request
EXPORTING
textid = VALUE scx_t100key( msgid = sy-msgid
msgno = sy-msgno
attr1 = 'TEXT1'
attr2 = 'TEXT2'
attr3 = 'TEXT3'
attr4 = 'TEXT4' )
text1 = CONV #( sy-msgv1 )
text2 = CONV #( sy-msgv2 )
text3 = CONV #( sy-msgv3 )
text4 = CONV #( sy-msgv4 ).
ENDMETHOD.
ENDCLASS.
| 33.416107 | 101 | 0.64049 |