download.microsoft.comdownload.microsoft.com/.../ui_sap_infopath.doc  · web viewthis unstructured...

27
Connecting to SAP From Microsoft Office InfoPath Technical White Paper Published: April 2004 Authors: Lindsey Allen,Dennis Wang Contributing Authors: Tudor Toma, Yancey Smith, Foad Vafaei, Karen Olson (BuzzBee) April 2004

Upload: nguyendang

Post on 30-Jun-2018

214 views

Category:

Documents


0 download

TRANSCRIPT

Connecting to SAP From Microsoft Office InfoPathTechnical White Paper

Published: April 2004

Authors: Lindsey Allen,Dennis Wang Contributing Authors: Tudor Toma, Yancey Smith, Foad Vafaei, Karen Olson (BuzzBee)

April 2004

Connecting to SAP From Microsoft Office InfoPath 2

Table of Contents

Introduction..................................................................................................................................... 4The Challenge of Unstructured Data.......................................................................................4Business Process Automation...................................................................................................4The Power of InfoPath 2003......................................................................................................4Executive Summary.................................................................................................................... 5Building a Web Service via Visual Studio .NET..............................................................................5Configuration............................................................................................................................... 5Programming the SAP .NET Connector Client........................................................................6Generate the Proxy..................................................................................................................... 6Generate the Vendor Search Proxy.........................................................................................7Configuring the Connection to SAP................................................................................................8Create the Front-end Web Service for Proxy..................................................................................9SAP Toolbox................................................................................................................................ 10Steps to Call RFC....................................................................................................................... 11Data Type Mapping...................................................................................................................13Consume the Data Within an InfoPath Form................................................................................13Create the InfoPath Form........................................................................................................13Conclusion.................................................................................................................................... 18Appendix I Debugging SAP Client................................................................................................20Appendix II Overview of .NET Connector Classes........................................................................23

Connecting to SAP From Microsoft Office InfoPath 3

Introduction The Challenge of Unstructured DataBusinesses create, capture, and manage information in myriad forms: as structured data in operational systems, as documents that are published and shared, and in countless e-mail messages. In recent decades, methods have been established for storing and managing structured information, for example, numerical data in databases or financial records and statistics.

However, a significant portion of the information created in today’s business environment has remained unstructured and, as a result, cannot be processed in any meaningful way. This unstructured data can come in the form of Word processing documents, Web pages, email, presentations, customer contact notes, etc. According to Gartner Group, “more than 75 percent of enterprise data is unstructured and document-related, rather than being neatly sorted numbers in a database.”1 To make matters worse, organizations are facing the daunting challenge of heterogeneous platforms, multiple systems, and front-end applications that don’t integrate well with back-end systems. Companies are finding that an inability to integrate critical business processes is limiting their ability to respond well to ever changing business conditions. These challenges have led businesses to search for a means of organizing and leveraging their core resource – their business intelligence.

Business Process AutomationAt the heart of every enterprise are numerous document-driven business processes that determine how information is to be collected, reported, published, shared, and stored. Document-based processes, including financial reporting, proposal management, contract management, recruiting and other business activities, influence the ways organizations collaborate on work; how they communicate with partners, customers, and shareholders; and how they store or archive information for reuse and retrieval. Facing dramatic changes in the business world, organizations are finding it essential but difficult to manage these business processes end to end. Businesses need to make faster, more informed decisions. They need the ability to better manage the flow of information to connect applications, people, partners, and data.

Microsoft provides a complete platform for end-to-end processes, solving problems common to many organizations today. Chief among today’s business challenges is ensuring easy access to information. Microsoft’s technologies enable companies to easily integrate desktop applications with line-of-business and back-office applications and enterprise data silos, allowing people to work more effectively. Automating business processes with the Microsoft Office System empowers information workers by connecting the desktop environment to enterprise data. It provides the tools that enable sophisticated analysis and reporting. Ultimately, it can improve the day to day processes that make workers more productive.

