Using Python to insert data into SAP with PyRFC

Using Python to insert data into SAP with PyRFC

How to insert the result of a Machine Learning method into SAP with the most used language to develop Machine Learning models? Today we are seeing the daily increase of Machine Learning (ML) development and the largest development tool is Python and each day more and more people are trying to return the results of the ML models into their Enterprise Resource Planning systems (ERPs).

Today we are seeing the daily increase of Machine Learning (ML) development and the largest development tool is Python and each day more and more people are trying to return the results of the ML models into their Enterprise Resource Planning systems (ERPs).

SAP is one of the most used ERPs systems and to insert the results of an ML model into it we have two options, manually in a custom SAP transaction or using a Remote Function Call (RFC) which is the standard SAP interface for communication between SAP systems and other systems, so RFC calls a function to be executed in a remote system.

Let’s say that you can automate the upload of the result file in the transaction with a Robotic Process Automation system (RPA), so then which one we should choose?

Well, if I had to choose one of them I would pick the second option because it tends to vary less and have fewer updates than the first one, so you probably would have fewer problems with unnoticed updates.

One important thing to point is that RFC has a lot of goals and ways to be developed and the one we want to use is to insert data into tables

We can do that with Python using the PyRFC package, but the first use of it is not so simple, so to help with that I’ve created some functions and documentations.

Let’s begin!

Installations

- First Step: Download SAP NW RFC SDK

SAP NW RFC SDK is the abbreviation for SAP NetWeaver Remote Function Call System Development Kit, this lets you manage the RFCs.

I’ve found a really good manual from *Informatica *ofhow to download it, but it’s for an older version and some icons are quite different now, so I’ve written the steps and reprinted the images to have it up to date.

If you want to see the manual of Informatica, it is linked at the end of the article as a Source.

One difficult thing about downloading this content is that you need an SAP account to do it, so try to get one before starting this journey.

Coming back, the download steps:

  • Go to the SAP Service Marketplace: http://service.sap.com/support
  • Enter your SAP Service Marketplace user name and password. The SAP Support Portal page appears.

machine-learning rfc sap python data-science

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Data Science With Python Training | Python Data Science Course | Intellipaat

🔵 Intellipaat Data Science with Python course: https://intellipaat.com/python-for-data-science-training/In this Data Science With Python Training video, you...

Applied Data Analysis in Python Machine Learning and Data Science | Scikit-Learn

Applied Data Analysis in Python Machine learning and Data science, we will investigate the use of scikit-learn for machine learning to discover things about whatever data may come across your desk.

Data Science Projects | Data Science | Machine Learning | Python

Practice your skills in Data Science with Python, by learning and then trying all these hands-on, interactive projects, that I have posted for you.

Data Science Projects | Data Science | Machine Learning | Python

Practice your skills in Data Science with Python, by learning and then trying all these hands-on, interactive projects, that I have posted for you.

Data Science Projects | Data Science | Machine Learning | Python

Practice your skills in Data Science with Python, by learning and then trying all these hands-on, interactive projects, that I have posted for you.