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: 

*'cannot interpret data in file'*

Former Member
0 Kudos

Hi,

I am uploading an .txt flat file with Gui_upload function module and passing an internal table in this fuunction module.

but on executing it gives error 'cannot interpret data in file' .

below is strucure of my internal table : -

_______________________

TYPES : BEGIN OF t_record ,

mandt type mandt,

werks like marc-werks ,

matnr like mara-matnr ,

maktx like makt-maktx ,

labst like mard-labst ,

END OF t_record .

And here is my flat file data seperated by tab.

uk 11000 chair 10

swis 11001 table 20

__________________________

Can anyone tell me whats the problem.

Regards,

3 REPLIES 3

Former Member
0 Kudos

Hi,

1st : search SDN with the error "cannot interpret data in file"...

2nd : Create a excel file with the data you specified and save the file as tab delimited text file

Now try again to upload. Do not forget to pass field_separator export parameter as 'X'.

2.b. Use charater type variables in the types statement and try uploading again.

eg : waers(4) type c. But not waers type pa0001-waers

3rd : if you still get error, paste your call function code here....

KR

Veeranji Reddy P.

Edited by: Veeranji Reddy on Jul 30, 2010 5:05 PM

Former Member
0 Kudos

Hi,

Use tab seperator between input data and try to upload.

Regards,

Lokeswari.

Former Member
0 Kudos

Hello,

Please use the foolowing code.

TYPES : BEGIN OF t_record ,

mandt type mandt,

werks like marc-werks ,

matnr like mara-matnr ,

maktx like makt-maktx ,

labst like mard-labst ,

END OF t_record .

data:it_rec type table of t_record with header line.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'C:\Documents and Settings\sriramyag\Desktop\TEST.txt'

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 = VIRUS_SCAN_PROFILE

  • NO_AUTH_CHECK = ' '

  • IMPORTING

  • FILELENGTH = FILELENGTH

  • HEADER = HEADER

TABLES

DATA_TAB = it_rec

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.

Thanks.

Ramya.