public IRfcTable Rfc_Move_Dal(RFC_MOVE_Model MoveModel, 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(MoveModel.FunctionModule); //调用函数名 IRfcTable table = rfc.GetTable(MoveModel.L_MM_MOVE); //RFC表数据 rfc.SetValue("I_BUDAT", MoveModel.I_BUDAT); rfc.SetValue("I_FLAG", "K"); rfc.Invoke(_dest); rfcMessage.E_RETURN_CODE = rfc.GetString("E_SUBRC").ToString(); rfcMessage.E_RETURN_MESSAGE = rfc.GetString("E_MESSAGE").ToString(); return(table); } catch (Exception exception) { rfcMessage.E_RETURN_MESSAGE = "接口MOVE错误:" + exception.ToString(); return(null); } finally { RfcDestinationManager.UnregisterDestinationConfiguration(_configurationId); } }
/// <summary> /// MOVE /// </summary> /// <param name="fgsModel"></param> /// <param name="rfcMessage"></param> /// <returns></returns> public DataTable Rfc_Move_DataTable(RFC_MOVE_Model MoveModel, out RFC_IN_Message rfcMessage) { return(convertDataSap.ConversionDataTableRFCTable(rfcMove.Rfc_Move_Dal(MoveModel, out rfcMessage))); }