[ABAP] Tabellen zu einer Transaktion auflisten

TYPES: BEGIN OF ty_data_item,
         tcode    TYPE tstc-tcode,
         ttext    TYPE tstct-ttext,
         pgmna    TYPE tstc-pgmna,
         tabname  TYPE d010tab-tabname,
         tabclass TYPE dd02l-tabclass,
         ddtext   TYPE dd02t-ddtext,
       END OF ty_data_item.

DATA: it_data TYPE STANDARD TABLE OF ty_data_item WITH DEFAULT KEY.

PARAMETERS: ptcode TYPE tstc-tcode DEFAULT 'MIGO'.
PARAMETERS: plang TYPE dd02t-ddlanguage DEFAULT 'DE'.

START-OF-SELECTION.

* Holt Transaktion, Programm zur Transaktion, verwendete Tabellen im Programm
  SELECT tstc~tcode, tstct~ttext, tstc~pgmna, d010tab~tabname, dd02l~tabclass, dd02t~ddtext
    FROM tstc
      INNER JOIN d010tab ON d010tab~master = tstc~pgmna
      INNER JOIN dd02l ON dd02l~tabname = d010tab~tabname
      INNER JOIN dd02t ON dd02t~tabname = dd02l~tabname
      INNER JOIN tstct ON tstct~tcode = tstc~tcode
      INTO CORRESPONDING FIELDS OF TABLE @it_data
      WHERE tstc~tcode = @ptcode
      AND dd02t~ddlanguage = @plang
      AND tstct~sprsl = @plang.

  SORT: it_data BY tabclass DESCENDING tabname.

  DATA: o_salv TYPE REF TO cl_salv_table.

  cl_salv_table=>factory( IMPORTING
                            r_salv_table = o_salv
                          CHANGING
                            t_table = it_data ).

  o_salv->get_functions( )->set_all( abap_true ).
  o_salv->get_display_settings( )->set_striped_pattern( abap_true ).
  o_salv->get_columns( )->set_optimize( abap_true ).

  o_salv->get_selections( )->set_selection_mode( if_salv_c_selection_mode=>row_column ).

  o_salv->display( ).