需要帮助,我正在尝试使用 RFC_READ_TABLE 从 SAP 获取销售数据,但不知道如何将 OPTIONS 和 FIELDS 参数传递给 SAP。这是我的应用程序的示例代码。
连接正常,执行后出现异常“DATA_BUFFER_EXCEEDED”
public void RFC_READ_TABLE()
{
try
{
ECCDestinationConfig cfg = new ECCDestinationConfig();
RfcDestinationManager.RegisterDestinationConfiguration(cfg);
RfcDestination dest = RfcDestinationManager.GetDestination("ABI_ERP");
RfcRepository repo = dest.Repository;
IRfcFunction fn = repo.CreateFunction("RFC_READ_TABLE");
fn.SetValue("QUERY_TABLE", "VBAP");
fn.GetTable("DATA");
fn.Invoke(dest);
var companyCodeList = fn.GetTable("VBAP");
var companyDataTable = companyCodeList.ToDataTable("VBAP");
dataGridView1.DataSource = companyDataTable;
}
catch (RfcBaseException x)
{
MessageBox.Show("Some problems in programe execution. Check entered data, and try again." +
"\n" +
"\n<SAP Remote Execution Error>" +
"\n" +
"\nAdditional Information on Error: " + x.Message, "Oops, Runtime Error");
}
}