‎2009 Dec 08 12:07 PM
Hi Everyone,
I have a file and i want to upload this with GUI_UPLOAD. but some lines of this file has more than 256 characters (eg 320) and lines of the file is not TAB delimited. When i try to upload the file it cuts the line from 256th ch. Can anyone help about this?
Thanks ...
‎2009 Dec 08 12:11 PM
Hi,
Try this fm CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = 'X'
i_tab_raw_data = it_rawdata
i_filename = p_xlfile
TABLES
i_tab_converted_data = <dyn_table>
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Regards,
PRashant
‎2009 Dec 08 12:15 PM
Hi Prashant;
this FM cant solve the problem i think.
one of the line is :
1;10003000000006;10003[3];10037[10003[3];1];19;01/05/2009 09:08:59;
10003000000004[3307];;0;0; 7;01/05/2009
09:09:56;0[];2008380000048887;31;2,2001;0;0;0;0;;;10003000000000[10003[3];
10037[10003[3];1];490;01/05/2009 21:50:30];0[];0
[];;;0;01/05/2009 10:59:00;1[];01/05/2009 10:59:00;1[];10003[];10003[];1this is only one line
Edited by: Matt on Dec 8, 2009 1:21 PM - fixed formatting
‎2009 Dec 08 12:24 PM
cl_gui_frontend_Services=>GUI_UPLOAD just wraps the function module GUI_UPLOAD, so while, yes, you should use it, it won't fix the problem.
I dealt with this problem a few years ago by uploading the file as filetype BIN, rather than text, then splitting the resultant data by carriage return, into an internal table.
matt
‎2009 Dec 08 12:30 PM
hi matt when i set the filetype to 'BIN' the result is :
u3B31u3031u3030u3033u3030u3030u3030u3630u313Bu3030u3330...Edited by: Matt on Dec 8, 2009 1:39 PM - removed formatting corrupting symbols
‎2009 Dec 08 12:40 PM
‎2009 Dec 08 12:47 PM
Hi Matt;
my itab
data: file_content type table of flt_text.
* flt_text = char400upload func
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = file_name
filetype = 'BIN'
CHANGING
data_tab = file_content
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
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19.one of the line
1;10003000000006;10003[3];10037[10003[3];1];19;01/05/2009 09:08:59;10003000000004[3307];;0;0; 7;
01/05/2009 09:09:56;0[];2008380000048887;31;2,2001;0;0;0;0;;;10003000000000[10003[3];10037[10003[3];1];490;
01/05/2009 21:50:30];0[];0[];;;0;01/05/2009 10:59:00;1[];01/05/2009 10:59:00;1[];10003[];10003[];1i want to see this line.
‎2009 Dec 08 12:55 PM
Hi!
What about raising the size of your table field?
TYPES: BEGIN OF t_tab,
line(1000) TYPE c,
END OF t_tab.
DATA: file_content TYPE STANDARD TABLE OF t_tab,
file_line LIKE LINE OF file_content.Regards
Tamá
‎2009 Dec 08 1:24 PM
‎2009 Dec 08 1:36 PM
Hi,
Try this.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = FILE_NAME
filetype = 'ASC' " type ASC
tables
data_tab = data_all.
or you can try this with declarin length perhaps..
types: begin of ty_dw,
i_length(600) type C,
end of ty_dw.
data: dw type table of ty_dw.
data: typety type STRING.
typety = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = typety
FILETYPE = 'ASC'
TABLES
DATA_TAB = down
‎2009 Dec 08 1:50 PM
‎2009 Dec 08 3:30 PM
>
> Hi Matt;
>
> my itab
>
>
1;10003000000006;10003[3];10037[10003[3];1];19;01/05/2009 09:08:59;10003000000004[3307];;0;0; 7; > 01/05/2009 09:09:56;0[];2008380000048887;31;2,2001;0;0;0;0;;;10003000000000[10003[3];10037[10003[3];1];490; > 01/05/2009 21:50:30];0[];0[];;;0;01/05/2009 10:59:00;1[];01/05/2009 10:59:00;1[];10003[];10003[];1>
> i want to see this line.
Yes but WHERE do you want to see this? In the debugger, with a write statement, AL11, what?
‎2009 Dec 08 12:13 PM
Hi!
Try using cl_gui_frontend_Services=>GUI_UPLOAD method instead.
Regards
Tamá
‎2009 Dec 08 12:44 PM
Hi,
try this:
DATA: IT_ITAB TYPE TABLE OF STRING.
*
CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD
EXPORTING
FILENAME = 'C:\TEST.TXT'
CHANGING
DATA_TAB = IT_ITAB[].
regards, Dieter