SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Detects long-running ABAP programs - report



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Performance tuning | Производительность
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1636

PostPosted: Sat Nov 17, 2007 6:07 pm    Post subject: Detects long-running ABAP programs - report Reply with quote

Code:
*
* This program interprets the sequential file created by ZHEAVYPR
* and displays the "heavy" ABAPs of a specified period of time.
* The result is a list of ABAPS categorized by app. server and
* work process type, and sorted by a number: how many times
* that particular ABAP was found running for too long time (>5min)
* during that period.
*
REPORT ZHEAVYLS.

DATA: INPUT_FILE(40) VALUE '/oracle/SID/sapreorg/heavy_abaps'.
PARAMETERS: DATE LIKE AMDS-ANDAT DEFAULT SY-DATUM,
            FROMTIME LIKE PLKZ-AEUZEIT DEFAULT SY-UZEIT,
            TOTIME LIKE PLKZ-AEUZEIT DEFAULT SY-UZEIT.

DATA: BEGIN OF O,
      1(10), 2(8), 3(8), 4(3), 5(8), 6(8),
END OF O.
DATA: BEGIN OF A OCCURS 100,
      3(8), 4(3), 6(8), NUM TYPE I,
END OF A.

OPEN DATASET INPUT_FILE FOR INPUT IN TEXT MODE.
DO.
  READ DATASET INPUT_FILE INTO O.
  IF SY-SUBRC <> 0.EXIT.ENDIF.
  IF O-1 = DATE AND O-2 >= FROMTIME AND O-2 <= TOTIME.
    MOVE-CORRESPONDING O TO A. A-NUM = 1.
    COLLECT A.
  ENDIF.
ENDDO.
CLOSE DATASET INPUT_FILE.

WRITE: / DATE, FROMTIME, '---', TOTIME.
SKIP 2.
SORT A BY 3 4 NUM DESCENDING.
LOOP AT A.
  AT NEW 3.
    WRITE: / A-3 COLOR 2.
  ENDAT.
  AT NEW 4.
    WRITE: / '      ',A-4 COLOR 3.
  ENDAT.
  WRITE: / '             ', A-6, A-NUM.
ENDLOOP.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Performance tuning | Производительность All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.