Skip to Content
avatar image
Former Member

How to connect to RfcDestinationManager from inside function


Nowadays I have this:

   [WebMethod]    public string ZPKG_IMPRIMEETIQUETA001(string P_PESO, string P_WERKS, string P_ROLLO, string P_PAPEL)    {        RfcDestination prd;        string P_RESULT;        ECCDestinationConfig onk1 = new ECCDestinationConfig();        onk1.compruebaconection();        prd = RfcDestinationManager.GetDestination("QAS");        try        {            RfcDestinationManager.RegisterDestinationConfiguration(new ECCDestinationConfig());        }        catch        {        }        try        {            RfcRepository repo = prd.Repository;            IRfcFunction companyBapi = repo.CreateFunction("ZPKG_IMPRIMEETIQUETA001");            companyBapi.SetValue("P_PESO", P_PESO);            companyBapi.SetValue("P_WERKS", P_WERKS);            companyBapi.SetValue("P_ROLLO", P_ROLLO);            companyBapi.SetValue("P_PAPEL", P_PAPEL);            companyBapi.Invoke(prd);            P_RESULT = companyBapi.GetValue("P_RESULT").ToString();            return P_RESULT.ToString();        }        catch (Exception exa)        {            P_RESULT = "Error en el Web Services";            return P_RESULT;           // return null;        }    }

In the line 12 I set the parameters for connection like this:   prd = RfcDestinationManager.GetDestination("QAS"); But I want to set the parameters without a function from a class, I want Set parameters directly.

Do you know How Can I do this?

Thanks and Regards.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 28, 2013 at 10:30 AM

    What do you mean by setting parameters directly?

    Btw. you shall move line 12.

    prd = RfcDestinationManager.GetDestination("QAS"); 

    to line 28.

    Add comment
    10|10000 characters needed characters exceeded