hey
when i try to compile below GUI_UPLOAD method, i get below error
"ITAB IS NOT TYPE-COMPATIBLE WITH FORMAL PARAMETER DATA_TAB."
i declared internal table as below.
DATA: BEGIN OF ITAB OCCURS 0,
TRKORRNUM LIKE ZMW0001-TRKORRNUM,
CLIENT LIKE ZMW0001-CLIENT,
IMPORTDAY TYPE STRING,
CONVERTFILENAME LIKE ZMW0001-CONVERTFILENAME,
TRANSNO LIKE ZMW0001-TRANSNO,
EXETIMING LIKE ZMW0001-EXETIMING,
PRETRKORRNUM LIKE ZMW0001-PRETRKORRNUM,
MEMO LIKE ZMW0001-MEMO,
END OF ITAB.
CALL METHOD TEST->GUI_UPLOAD
EXPORTING
filename = Sourcepath
FILETYPE = 'ASC'
has_field_separator = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
IMPORTING
FILELENGTH =
HEADER =
CHANGING
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.
SYST FIELDS ARE NOT SET BY THIS FUNCTION SO DISPLAY THE ERROR CODE *
IF sy-subrc <> 0.
MESSAGE E001.
ENDIF.
could you please tell why.
ambichan.
You can not directly upload the file into your internal table. My suggestion is to upload into a flat structured internal table. Then loop at that internal table and parse out the string into your fields of the other internal table. You are getting that error message because you must define you internal table to be compatiable with the DATA_TAB parameter of the method.
Regards,
Rich Heilman
Does the file have to be csv, because if you convert it to tab delimeted I belive your original code will work. see http://www.sapdevelopment.co.uk/file/file_uptabpc.htm
Mart
Add a comment