Connecting to SAP through BDC

Hi
Is there any sample BDC application file available for connecting to SAP other than the one found in /Program Files/ Microsoft Office Server/12.0/BDC folder?
Secondly do we need to install the SAP .Net Connector on the MOSS Server to connect to SAP?

Thanks and Regards
Guruprasad Karnik

[312 byte] By [gpk2005] at [2008-3-3]
# 1
did you ever figure this out?
safeldm at 2007-9-12 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Business Data Catalog...
# 2

Hi,

the BDC need Webservices. So...

You need the NCO (SAP .NET Connector) if you want to build your own ASP.NET Webservices to your legacy SAP-System (SAP R/3 4.6 or older).Beware: The NCO only works in Visual Studio 2003.

If you have SAP NetWaever, you can use the SAP Webservices generatd by the WAS (Netwaever Application Server) or SAP XI.

Greetings from Germany,

Andreas Rohr

AndreasRohr at 2007-9-12 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Business Data Catalog...
# 3

Hi,

I am currently trying to connect to SAP using the BDC. I have created a web service based on BAPI_FLIGHT_GETDETAIL which I am trying to get to work, but have had no success.

Does anyone actually have a functioning connection to SAP using the BDC? I have spent hours trying to get this simple(!?!) web service to work, but am having immense difficulty getting the metadata correct. If anyone could help it would be very much appreciated.

Thanks in advance

arduk at 2007-9-12 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Business Data Catalog...
# 4

arduk,

Can you provide more details on the issues you have with the webservice? (if you can also post some parts of you XML it will help to diagnose the issue)

JavierD-MSFT at 2007-9-12 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Business Data Catalog...
# 5

In order to test the BDCs connection to SAP, I have been trying to run the bapi BAPI_FLIGHT_GETDETAIL, which I have exposed as a web service (if you do any SAP development, you are probably familiar with the Flight database. It contains sample data for a flight booking system). I have also tried using the sample one that is delivered with MOSS2007, which tries to run the some Bapis that return customer detail, and get a very similar error (same error, different line numbers)

I get the following error when I try to import the file.

"Application definition import failed. The following error occurred: Index was outside the bounds of the array. Error was encountered at or just before Line: '49' and Position: '9'."

I have been feeling my way through this a bit, and have encountered many errrors, and in each case I have managed to work out what was causing it, and fix it. This one has really got me stumped though. I would appreciate any assistance you can give!

In the xml file below line 49 is:

Code Snippet
<TypeDescriptor TypeName="FlightWebService.Bapisfldat, FlightWebService" Name="FLIGHT_DATA">

My xml file is below:

Code Snippet

<?xml version="1.0" encoding="utf-8" standalone="yes" ?>

<LobSystem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog BDCMetadata.xsd"

Type="WebService" Version="2.0.0.3" Name="FlightWebService" xmlns="http://schemas.microsoft.com/office/2006/03/BusinessDataCatalog">

<Properties>

<Property Name="WebServiceAuthenticationMode" Type="System.String">WindowsCredentials</Property>

<Property Name="WebServiceProxyNamespace" Type="System.String">FlightWebService</Property>

<Property Name="WsdlFetchAuthenticationMode" Type="Microsoft.Office.Server.ApplicationRegistry.SystemSpecific.WebService.HttpAuthenticationMode">WindowsCredentials</Property><!--PassThrough-->

<Property Name="WsdlFetchSsoProviderImplementation" Type="System.String">Microsoft.SharePoint.Portal.SingleSignon.SpsSsoProvider, Microsoft.SharePoint.Portal.SingleSignon, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Property>

<Property Name="WsdlFetchSsoApplicationId" Type="System.String">SAPDEV</Property>

<Property Name="WildcardCharacter" Type="System.String">*</Property>

<Property Name="WsdlFetchUrl" Type="System.String">http://SAPserver:PORT/sap/bc/srt/rfc/sap/ZFLIGHT_GETDETAIL?sap-client=330&amp;wsdl=1.1</Property>

</Properties>

<LobSystemInstances>

<LobSystemInstance Name="FlightWebService">

<Properties>

<!-- <Property Name="LobSystemInstanceName" Type="System.String">FlightWebService</Property>-->

