Enable auditing in Service Manager

Auditing enables the system to create a separate audit record each time a user makes a change to a record and saves it to the database. The document describes how to enable and configure auditing so that if any records are added/deleted/modified in a table, it is captured and recorded by the application.

Auditing captures all modifications made to a record in any Service Manager table at the application level.

However, auditing does not capture any information if the changes to a table are made at the database level.

The following configuration of auditing captures information about any modifications made to records in a Service Manager table:

1. Login to service Manager as administrator

2. Go to System Navigator > Tailoring > Audit > Turn Auditing On/Off

Check the following options:
Do you want to audit development changes?
Do you want to keep backups of Changes?

3. Create a new Audit Specification as follows:

System Navigator > Tailoring > Audit > Audit Specification > enter the name of the table to audit in the filename field

4. Specify the Unique A field as the unique key for that particular table

The screenshot below shows an example audit record for the probsummary table:

5. Update the format control record for that particular table as follows:

Type fc in the command line > search for filename > Check the Save Copy check box > select Javascript > select more Options > select Show Expanded Form

Add: true
update: true
delete: true

In the text box line 1:
vars.$filetmp=new SCFile(“<filename>”);

The screenshot below shows an example of the javascript tab for the format control probsummary:

6. Select Subroutines in the format control > select more options > select Show Expanded Forms

Put in the following details in a new line:

Application Name: audit.compare
Names: file
Values: $file
Names: second.file
Values: $filetmp

Add msg ID: true
Delete:true
Add:true
Update:true

The screenshot below shows an example of the subroutines tab for the format control probsummary:

7. Save the format control record

8. Disconnect from the client and connect again for changes to take effect

All audit records are stored in a table called audit. This table can be accessed as follows:

Type db in command line > type in the table name as audit > type in the format name as audit > search

The audit record generated for any changes made to a table will look something like this:

The audit record will have information about the following:

1. Name of the file to which the changes are made and saved (label=filename)
2. Timestamp of the change(label=Recorded)
3. Name of the filed in the table that is changed(label=Field Name)
4. Value of the field before the change was made(label=Old Scalar)
5. Operator/user who made the change(label=falcon)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s