Skip to Content
avatar image
Former Member

No DestinationConfiguration registered

Hello,

I have a problem when I try to connect with SAP, please see my code below

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SAP.Middleware.Connector;
public partial class _Default : System.Web.UI.Page
{


    public class MyBackendConfig : IDestinationConfiguration
    {
        public RfcConfigParameters GetParameters(String destinationName)
        {
            if ("SE38".Equals(destinationName))
            {
                RfcConfigParameters parms = new RfcConfigParameters();
                parms.Add(RfcConfigParameters.AppServerHost, "192.168.16.75");
                parms.Add(RfcConfigParameters.SystemNumber, "00");
                parms.Add(RfcConfigParameters.User, "ssanchez");
                parms.Add(RfcConfigParameters.Password, "SAPLSC001");
                parms.Add(RfcConfigParameters.Client, "200");
                parms.Add(RfcConfigParameters.Language, "ES");
                parms.Add(RfcConfigParameters.PoolSize, "5");
                parms.Add(RfcConfigParameters.MaxPoolSize, "10");
                parms.Add(RfcConfigParameters.IdleTimeout, "600");
                return parms;
            }
            else return null;
        }
        public bool ChangeEventsSupported()
        {
            return false;
        }
        public event RfcDestinationManager.ConfigurationChangeHandler ConfigurationChanged;
    }

    protected void Page_Load(object sender, EventArgs e)
    {
     


    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        


        RfcDestination prd = RfcDestinationManager.GetDestination("SE38");
        RfcRepository repo = prd.Repository;
        IRfcFunction companyBapi1 = repo.CreateFunction("ZREGRESAVAR");
     companyBapi1.Invoke(prd);
     string Dato = companyBapi1.GetValue("DATO").ToString();


   
         


    }











}

But when I run my webpage, I get this error:

Anyone knows how can I solve this?

Screenshot_1.png (48.2 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 15, 2014 at 06:54 PM

    Everything looks right.  The only thing that looks peculiar to me is the following statement:

    if ("SE38".Equals(destinationName)) 

    Try this instead:

    if (destinationName.Equals("SE38")) 

    I'm not sure why that would matter, but like I said, it's the only thing that jumps out at me looking at your code.

    Add comment
    10|10000 characters needed characters exceeded