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

error while using GUI_UPLOAD

former_member654348
Participant
0 Likes
1,382

Hi

I am using GUI_UPLOAD to transfer the data from flat file ( | separated) into the internal table.

But while executing, its giving error like 'cannot interpret the data in the file'.

kindly help me out in this regard.

10 REPLIES 10
Read only

former_member632729
Contributor
0 Likes
1,040

Hi,

Check the parameters what ur passing ... exact or not...

for more info go through this link:[http://www.experts-exchange.com/Database/Software/ERP/SAP_ERP/Q_21278801.html]

Read only

Former Member
0 Likes
1,040

used HAS_FIELD_SEPARATOR in import parameters?

Read only

former_member654348
Participant
0 Likes
1,040

yes, I am exporting this parameter.

Check the code.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = filename

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

TABLES

DATA_TAB = i_tab1

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.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Read only

0 Likes
1,040

check formats of any date/time/qauntity fields in ur upload file

Read only

0 Likes
1,040

I think the filename your are passing is not of string type.

I think you are taking file from user by using f4 and so its datatype is not string but rplg-filename

so make another variable of type string and store the filename into that

Read only

0 Likes
1,040

hi,

check all the fields are matching comparing with file and internal table. and close the file when u r exicuting the program. use the following code

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

filename =

FILETYPE = 'ASC'

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 =

  • HEADER =

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

.

IF sy-subrc 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

hope it will help

~linganna

Read only

Former Member
0 Likes
1,040

you can take the table like

Types: begin of gty_texts_file,

line(500) type c,

end of gty_texts_file.

data: gt_text_file type table of gty_texts_file.

you can pass this table to your FM

Read only

RaymondGiuseppi
Active Contributor
0 Likes
1,040

I fear that GUI_UPLOAD expects a TAB(TYPE X VALUE '09') separator, not a '|'.

Regards

Read only

Former Member
0 Likes
1,040

Hi,

It is better you use Fm WS_UPLOAD.

regards,

Lokesh

Read only

Former Member
0 Likes
1,040

Hi,

check with the parameters passing in the function module like file name and file type...

Regards,

Madhu