The Power of InfoPath 2003In particular, an overwhelming number of business processes rely on the use of forms to capture data and initiate the required actions. Through InfoPath 2003, the Microsoft Office System provides an intuitive forms-based interface that enables organizations to create rich applications based on their own processes. InfoPath 2003 makes it easy for developers to create and deploy rich, forms-based solutions for enterprise processes. It provides developers with a facile interface for constructing dynamic, interactive forms with built-in business validations and business rules for accurate and efficient collection of information. InfoPath allows rapid solution creation Web services, eXtensible Markup Language (XML) data, or by allowing creation from scratch. It works with customer-defined schemas which eliminates the need for any schema mapping. Built-in

1 Gartner Group, “Four Steps Raise Value of Real-Time Content Management” May 19, 2003

Connecting to SAP From Microsoft Office InfoPath 4

script editor, rich object model and programmable task panes allow developers to build more advanced solutions.

InfoPath also addresses a core problem in data collection and integration needs in the enterprise via XML. While XML has great potential to enable application integration, its use typically requires a development background so it is primarily employed in back-office and data center applications. InfoPath brings XML functionality to the desktop by allowing users to gather and manage business data in XML without requiring those users to know the language themselves.

Executive SummaryInfoPath 2003 is a powerful front-end to business processes. By connecting InfoPath to backend line of business applications, organizations can increase efficiency by streamlining and automating repetitive processes. This helps shorten time-to-market by eliminating manual steps in information handling, by improving the quality of the data and minimizing errors. This reduces response times and delivery of goods and services. Companies can improve quality of service by deploying processes around best practices that ensure quality and consistency in products and customer service. Integrating the desktop applications with line-of-business and back-office applications and enterprise data silos allows people to work more effectively. Empowering Information workers to define their own processes reduces the need for IT departments to be involved with lines of business on a daily basis.

This paper demonstrates Microsoft’s ability to connect the desktop to a line of business system on the back end. It showcases how InfoPath 2003 can be easily connected to SAP to empower information workers to easily create and gather data.

This paper is intended for a technical audience. The first section of the paper describes how to configure and use the .NET connector to call remote functions in SAP. The second section of the paper provides guidelines for creating a front-end Web service (SAP WSDL or Web Service Description Language) interface for the .NET connector proxy through a sample solution (retrieve vendor information from SAP). This front-end Web service will retrieve the SAP dataset via the .NET Connector, and expose this data to InfoPath. Finally, the third section demonstrates how to build a simple InfoPath form to consume this data.

Building a Web Service via Visual Studio .NETOne of the compelling business reasons to connect InfoPath 2003 to SAP is the ability to easily retrieve and reuse vendor information from an SAP system. To do this, you will need to create a Web service through a configuration via Visual Studio .NET. The new Visual Studio Tools for the Microsoft Office System technology brings the power and productivity of Visual Studio .NET and the .NET Framework to business solutions. Using managed code with Office 2003 allows developers to create applications with a more robust security model, restricting code that can execute only on a fully trusted corporate server. This .NET environment also simplifies deployment, saving time and money by not requiring a manual installation of code on each desktop.

ConfigurationThe following sections will walk you through step-by-step guidelines for building a Web Service via Visual Studio .NET.

First, you must have Visual Studio .NET installed on the development machine. You can download the .NET connector from the SAP Website. You will also need a Java Runtime and Visual Studio .NET for your development environment. To deploy your solution, you will need LIBRF32.dll (SAP release 6.20 or higher), SAP.NET.Connector.dll and the Microsoft .NET Framework installed on your production environment. You will need the Java virtual machine for development purposes. It is used only at design time to get metadata from the SAP system (DDIC) to generate the proxy. It is not needed during run time. The design elements for Visual

Connecting to SAP From Microsoft Office InfoPath 5

Studio will be installed at %Program Files\Visual Studio.net\Common\IDE. The rest of the connector components will be installed to %Program Files\SAP\SAP .net connector\. Please refer to the release notes for more installation related details.

