Code: Alles auswählen.
Types: Begin of ty_s_test,
one type c,
two type c,
three type c,
end of ty_s_test.
Types: ty_t_teste type table of ty_s_test.
Data: lv_test type c,
lv_test2 type c.
data: ms_test type ty_s_test,
mt_test type ty_t_test
Select Feld1 Feld2 Feld3 Feld4Test Feld5Test
from dbtable
INTO CORRESPONDING FIELDS OF ms_test and (lv_test, lv_test2).
append ms_test to mt_test.
endselect.
...Code: Alles auswählen.
DATA lt_fields TYPE string_table.
TYPES: BEGIN OF my_struc,
land TYPE land1,
eg TYPE char1,
END OF my_struc.
DATA lt_data TYPE STANDARD TABLE OF my_struc.
DATA ls_data TYPE my_struc.
APPEND 'land1 as land' TO lt_fields.
APPEND 'xegld as eg' TO lt_fields.
SELECT (lt_fields) FROM t005 INTO CORRESPONDING FIELDS OF TABLE lt_data.
LOOP AT lt_data INTO ls_data.
WRITE: / ls_data-land, ls_data-eg COLOR COL_TOTAL.
ENDLOOP.