11-19-2013 1:05 PM
Hi Iam facing one issue while uploading excel file. In my excel file some of column enteris are more than 255 chars. After uploading excel file into internal table , the excel file entries if it more than 255 chars, then it truncated to 252 chars. iam not getting exact entries( more than 255 chars) as per excel file. I tried all FM's related to Upload or excel upload related things. But no use. Could you please suugest me how to handle this problem? Regards Karthik
11-19-2013 1:14 PM
I tried all FM's related to Upload or excel upload related things.
There are so many FMs. How is it possible that you tried every available option?
When you say excel file, it could be having 2007, 2003, csv, tsv format. You need to post example input file, and the code that is not working as per expectation. That will result in faster resolution.
11-19-2013 1:19 PM
Which FM you are using for uploading . I used GUI_UPLOAD and its working fine. i uploaded file with column length 255.
TYPES: BEGIN OF demo,
data TYPE c LENGTH 315,
END OF demo.
DATA: gi_demo TYPE STANDARD TABLE OF demo,
gw_demo TYPE demo.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lv_file
filetype = 'ASC'
has_field_separator = ','
TABLES
data_tab = gi_demo
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
* Implement suitable error handling here
ENDIF.
loop at gi_demo INTO gw_demo.
lv_len = strlen( gw_demo-data ).
write lv_len.
ENDLOOP.
o/p - 255.
11-19-2013 1:36 PM
You can use GUI_UPLOAD FM to upload a file with length greater than 255. Just make sure that it is a tab delimited file to upload as an excel file.
11-19-2013 1:39 PM
Did you try some OLE2 methods, if yes which ones, and can you provide list of FM you try with no results ?
Regards,
Raymond
11-20-2013 10:49 AM
I tried the following FM's... GUI_UPLOAD, TEXT_CONVERT_XLS_TO_SAP, C13Z_UPLOAD_DIALOG, C13Z_UPLOAD, ALSM_EXCEL_TO_INTERNAL_TABLE, SX_TABLE_LINE_WIDTH_CHANGE etc.. to try and increase the field char length but got no fruitful results with different file formats .XLS(2003 and also 2007) , .CSV , .TXT All responses which can resolve the issue are appreciated.
11-20-2013 4:56 PM
hey karthik,
i used gui upload and it is working fine.the code i sent u, i uploaded csv file with 255 character.
11-21-2013 1:52 PM
Hi Ashish, it is EXCEL file, not CSV file. i tired all FM' no use. Regards Karthik
11-21-2013 1:58 PM
Can you post the input file and a non-working code as attachment?
It would get better replies.
11-21-2013 2:10 PM
11-21-2013 2:16 PM
Post your excel file and code if possible. i will try to check. As in my code .XLS is uploaded without any issues.