Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Upload file from my C drive to SAP

Hi

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.'.
    STOP.
  ENDIF.
  DO.

* Upload the contents of the file into internal table tbdata
    READ DATASET filename INTO itab.
   IF sy-subrc NE 0.
      EXIT.
    ENDIF.
    APPEND itab.
  ENDDO.

* 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.

Regards

Debbie

Former Member
Not what you were looking for? View more on this topic or Ask a question