Programming the SAP .NET Connector ClientTo build a Web Service via Visual Studio .NET, you will also need the SAP .NET Connector Client. The SAP client allows your .NET code to execute SAP functions that are remote-enabled (RFC). In the SAP client solution, the SAP system is the server and the .NET application is the client that interacts with the RFC. When you generate an SAP client application, a WSDL file is added to your Visual Studio .NET project. This WSDL file in coordination with a custom tool in Visual Studio creates several C# classes needed to communicate with the SAP system via either RFC or SOAP. There is one class for the proxy itself, one for each export parameter and two for each Table parameter in your RFC.

The SAP RFC is called as a method of the proxy object. There can be one or more RFCs per proxy. For example you could have a proxy with all customer-related RFCs in one library. The parameters for each RFC can be customized within the Visual Studio designer so that optional parameters can be removed, parameters can be renamed and default values provided. You can also customize SAP structures by renaming or removing fields. Visual Studio developers can work with the SAP proxies in their choice of programming language. The proxies themselves are generated in C#. For projects written in other languages you have to add a new project of type SAP Connector Class to the Visual Studio solution.

Generate the ProxyNext, you will need to generate the RFC proxy. The RFC proxy is a small piece of C# code that represents everything you need to call remote functions in SAP (please see the illustration below).

Figure 1. SAP .Net Connector Proxy

The connector proxy includes C# classes for each unique SAP Tables (SAPTable) parameter and each unique SAP Structure (SAPStructure) parameters in the RFC you select. All the RFC call information is available to you at design time. The proxy supports both SOAP and traditional RFC in the same proxy. You can create the proxy from one of the following sources (also show in the wizard screen shot):

1. SAP system directly2. SAP interface repository3. An existing WSDL file

Connecting to SAP From Microsoft Office InfoPath 6

Figure 2. SAP .Net Connector Wizard

Generate the Vendor Search ProxyNext, you will need to generate the vendor search proxy. To show you an example of this, we have created a vendor search in a mocked sample. Z_Get_Invoice_By_Vname is the RFC we used in the sample to return vendor names matching the search criteria. We use the SAP .NET Connector to create the C# proxy SAPWSSample. ZINV02Table is the class created based on the SAPTable and ZINV02 is the class created based on SAPStructure.

By default, the wizard will use the name of the project that the proxy belongs to as the proxy name space and it is SAPWSSample in our case. You can change the proxy namespace on the SAPWSDL file “Custom tool Namespace” property. The .net connector code generator will automatically update the proxy definition.

The following is the sample proxy://------------------------------------------------------------------------------using System;using System.Text;using System.Collections;using System.Runtime.InteropServices;using System.Xml.Serialization;using System.Web.Services;using System.Web.Services.Description;using System.Web.Services.Protocols;using SAP.Connector;

namespace SAPWSSample{ // Client SAP proxy class [WebServiceBinding(Name="", Namespace="urn:sap-com:document:sap:rfc:functions")] public class SAPProxy1 : SAPClient {

// Constructorspublic SAPProxy1(){}

public SAPProxy1(string ConnectionString) :base(ConnectionString){}

// Generated method used to call the remote function module Z_GET_INVOICE_BY_VNAME // Throws:

Connecting to SAP From Microsoft Office InfoPath 7

[RfcMethod(AbapName = "Z_GET_INVOICE_BY_VNAME")] [SoapDocumentMethodAttribute("http://tempuri.org/Z_GET_INVOICE_BY_VNAME",

RequestNamespace = "urn:sap-com:document:sap:rfc:functions", RequestElementName = "Z_GET_INVOICE_BY_VNAME", ResponseNamespace = "urn:sap-com:document:sap:rfc:functions", ResponseElementName = "Z_GET_INVOICE_BY_VNAME.Response")]

public void Z_Get_Invoice_By_Vname ([RfcParameter(AbapName = "NAME",

RfcType=RFCTYPE.RFCTYPE_CHAR, Optional = false, Direction = RFCINOUT.IN, Length = 35, Length2 = 70)]

[XmlElement("NAME", IsNullable=false)] string Name,

[RfcParameter(AbapName = "RETURN_CODE",RfcType=RFCTYPE.RFCTYPE_CHAR, Optional = true, Direction = RFCINOUT.OUT, Length = 50, Length2 = 100)]

[XmlElement("RETURN_CODE", IsNullable=false)] out string Return_Code, [RfcParameter(AbapName = "INV_DATA",

RfcType=RFCTYPE.RFCTYPE_ITAB, Optional = false, Direction = RFCINOUT.INOUT)]

[XmlArray("INV_DATA", IsNullable=false)] [XmlArrayItem("ZINV02", IsNullable=false)] ref ZINV02Table Inv_Data) { object[]results = null; results = this.SAPInvoke("Z_Get_Invoice_By_Vname",new object[] { Name,Inv_Data }); Return_Code = (string) results[0]; Inv_Data = (ZINV02Table) results[1]; return; } } // rfm client proxy} // Namespace

