示例#1
0
        private DataTable RFC_Get_Unicode_Structure(string strTabName, out int nLen1, out int nLen2)
        {
            int nB1TabLen = 0;
            int nB2TabLen = 0;
            int nB4TabLen = 0;
            int nCharLen  = 0;

            byte[] btUUID = null;

            RFC_FLDS_UTable oFields = null;

            nLen1 = nLen2 = -1;

            if (this.Connection.IsOpen == false)
            {
                return(null);
            }

            try
            {
                oFields = new RFC_FLDS_UTable();

                RFC_GET_UNICODE_STRUCTURE("", "", "", strTabName, out nB1TabLen, out nB2TabLen, out nB4TabLen, out nCharLen, out btUUID, ref oFields);

                nLen1 = nB1TabLen;
                nLen2 = nB2TabLen;
            }
            catch (Exception exp)
            {
                throw exp;
            }

            return(oFields.ToADODataTable()); // Converts the SAP table to an ADO.NET DataTable.
        }
示例#2
0
        public virtual void RFC_GET_UNICODE_STRUCTURE(

            [RfcParameter(AbapName = "ALLOW_HALF_DEEP", RfcType = RFCTYPE.RFCTYPE_CHAR, Optional = true, Direction = RFCINOUT.IN, Length = 1, Length2 = 2)]
            [XmlElement("ALLOW_HALF_DEEP", IsNullable = false, Form = XmlSchemaForm.Unqualified)]
            string ALLOW_HALF_DEEP,
            [RfcParameter(AbapName = "SKIP_UCS_4_INFO", RfcType = RFCTYPE.RFCTYPE_CHAR, Optional = true, Direction = RFCINOUT.IN, Length = 1, Length2 = 2)]
            [XmlElement("SKIP_UCS_4_INFO", IsNullable = false, Form = XmlSchemaForm.Unqualified)]
            string SKIP_UCS_4_INFO,
            [RfcParameter(AbapName = "SKIP_UTF16_INFO", RfcType = RFCTYPE.RFCTYPE_CHAR, Optional = true, Direction = RFCINOUT.IN, Length = 1, Length2 = 2)]
            [XmlElement("SKIP_UTF16_INFO", IsNullable = false, Form = XmlSchemaForm.Unqualified)]
            string SKIP_UTF16_INFO,
            [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 = "B1_TABLENGTH", RfcType = RFCTYPE.RFCTYPE_INT, Optional = true, Direction = RFCINOUT.OUT, Length = 4, Length2 = 4)]
            [XmlElement("B1_TABLENGTH", IsNullable = false, Form = XmlSchemaForm.Unqualified)]
            out int B1_TABLENGTH,
            [RfcParameter(AbapName = "B2_TABLENGTH", RfcType = RFCTYPE.RFCTYPE_INT, Optional = true, Direction = RFCINOUT.OUT, Length = 4, Length2 = 4)]
            [XmlElement("B2_TABLENGTH", IsNullable = false, Form = XmlSchemaForm.Unqualified)]
            out int B2_TABLENGTH,
            [RfcParameter(AbapName = "B4_TABLENGTH", RfcType = RFCTYPE.RFCTYPE_INT, Optional = true, Direction = RFCINOUT.OUT, Length = 4, Length2 = 4)]
            [XmlElement("B4_TABLENGTH", IsNullable = false, Form = XmlSchemaForm.Unqualified)]
            out int B4_TABLENGTH,
            [RfcParameter(AbapName = "CHAR_LENGTH", RfcType = RFCTYPE.RFCTYPE_INT, Optional = true, Direction = RFCINOUT.OUT, Length = 4, Length2 = 4)]
            [XmlElement("CHAR_LENGTH", IsNullable = false, Form = XmlSchemaForm.Unqualified)]
            out int CHAR_LENGTH,
            [RfcParameter(AbapName = "UUID", RfcType = RFCTYPE.RFCTYPE_BYTE, Optional = true, Direction = RFCINOUT.OUT, Length = 16, Length2 = 16)]
            [XmlElement("UUID", IsNullable = false, Form = XmlSchemaForm.Unqualified)]
            out byte[] UUID,
            [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_FLDS_UTable FIELDS)
        {
            object[] results = null;
            results      = this.SAPInvoke("RFC_GET_UNICODE_STRUCTURE", new object[] { ALLOW_HALF_DEEP, SKIP_UCS_4_INFO, SKIP_UTF16_INFO, TABNAME, FIELDS });
            B1_TABLENGTH = (int)results[0];
            B2_TABLENGTH = (int)results[1];
            B4_TABLENGTH = (int)results[2];
            CHAR_LENGTH  = (int)results[3];
            UUID         = (byte[])results[4];
            FIELDS       = (RFC_FLDS_UTable)results[5];
        }