TABLES : ARCH_OBJ. TYPE-POOLS : ADK .

*---> data declaration DATA : BEGIN OF I_TAB_AOBJ OCCURS 0, OBJECT LIKE ARCH_OBJ-OBJECT, END OF I_TAB_AOBJ. DATA: TABNAM TYPE MSSTABLE. DATA : BEGIN OF I_TAB_YES_DEL OCCURS 0, OBJECT LIKE ARCH_OBJ-OBJECT, TABNAME LIKE DD02V-TABNAME, TEXT LIKE DD02V-DDTEXT, END OF I_TAB_YES_DEL. DATA: BEGIN OF I_DBSTAT OCCURS 0. INCLUDE STRUCTURE DBSTATAM. DATA: END OF I_DBSTAT. DATA: BEGIN OF I_TABSZ OCCURS 0. INCLUDE STRUCTURE MSSTABSIZEINFO. DATA: END OF I_TABSZ. DATA: BEGIN OF I_OUTPUT OCCURS 0, OBJECT LIKE ARCH_OBJ-OBJECT, TNAME LIKE I_DBSTAT-TNAME, TDESC LIKE DD02T-DDTEXT, RESERVED TYPE MSSRESSIZE, ROWS TYPE MSSNUMROWS, DATA TYPE MSSDATASIZE, INDEX TYPE MSSINDEXSIZE, UNUSED TYPE MSSUNUSEDSIZE, END OF I_OUTPUT. DATA: BEGIN OF TABDSC OCCURS 1, TABNAME LIKE DD02T-TABNAME, DDTEXT LIKE DD02T-DDTEXT, END OF TABDSC.

DATA: WA_TABDSC LIKE LINE OF TABDSC. DATA: I_OBJECT_TABLES TYPE ADK_CCMS_TABLE OCCURS 0. DATA: WA_OBJECT_TABLES TYPE ADK_CCMS_TABLE. DATA: V_ARCOBJ LIKE ARCH_OBJ-OBJECT. DATA: FNAME TYPE STRING. PARAMETERS FILENAME TYPE IBIPPARMS-PATH. *---> selection criteria - archive object SELECT-OPTIONS A_OBJECT FOR ARCH_OBJ-OBJECT. *---> Output filename

LOOP AT I_OBJECT_TABLES INTO WA_OBJECT_TABLES. REFRESH I_DBSTAT. I_TAB_YES_DEL-OBJECT = I_TAB_AOBJ-OBJECT . PERFORM BROWSE_FILE. I_TAB_YES_DEL-TABNAME = WA_OBJECT_TABLES-TABNAME. ENDIF. APPEND I_TAB_YES_DEL. APPEND I_TAB_AOBJ. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. IF SY-SUBRC <> 0. *---> get the list of tables that comprise the arhive object IF NOT I_TAB_AOBJ[] IS INITIAL.AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILENAME. START-OF-SELECTION. *--> find size of each table that comprise the archive object LOOP AT I_TAB_YES_DEL. MOVE I_TAB_YES_DEL-TABNAME TO I_DBSTAT-TNAME. ENDSELECT. CALL FUNCTION 'ADK_CCMS_GET_TABLES' EXPORTING OBJECT = I_TAB_AOBJ-OBJECT DELETE_TABLES_ONLY = '' TABLES OBJECT_TABLES = I_OBJECT_TABLES EXCEPTIONS OBJECT_NOT_FOUND = 1 OTHERS = 2 . MOVE I_TAB_YES_DEL-OBJECT TO V_ARCOBJ. ENDIF. SELECT TABNAME DDTEXT INTO CORRESPONDING FIELDS OF TABLE TABDSC FROM DD02T FOR A LL ENTRIES IN I_TAB_YES_DEL WHERE TABNAME = I_TAB_YES_DEL-TABNAME AND DDLANGUAGE = 'E'. APPEND I_DBSTAT. LOOP AT I_TAB_AOBJ. I_TAB_YES_DEL-TEXT = WA_OBJECT_TABLES-TEXT. *---> check the input SELECT OBJECT INTO I_TAB_AOBJ FROM ARCH_OBJ WHERE OBJECT IN A_OBJECT. SORT TABDSC ASCENDING BY TABNAME. ENDLOOP. ENDLOOP. CALL FUNCTION 'DB_TABLE_DATA_READ' " online lesen TABLES DBSTAT = I_DBSTAT EXCEPTIONS NO_DATA_FOUND = 2 " online nicht gefunden . REFRESH I_OBJECT_TABLES.

