Questions tagged [pyrfc]

The pyrfc Python package provides Python bindings for SAP NetWeaver RFC Library, for a comfortable way of calling ABAP modules from Python and Python modules from ABAP, via SAP Remote Function Call (RFC) protocol.

The pyrfc Python package provides Python bindings for SAP NetWeaver RFC Library, for a comfortable way of calling ABAP modules from Python and Python modules from ABAP, via SAP Remote Function Call (RFC) protocol. https://github.com/SAP/PyRFC

70 questions
0
votes
1 answer

Unable to Import pyrfc in Python in Windows

I am trying to connect python to SAP by calling the Function Module RFC_READ_TABLE. I followed every steps in this link, including setting up the environment variables. However, when I try to Import Pyrfc, I got an error: ImportError: DLL load…
felix12
  • 11
  • 4
0
votes
0 answers

SAP UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 2-3: unexpected end of data while calling RFC_READ_TABLE

I have followed all process of (https://blogs.sap.com/2020/06/09/connecting-python-with-sap-step-by-step-guide/) and able to establish the successful connection to the SAP server but at line conn.call method I am getting this: Traceback (most…
0
votes
2 answers

Optimization of code written using python and BAPI

I have a python code here which goes into SAP using BAPI RFC_READ_TABLE, queries USR02 table and bring back the results. The input is taken from an excel sheet A column and the output is pasted in B column The code is running all fine. However, for…
Anirudh Chauhan
  • 111
  • 2
  • 9
0
votes
0 answers

Can you connect to SAP Query with Python same way you do it with SBOP Analysis for Excel?

So currently I use MS Excel to explore and pull some data from a SAP Query I have access using SBOP Analysis tool in Excel. Now I need to automate this process and what I have done is use a Macro to connect and refresh the data daily, which is good…
franciscovalera
  • 111
  • 1
  • 1
  • 14
0
votes
0 answers

Pyrfc connection return none

I've tried the code below to connect to the sap system. But it was throwing an error complaining that nonetype cannot be used to call. def main(): config = ConfigParser() config.read('sapnwrfc.cfg') params_connection =…
Dinesh
  • 1
  • 1
0
votes
2 answers

Unique ID for every RFC call

I call some RFC module externally which calls other modules and calculates some value inside the call stack and saves it to memory, then reads this value in the end and returns to external caller. The calculation can be different each time so we…
Suncatcher
  • 10,355
  • 10
  • 52
  • 90
0
votes
1 answer

Direct run of SQL query with PyRFC

I am new to python. I want to pull data from SAP System. I have created a connection with SAP system using below code and trying to pull data using SQL query: select col1,col2,col3 from table_name where col1= 2019 Program: import pyrfc from…
0
votes
0 answers

ModuleNotFoundError: No module named '__main__.pyrfc'; '__main__' is not a package

I already install C:\Python37>pip3 install pyrfc` my output like this. Collecting pyrfc Downloading pyrfc-0.1.2.tar.gz (3.5 kB) Installing collected packages: pyrfc Running setup.py install for pyrfc ... done Successfully installed…
SPerla
  • 1
  • 2
0
votes
2 answers

Docker image python-alpine fails when using lib

I have the following Dockerfile: FROM python:3.7-alpine WORKDIR /msa-app/ EXPOSE 3000 ENV LD_LIBRARY_PATH="/usr/local/lib" ENV LD_RUN_PATH="/usr/local/lib" ENV SAPNWRFC_HOME="/usr/local/sap/nwrfcsdk" ENV PATH="${PATH}:/usr/sap/nwrfcsdk/lib" COPY…
WitnessTruth
  • 539
  • 2
  • 9
  • 27
0
votes
1 answer

Determine the number of characters which are allowed in a field?

The is a follow-up question of The meaning of nuc_length and uc_length parameters in PyRFC? With PyRFC I can get the function description like this: get_function_description(rfc_name) Per field I can read uc_length and nuc_length. How can I…
guettli
  • 25,042
  • 81
  • 346
  • 663
0
votes
1 answer

The meaning of nuc_length and uc_length parameters in PyRFC?

My favorite search engine (ecosia) could not find the canonical docs from upstream (SAP) about the meaning of uc_length vs nuc_length. What is the difference between both? I get these parameters with a modified version of clientPrintDescription.py
guettli
  • 25,042
  • 81
  • 346
  • 663
0
votes
2 answers

SAP RFC: parameter_type RFTYPE_TABLE: meaning of uc_length?

I took the nice example clientPrintDescription.py and modified it to return HTML. Now I see this: Since the parameter type is RFCTYPE_TABLE I think nuc_length and uc_length don't play a role. Am I right, or do have both values (here 16) have any…
guettli
  • 25,042
  • 81
  • 346
  • 663
0
votes
0 answers

pyRFC Unable to connect through SNC

I have been playing with pyRFC for a while now, and was trying to see if it would be possible to use the SNC information as the connection parameters. I tried with user and password and that's working fine. I also verified that I have the…
AlbertoRR
  • 1
  • 1
0
votes
0 answers

SAP L_TO_CANCEL doesn't cancel transfer order

I'm using SAP function module L_TO_CANCEL via pyrfc and python to cancel warehouse management replenishment transfer orders (TOs). This works fine for some TOs but for others (also replenishment) is give an error Negative stock for storage type X…
0
votes
2 answers

Performance of /ui2/cl_json serialization

In the past I used this to return any data structure via SAP RFC: json = /ui2/cl_json=>serialize( data = pretty_name = /ui2/cl_json=>pretty_mode-low_case ). This works very well if is small, but for bigger data sets…
guettli
  • 25,042
  • 81
  • 346
  • 663