2009 Feb 20 6:11 AM
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.
Hi,
check with the parameters passing in the function module like file name and file type...
Regards,
Madhu
2009 Feb 20 6:15 AM
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]
2009 Feb 20 6:22 AM
2009 Feb 20 6:25 AM
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.
2009 Feb 20 6:40 AM
check formats of any date/time/qauntity fields in ur upload file
2009 Apr 02 3:33 PM
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
2009 Apr 03 5:54 AM
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
2009 Feb 20 8:22 AM
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
2009 Feb 20 8:42 AM
2009 Feb 23 7:51 AM
2009 Feb 23 9:41 AM
Hi,
check with the parameters passing in the function module like file name and file type...
Regards,
Madhu
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |