Tag Archives: system

Get size of database table via ABAP

Check program Check program RSTABLESIZE
or following code.

Update for BW74: FM ‘EM_GET_NUMBER_OF_ENTRIES’ import parameter has changed. see new code below.

Code up to BW 73

REPORT ZTEST_ILESH.

TABLES : DD02L.

SELECT-OPTIONS : S_TABLES FOR DD02L-TABNAME.

DATA : GT_TABROWS LIKE STANDARD TABLE OF DDCDIM,
       WA_TABROWS LIKE DDCDIM.

SELECT TABNAME
  FROM DD02L
  INTO CORRESPONDING FIELDS OF TABLE GT_TABROWS
  WHERE TABNAME IN S_TABLES.

CALL FUNCTION 'EM_GET_NUMBER_OF_ENTRIES'
  TABLES
    IT_TABLES = GT_TABROWS.

LOOP AT GT_TABROWS INTO WA_TABROWS.
  WRITE : / WA_TABROWS-TABNAME , WA_TABROWS-TABROWS.
ENDLOOP.

Code from BW74

Download – PROG_ZBC_CHECK_SYSTEM_TABLES_74.slnk] – 1.3 kB – 269   downloads

REPORT  ZBC_CHECK_SYSTEM_TABLES.

TABLES : DD02L.

SELECT-OPTIONS : S_TABLES FOR DD02L-TABNAME.

DATA : GT_TABROWS LIKE STANDARD TABLE OF DDCDIM,
       WA_TABROWS LIKE DDCDIM.

SELECT TABNAME
  FROM DD02L
  INTO CORRESPONDING FIELDS OF TABLE GT_TABROWS
  WHERE TABNAME IN S_TABLES.

CALL FUNCTION 'EM_GET_NUMBER_OF_ENTRIES'
  TABLES
    IT_TABLES = GT_TABROWS.

LOOP AT GT_TABROWS INTO WA_TABROWS.
  WRITE : / WA_TABROWS-TABNAME , WA_TABROWS-TABROWS.
ENDLOOP.

BI_DELETE_OLD_MSG_PARM_DTPTEMP – Cleanup of RSBATCHDATA

rsbatchdata

I am running SAP BW 7.3 (SAPKW73004). I recently noticed that the daily job BI_DELETE_OLD_MSG_PARM_DTPTEMP takes 60000 to 100000 seconds to complete.

Below is the result of the investigation on the issue.

——————–

SAP recommends that a daily job be run to delete old messages and parameters related to running DTPs.

This is part of a large number of recommendations to avoid having table sizes get out of hand (see note Note 706478 – Preventing Basis tables from increasing considerably, see also the list of tables of the note in excel format )
See also recent post in SCN with list of relevant notes.
Table RSBATCHDATA Too Large – How To Delete Data
This cleans up the content of table RSBATCHDATA, that otherwise grows indefinitely.

The BW sap help site recommends running daily with a deletion of messages older than 30 days.  http://help.sap.com/saphelp_nw04s/helpdata/en/48/d2a551003c04e9e10000000a42189c/content.htm

For this you need create a variant for the job to be run with the following parameters

DEL_MSG 30 – delete all records older than nnn day (M-Records)
DEL_PAR 30 – delete all records older than nnn day (R- and P-Records)
DEL_DTP ‘ ‘ – useless/no function (unused parameter as of SAPKW73004, you can see that in the)

(note that not entering parameters or entering 1 or 2 as DEL_MSG/DEL_PAR defaults to deleting records  older than 180 days).

Other terms

RSBATCH, batch manager, RSBATCH_DEL_MSG_PARM_DTPTEMP,
BI_DELETE_OLD_MSG_PARM_DTPTEMP