REPORT ZTBLINFO LINE-SIZE 80.

TABLES: DD02L,
        DD02T,
        DD03L,
        DD04T.

DATA: BEGIN OF ITAB_TABLES OCCURS 0,
          TABNAME LIKE DD02L-TABNAME,
      END OF ITAB_TABLES.

DATA: FILEOPENCANCELLED.

SELECTION-SCREEN: COMMENT 1(80) TEXT-001, SKIP 1,
                  COMMENT 1(80) TEXT-002, SKIP 1.
PARAMETER: TBLNAME LIKE DD02L-TABNAME.

IF TBLNAME IS INITIAL.
  CALL FUNCTION 'UPLOAD'
       EXPORTING
            FILENAME = 'tablenames.txt'
       IMPORTING
            CANCEL   = FILEOPENCANCELLED
       TABLES
            DATA_TAB = ITAB_TABLES.
  IF NOT FILEOPENCANCELLED IS INITIAL.
    EXIT.
  ENDIF.
ELSE.
  CLEAR ITAB_TABLES. REFRESH ITAB_TABLES.
  ITAB_TABLES-TABNAME = TBLNAME.
  APPEND ITAB_TABLES.
ENDIF.

SORT ITAB_TABLES.
DELETE ADJACENT DUPLICATES FROM ITAB_TABLES.
TRANSLATE ITAB_TABLES-TABNAME TO UPPER CASE.

SELECT TABNAME DDTEXT FROM DD02T
       INTO CORRESPONDING FIELDS OF DD02T
       FOR ALL ENTRIES IN ITAB_TABLES
       WHERE TABNAME = ITAB_TABLES-TABNAME AND
             DDLANGUAGE = 'E'.
  FORMAT COLOR COL_KEY.
  WRITE: / 'N ' AS SYMBOL,
                DD02T-TABNAME RIGHT-JUSTIFIED, '-', DD02T-DDTEXT,
           '? ' AS SYMBOL.
  HIDE DD02T-TABNAME.
  FORMAT COLOR OFF.
  SELECT FIELDNAME ROLLNAME DATATYPE LENG DOMNAME FROM DD03L
         INTO CORRESPONDING FIELDS OF DD03L
         WHERE TABNAME = DD02T-TABNAME.
    SELECT DDTEXT FROM DD04T
           INTO CORRESPONDING FIELDS OF DD04T
           WHERE ROLLNAME = DD03L-ROLLNAME AND
                 DDLANGUAGE = 'E'.
      WRITE: /
            DD03L-FIELDNAME, DD03L-ROLLNAME,
            DD03L-DATATYPE, DD03L-LENG NO-ZERO,
            DD03L-DOMNAME, (35) DD04T-DDTEXT.
    ENDSELECT.
  ENDSELECT.
  ULINE.
ENDSELECT.
CLEAR DD02T-TABNAME.

AT LINE-SELECTION.
  IF NOT DD02T-TABNAME IS INITIAL.
    call function 'RS_DD_DEF_SHOW'
        EXPORTING
            OBJNAME              = DD02T-TABNAME.
  ENDIF.
  CLEAR DD02T-TABNAME.