After following the above steps, you should now be ready to create the wrapper Web service to front-end the vendor search proxy (SAPProxy1). This Web service will expose a Web method to call the RFC function. In order for the consumer of the Web service to retrieve data from SAP, we need to address SAP access security in our Web service. SAP .NET Connector supports all SAP authentication options.

Configuring the Connection to SAPTo connect to SAP you need several pieces of information:

• Client number• Application server (or group)• System number• User name & password

The connection to SAP is managed within the proxy’s connection object. You do not have to determine the status of the connection; the connector manages this automatically. Before an RFC can be executed, the connection must first be opened. After the RFC has finished executing the connection should be closed. For applications that have many concurrent users, the connector provides a connection pool object. It is possible to get the connection from the pool instead of creating one for each client. In this way connections are reused and performance is improved.

The .NET Connector makes it easy to perform SAP authentication in your application with the Destination and SAPLogonDestination classes and in ASP .NET applications with the SAP

Connecting to SAP From Microsoft Office InfoPath 8

Login Form. The SAP connection components (destination and SAP Logon Destination) take the place of a connection string such as the one below:

“ASHOST=iwdf9087.wdf.sap-ag.de. SYSNR=0 CLIENT=800 USER=scooby PASSWD=****”We recommend you use the SAP logon classes rather than manually creating a connection string with the logon information. The SAP logon classes support getting logon information at runtime from a configuration file (Web.config), SAPGUI or as another alternative, programmatically, for example from Microsoft Active Directory.

The following is the authentication code from the sample solutions:// create destination classSAP.Connector.Destination dest = new SAP.Connector.Destination();SAPProxy1 P = new SAPProxy1();try{

// provide dest information heredest.AppServerHost = "mysystemname";dest.Client = 122; // put your theredest.SystemNumber = 0;dest.Username ="????";dest.Password = "****";

// passing this destination to SAPconnectionPool to reuse the connectionP.Connection = SAP.Connector.SAPConnectionPool.GetConnection(dest.ConnectionString.ToString());

}catch (SAP.Connector.RfcAbapException ex){

…}finally{

P= null;}

Create the Front-end Web Service for ProxyThe following section illustrates how to create the front-end Web Service, or SAP WSDL interface, for the .NET connector proxy through a sample solution. (The sample solution we choose is a common business scenario of retrieving vendor information from SAP.) This front-end Web service will retrieve the SAP dataset via the .NET Connector, and expose this data to InfoPath. Before we start to create the Web service, let’s first review the SAP tools.

Connecting to SAP From Microsoft Office InfoPath 9

SAP ToolboxSAP Toolbox provides convenient VS.NET integration during development time. Below is a screen shot of the Toolbox.

Figure 4. SAP Proxy Toolbox

Before beginning to build the front-end Web service for the proxy, first familiarize yourself with this Toolbox. Following is a list of functionality in the SAP Proxy Toolbox: Destination stores connection information to the SAP system. SAPIDocSender sends IDOC files to the SAP system. SAPIDocReceiver receives IDOCS from SAP system using TRFC Server model. SAPLogonDestination like Destination but also works with SAPLogon to retrieve destination

