0

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.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
guettli
  • 25,042
  • 81
  • 346
  • 663
  • 2
    did you directly modify the function module or was it some form routine, like e.g. the pricing condition routines? In a few select cases you need to reactivate those after transporting changes. But if you modified a remote-capable function module, you shouldn't need to reactivate anything. To make sure your changed code is called, place an external breakpoint in the FM and see if it gets triggered (note: the FM has to be called with the user you set the breakpoint for). – Dirk Trilsbeek Nov 05 '18 at 14:44
  • Doesn't transport management automatically activate all changed objects after import? – Florian Nov 05 '18 at 15:01
  • How do you know that old code is executed ? can you share detail of RFC old and new code? – Umar Abdullah Nov 06 '18 at 05:27
  • share some code from your call... do you use DESTINATION while calling the RFC? – dotchuZ Nov 06 '18 at 06:43
  • @DirkTrilsbeek I did modify the function module directly. I think I found the solution, I posted it below. – guettli Nov 06 '18 at 11:21
  • @zYrEx I did not use DESTINATION. I think I found the answer. I posted it below – guettli Nov 06 '18 at 11:22

3 Answers3

1

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.

kaman-thah
  • 21
  • 2
  • Thank you for your feedback. Your text looks more like a comment to my answer. Maybe you have not seen it. But nevertheless thank you for supporting this solution. – guettli Nov 07 '18 at 11:16
  • I saw your post but had too little reputation for a comment. So I thought an additional answer was OK... ;-) – kaman-thah Nov 07 '18 at 14:17
  • I see. Keep on, and you will have enough reputations soon. I wish you up-votes – guettli Nov 07 '18 at 15:23
1

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.

guettli
  • 25,042
  • 81
  • 346
  • 663
0

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