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

Wrong file name?

Former Member
0 Likes
569

My program has a problem finding my file. Is the name wrong in some way?

CALL METHOD cl_gui_frontend_services=>gui_upload

EXPORTING

filename = 'G:\Test\Testfil_01_051004'

filetype = lc_filetype

CHANGING

data_tab = lt_transar

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.

4 REPLIES 4
Read only

Former Member
0 Likes
508

Can you tell what exactly is your error..

Also what is the value of lc_filetype and file type of Testfil_01_051004

Read only

Former Member
0 Likes
508

what is the error you are getting?

try passing the filename in a <b>string</b> type variable

example:::

TYPES:

ty_xline(1024) TYPE x.

DATA:

lf_file TYPE string,

lf_filelength TYPE i,

lt_datatab TYPE STANDARD TABLE OF ty_xline.

lf_file = file.

CALL METHOD cl_gui_frontend_services=>gui_upload

EXPORTING

filename = lf_file

filetype = 'BIN'

IMPORTING

filelength = lf_filelength

CHANGING

data_tab = lt_datatab

EXCEPTIONS

OTHERS = 1.

rgds,

PJ

Read only

Former Member
0 Likes
508

Hi,

I think you did not give the extension of the file name,

CALL METHOD cl_gui_frontend_services=>gui_upload

EXPORTING

<b>filename = 'G:\Test\Testfil_01_051004'</b>

should be

<b>filename = 'G:\Test\Testfil_01_051004.txt'</b>

OR whatever the extension of that file..

Hope this helps..

Sri

Read only

0 Likes
508

as the others suggested you need to pass it via astring variable with the extension.

Regards

Raja