Сам пользуюсь таблицей USR02(последний вход в систему) c таблицей USR06 (Лицензии) - доволен.
1. Позволяет оценить сколько свободных лицензий. На актуальную дату работает.
2. Позволяет найти уволенных сотрудников и забрать у них лицензию.
Возможно этого будет достаточно.
Еще в системе бежит следуюший код:
Code:
call function 'TH_SERVER_LIST'
tables
list = gt_srv[]
exceptions
no_server_list = 1
others = 2.
if sy-subrc is not initial.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
data: list like uinfo occurs 0.
loop at gt_srv.
refresh gt_usr.
* получить список работающих пользователей
call function 'TH_USER_LIST' destination gt_srv-name
tables
list = list
usrlist = gt_usr.
append lines of gt_usr to usr_tabl.
endloop.
* ->
* удалить данные из других мандантов. и типы соединений не GUI
delete USR_TABL where mandt <> sy-mandt or TYPE <> 4.
* удалить повтроные входы в систему
data: USR_TABL2 like USR_TABL occurs 0 with header line.
loop at USR_TABL.
read table USR_TABL2 with key bname = USR_TABL-bname.
if sy-subrc <> 0.
append USR_TABL to USR_TABL2.
else.
if USR_TABL-zeit > USR_TABL2-zeit.
delete USR_TABL2 index sy-tabix.
append USR_TABL to USR_TABL2.
endif.
endif.
endloop.
USR_TABL[] = USR_TABL2[].
* расчет времени работы
loop at USR_TABL.
select single * from ZIN_USER_LOG where uname = USR_TABL-bname and work_date = sy-datum.
if sy-subrc = 0.
ZIN_USER_LOG-logon_time = ZIN_USER_LOG-logon_time + delta_last.
update ZIN_USER_LOG.
endif.