Afiq Johari
Afiq Johari

Reputation: 1462

How do I extract non-HANA ECC tables into R?

I find that there's very little documentation on how to extract SAP tables into R. I'm not talking about SAP HANA.

Currently, it's very troublesome that I need to manually extract SAP tables using a GUI interface, export them into tabular format. Then only I can import them using my R script.

The current solution I'm exploring is to have my SAP colleagues to export those SAP tables into SQL database, then I can query the tables from R.

Ideally I want to cut this seemingly unnecessary step of having the SAP tables exported into a database.

Upvotes: 1

Views: 646

Answers (2)

Suncatcher
Suncatcher

Reputation: 10621

Consider using RODBC. This package allows adding different ODBC sources and use them in R Studio.

Follow this article and don't bug to word "HANA", this approach allows using any database, not only HANA.

Upvotes: 1

arg0naut91
arg0naut91

Reputation: 14774

For SAP R/3 systems (or what you call ECC), your best bet would be executing remote function calls (i.e. RFC).

Normally these would be supported by open source interfaces for at least the more recent versions (e.g. 4.6 or above).

However, they are fairly scarce and I know only of one such implementation in R - this is the RSAP. You'd also need to download NW RFC SDK, and there may be further requirements based on your OS (e.g. what Visual C++ you'd need for Windows, etc.).

There's also a slightly more widely recognised equivalent in Python, the PyRFC.

On the other hand, you may try Robotic Process Automation (RPA) to interact with GUI in an automated way. One of the options is UiPath but there are others. This way you could configure the automation of table extraction - at the same time you can also call R scripts directly from the RPA.

Overall - to be honest - the solution with extracting tables into a separate database does seem to be the best alternative (compared to what I've described above).

Note: The above presumes that - for any reason, usually security - you cannot access the database underlying ECC directly through ODBC calls - otherwise the instructions for connecting and calling SQL from R are the same as for HANA or similar.

Upvotes: 1

Related Questions