Posted: Sun Nov 25, 2007 12:57 pm Post subject: History of a selected tablespace using SAP graphics
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.
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.