Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2013-12-14
6
Medium Priority
?
1,422 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
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.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

618 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