/// <summary>
        /// RFC 구조체(테이블) 형태의 정의 내역을 반환한다. SAP 서버에 연결되지 않은 경우, null 값을 반환
        /// </summary>
        /// <param name="strTabName">구조체(테이블) 이름</param>
        /// <param name="nTabLen">구조체(테이블) 길이</param>
        /// <returns>RFC 구조체(테이블) 형태의 정의 내역 (ADO.NET DataTable)</returns>
        private DataTable RFC_Get_Structure_Definition(string strTabName, out int nTabLen)
        {
            RFC_FIELDSTable oRFCFT = null;

            nTabLen = -1;

            // SAP 서버에 연결되지 않은 경우, null 값을 반환하고 함수를 종료한다.
            if (this.Connection.IsOpen == false)
            {
                return(null);
            }

            try
            {
                oRFCFT = new RFC_FIELDSTable();

                RFC_GET_STRUCTURE_DEFINITION(strTabName, null, out nTabLen, ref oRFCFT);
            }
            catch (Exception exp)
            {
                throw exp;
            }

            return(oRFCFT.ToADODataTable()); // Converts the SAP table to an ADO.NET DataTable.
        }
Beispiel #2
0
        public virtual void RFC_GET_STRUCTURE_DEFINITION(

            [RfcParameter(AbapName = "TABNAME", RfcType = RFCTYPE.RFCTYPE_CHAR, Optional = false, Direction = RFCINOUT.IN, Length = 30, Length2 = 60)]
            [XmlElement("TABNAME", IsNullable = false, Form = XmlSchemaForm.Unqualified)]
            string TABNAME,
            [RfcParameter(AbapName = "UCLEN", RfcType = RFCTYPE.RFCTYPE_BYTE, Optional = true, Direction = RFCINOUT.IN, Length = 1, Length2 = 1)]
            [XmlElement("UCLEN", IsNullable = false, Form = XmlSchemaForm.Unqualified)]
            byte[] UCLEN,
            [RfcParameter(AbapName = "TABLENGTH", RfcType = RFCTYPE.RFCTYPE_INT, Optional = true, Direction = RFCINOUT.OUT, Length = 4, Length2 = 4)]
            [XmlElement("TABLENGTH", IsNullable = false, Form = XmlSchemaForm.Unqualified)]
            out int TABLENGTH,
            [RfcParameter(AbapName = "FIELDS", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = false, Direction = RFCINOUT.INOUT)]
            [XmlArray("FIELDS", IsNullable = false, Form = XmlSchemaForm.Unqualified)]
            [XmlArrayItem("item", IsNullable = false, Form = XmlSchemaForm.Unqualified)]
            ref RFC_FIELDSTable FIELDS)
        {
            object[] results = null;
            results   = this.SAPInvoke("RFC_GET_STRUCTURE_DEFINITION", new object[] { TABNAME, UCLEN, FIELDS });
            TABLENGTH = (int)results[0];
            FIELDS    = (RFC_FIELDSTable)results[1];
        }