Jul 21

Coming Soon: SAP .NET Connector (NCo) 3.0

SAP is announcing a new version of SAP Connector for Microsoft .NET 3.0 (now called “NCo 3.0”). 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).

EDITOR’S NOTE: NCo 3.0 has now been released.  Read more details here.

NCo 3.0 Logon

Security got vital improvements in NCo 3.0.  The component handling logon and authentication was redesigned to thwart the following attacks:
  • The unauthorized reading of sensitive logon data from the .NET configuration file (e.g. app.config).
  • 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.
  • The potential to create a malevolent application which gains access to an open connection that was originally intended for a different application.

One of the new features implemented to combat the malevolent for RFC client attacks is the interface IDestinationConfiguration. This interface contains method IDestinationConfiguration.GetParameters(string destinationName) 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.

Additionally, there is updated functionality to support single sign-on (SSO) and X.509 certificates.

Say Goodbye to Data Containers and Generated Code

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 RfcFunction class, whose Invoke() method dynamically executes every given ABAP function module. Additionally, all ABAP parameters will be represented by the class RfcStructure instead of a dedicated generated class for every structure; All tables will be represented by class RfcTable.  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.

NCo 3.0 uses SAP’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’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.

The biggest benefit of NCo 3.0’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, NCo 3.0 will work with any version of Visual Studio you like! The only requirement is that at runtime, a .NET Framework version is installed that is compatible with the NCo 3.0 libraries.

Anxiously Waiting

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’ll be posting blogs highlighting the new features.  We’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.


About The Author

Former Partner and Senior Consultant at DataXstream, Craig Stasila played a key role in developing DataXstream. For current information regarding Craig Stasila please see his Linkedin profile.


  1. Avatar
    July 29, 2010 at 6:40 am · Reply

    Hi Craig

    Thanks for the insight. The new features look promising. Do you if we will be able to use the conenctor with VS2008 or higher?


  2. Avatar
    Justin Loranger
    November 2, 2010 at 4:01 pm · Reply

    Any further word on a release date?

  3. Avatar
    January 3, 2011 at 4:50 pm · Reply

    NCo 3.0 has been released at the SAP Market Place.

  4. Avatar
    January 4, 2011 at 9:35 am · Reply

    This was officially released 12/22/2010. You can download from the connectors site

  5. Avatar
    March 10, 2011 at 4:03 am · Reply

    Hi Craig,
    I’m using a new NCo 3.0 and I need to throw an exception in a server fuction; but doesn’t work could you send me an example?
    This is my code:

    [RfcServerFunction(Name = “XXXXXX”)]
    public static void XXXXXX(RfcServerContext context, IRfcFunction function)

    Int32 oCount = MyServerDemo.server.Monitor.UsedConnectionCount;

    IRfcTable sapTable = function.GetTable(“zfile”);

    function.AbapClassExceptionMode = RfcAbapClassException.Mode.FULL;

    RfcAbapException oExc = new RfcAbapException(function.Metadata.GetAbapException(1).Key);

    throw oExc;

  6. Avatar
    Kevin Knapp
    August 1, 2011 at 9:31 am · Reply

    Have you done any type of SSO with NCo? We love the new NCo capabilities, but really need to figure out SSO for our situation. We can’t find any specific SAP example documentation on how to do this?

    We would like a user to invoke a SharePoint web part to review and approve SAP ECC invoices. The user has already logged into active directory on our network, and we would like to automatically log them into SAP and not prompt them for their SAP account and password. Their active directory and SAP accounts do match in this situation (even though passwords may not).

  7. Avatar
    November 19, 2011 at 4:24 pm · Reply

    problem in NCO convert time

  8. Avatar
    December 21, 2011 at 8:12 pm · Reply

    Hi Craig,
    I need to input a tableto a RFC, but it doesn’t work, can you tell why? It is my code:
    RfcRepository repo = prd.Repository;
    IRfcFunction function = repo.CreateFunction(“ZMES1”);
    IRfcTable ROFTable = function.GetTable(“Z_MESTAB”);
    ROFTable.CurrentRow.SetValue(“AUFNR”, “988888888888”);
    ROFTable.CurrentRow.SetValue(“AUART”, “PP01”);
    ROFTable.CurrentRow.SetValue(“ERNAM”, “hisen”);
    function.SetValue(“Z_MESTAB”, ROFTable);
    the program did not report error, but i can’t get the result in SAP, it seems input a blank value to RFC.

  9. Avatar
    March 22, 2012 at 2:30 am · Reply

    Hi Craig,

    I am new to NCo 3.0 and was successful in connecting my C# application to SAP. But How can i get the data from SAP Table and Store it in C# DataTable. Can you please guide me.


  10. Avatar
    April 11, 2012 at 11:06 am · Reply

    Hi Craig,
    How to extract data from the IDoc table (EDIDC), similar when I go to transaction SE16N and enter the table EDIDC and enter a value in the serialization field.

    Ty very much

    • Avatar
      Craig Stasila
      April 12, 2012 at 2:58 pm · Reply

      There are really only two options to read data from tables:
      Option 1: Use function RFC_READ_TABLE to retrieve the data you want. A full explanation of RFC_READ_TABLE is well beyond anything I could cover in a comment.
      Option 2: Write your own ABAP function (remember to RFC-enable it!) to read the data you require.

Leave a reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

This site uses Akismet to reduce spam. Learn how your comment data is processed.