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 exception

Former Member
0 Likes
832

Hi all

Please solve this problem.I am writing this code in my program to get the data from Excel or Tab delimited file.But i am getting the exception as BAD DATA FORMAT.

call function 'GUI_UPLOAD'

exporting

filename = 'c:\temp\websure.xls'

  • FILETYPE = 'DAT'

HAS_FIELD_SEPARATOR = 'X'

HEADER_LENGTH = 0

  • READ_BY_LINE = 'X'

  • DAT_MODE = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • CHECK_BOM = ' '

  • VIRUS_SCAN_PROFILE =

  • NO_AUTH_CHECK = ' '

IMPORTING

FILELENGTH = lv_filelength

  • HEADER =

tables

data_tab = lt_zobj_insp

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 <> 0.

WRITE 'Error occured while transfering data from input file.'.

ENDIF.

Thank you.

Regards

Giri.

3 REPLIES 3
Read only

Former Member
0 Likes
520

see excel has different format .

its not in the same format as txt file

the data is stored in

R X C

rows by columns style .

u need to use Fm <b>ALSM_EXCEL_TO_INTERNAL_TABLE</b> to fetch the data.

regards,

vijay

Read only

Former Member
0 Likes
520

Uncomment the filetype parameters. Also save your file as a tab delemited file. This will give it a .txt extension.

Read only

Former Member
0 Likes
520

you have to uncomment file_type = 'DAT' and i think file name should be given in CAPITAL letters.

regards

shiba dutta