list from SAPGUI. SAP Table Wizard adds SAP Table parameters from the proxy to your application. Connection code is the template code for logging on and executing a method in SAP.

Connecting to SAP From Microsoft Office InfoPath 10

Steps to Call RFCThe following diagram shows the steps you need to go through to call an RFC in VS.NET so that you know what to do in order to create the front-end Web service for your SAP .NET connector proxy.

Figure 5. Steps calling RFC

Connecting to SAP From Microsoft Office InfoPath 11

In our sample, we created one Web method (SAPRFCWSMethod1) to front end the RFC Z_Get_Invoice_By_Vname. The following is the Web service sample code.

using System;using System.Collections;using System.ComponentModel;using System.Data;using System.Diagnostics;using System.Web;using System.Web.Services;

namespace SAPWSSample{

public class SAPRFCWS : System.Web.Services.WebService{

public struct SAPRFCWSMethod1_RFCReturn{

public ZINV02Table TB;public string RC;public string ProcessMessage;

}// constructorpublic SAPRFCWS(){//CODEGEN: This call is required by the ASP.NET Web Services Designer

InitializeComponent();}~SAPRFCWS(){}

……

[component design generated code]

// put true RFC return structure name here.private SAPRFCWSMethod1_RFCReturn SAPRFCWSMethod(string username,

string password, string vName){

……}[WebMethod]public SAPRFCWSMethod1_RFCReturn SAPRFCWSMethod1(string username, string password, string vName){

SAPRFCWSMethod1_RFCReturn ret = new SAPRFCWSMethod1_RFCReturn ();return SAPRFCWSMethod(username, password, vName);

}}

}

Connecting to SAP From Microsoft Office InfoPath 12

Data Type MappingAlthough the proxy will take care of the data conversion, the programmer of the proxy will need to map that information to declare variables. Following is an example of a simple data type mapping between SAP and .Net.

Simple Data TypesSAP Data type .Net type

C (String) StringI (integer)F Int32

F (float) DoubleD (date) String

T (time) String

P (BCD Packed, Currency, Decimal, Qty) Decimal

N (Numc) String

X (Binary and Raw) Byte[]

RFC String String

XString Byte[]

Table 1. Simple data type mapping between SAP and .Net

Complex Data TypesSAP Type .Net typeStructure C# class: SAPStructureNormal ITAB C# class:SAPTableType I Table Not supported in version 1Type II Table C# class

Consume the Data Within an InfoPath FormNow that we have a Web service that is able to retrieve vendor information from SAP, we are ready to build our InfoPath form that uses this Web Service. InfoPath 2003 is a powerful front-end to business processes.

The InfoPath interface allows information workers to create and gather information easily on top of the core XML model. InfoPath associates an XSL-T (Extensible Style Sheet Language–Transformation) style sheet with the form interface, enabling information workers to view and edit XML forms. InfoPath provides all the functionality expected from a forms package, including the ability to structure and validate data, as well as the use of word processing—all within the familiar Microsoft Office user interface.

InfoPath supports complex forms with hierarchical structures, free-form text, tables, optional or repeated blocks, data validation, data aggregation, and forms with need of multiple views. In a corporate environment, InfoPath streamlines data entry and data capture; native support for XML enables companies to create InfoPath solutions that send data from the desktop environment to back-end systems via XML Web services.

Create the InfoPath FormThe InfoPath data source setup wizard makes the design process very intuitive and easy. To keep this discussion concise, we’ll only build a very simple form to query the Web service and display the return results.

Connecting to SAP From Microsoft Office InfoPath 13

Start InfoPath and then click “Design a Form…” from the action pane on the left. This will bring up the Design a Form action pane.   InfoPath has a rich set of sample forms that come with it out of the box, and usually one can find a form that they either completely reuse or at least start with and modify.   But for simplicity sake, let’s design a simple new form from the data connection. You can do this by clicking on “New from data connection…” , you will see the following Data Connection Wizard dialog allow you pick from three two different data connections:

