Solved

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

Posted on 2013-12-14
6
1,373 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:murbro
[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:murbro
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 250 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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 250 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:murbro
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:murbro
ID: 39731139
Thanks for the help
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
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…

726 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