Reading monitoring data

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Post Reply
Eggy
Posts: 309
Joined: Wed Jan 11, 2006 8:50 am

Reading monitoring data

Post by Eggy » Wed Aug 20, 2008 8:12 am

Ok so the customer requests some sort of monitoring report... they want to know who accessed the system, when was the last time they did that and more interesting what transactions did they use.

The first and second are pretty easy, since you can read this data from table USR02.

The third however poses a problem. There is data available on what user accessed what transaction, even when and how long things took. That information can be found in transaction ST03 which gets its data from the MONI table.

However, the data in the MONI table is stored in the LRAW format, meaning I can't just read it. Somehow the ST03 transaction can deliver results quite fast; for user X give me all transactions used in the last month.. and *poof* 2 seconds later it's on the screen.

Since MONI doesn't have columns specifically for user, time etc. I'd have to loop over all records (which are a lot), convert them to char/string, read the info and use or discard them. I reckon that would take a lot more time than 2 seconds. So how does ST03 do it? Or is converting really that fast?

Or perhaps there is some other table I should look into? ...that would be great :)

Thanks in advance!

wilhitern1
Posts: 135
Joined: Thu May 15, 2008 4:25 pm
Location: Butterball LLC., Goldsboro, NC, USA
Contact:

Re: Reading monitoring data

Post by wilhitern1 » Wed Aug 20, 2008 8:25 am

Might I suggest you look at
CALL FUNCTION 'SAPWL_STATREC_READ_FILE'
Neal Wilhite (WilhiteRN1)Image

Eggy
Posts: 309
Joined: Wed Jan 11, 2006 8:50 am

Re: Reading monitoring data

Post by Eggy » Wed Aug 20, 2008 8:38 am

If I recall correctly, that FM is used to read the statistics file saved to the server. The usual transaction used to read that data is STAT, which doesn't seem to exist on our system.

When I insert the FM, I get the message that it's obsolete and not to be used, new one is SAPWL_STATREC_DIRECT_READ.

Let me take a look :) thx for the info

A possible reason not to use this file is that it has a fixed size, discarding old data as it hits its limit. So if one user is generating a whole lot of records, it could result in records for an other user in the same week to disappear from the overview.

However it does seem to return information as seen in the ST03 transaction :)

doris
Posts: 56
Joined: Mon Jan 06, 2003 10:06 am
Location: Dublin, Ireland

Re: Reading monitoring data

Post by doris » Wed Aug 20, 2008 10:09 am

Hi Eggy,

I also use function module SAPWL_STATREC_READ_FILE to retrieve information about programs/transactions used. I store the information retrieved in a custom table for querying later on, but we are only interested in custom programs and when they were last run so the amout of information that we store is quite small. On our system the file that stores this data is re-created each time the system is rebooted (for us each weekend) so we only ever have a weeks worth of information - so that is something to consider on your system. Therefore, we run our job to collect and store the data every night - also have to flush the buffers before collecting to ensure that all the latest information is collected.

Doris

Eggy
Posts: 309
Joined: Wed Jan 11, 2006 8:50 am

Re: Reading monitoring data

Post by Eggy » Thu Aug 21, 2008 3:46 am

Yeah I've thought of the same thing, as long as you run the program every night and store the found data in a custom table, there will be no problem. If I always run the program for the day before and remove records that are no longer used for reporting from the custom table, I'd have once fine system :)

Now to wait for the _exact_ requirements, have the specification signed in blood, stamped with a royal seal etc. etc. ;) At least I'm pretty much ready for whatever they can throw at me on this one. At least that's what I try to make myself believe. In some way the customer always manages to surprise me with rediculous demands :P

Post Reply