<!-- <Property Name="LobSystemName" Type="System.String">FlightWebService</Property>-->

<Property Name="WebServiceAuthenticationMode" Type="System.String">WindowsCredentials</Property>

<!-- <Property Name="SsoProviderImplementation" Type="System.String">Microsoft.SharePoint.Portal.SingleSignon.SpsSsoProvider, Microsoft.SharePoint.Portal.SingleSignon, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Property>-->

<!-- <Property Name="WebServiceSsoApplicationId" Type="System.String">SAPDEV</Property>-->

</Properties>

</LobSystemInstance>

</LobSystemInstances>

<Entities>

<Entity EstimatedInstanceCount="10000" Name="Flight" DefaultDisplayName="Flight">

<Properties>

<Property Name="Audit" Type="System.Boolean">false</Property>

<!-- <Property Name="Title" Type="System.String">Name</Property>-->

</Properties>

<Identifiers>

<Identifier TypeName="System.String" Name="AirlineID" />

<Identifier TypeName="System.String" Name="ConnectionID" />

<Identifier TypeName="System.String" Name="FlightDate" />

</Identifiers>

<Methods>

<Method Name="zflight_getdetail">

<!--<Method Name="BAPI_FLIGHT_GETDETAIL">-->

<Parameters>

<Parameter Direction="In" Name="AIRLINEID">

<TypeDescriptor TypeName="System.String" IdentifierName="AirlineID" Name="AIRLINEID" />

</Parameter>

<Parameter Direction="In" Name="CONNECTIONID">

<TypeDescriptor TypeName="System.String" IdentifierName="ConnectionID" Name="CONNECTIONID" />

</Parameter>

<Parameter Direction="In" Name="FLIGHTDATE">

<TypeDescriptor TypeName="System.String" IdentifierName="FlightDate" Name="FLIGHTDATE" />

</Parameter>

<Parameter Direction="Out" Name="FLIGHT_DATA">

<TypeDescriptor TypeName="FlightWebService.Bapisfldat, FlightWebService" Name="FLIGHT_DATA">

<TypeDescriptors>

<TypeDescriptor TypeName="System.String" IdentifierName="AirlineID" Name="AIRLINEID" />

<TypeDescriptor TypeName="System.String" Name="AIRLINE" />

<TypeDescriptor TypeName="System.String" IdentifierName="ConnectionID" Name="CONNECTID" />

<TypeDescriptor TypeName="System.String" IdentifierName="FlightDate" Name="FLIGHTDATE" />

<TypeDescriptor TypeName="System.String" Name="AIRPORTFR" />

<TypeDescriptor TypeName="System.String" Name="CITYFROM" />

<TypeDescriptor TypeName="System.String" Name="AIRPORTTO" />

<TypeDescriptor TypeName="System.String" Name="CITYTO" />

<TypeDescriptor TypeName="System.String" Name="DEPTIME" />

<TypeDescriptor TypeName="System.String" Name="ARRTIME" />

<TypeDescriptor TypeName="System.String" Name="ARRDATE" />

<TypeDescriptor TypeName="System.String" Name="PRICE" />

<TypeDescriptor TypeName="System.String" Name="CURR" />

<TypeDescriptor TypeName="System.String" Name="CURR_ISO" />

</TypeDescriptors>

</TypeDescriptor>

</Parameter>

<Parameter Direction="Out" Name="ADDITIONAL_INFO">

<TypeDescriptor TypeName="FlightWebService.Bapisfladd, FlightWebService" Name="ADDITIONAL_INFO">

<TypeDescriptors>

<TypeDescriptor TypeName="System.String" IdentifierName="AirlineID" Name="FLIGHTTIME" />

<TypeDescriptor TypeName="System.String" Name="DISTANCE" />

<TypeDescriptor TypeName="System.String" Name="UNIT" />

<TypeDescriptor TypeName="System.String" Name="UNIT_ISO" />

<TypeDescriptor TypeName="System.String" Name="PLANETYPE" />

<TypeDescriptor TypeName="System.String" Name="FLIGHTTYPE" />

</TypeDescriptors>

</TypeDescriptor>

</Parameter>

<Parameter Direction="Out" Name="AVAILIBILITY">

