?
Solved

VB.net SAP Connector Error in converting C# to VB.net

Posted on 2013-12-14
6
Medium Priority
?
1,396 Views
Last Modified: 2013-12-19
Hi I am getting the error below on the line marked ERROR HERE in the following VB.net code, which I converted using an online tool from the C# code below.

Error      3      Class 'SAPSystemConnect' must implement 'Event ConfigurationChanged(destinationName As String, args As RfcConfigurationEventArgs)' for interface 'SAP.Middleware.Connector.IDestinationConfiguration'.

Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports SAP.Middleware.Connector


Public Class SAPSystemConnect

    Implements IDestinationConfiguration 'ERROR HERE
    Public Function ChangeEventsSupported() As Boolean
        Throw New NotImplementedException()
    End Function

    Public Event ConfigurationChanged As RfcDestinationManager.ConfigurationChangeHandler

    Public Function GetParameters(destinationName As String) As RfcConfigParameters
        Dim parms As New RfcConfigParameters()
        If "Dev".Equals(destinationName) Then
            parms.Add(RfcConfigParameters.AppServerHost, "000.000.000.000")
            parms.Add(RfcConfigParameters.SystemNumber, "95")
            parms.Add(RfcConfigParameters.User, "sap_user")
            parms.Add(RfcConfigParameters.Password, "xxxxxxxxxx")
            parms.Add(RfcConfigParameters.User, "10")
            parms.Add(RfcConfigParameters.User, "EN")
            parms.Add(RfcConfigParameters.User, "5")
            parms.Add(RfcConfigParameters.User, "10")
            parms.Add(RfcConfigParameters.User, "600")
        End If

        Return parms

    End Function

End Class



using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SAP.Middleware.Connector;

namespace SAP_Connect_CSharp
{
    class SAPSystemConnect:IDestinationConfiguration
    {
        public bool ChangeEventsSupported()
        {
            throw new NotImplementedException();
        }

        public event RfcDestinationManager.ConfigurationChangeHandler ConfigurationChanged;

        public RfcConfigParameters GetParameters (string destinationName)
        {
            RfcConfigParameters parms = new RfcConfigParameters();
            if ("Dev".Equals(destinationName))
            {
                parms.Add(RfcConfigParameters.AppServerHost, "000.000.000.000");
                parms.Add(RfcConfigParameters.SystemNumber, "95");
                parms.Add(RfcConfigParameters.User, "sap_user");
                parms.Add(RfcConfigParameters.Password, "xxxxxxxxxx");
                parms.Add(RfcConfigParameters.User, "10");
                parms.Add(RfcConfigParameters.User, "EN");
                parms.Add(RfcConfigParameters.User, "5");
                parms.Add(RfcConfigParameters.User, "10");
                parms.Add(RfcConfigParameters.User, "600");
            }

            return parms;

        }

    }
}
0
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 22

Expert Comment

by:p_davis
ID: 39718738
I would have to think that you are not implementing all the items in the interface.
0
 

Author Comment

by:Murray Brown
ID: 39718743
I should have mentioned that I also get the following two errors
Error      4      Class 'SAPSystemConnect' must implement 'Function ChangeEventsSupported() As Boolean' for interface 'SAP.Middleware.Connector.IDestinationConfiguration'.
Error      5      Class 'SAPSystemConnect' must implement 'Function GetParameters(destinationName As String) As RfcConfigParameters' for interface 'SAP.Middleware.Connector.IDestinationConfiguration'.
0
 
LVL 22

Assisted Solution

by:p_davis
p_davis earned 1000 total points
ID: 39718785
those are the methods you need to implement to get rid of the errors- if you are using visual studio and you click on the interface name there should be a blue box that appears underneath the first letter... if you click that it will give you options to implement and stub in the methods for you.
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 1000 total points
ID: 39718904
VB uses a different syntax to declare implementations:

Public Event ConfigurationChanged(destinationName As String, args As Object) Implements SAP.Middleware.Connector.IDestinationConfiguration
0
 

Author Comment

by:Murray Brown
ID: 39719850
Thanks James. How would the entire piece of code look with your changes? I can't seem to get it right
I tried the following and got a "Type expected" error on "SAP.Middleware.Connector.IDestinationConfiguration"

Public Class SAPSystemConnect

    Public Function ChangeEventsSupported() As Boolean
        Throw New NotImplementedException()
    End Function

    Public Event ConfigurationChanged(destinationName As String, args As Object) Implements SAP.Middleware.Connector.IDestinationConfiguration

    Public Function GetParameters(destinationName As String) As RfcConfigParameters
        Dim parms As New RfcConfigParameters()
        If "Dev".Equals(destinationName) Then
            parms.Add(RfcConfigParameters.AppServerHost, "000.000.000.000")
            parms.Add(RfcConfigParameters.SystemNumber, "95")
            parms.Add(RfcConfigParameters.User, "sap_user")
            parms.Add(RfcConfigParameters.Password, "xxxxxxxxxx")
            parms.Add(RfcConfigParameters.User, "10")
            parms.Add(RfcConfigParameters.User, "EN")
            parms.Add(RfcConfigParameters.User, "5")
            parms.Add(RfcConfigParameters.User, "10")
            parms.Add(RfcConfigParameters.User, "600")
        End If

        Return parms

    End Function

End Class
0
 

Author Closing Comment

by:Murray Brown
ID: 39731139
Thanks for the help
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month15 days, 8 hours left to enroll

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question