Skip to Content
0
Former Member
Aug 01, 2008 at 06:03 AM

Problem uploading data from an excel file using 'GUI_UPLOAD'

235 Views

Hi gurus,

I am in a need to upload data from an excel file.

I tried using 'GUI_UPLOAD' function , but the file is not being opened.

I am getting an exception message that 'file open error'.

I am giving the file type as 'XLS' , I have tried using file types as 'BIN' and 'DAT' , but still not working.

This is what i am giving,

DATA : it_lum TYPE TABLE OF z0pm_u9_vm_lum,

it_brkt TYPE TABLE OF z0pm_u9_vm_brkt,

file_name TYPE string.

file_name = 'E:\ZQRY_IPOWER_Z0PM_U9_VM_LUM'.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename = file_name

filetype = 'XLS'

TABLES

data_tab = it_lum

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

.

IF sy-subrc EQ 0.

MODIFY z0pm_u9_vm_lum FROM TABLE it_lum.

WRITE : / ' UPLOAD SUCCESS ' .

ENDIF.

Any pointers on this, will be really appreciated.

Thanks in advance.

Yatin.