FM RSAU_READ_FILE
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
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
Similar Messages
-
RSAU_READ_FILE RFC call help.
Hi,
I trying to get Audit events from C through SAP RFC SDK. However, i could not able to read table SYSLOG_IN_TABLE.
following is sample code i am using .
strcpyU(functionname,"RSAU_READ_FILE");
rfc_char_t * value = new rfc_char_t[500];
rfc_char_t * value1 = new rfc_char_t[500];
sprintfU(value,"Agtvra01-test_NSP_00 0000000000000000000000000000000020091106080000200911060800000020091109 2009110923595900 00000 *");
sprintfU(value1,"Structure: flat & not charlike");
exporting[0].name = cU("SELECTION");;
exporting[0].nlen = 9;
exporting[0].addr = value;
exporting[0].leng = strlenU(value)*sizeofR(SAP_UC);
exporting[0].type = RFCTYPE_CHAR;
/*exporting[1].name = cU("SELECTION_AUDIT");;
exporting[1].nlen = 15;
exporting[1].addr = value1;
exporting[1].leng = strlenU(value1)*sizeofR(SAP_UC);
exporting[1].type = RFCTYPE_CHAR;*/
rfc_char_t * t_name = new rfc_char_t[500];
strcpyU(t_name,"SYSLOG_IN_TABLE");
tables[0].name = t_name;
tables[0].nlen = 15;
tables[0].ithandle = ItCreate (t_name, 300, 0 , 0);
tables[0].leng = 300;
tables[0].type = RFCTYPE_CHAR;
/* issue the RFC call */
rc = RfcCallReceive (handle,
functionname,
exporting,
importing,
tables,
&exception_ptr);
/* check return code */
switch (rc)
case RFC_OK:
break;
case RFC_EXCEPTION :
case RFC_SYS_EXCEPTION :
rfc_error( exception_ptr );
break;
default :
rfc_error (cU("call/receive error"));
break;
display_table (tables[0].ithandle);
Please help me , how to read SYSLOG_IN_TABLE table .Hello,
Is your problem solved. I am facing the same situation. Could you help me out, How got the data into SYSLOG_IN_TABLE.
Thanks in advance for your reply.
Regards,
Darwin. -
Regarding Shortdump "CALL FUNCTION 'RSAU_READ_FILE"
hey..
I am trying to use this below functional module.
It goest to shortdump <b>"CALL FUNCTION CONFLICT _LENG"</b>
even i cant check whether sy-subrc is <> 0 or not.
How to stop this SHORTDUMP.
could somebody help me here..
(Situation used is : When auditfile is not found in directory it gives short dump or else it works fine.)
CALL FUNCTION 'RSAU_READ_FILE'
EXPORTING
SELECTION = TA
SELECTION_AUDIT = AUDIT_SELECT
FILE_NO_OLD = FILE_NO
TABLES
SYSLOG_IN_TABLE = ENTRIESTAB
AUDIT_FILE_STAT = AUDIT_FILE_STAT.
if sy-subrc <> 0.
write: 'no file here at RSAUREADFILE'.
exit.
endif.
Message was edited by: ambi chanHey,
sorry i closed this thread before solving completely.
i have still problem with this FM.
In 4.6B it works, but in 620 it generates SHORTDUMP.
i declared TA as
DATA: BEGIN OF TA.
INCLUDE STRUCTURE RSLGSEL.
DATA: END OF TA.
and
DATA: FILE_NO LIKE RSLGETAB-FILE_NO.
DATA : BEGIN OF ENTRIESTAB OCCURS 500.
INCLUDE STRUCTURE RSLGETAB.
DATA: END OF ENTRIESTAB.
DATA: BEGIN OF AUDIT_FILE_STAT OCCURS 100.
INCLUDE STRUCTURE RSAUFINFO.
DATA: END OF AUDIT_FILE_STAT.
CALL FUNCTION 'RSAU_SELINFO_INIT'
CHANGING
AUDIT_SELECTION = AUDIT_SELECT.
TA-WHICHLOG = 'L'.
FILE_NO = 1.
CALL FUNCTION RSAU READ_FILE
EXPORTING
SELECTION = TA
SELECTION_AUDIT = AUDIT_SELECT
FILE_NO_OLD = FILE_NO
TABLES
SYSLOG_IN_TABLE = ENTRIESTAB
AUDIT_FILE_STAT = AUDIT_FILE_STAT.
But above SHort dump exists and shows error in FM.
If my parameter declaration is wrong pls correct me..
ambichan
Message was edited by: ambi chan
Message was edited by: ambi chan -
User logon history date and time details
Hi,
can any tell me the user logon history tables,
as usr02 is only having the present log on detailsuse below Function module
CALL FUNCTION '<b>RSAU_READ_FILE</b>'.
it will solve your problem...
=====================================
Use BAPIS there are very useful BAPIS to get the user's info.
BAPI_USER_CHANGE Change User
BAPI_USER_CLONE Create User with Template in Another System
BAPI_USER_CREATE Create a User
BAPI_USER_CREATE1 Create a User
BAPI_USER_DELETE BAPI to Delete a User
BAPI_USER_DISPLAY Display users
BAPI_USER_EXISTENCE_CHECK Check a user exists
BAPI_USER_GET_DETAIL Read User Details
BAPI_USER_LOCACTGROUPS_ASSIGN Change Activity Group Assignment for Dependent Systems from Central System
BAPI_USER_LOCACTGROUPS_DELETE Delete Activity Group Assignments in the Dependent Systems
BAPI_USER_LOCK Lock User
BAPI_USER_LOCPROFILES_ASSIGN Change Profile Assignment for Dependent Systems from Central System
BAPI_USER_LOCPROFILES_DELETE Delete Profile Assignments for Dependent Systems
BAPI_USER_PROFILES_ASSIGN User: Assign profiles
BAPI_USER_PROFILES_DELETE User: Delete All Profile Assignments
BAPI_USER_UNLOCK Unlock user
===================================
U can see tables:
USR01 User master record (runtime data)
USR02 Logon data
USR03 User address data
USR05 User Master Parameter ID
USR12 User master authorization values
<b>Reward Points if it is useful..</b>
Thanks & Regards
ilesh 24x7 -
can any one tell me how to find user logon history date:
i am able to find last logon date in table usr02,
can any one tell m ehow to use the funaction module to find logon history of user RSAU_READ_FILE.
Thanks in advance,use below Function module
CALL FUNCTION 'RSAU_READ_FILE'.
Go through below link...
regarding Shortdump "CALL FUNCTION 'RSAU_READ_FILE"
Hope it will solve your problem...
=====================================
Use <b>BAPIS</b> there are very useful BAPIS to get the user's info.
BAPI_USER_CHANGE Change User
BAPI_USER_CLONE Create User with Template in Another System
BAPI_USER_CREATE Create a User
BAPI_USER_CREATE1 Create a User
BAPI_USER_DELETE BAPI to Delete a User
BAPI_USER_DISPLAY Display users
BAPI_USER_EXISTENCE_CHECK Check a user exists
BAPI_USER_GET_DETAIL Read User Details
BAPI_USER_LOCACTGROUPS_ASSIGN Change Activity Group Assignment for Dependent Systems from Central System
BAPI_USER_LOCACTGROUPS_DELETE Delete Activity Group Assignments in the Dependent Systems
BAPI_USER_LOCK Lock User
BAPI_USER_LOCPROFILES_ASSIGN Change Profile Assignment for Dependent Systems from Central System
BAPI_USER_LOCPROFILES_DELETE Delete Profile Assignments for Dependent Systems
BAPI_USER_PROFILES_ASSIGN User: Assign profiles
BAPI_USER_PROFILES_DELETE User: Delete All Profile Assignments
BAPI_USER_UNLOCK Unlock user
===================================
U can see tables:
USR01 User master record (runtime data)
USR02 Logon data
USR03 User address data
USR05 User Master Parameter ID
USR12 User master authorization values
<b>Reward points if it is useful..</b>
Thanks & Regards
ilesh 24x7 -
How to find a how many times a User logged in
Experts,
Is there a way where in I can find How many times a User Logged in to the system over a period of time.
FYI...,
I have a search over the forum but could not get the relevant solution for this. Had a trial search on TCodes SM04, SM20, STAD etc but could not find exact one for this.
Please let me know is there any way where I could get the details on the above query.
Thanks in adavnce.
Regards,
SRinivasHI,
i found this fm RSAU_READ_FILE for sm20 , but i am not sure how to use it.
I just made a search for this function and i got thisa link
Check the reply by FabioBC in which he explains the mapping of fields to this function
link:[http://www.sapfans.com/forums/viewtopic.php?p=799746&highlight=&sid=e8dca9480a775847b26ab57493f27eb6]
Edited by: Keshav.T on Dec 3, 2010 8:16 PM -
Regarding Parameter input at FM
I have still problem with this FM.
In 4.6B it works, but in 620 it generates SHORTDUMP.
i declared TA as
DATA: BEGIN OF TA.
INCLUDE STRUCTURE RSLGSEL.
DATA: END OF TA.
DATA : BEGIN OF AUDIT_SELECT.
INCLUDE STRUCTURE RSAUSEL.
DATA : END OF AUDIT_SELECT.
DATA: FILE_NO LIKE RSLGETAB-FILE_NO.
DATA : BEGIN OF ENTRIESTAB OCCURS 500.
INCLUDE STRUCTURE RSLGETAB.
DATA: END OF ENTRIESTAB.
DATA: BEGIN OF AUDIT_FILE_STAT OCCURS 100.
INCLUDE STRUCTURE RSAUFINFO.
DATA: END OF AUDIT_FILE_STAT.
CALL FUNCTION 'RSAU_SELINFO_INIT'
CHANGING
AUDIT_SELECTION = AUDIT_SELECT.
TA-WHICHLOG = 'L'.
FILE_NO = 1.
Here while debugging i found AUDIT_SELECT storing "Non-Char like structure"
does any structure here is not matching the below FM.
CALL FUNCTION RSAU READ_FILE
EXPORTING
SELECTION = TA
SELECTION_AUDIT = AUDIT_SELECT
FILE_NO_OLD = FILE_NO
TABLES
SYSLOG_IN_TABLE = ENTRIESTAB
AUDIT_FILE_STAT = AUDIT_FILE_STAT.
After execting this FM, Shortdump occurs. Pls correct me if my declaration is wrong anywhere..
ambichan<b>Runtime errors CALL_FUNCTION_CONFLICT_LENG
Exception CX_SY_DYN_CALL_ILLEGAL_TYPE</b>
Type conflict when calling a function module (field length).
<b>----
What happened?
</b>
Error in ABAP application program.
The current ABAP program "ZREADAUDLOG1" had to be terminated because one of the
statements could not be executed.
This is probably due to an error in the ABAP program.
The function module was called incorrectly.
<b>----
Error analysis
</b>
An exception occurred. This exception will be dealt with in more detail
below. The exception, assigned to the class <b>'CX_SY_DYN_CALL_ILLEGAL_TYPE'</b>, was
not caught, which
led to a runtime error. The reason for this exception is:
The call to the function module <b>"RSAU_READ_FILE"</b> is incorrect:
In the function module interface, you can specify only
fields of a specific type and length under "SYSLOG_IN_TABLE".
Although the currently specified field
"ENTRIESTAB" is the correct type, its length is incorrect.
Maybe you are looking for
-
Just fired up my tablet after getting my internet switched back on to find that Skype no longer works on it and I need to download the new version if I want to use it. So I followed the link, downloaded, opened up the setup, and that's where it ends.
-
How to distribute from cost center to profit centers?
Dear Experts, We have created profit centers as per business. We have certain expenses that are common. e.g. IT, A/c, HR etc. We have created cost centers for the same. Now we want to assign it to various PCs. How to distribute from cost center
-
Dear Sir / Madam, What is the Procedure for Purchase the Import Material.Request for explain the detail step by step with T-code. With Kind Regards, Nitin
-
Subscription not renewed by the desired date
I have a monthly subscription which was supposed to be renewed today i.e. Aug 13, 2011. Payment for the same was already done 10days back and the same is reflected in purchase history. However, the minutes haven't been added yet. How do I get this re
-
Upgrade 6.1.3.3000-1 Failure
03/28/2009 18:45:33 | root: Upgrade 6.1.3.3000-1 Start 03/28/2009 19:15:14 | root: Upgrade 6.1.3.3000-1 Failure 03/28/2009 19:15:14 CCMInstall|(CAPTURE) installFull rc[1]|<LVL::Debug> 03/28/2009 19:15:14 CCMInstall|(CAPTURE) installdb Failure [-i] 1|