Code: Alles auswählen.
PARAMETERS: p_table TYPE tabname.
FIELD-SYMBOLS: <wa>.
DATA: rc TYPE sysubrc.
* Check auf Tabellen-Existenz
CALL FUNCTION 'DD_EXIST_TABLE'
EXPORTING
tabname = p_table
status = 'M'
IMPORTING
subrc = rc.
if rc <> 0.
exit.
endif.
ASSIGN (p_table) TO <wa>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
SELECT * FROM (p_table) into <wa>.
WRITE:/ <wa>.
ENDSELECT.
Code: Alles auswählen.
PARAMETERS: p_table TYPE tabname.
FIELD-SYMBOLS: <wa> TYPE ANY.
DATA: rc TYPE sysubrc,
dref TYPE REF TO data.
* Check auf Tabellen-Existenz
CALL FUNCTION 'DD_EXIST_TABLE'
EXPORTING
tabname = p_table
status = 'M'
IMPORTING
subrc = rc.
IF rc <> 0.
EXIT.
ENDIF.
CREATE DATA dref TYPE (p_table).
ASSIGN dref->* TO <wa>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
SELECT * FROM (p_table) INTO <wa>.
WRITE:/ <wa>.
ENDSELECT.
Code: Alles auswählen.
* Variablen
PARAMETERS: p_table TYPE tabname.
FIELD-SYMBOLS: <wa>.
DATA: rc TYPE sysubrc,
dref TYPE REF TO data.
* Check auf Tabellen-Existenz
CALL FUNCTION 'DD_EXIST_TABLE'
EXPORTING
tabname = p_table
status = 'M'
IMPORTING
subrc = rc.
IF rc <> 0.
EXIT.
ENDIF.
* Work-Area wird definiert
CREATE DATA dref TYPE (p_table).
ASSIGN dref->* TO <wa>.
IF sy-subrc <> 0.
EXIT.
ENDIF.
* Select/Update der Tabelle mit Hilfe der TWX2
SELECT * FROM (p_table) INTO CORRESPONDING FIELDS OF <wa>.
WRITE:/ <wa>.
ENDSELECT.