该工具可以打印出user在指定日期内浏览过的webclient ui的component name和view name。 输入user name和查询的日期:
打印出所有浏览过的ui component name和view name:
report 代码如下:
REPORT ZPAGENAME.
PARAMETERS: name TYPE trdir-unam OBLIGATORY,
date TYPE trdir-udat OBLIGATORY.
DATA: lt_trdir TYPE STANDARD TABLE OF trdir,
lt_page TYPE STANDARD TABLE OF o2pagdir.
TYPES: BEGIN OF ty_impl,
name TYPE o2pagdir-implclass,
END OF ty_impl.
TYPES: tt_impl TYPE STANDARD TABLE OF ty_impl.
START-OF-SELECTION.
SELECT * INTO TABLE lt_trdir FROM trdir WHERE unam = name AND udat = date.
IF sy-subrc <> 0 .
WRITE: / 'No browse history found for current user at the given date'.
RETURN.
ENDIF.
DATA: lt_impl TYPE tt_impl,
ls_trdir TYPE trdir,
ls_impl TYPE ty_impl.
LOOP AT lt_trdir INTO ls_trdir.
ls_impl-name = ls_trdir-name.
APPEND ls_impl TO lt_impl.
ENDLOOP.
SELECT * INTO TABLE lt_page FROM o2pagdir FOR ALL ENTRIES IN lt_impl
WHERE implclass = lt_impl-name.
LOOP AT lt_page ASSIGNING FIELD-SYMBOL(<page>).
WRITE: / 'UI component name: ' , <page>-applname COLOR COL_NEGATIVE, ' view name: ', <page>-pagename COLOR COL_POSITIVE.
ENDLOOP.