Hola,
Sea cual sea la tabla interna de salida final, recórrela
DATA : begin of i_final occurs 0,
field1(20),
field2(20),
end of i_final.
DATA : v_filepath (200) TYPE c Value '/data/sapdata/test.csv' .
DATA : begin of i_file_data occurs 0,
Rec(500),
end of i_file_data.
LOOP AT i_final.
CONCATENATE i_final-field1 i_final-field2 INTO i_file_data-rec SEPARATED BY ','.
APPEND i_file_data.
CLEAR i_file_data.
ENDLOOP.
OPEN DATASET v_filepath IN OUTPUT FOR TEXT MODE.
LOOP AT i_file_data.
TRANSFER i_file_data-rec TO v_filepath.
ENDLOOP.
CLOSE v_filepath.
Para verificar el archivo, ve a Tcode
->AL11
>data/sapdata/test.csv.