예제 #1
0
        public virtual void Zrfc_Buro_Bp(

            [RfcParameter(AbapName = "ID_CONSULTA", RfcType = RFCTYPE.RFCTYPE_CHAR, Optional = false, Direction = RFCINOUT.IN, Length = 13, Length2 = 26)]
            [XmlElement("ID_--5fCONSULTA", IsNullable = false, Namespace = "")]
            string Id_Consulta,
            [RfcParameter(AbapName = "PARTNER", RfcType = RFCTYPE.RFCTYPE_CHAR, Optional = true, Direction = RFCINOUT.IN, Length = 10, Length2 = 20)]
            [XmlElement("PARTNER", IsNullable = false, Namespace = "")]
            string Partner,
            [RfcParameter(AbapName = "INTL", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("INTL", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_INTLTable Intl,
            [RfcParameter(AbapName = "PA", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("PA", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_PATable Pa,
            [RfcParameter(AbapName = "PN", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("PN", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_PNTable Pn)
        {
            object[] results = null;
            results = this.SAPInvoke("Zrfc_Buro_Bp", new object[] {
                Id_Consulta, Partner, Intl, Pa, Pn
            });
            Intl = (Z00_BURO_INTLTable)results[0];
            Pa   = (Z00_BURO_PATable)results[1];
            Pn   = (Z00_BURO_PNTable)results[2];
        }
예제 #2
0
        public void ConsultaFinalAlRFC(string idConsulta, string partner)
        {
            SapConnectorClientToBC proxy         = conn.establecerConeccionSap();
            Z00_BURO_INTLTable     resultadoIntl = new Z00_BURO_INTLTable();
            Z00_BURO_PNTable       resultadoPN   = new Z00_BURO_PNTable();
            Z00_BURO_PATable       resultadoPA   = new Z00_BURO_PATable();

            try
            {
                proxy.Connection.Open();
                proxy.Zrfc_Buro_Bp(idConsulta, partner, ref resultadoIntl, ref resultadoPA, ref resultadoPN);
                proxy.Connection.Close();
            }
            catch (SAP.Connector.RfcLogonException a)
            {
                Console.WriteLine("Existe un error el Usuario o contraseña, el sistema no se ha podido conectar " + a);
            }
            catch (SAP.Connector.RfcCommunicationException a)
            {
                Console.WriteLine("El usuario se tardo demacionado en aceptar que la conexion era segura" + a);
            }
            catch (SAP.Connector.RfcException a)
            {
                Console.WriteLine("No se encontro el RFC" + a);
            }
            //Begin JRojas : Convierte del resulta de ABAP a ojetos locales de .NET para facilitar su manejo

            /*DataTable dt = resultadoIntl.ToADODataTable();
             * DataTable dt2 = resultadoPN.ToADODataTable();
             * DataTable dt3 = resultadoPA.ToADODataTable();
             *
             * FormatoINTL objConsulta = new FormatoINTL();
             *
             * objConsulta.setDataTableEncabezadoIntl(dt);//Envie a la clase FormateINTL su correspondiente datatable
             * objConsulta.setDataTableSegmentoPN(dt2);//Envie a la clase FormateINTL su correspondiente datatable
             * objConsulta.setDataTableSegmentoPA(dt3);//Envie a la clase FormateINTL su correspondiente datatable
             */
            dataTableEncabezadoIntl = resultadoIntl.ToADODataTable();
            dataTableSegmentoPN     = resultadoPN.ToADODataTable();
            dataTableSegmentoPA     = resultadoPA.ToADODataTable();


            //END JRojas

            //BEGIN JRojas : Para la creacion la consulta se tienen que mandar llamar en este orden
            string Consulta;

            Consulta  = EncabezadoINTL();
            Consulta += SegmentoDeNombre();
            Consulta += SegmentoDeDireccion();
            Consulta  = SegmentoDeCierre(Consulta);
            Console.WriteLine(Consulta);
        }
예제 #3
0
        public void ConsultaFinalAlRFC(string idConsulta,string partner)
        {
            SapConnectorClientToBC proxy = conn.establecerConeccionSap();
            Z00_BURO_INTLTable resultadoIntl = new Z00_BURO_INTLTable();
            Z00_BURO_PNTable resultadoPN = new Z00_BURO_PNTable();
            Z00_BURO_PATable resultadoPA = new Z00_BURO_PATable();
            try
            {
                proxy.Connection.Open();
                proxy.Zrfc_Buro_Bp(idConsulta,partner,ref resultadoIntl,ref resultadoPA,ref resultadoPN);
                proxy.Connection.Close();
            }
            catch(SAP.Connector.RfcLogonException a)
            {
                Console.WriteLine("Existe un error el Usuario o contraseña, el sistema no se ha podido conectar "+a);
            }
            catch(SAP.Connector.RfcCommunicationException a)
            {
                Console.WriteLine("El usuario se tardo demacionado en aceptar que la conexion era segura"+a);

            }
            catch(SAP.Connector.RfcException a)
            {
                Console.WriteLine("No se encontro el RFC"+a);

            }
            //Begin JRojas : Convierte del resulta de ABAP a ojetos locales de .NET para facilitar su manejo
            /*DataTable dt = resultadoIntl.ToADODataTable();
            DataTable dt2 = resultadoPN.ToADODataTable();
            DataTable dt3 = resultadoPA.ToADODataTable();

            FormatoINTL objConsulta = new FormatoINTL();

            objConsulta.setDataTableEncabezadoIntl(dt);//Envie a la clase FormateINTL su correspondiente datatable
            objConsulta.setDataTableSegmentoPN(dt2);//Envie a la clase FormateINTL su correspondiente datatable
            objConsulta.setDataTableSegmentoPA(dt3);//Envie a la clase FormateINTL su correspondiente datatable
            */
            dataTableEncabezadoIntl= resultadoIntl.ToADODataTable();
            dataTableSegmentoPN = resultadoPN.ToADODataTable();
            dataTableSegmentoPA = resultadoPA.ToADODataTable();

            //END JRojas

            //BEGIN JRojas : Para la creacion la consulta se tienen que mandar llamar en este orden
            string Consulta;
            Consulta = EncabezadoINTL();
            Consulta += SegmentoDeNombre();
            Consulta += SegmentoDeDireccion();
            Consulta = SegmentoDeCierre(Consulta);
            Console.WriteLine(Consulta);
        }
예제 #4
0
        public string ConsultaFinalAlRFC(string idConsulta,string partner)
        {
            SapConnectorClientToBC proxy = conn.establecerConeccionSap();

            Z00_BURO_INTLTable resultadoIntl = new Z00_BURO_INTLTable();
            Z00_BURO_PNTable resultadoPN = new Z00_BURO_PNTable();
            Z00_BURO_PATable resultadoPA = new Z00_BURO_PATable();
            try
            {
                proxy.Connection.Open();
                proxy.Zrfc_Buro_Bp(idConsulta,partner,ref resultadoIntl,ref resultadoPA,ref resultadoPN);
                proxy.Connection.Close();
            }
            catch(SAP.Connector.RfcLogonException a)
            {
                Console.WriteLine("*Existe un error el Usuario o contrasena, el sistema no se ha podido conectar a SAP.");
                Console.WriteLine("Excepcion en .NET:  \n " + a);
                System.Environment.Exit(0);
            }
            catch(SAP.Connector.RfcCommunicationException a)
            {
                Console.WriteLine("*No se encontrado el Servidor o el usuario se tardo demacionado en aceptar que la conexion era segura.\n");
                Console.WriteLine("Excepcion en .NET:  \n " + a);
                System.Environment.Exit(0);
            }
            catch(SAP.Connector.RfcException a)
            {
                Console.WriteLine("*No se encontro el RFC.\n");
                Console.WriteLine("Excepcion en .NET:  \n " + a);
                System.Environment.Exit(0);
            }
            catch (Exception a)
            {
                Console.WriteLine("*Excepcion desconocida.\n");
                Console.WriteLine("Excepcion en .NET:  \n " + a);
                System.Environment.Exit(0);
            }

            dataTableEncabezadoIntl= resultadoIntl.ToADODataTable();
            dataTableSegmentoPN = resultadoPN.ToADODataTable();
            dataTableSegmentoPA = resultadoPA.ToADODataTable();

            string Consulta;
            Consulta = EncabezadoINTL();
            Consulta += SegmentoDeNombre();
            Consulta += SegmentoDeDireccion();
            Consulta = SegmentoDeCierre(Consulta);
            if (Consulta != "")
            {
                #region Remplazar acentos y caracteres varios
                Consulta = Consulta.Replace("ñ", "n");
                Consulta = Consulta.Replace("Ñ", "N");
                Consulta = Consulta.Replace("á", "a");
                Consulta = Consulta.Replace("à", "a");
                Consulta = Consulta.Replace("ä", "a");
                Consulta = Consulta.Replace("é", "e");
                Consulta = Consulta.Replace("è", "e");
                Consulta = Consulta.Replace("ë", "e");
                Consulta = Consulta.Replace("í", "i");
                Consulta = Consulta.Replace("ì", "i");
                Consulta = Consulta.Replace("ï", "i");
                Consulta = Consulta.Replace("ó", "o");
                Consulta = Consulta.Replace("ò", "o");
                Consulta = Consulta.Replace("ö", "o");
                Consulta = Consulta.Replace("ú", "u");
                Consulta = Consulta.Replace("ù", "u");
                Consulta = Consulta.Replace("u", "u");
                Consulta = Consulta.Replace("Á", "A");
                Consulta = Consulta.Replace("À", "A");
                Consulta = Consulta.Replace("Ä", "A");
                Consulta = Consulta.Replace("É", "E");
                Consulta = Consulta.Replace("È", "E");
                Consulta = Consulta.Replace("Ë", "E");
                Consulta = Consulta.Replace("Í", "I");
                Consulta = Consulta.Replace("Ì", "I");
                Consulta = Consulta.Replace("Ï", "I");
                Consulta = Consulta.Replace("Ó", "O");
                Consulta = Consulta.Replace("Ò", "O");
                Consulta = Consulta.Replace("Ö", "O");
                Consulta = Consulta.Replace("Ú", "U");
                Consulta = Consulta.Replace("Ù", "U");
                Consulta = Consulta.Replace("Ü", "U");
                Consulta = Consulta.Replace("ç", "c");
                Consulta = Consulta.Replace("Ç", "C");
                Consulta = Consulta.Replace("|", " ");
                #endregion
            }
            if (existenRequeritos == false)
            {
                this.verificarRequeridos();
            }
            return Consulta;
        }
예제 #5
0
        public string ConsultaFinalAlRFC(string idConsulta, string partner)
        {
            SapConnectorClientToBC proxy = conn.establecerConeccionSap();

            Z00_BURO_INTLTable resultadoIntl = new Z00_BURO_INTLTable();
            Z00_BURO_PNTable   resultadoPN   = new Z00_BURO_PNTable();
            Z00_BURO_PATable   resultadoPA   = new Z00_BURO_PATable();

            try
            {
                proxy.Connection.Open();
                proxy.Zrfc_Buro_Bp(idConsulta, partner, ref resultadoIntl, ref resultadoPA, ref resultadoPN);
                proxy.Connection.Close();
            }
            catch (SAP.Connector.RfcLogonException a)
            {
                Console.WriteLine("*Existe un error el Usuario o contrasena, el sistema no se ha podido conectar a SAP.");
                Console.WriteLine("Excepcion en .NET:  \n " + a);
                System.Environment.Exit(0);
            }
            catch (SAP.Connector.RfcCommunicationException a)
            {
                Console.WriteLine("*No se encontrado el Servidor o el usuario se tardo demacionado en aceptar que la conexion era segura.\n");
                Console.WriteLine("Excepcion en .NET:  \n " + a);
                System.Environment.Exit(0);
            }
            catch (SAP.Connector.RfcException a)
            {
                Console.WriteLine("*No se encontro el RFC.\n");
                Console.WriteLine("Excepcion en .NET:  \n " + a);
                System.Environment.Exit(0);
            }
            catch (Exception a)
            {
                Console.WriteLine("*Excepcion desconocida.\n");
                Console.WriteLine("Excepcion en .NET:  \n " + a);
                System.Environment.Exit(0);
            }

            dataTableEncabezadoIntl = resultadoIntl.ToADODataTable();
            dataTableSegmentoPN     = resultadoPN.ToADODataTable();
            dataTableSegmentoPA     = resultadoPA.ToADODataTable();

            string Consulta;

            Consulta  = EncabezadoINTL();
            Consulta += SegmentoDeNombre();
            Consulta += SegmentoDeDireccion();
            Consulta  = SegmentoDeCierre(Consulta);
            if (Consulta != "")
            {
                #region Remplazar acentos y caracteres varios
                Consulta = Consulta.Replace("ñ", "n");
                Consulta = Consulta.Replace("Ñ", "N");
                Consulta = Consulta.Replace("á", "a");
                Consulta = Consulta.Replace("à", "a");
                Consulta = Consulta.Replace("ä", "a");
                Consulta = Consulta.Replace("é", "e");
                Consulta = Consulta.Replace("è", "e");
                Consulta = Consulta.Replace("ë", "e");
                Consulta = Consulta.Replace("í", "i");
                Consulta = Consulta.Replace("ì", "i");
                Consulta = Consulta.Replace("ï", "i");
                Consulta = Consulta.Replace("ó", "o");
                Consulta = Consulta.Replace("ò", "o");
                Consulta = Consulta.Replace("ö", "o");
                Consulta = Consulta.Replace("ú", "u");
                Consulta = Consulta.Replace("ù", "u");
                Consulta = Consulta.Replace("u", "u");
                Consulta = Consulta.Replace("Á", "A");
                Consulta = Consulta.Replace("À", "A");
                Consulta = Consulta.Replace("Ä", "A");
                Consulta = Consulta.Replace("É", "E");
                Consulta = Consulta.Replace("È", "E");
                Consulta = Consulta.Replace("Ë", "E");
                Consulta = Consulta.Replace("Í", "I");
                Consulta = Consulta.Replace("Ì", "I");
                Consulta = Consulta.Replace("Ï", "I");
                Consulta = Consulta.Replace("Ó", "O");
                Consulta = Consulta.Replace("Ò", "O");
                Consulta = Consulta.Replace("Ö", "O");
                Consulta = Consulta.Replace("Ú", "U");
                Consulta = Consulta.Replace("Ù", "U");
                Consulta = Consulta.Replace("Ü", "U");
                Consulta = Consulta.Replace("ç", "c");
                Consulta = Consulta.Replace("Ç", "C");
                Consulta = Consulta.Replace("|", " ");
                #endregion
            }
            if (existenRequeritos == false)
            {
                this.verificarRequeridos();
            }
            return(Consulta);
        }
예제 #6
0
        public virtual void Zrfc_Buro_Respuesta(

            [RfcParameter(AbapName = "ERROR_CODE", RfcType = RFCTYPE.RFCTYPE_CHAR, Optional = true, Direction = RFCINOUT.IN, Length = 2, Length2 = 4)]
            [XmlElement("ERROR_--5fCODE", IsNullable = false, Namespace = "")]
            string Error_Code,
            [RfcParameter(AbapName = "ID_CONSULTA", RfcType = RFCTYPE.RFCTYPE_CHAR, Optional = false, Direction = RFCINOUT.IN, Length = 13, Length2 = 26)]
            [XmlElement("ID_--5fCONSULTA", IsNullable = false, Namespace = "")]
            string Id_Consulta,
            [RfcParameter(AbapName = "PARTNER", RfcType = RFCTYPE.RFCTYPE_CHAR, Optional = true, Direction = RFCINOUT.IN, Length = 10, Length2 = 20)]
            [XmlElement("PARTNER", IsNullable = false, Namespace = "")]
            string Partner,
            [RfcParameter(AbapName = "AR", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("AR", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_ARTable Ar,
            [RfcParameter(AbapName = "CR", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("CR", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_CRTable Cr,
            [RfcParameter(AbapName = "ES", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("ES", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_ESTable Es,
            [RfcParameter(AbapName = "HI", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("HI", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_HITable Hi,
            [RfcParameter(AbapName = "HR", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("HR", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_HRTable Hr,
            [RfcParameter(AbapName = "INTL", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("INTL", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_INTLTable Intl,
            [RfcParameter(AbapName = "IQ", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("IQ", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_IQTable Iq,
            [RfcParameter(AbapName = "PA", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("PA", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_PATable Pa,
            [RfcParameter(AbapName = "PE", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("PE", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_PETable Pe,
            [RfcParameter(AbapName = "PN", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("PN", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_PNTable Pn,
            [RfcParameter(AbapName = "RS", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("RS", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_RSTable Rs,
            [RfcParameter(AbapName = "SC", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("SC", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_SCTable Sc,
            [RfcParameter(AbapName = "STR", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("STR", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_STRTable Str,
            [RfcParameter(AbapName = "TL", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("TL", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_TLTable Tl,
            [RfcParameter(AbapName = "UR", RfcType = RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
            [XmlArray("UR", IsNullable = false, Namespace = "")]
            [XmlArrayItem("item", IsNullable = false)]
            ref Z00_BURO_URTable Ur)
        {
            object[] results = null;
            results = this.SAPInvoke("Zrfc_Buro_Respuesta", new object[] {
                Error_Code, Id_Consulta, Partner, Ar, Cr, Es, Hi, Hr, Intl, Iq, Pa, Pe, Pn, Rs, Sc, Str, Tl, Ur
            });
            Ar   = (Z00_BURO_ARTable)results[0];
            Cr   = (Z00_BURO_CRTable)results[1];
            Es   = (Z00_BURO_ESTable)results[2];
            Hi   = (Z00_BURO_HITable)results[3];
            Hr   = (Z00_BURO_HRTable)results[4];
            Intl = (Z00_BURO_INTLTable)results[5];
            Iq   = (Z00_BURO_IQTable)results[6];
            Pa   = (Z00_BURO_PATable)results[7];
            Pe   = (Z00_BURO_PETable)results[8];
            Pn   = (Z00_BURO_PNTable)results[9];
            Rs   = (Z00_BURO_RSTable)results[10];
            Sc   = (Z00_BURO_SCTable)results[11];
            Str  = (Z00_BURO_STRTable)results[12];
            Tl   = (Z00_BURO_TLTable)results[13];
            Ur   = (Z00_BURO_URTable)results[14];
        }