Skip to Content
author's profile photo Former Member
Former Member

RFC_REMOTE_FILE

Hi together,

Since SAP removed fb RFC_REMOTE_FILE.....

Is there any other suitable fb in higher releases? (...or any other approaches)

Thanks for any help

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Dec 14, 2015 at 04:49 PM

    Hi Gerd,

    what do you mean with "in higher releases"? The function module RFC_REMOTE_FILE has never been defined on ABAP side. It only existed on C/C++ side in the program rfcexec.exe (contained in the classic RFC SDK). It has been removed from the RFC SDK because of security reasons: as rfcexec was present in every R/3 installation, it was kind of difficult to prevent unauthorized access to it. (Not every SAP user should be allowed to read and write files in the R/3 installation directory... And if a sys admin is not careful, he can easily open that door by a misconfiguration of the ACL files.)

    One option for you would then be: just write your own "replacement" for rfcexec. You can then limit its functionality, install it only on the host, where files need to be read/written, implement additional security checks (e.g. you could implement it so that only files in one particular directory can be read/written), etc.

    And nowadays you are not limited to C/C++: you can also write such a program in Java (using JCo) or in .NET (using NCo).

    Or if you are an "ABAP-only" guy and only need to access files on the local application server, you could use the ABAP statement "OPEN DATASET" instead of making a call to RFC_REMOTE_FILE.

    Best Regards, Ulrich

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Gerd,

      the problem is, that this FM has been removed for a good reason (security), so providing "official" instructions on how to recreate it, would be a bit contra-productive...

      I could post some sample code, which provides the basic skeletton of an RFC server program implementing RFC_REMOTE_FILE and which you would have to complete with the necessary security checks and other details, etc.

      However, before we do this, here is another idea, which might be even simpler: if you want to transfer a file to an external server, can you perhaps use FTP? For this, two steps would be necessary:

      1. Start and configure an FTP server on the target host, if none is yet running. (In most Linux/Unix installations a standard FTP server is already present. It may only need to be activated and configured with regard to which user is allowed read/write access to which directories. For Windows Server, an FTP server is part of the IIS installation. There are also many freeware versions available.)
      2. On ABAP side use FMs FTP_CONNECT, FTP_R3_TO_SERVER, FTP_DISCONNECT, etc. A nice summary of this mechanism can be found here: http://wiki.scn.sap.com/wiki/display/ABAP/The+SAPFTP+Library+-+FTP+Programming+in+ABAP

      Best Regards, Ulrich

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.