Application Development 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: 

Find the last run of program

Former Member
0 Kudos
587

Hi,

How to find the last execution time of program.

From ST03 / STAD transactions I could not find.

Can you please suggest me.

Thanks

Hema

3 REPLIES 3

Former Member
0 Kudos
55

Hello,

Try with the Tcode STAT

If useful reward points.

or use this FM. This is a Customizimed FM which we are using in our company.

FUNCTION Z48S_PROGRAM_USAGE.

*"----


""Lokale Schnittstelle:

*" IMPORTING

*" REFERENCE(TCODE) TYPE SYTCODE DEFAULT SYST-TCODE

*" REFERENCE(CPROG) TYPE SYCPROG DEFAULT SYST-CPROG

*" REFERENCE(BATCH) TYPE SYBATCH DEFAULT SYST-BATCH

*" REFERENCE(UNAME) TYPE SYUNAME DEFAULT SYST-UNAME

*" REFERENCE(DATUM) TYPE SYDATUM DEFAULT SYST-DATUM

*" REFERENCE(UZEIT) TYPE SYUZEIT DEFAULT SYST-UZEIT

*"----


TABLES Z48S_PROGUSAGE.

Z48S_PROGUSAGE-BATCH = BATCH.

Z48S_PROGUSAGE-REPID = CPROG.

Z48S_PROGUSAGE-TCODE = TCODE.

Z48S_PROGUSAGE-UNAME = UNAME.

Z48S_PROGUSAGE-DATUM = DATUM.

Z48S_PROGUSAGE-UZEIT = UZEIT.

DO.

CALL FUNCTION 'ENQUEUE_EZ48S_PROGUSAGE'

EXPORTING

MODE_Z48S_PROGUSAGE = 'E'

MANDT = SY-MANDT

REPID = CPROG

BATCH = BATCH

  • X_REPID = ' '

  • X_BATCH = ' '

  • _SCOPE = '2'

  • _WAIT = ' '

  • _COLLECT = ' '

EXCEPTIONS

FOREIGN_LOCK = 1

SYSTEM_FAILURE = 2

OTHERS = 3.

IF SY-SUBRC <> 0.

WAIT UP TO 1 SECONDS.

CONTINUE.

ENDIF.

MODIFY Z48S_PROGUSAGE.

CALL FUNCTION 'DEQUEUE_EZ48S_PROGUSAGE'

EXPORTING

MODE_Z48S_PROGUSAGE = 'E'

MANDT = SY-MANDT

REPID = CPROG

  • BATCH =

  • X_REPID = ' '

  • X_BATCH = ' '

  • _SCOPE = '3'

  • _SYNCHRON = ' '

  • _COLLECT = ' '

.

EXIT.

ENDDO.

ENDFUNCTION.

Table structure:

MANDT MANDT CLNT 3 0 Client

REPID REPID CHAR 40 0 ABAP Program Name

BATCH SYBATCH CHAR 1 0 Program running in background

TCODE TCODE CHAR 20 0 Transaction code

UNAME UNAME CHAR 12 0 User name

DATUM SYDATUM DATS 8 0 Date and time, current (application server) date

UZEIT SYUZEIT TIMS 6 0 Dat and time, current application server time

Vasanth

Message was edited by: Vasanth M

0 Kudos
55

Check <b>STAT</b> T-code where you give the program name /transaction/task tpe/ work process/start time / end time...

0 Kudos
55

Hi Vasanth,

I do not find Tcode STAT in my system, we are using ECC 5.0.

The FM, seems for future maintenance of programs run, where as my requirement is to know the already executed programs for the last 3 months.

Thanks

Hema