<?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; Craig Stasila</title>
	<atom:link href="http://www.dataxstream.com/tag/craig-stasila/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dataxstream.com</link>
	<description>SAP Certified Consultants</description>
	<lastBuildDate>Sat, 04 Feb 2012 05:00:46 +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>1</slash:comments>
		</item>
		<item>
		<title>How To: SAP PI Data Type Enhancements</title>
		<link>http://www.dataxstream.com/2011/10/how-to-sap-pi-data-type-enhancements/</link>
		<comments>http://www.dataxstream.com/2011/10/how-to-sap-pi-data-type-enhancements/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 15:15:43 +0000</pubDate>
		<dc:creator>Craig Stasila</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[SAP Interface Blog]]></category>
		<category><![CDATA[SAP PI Blog]]></category>
		<category><![CDATA[SAP Technical]]></category>
		<category><![CDATA[BADI]]></category>
		<category><![CDATA[Craig Stasila]]></category>
		<category><![CDATA[Data Type Enhancement]]></category>
		<category><![CDATA[DataXstream]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Message Mapping]]></category>
		<category><![CDATA[PI]]></category>
		<category><![CDATA[SAP PI]]></category>
		<category><![CDATA[XI/PI]]></category>

		<guid isPermaLink="false">http://www.dataxstream.com/?p=5217</guid>
		<description><![CDATA[I have worked with SAP PI since it was called SAP XI (version 3.0).  SAP XI was pretty rough around the edges and was not what I would call an enterprise class integration tool.  Each successive SAP PI release and enhancement pack has steadily added functionality such that the latest version of SAP PI is [...]]]></description>
			<content:encoded><![CDATA[<p>I have worked with SAP PI since it was called SAP XI (version 3.0).  SAP XI was pretty rough around the edges and was not what I would call an enterprise class integration tool.  Each successive SAP PI release and enhancement pack has steadily added functionality such that the latest version of SAP PI is finally starting to resemble a fully functional EAI platform.</p>
<p>One such example of additional functionality is the ability to enhance delivered integration content.</p>
<p>Recently, I had to make some modifications to an integration scenario where an SAP ERP system was sending data to an external custom solution.  The good news was the SAP ERP and PI objects were built and delivered by SAP!</p>
<div id="attachment_5218" class="wp-caption alignnone" style="width: 511px"><a href="http://www.dataxstream.com/wp-content/uploads/Blog_dte00.jpg" rel="shadowbox[sbpost-5217];player=img;"><img class="size-full wp-image-5218" title="Delivered Content" src="http://www.dataxstream.com/wp-content/uploads/Blog_dte00.jpg" alt="SAP ERP Delivered Content" width="501" height="333" /></a><p class="wp-caption-text">SAP ERP Delivered Content</p></div>
<p>The bad news was that the interface, as designed, did not meet the business&#8217; need&#8230;</p>
<div id="attachment_5219" class="wp-caption alignnone" style="width: 615px"><a href="http://www.dataxstream.com/wp-content/uploads/Blog_dte01.jpg" rel="shadowbox[sbpost-5217];player=img;"><img class="size-full wp-image-5219" title="Blog_dte01" src="http://www.dataxstream.com/wp-content/uploads/Blog_dte01.jpg" alt="How to add fields to delivered content?" width="605" height="508" /></a><p class="wp-caption-text">How to add fields to delivered content?</p></div>
<p>So, the $64,000 question is, how do we add fields to delivered SAP PI content?<br />
<span id="more-5217"></span><br />
<h2>SAP PI Data Type Enhancement</h2>
<p>SAP PI data type enhancements allow developers to customize delivered SAP PI content.  Here&#8217;s a quick rundown of how it works:</p>
<h3>Step by Step SAP PI Data Type Enhancement Instructions</h3>
<ol>
<li>First, create a new data type enhancement in the SAP PI ESR:<br />
<a href="http://www.dataxstream.com/wp-content/uploads/Blog_dte02.jpg" rel="shadowbox[sbpost-5217];player=img;"><img class="alignnone size-full wp-image-5220" title="Blog_dte02" src="http://www.dataxstream.com/wp-content/uploads/Blog_dte02.jpg" alt="" width="624" height="382" /></a></li>
<li>Add the required fields to the required data elements and then save and activate your SAP PI changes.</li>
<li>The newly created data elements are now in message type:<a href="http://www.dataxstream.com/wp-content/uploads/Blog_dte04.jpg" rel="shadowbox[sbpost-5217];player=img;"><img class="alignnone size-full wp-image-5222" title="Blog_dte04" src="http://www.dataxstream.com/wp-content/uploads/Blog_dte04.jpg" alt="" width="669" height="438" /></a></li>
<li>Login to the SAP ERP system and activate the proxy changes via transaction SPROXY.  This will create/update the proxy structures that correspond to the newly created data elements in the ERP system:<a href="http://www.dataxstream.com/wp-content/uploads/Blog_dte05.jpg" rel="shadowbox[sbpost-5217];player=img;"><img class="alignnone size-full wp-image-5223" title="Blog_dte05" src="http://www.dataxstream.com/wp-content/uploads/Blog_dte05.jpg" alt="" width="439" height="456" /></a></li>
<li>Finally, create a BADI to populate the new data fields in the SAP ERP system:<br />
<a href="http://www.dataxstream.com/wp-content/uploads/Blog_dte06.jpg" rel="shadowbox[sbpost-5217];player=img;"><img class="alignnone size-full wp-image-5224" title="Blog_dte06" src="http://www.dataxstream.com/wp-content/uploads/Blog_dte06.jpg" alt="" width="639" height="246" /></a></li>
<li>Save and activate your ERP changes. Now you&#8217;re ready to rock and roll!</li>
</ol>
<p>SAP PI data type enhancements blends the stability and functionality of delivered content with the flexibility of custom development. It is definitely one of my favorite advances in the SAP PI platform.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dataxstream.com/2011/10/how-to-sap-pi-data-type-enhancements/feed/</wfw:commentRss>
		<slash:comments>0</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>SAP NCo 3.0 &#8211; Best Practice Guide for Upgrade from .NET Connector 2.0</title>
		<link>http://www.dataxstream.com/sap_webinars/sap-nco-3-0-best-practice-guide-for-upgrade-from-net-connector-2-0/</link>
		<comments>http://www.dataxstream.com/sap_webinars/sap-nco-3-0-best-practice-guide-for-upgrade-from-net-connector-2-0/#comments</comments>
		<pubDate>Mon, 15 Aug 2011 17:05:34 +0000</pubDate>
		<dc:creator>Dataxstream</dc:creator>
				<category><![CDATA[.Net Connector]]></category>
		<category><![CDATA[Craig Stasila]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[NCo 3.0]]></category>
		<category><![CDATA[SAP .Net Connector]]></category>
		<category><![CDATA[upgrades]]></category>

		<guid isPermaLink="false">http://www.dataxstream.com/?page_id=8675</guid>
		<description><![CDATA[Duration: 1 hour Speaker:  Craig Stasila, Principal, DataXstream This one hour webinar will supply you with knowledge of features specific to the new upgrade, as well as an overview of the advantages that come with investing in NCo 3.0. What Will Be Highlighted: Changes and new features brought upon by the NCo 3.0 update Demonstrations [...]]]></description>
			<content:encoded><![CDATA[<h3><a href="http://www.dataxstream.com/wp-content/uploads/Tin-Can-Banner-No-Date3.jpg" rel="shadowbox[sbpost-8675];player=img;"><img class="alignnone size-full wp-image-8568" title="Tin Can Banner No Date" src="http://www.dataxstream.com/wp-content/uploads/Tin-Can-Banner-No-Date3.jpg" alt="" width="600" height="235" /></a></h3>
<h3>Duration: 1 hour</h3>
<h3>Speaker:  <a href="http://www.dataxstream.com/author/cstasila/">Craig Stasila</a>, Principal, DataXstream</h3>
<h3><span class="Apple-style-span" style="font-size: 13px; font-weight: normal;">This one hour webinar will supply you with knowledge of features specific to the new upgrade, as well as an overview of the advantages that come with investing in NCo 3.0.</span></h3>
<h3>What Will Be Highlighted:</h3>
<ul>
<li>Changes and new features brought upon by the NCo 3.0 update</li>
<li>Demonstrations of best-practices for implementing new and existing NCo code</li>
<li>Live demonstration of inbound and outbound function calls between a .NET solution and SAP ECC</li>
</ul>
<div class="featureblock">
<h3><a title="foot_note_1" name="foot_note_1"></a>Available on Demand</h3>
<p><em>Please complete the required form to view the webinar</em></p>

		<div id="usermessage5a" class="cf_info "></div>
		<form enctype="multipart/form-data" action="/tag/craig-stasila/feed/#usermessage5a" method="post" class="cform nco-3-0-webinar " id="cforms5form">
		<ol class="cf-ol">
			<li id="li-5-1" class=""><label for="cf5_field_1"><span>First Name</span></label><input type="text" name="cf5_field_1" id="cf5_field_1" class="single fldrequired" value=""/><span class="reqtxt">(required)</span></li>
			<li id="li-5-2" class=""><label for="cf5_field_2"><span>Last Name</span></label><input type="text" name="cf5_field_2" id="cf5_field_2" class="single fldrequired" value=""/><span class="reqtxt">(required)</span></li>
			<li id="li-5-3" class=""><label for="cf5_field_3"><span>Company</span></label><input type="text" name="cf5_field_3" id="cf5_field_3" class="single fldrequired" value=""/><span class="reqtxt">(required)</span></li>
			<li id="li-5-4" class=""><label for="cf5_field_4"><span>Job Title</span></label><input type="text" name="cf5_field_4" id="cf5_field_4" class="single fldrequired" value=""/><span class="reqtxt">(required)</span></li>
			<li id="li-5-5" class=""><label for="cf5_field_5"><span>Email</span></label><input type="text" name="cf5_field_5" id="cf5_field_5" class="single fldemail fldrequired" value=""/><span class="emailreqtxt">(valid email required)</span></li>
			<li id="li-5-6" class=""><label for="cf5_field_6"><span>Phone</span></label><input type="text" name="cf5_field_6" id="cf5_field_6" class="single fldrequired" value=""/><span class="reqtxt">(required)</span></li>
			<li id="li-5-7" class=""><label for="cf5_field_7"><span>Additional Information</span></label><textarea cols="30" rows="8" name="cf5_field_7" id="cf5_field_7" class="area"></textarea></li>
		</ol>
		<fieldset class="cf_hidden">
			<legend>&nbsp;</legend>
			<input type="hidden" name="cf_working5" id="cf_working5" value="One%20moment%20please..."/>
			<input type="hidden" name="cf_failure5" id="cf_failure5" value="Please%20fill%20in%20all%20the%20required%20fields."/>
			<input type="hidden" name="cf_codeerr5" id="cf_codeerr5" value="Please%20double-check%20your%20verification%20code."/>
			<input type="hidden" name="cf_customerr5" id="cf_customerr5" value="yyy"/>
			<input type="hidden" name="cf_popup5" id="cf_popup5" value="nn"/>
		</fieldset>
		<p class="cf-sb"><input type="submit" name="sendbutton5" id="sendbutton5" class="sendbutton" value="Submit" onclick="return cforms_validate('5', false)"/></p></form><p class="linklove" id="ll5"></p>		<div id="usermessage5b" class="cf_info " ></div>

</div>
]]></content:encoded>
			<wfw:commentRss>http://www.dataxstream.com/sap_webinars/sap-nco-3-0-best-practice-guide-for-upgrade-from-net-connector-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Webinar &#8211; SAP NCo 3.0 &#8211; Best Practice Guide for Upgrade from .NET Connector 2.0</title>
		<link>http://www.dataxstream.com/2011/06/webinar-sap-net-connector-3-0/</link>
		<comments>http://www.dataxstream.com/2011/06/webinar-sap-net-connector-3-0/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 19:19:54 +0000</pubDate>
		<dc:creator>Dataxstream</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Press Releases]]></category>
		<category><![CDATA[.Net Connector]]></category>
		<category><![CDATA[Craig Stasila]]></category>
		<category><![CDATA[NCo 3.0]]></category>
		<category><![CDATA[webinar]]></category>

		<guid isPermaLink="false">http://www.dataxstream.com/?p=7088</guid>
		<description><![CDATA[Date:  Thursday, August 11, 2011 Time:  1:00 pm ET / 10:00 am PT Duration: 1 hour Speaker:  Craig Stasila, Principal, DataXstream Register Today! Please join us Thursday, August 11 at 1 pm ET for an overview and best practice guide for upgrading to the recently released SAP .Net Connector (NCo) 3.0.  This one hour webinar [...]]]></description>
			<content:encoded><![CDATA[<h3><a href="http://www.dataxstream.com/wp-content/uploads/Tin-Can-Banner-No-Date3.jpg" rel="shadowbox[sbpost-7088];player=img;"><img class="alignnone size-full wp-image-8568" title="Tin Can Banner No Date" src="http://www.dataxstream.com/wp-content/uploads/Tin-Can-Banner-No-Date3.jpg" alt="" width="600" height="235" /></a></h3>
<h3>Date:  Thursday, August 11, 2011</h3>
<h3>Time:  1:00 pm ET / 10:00 am PT</h3>
<h3>Duration: 1 hour</h3>
<h3>Speaker:  <a href="http://www.dataxstream.com/author/cstasila/">Craig Stasila</a>, Principal, DataXstream</h3>
<h3><a href="http://www.dataxstream.com/2011/06/webinar-sap-net-connector-3-0#foot_note_1">Register Today!</a></h3>
<p>Please join us Thursday, August 11 at 1 pm ET for an overview and best practice guide for upgrading to the recently released SAP .Net Connector (NCo) 3.0.  This one hour webinar will supply you with knowledge of features specific to the new upgrade, as well as an overview of the advantages that come with investing in NCo 3.0.<br />
<span id="more-7088"></span></p>
<h3>What Will Be Highlighted:</h3>
<ul>
<li>Changes and new features brought upon by the NCo 3.0 update</li>
<li>Demonstrations of best-practices for implementing new and existing NCo code</li>
<li>Live demonstration of inbound and outbound function calls between a .NET solution and SAP ECC</li>
</ul>
<h3>Win a Dell Streak!</h3>
<p>We&#8217;ll be giving away a sleek Dell Streak to a random registered attendee at the end of each webinar. You must be in attendance to claim your prize.</p>
<div class="featureblock">
<h3><a title="foot_note_1" name="foot_note_1"></a>Register Today</h3>

		<div id="usermessage5a" class="cf_info "></div>
		<form enctype="multipart/form-data" action="/tag/craig-stasila/feed/#usermessage5a" method="post" class="cform nco-3-0-webinar " id="cforms5form">
		<ol class="cf-ol">
			<li id="li-5-1" class=""><label for="cf5_field_1"><span>First Name</span></label><input type="text" name="cf5_field_1" id="cf5_field_1" class="single fldrequired" value=""/><span class="reqtxt">(required)</span></li>
			<li id="li-5-2" class=""><label for="cf5_field_2"><span>Last Name</span></label><input type="text" name="cf5_field_2" id="cf5_field_2" class="single fldrequired" value=""/><span class="reqtxt">(required)</span></li>
			<li id="li-5-3" class=""><label for="cf5_field_3"><span>Company</span></label><input type="text" name="cf5_field_3" id="cf5_field_3" class="single fldrequired" value=""/><span class="reqtxt">(required)</span></li>
			<li id="li-5-4" class=""><label for="cf5_field_4"><span>Job Title</span></label><input type="text" name="cf5_field_4" id="cf5_field_4" class="single fldrequired" value=""/><span class="reqtxt">(required)</span></li>
			<li id="li-5-5" class=""><label for="cf5_field_5"><span>Email</span></label><input type="text" name="cf5_field_5" id="cf5_field_5" class="single fldemail fldrequired" value=""/><span class="emailreqtxt">(valid email required)</span></li>
			<li id="li-5-6" class=""><label for="cf5_field_6"><span>Phone</span></label><input type="text" name="cf5_field_6" id="cf5_field_6" class="single fldrequired" value=""/><span class="reqtxt">(required)</span></li>
			<li id="li-5-7" class=""><label for="cf5_field_7"><span>Additional Information</span></label><textarea cols="30" rows="8" name="cf5_field_7" id="cf5_field_7" class="area"></textarea></li>
		</ol>
		<fieldset class="cf_hidden">
			<legend>&nbsp;</legend>
			<input type="hidden" name="cf_working5" id="cf_working5" value="One%20moment%20please..."/>
			<input type="hidden" name="cf_failure5" id="cf_failure5" value="Please%20fill%20in%20all%20the%20required%20fields."/>
			<input type="hidden" name="cf_codeerr5" id="cf_codeerr5" value="Please%20double-check%20your%20verification%20code."/>
			<input type="hidden" name="cf_customerr5" id="cf_customerr5" value="yyy"/>
			<input type="hidden" name="cf_popup5" id="cf_popup5" value="nn"/>
		</fieldset>
		<p class="cf-sb"><input type="submit" name="sendbutton5" id="sendbutton5" class="sendbutton" value="Submit" onclick="return cforms_validate('5', false)"/></p></form><p class="linklove" id="ll5"></p>		<div id="usermessage5b" class="cf_info " ></div>

</div>
]]></content:encoded>
			<wfw:commentRss>http://www.dataxstream.com/2011/06/webinar-sap-net-connector-3-0/feed/</wfw:commentRss>
		<slash:comments>0</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>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>
		<item>
		<title>Too Many Developers Spoil The Code</title>
		<link>http://www.dataxstream.com/2010/03/too-many-developers-spoil-the-code/</link>
		<comments>http://www.dataxstream.com/2010/03/too-many-developers-spoil-the-code/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 13:24:42 +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[ABAP]]></category>
		<category><![CDATA[ABAP development]]></category>
		<category><![CDATA[BADI]]></category>
		<category><![CDATA[Basis/Netweaver]]></category>
		<category><![CDATA[Craig Stasila]]></category>
		<category><![CDATA[DataXstream]]></category>
		<category><![CDATA[Integration]]></category>
		<category><![CDATA[NetWeaver]]></category>
		<category><![CDATA[Project Management]]></category>
		<category><![CDATA[SAP ABAP]]></category>

		<guid isPermaLink="false">http://www.dataxstream.com/?p=4689</guid>
		<description><![CDATA[You may have heard the following idiom before: Too many cooks spoil the broth The common meaning extracted from this saying is that too many people working on a single task tend to make a mess of it.  But, what happens when you have too many developers working in a single piece of ABAP code? [...]]]></description>
			<content:encoded><![CDATA[<p>You may have heard the following idiom before:</p>
<blockquote><p>Too many cooks spoil the broth</p></blockquote>
<p>The common meaning extracted from this saying is that too many people working on a single task tend to make a mess of it.  But, what happens when you have too many developers working in a single piece of ABAP code?  That&#8217;s right, you get a big mess.  This issue is especially difficult to deal with when there are multiple functional requirements leveraging the same custom code object, form-based user-exit, or function-based user-exit.</p>
<p>While current releases of SAP (those built on SAP NetWeaver 2004s and later) have good built-in handling of enhancements and customizations via implicit and explicit enhancement points and BADIs, there still exists many old-school user-exits.</p>
<h2>Multiple Developers; One Code Object</h2>
<p>I recently worked on a project where three separate developers were creating three separate interfaces based on the outbound delivery IDOC.  While the development for all three interfaces was occurring at the same time, the go-live date for each of the interfaces were different (we&#8217;ll discuss that project management glitch at another time).  Each interface required a separate set of custom fields and, therefore, it&#8217;s own IDOC extension.  The problem is there is only one appropriate user-exit in IDOC_OUTPUT_DELVRY and three developers needed to be developing in it at the same time!</p>
<p>How did we solve this problem?<br />
<span id="more-4689"></span></p>
<h2>An Object To Call One&#8217;s Own</h2>
<p>To allow each developer his own development object and transport timeline, I decided to implement a custom multiple-use, filtered BADI <em>inside</em> the SAP user-exit function EXIT_SAPLV56K_002.  Actually, you can implement your own BADI almost anywhere you need alternate logic execution&#8211;even custom code!</p>
<p>So you might be saying, &#8220;Create my own multi-use, filtered BADI definition? Sounds complicated.&#8221; Well, it&#8217;s easier than you think!</p>
<p>NOTE: This solution was done on an ECC6 system based on SAP NetWeaver 2004s.  The steps to implement this type of solution in ECC5 (SAP NetWeaver 2004) are very similar.</p>
<h2>Create A Custom BADI Definition</h2>
<ol>
<li>To create a new enhancement spot definition, use transaction SE18.  I named my enhancement spot Z_EXIT_SAPLV56K_002 because the enhancement spot will be used in user-exit function EXIT_SAPLV56K_002.<br />
<a href="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-01.jpg" rel="shadowbox[sbpost-4689];player=img;"><img class="alignnone size-full wp-image-4694" title="BADI 01" src="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-01.jpg" alt="" width="399" height="179" /></a></li>
<li>In the ensuing dialog box, enter a description and choose <em>BAdi</em> <em>Definition</em> for the Technology<br />
<a href="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-02.jpg" rel="shadowbox[sbpost-4689];player=img;"><img class="alignnone size-full wp-image-4695" title="BADI 02" src="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-02.jpg" alt="" width="646" height="149" /></a></li>
<li>Next, create a new BADI definition.<br />
<a href="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-03.jpg" rel="shadowbox[sbpost-4689];player=img;"><img class="alignnone size-full wp-image-4696" title="BADI 03" src="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-03.jpg" alt="" width="614" height="191" /></a></li>
<li>Specify that the new BADI definition will be multiple use and limited to filtered use.<br />
<a href="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-04.jpg" rel="shadowbox[sbpost-4689];player=img;"><img class="alignnone size-full wp-image-4697" title="BADI 04" src="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-04.jpg" alt="" width="538" height="95" /><br />
</a>Making the BADI definition multiple use means that each developer can create his or her own BADI implementation.  Each BADI is implemented in its own class.  This promotes code separation and the proper reuse of shared development objects.<br />
Making the BADI definition limited to filter use ensures that the BADI implementations are separate and cannot affect every interface using the user-exit.</li>
<li>Now, create a new filter.<br />
<a href="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-05.jpg" rel="shadowbox[sbpost-4689];player=img;"><img class="alignnone size-full wp-image-4698" title="BADI 05" src="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-05.jpg" alt="" width="262" height="102" /></a><br />
BADI filtering in SAP NetWeaver 2004s is much more powerful than in previous versions of SAP.  Read more about BADI filtering <a href="http://help.sap.com/saphelp_nw04/helpdata/en/eb/3e7cf7940e11d295df0000e82de14a/frameset.htm" target="_blank">here</a>.</li>
<li><a href="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-05.jpg" rel="shadowbox[sbpost-4689];player=img;"></a> The BADI we are defining will be used to populate IDOC extensions.  Each IDOC extension has its own message type (e.g. ZMHL_DESADV, ZQTC_DESADV, ZMHL_SHPORD), therefore the message type of the IDOC being processed is a good value to filter on.  I named my BADI filter EDI_MESTYP.<br />
<a href="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-06.jpg" rel="shadowbox[sbpost-4689];player=img;"><img class="alignnone size-full wp-image-4710" title="BADI 06" src="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-06.jpg" alt="" width="588" height="288" /></a><br />
SAP allows for the automatic checking of BADI implementation filter values.  The standard domain EDI_MESTYP has a value range of table EDMSG attached to it.  This is exactly the range of values I want as allowable values, so I configure the BADI filter to automatically check the filter values against dictionary object EDI_MESTYP.</li>
<li>Next, create the BADI interface that will be inherited by each implementing class<br />
<a href="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-07.jpg" rel="shadowbox[sbpost-4689];player=img;"><img class="alignnone size-full wp-image-4700" title="BADI 07" src="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-07.jpg" alt="" width="572" height="149" /></a></li>
<li>The original user-exti function EXIT_SAPLV56K_002 is executed after each segment is added.  Our BADI will do the same.  Create a new public interface method SEGMENT_ADDED.<br />
<a href="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-08.jpg" rel="shadowbox[sbpost-4689];player=img;"><img class="alignnone size-full wp-image-4701" title="BADI 08" src="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-08.jpg" alt="" width="560" height="118" /></a></li>
<li>The BADI we are creating is replicating user-exit function EXIT_SAPLV56K_002.  Here is the function interface for EXIT_SAPLV56K_002:<br />
<a href="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-09_1.jpg" rel="shadowbox[sbpost-4689];player=img;"><img class="alignnone size-full wp-image-4711" title="BADI 09_1" src="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-09_1.jpg" alt="" width="602" height="383" /></a><br />
Here is the same data being passed via the interface method.<br />
<a href="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-09.jpg" rel="shadowbox[sbpost-4689];player=img;"><img class="alignnone size-full wp-image-4702" title="BADI 09" src="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-09.jpg" alt="" width="582" height="218" /></a></li>
<li>Lastly, the BADI has to be called from the existing user-exit.  I will not cover the steps required for implementing user-exit function EXIT_SAPLV56K_002 here, but once you have the user-exit implemented, add the following code.  This code should be the only logic directly inside the user-exit.  Any data processing logic should be implemented via a BADI implementation:
<pre style="background-color: #eaeaea; color: #222;">DATA: GO_BADI TYPE REF TO Z_EXIT_SAPLV56K_002.
DATA: L_STR TYPE STRING.
L_STR = MESSAGE_TYPE.

* Get BADI class based on IDOC message type
GET BADI GO_BADI
   FILTERS EDI_MESTYP = L_STR.

* Execute SEGMENT_ADDED BADI method
CALL BADI GO_BADI-&gt;SEGMENT_ADDED
   EXPORTING
     MESSAGE_TYPE       = MESSAGE_TYPE
     SEGMENT_NAME       = SEGMENT_NAME
     DATA               = DATA
     TAB_IDOC_REDUCTION = TAB_IDOC_REDUCTION
     FLT_VAL            = MESSAGE_TYPE
   CHANGING
     CONTROL_RECORD_OUT = CONTROL_RECORD_OUT
     IDOC_DATA          = IDOC_DATA[].</pre>
</li>
</ol>
<p>We&#8217;re done with creating the BADI definition!  Save and activate your work.  I bet you&#8217;re saying to yourself, &#8220;Wow, that was easy!&#8221;</p>
<h2>BADI Implementation</h2>
<p>Implementing the BADI you just created in the steps above is just like implementing any other BADI in SAP, so here are the Cliff Notes version of implementation instructions.</p>
<ol>
<li>Using transaction SE19, create a new enhancement spot implementation for Z_EXIT_SAPLV56K_002.<br />
<a href="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-10.jpg" rel="shadowbox[sbpost-4689];player=img;"><img class="alignnone size-full wp-image-4703" title="BADI 10" src="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-10.jpg" alt="" width="547" height="180" /></a></li>
<li>Enter the BADI implementation details.  This particular BADI implementation is for RICEF ID MHL-IO-007, so I added that identification to the BADI implementation name and implementing class name.<br />
<a href="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-12.jpg" rel="shadowbox[sbpost-4689];player=img;"><img class="alignnone size-full wp-image-4705" title="BADI 12" src="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-12.jpg" alt="" width="572" height="280" /></a></li>
<li>In the BADI definition, we required each BADI implementation to be filtered on message type. This particular BADI implementation is for message type ZMHL_SHPORD.  Create the filter combination for the BADI implementation.<br />
<a href="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-13.jpg" rel="shadowbox[sbpost-4689];player=img;"><img class="alignnone size-full wp-image-4706" title="BADI 13" src="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-13.jpg" alt="" width="586" height="149" /></a></li>
<li>This ensures that the other interfaces using this BADI (ZMHL_DESADV, ZQTC_DESADV) will not execute the code implemented with this BADI.<br />
<a href="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-14.jpg" rel="shadowbox[sbpost-4689];player=img;"><img class="alignnone size-full wp-image-4707" title="BADI 14" src="http://www.dataxstream.com/wp-content/uploads/2010/03/BADI-14.jpg" alt="" width="518" height="255" /></a></li>
<li>The final steps are to add the code to the SEGMENT_ADDED method just like you would in user-exit function EXIT_SAPLV56K_002.  Once you are done, save and activate your changes!</li>
</ol>
<h2>Summary</h2>
<p>As you can see, with a few extra steps, it is possible to have your cake and eat it, too, by create a custom BADI definition that can be used by other developers.  All this talk of food is making me hungry.  Is it lunchtime yet?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dataxstream.com/2010/03/too-many-developers-spoil-the-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

