11-06-2015 12:33 PM
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
12-14-2015 4: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
12-14-2015 4: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
12-15-2015 7:27 AM
Hi Ulrich,
I was talking about the fact that the fm has not been available since release 4.7.
If such an fm is beeing removed it would be greate if there would be at least an official workaround!
I´d be willing to code a 'replacement' if I´d be able to use C/C++. If there would be any instruction as to how to actualize such a replacement (what tools do I need, what do I have to do, etc.) I´d be really grateful.
OPEN DATASET does not meet our requirements since we don´t want to transfer data to the SAP file system but to an external server (different domain).
Best regards
Gerd
12-15-2015 9:55 AM
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:
Best Regards, Ulrich