‎2008 Jan 29 9:44 PM
Hi,
I can save my file to a text file but I want to store it in a CSV file.
Each Field should be under diffrent column.
How can achieve this?
Following code brings it to only single column.
CONCATENATE '
TEST\' sy-sysid '\FILE\' sy-datum '.txt' INTO p_file.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
LOOP AT t_output.
TRANSFER t_output-vtext TO p_file.
ENDLOOP.
CLOSE DATASET p_file.
IF sy-subrc NE 0.
MESSAGE 'Error closing the File' TYPE 'E'.
EXIT.
.
ELSEIF sy-subrc IS INITIAL.
WRITE : 'Everything OK!!!!, File saved in the Location' COLOR COL_POSITIVE , p_file.
ENDIF.
Rgds
Praveen
‎2008 Jan 29 9:59 PM
Hello Praveen
Use the function module SAP_CONVERT_TO_CSV_FORMAT to convert your itab data to the .csv format. Do not use a filename for download.
Now you can loop over this converted itab data and store the file on your application server.
Regards,
Uwe