I have a database table ztab_sal that has the following fields
I am using UPLOAD_FILES function module to load a spreadsheet into ztab_sal. I have tried various things but it fails on me miserably. Following is the code I use..
data: fitab like RLGRAP occurs 0 with header line.
data: itab like ZTAB_SAL occurs 0 with header line.
fitab-FILENAME = name.
call function 'UPLOAD_FILES'
exporting I_TRUNCLEN = ' '
I_FILETYPE = type
I_XPC = 'X'
tables FILE_ALL = itab
TAB_FILE = fitab.
I take user input for filename and filetype. Say "load" is the name of the file then I have tried c:\load.xls and c:\load.csv filenames with every possible combination of filetype (ASC to DAT). Everytime the error is "Error Reading file". I tried to debug, it goes into GUI_UPLOAD function module well but somewhere it's missing something. Can anyone help me with this? Thanks for your inputs.