<TypeDescriptor TypeName="FlightWebService.Bapisflava, FlightWebService" Name="AVAILIBILITY">

<TypeDescriptors>

<TypeDescriptor TypeName="System.String" IdentifierName="AirlineID" Name="ECONOMAX" />

<TypeDescriptor TypeName="System.String" Name="ECONOFREE" />

<TypeDescriptor TypeName="System.String" Name="BUSINMAX" />

<TypeDescriptor TypeName="System.String" Name="BUSINFREE" />

<TypeDescriptor TypeName="System.String" Name="FIRSTMAX" />

<TypeDescriptor TypeName="System.String" Name="FIRSTFREE" />

</TypeDescriptors>

</TypeDescriptor>

</Parameter>

</Parameters>

<MethodInstances>

<MethodInstance Type="SpecificFinder" ReturnParameterName="FLIGHT_DATA" ReturnTypeDescriptorName="FLIGHT_DATA"

ReturnTypeDescriptorLevel="0" Name="BAPI_FLIGHT_GETDETAIL" />

</MethodInstances>

</Method>

</Methods>

</Entity>

</Entities>

</LobSystem>

arduk at 2007-9-12 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Business Data Catalog...
# 6

The error is beacuse BDC expect a definition of a complex structure and you are not providing all the parameters requiered.

What you are want to model is a complex structure? (<TypeDescriptor TypeName="FlightWebService.Bapisfldat, FlightWebService" Name="FLIGHT_DATA">)

If yes, then the problem is that you need to enter the corrcet parameters:

Use the IsCollection property on a return TypeDescriptor object to indicate wherever there are collections within the return parameter. Consider a Web method that return collections of customers, each customer of which contains a collection of Addresses. In this example, the flag must be set twice—once at the root Customer[] level, and then again at the Customer[0].Address[] level. However, a collection TypeDescriptor object can have only a single child TypeDescriptor object under it that represents the structure in the collection.

Business Data Catalog clients such as the Business Data Web Parts do not handle complex structures. For example, consider the following structures:

class Customer { String Name; Address address; } class Address { Street street; String city; String zip; } class Street { int Block; String street; }

To work around this limitation, Business Data Catalog supports the concept of "complex formatting." Because clients support flat structures of primitives, the Business Data Catalog will "render" complex structures as formatted strings via two mechanisms: a simple .NET Framework String formatter, or a more complex Renderer that one can write using any .NET language. This is accomplished by setting two String properties with the names "FormatString" (e.g. "{0}, {1} \n {2}, {3}") or "RendererDefinition" (MyMethodName!MyTypeName, MyAssemblyName), respectively. The Method object in the RendererDefinition must correspond to a public static .NET method on a public .NET Type that takes a single argument, which is an array of Objects. In either case, what gets passed to the Format string or to the .NET Renderer is basically an array of all the primitive child values of the complex structure, as modeled by the Business Data Catalog TypeDescriptor definition for that structure.

Caution:

Complex formatting is slow; use it only if absolutely necessary.

Example:

<TypeDescriptor TypeName="System.Data.IDataReader, System.Data, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" IsCollection="true" Name="ProductDataReader">

JavierD-MSFT at 2007-9-12 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Business Data Catalog...
# 7

Hi Javier,

I am a comparitive starter in sharepoint.I need to know that

1. BDC can connect to SAP using webservice or sap connector or is it that sap connector will be used inside the webservice only.If last is the case, can't sap connector can be used alone to get the data.

2.Can Business intelligence module of sharepoint use the sap connector(without creating a webservice) to connect and create a dashboard for SAP data in sharepoint.

Cheers

devsharepoint at 2007-9-12 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Business Data Catalog...
# 8

BDC can consume webservices. You could expose sap connector via webservices so BDC can get data from SAP. I'm not sure if this is the best aproach given that sap web application server already have such webservices.

I don't know if the business intelligence module can use sap connector, I recomd you to post that question in this forum: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=1205&SiteID=1

Business intelligence module can interact with BDC, so if you get the data from SAP via BDC, then you could generate a dashboard.

JavierD-MSFT at 2007-9-12 > top of Msdn Tech,SharePoint Products and Technologies,SharePoint - Business Data Catalog...

SharePoint Products and Technologies

Site Classified