Example #1
0
        /// <summary>
        /// execute with Executetable
        /// </summary>
        /// <param name="trxContext">TransactionContext</param>
        /// <param name="parameterList">SAPParameterList</param>
        /// <returns></returns>
        public SAPFunction ExecuteTable(TransactionContext trxContext, SAPParameterList parameterList)
        {
            SetCommandParameterTable(parameterList);

            DefaultSAPFunction sapFunction = new DefaultSAPFunction();

            try
            {
                sapFunction.Invoke(this.rfcDestination, rfcFunction);
                MessageData messageData = new MessageData("scci00002", Properties.Resources.scci00002, this.rfcDestination.Name.ToString());
                logger.Info(messageData);
            }
            catch (RfcAbapRuntimeException ex)
            {
                MessageData messageData = new MessageData("scce00016", Properties.Resources.scce00016, ex.GetType().Name.ToString(), ex.Message);
                logger.Error(messageData, ex);
                throw new Framework.SystemException(messageData, ex);
            }
            catch (RfcInvalidStateException ex)
            {
                MessageData messageData = new MessageData("scce00017", Properties.Resources.scce00017, ex.GetType().Name.ToString(), ex.Message);
                logger.Error(messageData, ex);
                throw new Framework.SystemException(messageData, ex);
            }
            catch (Exception ex)
            {
                MessageData messageData = new MessageData("scce00018", Properties.Resources.scce00018, ex.GetType().Name.ToString(), ex.Message);
                logger.Error(messageData, ex);
                throw new Framework.SystemException(messageData);
            }
            return(sapFunction);
        }
Example #2
0
        /// <summary>
        /// execute with ExecuteReader
        /// </summary>
        /// <param name="trxContext"></param>
        /// <param name="parameterList"></param>
        /// <returns></returns>
        public SAPFunction ExecuteTable(TransactionContext trxContext, SAPParameterList parameterList)
        {
            SetCommandParameterTable(rfcFunction, parameterList);

            DefaultSAPFunction sapFunction = new DefaultSAPFunction();

            sapFunction.Invoke(this.rfcDestination, rfcFunction);

            return(sapFunction);
        }
Example #3
0
        /// <summary>
        /// execute with ExecuteReader
        /// </summary>
        /// <param name="trxContext">TransactionContext</param>
        /// <param name="parameterList">SAPParameterList</param>
        /// <returns></returns>
        public SAPFunction Execute(TransactionContext trxContext, SAPParameterList parameterList)
        {
            SetCommandParameter(parameterList);

            DefaultSAPFunction sapFunction = new DefaultSAPFunction();

            try
            {
                sapFunction.Invoke(this.rfcDestination, rfcFunction);

                MessageData messageData = new MessageData("scci00002", Properties.Resources.scci00002, this.rfcDestination.Name.ToString());
                logger.Info(messageData);
            }
            catch (RfcAbapRuntimeException ex)
            {
                //cannot serialize sap rfc exception hence passing exception name and message to the messagedata
                MessageData messageData = new MessageData("scce00005", Properties.Resources.scce00005, ex.GetType().Name.ToString(), ex.Message);
                logger.Error(messageData, ex);
                throw new Framework.SystemException(messageData);
            }
            catch (RfcInvalidStateException ex)
            {
                //cannot serialize sap rfc exception hence passing exception name and message to the messagedata
                MessageData messageData = new MessageData("scce00009", Properties.Resources.scce00009, ex.GetType().Name.ToString(), ex.Message);
                logger.Error(messageData, ex);
                throw new Framework.SystemException(messageData);
            }
            catch (Exception ex)
            {
                //cannot serialize sap rfc exception hence passing exception name and message to the messagedata
                MessageData messageData = new MessageData("scce00007", Properties.Resources.scce00007, ex.GetType().Name.ToString(), ex.Message);
                logger.Error(messageData, ex);
                throw new Framework.SystemException(messageData);
            }
            return(sapFunction);
        }