public virtual QuerySelectionParameter this[int Index]
 {
     get
     {
         return((QuerySelectionParameter)base.List[Index]);
     }
     set
     {
         QuerySelectionParameter parameter = (QuerySelectionParameter)base.List[Index];
         if (!parameter.ABAPType.Equals("") && value.ABAPType.Equals(""))
         {
             value.ABAPType = parameter.ABAPType;
         }
         if (!parameter.DescriptionText.Equals("") && value.DescriptionText.Equals(""))
         {
             value.DescriptionText = parameter.DescriptionText;
         }
         if (!parameter.FieldName.Equals("") && value.FieldName.Equals(""))
         {
             value.FieldName = parameter.FieldName;
         }
         if (!parameter.Name.Equals("") && value.Name.Equals(""))
         {
             value.Name = parameter.Name;
         }
         if ((parameter.Length > 0) && (value.Length == 0))
         {
             value.Length = parameter.Length;
         }
         base.List[Index] = value;
     }
 }
Beispiel #2
0
        internal void RefreshFieldsAndSelections()
        {
            if (this._UserGroup.Trim().Equals("") || this._Name.Trim().Equals(""))
            {
                throw new SAPException(Messages.PleasemakesurethatthefieldsUserGroupandNamearefilledcorrectly);
            }
            //RFCFunction function = RFCFunctionFactory.GenerateFunctionObjectForRSAQ_REMOTE_QUERY_FIELDLIST(this._con.IsUnicode);
            IRfcFunction function = _des.Repository.CreateFunction("RSAQ_REMOTE_QUERY_FIELDLIST");

            //function.Connection = this._con;
            if (this._WorkArea == WorkSpace.StandardArea)
            {
                function.SetValue("WORKSPACE", " ");
            }
            else
            {
                function.SetValue("WORKSPACE", "X");
            }
            function["QUERY"].SetValue(this._Name);
            function.SetValue("USERGROUP", this._UserGroup);
            //function.Exports["USERGROUP"].ParamValue = this._UserGroup;
            try
            {
                function.Invoke(_des);
                // function.Execute();
                IRfcTable table  = function.GetTable("FIELDS");
                IRfcTable table2 = function.GetTable("SEL_FIELDS");
                this._Fields.Clear();
                this._SelectionParameters.Clear();
                string str = "";
                foreach (IRfcStructure structure in table.ToList())
                {
                    if (str == "")
                    {
                        str = structure["LID"].GetValue().ToString();
                    }
                    if (str == structure["LID"].GetValue().ToString())
                    {
                        QueryField newParameter = new QueryField(structure["NAME"].GetValue().ToString(), structure["TYPE"].GetValue().ToString(), Convert.ToInt32(structure["OLENG"].GetValue()), Convert.ToInt32(structure["DECIMALS"].GetValue()), "");
                        this._Fields.Add(newParameter);
                        if ((!structure["CURRY"].GetValue().ToString().Trim().Equals("") && !structure["CURRY"].GetValue().ToString().Trim().Equals("W")) && !structure["CURRY"].GetValue().ToString().Trim().Equals("E"))
                        {
                            QueryField field2 = new QueryField(structure["NAME"].GetValue().ToString() + "-" + structure["LINE"].GetValue().ToString() + structure["POS"].GetValue().ToString(), "C", 10, 0, "");
                            this._Fields.Add(field2);
                        }
                    }
                }
                foreach (IRfcStructure structure2 in table2.ToList())
                {
                    if (!structure2["SPNAME"].GetValue().ToString().Substring(0, 1).Equals("%"))
                    {
                        string descriptionText = structure2["FTEXT"].GetValue().ToString();
                        if (descriptionText.StartsWith("D       "))
                        {
                            descriptionText = descriptionText.Substring(8);
                        }
                        QuerySelectionParameter parameter = new QuerySelectionParameter(structure2["SPNAME"].GetValue().ToString(), structure2["FNAME"].GetValue().ToString(), descriptionText, Convert.ToInt32(structure2["LENGTH"].GetValue()), structure2["OBLIGATORY"].GetValue().ToString().Equals("X"), structure2["NODISPLAY"].GetValue().ToString().Equals("X"), structure2["KIND"].GetValue().ToString().Equals("S") ? Kind.SelectOption : Kind.Parameter);
                        this.SelectionParameters.Add(parameter);
                    }
                }
            }
            catch (RfcAbapException ee)
            {
                throw new SAPException(ee.Key + ee.Message);
            }
            catch (Exception ee)
            {
                throw new SAPException(ee.Message);
            }
        }
 internal void RefreshFieldsAndSelections()
 {
     if (this._UserGroup.Trim().Equals("") || this._Name.Trim().Equals(""))
     {
         throw new SAPException(Messages.PleasemakesurethatthefieldsUserGroupandNamearefilledcorrectly);
     }
     //RFCFunction function = RFCFunctionFactory.GenerateFunctionObjectForRSAQ_REMOTE_QUERY_FIELDLIST(this._con.IsUnicode);
     IRfcFunction function = _des.Repository.CreateFunction("RSAQ_REMOTE_QUERY_FIELDLIST");
     //function.Connection = this._con;
     if (this._WorkArea == WorkSpace.StandardArea)
     {
         function.SetValue("WORKSPACE", " ");
     }
     else
     {
         function.SetValue("WORKSPACE", "X");
     }
     function["QUERY"].SetValue(this._Name);
     function.SetValue("USERGROUP", this._UserGroup);
     //function.Exports["USERGROUP"].ParamValue = this._UserGroup;
     try
     {
         function.Invoke(_des);
         // function.Execute();
         IRfcTable table = function.GetTable("FIELDS");
         IRfcTable table2 = function.GetTable("SEL_FIELDS");
         this._Fields.Clear();
         this._SelectionParameters.Clear();
         string str = "";
         foreach (IRfcStructure structure in table.ToList())
         {
             if (str == "")
             {
                 str = structure["LID"].GetValue().ToString();
             }
             if (str == structure["LID"].GetValue().ToString())
             {
                 QueryField newParameter = new QueryField(structure["NAME"].GetValue().ToString(), structure["TYPE"].GetValue().ToString(), Convert.ToInt32(structure["OLENG"].GetValue()), Convert.ToInt32(structure["DECIMALS"].GetValue()), "");
                 this._Fields.Add(newParameter);
                 if ((!structure["CURRY"].GetValue().ToString().Trim().Equals("") && !structure["CURRY"].GetValue().ToString().Trim().Equals("W")) && !structure["CURRY"].GetValue().ToString().Trim().Equals("E"))
                 {
                     QueryField field2 = new QueryField(structure["NAME"].GetValue().ToString() + "-" + structure["LINE"].GetValue().ToString() + structure["POS"].GetValue().ToString(), "C", 10, 0, "");
                     this._Fields.Add(field2);
                 }
             }
         }
         foreach (IRfcStructure structure2 in table2.ToList())
         {
             if (!structure2["SPNAME"].GetValue().ToString().Substring(0, 1).Equals("%"))
             {
                 string descriptionText = structure2["FTEXT"].GetValue().ToString();
                 if (descriptionText.StartsWith("D       "))
                 {
                     descriptionText = descriptionText.Substring(8);
                 }
                 QuerySelectionParameter parameter = new QuerySelectionParameter(structure2["SPNAME"].GetValue().ToString(), structure2["FNAME"].GetValue().ToString(), descriptionText, Convert.ToInt32(structure2["LENGTH"].GetValue()), structure2["OBLIGATORY"].GetValue().ToString().Equals("X"), structure2["NODISPLAY"].GetValue().ToString().Equals("X"), structure2["KIND"].GetValue().ToString().Equals("S") ? Kind.SelectOption : Kind.Parameter);
                 this.SelectionParameters.Add(parameter);
             }
         }
     }
     catch (RfcAbapException ee)
     {
         throw new SAPException(ee.Key + ee.Message);
     }
     catch (Exception ee)
     {
         throw new SAPException(ee.Message);
     }
 }
 // Methods
 public virtual void Add(QuerySelectionParameter NewParameter)
 {
     base.List.Add(NewParameter);
 }
 // Methods
 public virtual void Add(QuerySelectionParameter NewParameter)
 {
     base.List.Add(NewParameter);
 }