public IRfcTable Rfc_Del_Dal(RFC_DEL_Model delModel, out RFC_IN_Message rfcMessage) { rfcMessage = new RFC_IN_Message(); try { _configurationId = new RFC_SetUp(); RfcDestinationManager.RegisterDestinationConfiguration(_configurationId); _dest = RfcDestinationManager.GetDestination("SAPMS"); _repository = _dest.Repository; IRfcFunction rfc = _repository.CreateFunction(delModel.FunctionModule); //调用函数名 IRfcTable table = rfc.GetTable(delModel.E_SAP_DEL); //RFC表数据 rfc.SetValue("I_MESKEY", delModel.I_MESKEY); //KEY随机号 不能重复 rfc.SetValue("I_DATE", delModel.I_DATE); //日期 rfc.SetValue("I_TIME", delModel.I_TIME); //时间 rfc.SetValue("I_USER", delModel.I_USER); //登录名 rfc.SetValue("I_VBELN", delModel.I_VBELN); rfc.Invoke(_dest); rfcMessage.E_RETURN_CODE = rfc.GetString("E_RETURN_CODE").ToString(); //rfcMessage.E_RETURN_MESSAGE = rfc.GetString("E_RETURN_MESSAGE").ToString(); rfcMessage.E_COUNT = rfc.GetInt("E_COUNT").ToString(); rfcMessage.E_SUM = rfc.GetInt("E_SUM").ToString(); return(table); } catch (Exception exception) { rfcMessage.E_RETURN_MESSAGE = "接口DEL 错误:" + exception.ToString(); return(null); } finally { RfcDestinationManager.UnregisterDestinationConfiguration(_configurationId); } }
/// <summary> /// DEL /// </summary> /// <param name="delModel"></param> /// <param name="rfcMessage"></param> /// <returns></returns> public DataTable Rfc_Del_DataTable(RFC_DEL_Model delModel, out RFC_IN_Message rfcMessage) { return(convertDataSap.ConversionDataTableRFCTable(rfcDelDal.Rfc_Del_Dal(delModel, out rfcMessage))); }