2005 Aug 20 2:03 PM
hi,
i've a problem while writing the data from an internal table which consist of some 5 data to a flat file of .CSV format . All the values that are written to the flat file are displayed in the first row first column ony. Is there any method to display the values in different lines ? .
with regards.
T.Jeyagopi
2005 Aug 22 2:51 PM
hi ,
u need tab delimit and a line break at the end of each record for that u declare a variable of hexdecimal type with value '09' for tab delimit and '0D' for line break .concatenate hex- 09 between the fields and hex '0d' at end of record this may solve ur problem . remember this concatnation work only in non-unicode system . if ur working in unicode system u can use this class attr. cl_abap_char_utilities=>horizontal_tab and cl_abap_char_utilities=>cr_lf assign it to char type field itself and concatenate as said .hope this may solve ur problem .
2005 Aug 20 2:16 PM
you have concatenate all the fileds separated by a comma (,) and at the end of each record CL_ABAP_CHAR_UTILITIES=>cr_lf.
also make sure that none of your field values have comma .
Regards
Raja
2005 Aug 20 2:30 PM
Hi,
I suppose, that you are using FM 'WS_DOWNLOAD' or 'GUI_DOWNLOAD'. If you use FILETYPE = 'ASC', then all fields will be in one column. In such a case you should create a new internal table with one field, combined of all fields separated by ';'. If you use FILETYPE = 'DAT', your fields will be tab separated directly.
If you find the answer helpful, please assign reward points.
Svetlin
Message was edited by: Svetlin Rusev
2005 Aug 22 7:56 AM
Hi ,
try this:
data delimiter value ';'.
loop at itab.
...
clear string.
do.
assign component sy-index of structure itab to <f>.
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
concatenate string <f> delimiter into string.
enddo.
append string to tab_download.
...
endloop.
...
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILETYPE = 'ASC'
FILENAME = FILE
TABLES
DATA_TAB = tab_download.Andreas
2005 Aug 22 2:51 PM
hi ,
u need tab delimit and a line break at the end of each record for that u declare a variable of hexdecimal type with value '09' for tab delimit and '0D' for line break .concatenate hex- 09 between the fields and hex '0d' at end of record this may solve ur problem . remember this concatnation work only in non-unicode system . if ur working in unicode system u can use this class attr. cl_abap_char_utilities=>horizontal_tab and cl_abap_char_utilities=>cr_lf assign it to char type field itself and concatenate as said .hope this may solve ur problem .
2005 Aug 22 3:05 PM
Hi,
You can also use the delivered function module 'SAP_CONVERT_TO_CSV_FORMAT' to convert the data inside the program; and then download to the frontend or transfer to the application server as the case may be..
Good Luck,
Suresh Datti