[ABAP] Größe einer DB-Tabelle in kB

* Datenbank             Kürzel   Funktionsbaustein
* Adabas/SAP DB         ada/sdb  GET_TABLE_SIZE_ADA
* Microsoft SQL Server  mss      GET_TABLE_SIZE_MSS
* Oracle                ora      GET_TABLE_SIZE_ORA
* IBM DB2/390           db2      GET_TABLE_SIZE_DB2
* IBM DB2/400           db4      GET_TABLE_SIZE_DB4
* IBM DB2 UDB           db6      GET_TABLE_SIZE_DB6
* Informix              inf      GET_TABLE_SIZE_INF
* Sybase ASE            syb      GET_TABLE_SIZE_ALL
* HANA Database         hdb      GET_TABLE_SIZE_ALL

* Beispiel für SAP DB
DATA: lv_tabsize TYPE sy-ccurs.
DATA: lv_table_fragmented TYPE dbstatc-activ.

CALL FUNCTION 'GET_TABLE_SIZE_ADA'
  EXPORTING
    tabname                     = 'MARA'
*   OWNER_NAME                  = ' '
    data_space_only             = abap_false
  IMPORTING
    tabsize                     = lv_tabsize
    table_fragmented            = lv_table_fragmented
  EXCEPTIONS
    no_database_table           = 1
    call_get_db_info_ada_failed = 2
    table_not_found             = 3
    no_entry_found              = 4
    sel_dbparameters_ada_failed = 5
    OTHERS                      = 6.

IF sy-subrc = 0.
  WRITE: / lv_tabsize.
  WRITE: / lv_table_fragmented.
ENDIF.