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: 

Error while uploading excel file

Former Member
0 Kudos
581

Hi All,

I am using class cl_gui_frontend_services=>gui_upload, to upload an excel file for ASCII as well as for DAT format.

I am passing the following parameters to the method :

IF ascii EQ 'X'.

CALL METHOD cl_gui_frontend_services=>gui_upload

EXPORTING

filename = gv_filename

filetype = 'ASC'

has_field_separator = space

CHANGING

data_tab = inputdata_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

not_supported_by_gui = 17

error_no_gui = 18

others = 19

ELSEIF dat EQ 'X'.

CALL METHOD cl_gui_frontend_services=>gui_upload

EXPORTING

filename = gv_filename

filetype = 'DAT'

has_field_separator = 'X'

CHANGING

data_tab = inputdata_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

not_supported_by_gui = 17

error_no_gui = 18

others = 19.

endif.

In both the cases it is giving junk characters in the inetrnal table 'inputdata_tab'.

I tried without using the separator also but still sam eerror.

Can anyone please help me out of this.

Thanks in Advance.

Sunanda.

3 REPLIES 3

Former Member
0 Kudos
85

Hi Sunanda,

Kindly go through this link below link, have posted one wiki on this topic:

https://www.sdn.sap.com/irj/scn/wiki?path=/display/abap/upload%252bexcel%252bdocument%252binto%252bi...

Hope it helps

Regrds

Mansi

Former Member
0 Kudos
85

hi,

You an convert data to ASCII using the function module QADB_DOCU_CONVERT_TO_ASCII.

CALL METHOD cl_gui_frontend_services=>gui_upload

EXPORTING

filename = 'C:\temp\text.xls'

filetype = 'ASC'

has_field_separator = '|'

CHANGING

data_tab = itab

IF sy-subrc = 0.

WRITE:/ 'success'.

ENDIF.

thanks

Former Member
0 Kudos
85

check the strucure of ur internal table,

the input file structure must same as the internal table