Application Development 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: 

GUI_UPLOAD

Former Member
0 Kudos
118

I am using GUI_UPLOAD in my program,

this FM is accepting only string type file. when I am trying to upload the file, it is not reading the file at all.

Please help here...

6 REPLIES 6

Former Member
0 Kudos
86

declare a varible of string type

ex: data: VAR type string.

assign ur file path rarameter to that vaiable ...

VAR = l_file ( varibale(file path) which is ur passing to FM)..

now pass this varibale (VAR) to GUI_UPLOAD

Regards.

Ramesh.

Former Member
0 Kudos
86

GUI_UPLOAD is used to upload data into internal table which can later be used for various purposes....

In the GUI_UPLOAD, give type as 'DAT' and give file path & in tables give int'table name...When u execute, data present iin file gets uploaded to int'table...

Former Member
0 Kudos
86

Have a look to this Code..

data: begin of itab occurs 10,

casen type zsnitm-casen,

matnr type zsnitm-matnr,

fkimg type zsnitm-fkimg,

aufnr type zsnitm-aufnr,

netpr type zsnitm-netpr,

end of itab.

data w_p_infile type string.

w_p_infile = p_file.

call function 'GUI_UPLOAD'

exporting

filename = w_p_infile

filetype = 'ASC'

has_field_separator = 'X'

dat_mode = 'X'

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.

0 Kudos
86

Hi Atul,

I am doing the same way, but in program parsing technique used, it is not reading the file, ie. reading records are 0.

Please help

meikandan_krishnan2
Participant
0 Kudos
86

Hi

Look at the following code

PARAMETERS: par_pat(100) TYPE c .

DATA: str_data TYPE string.

Declare ITAB based on ur requirement.

str_data = par_pat1.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = str_data

  • FILETYPE = 'ASC'

has_field_separator = 'X'

TABLES

data_tab = itab.

Hope this will solve ur purpose.

Enjoy ur coding.....

have a nice day.

regards

mei.

Former Member
0 Kudos
86

Hi,

try this,

PARAMETERS P_FILE TYPE RLGRAP-FILENAME OBLIGATORY.

Pass this variable to the FM Gui_upload(Export parameter Filename = p_file).

and then try Upload, it works fine.

Cheers...

Santosh.

P.S. Mark usefull answers.