Example #1
0
        public IRfcTable Rfc_Stock_dal(RFC_STOCK_Model StockModel, 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(StockModel.FunctionModule); //调用函数名
                IRfcTable    table = rfc.GetTable(StockModel.L_MM_STOCK);                   //RFC表数据
                rfc.SetValue("I_FLAG", "J");
                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 = "接口STOCK错误:" + exception.ToString();
                return(null);
            }
            finally
            {
                RfcDestinationManager.UnregisterDestinationConfiguration(_configurationId);
            }
        }
Example #2
0
 /// <summary>
 /// STOCK
 /// </summary>
 /// <param name="fgsModel"></param>
 /// <param name="rfcMessage"></param>
 /// <returns></returns>
 public DataTable Rfc_Stock_DataTable(RFC_STOCK_Model StockModel, out RFC_IN_Message rfcMessage)
 {
     return(convertDataSap.ConversionDataTableRFCTable(rfcStock.Rfc_Stock_dal(StockModel, out rfcMessage)));
 }