Figure 6. Data connection type selection in data connection wizard

The new form will use the SAP proxy web service built earlier, so you should select “Web server”. Clicking “Next” will bring you to the screen to select whether you want to:

Submit and receive data Submit data Receive data

We will select “Submit and receive data” and click “Next” to go to the Web service URL dialog box. Since we selected submit and receive data, and given that you could potentially use different Web services for submit and receive data, we will first see the receiving data Web service dialog and then the submit data Web service dialog. The following is what it looks like after we inputted the receiving data Web service URL.

Figure 7. Web service details in data connection wizard

It is easy to verify whether the URL is correct by pointing your browser to the same URL, and test the Web service as shown below.

Connecting to SAP From Microsoft Office InfoPath 14

Figure 8. View the Web service in IE

After you have completed this task, the data connection wizard will browse the WSDL and present the Web service methods to you in the wizard UI as shown.

Figure 9. Web Service interfaces in the data connection wizard

We need to submit data (vendor name search string) and receive data (the return result), the data connection wizard step you through selecting and naming both submitting and receiving data connections as shown in the following screen shots. You can use different web services for submit and receive data.

Figure 10. Name the receiving data connection

Connecting to SAP From Microsoft Office InfoPath 15

Figure 11. Name the submitting data connection

The last step in data connection setup is to finalize the submission query parameter list. By default, the wizard will list the Web method parameters as query submission parameters. You can then verify or modify the parameter list to use other query fields from the Web service data source. As a result, our query parameter list looks like the following:

Figure 12. Query parameters

When you click “Finish” , InfoPath will generate the default view of the form template, with query fields layout on top of the data fields layout. You can view the data source schema by click on “data source” from the design task pane on the right hand side of the form design screen.

Figure 13. InfoPath Data source

Connecting to SAP From Microsoft Office InfoPath 16

For the purpose of this simple solution, we placed a text box taking partial vendor name input for the search query. The text box is bound to the query parameter “vName” as shown below. Then, we choose a basic data grid to display the query result. In this example, you can drag and drop a repeating table with three columns from the control task pane onto the form. Then you can bind each of the columns to a data field in table ZINV02 as shown below.

Figure 14 form design

Note that this data grid is a very basic display of the query results. One of the advantages of InfoPath is that you can easily customize and refine your forms to map to your organization’s needs. InfoPath support the most basic layout design to very elaborate layouts that are customized for your business needs. With a few quick clicks, you can format this simple form, the following screen shot is the preview of the completed form.

Connecting to SAP From Microsoft Office InfoPath 17

Figure 15. Preview

In this example, we have created an InfoPath form to consume the SAP .NET connector Web service. To preview the form, press “Preview Form” on the toolbar above the design surface.   If everything is set up correctly, the data view table should be populated with the vendor names matching the selection criteria retrieved from SAP system by the Web service.   If not, Appendix A has some debugging tips.

ConclusionThe strength of automating business processes lies in the ability to seamlessly integrate desktop productivity applications with the business logic that drives the process and the enterprise systems that house the business data. The ability to manage the flow of information – by connecting applications, people, and data – increases an organization’s operational efficiency, improves productivity, and reduces costs. Connecting people to data and to one another enables faster, more informed decisions and more highly empowered employees; and makes the most of a company’s human capital and information assets. By integrating line-of-business and back-

Connecting to SAP From Microsoft Office InfoPath 18

office applications that are already in place, organizations increase the value of their investment in these systems and avoid the cost of replacing software.

The XML capabilities of the Office System, especially InfoPath, coupled with the integration components of the .NET framework allows companies to access and share legacy SAP information throughout the enterprise and with partners. Information workers can use InfoPath as a window into their separate data silos. Companies can leverage Microsoft’s built-in Web Services to bring enterprise information to the desktop. Organizations can reduce manual processes by leveraging the XML capabilities of InfoPath. By creating processes that connect structured and unstructured data, this integration between Microsoft and SAP brings organizations tremendous business value.

