on 03-07-2014 6:28 AM
I have developed a sample appln to check whether the .NET4.0 is connected to SAP or not....
I have added the references
SAPconnectionmanager.dll
sapnco.dll
sapnco_util.dll
Then I have created a application Config file for my window application, and added the apps setting
<configuration>
<appSettings>
<add key= "ServerHost" value="122.159.217.222" />
<add key= "SystemNumber" value= "58"/>
<add key="User" value="xxvi"/>
<add key="Password" value="xxxxx"/>
<add key="Client" value="00"/> //*Instance Number*//
<add key="Language" value="EN"/>
<add key="PoolSize" value="5"/>
<add key="PeakConnectionsLimit" value="10"/>
<add key="IdleTimeout" value="600"/>
</appSettings>
</configuration>
Then I have added a code on Form load function
try
{
SAPSystemConnect sapCfg = new SAPSystemConnect();
RfcDestinationManager.RegisterDestinationConfiguration(sapCfg);
RfcDestination rfcDest = null;
rfcDest = RfcDestinationManager.GetDestination("Dev");
;
}
catch (Exception ex)
{
label1.Text=ex.Message;
}
After running this, the form is loading without error even if i give wrong username and password in apps setting.... Then how can i find the SAP system is connected???
Use "CreateFunction" and "Invoke" an ABAP function module with it. That would be the easiest way to find out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i got it
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use .Ping() on destination. This is the simplest.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.