Code: Alles auswählen.
*
DATA:
wa_et_data LIKE LINE OF et_data,
ref_data_tab TYPE REF TO data.
FIELD-SYMBOLS:
<tab> TYPE ANY TABLE,
<wa_tab> TYPE ANY.
* Datenobjekt kreieren (Tabelle)
CREATE DATA ref_data_tab TYPE TABLE OF (iv_tabname).
ASSIGN ref_data_tab->* TO <tab>.
IF sy-subrc <> 0.
RAISE internal_error.
ENDIF.
* Daten aus Tabelle lesen
PERFORM get_data_from_db USING iv_tabname
CHANGING <tab>
lv_rc.
IF lv_rc = 0.
* Daten in Ausgabetabelle schreiben
LOOP AT <tab> ASSIGNING <wa_tab>.
MOVE <wa_tab> TO wa_et_data-line.
APPEND wa_et_data TO et_data. " Zeile hat den Typ CHAR3000
ENDLOOP.
ELSE.
RAISE not_found.
ENDIF.