使用 SAP .NET Connector 3.0 调用 BAPI_DOCUMENT_CHECKOUTVIEW2 返回“RFC 回调服务器不可用”
我正在尝试使用 SAP .NET Connector 3.0 从 SAP DMS 获取文档。我需要获取文档并在 ASP.Net 中显示。
我正在使用 BAPI_DOCUMENT_CHECKOUTVIEW2
来调用该函数。但是当调用invoke方法时,会抛出“RFC回调服务器不可用”错误。
我使用的代码如下。
...
sap.RfcRepository repo = prd.Repository;
sap.IRfcFunction testBapi = repo.CreateFunction("BAPI_DOCUMENT_CHECKOUTVIEW2");
testBapi.SetValue("DOCUMENTNUMBER", docNumber);
testBapi.SetValue("DOCUMENTPART", docPart);
testBapi.SetValue("DOCUMENTVERSION", docVersion);
testBapi.SetValue("DOCUMENTTYPE", docType);
...
the document file is created here using BAPI_DOCUMENT_GETDETAIL2
...
testBapi.SetValue("DOCUMENTFILE", struFile);
testBapi.SetValue("GETSTRUCTURE", "1");
testBapi.SetValue("GETHEADER", "X");
testBapi.SetValue("ORIGINALPATH", @"D:\");
testBapi.SetValue("PF_FTP_DEST", "SAPFTPA");
long result = RfcAllowStartProgram("sapftp; saphttp");
testBapi.Invoke(prd);
提前致谢
I am trying to get a document from SAP DMS using SAP .NET Connector 3.0. I need to get the document and display in ASP.Net.
I am using BAPI_DOCUMENT_CHECKOUTVIEW2
for calling the function. But when the invoke method is called, "RFC callback server not available" error is thrown.
The code I have used is below.
...
sap.RfcRepository repo = prd.Repository;
sap.IRfcFunction testBapi = repo.CreateFunction("BAPI_DOCUMENT_CHECKOUTVIEW2");
testBapi.SetValue("DOCUMENTNUMBER", docNumber);
testBapi.SetValue("DOCUMENTPART", docPart);
testBapi.SetValue("DOCUMENTVERSION", docVersion);
testBapi.SetValue("DOCUMENTTYPE", docType);
...
the document file is created here using BAPI_DOCUMENT_GETDETAIL2
...
testBapi.SetValue("DOCUMENTFILE", struFile);
testBapi.SetValue("GETSTRUCTURE", "1");
testBapi.SetValue("GETHEADER", "X");
testBapi.SetValue("ORIGINALPATH", @"D:\");
testBapi.SetValue("PF_FTP_DEST", "SAPFTPA");
long result = RfcAllowStartProgram("sapftp; saphttp");
testBapi.Invoke(prd);
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我不知道这个 BAPI,而且我手头没有系统来检查它,但我假设在执行过程中的某个地方,BAPI 尝试“返回”到应该位于另一个的 GUI会议结束。当它找不到 GUI 时,它就会死掉。如果您有 GUI 访问和调试权限(和知识:-)),您可以尝试在途中找到 CALL FUNCTION ... DESTINATION BACK 语句。
I don't know this BAPI and I don't have a system at hand to check it, but I'd assume that somewhere during the execution, the BAPI tries to call "back" to the GUI that's supposed to be at the other end of the session. When it can't find a GUI, it dies. IF you have GUI access and debugging permissions (and knowledge :-)), you could try to find a CALL FUNCTION ... DESTINATION BACK statement on the way.
尝试再添加一个配置参数:
RfcConfigParameters.UseSAPGui
,其值 = 1Try adding one more configuration parameter:
RfcConfigParameters.UseSAPGui
with value = 1您是否了解有关哪个 RFC 服务器连接失败的更多信息?如果您知道哪个连接出现问题,您可以要求 SAP Basis/ABAP 人员登录到 SAP 服务器并进行连接。检查事务 SM59 中的 RFC 目标。
编辑:还要检查 .NET 用户的授权。
Do you have more information on which RFC server connection is failing? If you know which connection is the problem, you can ask a SAP Basis/ABAP person to log on to the SAP server & check the RFC destinations in transaction SM59.
EDIT: Also check the authorizations of the .NET user.