| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577 |
- using System;
- using System.Collections.Generic;
- using System.Data;
- using System.Web;
- using System.Configuration;
- using SAP.Middleware.Connector;
- /// <summary>
- /// SapApi xuwei add 2020-07-15
- /// </summary>
- public class SapApi
- {
- //SAP服务器配置参数
- public static string appServerHost = ConfigurationManager.AppSettings["SapAppServerHost"].ToString();
- public static string systemNumber = ConfigurationManager.AppSettings["SapSystemNumber"].ToString();
- public static string user = ConfigurationManager.AppSettings["SapUser"].ToString();
- public static string password = ConfigurationManager.AppSettings["SapPassword"].ToString();
- public static string client = ConfigurationManager.AppSettings["SapClient"].ToString();
- /// <summary>
- /// 读取库存单价接口(获取库存数量)
- /// </summary>
- /// <param name="WERKS">工厂代号</param>
- /// <param name="MATNR">物料编号</param>
- /// <param name="LGORT">库存地点</param>
- /// <param name="ZTYPE">消息类型: S 成功,E 错误,W 警告,I 信息,A 中断</param>
- /// <param name="ZMSG">消息文本</param>
- /// <returns></returns>
- public static DataTable ZMMFM037(string WERKS, List<string> matnrs, string LGORT, out string ZTYPE, out string ZMSG)
- {
- RfcConfigParameters rfcPara = new RfcConfigParameters();
- rfcPara.Add(RfcConfigParameters.AppServerHost, appServerHost);
- rfcPara.Add(RfcConfigParameters.SystemNumber, systemNumber);
- rfcPara.Add(RfcConfigParameters.User, user);
- rfcPara.Add(RfcConfigParameters.Password, password);
- rfcPara.Add(RfcConfigParameters.Client, client);
- rfcPara.Add(RfcConfigParameters.Name, "CON");
- rfcPara.Add(RfcConfigParameters.Language, "ZH");
- rfcPara.Add(RfcConfigParameters.PoolSize, "5");
- rfcPara.Add(RfcConfigParameters.ConnectionIdleTimeout, "60");
- RfcDestination rfcDest = RfcDestinationManager.GetDestination(rfcPara);
- RfcRepository rfcRep = rfcDest.Repository;
- //接口API
- IRfcFunction rfcApi = rfcRep.CreateFunction("ZMMFM037");
- //输入参数
- IRfcTable imTable = rfcApi.GetTable("TAB_IN");
- foreach (string MATNR in matnrs)
- {
- imTable.Append();
- imTable.SetValue("WERKS", WERKS);
- imTable.SetValue("MATNR", MATNR);
- imTable.SetValue("LGORT", LGORT);
- }
- //调用接口
- rfcApi.Invoke(rfcDest);
- //获取输出
- ZTYPE = rfcApi.GetValue("ZTYPE").ToString();
- ZMSG = rfcApi.GetValue("ZMSG").ToString();
- IRfcTable table = rfcApi.GetTable("TAB_OUT");
- DataTable dt = GetDataTableFromRFCTable(table);
- //string[] columns = new string[] { "WERKS", "MATNR", "MEINS", "VBELN", "POSNR", "CHARG", "LGORT", "MENGE", "VERPR", "WAERS" };
- //DataTable dt = new DataTable();
- //foreach (string clmn in columns)
- //{
- // dt.Columns.Add(clmn);
- //}
- //for (int i = 0; i < table.RowCount; i++)
- //{
- // DataRow dr = dt.NewRow();
- // foreach (string clmn in columns)
- // {
- // dr[clmn] = table.GetString(clmn);
- // }
- // dt.Rows.Add(dr);
- //}
- rfcDest = null;
- rfcRep = null;
- return dt;
- }
- /// <summary>
- /// 读取库存单价接口(获取库存数量)
- /// </summary>
- /// <param name="WERKS">工厂代号</param>
- /// <param name="MATNR">物料编号</param>
- /// <param name="LGORT">库存地点</param>
- /// <param name="ZMSG">消息文本</param>
- /// <returns></returns>
- public static DataTable ZMM_WMS016(string WERKS, List<string> matnrs, string LGORT, out string ZMSG)
- {
- RfcConfigParameters rfcPara = new RfcConfigParameters();
- rfcPara.Add(RfcConfigParameters.AppServerHost, appServerHost);
- rfcPara.Add(RfcConfigParameters.SystemNumber, systemNumber);
- rfcPara.Add(RfcConfigParameters.User, user);
- rfcPara.Add(RfcConfigParameters.Password, password);
- rfcPara.Add(RfcConfigParameters.Client, client);
- rfcPara.Add(RfcConfigParameters.Name, "CON");
- rfcPara.Add(RfcConfigParameters.Language, "ZH");
- rfcPara.Add(RfcConfigParameters.PoolSize, "5");
- rfcPara.Add(RfcConfigParameters.ConnectionIdleTimeout, "60");
- RfcDestination rfcDest = RfcDestinationManager.GetDestination(rfcPara);
- RfcRepository rfcRep = rfcDest.Repository;
- //接口API
- IRfcFunction rfcApi = rfcRep.CreateFunction("ZMM_WMS016");
- //输入参数
- IRfcTable imTable = rfcApi.GetTable("IT_INPUT");
- foreach (string MATNR in matnrs)
- {
- imTable.Append();
- imTable.SetValue("WERKS", WERKS);
- imTable.SetValue("MATNR", MATNR);
- imTable.SetValue("LGORT", LGORT);
- }
- //调用接口
- rfcApi.Invoke(rfcDest);
- //获取输出
- ZMSG = rfcApi.GetValue("E_MSG").ToString();
- IRfcTable table = rfcApi.GetTable("IT_OUTPUT");
- DataTable dt = GetDataTableFromRFCTable(table);
- rfcDest = null;
- rfcRep = null;
- return dt;
- }
- /// <summary>
- /// 读取库存单价接口(获取库存数量)
- /// </summary>
- /// <param name="WERKS">工厂代号</param>
- /// <param name="LGORT">库存地点</param>
- /// <param name="ZMSG">消息文本</param>
- /// <returns></returns>
- public static DataTable ZMM_WMS016(string WERKS, DataTable dtInventory, out string ZMSG)
- {
- RfcConfigParameters rfcPara = new RfcConfigParameters();
- rfcPara.Add(RfcConfigParameters.AppServerHost, appServerHost);
- rfcPara.Add(RfcConfigParameters.SystemNumber, systemNumber);
- rfcPara.Add(RfcConfigParameters.User, user);
- rfcPara.Add(RfcConfigParameters.Password, password);
- rfcPara.Add(RfcConfigParameters.Client, client);
- rfcPara.Add(RfcConfigParameters.Name, "CON");
- rfcPara.Add(RfcConfigParameters.Language, "ZH");
- rfcPara.Add(RfcConfigParameters.PoolSize, "5");
- rfcPara.Add(RfcConfigParameters.ConnectionIdleTimeout, "60");
- RfcDestination rfcDest = RfcDestinationManager.GetDestination(rfcPara);
- RfcRepository rfcRep = rfcDest.Repository;
- //接口API
- IRfcFunction rfcApi = rfcRep.CreateFunction("ZMM_WMS016");
- //输入参数
- IRfcTable imTable = rfcApi.GetTable("IT_INPUT");
- foreach (DataRow row in dtInventory.Rows)
- {
- imTable.Append();
- imTable.SetValue("WERKS", WERKS);
- imTable.SetValue("MATNR", row["IDNRK"]);
- imTable.SetValue("LGORT", row["POSITION"]);
- }
- //调用接口
- rfcApi.Invoke(rfcDest);
- //获取输出
- ZMSG = rfcApi.GetValue("E_MSG").ToString();
- IRfcTable table = rfcApi.GetTable("IT_OUTPUT");
- DataTable dt = GetDataTableFromRFCTable(table);
- rfcDest = null;
- rfcRep = null;
- return dt;
- }
- /// <summary>
- /// 查询PO的相关信息(获取订单达成数量)
- /// </summary>
- /// <param name="IN_EBELN">采购凭证号</param>
- /// <param name="ZTYPE">消息类型: S 成功,E 错误,W 警告,I 信息,A 中断</param>
- /// <param name="ZMSG">消息文本</param>
- /// <returns></returns>
- public static DataTable ZMMFM_MES_POCX(string IN_EBELN, out string ZTYPE, out string ZMSG)
- {
- RfcConfigParameters rfcPara = new RfcConfigParameters();
- rfcPara.Add(RfcConfigParameters.AppServerHost, appServerHost);
- rfcPara.Add(RfcConfigParameters.SystemNumber, systemNumber);
- rfcPara.Add(RfcConfigParameters.User, user);
- rfcPara.Add(RfcConfigParameters.Password, password);
- rfcPara.Add(RfcConfigParameters.Client, client);
- rfcPara.Add(RfcConfigParameters.Name, "CON");
- rfcPara.Add(RfcConfigParameters.Language, "ZH");
- rfcPara.Add(RfcConfigParameters.PoolSize, "5");
- rfcPara.Add(RfcConfigParameters.ConnectionIdleTimeout, "60");
- RfcDestination rfcDest = RfcDestinationManager.GetDestination(rfcPara);
- RfcRepository rfcRep = rfcDest.Repository;
- //接口API
- IRfcFunction rfcApi = rfcRep.CreateFunction("ZMMFM_MES_POCX");
- //输入参数
- rfcApi.SetValue("IN_EKORG", 1000);
- rfcApi.SetValue("IN_EBELN", IN_EBELN);
- rfcApi.SetValue("IN_AEDAT_FROM", "20220101");
- rfcApi.SetValue("IN_AEDAT_TO", "20301231");
- //调用接口
- rfcApi.Invoke(rfcDest);
- //获取输出
- ZTYPE = rfcApi.GetValue("ZTYPE").ToString();
- ZMSG = rfcApi.GetValue("ZMSG").ToString();
- IRfcTable table = rfcApi.GetTable("GT_OUT");
- //EBELN 采购凭证编号
- //EBELP 采购凭证的项目编号
- //MENGE 采购订单数量
- //MEINS 订单计量单位
- //ZYSSL 已收/ 退数量数量
- //ZWSSL 未收/ 退数量
- //ELIKZ 交货已完成标识
- //LIFNR 供应商编码
- //EKGRP 采购组
- //MATNR 物料编码
- //string[] columns = new string[] { "EBELN", "EBELP", "MENGE", "MEINS", "ZYSSL", "ZWSSL", "ELIKZ", "LIFNR", "EKGRP", "MATNR" };
- DataTable dt = GetDataTableFromRFCTable(table);
- //foreach (string clmn in columns)
- //{
- // dt.Columns.Add(clmn);
- //}
- //for (int i = 0; i < table.RowCount; i++)
- //{
- // DataRow dr = dt.NewRow();
- // foreach (string clmn in columns)
- // {
- // dr[clmn] = table.ro.GetString(clmn);
- // }
- // dt.Rows.Add(dr);
- //}
- rfcDest = null;
- rfcRep = null;
- return dt;
- }
- /// <summary>
- /// 物料主数据接口(同步最小包装数用)
- /// </summary>
- /// <param name="MBLNR">物料凭证编号</param>
- /// <param name="createTime">创建时间</param>
- /// <param name="ZTYPE">消息类型: S 成功,E 错误,W 警告,I 信息,A 中断</param>
- /// <param name="ZMSG">消息文本</param>
- /// <returns></returns>
- public static DataTable ZMMFM054(out string ZTYPE, out string ZMSG,string syncType, string value)
- {
- RfcConfigParameters rfcPara = new RfcConfigParameters();
- rfcPara.Add(RfcConfigParameters.AppServerHost, appServerHost);
- rfcPara.Add(RfcConfigParameters.SystemNumber, systemNumber);
- rfcPara.Add(RfcConfigParameters.User, user);
- rfcPara.Add(RfcConfigParameters.Password, password);
- rfcPara.Add(RfcConfigParameters.Client, client);
- rfcPara.Add(RfcConfigParameters.Name, "CON");
- rfcPara.Add(RfcConfigParameters.Language, "ZH");
- rfcPara.Add(RfcConfigParameters.PoolSize, "5");
- rfcPara.Add(RfcConfigParameters.ConnectionIdleTimeout, "60");
- RfcDestination rfcDest = RfcDestinationManager.GetDestination(rfcPara);
- RfcRepository rfcRep = rfcDest.Repository;
- //周期性同步
- DateTime date = DateTime.Now;
- DateTime dateMinusOneDay = date.AddDays(-1);
- //接口API
- IRfcFunction rfcApi = rfcRep.CreateFunction("ZMMFM054");
- //输入参数
- if (syncType == "MATNR")
- {
- //单独获取某物料的主数据信息
- rfcApi.SetValue("IN_MATNR", value);
- }
- else if (syncType == "MTART")
- {
- //单独获取某物料类型的主数据信息
- rfcApi.SetValue("IN_MTART", "物料类型");
- }
- else if (syncType == "ALL")
- {
- //期初全量获取
- rfcApi.SetValue("IN_ALL", "X");
- }
-
- //周期性同步
- rfcApi.SetValue("IN_ERSDA", dateMinusOneDay);
- rfcApi.SetValue("IN_WERKS", 5000);
- //调用接口
- rfcApi.Invoke(rfcDest);
- //获取输出
- ZTYPE = rfcApi.GetValue("ZTYPE").ToString();
- ZMSG = rfcApi.GetValue("ZMSG").ToString();
- IRfcTable table = rfcApi.GetTable("OUT_TABLE");
- DataTable dt = GetDataTableFromRFCTable(table);
- rfcDest = null;
- rfcRep = null;
- return dt;
- }
- /// <summary>
- /// 东科与SAP系统之线边仓库存领用接口(库存过账)
- /// </summary>
- /// <param name="BLDAT">过帐日期</param>
- /// <param name="ZDKNO">东科单据号</param>
- /// <param name="ZTYPE">消息类型: S 成功,E 错误,W 警告,I 信息,A 中断</param>
- /// <param name="ZMSG">消息文本</param>
- /// <returns></returns>
- public static DataTable ZMMFM045(string BLDAT, string ZDKNO, DataTable dtTable, out string ZTYPE, out string ZMSG)
- {
- RfcConfigParameters rfcPara = new RfcConfigParameters();
- rfcPara.Add(RfcConfigParameters.AppServerHost, appServerHost);
- rfcPara.Add(RfcConfigParameters.SystemNumber, systemNumber);
- rfcPara.Add(RfcConfigParameters.User, user);
- rfcPara.Add(RfcConfigParameters.Password, password);
- rfcPara.Add(RfcConfigParameters.Client, client);
- rfcPara.Add(RfcConfigParameters.Name, "CON");
- rfcPara.Add(RfcConfigParameters.Language, "ZH");
- rfcPara.Add(RfcConfigParameters.PoolSize, "5");
- rfcPara.Add(RfcConfigParameters.ConnectionIdleTimeout, "60");
- RfcDestination rfcDest = RfcDestinationManager.GetDestination(rfcPara);
- RfcRepository rfcRep = rfcDest.Repository;
- //接口API
- IRfcFunction rfcApi = rfcRep.CreateFunction("ZMMFM045");
- //BLDAT DATS 8 0 必填 凭证日期 格式: yyyymmdd
- //BUDAT DATS 8 0 必填 过帐日期 格式: yyyymmdd
- //WERKS CHAR 4 0 必填 工厂 5020
- //LGORT_FM CHAR 4 0 必填 发出库位
- //LGORT_TO CHAR 4 0 必填 接收库位
- //MATNR CHAR 40 0 必填 物料编号
- //BWART CHAR 3 0 必填 移动类型(库存管理) 目前只允许填:311
- //MEINS UNIT 3 0 必填 基本计量单位
- //MENGE QUAN 13 3 必填 数量
- //ZDKNO CHAR 40 0 必填 东科单据号
- //输入参数
- IRfcTable imTable = rfcApi.GetTable("IT_ITEM");
- foreach (DataRow dr in dtTable.Rows)
- {
- imTable.Append();
- imTable.SetValue("BLDAT", BLDAT);
- imTable.SetValue("BUDAT", BLDAT);
- imTable.SetValue("WERKS", "5000");
- imTable.SetValue("LGORT_FM", dr["LGORT_FM"]);
- imTable.SetValue("LGORT_TO", dr["TOLOGT"]);
- imTable.SetValue("MATNR", dr["MATNR"]);
- imTable.SetValue("CHARG", dr["CHARG"] + "");
- imTable.SetValue("BWART", "311");
- imTable.SetValue("MEINS", dr["MEINS"]);
- imTable.SetValue("MENGE", dr["MENGE"]);
- imTable.SetValue("ZDKNO", ZDKNO);
- }
- //调用接口
- rfcApi.Invoke(rfcDest);
- //获取输出
- ZTYPE = rfcApi.GetValue("ZTYPE").ToString();
- ZMSG = rfcApi.GetValue("ZMSG").ToString();
- IRfcTable table = rfcApi.GetTable("ET_RETURN");
- DataTable dt = GetDataTableFromRFCTable(table);
- //string[] columns = new string[] { "BLDAT", "WERKS", "MBLNR", "MJAHR", "MSGTY", "MSGTX" };
- //DataTable dt = new DataTable();
- //foreach (string clmn in columns)
- //{
- // dt.Columns.Add(clmn);
- //}
- //for (int i = 0; i < table.RowCount; i++)
- //{
- // DataRow dr = dt.NewRow();
- // foreach (string clmn in columns)
- // {
- // dr[clmn] = table.GetString(clmn);
- // }
- // dt.Rows.Add(dr);
- //}
- rfcDest = null;
- rfcRep = null;
- return dt;
- }
- /// <summary>
- /// 冲销凭证接口(撤销过账)
- /// </summary>
- /// <param name="MBLNR">物料凭证编号</param>
- /// <param name="createTime">创建时间</param>
- /// <param name="ZTYPE">消息类型: S 成功,E 错误,W 警告,I 信息,A 中断</param>
- /// <param name="ZMSG">消息文本</param>
- /// <returns></returns>
- public static void ZMMFM038(string MBLNR, DateTime createTime, out string ZTYPE, out string ZMSG)
- {
- RfcConfigParameters rfcPara = new RfcConfigParameters();
- rfcPara.Add(RfcConfigParameters.AppServerHost, appServerHost);
- rfcPara.Add(RfcConfigParameters.SystemNumber, systemNumber);
- rfcPara.Add(RfcConfigParameters.User, user);
- rfcPara.Add(RfcConfigParameters.Password, password);
- rfcPara.Add(RfcConfigParameters.Client, client);
- rfcPara.Add(RfcConfigParameters.Name, "CON");
- rfcPara.Add(RfcConfigParameters.Language, "ZH");
- rfcPara.Add(RfcConfigParameters.PoolSize, "5");
- rfcPara.Add(RfcConfigParameters.ConnectionIdleTimeout, "60");
- RfcDestination rfcDest = RfcDestinationManager.GetDestination(rfcPara);
- RfcRepository rfcRep = rfcDest.Repository;
- //接口API
- IRfcFunction rfcApi = rfcRep.CreateFunction("ZMMFM038");
- //输入参数
- rfcApi.SetValue("MBLNR", MBLNR);
- rfcApi.SetValue("MJAHR", createTime.ToString("yyyy"));
- rfcApi.SetValue("BUDAT", createTime.ToString("yyyyMMdd"));
- //调用接口
- rfcApi.Invoke(rfcDest);
- //获取输出
- ZTYPE = rfcApi.GetValue("ZTYPE").ToString();
- ZMSG = rfcApi.GetValue("ZMSG").ToString();
- rfcDest = null;
- rfcRep = null;
- }
- /// <summary>
- /// 测试用,用于把线边仓的货,全挪走
- /// </summary>
- /// <param name="BLDAT">过帐日期</param>
- /// <param name="ZDKNO">东科单据号</param>
- /// <param name="ZTYPE">消息类型: S 成功,E 错误,W 警告,I 信息,A 中断</param>
- /// <param name="ZMSG">消息文本</param>
- /// <returns></returns>
- public static DataTable ZMMFM045_TEST(string BLDAT, string ZDKNO, DataTable dtTable, out string ZTYPE, out string ZMSG)
- {
- RfcConfigParameters rfcPara = new RfcConfigParameters();
- rfcPara.Add(RfcConfigParameters.AppServerHost, appServerHost);
- rfcPara.Add(RfcConfigParameters.SystemNumber, systemNumber);
- rfcPara.Add(RfcConfigParameters.User, user);
- rfcPara.Add(RfcConfigParameters.Password, password);
- rfcPara.Add(RfcConfigParameters.Client, client);
- rfcPara.Add(RfcConfigParameters.Name, "CON");
- rfcPara.Add(RfcConfigParameters.Language, "ZH");
- rfcPara.Add(RfcConfigParameters.PoolSize, "5");
- rfcPara.Add(RfcConfigParameters.ConnectionIdleTimeout, "60");
- RfcDestination rfcDest = RfcDestinationManager.GetDestination(rfcPara);
- RfcRepository rfcRep = rfcDest.Repository;
- //接口API
- IRfcFunction rfcApi = rfcRep.CreateFunction("ZMMFM045");
- //BLDAT DATS 8 0 必填 凭证日期 格式: yyyymmdd
- //BUDAT DATS 8 0 必填 过帐日期 格式: yyyymmdd
- //WERKS CHAR 4 0 必填 工厂 5020
- //LGORT_FM CHAR 4 0 必填 发出库位
- //LGORT_TO CHAR 4 0 必填 接收库位
- //MATNR CHAR 40 0 必填 物料编号
- //BWART CHAR 3 0 必填 移动类型(库存管理) 目前只允许填:311
- //MEINS UNIT 3 0 必填 基本计量单位
- //MENGE QUAN 13 3 必填 数量
- //ZDKNO CHAR 40 0 必填 东科单据号
- //输入参数
- IRfcTable imTable = rfcApi.GetTable("IT_ITEM");
- foreach (DataRow dr in dtTable.Rows)
- {
- imTable.Append();
- imTable.SetValue("BLDAT", BLDAT);
- imTable.SetValue("BUDAT", BLDAT);
- imTable.SetValue("WERKS", "5020");
- imTable.SetValue("LGORT_FM", "2205");
- imTable.SetValue("LGORT_TO", "1103");
- imTable.SetValue("MATNR", dr["MATNR"]);
- imTable.SetValue("CHARG", dr["CHARG"] + "");
- imTable.SetValue("BWART", "311");
- imTable.SetValue("MEINS", dr["MEINS"]);
- imTable.SetValue("MENGE", dr["MENGE"]);
- imTable.SetValue("ZDKNO", ZDKNO);
- }
- //调用接口
- rfcApi.Invoke(rfcDest);
- //获取输出
- ZTYPE = rfcApi.GetValue("ZTYPE").ToString();
- ZMSG = rfcApi.GetValue("ZMSG").ToString();
- IRfcTable table = rfcApi.GetTable("ET_RETURN");
- DataTable dt = GetDataTableFromRFCTable(table);
- rfcDest = null;
- rfcRep = null;
- return dt;
- }
- /// <summary>
- /// IRfcTable转DataTable
- /// </summary>
- /// <param name="myrfcTable"></param>
- /// <returns></returns>
- private static DataTable GetDataTableFromRFCTable(IRfcTable myrfcTable)
- {
- DataTable loTable = new DataTable();
- int liElement = 0;
- for (liElement = 0; liElement <= myrfcTable.ElementCount - 1; liElement++)
- {
- RfcElementMetadata metadata = myrfcTable.GetElementMetadata(liElement);
- loTable.Columns.Add(metadata.Name);
- }
- foreach (IRfcStructure Row in myrfcTable)
- {
- DataRow ldr = loTable.NewRow();
- for (liElement = 0; liElement <= myrfcTable.ElementCount - 1; liElement++)
- {
- RfcElementMetadata metadata = myrfcTable.GetElementMetadata(liElement);
- ldr[metadata.Name] = Row.GetString(metadata.Name);
- }
- loTable.Rows.Add(ldr);
- }
- return loTable;
- }
- }
|