コード例 #1
0
        public string TesteGuilherme(string USERNAME)
        {
            string detail;

            IRfcFunction companyBapi = repo.CreateFunction("Z_RFC_TESTE_GAP");

            /*  companyBapi.SetValue("DTDOC", "2013-01-01");
             * companyBapi.SetValue("TPDOC","KP");
             * companyBapi.SetValue("EMPRESA","B001");
             * companyBapi.SetValue("DTLANC","2013-01-01");
             * companyBapi.SetValue("MOEDA","BRL");
             * companyBapi.SetValue("REFER","TESTE");
             * companyBapi.SetValue("CHLANC","30");
             * companyBapi.SetValue("FORNEC","407");
             * companyBapi.SetValue("MONTANT","1");
             * companyBapi.SetValue("FILIAL","0001");
             * companyBapi.SetValue("CONDPAGTO","F000");
             * companyBapi.SetValue("DTBASE","2013-01-01");
             * companyBapi.SetValue("CHLANC2","40");
             * companyBapi.SetValue("CONTA","113103");
             * companyBapi.SetValue("DTEFET","2013-01-01");
             * companyBapi.SetValue("MENSAGEM", "SamuketePerobao");*/


            companyBapi.SetValue("USERNAME", USERNAME);

            companyBapi.Invoke(dest);
            detail = new string(companyBapi.GetCharArray("FIRSTNAME"));

            return(detail);
        }
コード例 #2
0
        public string chamaBAPI(string CODCLI)
        {
            IRfcFunction funcBAPI = repo.CreateFunction("BAPI_CUSTOMER_GETDETAIL");

            funcBAPI.SetValue("CUSTOMERNO", CODCLI);
            funcBAPI.SetValue("PI_SALESORG", "1000");
            funcBAPI.Invoke(dest);
            IRfcStructure structCode = funcBAPI.GetStructure("RETURN");
            string        detail     = new string(funcBAPI.GetCharArray("RETURN"));

            return(structCode.GetString("NAME").ToString());
        }
コード例 #3
0
        public void testeRFCminiSap()
        {
            IRfcFunction companyBapi = repo.CreateFunction("Z_RFC_WELL_CALC");

            companyBapi.SetValue("P_VALOR1", 1);
            companyBapi.SetValue("P_SINAL", '+');
            companyBapi.SetValue("P_VALOR2", 3);

            companyBapi.Invoke(dest);

            string detail = new string(companyBapi.GetCharArray("P_RESULT"));

            // return detail;
        }
コード例 #4
0
        public string SEFAZ(string CNPJ, string CENTRO, string BLOQUEIO)
        {
            IRfcFunction funcBAPI = repo.CreateFunction("ZDSDF019");

            funcBAPI.SetValue("I_CENTRO", CENTRO);
            funcBAPI.SetValue("I_CNPJ", CNPJ);
            funcBAPI.SetValue("I_BLOQUEIO", BLOQUEIO);

            funcBAPI.Invoke(dest);

            string detail = new string(funcBAPI.GetCharArray("E_RETURN"));

            return(detail);
            // string detail = new string(funcBAPI.GetCharArray("RETURN"));
            // return structCode.GetString("NAME").ToString();
        }
コード例 #5
0
        /*Exemplo de Envio para o SAP*/
        public string CriaOrdem(string ordem, string material, string dti, string dtf, string hri, string hrf, string qtd, string versao)
        {
            string detail;

            IRfcFunction companyBapi = repo.CreateFunction("Z_RFC_CRIA_OP");

            companyBapi.SetValue("ORDEM", ordem);
            companyBapi.SetValue("MATERIAL", material.PadRight(18, ' '));
            companyBapi.SetValue("START_DATE", Convert.ToDateTime(dti));
            companyBapi.SetValue("START_TIME", hri);
            companyBapi.SetValue("END_DATE", Convert.ToDateTime(dtf));
            companyBapi.SetValue("END_TIME", hrf);
            companyBapi.SetValue("QUANTITY", qtd);
            companyBapi.SetValue("PROD_VERSION", versao);

            companyBapi.Invoke(dest);
            detail = new string(companyBapi.GetCharArray("MENSAGEM"));

            RfcDestinationManager.UnregisterDestinationConfiguration(new SAPConnect());
            return(detail);
        }
コード例 #6
0
        /*Exemplo de Envio para o SAP*/
        public string CriarVale(string CODFUNCIONARIO, string CCUSTO, string VALOR, string CATEGORIA, string SUBCAT, string DESC)
        {
            string detail;

            IRfcFunction companyBapi = repo.CreateFunction("Z_IMPORT_VALE");

            /*  companyBapi.SetValue("DTDOC", "2013-01-01");
             * companyBapi.SetValue("TPDOC","KP");
             * companyBapi.SetValue("EMPRESA","B001");
             * companyBapi.SetValue("DTLANC","2013-01-01");
             * companyBapi.SetValue("MOEDA","BRL");
             * companyBapi.SetValue("REFER","TESTE");
             * companyBapi.SetValue("CHLANC","30");
             * companyBapi.SetValue("FORNEC","407");
             * companyBapi.SetValue("MONTANT","1");
             * companyBapi.SetValue("FILIAL","0001");
             * companyBapi.SetValue("CONDPAGTO","F000");
             * companyBapi.SetValue("DTBASE","2013-01-01");
             * companyBapi.SetValue("CHLANC2","40");
             * companyBapi.SetValue("CONTA","113103");
             * companyBapi.SetValue("DTEFET","2013-01-01");
             * companyBapi.SetValue("MENSAGEM", "SamuketePerobao");*/


            companyBapi.SetValue("CODFUNCIONARIO", CODFUNCIONARIO);
            companyBapi.SetValue("CCUSTO", CCUSTO);
            companyBapi.SetValue("VALOR", VALOR);
            companyBapi.SetValue("CATEGORIA", CATEGORIA);
            companyBapi.SetValue("SUBCAT", SUBCAT);
            companyBapi.SetValue("DESC", DESC);

            companyBapi.Invoke(dest);
            detail = new string(companyBapi.GetCharArray("MENSAGEM"));

            return(detail);
        }