* _ _ _ _ _ * /_\ | |__ __ _ _ __ ___ __ _ __| | __ _| |__ _ __ /_\ * //_\\| '_ \ / _` | '_ \ / __/ _` |/ _` |/ _` | '_ \| '__//_\\ * / _ \ |_) | (_| | |_) | (_| (_| | (_| | (_| | |_) | | / _ \ * \_/ \_/_.__/ \__,_| .__/ \___\__,_|\__,_|\__,_|_.__/|_| \_/ \_/ * |_| www.abapcadabra.com *---------------------------------------------------------------------------- * program : ZABAPCADABRA_INVENTORY * title : Customer coding inventory report * functional area : Cross modules * environment : 4.7 * program Function : Select the system's custom made modules (Y* and Z*) and * show details on report size, nr of reports, transactions * function modules, classes, tables, the lot. ALV report * Key count: the total number of lines of custom Abap * coding on the system indicates the size of the system * Documentation : Search for "Sizing the system" on AbapcadabrA.com * Previous version : This is the initial version * Developer name : Wim Maasdam * Development date : 01/02/2012 * Version : 0.2 *--------------------------------------------------------------------- * Change list: * Date Description * 01/02/2012 Initial release * 15/02/2016 Accuracy of report, classes and methods, function modules. * 25/11/2016 Uplift: object oriented, allow editing * http://patorjk.com/software/taag/ Font: Small * 09/05/2017 Support notes-areas, import/export notes (with separate report) * 12/05/2017 Include upload/download functionality * 08/06/2017 Include subroutine pools (cos they are still around..) * 24/01/2020 Bug fixing, additional class-coded logic (line counters) *--------------------------------------------------------------------- REPORT ZABAPCADABRA_INVENTORY. TABLES: d010sinf, tadir, seoclass, tlibt, tstc, sscrfields, tcy38. "Selection screen definition purpose only TYPE-POOLS: seop. * ___ _ ___ __ _ _ _ _ * / __\ | __ _ ___ ___ / \___ / _(_)_ __ (_) |_(_) ___ _ __ ___ * / / | |/ _` / __/ __| / /\ / _ \ |_| | '_ \| | __| |/ _ \| '_ \/ __| * / /___| | (_| \__ \__ \ / /_// __/ _| | | | | | |_| | (_) | | | \__ \ * \____/|_|\__,_|___/___/ /___,' \___|_| |_|_| |_|_|\__|_|\___/|_| |_|___/ CLASS lcl_event_manager DEFINITION. PUBLIC SECTION. METHODS: constructor IMPORTING r_object TYPE REF TO cl_salv_table, on_user_command FOR EVENT added_function OF cl_salv_events IMPORTING e_salv_function, on_link_click FOR EVENT link_click OF cl_salv_events_table IMPORTING row column. PRIVATE SECTION. DATA: go_salv TYPE REF TO cl_salv_table. ENDCLASS. "lcl_event_manager DEFINITION *----------------------------------------------------------------------* * CLASS lcl_summaries DEFINITION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* CLASS lcl_summaries DEFINITION. PUBLIC SECTION. TYPES: BEGIN OF ty_summary, date TYPE sy-datum, time TYPE sy-uzeit, user TYPE sy-uname, sysid TYPE sy-sysid, mandt TYPE sy-mandt, company TYPE c LENGTH 45, summary TYPE c LENGTH 45, puppets TYPE sy-dbcnt, devclasses TYPE sy-dbcnt, linesofcoding TYPE sy-dbcnt, linesofcomment TYPE sy-dbcnt, loc_reports TYPE sy-dbcnt, loc_functions TYPE sy-dbcnt, loc_classes TYPE sy-dbcnt, transactions TYPE sy-dbcnt, transactions_all TYPE sy-dbcnt, reports TYPE sy-dbcnt, modulepools TYPE sy-dbcnt, includes TYPE sy-dbcnt, classes TYPE sy-dbcnt, methods TYPE sy-dbcnt, fungroups TYPE sy-dbcnt, "- functions TYPE sy-dbcnt, includes_function TYPE sy-dbcnt, transformations TYPE sy-dbcnt, colors TYPE lvc_t_scol, END OF ty_summary. CLASS-DATA: gt_summary_data TYPE STANDARD TABLE OF ty_summary, * Variables for ALV display support go_alv TYPE REF TO cl_salv_table, rf_functions_list TYPE REF TO cl_salv_functions_list, rf_columns_table TYPE REF TO cl_salv_columns_table, rf_column TYPE REF TO cl_salv_column, * The footer box rf_layout TYPE REF TO cl_salv_layout. CLASS-METHODS: clipboard_export, clipboard_import, alv_report. ENDCLASS. "lcl_summaries DEFINITION *----------------------------------------------------------------------* * CLASS lcl_inventory DEFINITION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* CLASS lcl_inventory DEFINITION. PUBLIC SECTION. TYPES: BEGIN OF ty_object_info, master TYPE d010inc-master, prog TYPE d010sinf-prog, text TYPE trdirt-text, subc TYPE d010sinf-subc, otype TYPE text40, noteicon TYPE icon_d, noteid TYPE tcy38-aufbkey, notetxt TYPE tvarv_val, notetxt2 TYPE tvarv_val, notecreated TYPE d, notecreator TYPE sy-uname, notechanged TYPE d, notechanger TYPE sy-uname, cnam TYPE d010sinf-cnam, cdat TYPE d010sinf-cdat, unam TYPE d010sinf-unam, udat TYPE d010sinf-udat, transaction TYPE sy-tcode, devclass TYPE tadir-devclass, obj_name TYPE tadir-obj_name, srcsystem TYPE tadir-srcsystem, linecount TYPE sy-dbcnt, commentcount TYPE sy-dbcnt, commentperc TYPE i, lcl_count TYPE sy-dbcnt, lcl_meth_count TYPE sy-dbcnt, lcl_coding_count TYPE sy-dbcnt, rome type boolean, "Rome was not build in a single day one TYPE i, colors TYPE lvc_t_scol, END OF ty_object_info, BEGIN OF ty_tstc, pgmna TYPE tstc-pgmna, tcode TYPE tstc-tcode, END OF ty_tstc, BEGIN OF ty_tadir, obj_name TYPE tadir-obj_name, devclass TYPE tadir-devclass, srcsystem TYPE tadir-srcsystem, hlp_pname TYPE tfdir-pname, END OF ty_tadir. CLASS-DATA: gt_note_info TYPE TABLE OF ty_object_info, gt_note_info_tmp TYPE TABLE OF ty_object_info, gw_note_info TYPE ty_object_info, gw_note_info_tmp TYPE ty_object_info, gt_tadir TYPE TABLE OF ty_tadir, gw_tadir TYPE ty_tadir, gt_tstc TYPE TABLE OF ty_tstc, BEGIN OF gw_totals, puppets TYPE sy-dbcnt, active_puppets TYPE sy-dbcnt, prc_puppets TYPE c LENGTH 30, transactions TYPE sy-dbcnt, transactions_all TYPE sy-dbcnt, txt_transactions TYPE c LENGTH 40, reports TYPE sy-dbcnt, modulepools TYPE sy-dbcnt, subroutinepools TYPE sy-dbcnt, includes TYPE sy-dbcnt, classes TYPE sy-dbcnt, methods TYPE sy-dbcnt, transformations TYPE sy-dbcnt, devclasses TYPE sy-dbcnt, linesofcoding TYPE sy-dbcnt, linesofcomment TYPE sy-dbcnt, local_classes TYPE sy-dbcnt, lcl_linesofcoding TYPE sy-dbcnt, local_methods TYPE sy-dbcnt, fungroups TYPE sy-dbcnt, "- functions TYPE sy-dbcnt, includes_function TYPE sy-dbcnt, loc_reports TYPE sy-dbcnt, "Lines of coding: LOC prc_comments TYPE c LENGTH 30, prc_reports TYPE c LENGTH 30, loc_functions TYPE sy-dbcnt, prc_functions TYPE c LENGTH 30, loc_classes TYPE sy-dbcnt, prc_classes TYPE c LENGTH 30, END OF gw_totals, gv_area TYPE hlpindx-relid, * Variables for ALV display support go_alv TYPE REF TO cl_salv_table, go_event_man TYPE REF TO lcl_event_manager, rf_functions_list TYPE REF TO cl_salv_functions_list, rf_columns_table TYPE REF TO cl_salv_columns_table, rf_column_table TYPE REF TO cl_salv_column_table, rf_column TYPE REF TO cl_salv_column, rf_selections TYPE REF TO cl_salv_selections, * The footer box rf_alv_footer TYPE REF TO cl_salv_form_layout_grid, rf_text TYPE REF TO cl_salv_form_text, rf_layout TYPE REF TO cl_salv_layout, rf_layout_data TYPE REF TO cl_salv_form_layout_data_grid, gv_clskey TYPE seoclskey. CLASS-METHODS: initialize, reports_and_modulepools, subroutinepools, includes, transactions, function_groups, classes, determine_coding_lines, user_filter, descriptions, notes, calculate_totals, alv_report. ENDCLASS. "lcl_inventory DEFINITION *---------------------------------------------------------------------- * CLASS lcl_loader DEFINITION *---------------------------------------------------------------------- class lcl_loader definition. public section. types: BEGIN OF ty_object_info, obj_name TYPE tadir-obj_name, noteid TYPE aufbkey, notetxt TYPE tvarv_val, notetxt2 TYPE tvarv_val, noteCreated TYPE d, noteCreator TYPE sy-uname, noteChanged TYPE d, noteChanger TYPE sy-uname, END OF ty_object_info. class-data: gt_object_info TYPE standard table of ty_object_info. class-methods: set_listbox importing fieldname type any, f4_presentation_file importing title type any changing filepath type any, selection importing area type hlpindx-RELID, save_file importing filename type string, read_file importing filename type string, set_selection importing area type hlpindx-RELID. endclass. * ___ ___ _ ___ ___ _____ ___ ___ _ _ ___ ___ ___ ___ ___ _ _ * / __| __| | | __/ __|_ _|_ _/ _ \| \| | / __|/ __| _ \ __| __| \| | * \__ \ _|| |__| _| (__ | | | | (_) | .` | \__ \ (__| / _|| _|| .` | * |___/___|____|___\___| |_| |___\___/|_|\_| |___/\___|_|_\___|___|_|\_| * DEFINE select_optionsx. selection-screen begin of line. parameters pa_&2 as checkbox default abap_true user-command kicker. selection-screen comment 4(27) lbl_&1 for field so_&2. select-options: so_&2 for &3. selection-screen end of line. END-OF-DEFINITION. DEFINE select_optionsh. selection-screen begin of line. selection-screen comment 1(30) lbl_&1 for field so_&2 modif id nte. select-options: so_&2 for &3 modif id nte. selection-screen end of line. END-OF-DEFINITION. DEFINE select_options. selection-screen begin of line. selection-screen comment 1(30) lbl_&1 for field so_&2. select-options: so_&2 for &3. selection-screen end of line. END-OF-DEFINITION. SELECTION-SCREEN BEGIN OF SCREEN 1100 AS SUBSCREEN. select_options: 01 devc tadir-devclass. select_optionsx: 02 prog d010sinf-prog, 03 clas seoclass-clsname, 04 farea tlibt-area, 05 trans tstc-tcode. select_options: 06 cdat d010sinf-cdat, 07 cnam d010sinf-cnam, 08 udat d010sinf-udat, 09 unam d010sinf-unam. select_options: 10 invo d010sinf-cnam. SELECTION-SCREEN SKIP. SELECTION-SCREEN BEGIN OF LINE. PARAMETERS: pa_text AS CHECKBOX DEFAULT space. SELECTION-SCREEN COMMENT 4(20) lbl_11 FOR FIELD pa_text. SELECTION-SCREEN END OF LINE. SELECTION-SCREEN BEGIN OF LINE. PARAMETERS: pa_notes AS CHECKBOX DEFAULT space USER-COMMAND kicker. SELECTION-SCREEN COMMENT 4(20) lbl_12 FOR FIELD pa_notes. SELECTION-SCREEN POSITION 35. PARAMETERS: pa_area TYPE hlpindx-relid AS LISTBOX VISIBLE LENGTH 20 DEFAULT 'ZX' MODIF ID nte. SELECTION-SCREEN END OF LINE. select_optionsh: 13 notid tcy38-aufbkey, 14 notcd d010sinf-cdat, 15 notcr d010sinf-cnam, 16 notc2 d010sinf-udat, 17 notch d010sinf-unam, 18 notin d010sinf-cnam. SELECTION-SCREEN END OF SCREEN 1100. SELECTION-SCREEN BEGIN OF SCREEN 1200 AS SUBSCREEN. selection-screen begin of line. parameters: pa_down as checkbox default space. selection-screen comment 5(25) lb2_01 for field pa_down. selection-screen end of line. selection-screen begin of line. selection-screen comment 5(12) lb2_02 for field pa_dfile. parameters: pa_dfile type string lower case. selection-screen end of line. selection-screen begin of line. selection-screen comment 5(12) lb2_03 for field pa_darea. parameters: pa_darea type hlpindx-RELID AS LISTBOX VISIBLE LENGTH 20 DEFAULT 'ZX'. selection-screen end of line. selection-screen skip. selection-screen begin of line. parameters: pa_up as checkbox default space. selection-screen comment 5(23) lb2_04 for field pa_up. selection-screen end of line. selection-screen begin of line. selection-screen comment 5(12) lb2_05 for field pa_ufile. parameters: pa_ufile type string lower case. selection-screen end of line. selection-screen begin of line. selection-screen comment 5(12) lb2_06 for field pa_uarea. parameters: pa_uarea type hlpindx-RELID AS LISTBOX VISIBLE LENGTH 20 DEFAULT 'ZX'. selection-screen end of line. SELECTION-SCREEN END OF SCREEN 1200. SELECTION-SCREEN BEGIN OF TABBED BLOCK maintab FOR 19 LINES. SELECTION-SCREEN TAB (22) gl_tab1 USER-COMMAND tab1 DEFAULT SCREEN 1100. SELECTION-SCREEN TAB (22) gl_tab2 USER-COMMAND tab2 DEFAULT SCREEN 1200. SELECTION-SCREEN END OF BLOCK maintab. SELECTION-SCREEN BEGIN OF LINE. SELECTION-SCREEN PUSHBUTTON (70) lbl_abca USER-COMMAND abapcadabra VISIBLE LENGTH 5. SELECTION-SCREEN END OF LINE. at selection-screen on value-request for pa_dfile. lcl_loader=>f4_presentation_file( exporting title = 'Choose file to download to' changing filepath = pa_dfile ). at selection-screen on value-request for pa_ufile. lcl_loader=>f4_presentation_file( exporting title = 'Choose file to upload from' changing filepath = pa_ufile ). AT SELECTION-SCREEN OUTPUT. lcl_loader=>set_listbox( 'PA_DAREA' ). lcl_loader=>set_listbox( 'PA_UAREA' ). lcl_loader=>set_listbox( 'PA_AREA' ). LOOP AT SCREEN. IF screen-name = 'SO_PROG-LOW' OR screen-name = 'SO_PROG-HIGH'. IF pa_prog = abap_true. screen-input = '1'. ELSE. screen-input = '0'. ENDIF. ENDIF. IF screen-name = 'SO_CLAS-LOW' OR screen-name = 'SO_CLAS-HIGH'. IF pa_clas = abap_true. screen-input = '1'. ELSE. screen-input = '0'. ENDIF. ENDIF. IF screen-name = 'SO_FAREA-LOW' OR screen-name = 'SO_FAREA-HIGH'. IF pa_farea = abap_true. screen-input = '1'. ELSE. screen-input = '0'. ENDIF. ENDIF. IF screen-name = 'SO_TRANS-LOW' OR screen-name = 'SO_TRANS-HIGH'. IF pa_trans = abap_true. screen-input = '1'. ELSE. screen-input = '0'. ENDIF. ENDIF. IF screen-group1 = 'NTE'. IF pa_notes = abap_true. screen-input = '1'. ELSE. screen-input = '0'. IF screen-name <> 'PA_NOTES'. screen-active = '0'. ENDIF. ENDIF. ENDIF. MODIFY SCREEN. ENDLOOP. AT SELECTION-SCREEN. CASE sscrfields-ucomm. WHEN 'ABAPCADABRA'. CALL FUNCTION 'CALL_BROWSER' EXPORTING url = 'http://abapcadabra.com/index.php/upgrades/286-customer-inventory' EXCEPTIONS OTHERS = 0. ENDCASE. * ___ _ _ ___ _____ ___ _ _ ___ ____ _ _____ ___ ___ _ _ * |_ _| \| |_ _|_ _|_ _| /_\ | | |_ _|_ / /_\_ _|_ _/ _ \| \| | * | || .` || | | | | | / _ \| |__ | | / / / _ \| | | | (_) | .` | * |___|_|\_|___| |_| |___/_/ \_\____|___/___/_/ \_\_| |___\___/|_|\_| * INITIALIZATION. gl_tab1 = 'Main selection'. gl_tab2 = 'Notes'. lbl_01 = 'Development class'. lbl_02 = 'Report name'. lbl_03 = 'Class name'. lbl_04 = 'Function group'. lbl_05 = 'Transaction code'. lbl_06 = 'Create date'. lbl_07 = 'Created by'. lbl_08 = 'Change date'. lbl_09 = '(Last) changed by'. lbl_10 = 'Involving'. lbl_11 = 'With descriptions'. lbl_12 = 'With notes'. lbl_13 = 'Note ID'. lbl_14 = 'Created on'. lbl_15 = 'Created by'. lbl_16 = 'Changed on'. lbl_17 = '(Last) changed by'. lbl_18 = 'Involving'. lb2_01 = 'Download notes info'. lb2_02 = 'Into file'. lb2_03 = 'From (area)'. lb2_04 = 'Upload notes info'. lb2_05 = 'From file'. lb2_06 = 'Into (area)'. lbl_abca = '@N5\QMore on AbapcadabrA.com@'. IF so_devc[] IS INITIAL AND so_prog[] IS INITIAL AND so_clas[] IS INITIAL. CLEAR: so_devc[]. APPEND 'EEQ$TMP' TO so_devc. * Program names and include names follow the same Y* or Z* naming * convention - to cater for function pools, SAPLY* and SAPLZ* as * well as LZ* and LY* are also selected. CLEAR so_prog[]. APPEND 'ICPZ*' TO so_prog. APPEND 'ICPSAPMZ*' TO so_prog. APPEND 'ICPY*' TO so_prog. APPEND 'ICPSAPMY*' TO so_prog. CLEAR: so_clas[]. APPEND 'ICPZ*' TO so_clas. APPEND 'ICPY*' TO so_clas. CLEAR: so_farea[]. APPEND 'ICPZ*' TO so_farea. APPEND 'ICPY*' TO so_farea. CLEAR: so_trans[]. APPEND 'ICPZ*' TO so_trans. APPEND 'ICPY*' TO so_trans. ENDIF. * ___ _ _ ___ ___ ___ __ __ ___ _ ___ __ __ ___ _ _ _____ _ _____ ___ ___ _ _ ___ * / __| | /_\ / __/ __| |_ _| \/ | _ \ | | __| \/ | __| \| |_ _/_\_ _|_ _/ _ \| \| / __| * | (__| |__ / _ \\__ \__ \ | || |\/| | _/ |__| _|| |\/| | _|| .` | | |/ _ \| | | | (_) | .` \__ \ * \___|____/_/ \_\___/___/ |___|_| |_|_| |____|___|_| |_|___|_|\_| |_/_/ \_\_| |___\___/|_|\_|___/ * *----------------------------------------------------------------------* * CLASS lcl_event_manager IMPLEMENTATION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* CLASS lcl_event_manager IMPLEMENTATION. METHOD constructor. DATA: lo_events TYPE REF TO cl_salv_events_table. go_salv = r_object. lo_events = go_salv->get_event( ). SET HANDLER on_user_command FOR lo_events. SET HANDLER on_link_click FOR lo_events. ENDMETHOD. "constructor METHOD on_user_command. CASE sy-ucomm. WHEN 'COPY'. lcl_summaries=>clipboard_export( ). lcl_summaries=>clipboard_import( ). IF NOT lcl_summaries=>gt_summary_data[] IS INITIAL. lcl_summaries=>alv_report( ). ENDIF. WHEN 'PASTE'. lcl_summaries=>clipboard_import( ). IF NOT lcl_summaries=>gt_summary_data[] IS INITIAL. lcl_summaries=>alv_report( ). ENDIF. ENDCASE. ENDMETHOD. "on_user_command METHOD on_link_click. DATA: lt_sval TYPE STANDARD TABLE OF sval, lw_sval TYPE sval, lv_returncode TYPE c, lt_bdcdata TYPE STANDARD TABLE OF bdcdata, lw_bdcdata TYPE bdcdata. * bdc_add 'X' 'PROGRAM_NAME' 'SCREEN NUMBER'. * bdc_add ' ' 'FIELDNAME' 'FIELDVALUE'. DEFINE bdc_add. clear lw_bdcdata. lw_bdcdata-dynbegin = &1. if &1 eq 'X'. lw_bdcdata-program = &2. lw_bdcdata-dynpro = &3. else. lw_bdcdata-fnam = &2. lw_bdcdata-fval = &3. endif. append lw_bdcdata to lt_bdcdata. END-OF-DEFINITION. * lt_rows TYPE salv_t_row, * lv_row TYPE int4. * lt_rows = lcl_inventory=>rf_selections->get_selected_rows( ). * DESCRIBE TABLE lt_rows LINES lv_row. * IF lv_row = 1. READ TABLE lcl_inventory=>gt_note_info INTO lcl_inventory=>gw_note_info INDEX row. IF sy-subrc = 0. CASE column. WHEN 'PROG'. CASE lcl_inventory=>gw_note_info-otype. WHEN 'Report' OR 'Include' OR 'Function top include' OR 'Function include' OR 'Module pool' OR 'Subroutine pool'. CLEAR: lt_bdcdata. bdc_add: 'X' 'SAPLWBABAP' '100', ' ' 'RS38M-PROGRAMM' lcl_inventory=>gw_note_info-prog, ' ' 'BDC_OKCODE' '=SHOP', 'X' 'SAPLS38E' '0400'. CALL TRANSACTION 'SE38' USING lt_bdcdata MODE 'E'. WHEN 'Transaction'. CALL TRANSACTION lcl_inventory=>gw_note_info-transaction. WHEN 'Function'. CLEAR: lt_bdcdata. bdc_add: 'X' 'SAPLSFUNCTION_BUILDER' '1008', ' ' 'RS38L-NAME' lcl_inventory=>gw_note_info-prog. CALL TRANSACTION 'SE37' USING lt_bdcdata MODE 'E'. * when 'Class'. * clear: lt_bdcdata. * bdc_add: 'X' 'SAPLSEOD' '1000', * ' ' 'SEOCLASS-CLSNAME' lcl_inventory=>gw_note_info-prog. * call transaction 'SE24' using lt_bdcdata mode 'E'. WHEN 'Method' OR 'Public section' OR 'Private section' OR 'Protected section'. CLEAR: lt_bdcdata. bdc_add: 'X' 'SAPLWBABAP' '100', ' ' 'RS38M-PROGRAMM' lcl_inventory=>gw_note_info-obj_name, ' ' 'BDC_OKCODE' '=SHOP', 'X' 'SAPLSEO_CLEDITOR' '0300'. CALL TRANSACTION 'SE38' USING lt_bdcdata MODE 'E'. WHEN OTHERS. MESSAGE 'Sorry...' TYPE 'S'. ENDCASE. WHEN 'NOTEICON'. CLEAR: lt_sval[], lw_sval. lw_sval-tabname = 'TCY38'. lw_sval-fieldname = 'AUFBKEY'. lw_sval-fieldtext = 'Note ID'. lw_sval-value = lcl_inventory=>gw_note_info-noteid. APPEND lw_sval TO lt_sval. lw_sval-tabname = 'TVARVC'. lw_sval-fieldname = 'HIGH'. lw_sval-fieldtext = 'Note'. lw_sval-value = lcl_inventory=>gw_note_info-notetxt. APPEND lw_sval TO lt_sval. lw_sval-tabname = 'TVARVC'. lw_sval-fieldname = 'LOW'. lw_sval-fieldtext = 'More'. lw_sval-value = lcl_inventory=>gw_note_info-notetxt2. APPEND lw_sval TO lt_sval. * Show popup in which the future key date can be entered CALL FUNCTION 'POPUP_GET_VALUES' EXPORTING popup_title = 'Note' IMPORTING returncode = lv_returncode TABLES fields = lt_sval EXCEPTIONS OTHERS = 0. IF lv_returncode = 'A'. MESSAGE 'Action cancelled' TYPE 'S'. ELSE. READ TABLE lt_sval INDEX 1 INTO lw_sval. lcl_inventory=>gw_note_info-noteid = lw_sval-value. READ TABLE lt_sval INDEX 2 INTO lw_sval. lcl_inventory=>gw_note_info-notetxt = lw_sval-value. READ TABLE lt_sval INDEX 3 INTO lw_sval. lcl_inventory=>gw_note_info-notetxt2 = lw_sval-value. IF lcl_inventory=>gw_note_info-noteid IS INITIAL AND lcl_inventory=>gw_note_info-notetxt IS INITIAL AND lcl_inventory=>gw_note_info-notetxt2 IS INITIAL. * Remove from HLPINDX storage (INDX) DELETE FROM DATABASE hlpindx(zx) ID lcl_inventory=>gw_note_info-obj_name. CLEAR: lcl_inventory=>gw_note_info-notecreator, lcl_inventory=>gw_note_info-notecreated, lcl_inventory=>gw_note_info-notechanger, lcl_inventory=>gw_note_info-notechanged. ELSE. IF lcl_inventory=>gw_note_info-notecreated IS INITIAL. lcl_inventory=>gw_note_info-notecreated = sy-datum. lcl_inventory=>gw_note_info-notecreator = sy-uname. ENDIF. lcl_inventory=>gw_note_info-notechanged = sy-datum. lcl_inventory=>gw_note_info-notechanger = sy-uname. * Add to or update HLPINDX storage CASE lcl_inventory=>gv_area. WHEN 'ZX'. EXPORT noteid = lcl_inventory=>gw_note_info-noteid notetxt = lcl_inventory=>gw_note_info-notetxt notetxt2 = lcl_inventory=>gw_note_info-notetxt2 notecreated = lcl_inventory=>gw_note_info-notecreated notecreator = lcl_inventory=>gw_note_info-notecreator notechanged = lcl_inventory=>gw_note_info-notechanged notechanger = lcl_inventory=>gw_note_info-notechanger TO DATABASE hlpindx(zx) ID lcl_inventory=>gw_note_info-obj_name. WHEN 'ZY'. EXPORT noteid = lcl_inventory=>gw_note_info-noteid notetxt = lcl_inventory=>gw_note_info-notetxt notetxt2 = lcl_inventory=>gw_note_info-notetxt2 notecreated = lcl_inventory=>gw_note_info-notecreated notecreator = lcl_inventory=>gw_note_info-notecreator notechanged = lcl_inventory=>gw_note_info-notechanged notechanger = lcl_inventory=>gw_note_info-notechanger TO DATABASE hlpindx(zy) ID lcl_inventory=>gw_note_info-obj_name. WHEN 'ZZ'. EXPORT noteid = lcl_inventory=>gw_note_info-noteid notetxt = lcl_inventory=>gw_note_info-notetxt notetxt2 = lcl_inventory=>gw_note_info-notetxt2 notecreated = lcl_inventory=>gw_note_info-notecreated notecreator = lcl_inventory=>gw_note_info-notecreator notechanged = lcl_inventory=>gw_note_info-notechanged notechanger = lcl_inventory=>gw_note_info-notechanger TO DATABASE hlpindx(zz) ID lcl_inventory=>gw_note_info-obj_name. WHEN 'Z1'. EXPORT noteid = lcl_inventory=>gw_note_info-noteid notetxt = lcl_inventory=>gw_note_info-notetxt notetxt2 = lcl_inventory=>gw_note_info-notetxt2 notecreated = lcl_inventory=>gw_note_info-notecreated notecreator = lcl_inventory=>gw_note_info-notecreator notechanged = lcl_inventory=>gw_note_info-notechanged notechanger = lcl_inventory=>gw_note_info-notechanger TO DATABASE hlpindx(z1) ID lcl_inventory=>gw_note_info-obj_name. WHEN 'Z2'. EXPORT noteid = lcl_inventory=>gw_note_info-noteid notetxt = lcl_inventory=>gw_note_info-notetxt notetxt2 = lcl_inventory=>gw_note_info-notetxt2 notecreated = lcl_inventory=>gw_note_info-notecreated notecreator = lcl_inventory=>gw_note_info-notecreator notechanged = lcl_inventory=>gw_note_info-notechanged notechanger = lcl_inventory=>gw_note_info-notechanger TO DATABASE hlpindx(z2) ID lcl_inventory=>gw_note_info-obj_name. WHEN 'Z3'. EXPORT noteid = lcl_inventory=>gw_note_info-noteid notetxt = lcl_inventory=>gw_note_info-notetxt notetxt2 = lcl_inventory=>gw_note_info-notetxt2 notecreated = lcl_inventory=>gw_note_info-notecreated notecreator = lcl_inventory=>gw_note_info-notecreator notechanged = lcl_inventory=>gw_note_info-notechanged notechanger = lcl_inventory=>gw_note_info-notechanger TO DATABASE hlpindx(z3) ID lcl_inventory=>gw_note_info-obj_name. ENDCASE. ENDIF. MODIFY lcl_inventory=>gt_note_info FROM lcl_inventory=>gw_note_info INDEX row. ENDIF. WHEN 'CNAM' OR 'UNAM'. DATA: lv_username TYPE bapibname-bapibname, lw_logondata TYPE bapilogond, lw_address TYPE bapiaddr3, lw_admindata TYPE bapiuseradmin, lw_devaccess TYPE devaccess, lt_return TYPE STANDARD TABLE OF bapiret2, lw_return TYPE bapiret2, lw_popup TYPE rstabl, BEGIN OF lw_extra_fields, start TYPE c LENGTH 10, finish TYPE c LENGTH 10, ltime TYPE c LENGTH 5, END OF lw_extra_fields, lv_terminal TYPE usr41-terminal. IF column = 'CNAM'. lv_username = lcl_inventory=>gw_note_info-cnam. ELSE. lv_username = lcl_inventory=>gw_note_info-unam. ENDIF. * Fetch user information and display in popup: CALL FUNCTION 'BAPI_USER_GET_DETAIL' EXPORTING username = lv_username IMPORTING logondata = lw_logondata address = lw_address admindata = lw_admindata TABLES return = lt_return. CLEAR: lw_popup. lw_popup-title = 'User data'. CLEAR: lw_extra_fields. WRITE lw_admindata-erdat DD/MM/YYYY TO lw_extra_fields-start. WRITE lw_admindata-trdat DD/MM/YYYY TO lw_extra_fields-finish. WRITE lw_logondata-ltime USING EDIT MASK '__:__' TO lw_extra_fields-ltime. CONCATENATE 'User :' lv_username lw_address-fullname INTO lw_popup-txt1 SEPARATED BY space. IF NOT lt_return[] IS INITIAL. READ TABLE lt_return INTO lw_return INDEX 1. lw_popup-txt3 = lw_return-message. SHIFT lw_popup-txt3 RIGHT BY 13 PLACES. ELSE. CONCATENATE 'Active :' lw_extra_fields-start 'to' lw_extra_fields-finish lw_extra_fields-ltime INTO lw_popup-txt2 SEPARATED BY space. SELECT SINGLE * FROM devaccess INTO lw_devaccess WHERE uname = lv_username. IF sy-subrc = 0. lw_popup-txt3 = ' Has developer key'. ELSE. lw_popup-txt3 = ' Has NO developer key'. ENDIF. * Check whether the user is available right now: CALL FUNCTION 'TERMINAL_ID_GET' EXPORTING username = lv_username IMPORTING terminal = lv_terminal EXCEPTIONS OTHERS = 4. IF sy-subrc <> 0. lw_popup-txt4 = 'User not logged on'. ELSE. lw_popup-txt4 = lv_terminal. ENDIF. SHIFT lw_popup-txt4 RIGHT BY 13 PLACES. ENDIF. CALL FUNCTION 'POPUP_TO_INFORM' EXPORTING titel = lw_popup-title txt1 = lw_popup-txt1 txt2 = lw_popup-txt2 txt3 = lw_popup-txt3 txt4 = lw_popup-txt4. ENDCASE. ENDIF. go_salv->refresh( ). ENDMETHOD. "on_link_click ENDCLASS. "lcl_event_manager IMPLEMENTATION *----------------------------------------------------------------------* * CLASS lcl_summaries IMPLEMENTATION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* CLASS lcl_summaries IMPLEMENTATION. METHOD clipboard_export. DATA: lt_sval TYPE STANDARD TABLE OF sval, lw_sval TYPE sval, lv_returncode TYPE c, lv_rc TYPE i, lv_datastring TYPE string, lt_datastring TYPE STANDARD TABLE OF char2000, lv_fieldname TYPE c LENGTH 20, lv_charnum TYPE c LENGTH 20. DEFINE addfld. concatenate lv_datastring &1 ':' &2 ';' into lv_datastring. condense lv_datastring. END-OF-DEFINITION. DEFINE addttl. lv_fieldname = '&1'. translate lv_fieldname to upper case. write lcl_inventory=>gw_totals-&1 to lv_charnum left-justified. replace all occurrences of '.' in lv_charnum with ''. concatenate lv_datastring lv_fieldname ':' lv_charnum ';' into lv_datastring. condense lv_datastring. END-OF-DEFINITION. CLEAR: lt_sval[], lw_sval. lw_sval-tabname = 'TVARVC'. lw_sval-fieldname = 'LOW'. lw_sval-fieldtext = 'Company'. lw_sval-value = 'Company name'. APPEND lw_sval TO lt_sval. lw_sval-tabname = 'TVARVC'. lw_sval-fieldname = 'HIGH'. lw_sval-fieldtext = 'Summary'. lw_sval-value = 'Full selection'. APPEND lw_sval TO lt_sval. * Show popup in which the future key date can be entered CALL FUNCTION 'POPUP_GET_VALUES' EXPORTING popup_title = 'Capture statistics - to clipboard' IMPORTING returncode = lv_returncode TABLES fields = lt_sval EXCEPTIONS OTHERS = 0. IF lv_returncode = 'A'. MESSAGE 'Action cancelled' TYPE 'S'. ELSE. CLEAR: lt_datastring[], lv_datastring. addfld: 'DATE' sy-datum, 'TIME' sy-uzeit, 'USER' sy-uname, 'SYSID' sy-sysid, 'MANDT' sy-mandt. READ TABLE lt_sval INDEX 1 INTO lw_sval. addfld 'COMPANY' lw_sval-value. READ TABLE lt_sval INDEX 2 INTO lw_sval. addfld 'SUMMARY' lw_sval-value. addttl: puppets, transactions, transactions_all, reports, modulepools, includes, classes, methods, transformations, devclasses, linesofcoding, linesofcomment, fungroups, functions, includes_function, loc_reports, loc_functions, loc_classes. * Place on windows clipboard APPEND lv_datastring TO lt_datastring. cl_gui_frontend_services=>clipboard_export( IMPORTING data = lt_datastring CHANGING rc = lv_rc ). MESSAGE 'Statistics placed on clipboard' TYPE 'S'. ENDIF. ENDMETHOD. "clipboard_export METHOD clipboard_import. DATA: lv_datastring TYPE string, lt_datastring TYPE STANDARD TABLE OF char2000, lt_tokens TYPE STANDARD TABLE OF string, lv_token TYPE string, lv_fieldname TYPE c LENGTH 60, BEGIN OF lw_parval, par TYPE c LENGTH 45, val TYPE c LENGTH 45, END OF lw_parval, lw_summary TYPE ty_summary, lv_lines TYPE sy-tabix. FIELD-SYMBOLS TYPE any. cl_gui_frontend_services=>clipboard_import( IMPORTING data = lt_datastring ). IF lt_datastring[] IS INITIAL. MESSAGE 'Nothing on the clipboard...' TYPE 'S'. EXIT. ENDIF. CLEAR: gt_summary_data[]. LOOP AT lt_datastring INTO lv_datastring. SPLIT lv_datastring AT ';' INTO TABLE lt_tokens. DESCRIBE TABLE lt_tokens LINES lv_lines. IF lv_lines < 20. CONTINUE. ENDIF. CLEAR lw_summary. LOOP AT lt_tokens INTO lv_token. SPLIT lv_token AT ':' INTO lw_parval-par lw_parval-val. CONCATENATE 'LW_SUMMARY-' lw_parval-par INTO lv_fieldname. ASSIGN (lv_fieldname) TO . IF sy-subrc = 0. MOVE lw_parval-val TO . ENDIF. ENDLOOP. APPEND lw_summary TO gt_summary_data. ENDLOOP. IF gt_summary_data[] IS INITIAL. MESSAGE 'No relevant data on the Clipboard' TYPE 'S'. EXIT. ENDIF. ENDMETHOD. "clipboard_import METHOD alv_report. DATA: lv_text TYPE scrtext_s, lv_text_m TYPE scrtext_m, lv_text_l TYPE scrtext_l, lw_layout_key TYPE salv_s_layout_key. DEFINE set_text_field. rf_column = rf_columns_table->get_column( &1 ). lv_text = &2. lv_text_m = &2. lv_text_l = &2. rf_column->set_short_text( lv_text ). rf_column->set_medium_text( lv_text_m ). rf_column->set_long_text( lv_text_l ). END-OF-DEFINITION. DEFINE set_hidden_field. set_text_field &1 &2. rf_column->set_visible( abap_false ). END-OF-DEFINITION. TRY. cl_salv_table=>factory( IMPORTING r_salv_table = go_alv CHANGING t_table = gt_summary_data ). rf_functions_list = go_alv->get_functions( ). rf_functions_list->set_all( ). rf_columns_table = go_alv->get_columns( ). rf_columns_table->set_color_column( value = 'COLORS' ). rf_columns_table->set_optimize( abap_true ). "Always a good idea set_text_field: 'COMPANY' 'Company', 'SUMMARY' 'Additional', 'PUPPETS' 'Developers involved', 'TRANSACTIONS' 'Transaction codes (for report)', 'TRANSACTIONS_ALL' 'Transaction codes (total)', 'REPORTS' 'Reports', 'MODULEPOOLS' 'Module pools', 'INCLUDES' 'Includes', 'CLASSES' 'Classes', 'METHODS' 'Methods', 'TRANSFORMATIONS' 'Transformations', 'DEVCLASSES' 'Development classes', 'LINESOFCODING' 'Abap coding lines', 'LINESOFCOMMENT' 'Abap comment lines', 'FUNGROUPS' 'Function groups', 'FUNCTIONS' 'Function modules', 'INCLUDES_FUNCTION' 'Includes (functions)', 'LOC_REPORTS' 'Lines - reports', 'LOC_FUNCTIONS' 'Lines - functions', 'LOC_CLASSES' 'Lines - classes'. * rf_column_table ?= rf_columns_table->get_column( 'PROG' ). * rf_column_table->set_cell_type( if_salv_c_cell_type=>hotspot ). rf_layout = go_alv->get_layout( ). lw_layout_key-report = sy-cprog. lw_layout_key-logical_group = '1272'. rf_layout->set_key( lw_layout_key ). rf_layout->set_default( abap_true ). rf_layout->set_save_restriction( if_salv_c_layout=>restrict_none ). go_alv->display( ). CATCH: cx_salv_msg, cx_salv_not_found, cx_salv_data_error. MESSAGE 'Error generating ALV report' TYPE 'E'. ENDTRY. ENDMETHOD. "alv_report ENDCLASS. "lcl_summaries IMPLEMENTATION *----------------------------------------------------------------------* * CLASS lcl_inventory IMPLEMENTATION *----------------------------------------------------------------------* * *----------------------------------------------------------------------* CLASS lcl_inventory IMPLEMENTATION. METHOD initialize. CLEAR: gt_note_info[], gw_totals. ENDMETHOD. "initialize "initialize METHOD reports_and_modulepools. DATA: lw_tstc TYPE ty_tstc. * Transaction codes - for the reports (type 1) and module pools (type M) SELECT pgmna tcode FROM tstc INTO TABLE gt_tstc WHERE pgmna IN so_prog. SORT gt_tstc BY pgmna. *------------------------------------------------------------------- * REPORTS: from the Report Source Code table SELECT prog subc cnam cdat unam udat FROM d010sinf INTO CORRESPONDING FIELDS OF TABLE gt_note_info WHERE prog IN so_prog AND r3state EQ 'A' AND "Active cdat IN so_cdat AND cnam IN so_cnam AND udat IN so_udat AND unam IN so_unam AND subc = '1'. "<= Startable reports only * Standard SAP objects to be ignored DELETE gt_note_info WHERE cnam(3) EQ 'SAP' OR unam(3) EQ 'SAP'. DELETE gt_note_info WHERE NOT ( cnam IN so_invo OR unam IN so_invo ). IF NOT gt_note_info[] IS INITIAL. * Update OBJ_NAME LOOP AT gt_note_info INTO gw_note_info. gw_note_info-obj_name = gw_note_info-prog. MODIFY gt_note_info FROM gw_note_info TRANSPORTING obj_name. ENDLOOP. * The TADIR entry - to determine the package / devclass SELECT obj_name devclass srcsystem FROM tadir INTO TABLE gt_tadir FOR ALL ENTRIES IN gt_note_info WHERE pgmid = 'R3TR' AND object = 'PROG' AND devclass IN so_devc AND obj_name = gt_note_info-obj_name. SORT gt_tadir BY obj_name. LOOP AT gt_note_info INTO gw_note_info. * Check development class / package READ TABLE gt_tadir WITH KEY obj_name = gw_note_info-obj_name INTO gw_tadir. IF sy-subrc <> 0. DELETE gt_note_info. CONTINUE. ELSE. gw_note_info-devclass = gw_tadir-devclass. gw_note_info-srcsystem = gw_tadir-srcsystem. ENDIF. * Check transaction code READ TABLE gt_tstc WITH KEY pgmna = gw_note_info-prog BINARY SEARCH INTO lw_tstc. IF sy-subrc EQ 0. gw_note_info-transaction = lw_tstc-tcode. ENDIF. gw_note_info-otype = 'Report'. MODIFY gt_note_info FROM gw_note_info. ENDLOOP. ENDIF. *------------------------------------------------------------------- * MODULE POOLS: from the Report Source Code table CLEAR: gt_note_info_tmp[]. SELECT prog subc cnam cdat unam udat FROM d010sinf INTO CORRESPONDING FIELDS OF TABLE gt_note_info_tmp WHERE prog IN so_prog AND r3state EQ 'A' AND "Active cdat IN so_cdat AND cnam IN so_cnam AND udat IN so_udat AND unam IN so_unam AND subc = 'M'. "<= Module pools only * Standard SAP objects to be ignored DELETE gt_note_info_tmp WHERE cnam(3) EQ 'SAP' OR unam(3) EQ 'SAP'. DELETE gt_note_info_tmp WHERE NOT ( cnam IN so_invo AND unam IN so_invo ). IF NOT gt_note_info_tmp[] IS INITIAL. * Update OBJ_NAME LOOP AT gt_note_info_tmp INTO gw_note_info. gw_note_info-obj_name = gw_note_info-prog. MODIFY gt_note_info_tmp FROM gw_note_info TRANSPORTING obj_name. ENDLOOP. * The TADIR entry - to determine the package / devclass SELECT obj_name devclass srcsystem FROM tadir INTO TABLE gt_tadir FOR ALL ENTRIES IN gt_note_info_tmp WHERE pgmid = 'R3TR' AND object = 'PROG' AND devclass IN so_devc AND obj_name = gt_note_info_tmp-obj_name. SORT gt_tadir BY obj_name. LOOP AT gt_note_info_tmp INTO gw_note_info. * Check development class / package READ TABLE gt_tadir WITH KEY obj_name = gw_note_info-obj_name INTO gw_tadir. IF sy-subrc <> 0. DELETE gt_note_info_tmp. CONTINUE. ELSE. gw_note_info-devclass = gw_tadir-devclass. gw_note_info-srcsystem = gw_tadir-srcsystem. ENDIF. * Check transaction code READ TABLE gt_tstc WITH KEY pgmna = gw_note_info-prog BINARY SEARCH INTO lw_tstc. IF sy-subrc EQ 0. gw_note_info-transaction = lw_tstc-tcode. ENDIF. gw_note_info-otype = 'Module pool'. MODIFY gt_note_info_tmp FROM gw_note_info. ENDLOOP. ENDIF. APPEND LINES OF gt_note_info_tmp TO gt_note_info. ENDMETHOD. "reports_and_modulepools METHOD subroutinepools. DATA: lt_includes TYPE TABLE OF d010inc, lw_include TYPE d010inc, lw_note_info type ty_object_info, lt_includetab type standard table of D010INC-include, lt_note_info_tmp TYPE TABLE OF ty_object_info. clear: gt_note_info_tmp[]. *------------------------------------------------------------------- * SUBROUTINE POOLS: not common, but used SELECT prog subc cnam cdat unam udat FROM d010sinf INTO CORRESPONDING FIELDS OF TABLE gt_note_info_tmp WHERE prog IN so_prog AND r3state EQ 'A' AND "Active cdat IN so_cdat AND cnam IN so_cnam AND udat IN so_udat AND unam IN so_unam AND subc = 'S'. "<= Subroutine pools * Standard SAP objects to be ignored DELETE gt_note_info_tmp WHERE cnam(3) EQ 'SAP' OR unam(3) EQ 'SAP'. DELETE gt_note_info_tmp WHERE NOT ( cnam IN so_invo OR unam IN so_invo ). IF NOT gt_note_info_tmp[] IS INITIAL. * Update OBJ_NAME LOOP AT gt_note_info_tmp INTO gw_note_info. gw_note_info-obj_name = gw_note_info-prog. MODIFY gt_note_info_tmp FROM gw_note_info TRANSPORTING obj_name. ENDLOOP. * The TADIR entry - to determine the package / devclass SELECT obj_name devclass FROM tadir INTO TABLE gt_tadir FOR ALL ENTRIES IN gt_note_info_tmp WHERE pgmid = 'R3TR' AND object = 'PROG' AND devclass IN so_devc AND obj_name = gt_note_info_tmp-obj_name. SORT gt_tadir BY obj_name. LOOP AT gt_note_info_tmp INTO gw_note_info. * Check development class / package READ TABLE gt_tadir WITH KEY obj_name = gw_note_info-obj_name INTO gw_tadir. IF sy-subrc <> 0. DELETE gt_note_info_tmp. CONTINUE. ELSE. gw_note_info-devclass = gw_tadir-devclass. ENDIF. gw_note_info-otype = 'Subroutine pool'. MODIFY gt_note_info_tmp FROM gw_note_info. ENDLOOP. *------------------------------------------------------------------- * The includes on module pools and reports: IF NOT gt_note_info_tmp[] IS INITIAL. * Includes IF 1 = 2. "If TRUE: The D010INC index is regarded "reliable" SELECT * FROM d010inc INTO TABLE lt_includes FOR ALL ENTRIES IN gt_note_info_tmp WHERE master = gt_note_info_tmp-prog. ELSE. loop at gt_note_info_tmp into lw_note_info. clear: lt_includetab[]. CALL FUNCTION 'GET_INCLUDETAB' EXPORTING PROGNAME = lw_note_info-prog TABLES INCLTAB = lt_includetab. loop at lt_includetab into lw_include-include. lw_include-master = lw_note_info-prog. append lw_include to lt_includes. endloop. endloop. endif. * Add to the gt_note_info pool: IF NOT lt_includes[] IS INITIAL. CLEAR: lt_note_info_tmp[]. SELECT prog subc cnam cdat unam udat FROM d010sinf INTO CORRESPONDING FIELDS OF TABLE lt_note_info_tmp FOR ALL ENTRIES IN lt_includes WHERE prog = lt_includes-include AND r3state EQ 'A' AND "Active cdat IN so_cdat AND cnam IN so_cnam AND udat IN so_udat AND unam IN so_unam AND subc = 'I'. DELETE lt_note_info_tmp WHERE cnam(3) EQ 'SAP' OR unam(3) EQ 'SAP'. DELETE lt_note_info_tmp WHERE NOT ( cnam IN so_invo AND unam IN so_invo ). * Update OBJ_NAME LOOP AT lt_note_info_tmp INTO gw_note_info. gw_note_info-obj_name = gw_note_info-prog. MODIFY lt_note_info_tmp FROM gw_note_info TRANSPORTING obj_name. ENDLOOP. * The TADIR entry - to determine the package / devclass SELECT obj_name devclass FROM tadir INTO TABLE gt_tadir FOR ALL ENTRIES IN lt_note_info_tmp WHERE pgmid = 'R3TR' AND object = 'PROG' AND devclass IN so_devc AND obj_name = lt_note_info_tmp-obj_name. SORT gt_tadir BY obj_name. LOOP AT lt_note_info_tmp INTO gw_note_info. gw_note_info-obj_name = gw_note_info-prog. * Determine master report (first one available will do for linecounts) READ TABLE lt_includes WITH KEY include = gw_note_info-prog INTO lw_include. gw_note_info-master = lw_include-master. * Check development class / package READ TABLE gt_tadir WITH KEY obj_name = gw_note_info-obj_name INTO gw_tadir. IF sy-subrc <> 0. DELETE lt_note_info_tmp. CONTINUE. ELSE. gw_note_info-devclass = gw_tadir-devclass. ENDIF. gw_note_info-otype = 'Include'. MODIFY lt_note_info_tmp FROM gw_note_info. ENDLOOP. ENDIF. APPEND LINES OF lt_note_info_tmp TO gt_note_info. ENDIF. append lines of gt_note_info_tmp to gt_note_info. ENDIF. ENDMETHOD. "subroutine pools METHOD includes. DATA: lt_includes TYPE TABLE OF d010inc, lw_include TYPE d010inc, lw_note_info type ty_object_info, lt_includetab type standard table of D010INC-include, lr_include type range of D010INC-INCLUDE. *------------------------------------------------------------------- * The includes on module pools and reports: IF NOT gt_note_info[] IS INITIAL. * Includes IF 1 = 1. "If TRUE: The D010INC index is regarded "reliable" clear lr_include[]. append 'ICPZ*' to lr_include. append 'ICPY*' to lr_include. SELECT * FROM d010inc INTO TABLE lt_includes FOR ALL ENTRIES IN gt_note_info WHERE master = gt_note_info-prog and include in lr_include. ELSE. loop at gt_note_info into lw_note_info. clear: lt_includetab[]. CALL FUNCTION 'GET_INCLUDETAB' EXPORTING PROGNAME = lw_note_info-prog TABLES INCLTAB = lt_includetab. loop at lt_includetab into lw_include-include. lw_include-master = lw_note_info-prog. append lw_include to lt_includes. endloop. endloop. endif. * Add to the gt_note_info pool: IF NOT lt_includes[] IS INITIAL. CLEAR: gt_note_info_tmp[]. SELECT prog subc cnam cdat unam udat FROM d010sinf INTO CORRESPONDING FIELDS OF TABLE gt_note_info_tmp FOR ALL ENTRIES IN lt_includes WHERE prog = lt_includes-include AND r3state EQ 'A' AND "Active cdat IN so_cdat AND cnam IN so_cnam AND udat IN so_udat AND unam IN so_unam AND subc = 'I'. DELETE gt_note_info_tmp WHERE cnam(3) EQ 'SAP' OR unam(3) EQ 'SAP'. DELETE gt_note_info_tmp WHERE NOT ( cnam IN so_invo AND unam IN so_invo ). if not gt_note_info_tmp[] is initial. * Update OBJ_NAME LOOP AT gt_note_info_tmp INTO gw_note_info. gw_note_info-obj_name = gw_note_info-prog. MODIFY gt_note_info_tmp FROM gw_note_info TRANSPORTING obj_name. ENDLOOP. * The TADIR entry - to determine the package / devclass SELECT obj_name devclass FROM tadir INTO TABLE gt_tadir FOR ALL ENTRIES IN gt_note_info_tmp WHERE pgmid = 'R3TR' AND object = 'PROG' AND devclass IN so_devc AND obj_name = gt_note_info_tmp-obj_name. SORT gt_tadir BY obj_name. LOOP AT gt_note_info_tmp INTO gw_note_info. gw_note_info-obj_name = gw_note_info-prog. * Determine master report (first one available will do for linecounts) READ TABLE lt_includes WITH KEY include = gw_note_info-prog INTO lw_include. gw_note_info-master = lw_include-master. * Check development class / package READ TABLE gt_tadir WITH KEY obj_name = gw_note_info-obj_name INTO gw_tadir. IF sy-subrc <> 0. DELETE gt_note_info_tmp. CONTINUE. ELSE. gw_note_info-devclass = gw_tadir-devclass. ENDIF. gw_note_info-otype = 'Include'. MODIFY gt_note_info_tmp FROM gw_note_info. ENDLOOP. endif. ENDIF. APPEND LINES OF gt_note_info_tmp TO gt_note_info. ENDIF. ENDMETHOD. "includes METHOD transactions. TYPES: BEGIN OF lty_tcode, tcode TYPE c LENGTH 40, END OF lty_tcode. DATA: lt_tstc TYPE STANDARD TABLE OF tstc, lw_tstc TYPE tstc, lt_tstct TYPE STANDARD TABLE OF tstct, lw_tstct TYPE tstct, lt_tadir TYPE STANDARD TABLE OF tadir, lw_tadir TYPE tadir, lt_tstc_tmp TYPE STANDARD TABLE OF lty_tcode. SELECT * FROM tstc INTO TABLE lt_tstc WHERE tcode IN so_trans. * Remove the transaction codes that are already assigned to a report in the overview: LOOP AT lt_tstc INTO lw_tstc. READ TABLE gt_tstc WITH KEY tcode = lw_tstc-tcode TRANSPORTING NO FIELDS. IF sy-subrc = 0. DELETE lt_tstc. ENDIF. ENDLOOP. * The remainder is listed as type Transaction: CHECK NOT lt_tstc[] IS INITIAL. CLEAR: lt_tstc_tmp[]. LOOP AT lt_tstc INTO lw_tstc. APPEND lw_tstc-tcode TO lt_tstc_tmp. ENDLOOP. SELECT * FROM tadir INTO TABLE lt_tadir FOR ALL ENTRIES IN lt_tstc_tmp WHERE pgmid = 'R3TR' AND object = 'TRAN' AND obj_name = lt_tstc_tmp-tcode. IF NOT pa_text IS INITIAL. SELECT * FROM tstct INTO TABLE lt_tstct FOR ALL ENTRIES IN lt_tstc WHERE sprsl = sy-langu AND tcode = lt_tstc-tcode. ENDIF. * Compose/add entries of the type Transaction: LOOP AT lt_tstc INTO lw_tstc. CLEAR: gw_note_info. gw_note_info-transaction = lw_tstc-tcode. gw_note_info-obj_name = lw_tstc-pgmna. gw_note_info-prog = lw_tstc-pgmna. * Check development class / package READ TABLE lt_tadir INTO lw_tadir WITH KEY obj_name = lw_tstc-tcode. IF sy-subrc <> 0. gw_note_info-devclass = lw_tadir-devclass. ENDIF. gw_note_info-cnam = lw_tadir-author. gw_note_info-otype = 'Transaction'. READ TABLE lt_tstct INTO lw_tstct WITH KEY tcode = lw_tstc-tcode. gw_note_info-text = lw_tstct-ttext. IF lw_tadir-devclass IN so_devc. APPEND gw_note_info TO gt_note_info. ENDIF. ENDLOOP. ENDMETHOD. "transactions METHOD function_groups. DATA: lt_tfdir TYPE STANDARD TABLE OF tfdir, lw_tfdir TYPE tfdir, lt_tadir_fugr TYPE TABLE OF ty_tadir, lt_object_info_tmp TYPE TABLE OF ty_object_info, lv_hlp TYPE c LENGTH 50, lv_hlp2 TYPE c LENGTH 50, lv_hlp_str TYPE string, lt_trdir TYPE STANDARD TABLE OF trdir, lw_trdir TYPE trdir, lr_name TYPE RANGE OF trdir-name, lw_name LIKE LINE OF lr_name. *------------------------------------------------------------------- * Function modules - through groups: SELECT obj_name devclass FROM tadir INTO TABLE lt_tadir_fugr WHERE pgmid = 'R3TR' AND object = 'FUGR' AND devclass IN so_devc AND obj_name IN so_farea. SORT lt_tadir_fugr BY obj_name. * A function group is a rather funny object: it potentially holds lots of Abap * logic in function modules and a top include. IF NOT lt_tadir_fugr[] IS INITIAL. CLEAR gt_note_info_tmp[]. * Prepare for selection, group becomes SAPLgroup LOOP AT lt_tadir_fugr INTO gw_tadir. CONCATENATE 'SAPL' gw_tadir-obj_name INTO gw_tadir-hlp_pname. MODIFY lt_tadir_fugr FROM gw_tadir. ENDLOOP. SELECT * FROM tfdir INTO TABLE lt_tfdir FOR ALL ENTRIES IN lt_tadir_fugr WHERE pname = lt_tadir_fugr-hlp_pname. "Indexed field ! CLEAR: gt_note_info_tmp[], lt_object_info_tmp[]. LOOP AT lt_tadir_fugr INTO gw_tadir. * Select potential includes: The TOP include: CLEAR gw_note_info. * Every function group has a top include CONCATENATE 'L' gw_tadir-obj_name 'TOP' INTO gw_note_info-prog. gw_note_info-otype = 'Function top include'. gw_note_info-devclass = gw_tadir-devclass. gw_note_info-master = gw_tadir-hlp_pname. APPEND gw_note_info TO gt_note_info_tmp. * Select the includes for the function group, which adhere's to the L{group}{F/I/O}{nn} naming convention: CLEAR: lr_name, lw_name. lw_name = 'ICP'. CONCATENATE 'L' gw_tadir-obj_name 'F++' INTO lw_name-low. APPEND lw_name TO lr_name. CONCATENATE 'L' gw_tadir-obj_name 'O++' INTO lw_name-low. APPEND lw_name TO lr_name. CONCATENATE 'L' gw_tadir-obj_name 'I++' INTO lw_name-low. APPEND lw_name TO lr_name. SELECT * FROM trdir INTO TABLE lt_trdir WHERE name IN lr_name. LOOP AT lt_trdir INTO lw_trdir. CLEAR gw_note_info. gw_note_info-prog = lw_trdir-name. gw_note_info-otype = 'Function include'. gw_note_info-devclass = gw_tadir-devclass. gw_note_info-master = gw_tadir-hlp_pname. APPEND gw_note_info TO gt_note_info_tmp. ENDLOOP. * Add an include for every function module (as each function module lives in one) LOOP AT lt_tfdir INTO lw_tfdir WHERE pname = gw_tadir-hlp_pname. CLEAR gw_note_info. CONCATENATE 'L' gw_tadir-obj_name 'U' lw_tfdir-include INTO gw_note_info-prog. gw_note_info-otype = 'Function'. gw_note_info-devclass = gw_tadir-devclass. gw_note_info-master = gw_tadir-hlp_pname. APPEND gw_note_info TO gt_note_info_tmp. ENDLOOP. ENDLOOP. IF NOT gt_note_info_tmp[] IS INITIAL. * Select through the D010SINF to gather all relevant detail SELECT prog subc cnam cdat unam udat FROM d010sinf INTO CORRESPONDING FIELDS OF TABLE lt_object_info_tmp FOR ALL ENTRIES IN gt_note_info_tmp WHERE prog = gt_note_info_tmp-prog AND r3state = 'A' AND "Active cdat IN so_cdat AND cnam IN so_cnam AND udat IN so_udat AND unam IN so_unam AND subc = 'I'. DELETE lt_object_info_tmp WHERE cnam(3) EQ 'SAP' OR unam(3) EQ 'SAP'. DELETE lt_object_info_tmp WHERE NOT ( cnam IN so_invo AND unam IN so_invo ). LOOP AT lt_object_info_tmp INTO gw_note_info. gw_note_info-obj_name = gw_note_info-prog. * Check development class / package READ TABLE gt_note_info_tmp INTO gw_note_info_tmp WITH KEY prog = gw_note_info-prog. gw_note_info-devclass = gw_note_info_tmp-devclass. gw_note_info-master = gw_note_info_tmp-master. lv_hlp_str = gw_note_info_tmp-master+4. SPLIT gw_note_info-prog AT lv_hlp_str INTO lv_hlp lv_hlp2. IF lv_hlp2(1) = 'U'. READ TABLE lt_tfdir INTO lw_tfdir WITH KEY pname = gw_note_info_tmp-master include = lv_hlp2+1(2). IF sy-subrc = 0. gw_note_info-prog = lw_tfdir-funcname. ENDIF. ENDIF. gw_note_info-otype = gw_note_info_tmp-otype. APPEND gw_note_info TO gt_note_info. ENDLOOP. ENDIF. ENDIF. ENDMETHOD. "function_modules METHOD classes. DATA: lt_method_includes_new TYPE STANDARD TABLE OF seop_method_w_include, lt_method_includes TYPE STANDARD TABLE OF seop_method_w_include, lw_method_include TYPE seop_method_w_include, lt_tadir_clas TYPE TABLE OF ty_tadir, lv_hlp TYPE c LENGTH 50, lv_hlp_str TYPE string. *------------------------------------------------------------------- * For classes - with methods (each held in an include) and sections SELECT obj_name devclass srcsystem FROM tadir INTO TABLE lt_tadir_clas WHERE pgmid = 'R3TR' AND object = 'CLAS' AND devclass IN so_devc AND obj_name IN so_clas. SORT lt_tadir_clas BY obj_name. CLEAR: gt_note_info_tmp[]. * Compose a list of method names - to replace include names later on LOOP AT lt_tadir_clas INTO gw_tadir. gv_clskey = gw_tadir-obj_name. CALL FUNCTION 'SEO_CLASS_GET_METHOD_INCLUDES' EXPORTING clskey = gv_clskey IMPORTING includes = lt_method_includes_new EXCEPTIONS OTHERS = 0. APPEND LINES OF lt_method_includes_new TO lt_method_includes. * Set the class pattern for selection later on: lv_hlp = |{ gw_tadir-obj_name }==%|. * Select through the D010SINF to gather all relevant detail SELECT prog subc cnam cdat unam udat FROM d010sinf APPENDING CORRESPONDING FIELDS OF TABLE gt_note_info_tmp WHERE prog LIKE lv_hlp AND r3state = 'A' AND "Active cdat IN so_cdat AND cnam IN so_cnam AND udat IN so_udat AND unam IN so_unam AND subc = 'I'. ENDLOOP. DELETE gt_note_info_tmp WHERE cnam(3) EQ 'SAP' OR unam(3) EQ 'SAP'. DELETE gt_note_info_tmp WHERE NOT ( cnam IN so_invo AND unam IN so_invo ). SORT lt_method_includes BY incname. IF NOT gt_note_info_tmp[] IS INITIAL. LOOP AT gt_note_info_tmp INTO gw_note_info. gw_note_info-obj_name = gw_note_info-prog. * Check development class / package SPLIT gw_note_info-prog AT '=' INTO gw_note_info-master lv_hlp_str. READ TABLE lt_tadir_clas WITH KEY obj_name = gw_note_info-master INTO gw_tadir. IF sy-subrc <> 0. CONTINUE. ELSE. gw_note_info-devclass = gw_tadir-devclass. ENDIF. * Check CLASS areas" IF gw_note_info-prog CP '++++++++++++++++++++++++++++++CO'. gw_note_info-prog = '*** SECTION'. gw_note_info-otype = 'Protected section'. ELSEIF gw_note_info-prog CP '++++++++++++++++++++++++++++++CU'. gw_note_info-prog = '*** SECTION'. gw_note_info-otype = 'Public section'. ELSEIF gw_note_info-prog CP '++++++++++++++++++++++++++++++CI'. gw_note_info-prog = '*** SECTION'. gw_note_info-otype = 'Private section'. ELSEIF gw_note_info-prog CP '++++++++++++++++++++++++++++++CCDEF' OR gw_note_info-prog CP '++++++++++++++++++++++++++++++CL'. gw_note_info-prog = '*** LOCAL CLASS DEFINITIONS'. gw_note_info-otype = 'Local definitions'. ELSEIF gw_note_info-prog CP '++++++++++++++++++++++++++++++CCMAC'. gw_note_info-prog = '*** MACRO DEFINITIONS'. gw_note_info-otype = 'Macro definitions'. ELSEIF gw_note_info-prog CP '++++++++++++++++++++++++++++++CCIMP' OR gw_note_info-prog CP '++++++++++++++++++++++++++++++CT'. gw_note_info-prog = '*** LOCAL DEFINITIONS'. gw_note_info-otype = 'Local def/impl'. ELSE. gw_note_info-otype = 'Method'. READ TABLE lt_method_includes WITH KEY incname = gw_note_info-prog INTO lw_method_include. IF sy-subrc = 0. gw_note_info-prog = lw_method_include-cpdkey-cpdname. ENDIF. ADD 1 TO gw_totals-methods. APPEND gw_note_info TO gt_note_info. ENDIF. * APPEND gw_note_info TO gt_note_info. ENDLOOP. ENDIF. ENDMETHOD. "classes METHOD determine_coding_lines. DATA: lt_abap TYPE TABLE OF string, lv_abap type string, lv_percentage TYPE f, lv_percentage_n TYPE n LENGTH 4, lv_lcl_coding_in_focus type boolean. *------------------------------------------------------------------- * Consolidation of the gathered information: LOOP AT gt_note_info INTO gw_note_info. *------------------------------------------------------------ READ REPORT gw_note_info-obj_name INTO lt_abap. *------------------------------------------------------------ IF sy-subrc EQ 0. DESCRIBE TABLE lt_abap LINES gw_note_info-linecount. * Count the comment lines in the system's coding LOOP AT lt_abap TRANSPORTING NO FIELDS WHERE table_line CP '#**'. ADD 1 TO gw_note_info-commentcount. ENDLOOP. * Count the coding lines that are used on local class definitions and local class implementations: clear: lv_lcl_coding_in_focus. LOOP AT lt_abap into lv_abap WHERE table_line NP '#**'. translate lv_abap TO UPPER CASE. * Class definition if lv_abap cp 'CLASS * DEFINITION*'. if not lv_abap cs 'DEFERRED'. ADD 1 TO gw_note_info-lcl_count. lv_lcl_coding_in_focus = abap_true. endif. * Class implementation elseif lv_abap cp 'CLASS * IMPLEMENTATION*'. lv_lcl_coding_in_focus = abap_true. * Method (end of) elseif lv_abap cs 'ENDMETHOD.'. ADD 1 TO gw_note_info-lcl_meth_count. endif. if lv_lcl_coding_in_focus = abap_true. ADD 1 TO gw_note_info-lcl_coding_count. endif. if lv_abap cs 'ENDCLASS.'. lv_lcl_coding_in_focus = abap_false. endif. ENDLOOP. lv_percentage = gw_note_info-commentcount / ( gw_note_info-linecount / 100 ). WRITE lv_percentage DECIMALS 0 EXPONENT 0 TO lv_percentage_n LEFT-JUSTIFIED. gw_note_info-commentperc = lv_percentage_n. MODIFY gt_note_info FROM gw_note_info. ADD gw_note_info-linecount TO gw_totals-linesofcoding. ADD gw_note_info-commentcount TO gw_totals-linesofcomment. ADD gw_note_info-lcl_count TO gw_totals-local_classes. ADD gw_note_info-lcl_meth_count TO gw_totals-local_methods. ADD gw_note_info-lcl_coding_count TO gw_totals-lcl_linesofcoding. CASE gw_note_info-otype. "loc: Lines Of Coding WHEN 'Report' OR 'Include' OR 'Module pool' OR 'Subroutine pool'. ADD gw_note_info-linecount TO gw_totals-loc_reports. WHEN 'Method' OR 'Macro definitions' OR 'Local definitions' OR 'Protected section' OR 'Private section' OR 'Public section' OR 'Local def/impl'. ADD gw_note_info-linecount TO gw_totals-loc_classes. WHEN 'Function top include' OR 'Function include' OR 'Function'. ADD gw_note_info-linecount TO gw_totals-loc_functions. ENDCASE. ENDIF. ENDLOOP. ENDMETHOD. "determine_coding_lines METHOD user_filter. * There several settings for the users involved, which are checked here: LOOP AT gt_note_info INTO gw_note_info. IF NOT ( so_cnam[] IS INITIAL OR so_unam[] IS INITIAL ). * Filter based on the direct fields. IF NOT ( gw_note_info-cnam IN so_cnam OR gw_note_info-unam IN so_unam ). DELETE gt_note_info. ENDIF. ELSEIF NOT so_invo[] IS INITIAL. IF NOT ( gw_note_info-cnam IN so_invo OR gw_note_info-unam IN so_invo ). DELETE gt_note_info. ENDIF. ENDIF. ENDLOOP. ENDMETHOD. "user_filter METHOD descriptions. DATA: lt_trdirt TYPE STANDARD TABLE OF trdirt, lw_trdirt TYPE trdirt, lt_tftit TYPE STANDARD TABLE OF tftit, lw_tftit TYPE tftit. SELECT * FROM trdirt INTO TABLE lt_trdirt FOR ALL ENTRIES IN gt_note_info WHERE name = gt_note_info-prog. SELECT * FROM tftit INTO TABLE lt_tftit FOR ALL ENTRIES IN gt_note_info WHERE funcname = gt_note_info-prog(30). LOOP AT gt_note_info INTO gw_note_info. IF gw_note_info-otype = 'Function'. READ TABLE lt_tftit WITH KEY funcname = gw_note_info-prog spras = sy-langu INTO lw_tftit. IF sy-subrc <> 0 AND sy-langu <> 'E'. READ TABLE lt_tftit WITH KEY funcname = gw_note_info-prog spras = 'E' INTO lw_tftit. ENDIF. IF sy-subrc <> 0. READ TABLE lt_tftit WITH KEY funcname = gw_note_info-prog INTO lw_tftit. ENDIF. IF sy-subrc = 0. gw_note_info-text = lw_tftit-stext. ENDIF. ELSE. READ TABLE lt_trdirt WITH KEY name = gw_note_info-prog sprsl = sy-langu INTO lw_trdirt. IF sy-subrc <> 0 AND sy-langu <> 'E'. READ TABLE lt_trdirt WITH KEY name = gw_note_info-prog sprsl = 'E' INTO lw_trdirt. ENDIF. IF sy-subrc <> 0. READ TABLE lt_trdirt WITH KEY name = gw_note_info-prog INTO lw_trdirt. ENDIF. IF sy-subrc = 0. gw_note_info-text = lw_trdirt-text. ENDIF. ENDIF. MODIFY gt_note_info FROM gw_note_info TRANSPORTING text. ENDLOOP. ENDMETHOD. "descriptions METHOD notes. DATA: lw_colored_field TYPE lvc_s_scol, lt_srtfd TYPE STANDARD TABLE OF hlpindx-srtfd, lv_srtfd TYPE hlpindx-srtfd. SELECT srtfd FROM hlpindx INTO TABLE lt_srtfd WHERE relid = gv_area. LOOP AT gt_note_info INTO gw_note_info. READ TABLE lt_srtfd WITH KEY table_line = gw_note_info-obj_name TRANSPORTING NO FIELDS. IF sy-subrc = 0. * Read the note information and fill noteID, noteTXT and noteTXT2, add to or update HLPINDX storage CASE gv_area. WHEN 'ZX'. IMPORT noteid = gw_note_info-noteid notetxt = gw_note_info-notetxt notetxt2 = gw_note_info-notetxt2 notecreated = gw_note_info-notecreated notecreator = gw_note_info-notecreator notechanged = gw_note_info-notechanged notechanger = gw_note_info-notechanger FROM DATABASE hlpindx(zx) ID gw_note_info-obj_name. WHEN 'ZY'. IMPORT noteid = gw_note_info-noteid notetxt = gw_note_info-notetxt notetxt2 = gw_note_info-notetxt2 notecreated = gw_note_info-notecreated notecreator = gw_note_info-notecreator notechanged = gw_note_info-notechanged notechanger = gw_note_info-notechanger FROM DATABASE hlpindx(zy) ID gw_note_info-obj_name. WHEN 'ZZ'. IMPORT noteid = gw_note_info-noteid notetxt = gw_note_info-notetxt notetxt2 = gw_note_info-notetxt2 notecreated = gw_note_info-notecreated notecreator = gw_note_info-notecreator notechanged = gw_note_info-notechanged notechanger = gw_note_info-notechanger FROM DATABASE hlpindx(zz) ID gw_note_info-obj_name. WHEN 'Z1'. IMPORT noteid = gw_note_info-noteid notetxt = gw_note_info-notetxt notetxt2 = gw_note_info-notetxt2 notecreated = gw_note_info-notecreated notecreator = gw_note_info-notecreator notechanged = gw_note_info-notechanged notechanger = gw_note_info-notechanger FROM DATABASE hlpindx(z1) ID gw_note_info-obj_name. WHEN 'Z2'. IMPORT noteid = gw_note_info-noteid notetxt = gw_note_info-notetxt notetxt2 = gw_note_info-notetxt2 notecreated = gw_note_info-notecreated notecreator = gw_note_info-notecreator notechanged = gw_note_info-notechanged notechanger = gw_note_info-notechanger FROM DATABASE hlpindx(z2) ID gw_note_info-obj_name. WHEN 'Z3'. IMPORT noteid = gw_note_info-noteid notetxt = gw_note_info-notetxt notetxt2 = gw_note_info-notetxt2 notecreated = gw_note_info-notecreated notecreator = gw_note_info-notecreator notechanged = gw_note_info-notechanged notechanger = gw_note_info-notechanger FROM DATABASE hlpindx(z3) ID gw_note_info-obj_name. ENDCASE. ENDIF. lw_colored_field-fname = 'NOTEID'. lw_colored_field-color-col = 7. lw_colored_field-color-int = 0. lw_colored_field-color-inv = 0. APPEND lw_colored_field TO gw_note_info-colors. lw_colored_field-fname = 'NOTETXT'. APPEND lw_colored_field TO gw_note_info-colors. lw_colored_field-fname = 'NOTETXT2'. APPEND lw_colored_field TO gw_note_info-colors. lw_colored_field-fname = 'NOTECREATED'. APPEND lw_colored_field TO gw_note_info-colors. lw_colored_field-fname = 'NOTECREATOR'. APPEND lw_colored_field TO gw_note_info-colors. lw_colored_field-fname = 'NOTECHANGED'. APPEND lw_colored_field TO gw_note_info-colors. lw_colored_field-fname = 'NOTECHANGED'. APPEND lw_colored_field TO gw_note_info-colors. MODIFY gt_note_info FROM gw_note_info. IF gw_note_info-noteid NOT IN so_notid OR gw_note_info-notecreated NOT IN so_notcd OR gw_note_info-notecreator NOT IN so_notcr OR gw_note_info-notechanged NOT IN so_notc2 OR gw_note_info-notechanger NOT IN so_notch. DELETE gt_note_info. ELSEIF gw_note_info-notecreated NOT IN so_notin AND gw_note_info-notechanged NOT IN so_notin. DELETE gt_note_info. ENDIF. ENDLOOP. ENDMETHOD. "notes METHOD calculate_totals. TYPES: BEGIN OF ty_puppet, uname TYPE sy-uname, END OF ty_puppet. DATA: lt_devclass TYPE STANDARD TABLE OF tadir-devclass, lt_puppets TYPE STANDARD TABLE OF ty_puppet, lw_puppet TYPE ty_puppet, lt_classes TYPE STANDARD TABLE OF d010inc-master, lt_function_groups TYPE STANDARD TABLE OF d010inc-master, lt_bname TYPE STANDARD TABLE OF usr01-bname, lw_colored_field TYPE lvc_s_scol. *--------------------- Calculation of totals -------------------- CLEAR: lt_puppets[], lt_devclass[], lt_classes[], lt_function_groups[]. LOOP AT gt_note_info INTO gw_note_info. lw_puppet-uname = gw_note_info-cnam. APPEND lw_puppet TO lt_puppets. lw_puppet-uname = gw_note_info-unam. APPEND lw_puppet TO lt_puppets. APPEND gw_note_info-devclass TO lt_devclass. IF NOT gw_note_info-transaction IS INITIAL. ADD 1 TO gw_totals-transactions. ENDIF. CASE gw_note_info-otype . WHEN 'Report'. ADD 1 TO gw_totals-reports. WHEN 'Module pool'. ADD 1 TO gw_totals-modulepools. WHEN 'Subroutine pool'. ADD 1 TO gw_totals-subroutinepools. WHEN 'Include'. ADD 1 TO gw_totals-includes. WHEN 'Method'. APPEND gw_note_info-master TO lt_classes. ADD 1 TO gw_totals-methods. WHEN 'Function'. APPEND gw_note_info-master TO lt_function_groups. ADD 1 TO gw_totals-functions. WHEN 'Function top include' OR 'Function include'. APPEND gw_note_info-master TO lt_function_groups. ADD 1 TO gw_totals-includes_function. ENDCASE. * Set a few predefined defaults: gw_note_info-noteicon = '@0J@'. gw_note_info-one = 1. * Determine whether the logic is regarded "external copy": if gw_note_info-cnam = gw_note_info-unam and gw_note_info-cdat = gw_note_info-udat and gw_note_info-linecount > 500. gw_note_info-rome = abap_true. endif. MODIFY gt_note_info FROM gw_note_info TRANSPORTING noteicon one rome. ENDLOOP. SORT lt_puppets. DELETE ADJACENT DUPLICATES FROM lt_puppets. * Now determine whether the users still exist on the system: IF NOT lt_puppets[] IS INITIAL. SELECT bname FROM usr01 INTO TABLE lt_bname FOR ALL ENTRIES IN lt_puppets WHERE bname = lt_puppets-uname. * Active people involved get a color: lw_colored_field-color-col = 5. lw_colored_field-color-int = 0. lw_colored_field-color-inv = 0. LOOP AT gt_note_info INTO gw_note_info. READ TABLE lt_bname WITH KEY table_line = gw_note_info-cnam TRANSPORTING NO FIELDS. IF sy-subrc = 0. lw_colored_field-fname = 'CNAM'. APPEND lw_colored_field TO gw_note_info-colors. ENDIF. READ TABLE lt_bname WITH KEY table_line = gw_note_info-unam TRANSPORTING NO FIELDS. IF sy-subrc = 0. lw_colored_field-fname = 'UNAM'. APPEND lw_colored_field TO gw_note_info-colors. ENDIF. MODIFY gt_note_info FROM gw_note_info. ENDLOOP. ENDIF. DESCRIBE TABLE lt_puppets LINES gw_totals-puppets. DESCRIBE TABLE lt_bname LINES gw_totals-active_puppets. SORT lt_devclass. DELETE ADJACENT DUPLICATES FROM lt_devclass. DESCRIBE TABLE lt_devclass LINES gw_totals-devclasses. SORT lt_classes. DELETE ADJACENT DUPLICATES FROM lt_classes. DESCRIBE TABLE lt_classes LINES gw_totals-classes. SORT lt_function_groups. DELETE ADJACENT DUPLICATES FROM lt_function_groups. DESCRIBE TABLE lt_function_groups LINES gw_totals-fungroups. ENDMETHOD. "calculate_totals METHOD alv_report. DATA: lv_percentage TYPE f, lv_column TYPE i, lv_text TYPE scrtext_s, lv_text_m TYPE scrtext_m, lv_text_l TYPE scrtext_l, lw_layout_key TYPE salv_s_layout_key. DEFINE set_text_field. rf_column ?= rf_columns_table->get_column( &1 ). lv_text = &2. lv_text_m = &2. lv_text_l = &2. rf_column->set_short_text( lv_text ). rf_column->set_medium_text( lv_text_m ). rf_column->set_long_text( lv_text_l ). END-OF-DEFINITION. DEFINE set_hidden_field. set_text_field &1 &2. rf_column->set_visible( abap_false ). END-OF-DEFINITION. TRY. cl_salv_table=>factory( IMPORTING r_salv_table = go_alv CHANGING t_table = gt_note_info ). rf_functions_list = go_alv->get_functions( ). rf_functions_list->set_all( ). rf_columns_table = go_alv->get_columns( ). rf_columns_table->set_color_column( value = 'COLORS' ). rf_columns_table->set_optimize( abap_true ). "Always a good idea set_hidden_field: 'OBJ_NAME' 'Original source', 'SUBC' 'Type'. set_text_field: 'MASTER' 'Main program/class', 'PROG' 'Report/include/function/method'. rf_column_table ?= rf_columns_table->get_column( 'PROG' ). rf_column_table->set_cell_type( if_salv_c_cell_type=>hotspot ). set_text_field: 'OTYPE' 'Type', 'CNAM' 'Created by'. rf_column_table ?= rf_columns_table->get_column( 'CNAM' ). rf_column_table->set_cell_type( if_salv_c_cell_type=>hotspot ). set_text_field: 'CDAT' 'Created on', 'UNAM' 'Changed by'. rf_column_table ?= rf_columns_table->get_column( 'UNAM' ). rf_column_table->set_cell_type( if_salv_c_cell_type=>hotspot ). set_text_field: 'UDAT' 'Changed on', 'TRANSACTION' 'Transaction', 'DEVCLASS' 'Development class', 'OTYPE' 'Type', 'LINECOUNT' '# of lines', 'LCL_COUNT' 'Local classes', 'LCL_CODING_COUNT' '# of class lines', 'LCL_METH_COUNT' 'Local methods'. set_hidden_field: 'COMMENTPERC' 'Comment %', 'ONE' 'Value=1', 'COMMENTCOUNT' '# of commentlines'. set_text_field: 'TEXT' 'Description'. IF pa_text IS INITIAL. rf_column->set_visible( abap_false ). "Hide this field ENDIF. set_text_field: 'NOTEICON' '____'. rf_column_table ?= rf_columns_table->get_column( 'NOTEICON' ). rf_column_table->set_cell_type( if_salv_c_cell_type=>hotspot ). IF pa_notes IS INITIAL. rf_column->set_visible( abap_false ). "Hide this field ENDIF. IF NOT pa_notes IS INITIAL. set_text_field: 'NOTEID' 'Note ID', 'NOTETXT' 'Note'. ELSE. set_hidden_field: 'NOTEID' 'Note ID', 'NOTETXT' 'Note'. ENDIF. set_hidden_field: 'NOTETXT2' 'More', 'NOTECREATED' 'Note created on', 'NOTECREATOR' 'Note created by', 'NOTECHANGED' 'Note changed on', 'NOTECHANGER' 'Note changed by', 'ROME' 'External copy'. rf_column_table ?= rf_columns_table->get_column( 'ROME' ). rf_column_table->set_cell_type( if_salv_c_cell_type=>checkbox ). *------------- Totals information block CREATE OBJECT rf_alv_footer. * set_totals_field DEFINE set_totals_field. lv_column = &2. rf_text = rf_alv_footer->create_text( text = &3 row = &1 column = lv_column ). rf_layout_data ?= rf_text->get_layout_data( ). rf_layout_data->set_h_align( if_salv_form_c_h_align=>right ). add 1 to lv_column. rf_text = rf_alv_footer->create_text( text = &4 row = &1 column = lv_column ). END-OF-DEFINITION. lv_percentage = gw_totals-linesofcomment / ( gw_totals-linesofcoding / 100 ). WRITE lv_percentage TO gw_totals-prc_comments DECIMALS 0 EXPONENT 0 LEFT-JUSTIFIED. CONCATENATE '| Lines of comments (' gw_totals-prc_comments '%)' INTO gw_totals-prc_comments. lv_percentage = gw_totals-loc_reports / ( gw_totals-linesofcoding / 100 ). WRITE lv_percentage TO gw_totals-prc_reports DECIMALS 0 EXPONENT 0 LEFT-JUSTIFIED. CONCATENATE '| Lines (' gw_totals-prc_reports '%)' INTO gw_totals-prc_reports. lv_percentage = gw_totals-loc_functions / ( gw_totals-linesofcoding / 100 ). if gw_totals-transactions_all > 0. WRITE gw_totals-transactions_all TO gw_totals-txt_transactions LEFT-JUSTIFIED. CONCATENATE '| .. with transact. -' gw_totals-txt_transactions ' total' INTO gw_totals-txt_transactions SEPARATED BY space. else. gw_totals-txt_transactions = |.. with transaction { gw_totals-txt_transactions }|. endif. WRITE lv_percentage TO gw_totals-prc_functions DECIMALS 0 EXPONENT 0 LEFT-JUSTIFIED. CONCATENATE '| Lines (' gw_totals-prc_functions '%)' INTO gw_totals-prc_functions. lv_percentage = gw_totals-loc_classes / ( gw_totals-linesofcoding / 100 ). WRITE lv_percentage TO gw_totals-prc_classes DECIMALS 0 EXPONENT 0 LEFT-JUSTIFIED. CONCATENATE '| Lines (' gw_totals-prc_classes '%)' INTO gw_totals-prc_classes. WRITE gw_totals-active_puppets TO gw_totals-prc_puppets DECIMALS 0 EXPONENT 0 LEFT-JUSTIFIED. CONCATENATE '| Users involved (' gw_totals-prc_puppets ' existing)' INTO gw_totals-prc_puppets. set_totals_field: "line, First columnquantity, field label 1 1 '______' 'SUMMARY', 2 1 gw_totals-puppets gw_totals-prc_puppets, 3 1 gw_totals-devclasses '| Packages', 5 1 '______' 'TOTAL', 6 1 gw_totals-linesofcoding '| Lines of ABAP coding', 7 1 gw_totals-linesofcomment gw_totals-prc_comments. IF pa_prog = abap_false AND pa_trans = abap_true. set_totals_field: 1 3 '______' 'TRANSACTIONS', 2 3 gw_totals-transactions '| Transactions'. ELSEIF pa_prog = abap_true. set_totals_field: 1 3 '______' 'REPORTS and MODULE POOLS', 2 3 gw_totals-reports '| Reports', 3 3 gw_totals-transactions gw_totals-txt_transactions, "'| ... with transaction', 4 3 gw_totals-modulepools '| Module pools', 5 3 gw_totals-subroutinepools '| Subroutine pools', 6 3 gw_totals-includes '| Includes', 7 3 gw_totals-loc_reports gw_totals-prc_reports. ENDIF. IF pa_farea = abap_true. set_totals_field: 1 5 '______' 'FUNCTIONS', 2 5 gw_totals-fungroups '| Function groups', 3 5 gw_totals-functions '| Functions', 4 5 gw_totals-includes_function '| Includes', 7 5 gw_totals-loc_functions gw_totals-prc_functions. ENDIF. IF pa_clas = abap_true. set_totals_field: 1 7 '______' 'CLASSES', 2 7 gw_totals-classes '| Classes', 3 7 gw_totals-methods '| Methods', * 4 7 gw_totals-sections '| Sections', 7 7 gw_totals-loc_classes gw_totals-prc_classes. ENDIF. if not gw_totals-local_classes is initial. set_totals_field: 1 9 '______' 'LOCAL CLASSES', 2 9 gw_totals-local_classes '| Classes', 3 9 gw_totals-local_methods '| Methods', 4 9 gw_totals-lcl_linesofcoding '| Lines of ABAP coding'. endif. go_alv->set_end_of_list( rf_alv_footer ). go_alv->set_end_of_list_print( rf_alv_footer ). rf_selections = go_alv->get_selections( ). rf_selections->set_selection_mode( 2 ). rf_layout = go_alv->get_layout( ). lw_layout_key-report = sy-cprog. lw_layout_key-logical_group = '1271'. rf_layout->set_key( lw_layout_key ). rf_layout->set_default( abap_true ). rf_layout->set_save_restriction( if_salv_c_layout=>restrict_none ). CREATE OBJECT go_event_man EXPORTING r_object = go_alv. go_alv->display( ). CATCH: cx_salv_msg, cx_salv_not_found. MESSAGE 'Error generating ALV report' TYPE 'E'. ENDTRY. ENDMETHOD. "alv_report ENDCLASS. "lcl_inventory IMPLEMENTATION class lcl_loader implementation. method set_listbox. DATA: lt_list TYPE vrm_values, lw_list LIKE LINE OF lt_list. lw_list-key = 'Z1'. lw_list-text = 'Z1: area 1'. APPEND lw_list TO lt_list. lw_list-key = 'Z2'. lw_list-text = 'Z2: area 2'. APPEND lw_list TO lt_list. lw_list-key = 'Z3'. lw_list-text = 'Z3: area 3'. APPEND lw_list TO lt_list. lw_list-key = 'ZX'. lw_list-text = 'ZX: default area'. APPEND lw_list TO lt_list. lw_list-key = 'ZY'. lw_list-text = 'ZY: secondary area'. APPEND lw_list TO lt_list. lw_list-key = 'ZZ'. lw_list-text = 'ZZ: secure area'. APPEND lw_list TO lt_list. CALL FUNCTION 'VRM_SET_VALUES' EXPORTING id = fieldname values = lt_list. endmethod. method f4_presentation_file. data: lv_title type c length 60, lv_filepath type c length 120, lt_files type standard table of sdokpath, lw_file type sdokpath. lv_title = title. lv_filepath = filepath. CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG' EXPORTING window_title = lv_title default_filename = lv_filepath TABLES file_table = lt_files EXCEPTIONS others = 4. if sy-subrc <> 0. message 'Front end file open error' type 'E'. else. read table lt_files index 1 into lw_file. filepath = lw_file-pathname. endif. endmethod. method selection. data: lw_object_info TYPE ty_object_info, lt_hlpindx_SRTFD type standard table of hlpindx-SRTFD, lv_hlpindx_SRTFD type hlpindx-SRTFD. clear: gt_Object_info[], lt_hlpindx_SRTFD[]. SELECT SRTFD FROM hlpindx INTO TABLE lt_hlpindx_SRTFD where relid = area. if sy-subrc <> 0. message 'No note settings found' type 'S'. exit. endif. loop at lt_hlpindx_SRTFD into lv_hlpindx_SRTFD. clear: lw_object_info. lw_object_info-obj_name = lv_hlpindx_SRTFD. case area. when 'ZX'. IMPORT noteid = lw_object_info-noteid notetxt = lw_object_info-notetxt notetxt2 = lw_object_info-notetxt2 notecreated = lw_object_info-notecreated notecreator = lw_object_info-notecreator notechanged = lw_object_info-notechanged notechanger = lw_object_info-notechanger FROM DATABASE hlpindx(zx) ID lw_object_info-obj_name. when 'ZY'. IMPORT noteid = lw_object_info-noteid notetxt = lw_object_info-notetxt notetxt2 = lw_object_info-notetxt2 notecreated = lw_object_info-notecreated notecreator = lw_object_info-notecreator notechanged = lw_object_info-notechanged notechanger = lw_object_info-notechanger FROM DATABASE hlpindx(zy) ID lw_object_info-obj_name. when 'ZZ'. IMPORT noteid = lw_object_info-noteid notetxt = lw_object_info-notetxt notetxt2 = lw_object_info-notetxt2 notecreated = lw_object_info-notecreated notecreator = lw_object_info-notecreator notechanged = lw_object_info-notechanged notechanger = lw_object_info-notechanger FROM DATABASE hlpindx(zz) ID lw_object_info-obj_name. when 'Z1'. IMPORT noteid = lw_object_info-noteid notetxt = lw_object_info-notetxt notetxt2 = lw_object_info-notetxt2 notecreated = lw_object_info-notecreated notecreator = lw_object_info-notecreator notechanged = lw_object_info-notechanged notechanger = lw_object_info-notechanger FROM DATABASE hlpindx(z1) ID lw_object_info-obj_name. when 'Z2'. IMPORT noteid = lw_object_info-noteid notetxt = lw_object_info-notetxt notetxt2 = lw_object_info-notetxt2 notecreated = lw_object_info-notecreated notecreator = lw_object_info-notecreator notechanged = lw_object_info-notechanged notechanger = lw_object_info-notechanger FROM DATABASE hlpindx(z2) ID lw_object_info-obj_name. when 'Z3'. IMPORT noteid = lw_object_info-noteid notetxt = lw_object_info-notetxt notetxt2 = lw_object_info-notetxt2 notecreated = lw_object_info-notecreated notecreator = lw_object_info-notecreator notechanged = lw_object_info-notechanged notechanger = lw_object_info-notechanger FROM DATABASE hlpindx(z3) ID lw_object_info-obj_name. endcase. if sy-subrc = 0. append lw_object_info to gt_object_info. endif. endloop. endmethod. "selection method save_file. data: lw_object_info TYPE ty_object_info, lt_table_content TYPE STANDARD TABLE OF string, lv_table_line type string, lv_answer type c length 1. if filename is initial. message 'Filename missing' type 'S'. exit. endif. if CL_GUI_FRONTEND_SERVICES=>FILE_EXIST( filename ) = abap_true. CALL FUNCTION 'POPUP_TO_CONFIRM' EXPORTING TEXT_QUESTION = 'File exists. Overwrite ?' DISPLAY_CANCEL_BUTTON = abap_false IMPORTING ANSWER = lv_answer. if lv_answer = '2'. message 'Mission aborted...' type 'S'. exit. endif. endif. clear: lt_table_content[]. loop at gt_object_info into lw_object_info. concatenate lw_object_info-obj_name lw_object_info-noteid lw_object_info-notetxt lw_object_info-notetxt2 lw_object_info-notecreated lw_object_info-notecreator lw_object_info-notechanged lw_object_info-notechanger into lv_table_line SEPARATED BY ';'. append lv_table_line to lt_table_content. endloop. CALL FUNCTION 'GUI_DOWNLOAD' EXPORTING FILENAME = filename TABLES DATA_TAB = lt_table_content EXCEPTIONS OTHERS = 4. IF SY-SUBRC <> 0. MESSAGE ID sy-msgid TYPE 'W' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE. message 'File saved' type 'S'. ENDIF. endmethod. method read_file. data: lw_object_info TYPE ty_object_info, lt_table_content TYPE STANDARD TABLE OF string, lv_table_line type string. if filename is initial. message 'Filename missing' type 'S'. exit. endif. CALL FUNCTION 'GUI_UPLOAD' EXPORTING FILENAME = filename TABLES DATA_TAB = lt_table_content EXCEPTIONS OTHERS = 4. IF SY-SUBRC <> 0. MESSAGE ID sy-msgid TYPE 'W' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. ELSE. message 'File read' type 'S'. ENDIF. clear gt_object_info[]. loop at lt_table_content into lv_table_line. split lv_table_line at ';' into lw_object_info-obj_name lw_object_info-noteid lw_object_info-notetxt lw_object_info-notetxt2 lw_object_info-notecreated lw_object_info-notecreator lw_object_info-notechanged lw_object_info-notechanger. if not lw_object_info-notechanger is initial. append lw_object_info to gt_object_info. endif. endloop. endmethod. method set_selection. data: lw_object_info TYPE ty_object_info, lt_hlpindx_SRTFD type standard table of hlpindx-SRTFD, lv_hlpindx_SRTFD type hlpindx-SRTFD, lv_answer type c length 1. clear: lt_hlpindx_SRTFD[]. SELECT SRTFD FROM hlpindx INTO TABLE lt_hlpindx_SRTFD where relid = area. if sy-subrc = 0. CALL FUNCTION 'POPUP_TO_CONFIRM' EXPORTING TEXT_QUESTION = 'Remove existing entries ?' IMPORTING ANSWER = lv_answer. if lv_answer = 'A'. message 'Mission aborted...' type 'S'. exit. endif. if lv_answer = '1'. * Remove entries from database: *----------------------------------------------------------- DELETE FROM hlpindx WHERE relid = area. COMMIT WORK AND WAIT. *----------------------------------------------------------- endif. endif. loop at gt_Object_info into lw_object_info. case area. when 'ZX'. EXPORT noteid = lw_object_info-noteid notetxt = lw_object_info-notetxt notetxt2 = lw_object_info-notetxt2 notecreated = lw_object_info-notecreated notecreator = lw_object_info-notecreator notechanged = lw_object_info-notechanged notechanger = lw_object_info-notechanger TO DATABASE hlpindx(zx) ID lw_object_info-obj_name. when 'ZY'. EXPORT noteid = lw_object_info-noteid notetxt = lw_object_info-notetxt notetxt2 = lw_object_info-notetxt2 notecreated = lw_object_info-notecreated notecreator = lw_object_info-notecreator notechanged = lw_object_info-notechanged notechanger = lw_object_info-notechanger TO DATABASE hlpindx(zy) ID lw_object_info-obj_name. when 'ZZ'. EXPORT noteid = lw_object_info-noteid notetxt = lw_object_info-notetxt notetxt2 = lw_object_info-notetxt2 notecreated = lw_object_info-notecreated notecreator = lw_object_info-notecreator notechanged = lw_object_info-notechanged notechanger = lw_object_info-notechanger TO DATABASE hlpindx(zz) ID lw_object_info-obj_name. when 'Z1'. EXPORT noteid = lw_object_info-noteid notetxt = lw_object_info-notetxt notetxt2 = lw_object_info-notetxt2 notecreated = lw_object_info-notecreated notecreator = lw_object_info-notecreator notechanged = lw_object_info-notechanged notechanger = lw_object_info-notechanger TO DATABASE hlpindx(z1) ID lw_object_info-obj_name. when 'Z2'. EXPORT noteid = lw_object_info-noteid notetxt = lw_object_info-notetxt notetxt2 = lw_object_info-notetxt2 notecreated = lw_object_info-notecreated notecreator = lw_object_info-notecreator notechanged = lw_object_info-notechanged notechanger = lw_object_info-notechanger TO DATABASE hlpindx(z2) ID lw_object_info-obj_name. when 'Z3'. EXPORT noteid = lw_object_info-noteid notetxt = lw_object_info-notetxt notetxt2 = lw_object_info-notetxt2 notecreated = lw_object_info-notecreated notecreator = lw_object_info-notecreator notechanged = lw_object_info-notechanged notechanger = lw_object_info-notechanger TO DATABASE hlpindx(z3) ID lw_object_info-obj_name. endcase. endloop. if sy-subrc = 0. message 'Notes info stored' type 'S'. endif. endmethod. "selection endclass. * ___ _____ _ ___ _____ ___ ___ ___ ___ _ ___ ___ _____ ___ ___ _ _ * / __|_ _/_\ | _ \_ _|__ / _ \| __|__/ __| __| | | __/ __|_ _|_ _/ _ \| \| | * \__ \ | |/ _ \| / | ||___| (_) | _|___\__ \ _|| |__| _| (__ | | | | (_) | .` | * |___/ |_/_/ \_\_|_\ |_| \___/|_| |___/___|____|___\___| |_| |___\___/|_|\_| * START-OF-SELECTION. * Produce a report with information of reports, includes, classes, function modules, * anything that can hold ABAP coding if pa_down = abap_true. lcl_loader=>selection( pa_darea ). if not lcl_loader=>gt_object_info[] is initial. lcl_loader=>save_file( pa_dfile ). endif. endif. if pa_up = abap_true. lcl_loader=>read_file( pa_ufile ). if not lcl_loader=>gt_object_info[] is initial. lcl_loader=>set_selection( pa_uarea ). endif. endif. if pa_down = abap_false and pa_up = abap_false. lcl_inventory=>initialize( ). lcl_inventory=>gv_area = pa_area. IF pa_prog = abap_true. CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING text = 'Reports and module pools...'. lcl_inventory=>reports_and_modulepools( ). CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING text = 'Reports and module pools... includes ...'. lcl_inventory=>includes( ). CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING text = 'Subroutine pools ... includes ...'. lcl_inventory=>subroutinepools( ). ENDIF. IF pa_trans = abap_true. CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING text = 'Transactions ...'. SELECT COUNT(*) FROM tstc INTO lcl_inventory=>gw_totals-transactions_all WHERE tcode IN so_trans. lcl_inventory=>transactions( ). ENDIF. IF pa_farea = abap_true. CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING text = 'Function groups ...'. lcl_inventory=>function_groups( ). ENDIF. IF pa_clas = abap_true. CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING text = 'Classes ...'. lcl_inventory=>classes( ). ENDIF. IF NOT lcl_inventory=>gt_note_info[] IS INITIAL. IF NOT pa_text IS INITIAL. CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING text = 'Descriptions...'. lcl_inventory=>descriptions( ). ENDIF. IF NOT pa_notes IS INITIAL. CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING text = 'Notes...'. lcl_inventory=>notes( ). ENDIF. lcl_inventory=>user_filter( ). CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING text = 'Determine number of (Abap) coding lines ...'. lcl_inventory=>determine_coding_lines( ). lcl_inventory=>calculate_totals( ). ENDIF. ENDIF. * ___ _ _ ___ ___ ___ ___ ___ _ ___ ___ _____ ___ ___ _ _ * | __| \| | \ ___ / _ \| __|__/ __| __| | | __/ __|_ _|_ _/ _ \| \| | * | _|| .` | |) |___| (_) | _|___\__ \ _|| |__| _| (__ | | | | (_) | .` | * |___|_|\_|___/ \___/|_| |___/___|____|___\___| |_| |___\___/|_|\_| END-OF-SELECTION. if pa_down = abap_false and pa_up = abap_false. IF NOT lcl_inventory=>gt_note_info[] IS INITIAL. CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR' EXPORTING text = 'Finished !'. lcl_inventory=>alv_report( ). ELSE. MESSAGE 'Absolutely nothing was selected... ' TYPE 'S'. ENDIF. endif.