Rafal Xxx
Rafal Xxx

Reputation: 75

How to install RSAP package - SAP connector for R

My requirement is to use R to analyze data from my company SAP system. I use R v.3.2.4 on my local computer and am able to log in to SAP via SAPGUI.

I have found that to connect R to SAP you need RSAP package, and to install it you need SAP NetWeaver RFC SDK on your local computer.

I tried the steps below, but have stuck with installing RSAP in R (step B-7]).

I would appreciate any suggestion how to proceed ...

[A] Steps according to: https://wiki.scn.sap.com/wiki/display/ABAPConn/Download+and+Installation+of+NW+RFC+SDK

  1. Download NWRFC_38-20004568.SAR
  2. Download SAPCAR.exe
  3. Put both files in the same directory C:\Downloads
  4. Run 'cmd' to open command terminal window and change directory to C:\Downloads
  5. To decompress the .SAR file write in the command line SAPCAR_617-80000938.exe -xvf NWRFC_38-20004568.SAR

[B] Steps according to: INSTALL file on https://github.com/piersharding/RSAP

  1. Position header and library directories as C:\nwrfcsdk\include and C:\nwrfcsdk\lib - move directory nwrfcsdk from C:\Downloads to C:\
  2. Copy the content of C:\nwrfcsdk\lib into the Windows system32 directory ie: C:\Windows\System32
  3. Download Rtools for appropriate version of R from cran.r-project.org
  4. Run the downloaded file RTools33.exe to install Rtools (see installation settings at the very bottom)
  5. Then reboot the computer. You must make absolutely sure that the RTools install worked correctly - check for any errors when you startup R
  6. In R install packages 'devtools', 'yaml', 'reshape' (last two are dependencies for RSAP) and restart R
  7. In R execute:
     library(devtools)
     library(yaml)
     library(reshape)
     install_github("RSAP", username="piersharding", args=c("--configure-args=--with-nwrfcsdk-include=C:\\nwrfcsdk\\include --with-nwrfcsdk-lib=C:\\nwrfcsdk\\lib --no-clean-on-error"))
    

And here is the error:

Downloading GitHub repo piersharding/RSAP@master from URL https://api.github.com/repos/piersharding/RSAP/zipball/master

Error in curl::curl_fetch_memory(url, handle = handle) : Problem with the SSL CA cert (path? access rights?)

In addition: Warning message: Username parameter is deprecated. Please use piersharding/RSAP

I tried another thing as suggested in INSTALL file in step B-7:

And this time the system did some more work, but still without success:

Installing package into ‘\\RWAMSEEFP1/U_kosinskr$/My Documents/R/win-library/3.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
  dependencies ‘yaml’, ‘reshape’ are not available
trying URL 'http://piersharding.com/R/src/contrib/RSAP_0.9.tar.gz'
Content type 'application/x-gzip' length 69780 bytes (68 KB)
downloaded 68 KB

* installing *source* package 'RSAP' ...
** libs
Warning: this package has a non-empty 'configure.win' file,
so building only the main architecture

gcc -m64 -I"C:/PROGRA~1/R/R-32~1.4/include" -DNDEBUG -I. -I"C:/nwrfcsdk/include" -DSAPwithUNICODE -DUNICODE -D_UNICODE -D_AFXDLL -D_CRT_NON_CONFORMING_SWPRINTFS -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DSAPonNT -DSAP_PLATFORM_MAKENAME=ntintel     -I"d:/RCompile/r-compiling/local/local323/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c RSAP.c -o RSAP.o
In file included from C:/nwrfcsdk/include/sapnwrfc.h:7:0,
                 from RSAP.c:41:
C:/nwrfcsdk/include/sapucx.h:562:5: warning: 'align' attribute directive ignored [-Wattributes]
In file included from RSAP.c:41:0:
C:/nwrfcsdk/include/sapnwrfc.h:28:0: warning: ignoring #pragma warning  [-Wunknown-pragmas]
RSAP.c: In function 'u8to16c':
RSAP.c:133:12: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
RSAP.c: In function 'u8to16':
RSAP.c:150:12: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
RSAP.c: In function 'u8to16r':
RSAP.c:167:12: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
RSAP.c: In function 'u16to8c':
RSAP.c:184:12: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
RSAP.c: In function 'u16to8':
RSAP.c:208:12: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
RSAP.c: At top level:
C:/nwrfcsdk/include/sapuc.h:853:24: warning: 'sccsidU16' defined but not used [-Wunused-variable]
gcc -m64 -shared -s -static-libgcc -o RSAP.dll tmp.def RSAP.o -L. -LC:/nwrfcsdk/lib -lsapnwrfc -llibsapucum -Ld:/RCompile/r-compiling/local/local323/lib/x64 -Ld:/RCompile/r-compiling/local/local323/lib -LC:/PROGRA~1/R/R-32~1.4/bin/x64 -lR
installing to \\RWAMSEEFP1/U_kosinskr$/My Documents/R/win-library/3.2/RSAP/libs/x64
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
Warning in library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) :
  there is no package called 'RSAP'
Error: loading failed
Execution halted
ERROR: loading failed
* removing '\\RWAMSEEFP1/U_kosinskr$/My Documents/R/win-library/3.2/RSAP'
Warning in install.packages :
  running command '"C:/PROGRA~1/R/R-32~1.4/bin/x64/R" CMD INSTALL -l "\\RWAMSEEFP1\U_kosinskr$\My Documents\R\win-library\3.2" C:\Users\kosinskr\AppData\Local\Temp\Rtmp40cQJZ/downloaded_packages/RSAP_0.9.tar.gz' had status 1
Warning in install.packages :
  installation of package ‘RSAP’ had non-zero exit status

The downloaded source packages are in
  ‘C:\Users\kosinskr\AppData\Local\Temp\Rtmp40cQJZ\downloaded_packages’

RTools installation settings

Upvotes: 1

Views: 1138

Answers (0)

Related Questions