Application Development and Automation 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: 
Read only

ABAP Program

Former Member
0 Likes
1,085

Hi There,

I want to find out, when SAP Z-program was run last.

Is there any way to find it out except the Transactions

STAT, ST03.

Thanks in Advance!

Beserithan

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
777

check..

st22 and sm04..

5 REPLIES 5
Read only

Former Member
0 Likes
778

check..

st22 and sm04..

Read only

0 Likes
777

You can use transaction code STAT.

For writer/painter reports you can view stats via SE16 in table T803J. For all reports and transactions execution info is stored in table MONI. This is the same info available via ST03 and to some extent STAT. Info for MONI is collected from the UNIX servers and totalled on MONI by day, week, month, year. Retention periods are set by the Basis group. We have a custom table where this information is stored by period for historical and licensing purposes. Be sure to use the SAP function modules to retrieve data from MONI.

Also check this sample code from other thread.

  • internal tables for use counterdata:

begin of list occurs 5.

include structure sapwlserv.

data: end of list.

data: begin of applicat occurs 0.

include structure sapwlustcx.

data: end of applicat.

data: begin of applica_ occurs 0.

include structure sapwlustcx.

data: end of applica_.

data: begin of applicau occurs 0,

entry_id like sapwlustcx-entry_id,

account like sapwlustcx-account,

count like sapwlustcx-count,

: end of applicau.

data: wa_applicau like applicau.

&----


*& Form MONI

&----


form moni.

data: l_host like sapwlserv-hostshort.

m_start = p_usedt.

      • get server

call function 'SAPWL_SERVLIST_GET_LIST'

tables

list = list.

do.

loop at list.

      • loop on server

check not list-instshort is initial.

l_host = list-instshort.

      • get statistics per month and server

perform workload using m_start l_host.

endloop.

add 31 to m_start.

if m_start > sy-datum.

exit.

endif.

enddo.

sort applica_ by entry_id.

sort applicau by entry_id count descending.

endform. " MONI

&----


*& Form WORKLOAD

&----


form workload using p_start like sy-datum

p_host like sapwlserv-hostshort.

refresh: applica_.

      • read application statistic from MONI

call function 'SAPWL_WORKLOAD_GET_STATISTIC'

exporting

periodtype = 'M'

hostid = p_host

startdate = p_start

only_application_statistic = 'X'

tables

application_statistic = applica_

exceptions

unknown_periodtype = 1

no_data_found = 2

others = 3.

sort applica_ by entry_id account.

loop at applica_ where entry_id(1) ge 'Y'. "#EC PORTABLE

clear wa_applicau-entry_id.

wa_applicau-entry_id(25) = applica_-entry_id.

wa_applicau-account = applica_-account.

wa_applicau-count = applica_-count.

collect wa_applicau into applicau.

endloop.

sort applicau by entry_id count descending.

applica_-ttype = space.

applica_-account = space.

modify applica_ transporting ttype account where ttype ne space.

      • collect only enhancements statistic

if p_temp = 'X'.

loop at applica_.

applica_-entry_id+25(48) = space.

collect applica_ into applicat.

endloop.

else.

loop at applica_ where entry_id(1) ge 'Y'. "#EC PORTABLE

applica_-entry_id+25(48) = space.

collect applica_ into applicat.

endloop.

endif.

endform. " WORKLOAD

SPAU tcode also may help u.

STAT too check

That data is stored in a statistics file. To get to it, try using function module SAPWL_STATREC_READ_FILE. Before calling the function, you will need to get the path of the statistics file, and to do that try this:

CALL 'C_SAPGPARAM' ID 'NAME' FIELD 'stat/file'

ID 'VALUE' FIELD WS_PATH.

You will need to use WS_PATH on the STATISTIC_FILE exporting parameter on the call to SAPWL_STATREC_READ_FILE. You should get the data back in the V2 records (releases over 4.0) and in V1 (releases < 4.0).

Message was edited by: kishan negi

Read only

vinod_gunaware2
Active Contributor
0 Likes
777

The trasaction stat is limited because i want all the execution date even if it is 3 years ago.

I have tryied the transaction st03 but it is limited to 3 months ago.

check transaction STAT and it's report RSSTAT00.

U can copy RSSTAT00 into ZRSSTAT00 and modify corresponding.

regards

vinod

Read only

0 Likes
777

HI

use <b>STAT</b> or <b>SM04</b> transaction

regards,

Santosh

Read only

Former Member
0 Likes
777

Hello Beserithan,

long time ago since you post this message, and now I have the same need as you had... could you please tell me how did you solve your problem?? how did you get the information about when was the last time a program/transaction was executed ? I would appreciated very much your help, even if is it a ABAP code, ok?

Kind regards,

Caroline