0

我正在尝试使用 SAP.Net 连接器 3.0 从 SAP DMS 获取文档。我需要获取文档并在 ASP.Net 中显示。

我正在使用“BAPI_DOCUMENT_CHECKOUTVIEW2”来调用该函数。但是调用调用方法时,会抛出“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);

提前致谢

4

3 回答 3

2

我不知道这个 BAPI,我手头也没有系统来检查它,但我假设在执行期间的某个地方,BAPI 尝试“回调”到应该在另一个的 GUI会议结束。当它找不到 GUI 时,它就会死掉。如果您有 GUI 访问和调试权限(和知识 :-)),您可以尝试在途中找到 CALL FUNCTION ... DESTINATION BACK 语句。

于 2011-11-10T19:15:32.287 回答
1

尝试再添加一个配置参数:

RfcConfigParameters.UseSAPGui值 = 1

于 2012-04-19T15:27:56.027 回答
0

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.

于 2011-11-08T18:55:13.463 回答