Upload file from my C drive to SAP
I have written a program where I upload a file using FTP to update info to SAP. This program works.
I now need to change this program NOT to use FTP, but to upload the file from my laptop's "C" drive (we need to not use FTP for various reasons). I have made changes to my program for this, but it gives a sy-subrc = 4 error where the bold sentence is.
MOVE upload TO filename.
* Open the dataset
OPEN DATASET filename FOR input IN TEXT MODE.
IF sy-subrc = 8.
WRITE: 'File - "', filename, '" , could not be opened.'.
* Upload the contents of the file into internal table tbdata
READ DATASET filename INTO itab.
IF sy-subrc NE 0.
* Close the Dataset
CLOSE DATASET filename.
Can anyone see where my problem is? It is a txt file on my TEMP file in my "C" drive. Any help will really be appreciated.