Skip to Content
0
Former Member
Jan 29, 2008 at 09:44 PM

Data set-Storing in CSV format

26 Views

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