Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 一个RFC调用正在返回数据,但另一个没有返回数据_C#_Sap_Sap Dotnet Connector - Fatal编程技术网

C# 一个RFC调用正在返回数据,但另一个没有返回数据

C# 一个RFC调用正在返回数据,但另一个没有返回数据,c#,sap,sap-dotnet-connector,C#,Sap,Sap Dotnet Connector,我使用两种不同的BAPI从SAP获取数据。当我使用BAPI\u SALESORDER\u GETLIST时,它工作得非常好。但是当我使用BAPI\u BILLINGDOC\u GETLIST时,我没有得到任何数据。这就是我试图称之为BAPI的方式: DataTable table = null; SapConfig cfg = new SapConfig(); if (RfcDestinationManager.TryGetDestination("SAP") == null) Rf

我使用两种不同的BAPI从SAP获取数据。当我使用
BAPI\u SALESORDER\u GETLIST
时,它工作得非常好。但是当我使用
BAPI\u BILLINGDOC\u GETLIST
时,我没有得到任何数据。这就是我试图称之为BAPI的方式:

DataTable table = null;

SapConfig cfg = new SapConfig();

if (RfcDestinationManager.TryGetDestination("SAP") == null)
    RfcDestinationManager.RegisterDestinationConfiguration(cfg);

RfcDestination dest = RfcDestinationManager.GetDestination("SAP");
RfcRepository repo = dest.Repository;

IRfcFunction fnc = repo.CreateFunction("BAPI_BILLINGDOC_GETLIST");
IRfcStructure param = fnc.GetStructure("REFDOCRANGE");
param.SetValue("SIGN", "I");
param.SetValue("OPTION", "EQ");
param.SetValue("REF_DOC_LOW", salesOrderNumber);
param.SetValue("REF_DOC_HIGH", "");

fnc.Invoke(dest);

table = fnc.GetTable("BILLINGDOCUMENTDETAIL").ToDataTable();

return table;
据我所知,一切看起来都不错。我与SAP团队取得了联系,他们确保我使用的帐户可以访问所有内容,我们在SAP中运行了BAPI,效果良好


所以SAP看起来不错。你知道我做错了什么吗?

请检查参数值是否正确。有时SAP功能模块希望提交的文档编号带有前导零。您可以在transaction
SE37
中测试功能模块以检查您的参数。

您确定您的参数salesOrderNumber正确吗?在某些情况下,SAP希望提交的文档编号带有前导零。通常不在官方的BAPI中,但很容易检查。我首先尝试用相同的参数在SE37中执行FM,看看是否会产生结果。@DirkTrilsbeek我们在SE37中用实际的数字80000236执行了FM,结果很好。我可以看看是否有任何前导零,然后试试看。@DirkTrilsbeek该死的,你是对的。我在数字上加了2个零,它返回了数据。请随意提交答案,我会接受的。谢谢