RFC_READ_TABLE 传递“选项"和“字段"参数 (c#) [英] RFC_READ_TABLE passing "options" and "Fields" parameters (c#)

查看:21
本文介绍了RFC_READ_TABLE 传递“选项"和“字段"参数 (c#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

需要帮助,我正在尝试使用 RFC_READ_TABLE 从 SAP 获取销售数据,但不知道如何将 OPTIONS 和 FIELDS 参数传递给 SAP.这是我的应用程序的示例代码.

Need help, I'm trying to get sales data from SAP Using RFC_READ_TABLE, but don't know how to pass OPTIONS and FIELDS parameters to SAP. Here sample code of my app.

连接正常,执行后出现异常DATA_BUFFER_EXCEEDED"

Connection is working, after execution, I have an exception "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." +
                                        "
" +
                                        "
<SAP Remote Execution Error>" +
                                        "
" +
                                        "
Additional Information on Error: " + x.Message, "Oops, Runtime Error");
        }
    }

推荐答案

RFC_READ_TABLE 不是用于读取销售订单数据的理想功能模块(它实际上是为快速n'-脏表读取没有其他东西存在的地方).我会调查以下支持 RFC 的功能模块:

RFC_READ_TABLE isn't the ideal function module to be using to read sales order data (it's really designed for quick-n'-dirty table reads where nothing else exists). I'd investigate the following RFC-enabled function modules:

  • BAPI_SALESORDER_GETLIST - 获取销售文件列表
  • BAPISDORDER_GETDETAILEDLIST - 阅读单个销售文档的详细信息
  • BAPI_SALESORDER_GETLIST - get a list of sales documents
  • BAPISDORDER_GETDETAILEDLIST - read the details of a single sales document

如果您查看功能组 2032Sales and Distribution -> Sales -> Sales Order在事务 BAPI 中,您会发现其他可能有帮助的人.

If you look at function group 2032 or at Sales and Distribution -> Sales -> Sales Order in transaction BAPI you'll find others that may help.

这篇关于RFC_READ_TABLE 传递“选项"和“字段"参数 (c#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