public BusinessObjectMethod CreateBapi(string BusinessObjectName, string MethodName)
        {
            des = SAPDestination.GetDesByName(m_sysName);
            IRfcFunction function = des.Repository.CreateFunction("SWO_QUERY_API_OBJTYPES");

            function["OBJECT_NAME"].SetValue(BusinessObjectName);
            function.Invoke(des);
            if (function.GetTable("OBJTYPES").RowCount == 0)
            {
                throw new Exception("Unable to find ObjectType for name '" + BusinessObjectName + "'");
            }
            string       str       = function.GetTable("OBJTYPES")[0]["OBJTYPE"].GetValue().ToString();
            IRfcFunction function2 = des.Repository.CreateFunction("SWO_QUERY_API_METHODS");

            function2["OBJTYPE"].SetValue(str);
            function2["WITH_TEXTS"].SetValue("");
            function2.Invoke(des);
            for (int i = 0; i < function2.GetTable("API_METHODS").RowCount; i++)
            {
                if (function2.GetTable("API_METHODS")[i]["METHOD"].GetValue().ToString().ToUpper().Equals(MethodName.ToUpper()))
                {
                    BusinessObjectMethod method = new BusinessObjectMethod(m_sysName)
                    {
                        MethodName = MethodName,
                        ObjectName = BusinessObjectName
                    };
                    // RFCFunction dest = method;
                    method.Name = function2.GetTable("API_METHODS")[i]["FUNCTION"].GetValue().ToString();
                    //this.AddParametersAndTablesToUndefinedFunctionObject(ref dest, method.Name);
                    //method.Connection = this;

                    return(method);
                }
            }
            throw new Exception(string.Format("Unable to find method_{0}_at Object Type_1", MethodName, str));
        }
        public BusinessObjectMethod CreateBapi(string BusinessObjectName, string MethodName)
        {
            des = SAPDestination.GetDesByName(m_sysName);
            IRfcFunction function = des.Repository.CreateFunction("SWO_QUERY_API_OBJTYPES");
            function["OBJECT_NAME"].SetValue(BusinessObjectName);
            function.Invoke(des);
            if (function.GetTable("OBJTYPES").RowCount == 0)
            {
                throw new Exception("Unable to find ObjectType for name '" + BusinessObjectName + "'");
            }
            string str = function.GetTable("OBJTYPES")[0]["OBJTYPE"].GetValue().ToString();
            IRfcFunction function2 = des.Repository.CreateFunction("SWO_QUERY_API_METHODS");
            function2["OBJTYPE"].SetValue(str);
            function2["WITH_TEXTS"].SetValue("");
            function2.Invoke(des);
            for (int i = 0; i < function2.GetTable("API_METHODS").RowCount; i++)
            {
                if (function2.GetTable("API_METHODS")[i]["METHOD"].GetValue().ToString().ToUpper().Equals(MethodName.ToUpper()))
                {
                    BusinessObjectMethod method = new BusinessObjectMethod(m_sysName)
                    {
                        MethodName = MethodName,
                        ObjectName = BusinessObjectName
                    };
                    // RFCFunction dest = method;
                    method.Name = function2.GetTable("API_METHODS")[i]["FUNCTION"].GetValue().ToString();
                    //this.AddParametersAndTablesToUndefinedFunctionObject(ref dest, method.Name);
                    //method.Connection = this;

                    return method;
                }
            }
            throw new Exception(string.Format("Unable to find method_{0}_at Object Type_1", MethodName, str));
        }