Skip to Content
0
Former Member
Apr 09, 2010 at 11:34 AM

" Can not interpret the data in file " error while uploading the data in DB

1235 Views

Dear All ,

After running the below report I am getting the " Can not interpret the data in file " error.

Need to upload the data in DB through excel or .txt file.

Kindly advise to resolve the issue.

REPORT ZTEST_4.

data : it like ZPRINT_LOC occurs 0 with header line,

FILETABLE type table of FILE_TABLE,

wa_filetable like line of filetable,

wa_filename type string,

rc type i.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG

CHANGING

FILE_TABLE = filetable

RC = rc.

IF SY-SUBRC = 0.

read table filetable into wa_filetable index 1.

move wa_filetable-FILENAME to wa_filename.

Else.

Write: / 'HI'.

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

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

ENDIF.

start-of-selection.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = wa_filename

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

TABLES

DATA_TAB = it.

IF SY-SUBRC = 0.

Write: / 'HI'.

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

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

ENDIF.

insert ZPRINT_LOC from table it.

if sy-subrc = 0.

commit work.

else.

rollback work.

endif.

Regards

Machindra Patade

Edited by: Machindra Patade on Apr 9, 2010 1:34 PM