<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SAP Experts: VMware Virtualization &#124; Consulting &#124; Integration - DataXstream &#187; NCo</title>
	<atom:link href="http://www.dataxstream.com/tag/nco/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dataxstream.com</link>
	<description>SAP Certified Consultants</description>
	<lastBuildDate>Tue, 07 Feb 2012 23:57:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Build an RFC Client with NCo 3.0 for VB.NET &#8211; A Step-By-Step Guide</title>
		<link>http://www.dataxstream.com/2011/11/nco-3-rfc-client-vb-net-step-by-step/</link>
		<comments>http://www.dataxstream.com/2011/11/nco-3-rfc-client-vb-net-step-by-step/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 16:50:25 +0000</pubDate>
		<dc:creator>Craig Stasila</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[SAP Interface Blog]]></category>
		<category><![CDATA[SAP Technical]]></category>
		<category><![CDATA[.Net Connector]]></category>
		<category><![CDATA[Craig Stasila]]></category>
		<category><![CDATA[DataXstream]]></category>
		<category><![CDATA[NCo]]></category>
		<category><![CDATA[NCo 3.0]]></category>
		<category><![CDATA[SAP .Net Connector]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://www.dataxstream.com/?p=9772</guid>
		<description><![CDATA[Recently, I published an article showing step-by-step instructions for how to consume an SAP RFC with the SAP .Net Connector 3.0 (NCo 3.0).  The article included code samples and a working code example for download written in C#.  Well, not everybody writes in C#.  There are some of you that would prefer to write in VB.NET. [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I published an article showing step-by-step instructions for <a title="Build an RFC Client with NCo 3.0 – A Step-By-Step Guide" href="http://www.dataxstream.com/2011/08/nco-3-rfc-client-step-by-step/">how to consume an SAP RFC with the SAP .Net Connector 3.0 (NCo 3.0)</a>.  The article included code samples and a working code example for download written in C#.  Well, not everybody writes in C#.  There are some of you that would prefer to write in VB.NET.  So, I have heeded your call, all you VB.NET developers!  Here is your very own article detailing how to build an RFC client with NCo 3.0 for VB.NET.</p>
<p>The SAP .Net Connector 3.0 (NCo 3.0) offers many improvements over SAP .NET Connector 2.0. Unfortunately, SAP no longer offers example .NET code.  This blog attempts to fill that gap by describing how to build a simple RFC Client using SAP .Net Connector (NCo) 3.0 with VB.NET.  <a href="http://www.dataxstream.com/sap-nco-3-0-rfc-client-code-sample-for-visual-basic/" target="_blank">Click here</a> to request a .zip file containing a copy of the source code.</p>
<p><span id="more-9772"></span>The sample program displays details about companies defined by SAP. There are two BAPI calls involved, BAPI_COMPANY_GETLIST and BAPI_COMPANY_GETDETAIL.<br />
Along with the SAP .Net Connector 3.0, we are using Microsoft Visual Studio 2010 and the Microsoft .Net Framework 4.0 to build our sample.  Prior to starting, you will have to download and install <a href="http://service.sap.com/connectors" target="_blank">NCo 3.0</a> (OSS login required).<br />
<img title="More..." src="http://www.dataxstream.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /></p>
<h2>Setting up the Project</h2>
<p>Using Visual Studio 2010, create a new Windows Form project. In the project properties, be sure to set the Target Framework to .Net Framework 4.0.  To change the target .NET framework version on a VB.NET project, first open the project&#8217;s property page.  Click on the &#8220;Compile&#8221; tab in the property page.  Then click on the &#8220;Advanced Compile Options..&#8221; button.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/NCO3_Client_VB_01.png" rel="shadowbox[sbpost-9772];player=img;"><img class="alignnone size-full wp-image-9773" title="Change .NET Framework Target Version" src="http://www.dataxstream.com/wp-content/uploads/NCO3_Client_VB_01.png" alt="" width="645" height="311" /></a></p>
<p>In the ensuing dialog window, change the target framework version.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/NCO3_Client_VB_02.png" rel="shadowbox[sbpost-9772];player=img;"><img class="alignnone size-full wp-image-9774" title="Change .NET Framework Target Version (No Client Profile)" src="http://www.dataxstream.com/wp-content/uploads/NCO3_Client_VB_02.png" alt="" width="520" height="423" /></a></p>
<p>Next, add references to the SAP .Net Connector 3.0. There are two DLLs, sapnco.dll and sapnco_utils.dll.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/NCO3_Client_VB_03.png" rel="shadowbox[sbpost-9772];player=img;"><img class="alignnone size-full wp-image-9775" title="Add Reference to NCo 3.0" src="http://www.dataxstream.com/wp-content/uploads/NCO3_Client_VB_03.png" alt="" width="315" height="225" /></a></p>
<p>&nbsp;</p>
<h2>Design the Form</h2>
<p>Add two controls to the form. The first is a List Box, which will contain the list of available SAP companies. The second control to add is a Property Grid control, which is used to display the details of a particular SAP company when the user selects one from the List Box.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/NCO3_Client_VB_04.png" rel="shadowbox[sbpost-9772];player=img;"><img class="alignnone size-full wp-image-9776" title="Design Windows Form" src="http://www.dataxstream.com/wp-content/uploads/NCO3_Client_VB_04.png" alt="" width="562" height="445" /></a></p>
<p>&nbsp;</p>
<h2>Using App.Config to define the SAP Connections</h2>
<p>There are several methods you can use in your solutions to define a particular SAP host. For this example, we are using an app.config file to define our SAP host.<br />
The SAP .Net Connector 3.0 includes sample app.config files. For the RFC client, be sure there is a sectionGroup definition for &lt;ClientSettings&gt;.<br />
The SAP host is defined by the destinations section. Within the destination, the Name field identifies this app.config entry to our program code. Specify the appropriate user name, password, SAP host name, client and system number in the destination section.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/NCO3_Client_VB_05.png" rel="shadowbox[sbpost-9772];player=img;"><img class="alignnone size-full wp-image-9777" title="App.config" src="http://www.dataxstream.com/wp-content/uploads/NCO3_Client_VB_05.png" alt="" width="647" height="230" /></a></p>
<h2>The BAPIs</h2>
<p>Use the SAP transaction SE37 to determine the parameters for functions BAPI_COMPANY_GETLIST and BAPI_COMPANY_GETDETAIL. This will tell us what parameters need to be passed in and where to find the results that are returned to our code.</p>
<h2>The Code</h2>
<p>During the form load event, we want to populate our List Box with the defined companies from SAP.</p>
<ol>
<li>Acquire a valid RfcDestination to use. Use method RfcDestinationManager.GetDestination() to do this. GetDestination() requires a parameter to determine which SAP host to refer to. Pass in the Name of the SAP host you previously defined in the app.config file. (Line 39)</li>
<li>Now that we have a valid RfcDestination object, we need access to the SAP Repository. The repository contains information about the BAPI calls we are going to make. The RfcRepository is an attribute of an RfcDestination object. (Line 42)</li>
<li>Using the RfcRepository object, acquire a reference to the SAP BAPI by calling method RfcRepository.CreateFunction() method. Pass in the name of the desired function as a string parameter to CreateFunction(). This method returns an object we can use to setup parameters, invoke the function, and retrieve results.</li>
<li>Now we can make the RFC calls into SAP. Using the IRfcFunction object returned by CreateFunction(), call the Invoke() method, passing in our RfcDestination object as parameter. This will make the RFC call into SAP, and provides the results via our IRfcFunction object. (Line 48)</li>
<li>SAP function BAPI_GET_COMPANYLIST returns a table of company records. We use an instance of an IRfcTable object that we retrieve by calling the GetTable() method on the IRfcFunction object. To get a desired table, pass in the table name to the GetTable() method. (Line 50)</li>
<li>We now have an instance of an IRfcTable object that contains company information through which we can iterate. It is possible to iterate through the data by setting the CurrentIndex property on the returned table. For a particular row in the table, it is possible to access values using the GetString() method. (Lines 55-59)</li>
<li>For each company, get the CompanyNumber, and use that as a parameter to SAP function BAPI_COMPANY_GETDETAIL. BAPI_COMPANY_GETDETAIL returns detailed information about that particular SAP company. The techniques are the same as before, with the additional step of using the SetValue() method on the IRfcFunction object to pass in the company number as a parameter. (Lines 60-67)</li>
<li>BAPI_COMPANY_GETDETAIL returns data as an instance of the IRfcStructure interface. Access individual field data of the company record, using the GetString() method of the IRfcStructure object instance. (Lines 67-78)</li>
<li>Extract the company details as desired. Add them to some object you create and then add that object to the List Box control. (Line 80)</li>
</ol>
<p>&nbsp;</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/NCO3_Client_VB_06.png" rel="shadowbox[sbpost-9772];player=img;"><img class="alignnone size-full wp-image-9778" title="NCo 3.0 RFC Client Sample VB.NET Code" src="http://www.dataxstream.com/wp-content/uploads/NCO3_Client_VB_06.png" alt="" width="580" height="523" /></a></p>
<p>The rest of the code is regular Windows Forms programming. Your code will need to wire up the List Box changed events so that the Property Grid will display the details of the selected company.</p>
<h2>Additional Information</h2>
<p>Follow these links for more information about NCo 3.0 programming:</p>
<ul>
<li>Webinar: <a href="http://www.dataxstream.com/sap_webinars/sap-nco-3-0-best-practice-guide-for-upgrade-from-net-connector-2-0/">SAP NCo 3.0 – Best Practice Guide for Upgrade from .NET Connector 2.0</a></li>
<li>Source Code: <a href="http://www.dataxstream.com/sap-nco-3-0-rfc-client-code-sample-for-visual-basic/" target="_blank">RFC Client with NCo 3.0 for VB.NET</a></li>
<li>C# version of this example: <a title="Build an RFC Client with NCo 3.0 – A Step-By-Step Guide" href="http://www.dataxstream.com/2011/08/nco-3-rfc-client-step-by-step/" target="_blank">Build an RFC Client with NCo 3.0 &#8211; A Step-By-Step Guide</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dataxstream.com/2011/11/nco-3-rfc-client-vb-net-step-by-step/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>NCo 3.0: Reconnecting a Broken RFC Server Connection</title>
		<link>http://www.dataxstream.com/2011/09/nco-3-0-reconnecting-a-broken-rfc-server-connection/</link>
		<comments>http://www.dataxstream.com/2011/09/nco-3-0-reconnecting-a-broken-rfc-server-connection/#comments</comments>
		<pubDate>Wed, 21 Sep 2011 14:10:17 +0000</pubDate>
		<dc:creator>Craig Stasila</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[SAP Interface Blog]]></category>
		<category><![CDATA[SAP Technical]]></category>
		<category><![CDATA[.Net Connector]]></category>
		<category><![CDATA[Craig Stasila]]></category>
		<category><![CDATA[DataXstream]]></category>
		<category><![CDATA[NCo]]></category>
		<category><![CDATA[NCo 3.0]]></category>
		<category><![CDATA[RFC Server]]></category>
		<category><![CDATA[SAP .Net Connector]]></category>

		<guid isPermaLink="false">http://www.dataxstream.com/?p=8826</guid>
		<description><![CDATA[Don&#8217;t you hate it when you&#8217;re talking on the cell phone and the call drops?   I was talking to my wife on the way to my client site this week and was telling her about this awesome blog post I was writing when the call dropped.  Bummer.  Since I really wanted to tell her [...]]]></description>
			<content:encoded><![CDATA[<p>Don&#8217;t you hate it when you&#8217;re talking on the cell phone and the call drops?   I was talking to my wife on the way to my client site this week and was telling her about this awesome blog post I was writing when the call dropped.  Bummer.  Since I really wanted to tell her about my blog, I wanted to complete the conversation.  But first, I had to wait for service.  Then I had to call her back, and have her answer.  Then I uttered the phrase that all cell phone users know, &#8220;What was the last thing you heard me say?&#8221;  It was a fairly messy recovery, but I was finally able to talk about my blog!</p>
<p>When two software systems integrate, we also have to deal with the &#8220;dropped call&#8221; problem.  SAP NCo 3.0 offers a few different levels of  data recovery options depending on whether NCo is the client or the server.  But before any data recovery can happen, the first step is to call the other party back.  This blog post describes the general process to reconnect an NCo RfcServer to an SAP gateway host.</p>
<p><span id="more-8826"></span></p>
<p>I have read in other blogs that SAP claims their RfcServer object will automatically reconnect if it detects a dropped connection.  While this may be true, I have not seen this automatic reconnection occur in all the testing that I have done.  So, left to my own devices, I set out to figure out the best way to reconnect an RfcServer.</p>
<p>The first thing I did was to map out the &#8220;dropped call&#8221; process diagram.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/PhoneCall_Reconnect_Flow-e1316637566273.png" rel="shadowbox[sbpost-8826];player=img;"><img class="alignnone size-full wp-image-9212" title="Phone Call Reconnection Flowchart" src="http://www.dataxstream.com/wp-content/uploads/PhoneCall_Reconnect_Flow-e1316637566273.png" alt="" width="534" height="402" /></a></p>
<p>I know that some of you are thinking that after a call is dropped it is not necessary to hang up.  This is true.  But the connection needs to be cleaned up.  In the mobile phone analogy, the phone automatically detects the dropped call and hangs up for you.  What I found during my research is that NCo 3.0 doesn&#8217;t automatically clean up broken connections, nor does it automatically clean up failed connection attemps.</p>
<p>Armed with this flow chart, my new found understanding of NCo 3.0, some Diet Mountain Dew, and a bag of Skittles, I decided to tackle coding a similar solution in C# using NCo 3.0.</p>
<p>But first, I tweaked my flow chart:</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/RfcServer_Reconnect_Flow.png" rel="shadowbox[sbpost-8826];player=img;"><img class="alignnone size-full wp-image-8829" src="http://www.dataxstream.com/wp-content/uploads/RfcServer_Reconnect_Flow.png" alt="" width="534" height="402" /></a></p>
<p>The result was a RfcServer NCo 3.0 project that would automatically recover from connection errors.  The key concept is to call the <span style="font-family: Consolas, Courier, monospace;">Shutdown()</span> method of the <span style="font-family: Consolas, Courier, monospace;">RfcServer</span> object after each connection failure.  Add in an event handler for the RfcServerError Event and a timer, and the rest falls into place.</p>
<h2>Download RfcServer Reconnection Sample NCo 3.0 Project</h2>
<p>A full sample C# project is available for download here: <a title="SAP NCo 3.0 RFC Server Reconnection Sample" href="http://www.dataxstream.com/sap-nco-3-0-rfc-server-reconnection-sample/">SAP NCo 3.0 RFC Server Reconnection Sample</a></p>
<h2>Additional SAP NCo 3.0 Information</h2>
<p>Follow these links for more information about SAP NCo 3.0 programming:</p>
<ul>
<li><a title="SAP NCo 3.0 – Best Practice Guide for Upgrade from .NET Connector 2.0" href="http://www.dataxstream.com/sap_webinars/sap-nco-3-0-best-practice-guide-for-upgrade-from-net-connector-2-0/">Webinar: SAP NCo 3.0 – Best Practice Guide for Upgrade from .NET Connector 2.</a></li>
<li><a title="Build an RFC Client with NCo 3.0 – A Step-By-Step Guide" href="http://www.dataxstream.com/2011/08/nco-3-rfc-client-step-by-step/">Build an RFC Client with NCo 3.0 – A Step-By-Step Guide</a></li>
<li><a title="Build an RFC Server with NCo 3.0 – A Step-By-Step Guide" href="http://www.dataxstream.com/2011/08/nco-3-rfc-server-step-by-step/">Build an RFC Server with NCo 3.0 – A Step-By-Step Guide</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dataxstream.com/2011/09/nco-3-0-reconnecting-a-broken-rfc-server-connection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build an RFC Server with NCo 3.0 – A Step-By-Step Guide</title>
		<link>http://www.dataxstream.com/2011/08/nco-3-rfc-server-step-by-step/</link>
		<comments>http://www.dataxstream.com/2011/08/nco-3-rfc-server-step-by-step/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 19:15:01 +0000</pubDate>
		<dc:creator>Craig Stasila</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[SAP Interface Blog]]></category>
		<category><![CDATA[SAP Technical]]></category>
		<category><![CDATA[.Net Connector]]></category>
		<category><![CDATA[Craig Stasila]]></category>
		<category><![CDATA[DataXstream]]></category>
		<category><![CDATA[NCo]]></category>
		<category><![CDATA[NCo 3.0]]></category>
		<category><![CDATA[SAP .Net Connector]]></category>

		<guid isPermaLink="false">http://www.dataxstream.com/?p=8763</guid>
		<description><![CDATA[&#160; SAP .NET Connector 2.0 offered a couple of different sample projects that were instrumental in my learning process.  As I mentioned in my post detailing the steps to build an RFC client, SAP no longer supplies code samples with SAP .NET Connector (NCo) 3.0.  So, I decided to make available some code examples created by [...]]]></description>
			<content:encoded><![CDATA[<p>&nbsp;</p>
<p>SAP .NET Connector 2.0 offered a couple of different sample projects that were instrumental in my learning process.  As I mentioned in my post <a title="Build an RFC Client with NCo 3.0 – A Step-By-Step Guide" href="http://www.dataxstream.com/2011/08/nco-3-rfc-client-step-by-step/">detailing the steps to build an RFC client</a>, SAP no longer supplies code samples with SAP .NET Connector (NCo) 3.0.  So, I decided to make available some code examples created by my colleague, <a href="http://www.dataxstream.com/author/tdebruicker/">Terry DeBruicker</a>.</p>
<p>This blog describes how to build a simple RFC Server using the SAP NCo 3.0. The sample program implements RFC STFC_CONNECTION.  STFC_CONNECTION is a good example to use because it contains both importing and exporting parameters.</p>
<p><span id="more-8763"></span></p>
<p><a title="SAP NCo 3.0 RFC Server Sample Code" href="http://www.dataxstream.com/sap-nco-3-0-rfc-server-sample-code/">Click here</a> to request a .zip file containing a copy of the source code.</p>
<p>Along with the SAP .Net Connector 3.0, we are using Microsoft Visual Studio 2010 and the Microsoft .Net Framework 4.0 to build our sample. Prior to starting, you will have to download and install <a href="http://service.sap.com/connectors" target="_blank">NCo 3.0</a> (OSS login required).</p>
<h2>Setting up the Project</h2>
<p>Using Visual Studio 2010, create a new console project. In the project properties, be sure to set the Target Framework to .Net Framework 4.0.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/RFC_Server01.png" rel="shadowbox[sbpost-8763];player=img;"><img class="alignnone size-full wp-image-8765" src="http://www.dataxstream.com/wp-content/uploads/RFC_Server01.png" alt="" width="624" height="401" /></a></p>
<p>Next, add references to the SAP .Net Connector 3.0. There are two DLLs, sapnco.dll and sapnco_utils.dll.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/RFC_Server02.png" rel="shadowbox[sbpost-8763];player=img;"><img class="alignnone size-full wp-image-8766" src="http://www.dataxstream.com/wp-content/uploads/RFC_Server02.png" alt="" width="384" height="150" /></a></p>
<h2>Using App.Config to define the SAP Connections</h2>
<p>There are several methods you can use in your solutions to define a particular SAP host. For this simple example, we are using an app.config file to define our SAP host connection information.</p>
<p>One of the biggest differences between NCo 3.0 and NCo 2.0 is how function metadata is retrieved and stored.  With NCo 2.0 the function metadata was downloaded from an SAP system at design  time and persisted as proxy objects that were compiled with the rest of your solution.  NCo 3.0 needs to access this metadata at <em>runtime</em>.  There are two methods for providing this metadata.  One method is to create the metadata in your .NET code.  The other method is to rely on the metadata stored in the SAP system.  For this example, we will rely on the SAP system to provide RFC metadata.  This metadata is retrieved using special built-in RFCs.  Therefore, not only will our program act as an RFC server, it will also need to act as an RFC client.</p>
<p>For basic RFC server configuration, there are two configuration sections that are used, <span style="font-family: Consolas, Courier, monospace"><span style="color: #0000ff">&lt;</span><span style="color: #800000">ClientSettings</span><span style="color: #0000ff">&gt;</span></span> and <span style="font-family: Consolas, Courier, monospace"><span style="color: #0000ff">&lt;</span><span style="color: #800000">ServerSettings</span><span style="color: #0000ff">&gt;</span></span>.  Ensure that the app.config file has a <span style="font-family: Consolas, Courier, monospace"><span style="color: #0000ff">&lt;</span><span style="color: #800000">sectionGroup</span><span style="color: #0000ff">&gt;</span></span> tag for both client and server settings.</p>
<p>An RFC server configuration is linked to a RFC repository by use of the <span style="font-family: Consolas, Courier, monospace"><span style="color: #ff0000">REPOSITORY_DESTINATION</span></span> attribute.  To be able to access function metadata, this attribute must match the name of a destination configuration in the client settings section.</p>
<p>All SAP NCo 3.0 RFC servers communicate with SAP through a SAP service called the gateway.  The server settings configuration section  defines how the program connects to the SAP gateway.  In the servers section, the NAME field identifies this app.config entry to our  program. The SAP .Net Connector 3.0 will use the values in the GWHOST, GWSERV, and PROGRAM_ID fields to register our program on the SAP Application Gateway. The PROGRAM_ID specified here must match the Registered Server Program ID specified in the RFC destination.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/RFC_Server03.png" rel="shadowbox[sbpost-8763];player=img;"><img class="alignnone size-full wp-image-8799" src="http://www.dataxstream.com/wp-content/uploads/RFC_Server03.png" alt="" width="604" height="381" /></a></p>
<h2>The SAP RFC Function Interface</h2>
<p>SAP transaction SE37 can be used to determine the parameters for the STFC_CONNECTION function. This describes what parameters will be passed to our function, and what results are expected.</p>
<p>In this example, we expect to receive parameter REQUTEXT, which will be returned to the caller in ECHOTEXT. We also return a text string to the caller in field RESPTEXT.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/RFC_Server041.png" rel="shadowbox[sbpost-8763];player=img;"><img class="alignnone size-full wp-image-8812" src="http://www.dataxstream.com/wp-content/uploads/RFC_Server041.png" alt="" width="542" height="181" /></a></p>
<p>SAP transactoin SM59 is used to configure the SAP RFC Destination. In this example, the name of the RFC Destination (NIMBUS) is the name of the development computer that is running the RFC Server. The registered program ID (NCO3_RFC_SERVER) matches our app.config file.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/RFC_Server05.png" rel="shadowbox[sbpost-8763];player=img;"><img class="alignnone size-full wp-image-8769" src="http://www.dataxstream.com/wp-content/uploads/RFC_Server05.png" alt="" width="506" height="396" /></a></p>
<h2>The Code</h2>
<p>As an Nco developer, one of my favorite changes brought about by Nco 3.0 is how RFC server functionality is implemented. Instead of overriding generated stub method, we need to implement one or more class methods that will process the incoming RFC calls. For this there are several possibilities:</p>
<ul>
<li>The first option is to create one static method corresponding to each SAP function module to be implemented.  Assigning a SAP function module to a method is done by decorating the method with the <span style="font-family: Consolas, Courier, monospace"><span style="color: #8080ff">RfcServerFunction</span></span> attribute.</li>
<li>The second method is to create one static method for that handles all SAP function modules. This is called the “default” method. Use the same <span style="font-family: Consolas, Courier, monospace"><span style="color: #8080ff">RfcServerFunction</span></span> method decoration as the previous option, but denote that the method is the defualt RFC handler. The Name attribute is irrelevant in this case.  These two methods for RFC Function handling can be combined in the same project.</li>
</ul>
<p>It is also possible to use either of the two previous options with instance methods instead of static methods.  For the purposes of this example, we will use a static method to implement our RFC Server.</p>
<p>We will create a class that exposes a method that can be called via SAP RFC.  In our example that class is named DxsRfcServer and it contains one method that will supply the STFC_CONNECTION functionality.  Now perform the following steps to implement class.</p>
<ol>
<li>Provide the RFC callable code. This is done in our DxsRfcServer class, where we have a method defined. The <span style="font-family: Consolas, Courier, monospace"><span style="color: #8080ff">RfcServerFunction</span></span> code attribute on line 59 identifies this function to the SAP .Net Connector as the method that implements SAP function STFC_CONNECTION. On line 60 is where we are passed two parameters that contain all of the information we need to execute our function. The <span style="font-family: Consolas, Courier, monospace">IRfcFunction</span> interface provides access to parameter values. In this case we use the <span style="font-family: Consolas, Courier, monospace">.GetString()</span> method on line 69 to extract the value of the REQUTEXT parameter. We also can return values to the RFC caller using the IRfcFunction interface by using the <span style="font-family: Consolas, Courier, monospace">.SetValue()</span> method as seen in lines 69-70.<br />
<a href="http://www.dataxstream.com/wp-content/uploads/RFC_Server06.png" rel="shadowbox[sbpost-8763];player=img;"><img class="alignnone size-full wp-image-8771" src="http://www.dataxstream.com/wp-content/uploads/RFC_Server06.png" alt="" width="600" height="207" /></a></li>
<li> Create an array of types, with just one element that refers to our DxsRfcServer class.<br />
<a href="http://www.dataxstream.com/wp-content/uploads/RFC_Server07.png" rel="shadowbox[sbpost-8763];player=img;"><img class="alignnone size-full wp-image-8778" src="http://www.dataxstream.com/wp-content/uploads/RFC_Server07.png" alt="" width="514" height="18" /></a></li>
<li>Register the array with an <span style="font-family: Consolas, Courier, monospace">RfcServer</span> object.  Notice that on line 22, the first parameter to the <span style="font-family: Consolas, Courier, monospace">.GetServer()</span> method is the NAME field of the servers section in app.config.<br />
<a href="http://www.dataxstream.com/wp-content/uploads/RFC_Server08.png" rel="shadowbox[sbpost-8763];player=img;"><img class="alignnone size-full wp-image-8779" src="http://www.dataxstream.com/wp-content/uploads/RFC_Server08.png" alt="" width="483" height="67" /></a></li>
<li>Start the RFC server.<br />
<a href="http://www.dataxstream.com/wp-content/uploads/RFC_Server09.png" rel="shadowbox[sbpost-8763];player=img;"><img class="alignnone size-full wp-image-8784" src="http://www.dataxstream.com/wp-content/uploads/RFC_Server09.png" alt="" width="222" height="16" /></a></li>
<li>At this time, the SAP system has visibility of our program running on the application gateway. (SAP transaction SMGW Goto menu-&gt;Logged On Clients)<br />
<a href="http://www.dataxstream.com/wp-content/uploads/RFC_Server10.png" rel="shadowbox[sbpost-8763];player=img;"><img class="alignnone size-full wp-image-8785" src="http://www.dataxstream.com/wp-content/uploads/RFC_Server10.png" alt="" width="653" height="82" /></a></li>
<li>Use the test function screen in transaction SE37 to test the new function. The RFC Target System is set to the name of the RFC destination created in the previous step (in this case it is our development system name).<br />
<a href="http://www.dataxstream.com/wp-content/uploads/RFC_Server11.png" rel="shadowbox[sbpost-8763];player=img;"><img class="alignnone size-full wp-image-8786" src="http://www.dataxstream.com/wp-content/uploads/RFC_Server11.png" alt="" width="370" height="205" /></a><br />
Here are the results:<br />
<a href="http://www.dataxstream.com/wp-content/uploads/RFC_Server12.png" rel="shadowbox[sbpost-8763];player=img;"><img class="alignnone size-full wp-image-8787" src="http://www.dataxstream.com/wp-content/uploads/RFC_Server12.png" alt="" width="489" height="307" /></a></li>
<li>The command console will also display some useful information:<br />
<a href="http://www.dataxstream.com/wp-content/uploads/RFC_Server13.png" rel="shadowbox[sbpost-8763];player=img;"><img class="alignnone size-full wp-image-8788" src="http://www.dataxstream.com/wp-content/uploads/RFC_Server13.png" alt="" width="536" height="160" /></a></li>
</ol>
<p>The rest of the code is regular Windows Console programming and is very straight forward.</p>
<h2>Additional Information</h2>
<p>Follow these links for more information about NCo 3.0 programming:</p>
<ul>
<li><a title="SAP NCo 3.0 – Best Practice Guide for Upgrade from .NET Connector 2.0" href="http://www.dataxstream.com/sap_webinars/sap-nco-3-0-best-practice-guide-for-upgrade-from-net-connector-2-0/">Webinar: SAP NCo 3.0 – Best Practice Guide for Upgrade from .NET Connector 2.0</a></li>
<li><a title="SAP NCo 3.0 RFC Server Sample Code" href="http://www.dataxstream.com/sap-nco-3-0-rfc-server-sample-code/">Source Code: RFC Server with NCo 3.0</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dataxstream.com/2011/08/nco-3-rfc-server-step-by-step/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Build an RFC Client with NCo 3.0 &#8211; A Step-By-Step Guide</title>
		<link>http://www.dataxstream.com/2011/08/nco-3-rfc-client-step-by-step/</link>
		<comments>http://www.dataxstream.com/2011/08/nco-3-rfc-client-step-by-step/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 14:15:32 +0000</pubDate>
		<dc:creator>Craig Stasila</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[SAP ABAP Blog]]></category>
		<category><![CDATA[SAP Interface Blog]]></category>
		<category><![CDATA[SAP Technical]]></category>
		<category><![CDATA[.Net Connector]]></category>
		<category><![CDATA[Craig Stasila]]></category>
		<category><![CDATA[DataXstream]]></category>
		<category><![CDATA[NCo]]></category>
		<category><![CDATA[NCo 3.0]]></category>
		<category><![CDATA[SAP .Net Connector]]></category>

		<guid isPermaLink="false">http://www.dataxstream.com/?p=8576</guid>
		<description><![CDATA[The SAP .Net Connector 3.0 (NCo 3.0) offers many improvements over the 2.0 version of that product. Unfortunately, SAP no longer offers example .NET code.  This blog attempts to fill that gap by describing how to build a simple RFC Client using SAP .Net Connector (NCo) 3.0.  Click here to request a .zip file containing a [...]]]></description>
			<content:encoded><![CDATA[<p>The SAP .Net Connector 3.0 (NCo 3.0) offers many improvements over the 2.0 version of that product. Unfortunately, SAP no longer offers example .NET code.  This blog attempts to fill that gap by describing how to build a simple RFC Client using SAP .Net Connector (NCo) 3.0.  <a href="http://www.dataxstream.com/sap-nco-3-0-rfc-client-code/">Click here</a> to request a .zip file containing a copy of the source code.</p>
<p>The sample program displays details about companies defined by SAP. There are two BAPI calls involved, BAPI_COMPANY_GETLIST and BAPI_COMPANY_GETDETAIL.<br />
Along with the SAP .Net Connector 3.0, we are using Microsoft Visual Studio 2010 and the Microsoft .Net Framework 4.0 to build our sample.  Prior to starting, you will have to download and install <a href="http://service.sap.com/connectors" target="_blank">NCo 3.0</a> (OSS login required).<br />
<span id="more-8576"></span></p>
<h2>Setting up the Project</h2>
<p>Using Visual Studio 2010, create a new Windows Form project. In the project properties, be sure to set the Target Framework to .Net Framework 4.0.<a href="http://www.dataxstream.com/wp-content/uploads/RFC_Client01.png" rel="shadowbox[sbpost-8576];player=img;"><img class="alignnone size-full wp-image-8581" src="http://www.dataxstream.com/wp-content/uploads/RFC_Client01.png" alt="" width="564" height="332" /></a></p>
<p>Add references to the SAP .Net Connector 3.0. There are two DLLs, sapnco.dll and sapnco_utils.dll.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/RFC_Client02.png" rel="shadowbox[sbpost-8576];player=img;"><img class="alignnone size-full wp-image-8582" src="http://www.dataxstream.com/wp-content/uploads/RFC_Client02.png" alt="" width="251" height="154" /></a></p>
<h2>Design the Form</h2>
<p>Add two controls to the form. The first is a List Box, which will contain the list of available SAP companies. The second control to add is a Property Grid control, which is used to display the details of a particular SAP company when the user selects one from the List Box.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/RFC_Client03.png" rel="shadowbox[sbpost-8576];player=img;"><img class="alignnone size-full wp-image-8583" src="http://www.dataxstream.com/wp-content/uploads/RFC_Client03.png" alt="" width="575" height="454" /></a></p>
<h2>Using App.Config to define the SAP Connections</h2>
<p>There are several methods you can use in your solutions to define a particular SAP host. For this example, we are using an app.config file to define our SAP host.<br />
The SAP .Net Connector 3.0 includes sample app.config files. For the RFC client, be sure there is a sectionGroup definition for <span style="font-family: Consolas, Courier, monospace"><span style="color: #0000ff">&lt;</span><span style="color: #800000">ClientSettings</span><span style="color: #0000ff">&gt;</span></span>.<br />
The SAP host is defined by the destinations section. Within the destination, the Name field identifies this app.config entry to our program code. Specify the appropriate user name, password, SAP host name, client and system number in the destination section.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/RFC_Client04.png" rel="shadowbox[sbpost-8576];player=img;"><img class="alignnone size-full wp-image-8584" src="http://www.dataxstream.com/wp-content/uploads/RFC_Client04.png" alt="" width="688" height="347" /></a></p>
<h2>The BAPIs</h2>
<p>Use the SAP transaction SE37 to determine the parameters for functions BAPI_COMPANY_GETLIST and BAPI_COMPANY_GETDETAIL. This will tell us what parameters need to be passed in and where to find the results that are returned to our code.</p>
<h2>The Code</h2>
<p>During the form load event, we want to populate our List Box with the defined companies from SAP.</p>
<ol>
<li>Acquire a valid RfcDestination to use. Use method <span style="font-family: Consolas, Courier, monospace">RfcDestinationManager.GetDestination()</span> to do this. <span style="font-family: Consolas, Courier, monospace">GetDestination()</span> requires a parameter to determine which SAP host to refer to. Pass in the Name of the SAP host you previously defined in the app.config file. (Line 60)</li>
<li>Now that we have a valid <span style="font-family: Consolas, Courier, monospace">RfcDestination</span> object, we need access to the SAP Repository. The repository contains information about the BAPI calls we are going to make. The <span style="font-family: Consolas, Courier, monospace">RfcRepository</span> is an attribute of an <span style="font-family: Consolas, Courier, monospace">RfcDestination</span> object. (Line 62)</li>
<li>Using the <span style="font-family: Consolas, Courier, monospace">RfcRepository</span> object, acquire a reference to the SAP BAPI by calling method <span style="font-family: Consolas, Courier, monospace">RfcRepository.CreateFunction()</span> method. Pass in the name of the desired function as a string parameter to <span style="font-family: Consolas, Courier, monospace">CreateFunction()</span>. This method returns an object we can use to setup parameters, invoke the function, and retrieve results.</li>
<li>Now we can make the RFC calls into SAP. Using the <span style="font-family: Consolas, Courier, monospace">IRfcFunction</span> object returned by <span style="font-family: Consolas, Courier, monospace">CreateFunction()</span>, call the <span style="font-family: Consolas, Courier, monospace">Invoke()</span> method, passing in our <span style="font-family: Consolas, Courier, monospace">RfcDestination</span> object as parameter. This will make the RFC call into SAP, and provides the results via our <span style="font-family: Consolas, Courier, monospace">IRfcFunction</span> object. (Line 68)</li>
<li>SAP function BAPI_GET_COMPANYLIST returns a table of company records. We use an instance of an <span style="font-family: Consolas, Courier, monospace">IRfcTable</span> object that we retrieve by calling the <span style="font-family: Consolas, Courier, monospace">GetTable()</span> method on the <span style="font-family: Consolas, Courier, monospace">IRfcFunction</span> object. To get a desired table, pass in the table name to the <span style="font-family: Consolas, Courier, monospace">GetTable()</span> method. (Line 70)</li>
<li>We now have an instance of an <span style="font-family: Consolas, Courier, monospace">IRfcTable</span> object that contains company information through which we can iterate. It is possible to iterate through the data by setting the <span style="font-family: Consolas, Courier, monospace">CurrentIndex</span> property on the returned table. For a particular row in the table, it is possible to access values using the <span style="font-family: Consolas, Courier, monospace">GetString()</span> method. (Lines 75-79)</li>
<li>For each company, get the CompanyNumber, and use that as a parameter to SAP function BAPI_COMPANY_GETDETAIL. BAPI_COMPANY_GETDETAIL returns detailed information about that particular SAP company. The techniques are the same as before, with the additional step of using the <span style="font-family: Consolas, Courier, monospace">SetValue()</span> method on the <span style="font-family: Consolas, Courier, monospace">IRfcFunction</span> object to pass in the company number as a parameter. (Lines 78-84)</li>
<li>BAPI_COMPANY_GETDETAIL returns data as an instance of the <span style="font-family: Consolas, Courier, monospace">IRfcStructure</span> interface. Access individual field data of the company record, using the <span style="font-family: Consolas, Courier, monospace">GetString()</span> method of the <span style="font-family: Consolas, Courier, monospace">IRfcStructure</span> object instance. (Lines 88-99)</li>
<li>Extract the company details as desired. Add them to some object you create and then add that object to the List Box control. (Line 101)</li>
</ol>
<p><a href="http://www.dataxstream.com/wp-content/uploads/RFC_Client05.png" rel="shadowbox[sbpost-8576];player=img;"><img class="alignnone size-full wp-image-8585" src="http://www.dataxstream.com/wp-content/uploads/RFC_Client05.png" alt="" width="665" height="547" /></a></p>
<p>The rest of the code is regular Windows Forms programming. Your code will need to wire up the List Box changed events so that the Property Grid will display the details of the selected company.</p>
<h2>Additional Information</h2>
<p>Follow these links for more information about NCo 3.0 programming:</p>
<ul>
<li>Webinar: <a href="http://www.dataxstream.com/sap_webinars/sap-nco-3-0-best-practice-guide-for-upgrade-from-net-connector-2-0/">SAP NCo 3.0 – Best Practice Guide for Upgrade from .NET Connector 2.0</a></li>
<li>Source Code: <a href="http://www.dataxstream.com/sap-nco-3-0-rfc-client-code/">RFC Client with NCo 3.0</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dataxstream.com/2011/08/nco-3-rfc-client-step-by-step/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Introducing SAP .NET Connector (NCo) 3.0</title>
		<link>http://www.dataxstream.com/2011/01/introducing-sap-net-connector-nco-3-0/</link>
		<comments>http://www.dataxstream.com/2011/01/introducing-sap-net-connector-nco-3-0/#comments</comments>
		<pubDate>Wed, 05 Jan 2011 15:33:30 +0000</pubDate>
		<dc:creator>Craig Stasila</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[SAP Interface Blog]]></category>
		<category><![CDATA[SAP Technical]]></category>
		<category><![CDATA[.Net Connector]]></category>
		<category><![CDATA[Craig Stasila]]></category>
		<category><![CDATA[DataXstream]]></category>
		<category><![CDATA[external program]]></category>
		<category><![CDATA[NCo]]></category>
		<category><![CDATA[NCo 3.0]]></category>
		<category><![CDATA[SAP .Net Connector]]></category>
		<category><![CDATA[SAP Integration]]></category>
		<category><![CDATA[SAP programming]]></category>

		<guid isPermaLink="false">http://www.dataxstream.com/?p=6680</guid>
		<description><![CDATA[This past summer, SAP announced a new version of SAP Connector for Microsoft .NET &#8212; NCo 3.0.  SAP decided to give us an early Christmas present when they officially released NCo 3.0 on December 22, 2010.  You can download NCo 3.0 at http://service.sap.com/connectors (you will need an OSS logon). Included in the downloads are documents [...]]]></description>
			<content:encoded><![CDATA[<p>This past summer, SAP announced a new version of SAP Connector for Microsoft .NET &#8212; NCo 3.0.  SAP decided to give us an early Christmas present when they officially released NCo 3.0 on December 22, 2010.  You can download NCo 3.0 at <a href="http://service.sap.com/connectors" target="_blank">http://service.sap.com/connectors</a> (you will need an OSS logon).</p>
<p>Included in the downloads are documents that discuss the notable changes from .NET Connector 2.0 and a very comprehensive help file (in .chm format).  Noticeably absent are complete samples, although SAP claims that the included tutorial will be updated.</p>
<p>Additionally, I already have my first NCo 3.0 project under way, so check back soon for more information about NCo 3.0!</p>
<p>Happy Coding!</p>
<p>[UPDATED]</p>
<h2>Additional Information</h2>
<p>Follow these links for more information about NCo 3.0 programming:</p>
<ul>
<li>Webinar: <a href="http://www.dataxstream.com/sap_webinars/sap-nco-3-0-best-practice-guide-for-upgrade-from-net-connector-2-0/">SAP NCo 3.0 – Best Practice Guide for Upgrade from .NET Connector 2.0</a></li>
<li><a title="Build an RFC Client with NCo 3.0 – A Step-By-Step Guide" href="http://www.dataxstream.com/2011/08/nco-3-rfc-client-step-by-step/">Build an RFC Client with NCo 3.0 &#8211; A Step-By-Step Guide</a></li>
<li><a title="Build an RFC Server with NCo 3.0 – A Step-By-Step Guide" href="http://www.dataxstream.com/2011/08/nco-3-rfc-server-step-by-step/">Build an RFC Server with NCo 3.0 &#8211; A Step-By-Step Guide</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.dataxstream.com/2011/01/introducing-sap-net-connector-nco-3-0/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Case Study &#8211; Integration with SAP .Net Connector</title>
		<link>http://www.dataxstream.com/success-stories/case-studies/sap-net-connector/</link>
		<comments>http://www.dataxstream.com/success-stories/case-studies/sap-net-connector/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 20:21:09 +0000</pubDate>
		<dc:creator>Dataxstream</dc:creator>
				<category><![CDATA[.Net Connector]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[NCo]]></category>
		<category><![CDATA[SAP .Net Connector]]></category>

		<guid isPermaLink="false">http://www.dataxstream.com/</guid>
		<description><![CDATA[Pure Fishing, Inc. &#8211; Integration with SAP .Net Connector Pure Fishing needed a new and standardized solution to allow seamless interaction between their SAP systems and third-party warehouse management software that was more reliable and flexible then custom integration approach used in the past. View More Case Studies]]></description>
			<content:encoded><![CDATA[<p><!--StartFragment--> <!--EndFragment--></p>
<table border="0" cellspacing="20" cellpadding="0" width="100%">
<tbody>
<tr>
<td width="90" valign="top"><a href="http://www.dataxstream.com/download/22"><img class="size-medium wp-image-6654 alignleft" title="Pure Fishing Thumbnail" src="http://www.dataxstream.com/wp-content/uploads/Pure-Fishing-Thumbnail4-232x300.png" alt="" width="83" height="108" /></a></td>
<td>
<h3><strong>Pure Fishing, Inc. &#8211; Integration with SAP .Net Connector</strong></h3>
<h2><strong> </strong></h2>
<p>Pure Fishing needed a new and standardized solution to allow seamless interaction between their SAP systems and third-party warehouse management software that was more reliable and flexible then custom integration approach used in the past.</td>
</tr>
</tbody>
</table>
<p><a href="http://www.dataxstream.com/success-stories/case-studies/"><strong>View More Case Studies</strong></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dataxstream.com/success-stories/case-studies/sap-net-connector/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Coming Soon: SAP .NET Connector (NCo) 3.0</title>
		<link>http://www.dataxstream.com/2010/07/sap-net-connector-nco-3-0-overview/</link>
		<comments>http://www.dataxstream.com/2010/07/sap-net-connector-nco-3-0-overview/#comments</comments>
		<pubDate>Wed, 21 Jul 2010 13:40:15 +0000</pubDate>
		<dc:creator>Craig Stasila</dc:creator>
				<category><![CDATA[SAP ABAP Blog]]></category>
		<category><![CDATA[SAP Basis Blog]]></category>
		<category><![CDATA[SAP Interface Blog]]></category>
		<category><![CDATA[SAP Technical]]></category>
		<category><![CDATA[.Net Connector]]></category>
		<category><![CDATA[Craig Stasila]]></category>
		<category><![CDATA[DataXstream]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[NCo]]></category>
		<category><![CDATA[SAP .Net Connector]]></category>
		<category><![CDATA[Xstream Connector]]></category>
		<category><![CDATA[XstreamConnector]]></category>

		<guid isPermaLink="false">http://www.dataxstream.com/?p=5499</guid>
		<description><![CDATA[SAP is announcing a new version of SAP Connector for Microsoft .NET 3.0 (now called &#8220;NCo 3.0&#8243;). A beta program for selected customers and partners is currently underway (Q3, 2010) with the general release of the software coming soon thereafter.  I will highlight some of the major differences between the SAP Connector for Microsoft .NET [...]]]></description>
			<content:encoded><![CDATA[<p>SAP is announcing a new version of SAP Connector for Microsoft .NET 3.0 (now called &#8220;NCo 3.0&#8243;). A beta program for selected customers and partners is currently underway (Q3, 2010) with the general release of the software coming soon thereafter.  I will highlight some of the major differences between the SAP Connector for Microsoft .NET 2.0 and NCo 3.0 (besides the obvious, and much-needed name-shortening).</p>
<blockquote><p>EDITOR&#8217;S NOTE: NCo 3.0 has now been released.  <a href="http://www.dataxstream.com/2011/01/introducing-sap-net-connector-nco-3-0/">Read more details here.</a></p></blockquote>
<p><span id="more-5499"></span></p>
<h2>NCo 3.0 Logon</h2>
<div>Security got vital improvements in NCo 3.0.  The component handling logon and authentication was redesigned to thwart the following attacks:</div>
<div>
<ul>
<li>The unauthorized reading of sensitive logon data from the .NET configuration file (e.g. app.config).</li>
<li>The potential to create a malevolent application which replaces the customized logon data with it’s own logon data to obtain backend user sessions with different authorizations.</li>
<li>The potential to create a malevolent application which gains access to an open connection that was originally intended for a different application.</li>
</ul>
</div>
<p>One of the new features implemented to combat the malevolent for RFC client attacks is the interface <span style="font-family: Courier;">IDestinationConfiguration</span>.  This interface contains method <span style="font-family: Courier;">IDestinationConfiguration.GetParameters(string destinationName)</span> which allows .NET programmers to provide their own secure method for storing and retrieving logon information, be it encrypted database, encrypted file, or even LDAP.  There is also a corresponding interface and method to secure NCo 3.0 RFC servers.</p>
<p>Additionally, there is updated functionality to support single sign-on (SSO) and X.509 certificates.</p>
<h2>Say Goodbye to Data Containers and Generated Code</h2>
<p>In SAP Connector 2.0, working with RFCs required the generation of proxy code via the SAP .NET Connector design-time tool.  This tool would convert the IMPORTING, EXPORTING, CHANGING, and TABLES parameters from the RFC you were calling/serving to .NET representations of the same.  With NCo 3.0 there is no longer any kind of generated code.  Instead of one generated proxy method for each function module, there is one single <span style="font-family: Courier;">RfcFunction</span> class, whose <span style="font-family: Courier;">Invoke()</span> method dynamically executes every given ABAP function module.  Additionally, all ABAP parameters will be represented by the class <span style="font-family: Courier;">RfcStructure</span> instead of a dedicated generated class for every structure; All tables will be represented by class <span style="font-family: Courier;">RfcTable</span>.  So, instead of hard-coding all of the data and variable bindings statically at design time, NCo 3.0 now handles everything dynamically at runtime.</p>
<p>NCo 3.0 uses SAP&#8217;s data dictionary to determine the function interface for the called RFCs.  While this data is cached locally for performance reasons, NCo 3.0 is robust enough to detect changes in RFC interface signatures so your code will still execute if you&#8217;ve added, deleted, or changed RFC parameters.  If there arises a situation where the dynamic lookup of RFC interface signature is not wanted, there is also an option to hard code the RFC parameter metadata.</p>
<p>The biggest benefit of NCo 3.0&#8242;s new dynamic function handling is that NCo 3.0 no longer has a design-time component.  This releases the Visual Studio version restriction that .NET 2.0 had.  Let me rephrase that, <strong>NCo 3.0 will work with any version of Visual Studio you like!</strong> The only requirement is that at runtime, a .NET Framework version is installed that is compatible with the NCo 3.0 libraries.</p>
<h2>Anxiously Waiting</h2>
<p>NCo 3.0 figures to be a much-needed update to a vital SAP integration technology.  I, for one, cannot wait for the new functionality to be generally released.  Once NCo 3.0 is released we&#8217;ll be posting blogs highlighting the new features.  We&#8217;ll also include helpful information regarding a .NET Connector 2.0 to NCo 3.0 upgrade.  In the meantime, if you have any leave any questions or comments you have regarding NCo 3.0 below.  You may also email me directly at <span class="mh-email">csta<a href='http://www.google.com/recaptcha/mailhide/d?k=01NvHbOaIcE_hinzIpcpzZQQ==&amp;c=2sqVLQgd7lYWASsTIrUumIH5gCbE09il9SNcQyxGWDs=' onclick="window.open('http://www.google.com/recaptcha/mailhide/d?k=01NvHbOaIcE_hinzIpcpzZQQ==&amp;c=2sqVLQgd7lYWASsTIrUumIH5gCbE09il9SNcQyxGWDs=', '', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300'); return false;" title="Reveal this e-mail address">...</a>@dataxstream.com</span> if you&#8217;d like to set up a detailed conversation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dataxstream.com/2010/07/sap-net-connector-nco-3-0-overview/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>

