06-29-2011 8:54 AM
Hi All,
I am downloading data from an internal table to an excel in my system using the FM GUI_DOWNLOAD. There are total 1032 rows. THe records from 2nd to 80th are mising in the excel whereas in the notepad all the 1032 rows are coming. Kindly let me know why this is happening.
TIA.
Regards,
Kalyan
06-29-2011 9:03 AM
Hi,
Could ypu please provide the code you are using for GUI_download.
Also, HAve you noticed some particular records which go misisng?
i mean like records having some field value in quotes?
06-29-2011 10:06 AM
Hi,
THese are parameters that I am passing to the FM. I have tried all the file types 'BIN', 'ASC' and 'DAT' but in vain. It is working fine if i download to a notepad but to excel it is not working. 2nd row to 80th row are missing.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = fullpath
filetype = 'BIN'
write_field_separator = 'X'
IMPORTING
filelength = length
TABLES
data_tab = tb_zdnt_dn[]
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
06-29-2011 10:29 AM
Hi Kalyan,
I understand that you have tried with ASC and DAT as well, but just to keep you informed
As per the documentation of GUI_DOWNLOAD WRITE_FIELD_SEPARATOR doesn't make sense in BIN file.
In the downloaded file, the columns are separated by tab characters (cl_abap_char_utilities=>horizontal_tab). You should use this setting if you want to upload the data from the file at a later time, because this is the only way of identifying individual columns.
The parameter makes sense only for the FILETYPE values ASC, DAT and IBM; for DAT it is set implicitly.
Check if the file length returned is same/different in case of notepad versus excel, my guess is, it will be different but the difference should not be significant.
IMPORTING
filelength = length
Regards,
Chen
06-29-2011 10:37 AM
Hi Kalyan,
Give me the following inputs.
FILENAME = lv_file "'C:\TEST.XLS'
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
Thanks & Regards,
Vallamuthu.M
06-29-2011 11:13 AM
Hi,
@ Chen : the value of filelength ithat is returned by the FM s the same irrespective of whether it is a .txt or .xls.
@Vallamuthu : I have tried using ur code but it didnt work.
Regards,
Kalyan
06-29-2011 1:33 PM
Hi Kalyan,
Can you provide your code?
Thanks & Regards,
Vallamuthu M
06-29-2011 1:45 PM
Hi All,
The issue is solved. The issue seems to be with the table data from which we are fetching.We have moved the program /t-code to the next system and tested it. It is working fine.
Thanks a lot for all the replies. Special thanks to to vallamuthu and Chen for the quick replies.
Regards,
Kalyan