使用ABAP代码打印出某个用户某个时间段内使用过哪些SAP事务码
发布日期:2021-06-30 14:06:29
浏览次数:2
分类:技术文章
本文共 1890 字,大约阅读时间需要 6 分钟。
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() WHERE account = user. CLEAR: ls_result. ls_result-operation = -entry_id. ls_result-type = -entry_id+72. ls_result-count = -count. COLLECT ls_result INTO lt_result. ENDLOOP. SORT lt_result BY count DESCENDING. WRITE: 10 cv_tcode, 20 cv_report, 60 cv_count COLOR COL_NEGATIVE. LOOP AT lt_result ASSIGNING FIELD-SYMBOL( ). IF -type = 'T'. WRITE: / -operation COLOR COL_TOTAL UNDER cv_tcode, -count COLOR COL_POSITIVE UNDER cv_count. ELSE. WRITE: / -operation COLOR COL_GROUP UNDER cv_report, -count COLOR COL_POSITIVE UNDER cv_count. ENDIF. ENDLOOP.
要获取更多Jerry的原创文章,请关注公众号"汪子熙":
转载地址:https://jerry.blog.csdn.net/article/details/104031484 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
感谢大佬
[***.8.128.20]2024年04月11日 10时14分12秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
vSphere5安装配置视频教程
2019-05-01
《Linux企业应用案例精解》一书已由清华大学出版社出版
2019-05-01
安装配置FreeBSD9全过程体验
2019-05-01
全球开源软件发展趋势分析
2019-05-01
Linux系统安全加固(一)
2019-05-01
Linux常用的安全工具
2019-05-01
Linux下网络服务的安全设置
2019-05-01
一款非常实用的在线代码分享站点
2019-05-01
教你一分钟制作自己的电子书(视频)
2019-05-01
完成《Java编程入门》初稿
2019-05-01
MacOSX和Windows 8的完美融合
2019-05-01
Iphone5S 体验(视频+截图)
2019-05-01
python 多进程之进程池的操作
2019-05-01
flask整理之 flask程序中的debug模式
2019-05-01
如何和大妈解释区块链,让他们理解区块链
2019-05-01
比特币,父母这一辈能接受吗?
2019-05-01
解释区块链钱包的意思
2019-05-01
让老百姓知道什么是比特币,只需要10分钟
2019-05-01