‎2013 Feb 04 7:38 AM
Dear all,
I am downloading a file using GUI_download for a CSV file . Its working file in MS-ExCEL but when we open it in edit mode in notepad , each entry is
having double quotes in the beginning and end both .
please share how to resolve this issue .
regards
vaibhav
‎2013 Feb 04 7:47 AM
Hello,
During population of internal table may be concatenation of Double quote has been made to get into column wise in excel file. So, the problem lies on your internal table population if you want to download into a notepad file.
I would like to suggest you that please change your row during population and at the end of data please insert a carriage return line feed .
You can concatenate like below at the end of the line data: cl_abap_char_utilities=>cr_lf
I think this will solve your issue.
Thanks,
Abhijit
‎2013 Feb 04 7:49 AM
HI.
I hope your are converting file into CSV format by CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'. and better use 'ASC' format while doing GUI_DOWNLOAD.
Thanks.
NJ
‎2013 Feb 04 7:56 AM
Hi Vaibhav,
Have a look at these FM's
SAP_CONVERT_TO_CSV_FORMAT
SAP_CONVERT_TO_TEX_FORMAT
SAP_CONVERT_TO_TXT_FORMAT
SAP_CONVERT_TO_XLS_FORMAT
SAP_CONVERT_TO_XML_FORMAT
Hope this helps.
Thanks,
Tooshar Bendale
‎2013 Feb 04 8:01 AM
Hi,
Try to download the file into .csv format which is shown below,
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'D:\T001.CSV'
write_field_separator = ','
TABLES
data_tab = t_t001.
‎2013 Feb 04 8:03 AM
‎2013 Feb 04 8:08 AM
Are you getting the same error?
we open it in edit mode in notepad , each entry is
having double quotes in the beginning and end both .
What is write_field_separator which you have taken?
‎2013 Feb 04 8:16 AM
‎2013 Feb 04 8:16 AM
‎2013 Feb 04 8:24 AM
Its working fine for me.Even if I tried with downloaded file with .xls format and then I opened with notepad its working fine.
‎2013 Feb 04 8:59 AM
HI
LOOP AT it INTO wa.
IF sy-subrc = 0.
TRANSFER wa TO l_fname.
* transfer wa-text2 to l_fname.
ENDIF.
ENDLOOP.
* BREAK-POINT.
CLOSE DATASET l_fname.
*
*CALL FUNCTION 'GUI_DOWNLOAD'
* EXPORTING
** BIN_FILESIZE =
* filename =
* filetype = 'ASC'
* append = 'X'
* write_field_separator = ','
* show_transfer_status = abap_true
* confirm_overwrite = ' '
* TABLES
* data_tab = it
** FIELDNAMES = IT_H
* .
*IF sy-subrc <> 0.
* MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
* WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
*ENDIF.
l_fname contains filename .
please correct me for errors.
regards
‎2013 Feb 04 3:17 PM
Hi,
Do any of the fields have comma values within the data? If so, I believe the addition of the double quotes is so a front-end program that reads .csv files can determine when the commas are part of the data and when they are intended to be field separators. I would check out the data first to see if that is causing the FM to insert the double quotes.
Regards,
Ryan Crosby