on 07-18-2018 8:06 AM
I have written some Code for a program that is using the RFC .NET Connector to get the data from an SAP Server to my C# program. I have done some research what module you should use to get data from the server but I couldn't find out how to use the module.
RFCConnector.cs:
class RFCConnector
{
RfcDestination dest = RfcDestinationManager.GetDestination("SAPServer");
public void Ping()
{
dest.Ping();
Console.WriteLine("Ping erfolgreich.");
}
public void GetData(string module)
{
IRfcFunction function = dest.Repository.CreateFunction(module);
Console.WriteLine("Verbindung erfolgreich aufgebaut zu Module: " + module);
}
}
Program.cs:
class Program
{
static void Main(string[] args)
{
RFCConnector connector = new RFCConnector();
connector.Ping();
connector.GetData("TABLE_ENTRIES_GET_VIA_RFC");
}
}
In the SAP .NET Connector Programming Guide, it tells you can get access to the fields of a table with this code:
IRfcTable addresses = function["ADDRESSES"].GetTable();
Console.WriteLine("STREET");
for (int index = 0; index < addresses.RowCount; ++index)
{
Console.WriteLine(addresses[index]["STREET"].GetString());
}
The problem is when I put that code into my program I get this error:
SAP.Middleware.Connector.RfcInvalidParameterException: "Element ADDRESSES of container metadata TABLE_ENTRIES_GET_VIA_RFC unknown"
Hi Raphael,
There are some exmaples and tutorials available on the .NET connector site:
https://support.sap.com/en/product/connectors/msnet.html#section_512604546
Check the examples provided in StepByStepClient.cs file (dotnet_connector_30_tutorial.zip).
Best regards,
Antal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.