Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Table name for Security Audit Log SM20

Former Member
0 Kudos

Hi,

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.

Sandy

4 REPLIES 4

Former Member
0 Kudos

Hi Sandy

Please go through the following post.

Thanks.

Anjan

0 Kudos

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?

thanks.....

martin_voros
Active Contributor
0 Kudos

Hi,

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.

Cheers

Erol_CAGLAR
Participant
0 Kudos

please investigate this include MSM20TO1.

DATA: BEGIN OF TA.
         INCLUDE STRUCTURE RSLGSEL.
DATA: END OF TA
     .

  CALL FUNCTION 'RSLG_SEL_DUMP'

  IMPORTING

    itself = ta.

CALL FUNCTION 'RSAU_READ_FILE' DESTINATION <fs_dests>-rfcdest

        EXPORTING

           selection       = ls_sel_slg

           selection_audit = ls_sel_au

           file_no_old     = file_no

        IMPORTING

           end_reason      = end_reason

           end_info        = end_info

           counters        = recordcnt

           file_no_new     = file_no

        TABLES

           syslog_in_table = entriestab_2

           audit_file_stat = audit_file_stat_rfc

        EXCEPTIONS

           system_failure        = 2 MESSAGE last_rfc_mess

           communication_failure = 3 MESSAGE last_rfc_mess.