Execute report, enter the date and user to query,
The tool will list all the Tcode and report lists that were used by the user in the month in which the input date was entered, according to the number of uses:
Report Zusertcode.
Parameter:month TYPE dats DEFAULT sy-datum obligatory,
User type Usr02-bname obligatory DEFAULT sy-uname.
Types:begin of Zusertcode,
Operation Type Char30,
Type type CHAR10,
Count TYPE swncshcnt,
END of Zusertcode.
Types:tt_zusertcode type standard TABLE of Zusertcode with KEY operation type.
Data:lt_usertcode TYPE Swnc_t_aggusertcode,
Wa_usertcode TYPE Swncaggusertcode,
WA TYPE Zusertcode,
T_ut TYPE Tt_zusertcode,
Ls_result TYPE Zusertcode,
Lt_result TYPE Tt_zusertcode.
Constants:cv_tcode TYPE char30 VALUE ' Tcode ',
Cv_report TYPE char30 VALUE ' report ',
Cv_count TYPE char5 value ' count '.
Start-of-selection.
* Set date to the first day of the month
"Month+6 (2) = ' 01 '.
Call FUNCTION ' Swnc_collector_get_aggregates '
Exporting
Component = ' Total '
Periodtype = ' M '
PERIODSTRT = Month
TABLES
Usertcode = Lt_usertcode
EXCEPTIONS
No_data_found = 1
OTHERS = 2.
DELETE lt_usertcode WHERE tasktype <> ' 01 '.
LOOP at Lt_usertcode assigning Field-symbol (<user>) WHERE account = user.
Clear:ls_result.
Ls_result-operation = <user>-entry_id.
Ls_result-type = <user>-entry_id+72.
Ls_result-count = <user>-count.
COLLECT Ls_result into Lt_result.
Endloop.
SORT Lt_result by Count descending.
Write:10 Cv_tcode, Cv_report, Cv_count COLOR col_negative.
LOOP at Lt_result assigning Field-symbol (<result>).
IF <result>-type = ' T '.
WRITE:/<result>-operation COLOR col_total under Cv_tcode,
<result>-count COLOR col_positive under Cv_count.
ELSE.
WRITE:/<result>-operation COLOR col_group under Cv_report,
<result>-count COLOR col_positive under Cv_count.
ENDIF.
Endloop.
Tools for monthly statistics on Tcode and report usage times