即使在导入 TR 之后,旧的 ABAP 代码仍然对 PyRFC 有效。为什么?

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

我在 SAP 系统 X 中更改了一个 ABAP RFC 模块,并将更改传输到 Y。现在,当我调用 RFC 时,SAP 仍然执行旧代码。

我用 diff 工具比较了 X 和 Y 的两个版本,没有发现任何差异,因此看起来像是传输的更改。是否需要特殊步骤来激活我的 ABAP RFC 代码?

我使用 PyRFC 作为客户端库。

不需要激活任何东西。运输时应该没问题。 你可以试试这些;

  • 再次传输所有内容。(包括同一请求的其他任务)
  • 检查您呼叫中的目的地字段,看看您是否呼叫了正确的系统
  • 清除缓冲区 => TCode /$sync

我们的一个 RFC FM 遇到了同样的问题。原因是连接一旦建立就保持打开状态。在这种情况下,二进制文件不会在 RFC 上下文中刷新。只需重新启动连接,一切就会按预期工作。

这是一个已知问题:https://github.com/SAP/PyRFC/issues/89

引用问题:

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.

我希望开发人员友好的解决方案将在未来得到使用。