Quantcast
Channel: SCN : All Content - SAP GUI
Viewing all articles
Browse latest Browse all 3616

Upload file from my C drive to SAP

$
0
0

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


Viewing all articles
Browse latest Browse all 3616


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>