ERPConnect.IR3Connection
Namespace: ERPConnect
Assembly: ERPConnectStandard20.dll
Represents a connection to a SAP R/3 System
Implements
Properties
Codepage
Property Value
IsOpen
Gets a value indicating whether this connection has been successfully established and has been valid when the last message has been received/sent.
Property Value
IsUnicode
Defines whether the partner system is a unicode system
Property Value
Language
Gets the logon language
Property Value
Examples
DE od EN
LogDir
Gets or sets the path to the directory in which trace files and XML log files are stored
Property Value
Remarks
To enable logging, set the value to an existing directory to which the process has write access. To disable logging set the value to string.Empty. Property must be set before the connection is opened.
Logging
Gets or sets a value which indicates whether detailed RFC tracing is enabled or not
Property Value
Remarks
Must be set before the connection is opened. ERPConnect.IR3Connection.LogDir
must also be set.
PartnerRelease
The release number of the SAP-BASIS of the system
Property Value
Examples
700
Protocol
The ERPConnect.ClientProtocol
used for the communication between client and SAP server
Property Value
ReadTableFunctionName
Gets or sets the name of the function module that is used by ERPConnect.Utils.ReadTable
. This will be overriden by ERPConnect.Utils.ReadTable.SetCustomFunctionName(System.String)
.
Property Value
SAPEncodingInfo
Gets information about data encoding
Property Value
SNCSettings
Gets or sets the settings for SNC
Property Value
See Also
Methods
Close()
Closes the client connection
CreateFunction(string)
Creates a function by the name of the SAP function module
Parameters
name
string
Name of the function module
Returns
A RFCFunction object
Examples
[C#]
static void Main(string[] args)
{
R3Connection con = new R3Connection("hamlet",11,"theobald","pw","DE","800");
con.Open(false);
// Create a function object
RFCFunction func = con.CreateFunction("RFC_CUSTOMER_GET");
Console.WriteLine("Please enter customer number ...");
Console.WriteLine("(and do not forget the leading zeros ...");
// fill the export parameter
StringBuilder CustomerNo = new StringBuilder(Console.ReadLine());
func.Exports["KUNNR"].ParamValue = CustomerNo.ToString();
try
{
func.Execute();
}
catch (ERPException e)
{
Console.WriteLine(e.Message);
Console.ReadLine();
return;
}
// Output the result of the function module
Console.WriteLine("Name of customer:");
Console.WriteLine(func.Tables["CUSTOMER_T"].Rows[0,"NAME1"]);
Console.ReadLine();
}
[VB]
Sub Main()
Dim con As New R3Connection("hamlet", 11, "theobald", "pw", "DE", "800")
con.Open(False)
' Create a function object
Dim func = con.CreateFunction("RFC_CUSTOMER_GET")
Console.WriteLine("Please enter customer number ...")
Console.WriteLine("(and do not forget the leading zeros ...")
' fill the export parameter
Dim CustomerNo As New StringBuilder(Console.ReadLine())
func.Exports("KUNNR").ParamValue = CustomerNo.ToString()
Try
func.Execute()
Catch e As ERPException
Console.WriteLine(e.Message)
Console.ReadLine()
Return
End Try
' Output the result of the function module
Console.WriteLine("Name of customer:")
Console.WriteLine(func.Tables("CUSTOMER_T").Rows(0, "NAME1"))
Console.ReadLine()
End Sub
Remarks
The following example demonstrates, how to logon, to create a function object and to execute the function
Execute(RFCFunction)
Assigns this connection to the supplied ERPConnect.RFCFunction
and then executes the function.
Parameters
function
RFCFunction
Open()
Opens a connection to an SAP R/3 system.