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

932 views Asked by At

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.

3

There are 3 answers

0
guettli On BEST ANSWER

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.

0
Gurkan Yilmaz On

There is no need for activating anything. It should be fine as you transport it. You can try these;

  • Transport everything again.(Including other tasks of the same request)
  • Check the destination field in your call to see if you are calling the correct system
  • Clear the buffer => TCode /$sync
3
kaman-thah On

We had the same problem with one of our RFC FMs. Reason was that the connection remained open once it was established. In this case, the binaries are not refreshed in the RFC context. Simply restart the connection and everything should work as desired.