public ReadTableFieldCollection GetAllFieldsOfTable() { ReadTableFieldCollection fields = new ReadTableFieldCollection(); if (string.IsNullOrEmpty(this.TableName)) { return(null); } IRfcFunction function = _des.Repository.CreateFunction("DDIF_FIELDINFO_GET"); function["LANGU"].SetValue(Converts.languageIsotoSap(this._des.Language)); function["TABNAME"].SetValue(this.TableName); try { function.Invoke(_des); for (int k = 0; k < function.GetTable("DFIES_TAB").RowCount; k++) { IRfcStructure structure = function.GetTable("DFIES_TAB")[k]; fields.Add(new ReadTableField(structure["FIELDNAME"].GetValue().ToString(), Convert.ToInt32(structure["OUTPUTLEN"].GetValue()), structure["INTTYPE"].GetValue().ToString(), structure["FIELDTEXT"].GetValue().ToString(), Convert.ToInt32(structure["DECIMALS"].GetValue()), structure["CHECKTABLE"].GetValue().ToString())); } return(fields); } catch (RfcAbapException ee) { throw new SAPException(ee.Key + ee.Message); } }
//public ReadTable() //{ // this.fields = new ArrayList(); // this.options = new ArrayList(); // this._PrimaryKeys = new ReadTableFieldCollection(); // this._TableName = ""; // this._Fields = new ReadTableFieldCollection(); // this._WhereClause = ""; // this._Delimiter = ""; // this._FunctionName = ""; // this.BackgroundRequestID = ""; // this.BufferLocation = ""; // this._LastPrimaryKey = ""; //} public ReadTable(string sysName) { this.fields = new ArrayList(); this.options = new ArrayList(); this._PrimaryKeys = new ReadTableFieldCollection(); this._TableName = ""; this._Fields = new ReadTableFieldCollection(); this._WhereClause = ""; this._Delimiter = ""; this._FunctionName = ""; this.BackgroundRequestID = ""; this.BufferLocation = ""; this._LastPrimaryKey = ""; this._des = SAPDestination.GetDesByName(sysName); //if (Connection.Codepage.Equals("8000")) //{ // this._Delimiter = "|"; //} //Connection.Log("ReadTable() Connection.Codepage = " + Connection.Codepage); }
//public ReadTable() //{ // this.fields = new ArrayList(); // this.options = new ArrayList(); // this._PrimaryKeys = new ReadTableFieldCollection(); // this._TableName = ""; // this._Fields = new ReadTableFieldCollection(); // this._WhereClause = ""; // this._Delimiter = ""; // this._FunctionName = ""; // this.BackgroundRequestID = ""; // this.BufferLocation = ""; // this._LastPrimaryKey = ""; //} public ReadTable(string sysName) { this.fields = new ArrayList(); this.options = new ArrayList(); this._PrimaryKeys = new ReadTableFieldCollection(); this._TableName = ""; this._Fields = new ReadTableFieldCollection(); this._WhereClause = ""; this._Delimiter = ""; this._FunctionName = ""; this.BackgroundRequestID = ""; this.BufferLocation = ""; this._LastPrimaryKey = ""; this._des = SAPDestination.GetDesByName(sysName); //if (Connection.Codepage.Equals("8000")) //{ // this._Delimiter = "|"; //} //Connection.Log("ReadTable() Connection.Codepage = " + Connection.Codepage); }
public ReadTableFieldCollection GetAllFieldsOfTable() { ReadTableFieldCollection fields = new ReadTableFieldCollection(); if (string.IsNullOrEmpty(this.TableName)) { return null; } IRfcFunction function = _des.Repository.CreateFunction("DDIF_FIELDINFO_GET"); function["LANGU"].SetValue(Converts.languageIsotoSap(this._des.Language)); function["TABNAME"].SetValue(this.TableName); try { function.Invoke(_des); for (int k = 0; k < function.GetTable("DFIES_TAB").RowCount; k++) { IRfcStructure structure = function.GetTable("DFIES_TAB")[k]; fields.Add(new ReadTableField(structure["FIELDNAME"].GetValue().ToString(), Convert.ToInt32(structure["OUTPUTLEN"].GetValue()), structure["INTTYPE"].GetValue().ToString(), structure["FIELDTEXT"].GetValue().ToString(), Convert.ToInt32(structure["DECIMALS"].GetValue()), structure["CHECKTABLE"].GetValue().ToString())); } return fields; } catch (RfcAbapException ee) { throw new SAPException(ee.Key + ee.Message); } }