<?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 Integration Experts - DataXstream &#187; SAP .Net Connector</title>
	<atom:link href="http://www.dataxstream.com/tag/sap-net-connector/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dataxstream.com</link>
	<description>SAP Certified Consultants</description>
	<lastBuildDate>Thu, 09 Sep 2010 18:20:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<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[Craig Stasila]]></category>
		<category><![CDATA[DataXstream]]></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>
<div id="_mcePaste"><span id="more-5499"></span></div>
<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 <a href="mailto:cstasila@dataxstream.com">cstasila@dataxstream.com</a> 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>1</slash:comments>
		</item>
		<item>
		<title>Build an SAP RFC Server using the SAP .Net Connector</title>
		<link>http://www.dataxstream.com/2010/03/build-an-sap-rfc-server-using-the-sap-net-connector/</link>
		<comments>http://www.dataxstream.com/2010/03/build-an-sap-rfc-server-using-the-sap-net-connector/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 13:30:58 +0000</pubDate>
		<dc:creator>Terry DeBruicker</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[SAP Interface Blog]]></category>
		<category><![CDATA[SAP Technical]]></category>
		<category><![CDATA[ABAP]]></category>
		<category><![CDATA[DataXstream]]></category>
		<category><![CDATA[SAP]]></category>
		<category><![CDATA[SAP .Net Connector]]></category>

		<guid isPermaLink="false">http://www.dataxstream.com/?p=4054</guid>
		<description><![CDATA[This blog post describes step-by-step how to use the SAP .Net Connector and Microsoft C# to create an SAP RFC Server. This allows an SAP process to call your custom C# code, which can accept parameters and return values. The SAP .Net Connector simplifies creating C# programs that can interoperate with an SAP host. The [...]]]></description>
			<content:encoded><![CDATA[<p>This blog post describes step-by-step how to use the SAP .Net Connector and Microsoft C# to create an SAP RFC Server. This allows an SAP process to call your custom C# code, which can accept parameters and return values.</p>
<p>The SAP .Net Connector simplifies creating C# programs that can interoperate with an SAP host. The SAP .Net Connector is available from the <a href="http://service.sap.com/connectors" target="_blank">SAP Service Marketplace</a>. You must have access to the SAP Service Marketplace to be able to download the SAP .Net Connector. The SAP .Net Connector must be installed on your development machine before we begin.</p>
<p>RFC is a Remote Function Call. In this case, the SAP process is a ‘client’ that is making an RFC call to our custom ‘server’ code. Our code uses the SAP .Net Connector to register on an SAP Application Gateway.</p>
<p>The TLA system we have been creating exists solely to demonstrate certain programming techniques involving the SAP .Net Connector and C#.  We will cover three separate parts of the solution: defining the function to SAP, creating a proxy object used to access SAP, and creating our C# code to perform the RFC function.</p>
<h2><span id="more-4054"></span>Defining the Function in SAP</h2>
<p>Before we build our RFC server, we will define our RFC function in the SAP system. There are two parts we will need to create:  the Function Signature, and the RFC Destination.</p>
<h3>Defining the RFC Function Signature</h3>
<p>Open the SAP SE37 Function Builder screen. For the Function Module field, enter <strong>Z_RFC_TLA_HELLO_WORLD</strong> and click Create. For the Function group, press the browse button to the right of the field, then select an appropriate function Group. Enter a short text description and click Save to save the function signature.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0013.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0013_thumb.jpg" border="0" alt="Image-0013" width="244" height="187" /></a></p>
<p>On the Attributes tab, be sure to select the <em>Remote-enabled module</em> radio button.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0027.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0027_thumb.jpg" border="0" alt="Image-0027" width="244" height="164" /></a></p>
<p>Now we will be asked to define the parameters that are used. SAP refers to values passed to the RFC call as Import values. Values that are returned from the RFC call are called Export values.</p>
<p>In the Function Builder screen, on the Import tab, define a Parameter named <strong>Name</strong>. Fill in the appropriate Type and Associated Type values. Be sure to check the Pass Value check box.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0016.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0016_thumb.jpg" border="0" alt="Image-0016" width="244" height="69" /></a></p>
<p>On the Export tab, create a Parameter named Hello_World. This will end up storing the result of the RFC call. Define the field in the same way as the Name import field.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0017.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0017_thumb.jpg" border="0" alt="Image-0017" width="244" height="75" /></a></p>
<p>Save your RFC Function. Then you need to activate your RFC function. To do that, from the SE37 screen, enter the function module name. then click the <em>Activate</em> button.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0019.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0019_thumb.jpg" border="0" alt="Image-0019" width="244" height="186" /></a></p>
<h3>Defining the RFC Destination</h3>
<p>SAP can direct an RFC call to different destinations. We will create an RFC Destination using SAP function SM59. This RFC Destination is used by the SAP system to route an RFC call to our program, which previously registered itself on the SAP Application Gateway.</p>
<p>In the SM59 screen, click the Create button.  Enter RFC destination of <strong>TLARFCSERVER</strong>. The Connection type is <strong>T</strong> for TCP/IP. Enter a description.</p>
<p>On the Technical settings tab, select Activation Type of <em>Registered Server Program</em>.</p>
<p>For the Registered Server Program Program ID, enter <strong>TlaRfcSrv</strong>. The Program ID we use here must match the Program ID used when our server code connects to the SAP Application Gateway.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0010.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0010_thumb.jpg" border="0" alt="Image-0010" width="346" height="387" /></a></p>
<p>If you try the Test connection button, it will fail, since we have not yet registered our program on the Application Gateway. Later, we can come back to SM59 and test this and see that our RFC destination is available.</p>
<h2>C# Code</h2>
<p>We will create an application that can be called from an SAP host. The SAP host will pass in a name, as a string. Our application will return a hello greeting back to the calling program.</p>
<p>Our solution will consist of two parts.</p>
<ol>
<li>The first part is the SAP .Net Connector Proxy project, named TlaRfcServerSapProxy. This will produce a Dynamic Link Library that encapsulates what we need to know to interoperate with the SAP host.</li>
<li>The second part is is our custom code project, named TlaRfcServer. This contains the code which will execute when called from the SAP host via RFC. Save the RFC destination.</li>
</ol>
<h3>Creating the SAP Proxy Project</h3>
<p>We will use Visual Studio 2003 to create a DLL that manages the interactions with the SAP host. The SAP .Net Connector version 2.0 works with Visual Studio 2003 or 2005. To use the .Net Connector in our preferred environment of Visual Studio 2008, we will create the proxy DLL in 2003 and add that to our 2008 project. The techniques are described in our earlier post, <a title="How to Build an SAP .Net Connector Proxy" href="http://www.dataxstream.com/2009/08/using-the-sap-net-connector-in-visual-studio-2008/" target="_blank">Using the SAP .Net Connector in Visual Studio 2008</a>.</p>
<p>In Visual Studio 2003, start a new Class Library project named TlaRfcServerSapProxy. Delete the default Class1.cs file that is created automatically.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0020.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0020_thumb.jpg" border="0" alt="Image-0020" width="341" height="248" /></a></p>
<p>From the Solution Explorer, Right-click on References and choose Add New References. Under the .Net tab, highlight SAP.Connector.dll and SAP.Connector.RFC. Click the Select button, then OK to add the SAP .Net Connector references.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0021.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0021_thumb.jpg" border="0" alt="Image-0021" width="352" height="246" /></a></p>
<p>Now add the SAP Connector Proxy to our project. Right click on the project and choose Add / Add New Item. Under the templates, highlight SAP Connector Proxy. In the Name field, give our proxy the name TlaRfcServerSapProxy.sapwsdl. The name we use here will become the object type name for our SAP Server Proxy object we use when we build our RFC server code.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0005.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0005_thumb.jpg" border="0" alt="Image-0005" width="353" height="280" /></a></p>
<p>The TlaRfcSerfverSapProxy.sapwsdl file will be displayed in Design mode. Right click on the Design surface and choose properties. This displays properties of our SAP Connector Proxy. Change the Proxy Type to Server.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0022.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0022_thumb.jpg" border="0" alt="Image-0022" width="359" height="127" /></a></p>
<p>Now we need to add in a reference to our SAP host so that we can pull in the signature and object model for our RFC function. Open the Server Explorer windows and expand SAP / Application Servers. Right-click on Application Servers and choose add New Server. Enter in the connection information for your SAP host. Click OK.</p>
<p>Expand the newly added SAP Server and right-click on Functions. Choose Add New Function Filter. In the Name Filter field, enter *HELLO* . The * is used as a wild card. Click OK to display our Z_TLA_RFC_HELLO_WORLD function in the Server Explorer.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0007.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0007_thumb.jpg" border="0" alt="Image-0007" width="351" height="150" /></a></p>
<p>Highlight the Z_TLA_RFC_HELLO_WORLD function in the Server Explorer, and drag it onto the TlaRfcServerSapProxy.sapwsdl design surface. This will add the necessary function signatures and object type definitions to the project.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0028.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0028_thumb.jpg" border="0" alt="Image-0028" width="350" height="121" /></a></p>
<p>Now attempt to build the project. It will fail, as we have not yet created the code to implement our remote function. But, when we ran the build, the SAP Connector generated an implementation stub for our server method. A new class was automatically added to our project, named TlaRfcServerSapProxyImpl.cs.</p>
<p>However, we desire to implement our RFC server using Visual Studio 2008.</p>
<p>So, we will modify this code so it will build, and later we will override the implementation from our Visual Studio 2008 project.</p>
<p>If you double-click on the build error, it will take you to the offending line of code. All we need to do is set the result of Hello_World to some value.  To prevent confusion with our Visual Studio 2008 code, we will just return foo.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0029.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0029_thumb.jpg" border="0" alt="Image-0029" width="356" height="73" /></a></p>
<p>Now build the TlaRfcSapServerProxy project and it will create TlaRfcServerSapProxy.dll, which we will use in our Visual Studio 2008 project.</p>
<h3>Creating the RFC Server Project</h3>
<p>Using Visual Studio 2008, create a C# console project named TlaRfcServer. In the Solution Explorer, right-click on References and choose Add New Reference. Using the Browse tab, select both SAP.Connector.dll and Sap.Connector.Rfc.dll, typically found in C:\Program Files\SAP\SAP .Net Connector 2.0.</p>
<p>Add a reference to the TlaRfcServerSapProxy.dll created earlier, also using the Browse tab. Add a reference to System.Web.Services using the .Net tab.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0024.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0024_thumb.jpg" border="0" alt="Image-0024" width="352" height="375" /></a></p>
<p>In our C# code, we need to provide the code to implement our RFC function, which we do by inheriting from TlaRfcServerSapProxyImpl and overriding the Hello World function.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0030.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0030_thumb.jpg" border="0" alt="Image-0030" width="357" height="141" /></a></p>
<p>On Line 3, with have our ‘using’ directive to include our custom proxy.</p>
<p>On line 8, we are creating a new class named SAPProxy, which is derived from our TlaRfcServerSapProxyImpl class that was created in our Visual Studio 2003 class.</p>
<p>On line 12 is the override of the Z_Tla_Rfc_Hello_World call. We provide our functionality and place the result in the Hello_World variable.</p>
<p>That concludes our class that will implement the RFC functionality.</p>
<p>Now we will finish off our console program so that we can establish our code on the SAP Application Gateway and execute it.</p>
<p>To do this,we will pass in command line arguments to our Main routine. These arguments are passed to the SAPProxy constructor, which uses them to connect to the correct SAP Application Gateway.</p>
<p>Each of our SAP Proxy objects are hosted by an SAPServerHost object, which is part of the SAP .Net Connector. The SAPServerHost object governs the connection to the SAP host.</p>
<p>Once we create the SAPProxy object and attach it to an SAPServerHost, we can start the host and that will cause our program to register and be available on the SAP Application Gateway.</p>
<p>Our program will continue to be available on the SAP Application Gateway as long as we have it running (until we press the enter key, in our example).</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0031.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0031_thumb.jpg" border="0" alt="Image-0031" width="369" height="212" /></a></p>
<p>On lines 22-25, we instantiate our proxy and SAP host. Notice how we pass in the command line arguments to the SAPProxy constructor (line 25).</p>
<p>We start the proxy on line 29. After we have done that, we can go back to the SAP SM59 function and test our RFC destination. If things are working, that test will success.</p>
<p>Our code will continue to be available until we press enter at line 37, after which we stop the SAP host.</p>
<h4>Command Line Arguments</h4>
<p>The command line arguments consist of three parts, and are specified in the Visual Studio environment under the Debug tab of the Project Properties display.</p>
<p>The three parts are</p>
<p>-aProgram ID</p>
<p>-XPort</p>
<p>-GHost</p>
<p>The Program ID specified here must match the Program ID we used when creating the SAP RFC Destination. In our case this is specified as –aTlaRfcSrv.</p>
<p>The Port field tells SAP what TCP/IP port to use. This is specified by –XSAPGW00. The SAPGW part specifies port 3300, we add whatever the 00 is to get the actual port number. In our case we are using port number 3300, so we use –XSAPGW00. If we wanted port 3302, we would have used –XSAPGW02.</p>
<p>The Host field is the DNS name or IP address of the SAP server.</p>
<p>So, your parameters will be different but they will look something like –aTlaRfcSrv –XSAPGW00 –Ghostname</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0032.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0032_thumb.jpg" border="0" alt="Image-0032" width="359" height="214" /></a></p>
<p>Now build and run TlaRfcServer. A console window will appear.</p>
<p>Go back to SAP and bring up the SM59 screen. Expand the TCP/IP connections and find TLARFCSERVER. Double click that to display the definition. When you click the Test Connection button, you should see something like :</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0034.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0034_thumb.jpg" border="0" alt="Image-0034" width="359" height="316" /></a></p>
<p>which indicates a successful test of the RFC destination.</p>
<p>Now we need to test our actual RFC function. Bring up the SAP SE37 screen. In the Function Module name, enter Z_TLA_RFC_HELLO_WORLD, which matches the name of the function signature we created earlier.</p>
<p>Press the F8 key to test the function. The Test Function Module screen is displayed.</p>
<p>For the RFC Target sys, we use the RFC Function destination we created earlier, TLARFCSERVER.</p>
<p>For the name field, type WORLD. Press F8 to execute the RFC call.</p>
<p><a href="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0035.jpg" rel="shadowbox[post-4054];player=img;"><img style="border-width: 0px;" src="http://www.dataxstream.com/wp-content/uploads/2010/02/Image0035_thumb.jpg" border="0" alt="Image-0035" width="360" height="213" /></a></p>
<p>This indicates a good test of our RFC function.</p>
<h4>Troubleshooting</h4>
<p>If things don’t work, check the following:</p>
<p>Program ID in RFC Destination matches –a parameter of TlaRfcServer command line.</p>
<p>Port number (SAPGW00) on TlaRfcSever comand line is set to correct port number.</p>
<p>Any firewalls in between the SAP host and the RFC Server program need to allow traffic in both directions over that port.</p>
<h2>Summary</h2>
<p>In this blog posting we have shown how you can call custom C# code from an SAP process.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dataxstream.com/2010/03/build-an-sap-rfc-server-using-the-sap-net-connector/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build an SAP IDOC Receiver Using the SAP .Net Connector</title>
		<link>http://www.dataxstream.com/2009/12/build-an-sap-idoc-receiver-using-the-sap-net-connector/</link>
		<comments>http://www.dataxstream.com/2009/12/build-an-sap-idoc-receiver-using-the-sap-net-connector/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 05:00:16 +0000</pubDate>
		<dc:creator>Terry DeBruicker</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[SAP Interface Blog]]></category>
		<category><![CDATA[SAP Technical]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[DataXstream]]></category>
		<category><![CDATA[IDOC receiver]]></category>
		<category><![CDATA[SAP .Net Connector]]></category>

		<guid isPermaLink="false">http://www.dataxstream.com/?p=3611</guid>
		<description><![CDATA[Using the SAP .Net Connector makes it easy to receive an IDOC from an SAP host.]]></description>
			<content:encoded><![CDATA[<h2>Overview</h2>
<p>This blog post describes how to receive an IDOC from an SAP system, using the SAP .Net Connector and Microsoft C#.</p>
<h2>Introduction</h2>
<p>The SAP .Net Connector simplifies creating C# programs that can interoperate with an SAP host. The SAP .Net Connector is available from the <a href="http://service.sap.com/connectors" target="_blank">SAP Service Marketplace</a>. You must have access to the SAP Service Marketplace to be able to download the SAP .Net Connector. The SAP .Net Connector must be installed on your development machine before we begin.</p>
<p>An IDOC is an Interface Document that is used to send or receive information to or from an SAP host.  An IDOC will consist of a header record and as many detail records as necessary. The header records follow the format of the EDI_DC40 table, and the detail records follow the format of the EDI_DD40 table. The exact format of the payload in the detail records depends on the type of IDOC being transmitted.</p>
<h2><span id="more-3611"></span>C# Code</h2>
<p>We will create an application that displays the contents of IDOCs received from an SAP host. Use Visual Studio 2008 and create a new C# console application. Name the new application IdocReceive.</p>
<h3>Add Reference to SAP .Net Connector.</h3>
<p>In the Solution Explorer,  right-click on References and choose Add New Reference. Select both SAP.Connector.dll and SAP.Connector.Rfc.dll. Typically, these files will be found in C:\Program Files\SAP\SAP .Net Connector 2.0.</p>
<p>Our program will instantiate a custom class, <strong>IdocReceiver</strong>, that encapsulates the SAP transmit and receive logic.</p>
<p>IdocReceiver inherits from the SAP .Net Connector.  IdocReceiver overrides methods from the SAP .Net Connector to manage the flow of IDOCs from the SAP host. IdocReceiver also subscribes to two events exposed by the SAP .Net Connector that perform the actual transmission.</p>
<p><div id="attachment_3635" class="wp-caption aligncenter" style="width: 624px"><a href="http://www.dataxstream.com/wp-content/uploads/2009/12/Image-00003.jpg" rel="shadowbox[post-3611];player=img;"><img class="size-large wp-image-3635      " src="http://www.dataxstream.com/wp-content/uploads/2009/12/Image-00003-1024x427.jpg" alt="IDOC Receiver Main Method" width="614" height="256" /></a><p class="wp-caption-text">IDOC Receiver Main Method</p></div></p>
<p>Line 5 contains the reference to the SAP .Net Connector that we need.</p>
<p>The IdocReceiver object requires an SAPHost object that is used to configure the connection to the SAP Gateway. Line 9 instantiates the SAPHost object.</p>
<p>Line 14 calls the IdocReceiver constructor. The first parameter is the SAP Connection String, used to connect to the SAP host. There are three parts of an SAP Connection String:</p>
<p style="padding-left: 30px"><strong>-aProgramName</strong> is the program name as it is defined on the SAP Gateway. This value must match the Program ID configured on the SAP Gateway. Use SAP command SM59 to view the settings of the SAP Gateway.</p>
<p style="padding-left: 30px"><strong>-xSAPGWnn</strong> is the SAP Gateway number to which the IDOC receiver will register.  The SAP Gateway listens on a TCP/IP port number based on <em>nn</em> value. The actual port number is equal to 3300 plus the <em>nn</em> value. In this case <em>nn</em> is zero, so port 3300 is used.</p>
<p style="padding-left: 30px"><strong>-gHostName</strong> is the DNS host name of the SAP server. It is also possible to specify an IP address, like -g192.168.10.1.</p>
<p>Line 16 starts the SAP host, which makes it possible to begin receiving IDOCs. At this point, our program will now be visible to the SAP host, which you can verify using the Test Connection command via SAP transaction SM59. As long as the IdocReceiver object remains in scope, it will receive IDOCs.</p>
<h3>IdocReceiver Class</h3>
<p>To receive an IDOC, the IdocReceiver class inherits from the SAP .Net Connector SAPIdocReceiver class. To control the flow of IDOCs, the IdocReceiver class overrides certain methods of the SAPIdocReceiver class. To actually receive an IDOC, the IdocReceiver subscribes to two events exposed by the SAPIdocReceiver class.</p>
<h4>Constructor</h4>
<p>Here is the code for the IdocReceiver constructor.</p>
<p><div id="attachment_3637" class="wp-caption aligncenter" style="width: 624px"><a href="http://www.dataxstream.com/wp-content/uploads/2009/12/Image-00013.jpg" rel="shadowbox[post-3611];player=img;"><img class="size-large wp-image-3637     " src="http://www.dataxstream.com/wp-content/uploads/2009/12/Image-00013-1024x195.jpg" alt="IdocReceiver Constructor" width="614" height="117" /></a><p class="wp-caption-text">IdocReceiver Constructor</p></div></p>
<p>On line 25 we declare our IdocReceiver and inherit from the appropriate SAP .Net Connector object. We use the StringWriter on Line 27 to store the contents of the actual IDOC received.</p>
<p>The constructor requires two parameters, the SAP Configuration string, and an SAPServerHost object that is a container for the IdocReceiver. Line 30 is where we call the base constructor.</p>
<p>The transfer of the IDOC raises an event at two times: when the transfer begins and when the transfer ends. On lines 32-33, we wire up our IdocReceiver methods to the BeginReceive and EndReceive events exposed by the SAPIdocReceiver class. Our IdocBeginReceive will be called at the start of the IDOC transmission, and our IdocEndReceive method will be called at the end of the IDOC transmission.</p>
<h4>IDOC Flow Control</h4>
<p>IDOCs flow out of an SAP system in a transactional way, in that an SAP host will send a particular IDOC once an only once. To accomplish this, the SAP host will put together one or more IDOCs into a transaction and send that off to the IdocReceiver that has registered on the SAP Gateway. The transaction is identified by a unique Transaction ID (TID) that is supplied by the SAP host. The SAP host will communicate with our IdocReceiver using the Transaction ID to control the flow of IDOCs from SAP to our program.</p>
<p>There are four methods of the base SAPIdocReceiver class that we need to override.</p>
<p><div id="attachment_3638" class="wp-caption aligncenter" style="width: 624px"><a href="http://www.dataxstream.com/wp-content/uploads/2009/12/Image-00021.jpg" rel="shadowbox[post-3611];player=img;"><img class="size-full wp-image-3638    " src="http://www.dataxstream.com/wp-content/uploads/2009/12/Image-00021.jpg" alt="IDOC Flow Control Methods" width="614" height="244" /></a><p class="wp-caption-text">IDOC Flow Control Methods</p></div></p>
<p>In each case, the SAP host expects our code to return a zero if there are no difficulties. The TIDs passed as parameters can be used to verify the state of the transmission. This demonstration code leaves out any processing you may want to use to validate the state of the transaction.</p>
<p>The SAP host will first call the CheckTransaction method. If a zero is returned, the SAP host will call ConfrimTransaction. If a zero is then returned, the SAP host will begin transmitting IDOCs. When the transmission is complete, the SAP host will call CommitTransaction.</p>
<h4>IDOC Reception</h4>
<p>We use two methods to receive the actual IDOCs. At the start of the transmission, we assign a StringWriter to the EventArg, which tells the SAP .Net Connector where we want to place the payload of the transmission. When the transmission is complete, we can read from the StringWriter to extract the payload.</p>
<p><div id="attachment_3639" class="wp-caption aligncenter" style="width: 624px"><a href="http://www.dataxstream.com/wp-content/uploads/2009/12/Image-00031.jpg" rel="shadowbox[post-3611];player=img;"><img class="size-full wp-image-3639   " src="http://www.dataxstream.com/wp-content/uploads/2009/12/Image-00031.jpg" alt="IDOC Reception" width="614" height="252" /></a><p class="wp-caption-text">IDOC Reception</p></div></p>
<p>There can be one or more IDOCs transmitted at a time. Your code will need to parse the payload to determine what goes where.</p>
<p>If any of your code throws an exception, the SAP .Net Connector will detect that and alert the SAP side. The SAP side will then call your Rollback method.</p>
<h2>Summary</h2>
<p>Using the SAP .Net Connector makes it easy to receive an IDOC from an SAP host.</p>
<h3>To learn more about IDOCs download the white paper: <a href="http://www.dataxstream.com/success-stories/whitepapers/white-paper-request/" target="_self">ALE &amp; IDOC Leveraging</a></h3>
<div class="wlWriterEditableSmartContent" style="padding-bottom: 0px;margin: 0px;padding-left: 0px;padding-right: 0px;float: none;padding-top: 0px"><a rel="tag" href="http://technorati.com/tags/how+to"></a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.dataxstream.com/2009/12/build-an-sap-idoc-receiver-using-the-sap-net-connector/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using the SAP .Net Connector in Visual Studio 2008</title>
		<link>http://www.dataxstream.com/2009/08/using-the-sap-net-connector-in-visual-studio-2008/</link>
		<comments>http://www.dataxstream.com/2009/08/using-the-sap-net-connector-in-visual-studio-2008/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 02:00:51 +0000</pubDate>
		<dc:creator>Terry DeBruicker</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[SAP Interface Blog]]></category>
		<category><![CDATA[SAP Technical]]></category>
		<category><![CDATA[DataXstream]]></category>
		<category><![CDATA[SAP .Net Connector]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>
		<category><![CDATA[XstreamConnector]]></category>

		<guid isPermaLink="false">http://www.dataxstream.com/?p=2041</guid>
		<description><![CDATA[Our previous post described how to use Visual Studio 2003 and the SAP .Net Connector to create a Dynamic Link Library containing the desired SAP functionality. The DLL contains proxies for each SAP function that we want to utilize.

We will reference that DLL in a Visual Studio 2008, and use it to retrieve system information from an SAP host.

As a demonstration, we are creating the TLA System, which exists solely to demonstrate certain SAP .Net Connector programming techniques.]]></description>
			<content:encoded><![CDATA[<h2>Overview</h2>
<p>This blog post describes how to use an SAP .Net Connector proxy, created in a VS 2003 project, in a Visual Studio 2008 C# solution.</p>
<blockquote><p><em>[Editor's Note]
This blog is third in a multi-part series describing how to use the SAP .NET Connector:</em>
<em> </em></p>
<p><em></p>
<ol>
<li><a href="http://www.dataxstream.com/2009/07/introduction-to-the-sap-net-connector/">Introduction to the SAP .Net Connector</a></li>
<li><a href="http://www.dataxstream.com/2009/07/building-an-sap-proxy/">Building an SAP .NET Connector Proxy</a></li>
<li>Using the SAP .Net Connector in Visual Studio 2008</li>
</ol>
<p></em></p></blockquote>
<h2>Introduction</h2>
<p>Our <a title="Building an SAP .Net Connector Proxy" href="http://www.dataxstream.com/2009/07/building-an-sap-proxy/" target="_blank">previous post</a> described how to use Visual Studio 2003 and the SAP .Net Connector to create a Dynamic Link Library containing the desired SAP functionality. The DLL contains proxies for each SAP function that we want to utilize.</p>
<p>We will reference that DLL in a Visual Studio 2008, and use it to retrieve system information from an SAP host.</p>
<p>As a demonstration, we are creating the TLA System, which exists solely to demonstrate certain SAP .Net Connector programming techniques.</p>
<p><span id="more-2041"></span></p>
<h2>Using the SAP .Net Connector Proxy</h2>
<p>Now we are ready to put our SAP .Net Connector Proxy to work. This will allow us to use the SAP .Net Connector in the modern Visual Studio environment.</p>
<h3>Start a Visual Studio 2008 Project</h3>
<p>Start a new Visual Studio 2008 Project. Use the Console Application template, and name the solution TlaSapRfcClient.</p>
<p><div id="attachment_2050" class="wp-caption aligncenter" style="width: 610px"><img class="size-full wp-image-2050" src="http://www.dataxstream.com/wp-content/uploads/2009/08/Image-00002.png" alt="Creating a new console application" width="600" height="455" /><p class="wp-caption-text">Creating a new console application</p></div></p>
<h3>Add a Reference to the TLA SAP Proxy</h3>
<p>Now we need to add a reference to the DLL we created earlier.</p>
<p>In the Solution Explorer, right click References and choose Add Reference. Using the Browse tab, find the TlaSapProxy.dll file from the TlaSapProxy project. Typically, this will be in the bin\debug folder of the TlaSapProxy folder. Click the OK button to add the reference to your project.</p>
<p><div id="attachment_2051" class="wp-caption aligncenter" style="width: 610px"><img class="size-full wp-image-2051" src="http://www.dataxstream.com/wp-content/uploads/2009/08/Image-0001.png" alt="Adding a reference to the proxy" width="600" height="464" /><p class="wp-caption-text">Adding a reference to the proxy</p></div></p>
<h3>C# Code</h3>
<p>Here is a Visual Studio 2008 C# program that uses the SAP .Net Connector proxy that we built earlier using Visual Studio 2003.</p>
<p><div id="attachment_2053" class="wp-caption aligncenter" style="width: 642px"><img class="size-full wp-image-2053" src="http://www.dataxstream.com/wp-content/uploads/2009/08/Image-00021.png" alt="C# program listing" width="632" height="561" /><p class="wp-caption-text">C# program listing</p></div></p>
<p>When we create an instance of the proxy in line 11, we pass in an SAP connection string. We create an object of type SAPProxy1 because that is what we named it in our Visual Studio 2003 project.</p>
<p>In line 20, we create an object of type RFCSI, because that is what our RFC call to Rfc_Get_System_Info will return. The type definition for RFCSI was also included in the proxy.</p>
<p>In line 22 we make the RFC call to the SAP host. We get full IntelliSense support that describes the parameters required.</p>
<h2>Summary</h2>
<p>The SAP .Net Connector is built for Visual Studio 2003. By using Visual Studio 2003 to create a DLL, we can use the SAP .Net Connector in Visual Studio 2008 (or later).</p>
<p>Here we have described how to use that DLL in a Visual Studio 2008 project.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dataxstream.com/2009/08/using-the-sap-net-connector-in-visual-studio-2008/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Building an SAP .Net Connector Proxy</title>
		<link>http://www.dataxstream.com/2009/07/building-an-sap-proxy/</link>
		<comments>http://www.dataxstream.com/2009/07/building-an-sap-proxy/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 19:28:03 +0000</pubDate>
		<dc:creator>Terry DeBruicker</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[SAP Interface Blog]]></category>
		<category><![CDATA[SAP Technical]]></category>
		<category><![CDATA[DataXstream]]></category>
		<category><![CDATA[SAP .Net Connector]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>
		<category><![CDATA[XstreamConnector]]></category>

		<guid isPermaLink="false">http://www.dataxstream.com/?p=1630</guid>
		<description><![CDATA[Overview The SAP .Net Connector is an SAP-supplied control that works only with Visual Studio 2003. This blog post describes how to create a VS 2003 project that will allow you to use the SAP .Net Connector in later versions of Visual Studio. [Editor's Note] This blog is the second of a multi-part series describing [...]]]></description>
			<content:encoded><![CDATA[<h2>Overview</h2>
<p>The SAP .Net Connector is an SAP-supplied control that works only with Visual Studio 2003. This blog post describes how to create a VS 2003 project that will allow you to use the SAP .Net Connector in later versions of Visual Studio.</p>
<blockquote><p><em>[Editor's Note]
This blog is the second of a multi-part series describing how to use the SAP .NET Connector:</em></p>
<p><em> </em></p>
<p><em> </em></p>
<p><em></p>
<ol>
<li><a href="http://www.dataxstream.com/2009/07/introduction-to-the-sap-net-connector/">Introduction to the SAP .Net Connector</a></li>
<li>Building an SAP .NET Connector Proxy</li>
<li><a href="http://www.dataxstream.com/2009/08/using-the-sap-net-connector-in-visual-studio-2008/">Using the SAP .Net Connector in Visual Studio 2008</a></li>
</ol>
<p></em></p></blockquote>
<h2>Introduction</h2>
<p>We will use Visual Studio 2003 and create a Dynamic Link Library (DLL) that encapsulates the desired SAP .Net Connector functionality. We can use the DLL that we create in a Visual Studio 2008 project.</p>
<p>To illustrate the process, we will build up, over the course of several blog posts, a system that is capable of receiving an IDOC from an SAP host. This system will be known as the Three Letter Acronym system, or TLA.</p>
<p><span id="more-1630"></span></p>
<h2>Build an SAP Proxy</h2>
<p>Our first task is to use the SAP .Net Connector to build a proxy that we can incorporate into Visual Studio 2008 projects.</p>
<p>The approach is to first add the SAP .Net Connector to a Visual Studio 2003 project. Then, we will attach to an SAP host to browse available functions. We will select the desired functions to be included in our SAP proxy.</p>
<p>Then, we will build the VS 2003 project into a DLL that can be used in Visual Studio 2008.</p>
<h3>Start a Visual Studio 2003 Project</h3>
<p>After you have installed the SAP .Net Connector, start a new Visual Studio for .Net 2003 project. Name the project “TlaSapProxy.” Choose the “Class Library” C# template.</p>
<p><div id="attachment_1637" class="wp-caption aligncenter" style="width: 629px"><img class="size-full wp-image-1637" src="http://www.dataxstream.com/wp-content/uploads/2009/07/SAPDotNetProgramming0002_0011.png" alt="Creating a new SAP Proxy project" width="619" height="473" /><p class="wp-caption-text">Creating a new SAP Proxy project</p></div></p>
<p>We don’t need the default Class1.cs file that is created, so close the Class1.cs module that is displayed, and remove Class1.cs from the TlaSapProxy project.</p>
<h3>Add a Reference to the SAP .Net Connector</h3>
<p>Now we need to add a reference to the SAP .Net Connector. From the Solution Explorer view, expand TlaSapProxy / References. Right click on References and choose Add Reference. From the .Net tab, double-click both SAP.Connector.dll and SAP.Connector.Rfc. Click OK to add the reference to your project.</p>
<p><div id="attachment_1642" class="wp-caption aligncenter" style="width: 669px"><img class="size-full wp-image-1642" src="http://www.dataxstream.com/wp-content/uploads/2009/07/SAPDotNetProgramming0002_0021.png" alt="Adding References to SAP .Net Connector" width="659" height="541" /><p class="wp-caption-text">Adding References to SAP .Net Connector</p></div></p>
<p><strong> </strong></p>
<h3>Establish a Connection to an SAP Host</h3>
<p>We will use the Visual Studio design time environment to attach to an SAP Host. From the Visual Studio View menu, select Server Explorer. Expand the SAP node. Right click on Application Servers and select Add Application Server.</p>
<p>For Destination Type, select Custom Logon Settings from the drop down list. Enter a valid SAP Username, Client, and Password. For the AppServerHost, enter the SAP host name, or the IP address of the desired SAP host. Be sure to fill in the Language field.</p>
<p><div id="attachment_1643" class="wp-caption aligncenter" style="width: 731px"><img class="size-full wp-image-1643" src="http://www.dataxstream.com/wp-content/uploads/2009/07/SAPDotNetProgramming0002_0031.png" alt="SAP Server Connection Properties" width="721" height="425" /><p class="wp-caption-text">SAP Server Connection Properties</p></div></p>
<p>If things go well, at this point you will have an SAP Application Server established. You should see two new nodes on the Server Explorer display: BOR and Functions. Under BOR, you can expand either the Alphabetical or Hierarchical nodes to see available object definitions.</p>
<h3>Browse SAP Functions</h3>
<p>To display an SAP function using the Server Explorer, you have to create a function ‘filter,’ which selects which functions from the SAP Host you want to display. To do this, right click on Functions and choose Add Function Filter. In our proxy, we are going to be using some RFC functions, so, in the NameFilter field, enter RFC* (the asterisk is a wild card). Click OK, then expand Functions, then expand Filter1. After a moment, the screen will display a list of SAP functions that match our filter.</p>
<p><div id="attachment_1647" class="wp-caption aligncenter" style="width: 512px"><img class="size-full wp-image-1647" src="http://www.dataxstream.com/wp-content/uploads/2009/07/SAPDotNetProgramming0002_0041.png" alt="Creating a New Function Filter" width="502" height="326" /><p class="wp-caption-text">Creating a New Function Filter</p></div></p>
<p><div id="attachment_1648" class="wp-caption aligncenter" style="width: 536px"><img class="size-full wp-image-1648" src="http://www.dataxstream.com/wp-content/uploads/2009/07/SAPDotNetProgramming0002_0051.png" alt="SAP Function Filter Display" width="526" height="639" /><p class="wp-caption-text">SAP Function Filter Display</p></div></p>
<p><strong> </strong></p>
<h3>Select Desired SAP Functions</h3>
<p>As you can see, there are many functions to choose from. When we build our SAP proxy, we will select just the functions we need.</p>
<p>For our TLA SAP Proxy we are building, we only need RFC_GET_SYSTEM_INFO. As with most SAP functions, RFC_GET_SYSTEM_INFO returns an object of a custom type that includes all of the results of the function call.</p>
<p>From the Visual Studio 2003 Solution Explorer, right click on the TlaSapProxy project and choose Add, then Add New Item. Scroll through the list of Templates and click on SAP Connector Proxy, then click OK to add the new item to the project.</p>
<p><div id="attachment_1650" class="wp-caption aligncenter" style="width: 629px"><img class="size-full wp-image-1650" src="http://www.dataxstream.com/wp-content/uploads/2009/07/SAPDotNetProgramming0002_0061.png" alt="Adding an SAP Connector Proxy Object" width="619" height="483" /><p class="wp-caption-text">Adding an SAP Connector Proxy Object</p></div></p>
<p>What you have at that point is a Visual Studio design surface to which we can add SAP function definitions. The design surface is displayed as SAPProxy1.sapwsdl. We are basically creating a WSDL file that will be used to generate our desired DLL.</p>
<p><div id="attachment_1654" class="wp-caption aligncenter" style="width: 820px"><img class="size-full wp-image-1654" src="http://www.dataxstream.com/wp-content/uploads/2009/07/SAPDotNetProgramming0002_0071.png" alt="Adding SAP Functions to a Proxy" width="810" height="576" /><p class="wp-caption-text">Adding SAP Functions to a Proxy</p></div></p>
<p>To include an SAP function, in our case RFC_GET_SYSTEM_INFO, display the Server Explorer. Expand the SAP Application Servers to the desired server, then click on RFC_GET_SYSTEM_INFO. Drag RFC_GET_SYSTEM_INFO to the SAPProxy1.sapwsdl and drop it there.</p>
<p>The screen will display ‘Retrieve Data.’ When it is done, you will see two things added to the WSDL. First is the function call definition (method). Second is a class definition for what is returned from the function. You can right click on these and select Properties to view details of what is contained therein.</p>
<h3>Building the Project</h3>
<p>Now that we have selected all of the desired SAP functions that we want to include in our proxy, we are ready to build the project.</p>
<p>Because we selected a Class Library as our starting project template, our project is already set to build a class module (DLL). To build the DLL, right click on the TlaSapProxy project and select Build.</p>
<p>This will compile our WSDL file into a DLL file that we will be able to use in Visual Studio 2008.</p>
<h2>Summary</h2>
<p>The SAP .Net Connector is built for Visual Studio 2003. By using Visual Studio 2003 to create a DLL, we can use the SAP .Net Connector in Visual Studio 2008 (or later).</p>
<p>We do this by establishing a connection to an SAP host, selecting the desired functions, and creating an SAP proxy object that contains the desired functions. When we build this project, the resulting DLL can be used in Visual Studio 2008.</p>
<p>Our next blog post will describe how to use our newly created SAP proxy in a Visual Studio 2008 project.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dataxstream.com/2009/07/building-an-sap-proxy/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Introduction to the SAP .Net Connector</title>
		<link>http://www.dataxstream.com/2009/07/introduction-to-the-sap-net-connector/</link>
		<comments>http://www.dataxstream.com/2009/07/introduction-to-the-sap-net-connector/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 13:51:16 +0000</pubDate>
		<dc:creator>Terry DeBruicker</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[SAP Interface Blog]]></category>
		<category><![CDATA[DataXstream]]></category>
		<category><![CDATA[SAP .Net Connector]]></category>
		<category><![CDATA[Visual Studio 2003]]></category>
		<category><![CDATA[XstreamConnector]]></category>

		<guid isPermaLink="false">http://www.dataxstream.com/2009/07/introduction-to-the-sap-net-connector/</guid>
		<description><![CDATA[Overview DataXstream’s XstreamConnector provides a robust, high performance tool to receive SAP IDOCS. These IDOCs are then persisted to an SQL database that can be used for any other application This article describes one of the SAP components used by the DataXstream XstreamConnector to facilitate this process. [Editor's Note] This blog is first of a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Overview</strong></p>
<p>DataXstream’s XstreamConnector provides a robust, high performance tool to receive SAP IDOCS. These IDOCs are then persisted to an SQL database that can be used for any other application</p>
<p>This article describes one of the SAP components used by the DataXstream XstreamConnector to facilitate this process.</p>
<blockquote><p><em>[Editor's Note]
This blog is first of a multi-part series describing how to use the SAP .NET Connector:</em></p>
<p><em></p>
<ol>
<li>Introduction to the SAP .Net Connector</li>
<li><a href="http://www.dataxstream.com/2009/07/building-an-sap-proxy/">Building an SAP .NET Connector Proxy</a></li>
<li><a href="http://www.dataxstream.com/2009/08/using-the-sap-net-connector-in-visual-studio-2008/">Using the SAP .Net Connector in Visual Studio 2008</a></li>
</ol>
<p></em></p></blockquote>
<p><strong>Introduction</strong></p>
<p>The SAP .Net Connector is a software component supplied by SAP that makes it possible to communicate between an SAP host and a .Net program. Any .Net language can be used with the SAP .Net Connector.</p>
<p><strong>Where to Find It</strong></p>
<p>You can download the SAP .Net Connector from <a href="http://service.sap.com/connectors">http://service.sap.com/connectors</a>. You will have to provide your SAP Marketplace user ID and password.</p>
<p><strong>What it Does</strong></p>
<p>The SAP .Net Connector gives a .Net program access to an SAP host. The .Net program can logon to an SAP host and issue SAP Remote Function Calls. Parameters can be passed in to an RFC, and results data can be passed back to the .Net program.</p>
<p>A .Net program can also establish a connection to an SAP IDOC Gateway. The .Net program uses the SAP .Net Connector to send and receive IDOCs. There is full support for transactional integrity for IDOCS moving back and forth between the SAP host and the .Net program.</p>
<p>With this functionality, a Microsoft .Net program has all that it needs to query SAP metadata, call ABAP functions, or send and receive IDOCs.</p>
<p><strong>What it Doesn’t Do</strong></p>
<p>While the SAP .Net Connector takes care of most of the heavy lifting in communicating with an SAP host, there is still considerable work to be done before you can get something useful from it.</p>
<p>In particular, there is no functionality built-in to the SAP .Net Connector for parsing the various data fields from an IDOC. It is up to the receiving program to know what the format of the IDOC is, and how to extract the data from the IDOC.</p>
<p>One other issue to deal with is that the SAP .Net Connector is built for Visual Studio 2003. There is a work around that is easy to use that enables you to use the SAP .Net Connector with newer versions of Visual Studio. Next week we will demonstrate that work around.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dataxstream.com/2009/07/introduction-to-the-sap-net-connector/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
