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

Gui Upload

Former Member
0 Likes
503

Hi Gurus,

I have uploaded one file using Gui Upload which was pipe delimited and for this I have written the following code.

Call function 'GUI_UPLOAD'

EXPORTING

filename = 'C:\Documents and Settings\rajeevgupta\My Documents\1020Header_testdata'

TABLES

data_tab = it_tab_hdr

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.

loop at it_tab_hdr into it_tab_hdr1.

split it_tab_hdr1 at '|' into it_dat_hdr-mode1

it_dat_hdr-progid

it_dat_hdr-vkorg

it_dat_hdr-vtweg

it_dat_hdr-spart

append it_tab_hdr1.

endloop.

Can you just tell me whether I have done this thing right or wrong, and if you have any suggestion do let me know.

Thanks and regards

Rajeev Gupta

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
465

Hi Rajeev,

There is nothing wrong in the code.

Only try to define variable clearly such as

it_tab_hdr1 is a work area so you should define it as ls_tab_hdr OR wa_tab_hdr.

Regards,

Atish

3 REPLIES 3
Read only

Former Member
0 Likes
466

Hi Rajeev,

There is nothing wrong in the code.

Only try to define variable clearly such as

it_tab_hdr1 is a work area so you should define it as ls_tab_hdr OR wa_tab_hdr.

Regards,

Atish

Read only

0 Likes
465

ok thanks for the reply.

I have a small question, I mean GUI Upload is basically used to upload those files those are pipe delimited, then is it required to split the file as I did in the above code.

Thanks

Rajeev Gupta

Read only

0 Likes
465

Hi Rajeev,

GUI_UPLOAD will be used to any kind of delimited file may be pipe or tab separated. But it dependss on your defination of internal table also. Now if you defined internal table with only one field and then you are separting all the data using internal table then it is also OK.

Regards,

Atish