I_OUTPUT-ROWS = I_TABSZ-ROWS. 30 SY-VLINE.90 'Reserved Size(KB)' COLOR 4. 15 SY-VLINE. LOOP AT I_DBSTAT. IF sy-subrc <> 0. I_OUTPUT-TDESC = WA_TABDSC-DDTEXT. ENDLOOP.112 'No. APPEND I_OUTPUT.OTHERS = 3.32 'TABLE DESCRIPTION' COLOR 3. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. I_OUTPUT-RESERVED = I_TABSZ-RESERVED. 110 SY-VLINE. ENDIF. I_OUTPUT-INDEX = I_TABSZ-INDEX. *---> write output to screen ULINE: /(198).Records' COLOR 2. I_OUTPUT-DATA = I_TABSZ-DATA. ENDIF. TABNAM = I_DBSTAT-TNAME. WRITE : /1 SY-VLINE. I_OUTPUT-UNUSED = I_TABSZ-UNUSED.Of. IF SY-SUBRC = 0. READ TABLE TABDSC INTO WA_TABDSC WITH KEY TABNAME = I_DBSTAT-TNAME BINARY SEARCH . ENDLOOP. I_OUTPUT-OBJECT = V_ARCOBJ. ELSE.17 'TABLE NAME' COLOR 1.3 'OBJECT' COLOR 5. I_OUTPUT-TNAME = I_DBSTAT-TNAME. CLEAR I_TABSZ. . CALL FUNCTION 'MSS_GET_TABLE_SIZE_INFO' EXPORTING table_name = TABNAM IMPORTING TABLE_SIZEINFO = I_TABSZ EXCEPTIONS NOT_RUNNING_ON_MSSQL = 1 DB_ERROR = 2 INTERNAL_ERROR = 3 DB_NOT_FOUND = 4 NO_DB_ACCESS = 5 SCHEMA_NOT_FOUND = 6 INVALID_INPUT = 7 TABLE_NOT_FOUND = 8 OTHERS = 9 . 88 SY-VLINE.

ULINE: /(198).132 SY-VLINE. 176 SY-VLINE. endform. FNAME = FILENAME.112 I_OUTPUT-ROWS. 154 SY-VLINE.32 I_OUTPUT-TDESC. CALL FUNCTION 'F4_FILENAME' EXPORTING PROGRAM_NAME = SYST-CPROG DYNPRO_NUMBER = SYST-DYNNR FIELD_NAME = 'FILENAME' IMPORTING FILE_NAME = FILENAME . 132 SY-VLINE. WRITE : /1 SY-VLINE. 176 SY-VLINE. LOOP AT I_OUTPUT. " BROWSE_FILE .17 I_OUTPUT-TNAME. 110 SY-VLINE.156 I_OUTPUT-INDEX.178 'Unused Size(KB)' COLOR 1. 198 SY-VLINE. 198 SY-VLINE. *---> write output to file CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD EXPORTING FILENAME = FNAME FILETYPE = 'DAT' WRITE_FIELD_SEPARATOR = 'X' CHANGING DATA_TAB = I_OUTPUT[] EXCEPTIONS FILE_WRITE_ERROR = 1 NO_BATCH = 2.90 I_OUTPUT-RESERVED.134 I_OUTPUT-DATA.p2 text *----------------------------------------------------------------------* form BROWSE_FILE . 154 SY-VLINE.156 'Indexes size(KB)' COLOR 7. *&---------------------------------------------------------------------* *& Form BROWSE_FILE *&---------------------------------------------------------------------* * text *----------------------------------------------------------------------* * --> p1 text * <-. ENDLOOP.134 'Data Size(KB)' COLOR 6.3 I_OUTPUT-OBJECT. 15 SY-VLINE. 88 SY-VLINE.178 I_OUTPUT-UNUSED. 30 SY-VLINE. ULINE: /(198).

Sign up to vote on this title
UsefulNot useful