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: 

FM RSAU_READ_FILE

Former Member
0 Kudos

hi

I am trying to use the above FM to read audit logs from a network of several application servers.

One of the IMPORT paramters is SELECTION-RFCDEST.

Does anyone know what parameter I have to put in for the FM to collect the audit logs from all

application servers.

Giving no prameter at all brings back the central instance audit log only.

Thank you in advance

yuval

7 REPLIES 7

former_member181995
Active Contributor
0 Kudos

Peery,

Just use like that:

CALL FUNCTION 'RSAU_READ_FILE'
        DESTINATION ls_all_dests-rfcdest
        EXPORTING
          selection             = ta
          selection_audit       = ta_audit
          file_no_old           = file_no
        IMPORTING
          end_reason            = end_reason
          end_info              = end_info
          counters              = l_recordcnt
          file_no_new           = file_no
        TABLES
          syslog_in_table       = it_entriestab_2
          audit_file_stat       = audit_file_stat_rfc
        EXCEPTIONS
          system_failure        = 2  MESSAGE last_rfc_mess
          communication_failure = 3  MESSAGE last_rfc_mess.

Amit.

0 Kudos

Hi Amit

Thank you for your reply

I will try to incorporate it in my call.

However suppose oyu use transaction SE37 to

run this FM, how do you then put a valid parameter in RFCDEST????

regards

yuval

0 Kudos

Peery,

leave it blank.

Amit.

0 Kudos

Amit

If I leave it blank it does not fetch logs from the various application servers.

If I run SM20 using 'ALL_AUDIT_LOGS', I get a different report this time specfying

all application servers.

Thank you

Yuval

Former Member
0 Kudos

Hi Yuval

you can follow this

use fm TH_SERVER_LIST to get the servers list

you'll get that in an internal table (of type msxxlist ex:serv_list)

loop at that and call the RSAU_READ_FILE within the loop

giving the destination from the server list.

ex coding:

DATA : serv_list TYPE TABLE OF msxxlist .

DATA : wa_servlist LIKE LINE OF serv_list.

DATA: BEGIN OF all_dests OCCURS 100.

INCLUDE STRUCTURE rfchosts.

DATA: access TYPE i, " 0=active, 4=not active

END OF all_dests.

CALL FUNCTION 'TH_SERVER_LIST'

TABLES

list = serv_list

EXCEPTIONS

no_server_list = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

IF NOT serv_list[] IS INITIAL.

LOOP AT serv_list INTO wa_servlist.

all_dests-rfcdest = wa_servlist-name.

all_dests-access = 0.

APPEND all_dests.

CLEAR :wa_servlist,all_dests.

ENDLOOP.

ENDIF.

LOOP AT all_dests.

IF all_dests-access <> 0.

CLEAR rec_cnts.

MOVE 'R' TO rec_cnts-kind.

MOVE-CORRESPONDING ta TO rec_cnts.

MOVE all_dests-access TO rec_cnts-errrc.

APPEND rec_cnts.

ELSE.

ta-rfcdest = all_dests-rfcdest.

CLEAR rec_cnts.

MOVE 'R' TO rec_cnts-kind.

MOVE-CORRESPONDING ta TO rec_cnts.

REFRESH entriestab_2.

REFRESH audit_file_stat_rfc.

CALL FUNCTION 'RSAU_READ_FILE'

DESTINATION all_dests-rfcdest

EXPORTING

selection = ta

selection_audit = ta_audit

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.

IF sy-subrc <> 0.

rec_cnts-errrc = sy-subrc.

rec_cnts-errmess = last_rfc_mess.

ELSE.

LOOP AT entriestab_2.

entriestab = entriestab_2.

APPEND entriestab.

ENDLOOP.

LOOP AT audit_file_stat_rfc.

audit_file_stat = audit_file_stat_rfc.

APPEND audit_file_stat.

ENDLOOP.

MOVE-CORRESPONDING recordcnt TO rec_cnts.

ENDIF.

APPEND rec_cnts.

CLEAR recordcnt.

ENDIF.

ENDLOOP.

hope this will clear ur doubt.

reward is useful

Regards

Prabumanoharan

Former Member
0 Kudos

This was not the problem

Private_Member_19084
Active Contributor
0 Kudos

Could anybody solve the problem, to get the audit-log CONTENT ?

Kind regards