/// <summary> /// 查询RFC数据(无查询参数) /// </summary> /// <param name="ConnectionSAP">链接信息</param> /// <param name="interfaceFunName">接口名称</param> /// <returns></returns> public ReturnResult Get_RFC_Info_By_NoParam(ref DataTable dataTable_put, R3Connection ConnectionSAP, string interfaceFunName) { RFCTable rfcTable_ERR = new RFCTable(); ReturnResult result = new ReturnResult(); RFCFunction function = null; try { function = ConnectionSAP.CreateFunction(interfaceFunName); function.Execute(); rfcTable_ERR = function.Tables["T_OUTTAB"];//out table dataTable_put = rfcTable_ERR.ToADOTable(); ConnectionSAP.Close(); result.Status = true; result.Message = "OK"; } catch (Exception ex) { result.Status = false; result.Message = ex.Message; this.logHandler.Error(MethodBase.GetCurrentMethod().Name, "Call Get_RFC_Info_By_NoParam Fail: " + ex.Message); } return(result); }
/// <summary> /// 根据参数查询RFC数据 /// </summary> /// <param name="refStr">查询返回信息</param> /// <param name="ConnectionSAP">链接信息</param> /// <param name="interfaceFunName">接口名称</param> /// <param name="tbParam">料号</param> /// <returns></returns> public ReturnResult Get_RFC_Info_By_Param(ref string rfcRes, R3Connection ConnectionSAP, string interfaceFunName, DataTable tbParam) { RFCTable rfcTable_ERR = new RFCTable(); ReturnResult result = new ReturnResult(); RFCFunction function = null; try { RFCTableColumnCollection ff = new RFCTableColumnCollection(); function = ConnectionSAP.CreateFunction(interfaceFunName); RFCTable info_table_H = function.Tables["IT_ZPPT6017"];//in table foreach (DataRow row in tbParam.Rows) { RFCStructure rfcStruc_H = info_table_H.AddRow(); rfcStruc_H["AUFNR"] = row[0]; //MO 编号 rfcStruc_H["MO_NO"] = row[1]; //MO 排序 } function.Execute(); //rfcTable_ERR = function.Tables["IT_ZPPT6017"];//out table //dataTable_put = rfcTable_ERR.ToADOTable(); rfcRes = function.Imports["E_FLAG"].ParamValue.ToString().Trim(); ConnectionSAP.Close(); result.Status = true; result.Message = "OK"; } catch (Exception ex) { result.Status = false; result.Message = ex.Message; this.logHandler.Error(MethodBase.GetCurrentMethod().Name, "Call Get_RFC_Info_By_Param Fail: " + ex.Message); } return(result); }