Code: Alles auswählen.
DATA: gt_t77s0 TYPE TABLE OF t77s0,
gv_line TYPE string.
FIELD-SYMBOLS: <gs_t77s0> TYPE t77s0.
PARAMETERS: p_file TYPE localfile DEFAULT '/usr/sap/CCMS/download_t77s0.txt'.
SELECT * FROM t77s0 INTO CORRESPONDING FIELDS OF TABLE gt_t77s0.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT gt_t77s0 ASSIGNING <gs_t77s0>.
gv_line = |{ <gs_t77s0>-mandt }| && |, | && |{ <gs_t77s0>-grpid }| && |, | && |{ <gs_t77s0>-semid }| && |, | && |{ <gs_t77s0>-gsval }|.
TRANSFER gv_line TO p_file.
ENDLOOP.
CLOSE DATASET p_file.
WRITE: 'Datei wurde erzeugt'.