Skip to content
Permalink
Browse files

update lines program

  • Loading branch information...
larshp committed Jul 2, 2019
1 parent 5ee6ae1 commit 4cf82f212a614162e972939113df160b1e4fb811
Showing with 47 additions and 15 deletions.
  1. +31 −11 src/utils/zaoc_lines_tree.prog.abap
  2. +10 −4 src/utils/zaoc_lines_tree.prog.xml
  3. +6 −0 src/utils/zcl_aoc_util_programs.clas.abap
@@ -4,10 +4,14 @@ REPORT zaoc_lines_tree.
* https://github.com/larshp/abapOpenChecks
* MIT License

PARAMETERS: p_devc TYPE devclass DEFAULT '$AOC' OBLIGATORY,
p_comm TYPE c AS CHECKBOX DEFAULT 'X',
TABLES: tdevc.

SELECT-OPTIONS: s_devc FOR tdevc-devclass DEFAULT '$AOC' OBLIGATORY.

PARAMETERS: p_comm TYPE c AS CHECKBOX DEFAULT 'X',
p_vfug TYPE c AS CHECKBOX DEFAULT 'X',
p_loca TYPE c AS CHECKBOX DEFAULT 'X'.
p_loca TYPE c AS CHECKBOX DEFAULT 'X',
p_gate TYPE c AS CHECKBOX DEFAULT 'X'.

DATA: gv_ok_code LIKE sy-ucomm.

@@ -48,11 +52,21 @@ CLASS lcl_logic IMPLEMENTATION.

METHOD run.

CLEAR gt_result.
DATA: lt_tdevc TYPE STANDARD TABLE OF tdevc WITH DEFAULT KEY.

run_package( iv_devclass = p_devc
iv_parent = '' ).
FIELD-SYMBOLS: <ls_tdevc> LIKE LINE OF lt_tdevc.


SELECT * FROM tdevc INTO TABLE lt_tdevc
WHERE devclass IN s_devc
AND parentcl = ''
ORDER BY PRIMARY KEY.

CLEAR gt_result.
LOOP AT lt_tdevc ASSIGNING <ls_tdevc>.
run_package( iv_devclass = <ls_tdevc>-devclass
iv_parent = '' ).
ENDLOOP.
rt_result = gt_result.

ENDMETHOD.
@@ -67,7 +81,8 @@ CLASS lcl_logic IMPLEMENTATION.
lt_includes = zcl_aoc_util_programs=>get_programs_in_package(
iv_devclass = iv_devclass
iv_ignore_mview_fugr = p_vfug
iv_ignore_local_tests = p_loca ).
iv_ignore_local_tests = p_loca
iv_ignore_gateway = p_gate ).

LOOP AT lt_includes INTO lv_include.
IF sy-tabix MOD 100 = 0.
@@ -236,11 +251,17 @@ CLASS lcl_gui IMPLEMENTATION.
lt_result TYPE lcl_logic=>ty_result_tt,
lv_key LIKE ls_node-node_key,
lv_parent LIKE ls_node-node_key,
lv_total TYPE i,
ls_result LIKE LINE OF lt_result.


lt_result = lcl_logic=>run( ).

LOOP AT lt_result INTO ls_result WHERE parent = ''.
lv_total = lv_total + ls_result-count.
ENDLOOP.
MESSAGE |Grand Total: { lv_total }| TYPE 'S.'.

This comment has been minimized.

Copy link
@os-neff

os-neff Jul 16, 2019

This message statement leads to an activation error in all releases below NW 7.4. The message statement is unable to first concatenate the string and the put-out the corresponding message. To my understanding the type should be 'S' instead of 'S.'


LOOP AT lt_result INTO ls_result.
lv_key = sy-tabix.

@@ -286,19 +307,18 @@ CLASS lcl_gui IMPLEMENTATION.
table_structure_name_not_found = 6 ). "#EC CI_SUBRC
ASSERT sy-subrc = 0.

IF lines( lt_node_table ) > 1.
lv_key = 1.
LOOP AT lt_node_table INTO ls_node WHERE isfolder = abap_true AND relatkey IS INITIAL.
go_tree->expand_node(
EXPORTING
node_key = lv_key
node_key = ls_node-node_key
EXCEPTIONS
failed = 1
illegal_level_count = 2
cntl_system_error = 3
node_not_found = 4
cannot_expand_leaf = 5 ). "#EC CI_SUBRC
ASSERT sy-subrc = 0.
ENDIF.
ENDLOOP.

ENDMETHOD.

@@ -173,10 +173,9 @@
</item>
<item>
<ID>S</ID>
<KEY>P_DEVC</KEY>
<ENTRY>.</ENTRY>
<LENGTH>15</LENGTH>
<SPLIT>D</SPLIT>
<KEY>P_GATE</KEY>
<ENTRY>Ignore gateway(*_DPC, *_MPC)</ENTRY>
<LENGTH>36</LENGTH>
</item>
<item>
<ID>S</ID>
@@ -190,6 +189,13 @@
<ENTRY>Ignore maintenance views</ENTRY>
<LENGTH>32</LENGTH>
</item>
<item>
<ID>S</ID>
<KEY>S_DEVC</KEY>
<ENTRY>.</ENTRY>
<LENGTH>15</LENGTH>
<SPLIT>D</SPLIT>
</item>
</TPOOL>
</asx:values>
</asx:abap>
@@ -9,6 +9,7 @@ CLASS zcl_aoc_util_programs DEFINITION
!iv_devclass TYPE devclass
!iv_ignore_mview_fugr TYPE abap_bool DEFAULT abap_false
!iv_ignore_local_tests TYPE abap_bool DEFAULT abap_false
!iv_ignore_gateway TYPE abap_bool DEFAULT abap_false
RETURNING
VALUE(rt_programs) TYPE scit_program .
PROTECTED SECTION.
@@ -141,6 +142,11 @@ CLASS ZCL_AOC_UTIL_PROGRAMS IMPLEMENTATION.
AND ( object = 'CLAS' OR object = 'PROG' OR object = 'FUGR' )
AND devclass = iv_devclass. "#EC CI_GENBUFF "#EC CI_SUBRC

IF iv_ignore_gateway = abap_true.
DELETE lt_tadir WHERE obj_name CP '*_DPC' AND object = 'CLAS'.
DELETE lt_tadir WHERE obj_name CP '*_MPC' AND object = 'CLAS'.
ENDIF.

LOOP AT lt_tadir ASSIGNING <ls_tadir>.
CASE <ls_tadir>-object.
WHEN 'CLAS'.

0 comments on commit 4cf82f2

Please sign in to comment.
You can’t perform that action at this time.