Connecting to SAP From Microsoft Office InfoPath 19

Appendix I Debugging SAP Client

SAP ExceptionsIt is good practice to use try/catch/finally blocks and take advantage of strongly typed ABAP exceptions.

RFCABAPExceptionABAP exceptions are thrown when a normal program exception in the SAP program occurs and exceptions are the static members of the proxy. The specific ABAP exception is in the exceptions’ AbapException. This value can be compared to the list of possible exceptions for that RFC which are generated with the proxy generator.

Figure x RFC ABAP Exception

RFCLogonExceptionThis exception is thrown when user name and password is wrong or the user is locked.

RFCSystemExceptionThis exception is thrown when there is a SAP system error and or the RFC call produces a short dump.

RFCCommunicationExceptionThis exception is thrown when the client can not communicate with SAP system, it could due to incorrectly login information or the SAP system is unavailable.

RFCMarshalExceptionThis exception is thrown when

The data type cannot be translated from .NET to SAP or vice versa. Proxy is corrupted. Some problems with either SAP system or client dll’s (librfc32.dll, SAP.Connector.dll).

ABAP DebuggerYou can use the ABAP debugger to troubleshoot differences between SAP functions running in SAP vs. in the .NET connector:

Look for values that may be padded with zeroes in SAP but not in your code Date format (YYYYMMDD) Step thru code to get an idea for valid values Look for “select” statements

To use the ABAP debugger: You need to set ABAP_DEBUG = true in Destination. Adding a variable to the watch

Connecting to SAP From Microsoft Office InfoPath 20

and then executing the code in debugging mode: Step into (F5) Execute (F6) Step out (F7) Run to cursor (F8)

Figure x ABAP Debugger

RFC TraceYou could also turn on the trace flag to create a trace file to assist your debugging process. You will need the trace file if you want to open a support case with SAP. The down side is that the trace file is not easily understandable.

Connecting to SAP From Microsoft Office InfoPath 21

Figure x RFC trace

Connecting to SAP From Microsoft Office InfoPath 22

Appendix II Overview of .NET Connector ClassesClass DescriptionSAPClient Base class for all SAP client projectsSAPServer RFC server class that allows you to make use

of .NET functionality inside of your SAP ABAP/4 programs

SAPConnection Manages a connection to the SAP system. It is used by the SAPClient classes.

SAPConnectionPool Allows you to manage a pool of connection objects. This is important for applications where multiple users access your proxy.

Destination Base class for Destination objects. Holds login attributes as properties but does not contain logic to retrieve these properties as does SAPLogonDestination for example.

SAPLogonDestination Derived from Destination. In addition to holding login attributes this class can retrieve login information from the SAPGUI

SAPLoginProvider User name/password login support via ASP.NET forms authentication. Also provides an alternative single sign-on capability.

RfcException Base exception class for SAP .NET Connector exceptions. Not raised by itself.

RfcAbapException Exception representing an Abap/4 exception raised by the SAP RFC Abap/4 code.

RfcCommunicationException Exception representing a communication failure of some type (for example, the SAP system is unreachable).

RfcLogonException Exception representing a logon failure (for example, incorrect user name or password).

RfcSystemException Exception representing a system error (for example, an SAP short dump has occurred)

RfcQueueItem Used for QRFC calls to contain the SAP Queue information.

RfcTID Used for TRFC and QRFC calls. A TID is similar to a system GUID

SAPTable Very common data type used in RFC programming. This class can be data bound to most .NET data aware controls such as datagrids and listboxes. An example of an SAPTable might be a list of customers with name and address data for each row. SAPTable is a collection of SAPStructure.

SAPStructure Very common data type used in RFC programming. For example, a BAPI return code is a SAPStructure. An individual row in a table is a structure.

SAPIDocSender A class for submitting SAP intermediate documents (IDOCS) from text files.

SAPIDocReceiver A class for receiving SAP IDOCS from SAP.

Connecting to SAP From Microsoft Office InfoPath 23