I want to make a report to calculate total SAP Used(logon) hours for a specified period (week/year/month) for User(s). In this regard I used SM20 transaction code and calculate time using Logon Successful time and User Log off time data. This Audit Log data saves into files. Now I want to know the table name for Users, Login time and Log out times so as to make a report which I could fire periodically.
Or is there any function module for this?
thanks in advance.
Please go through the following post.
Dear Mr. Anjan,
ST03N, STAD will not give my required result. And Security Audit Log is activated for my system which is giving me the desired reply. But here I have to do a lot long manual calculation in Excel which is very time consuming.
So I want to make a report by firing which it will give me total used hours (Sum of (User Log off-Login Successful)) for a perticular user for a period specified.
Is there any wayout?
as you mentioned the security audit log is written to files. It's not that hard to check transaction SM20N to see what function modules are used by SAP. Basically, you are looking for function modules with name like RSAU_* such as RSAU_READ_FILE. Don't forget that if you remove audit files then you won't be able to read these files. So you can create your own custom table and schedule a simple report which will make a copy of audit records and then use this custom table in your report. Also don't forget that there is a security reason why audit records are written to file.
please investigate this include MSM20TO1.
DATA: BEGIN OF TA.
INCLUDE STRUCTURE RSLGSEL.
DATA: END OF TA
CALL FUNCTION 'RSLG_SEL_DUMP'
itself = ta.
CALL FUNCTION 'RSAU_READ_FILE' DESTINATION <fs_dests>-rfcdest
selection = ls_sel_slg
selection_audit = ls_sel_au
file_no_old = file_no
end_reason = end_reason
end_info = end_info
counters = recordcnt
file_no_new = file_no
syslog_in_table = entriestab_2
audit_file_stat = audit_file_stat_rfc
system_failure = 2 MESSAGE last_rfc_mess
communication_failure = 3 MESSAGE last_rfc_mess.