abapsaprfcpyrfc

Old ABAP code still active for PyRFC even after TR was imported. Why?


I changed an ABAP RFC module in a SAP system X and transported the changes the Y. Now when I call the RFC SAP stills executes the old code.

I compared both versions from X and Y with a diff tool and found no differences, so it looks like the changes where transported. Is there a special step needed to activate my ABAP RFC code?

I use PyRFC as a client library.


Solution

  • This is a known issue: https://github.com/SAP/PyRFC/issues/89

    Quoting the issue:

    After the Python script ended, the connection should be automatically closed and SAP NW RFC SDK initialised. Here what happens under the hub.

    Python interpreters and PyRFC instances share the same SAP NW RFC SDK lib instance and when the remote enabled function module (RFM) is called for the 1st time, the RFM metadata are cached inside SAP NW RFC SDK. When the 2nd call of the same RFM requested from Python/PyRFC, the SAP NW RFC SDK returns the metadata from cache, rather than reading again from ABAP system, saving one Python/ABAP roundtrip and some performance, especially in case of complex RFMs. If the RFM signature changed in the meantime, the cached RFM metadata are not changed and Python "sees" the old ABAP code.

    I hope a developer friendly solution will get used for the future.