‎2008 Mar 31 10:37 AM
Hi im using gui_upload but getting the following error:
The call to the function module "GUI_UPLOAD" is incorrect:
The function module interface allows you to specify only fields
of a particular type under "FILENAME". The field "FILENAME" specified here
has a different field type.
call function 'GUI_UPLOAD'
exporting
filename = filename
has_field_separator = '|'
filetype = 'DAT'
tables
data_tab = itab
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.
‎2008 Mar 31 10:40 AM
‎2008 Mar 31 10:40 AM
filename should be of type STRING.call function 'GUI_UPLOAD'
exporting
filename = filename
has_field_separator = '|'
* filetype = 'DAT'
tables
data_tab = itab
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.
‎2008 Mar 31 10:42 AM
FILENAME should be declared as TYPE STRING ..
I think U declared as rlgrap-filename ...
‎2008 Mar 31 11:29 AM
‎2008 Mar 31 1:17 PM
TYPES: BEGIN OF t_infile,
num TYPE c,
END OF t_infile.
DATA : filename TYPE string,
itab TYPE STANDARD TABLE OF t_infile.
filename = 'D:\TEST.txt'. "Path for uploading file
PERFORM UPLOAD.
WRITE : 'upload successful'.
FORM UPLOAD.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = filename
has_field_separator = '|'
filetype = 'DAT'
TABLES
data_tab = itab
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.
ENDFORM.
‎2008 Mar 31 10:44 AM
call function 'GUI_UPLOAD'
exporting
filename = filename
has_field_separator = '|'
..........
..............
Define filename as type of dxfile-filename.
‎2008 Mar 31 11:48 AM
‎2008 Mar 31 11:55 AM
Can you please paste the entire code here ....
Regards,
Santosh
‎2008 Mar 31 11:56 AM
Hi,
Can you please paste the whole code for this upload,?
Thanks,
Ahasan
‎2008 Mar 31 11:24 AM
Hi,
The FILENAME passed to FM GUI_UPLOAD should be a STRING variable.
Declare the FILENAME as follows:
data: filename type string.Hope this helps.
Thanks,
Balaji
‎2008 Mar 31 11:37 AM
‎2008 Mar 31 12:07 PM
I feel that in your FM gui_upload
has_field_separator = '|'
should be replace by
WRITE_FIELD_SEPARATOR = '|'