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

Table / Function that defines if a program is being executed(not-so-urgent)

Former Member
0 Likes
761

Hi,

Could you please help me.

I required to know if a program is being executed in a specific moment.

If you know any table or a function, than indicates if a program is being executed in that moment please tell me.

I search for a function and found this one, but i dont know how to use it.

CALL FUNCTION 'ENQUEUE_ESFUNCTION'

EXPORTING

MODE_TFDIR = 'E'

FUNCNAME =

X_FUNCNAME = ' '

_SCOPE = '2'

_WAIT = ' '

_COLLECT = ' '

EXCEPTIONS

FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2

OTHERS = 3

Please help me !!!!!.

Thanks for your help and best regards.

JRZ.

<Subject line changed>

Edited by: Suhas Saha on Oct 28, 2011 10:37 AM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
664

Hi,

You can use transaction code STAT

writer/painter reports -view stats via SE16 in table T803J

reports and transactions execution info is stored in table 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

Thanks & regards.

Hi,

Could you please help me.

I required to know if a program is being executed in a specific moment.

If you know any table or a function, than indicates if a program is being executed in that moment please tell me.

I search for a function and found this one, but i dont know how to use it.

CALL FUNCTION 'ENQUEUE_ESFUNCTION'

EXPORTING

MODE_TFDIR = 'E'

FUNCNAME =

X_FUNCNAME = ' '

_SCOPE = '2'

_WAIT = ' '

_COLLECT = ' '

EXCEPTIONS

FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2

OTHERS = 3

Please help me !!!!!.

Thanks for your help and best regards.

JRZ.

<Subject line changed>

Edited by: Suhas Saha on Oct 28, 2011 10:37 AM

3 REPLIES 3
Read only

Former Member
0 Likes
665

Hi,

You can use transaction code STAT

writer/painter reports -view stats via SE16 in table T803J

reports and transactions execution info is stored in table 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

Thanks & regards.

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
664

Did you check fm th_wpinfo ?

Good subject line creativity by Suhas

Read only

0 Likes
664

I think i stole the idea from Thomas(may be) ... Only he & JB have these brilliant ideas

Edited by: Suhas Saha on Oct 28, 2011 11:27 AM