惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Spread Privacy
Spread Privacy
P
Palo Alto Networks Blog
P
Proofpoint News Feed
AI
AI
Help Net Security
Help Net Security
S
Securelist
T
Troy Hunt's Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
C
Cisco Blogs
Scott Helme
Scott Helme
Hacker News - Newest:
Hacker News - Newest: "LLM"
Vercel News
Vercel News
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
B
Blog
GbyAI
GbyAI
Recent Commits to openclaw:main
Recent Commits to openclaw:main
D
Darknet – Hacking Tools, Hacker News & Cyber Security
P
Proofpoint News Feed
S
Security Affairs
Cisco Talos Blog
Cisco Talos Blog
AWS News Blog
AWS News Blog
T
Tenable Blog
H
Help Net Security
NISL@THU
NISL@THU
F
Fortinet All Blogs
博客园_首页
G
GRAHAM CLULEY
L
LINUX DO - 最新话题
P
Privacy International News Feed
G
Google Developers Blog
博客园 - Franky
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Security Archives - TechRepublic
Security Archives - TechRepublic
The Register - Security
The Register - Security
L
LangChain Blog
aimingoo的专栏
aimingoo的专栏
T
Tor Project blog
P
Privacy & Cybersecurity Law Blog
量子位
C
Cyber Attacks, Cyber Crime and Cyber Security
Forbes - Security
Forbes - Security
S
Secure Thoughts
Simon Willison's Weblog
Simon Willison's Weblog
D
Docker
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
L
Lohrmann on Cybersecurity
T
Tailwind CSS Blog

博客园 - smith_feng

六大免费网站数据采集器对比(火车头,海纳,云采集,ET,三人行,狂人采集) 微信公众账号 Senparc.Weixin.MP SDK 开发教程 索引 国内app快速生成平台对比 .NET连接SAP系统专题:BAPI_TRANSACTION_COMMIT的使用方法(十) SAP IDOC开发(转) webdynpro C#打印条码与ZPL weixin 公众平台开发 android SDK 离线下载更新 SAP web 开发 (第二篇 bsp 开发 mvc模式 Part2 ) SAP web 开发 (第二篇 bsp 开发 mvc模式 Part1 ) bsp STEP adobe form 使用查询(SQ01、SQ02、SQ03)创建报表 程序员想玩转大数据:需要知晓的12种工具 查找SAP标准程序用户出口及BADI的方法 SAP abap 需找出口(BADI)的几种方法 SAP 增强-出口选找方法-全部 android sdk 更新用的HOSTS
按月统计tcode和report使用次数的工具
smith_feng · 2015-10-13 · via 博客园 - smith_feng

执行report,输入要查询的日期和user,

工具会按照使用次数从高到低列出输入日期所在的月份内所有该user 曾经使用过的tcode 和report list:

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, 20 cv_report, 60 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.