Table Rows
Usage
- This tool can be used to get the cardinality (number of rows) of Table
- Can be used to quickly check row count of Cube tables after a dimension table cleanup
- Cardinality of table in DB02 & SAP_INFOCUBE_DESIGNS is reflected only after a runstat.
User Interface
Find the Dim Tables for a Cube by using wild cards
Copy the Tables from F4
Paste
Execute
Output:
Cardinality of each table
Code
Copy paste this code in an executable program.
Code |
---|
*&———————————————————————* *& Report Z_BW_TABLE_RECORDS *& *&———————————————————————* *& *& *&——————————————————————–&* *& ABAP Name : Z_BW_TABLE_RECORDS &* *& Changed By : Rahul R Nair &* *& Created On : 11/03/2011 &* *& Version : 1.0 &* *& Description : This program can be used to generate the number of &* *& records in a table. &* *& &* *& Use : &* *& The cube dimension table size will be reflected &* *& in program SAP_INFOCUBE_DESIGNS after a run stat. &* *& &* *& Reduction in cube dimension table size can be &* *& checked immediately using this program. &* *&———————————————————————* REPORT Z_BW_TABLE_RECORDS. *$*********************************************************************** *$*$ TABLES *$*$********************************************************************* TABLES : DD02L. TYPE-POOLS : SLIS, ICON. *$*********************************************************************** *$*$ DATA DECLARATION *$*$********************************************************************* DATA : IT_TABS TYPE STANDARD TABLE OF DDCDIM, WA_TABS TYPE DDCDIM. DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV, WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV. “FIELD CATALOG DATA : LV_ERR_MSG TYPE STRING. *$*********************************************************************** *$*$ SELECTION SCREENS *$*$********************************************************************* SELECTION-SCREEN BEGIN OF BLOCK SB1 WITH FRAME TITLE TEXT–T01. SELECT-OPTIONS : SO_TABS FOR DD02L–TABNAME NO INTERVALS. SELECTION-SCREEN END OF BLOCK SB1. *$*********************************************************************** *$*$ SELECTION SCREEN HOW TO *$*$********************************************************************* SELECTION-SCREEN : BEGIN OF BLOCK SB2 WITH FRAME TITLE TEXT–T40. SELECTION-SCREEN COMMENT /1(79) TEXT–T41. SELECTION-SCREEN COMMENT /1(79) TEXT–T42. SELECTION-SCREEN COMMENT /1(79) TEXT–T43. SELECTION-SCREEN COMMENT /1(79) TEXT–T44. SELECTION-SCREEN COMMENT /1(79) TEXT–T45. SELECTION-SCREEN COMMENT /1(79) TEXT–T46. SELECTION-SCREEN COMMENT /1(79) TEXT–T47. SELECTION-SCREEN COMMENT /1(79) TEXT–T48. SELECTION-SCREEN COMMENT /1(79) TEXT–T49. SELECTION-SCREEN END OF BLOCK SB2 . *$*********************************************************************** *$*$ DATA PROCESSING *$*$********************************************************************* LOOP AT SO_TABS. CONDENSE SO_TABS–LOW. CLEAR WA_TABS. WA_TABS–TABNAME = SO_TABS–LOW. APPEND WA_TABS TO IT_TABS. ENDLOOP. IF IT_TABS[] IS NOT INITIAL. CALL FUNCTION ‘EM_GET_NUMBER_OF_ENTRIES’ TABLES IT_TABLES = IT_TABS . IF SY–SUBRC = 0. “********************************************************** “DISPLAY WA_FIELDCAT–COL_POS = 1. WA_FIELDCAT–KEY = ‘X’. WA_FIELDCAT–FIELDNAME = ‘TABNAME’. WA_FIELDCAT–REPTEXT_DDIC = ‘Table’. WA_FIELDCAT–OUTPUTLEN = 15. WA_FIELDCAT–TABNAME = ‘IT_TABS’. APPEND WA_FIELDCAT TO IT_FIELDCAT. CLEAR WA_FIELDCAT. WA_FIELDCAT–COL_POS = 2. WA_FIELDCAT–FIELDNAME = ‘TABROWS’. WA_FIELDCAT–REPTEXT_DDIC = ‘Rows’. WA_FIELDCAT–OUTPUTLEN = 15. WA_FIELDCAT–TABNAME = ‘IT_TABS’. APPEND WA_FIELDCAT TO IT_FIELDCAT. CLEAR WA_FIELDCAT. CALL FUNCTION ‘REUSE_ALV_GRID_DISPLAY’ EXPORTING I_CALLBACK_PROGRAM = SY–REPID I_GRID_TITLE = ‘Number of Records in a Table’ IT_FIELDCAT = IT_FIELDCAT TABLES T_OUTTAB = IT_TABS EXCEPTIONS PROGRAM_ERROR = 1 OTHERS = 2 . IF SY–SUBRC <> 0. CASE SY–SUBRC. WHEN 1. LV_ERR_MSG = ‘Program error during list generation.’. WHEN 2. LV_ERR_MSG = ‘Unknown error during list generation.’. ENDCASE. MESSAGE LV_ERR_MSG TYPE ‘E’. ENDIF. “DISPLAY “********************************************************** ENDIF. ENDIF. |
Text Elements
Selection Text
SO_TABS | Table |
Text Elements
T01 | Table |
T40 | Help |
T41 | This program can be used to generate the number of |
T42 | records in a table. |
T43 | |
T44 | Use : |
T45 | The cube dimension table size will be reflected |
T46 | in program SAP_INFOCUBE_DESIGNS after a run stat. |
T47 | |
T48 | Reduction in cube dimension table size can be |
T49 | checked immediately using this program. |
Acknowledgments
I would like to thank my team mates at Infosys Ravi, Anuj, Tilak, Twinkle, Priya & Karthik .
Hi Rahul:
In the screenshot that has the Title "Number of Records in a Table" there are several entries that display a negative value (-1). How can we interpret this number? Obviously, there can't be -1 records in the Tables /BI0/D0TCT_C011, /BI0/D0TCT_C012, /BI0/D0TCT_C014, /BI0/D0TCT_C16 and /BI0/D0TCT_C17.
Thanks a lot for sharing this valuable info.
Best regards,
Francisco Milan.
If you need help while activating remote desktop service windows 10 so the text file we are going to share with you setup remote desktop windows 10 will help you at every step with images.