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

History of a selected tablespace using SAP graphics



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> Security and Monitoring
View previous topic :: View next topic  
Author Message
admin
Администратор
Администратор



Joined: 01 Sep 2007
Posts: 1640

PostPosted: Sun Nov 25, 2007 12:57 pm    Post subject: History of a selected tablespace using SAP graphics Reply with quote

Display the growth history of a selected tablespace using SAP graphics

Code:

*
* Display the growth history of a specific tablespace using SAP graphics.
* The tablespace has to be selected from an interactive list.
*
REPORT ZTBSPCGR.

DATA: BEGIN OF HIST OCCURS 100.
        INCLUDE STRUCTURE HIST.
DATA: END OF HIST.
DATA: BEGIN OF HIST2 OCCURS 100,
        TS LIKE HIST-TS,
        DATE_ LIKE HIST-DATE_,
        TUSED LIKE HIST-TUSED,
END OF HIST2 .
DATA: BEGIN OF DATA OCCURS 1,
 W TYPE I,
 F TYPE F,
END OF DATA.
DATA: BEGIN OF OPTS OCCURS 1,
 C(80),
END OF OPTS.
DATA: SELTS LIKE HIST-TS, CLIN(7) TYPE N, CCLIN(7), LIN TYPE I,
      DATEC(25), REFDAT TYPE D VALUE '19970801', X1 TYPE I VALUE 0,
      X2 TYPE I VALUE 300, Y1 TYPE I VALUE 0, Y2 TYPE I VALUE 10000,
      FLAG TYPE I.

START-OF-SELECTION.

  CALL FUNCTION 'DB_ORA_TABLESPACE_HISTORY' DESTINATION 'zzzzzzzz'
  TABLES
         HIST1 =  HIST.

  LOOP AT HIST.
    MOVE-CORRESPONDING HIST TO HIST2.
    HIST2-TUSED = HIST2-TUSED / 1024.
    HIST2-DATE_ = HIST2-DATE_ - REFDAT.
    APPEND HIST2.
  ENDLOOP.

  SORT HIST2 BY TS.
  FLAG = 0.
  LOOP AT HIST2.
    AT NEW TS.
      FLAG = FLAG + 1. FLAG = FLAG MOD 2.
      IF FLAG = 0.
        WRITE: / HIST2-TS COLOR 2. HIDE: HIST2-TS.
      ELSE.
        WRITE: / HIST2-TS COLOR 4. HIDE: HIST2-TS.
      ENDIF.
    ENDAT.
  ENDLOOP.

AT LINE-SELECTION.
  SELTS = HIST2-TS.
  SY-LSIND = SY-LSIND - 1.
  SORT HIST2 BY DATE_ ASCENDING.
  CLEAR DATA. REFRESH DATA.
  CLEAR OPTS. REFRESH OPTS.
  LOOP AT HIST2.
    IF HIST2-TS = SELTS.
      DATA-W = HIST2-DATE_.
      DATA-F = HIST2-TUSED.
      APPEND DATA.
    ENDIF.
  ENDLOOP.

  DESCRIBE TABLE DATA LINES LIN.
  CLIN = LIN. CCLIN = CLIN. CCLIN(1) = '$'.
  DATEC = 'TABLESPACE: '. DATEC+12 = SELTS.
  OPTS-C = CCLIN .APPEND OPTS.
  OPTS-C = 'COLOR=1'.APPEND OPTS.
  OPTS-C = 'thick=1'.APPEND OPTS.
  OPTS-C = 'LTEXT='.APPEND OPTS.
  OPTS-C = 'DTEXT='.APPEND OPTS.

  CALL FUNCTION 'STAT_GRAPH'
       EXPORTING
            TTEXT = DATEC
            UTEXT = 'Kb/day (from Aug-01-97)'
            X_ART = 'LIN'
            Y_ART = 'LIN'
            SCALE = 'MAN'
            XRNGL = X1
            XRNGU = X2
            YRNGL = Y1
            YRNGU = Y2
            XTCKS = '11'
            YTCKS = '11'
            XDECS = '0'
            YDECS = '0'
       TABLES
            OPTS  = OPTS
            DATA  = DATA.
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 -> Security and Monitoring 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.