cancel
Showing results for 
Search instead for 
Did you mean: 

Statistical log - No records returned

Former Member
0 Kudos

We have a custom ABAP that calls function module SAPWL_STATREC_DIRECT_READ to extract data from the statistical log. (We use this information to monitor the tcodes that a user has executed.)

A scheduled job runs the program runs each morning at 5AM, extracs data for the previous day, and creates a unix file.

The job always completes successfully, and on most days does extract the desired data. Sometimes, however, no data is returned from the function module, and so a unix file is not created. However, we know that there has been tcode activity in the system on those days.

<b>My Question</b>

From a Basis perspective, is there anything we should be looking at that could be responsible for what we're seeing, possibly some system parameters? (Our Basis group has not come up with anything so far.)

<b> System Info</b>

We're at release 4.7 (Basis release 6.2)

Thanks in advance for any suggestions.

Len Laurence,

Becton Dickinson

Accepted Solutions (1)

Accepted Solutions (1)

tim_buchholz
Active Participant
0 Kudos

Dear Len and Becton,

did you check the statistic record with SAP's transactions, e.g. STAD? Does this show records during the time you do not get any data?

Best Regards,

Tim

Former Member
0 Kudos

Thanks, Tim, for your response.

The next time it happens that we don't have data, I will ask someone from our Basis group to check this. I guess you're saying that if STAD does show records, then something must be wrong with our program?

Thanks,

Len

Answers (3)

Answers (3)

Former Member
0 Kudos

Should have closed this a long time ago. The suggestions provided were very helpful.

Former Member
0 Kudos

Right. You do not need to supply a list of systems; SELECT_FROM_SYSTEMS is an optional parameter.

We call it and supply only start/stop date/times.

--

Tim

Former Member
0 Kudos

Good idea to use STAD to double check if there are statistic records.

Also, realize that SAPWL_STATREC_DIRECT_READ read statistics records only for the instance it is run on. If the activity was on other instances (application servers) of the system, you won't see the records.

Use SAPWL_READ_STATISTIC_FILES to get records from all instances of an SAP system. Here's the call graph for STAD on 4.7:

STAD R RSSTAT26
  FM STUD.SAPWL_READ_STATISTIC_FILES – get workload and application stats from all instances of system
    RFM STUD.SAPWL_READ_STAT_A_ASTAT_FILES – get workload and application stats from current instance
	FM STUW.SAPWL_STATREC_DIRECT_READ – get workload stats from current instance
	FM STUW.SAPWL_ASTAT_DIRECT_READ – get application stats from current instance

Former Member
0 Kudos

Hi Tim, and thanks for taking the time to respond.

Over the past few days, I've been corresponding with Andreas Vogel, who has a blog on this site. He's the SAP developer responsible for statistical monitoring and workload analysis tools such as ST03N and STAD.

He confirms what you're saying - that SAPWL_STATREC_DIRECT_READ reads statistics only for the instance it is run on, and has suggested instead SAPWL_GET_STATRECS_FRAME. Have you had any experience with this function module?

I've updated the ABAP program (in our dev. system) to use the new function module, but it's difficult for us to "prove" that this is the problem, as it's only in our prod. system that we have multiple application servers. To get something moved to production around here is an arduous process, with all the documentation required, so we don't want to go through the trouble unless we know that this will fix the problem.

Hopefully, our Basis group will come up with a way for us to test this in the lower systems, and it will fix the problem.

Thanks again,

Len

Former Member
0 Kudos

Everything I know on statistics records is from Andreas

Yes, we've used SAPWL_GET_STATRECS_FRAME. It will get statistics records from multiple SAP systems, if you want. By default, it gets records from all instances of the current system. It is also 'remote enabled' so you can call it from outside SAP, if you need.

There will be a bit of code change to your reporter since the tables are returned in a slightly different structures to account for the multiple systems.

--

Tim

Former Member
0 Kudos

I didn't know that by default it gets records from all instances. When coding it, I populated the <i>select_from_systems</i> parameter, by getting a list of the servers from function module TH_SERVER_LIST, but it sounds from your response like I didn't need to do this. I could just not pass anything for this parameter.

Thanks,

Len