Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Error Gui_upload

Former Member
0 Likes
2,080

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.

12 REPLIES 12
Read only

Former Member
0 Likes
1,371

hi declare file name as below


DATA: FILENAME TYPE STRING. 

Read only

Former Member
0 Likes
1,371
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.

Read only

Former Member
0 Likes
1,371

FILENAME should be declared as TYPE STRING ..

I think U declared as rlgrap-filename ...

Read only

0 Likes
1,371

Even if its type is string...its giving me the same error.

Read only

0 Likes
1,371

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.

Read only

Former Member
0 Likes
1,371

call function 'GUI_UPLOAD'

exporting

filename = filename

has_field_separator = '|'

..........

..............

Define filename as type of dxfile-filename.

Read only

0 Likes
1,371

problem still persists.

Read only

0 Likes
1,371

Can you please paste the entire code here ....

Regards,

Santosh

Read only

0 Likes
1,371

Hi,

Can you please paste the whole code for this upload,?

Thanks,

Ahasan

Read only

Former Member
0 Likes
1,371

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

Read only

Former Member
0 Likes
1,371

call this fm at start-of-selection

Read only

Former Member
0 Likes
1,371

I feel that in your FM gui_upload

has_field_separator = '|'

should be replace by

   WRITE_FIELD_SEPARATOR           = '|'