Browse, search, and get SAP metadata

The SAP adapter surfaces metadata from the SAP system. This metadata describes the message structure for communicating with an SAP system using the adapter. The SAP adapter supports two interfaces for retrieving metadata.

  • MetadataExchange provided by Windows Communication Foundation (WCF). WCF provides a metadata-exchange endpoint for all WCF bindings, which enables clients to get metadata from the SAP system.

  • IMetadataRetrievalContract provided by the Microsoft Windows Communication Foundation (WCF) Line of Business (LOB) Adapter SDK, which supports the metadata browsing and searching capabilities of the adapter.

    One of the goals of the Microsoft BizTalk Adapter for mySAP Business Suite is to expose the SAP system as a WCF service. The adapter surfaces the SAP artifacts (RFCs, BAPIs, and IDOCs) as operations that adapter clients can invoke. The adapter also surfaces some specific operations that can be used to send or receive IDOCs from an SAP system. These operations are listed later in this topic.

    It is possible to browse, search, and retrieve metadata by using the WCF service model, by using the WCF channel model, or by creating a BizTalk project in Visual Studio.

    When using the WCF service model, you must use the Add Adapter Service Reference Visual Studio Plug-in to generate the proxy classes for performing operations on the SAP system. When using a BizTalk project, you must use the Add Adapter Metadata Wizard or the Consume Adapter Service BizTalk Project Add-in to generate metadata for the operations that you want to perform on the SAP system.

    For more information about browsing, searching, and retrieving metadata using Add Adapter Service Reference Plug-in, Add Adapter Metadata Wizard or Consume Adapter Service Add-in, see Get Metadata for SAP Operations in Visual Studio.

Browsing Metadata

TheSAP adapter enables adapter clients to browse the RFCs, tRFCs, BAPIs, and IDOCs exposed by the SAP system. As part of the metadata browse operation, the adapter surfaces the RFCs and BAPIs as operations. For IDOCs, the adapter surfaces operations for sending and receiving IDOCs. These operations are available from Add Adapter Service Reference Plug-in, Add Adapter Metadata Wizard or Consume Adapter Service Add-in. The SAP metadata is categorized under the following nodes:

  • RFC. This node contains the RFCs exposed by the SAP system and represents a function module in SAP. The adapter categorizes the RFCs into multiple logical levels and exposes a hierarchical view to the adapter clients. An RFC is at the lowest level of this hierarchy and is exposed as an operation that can be invoked by an external application. The SAP adapter uses the RFC SDK to generate metadata for the RFCs. The adapter can invoke only those RFCs for which it can generate the metadata.

    Other than surfacing the RFCs as operations, the adapter also surfaces some specific operations such as RfcGetAttributes. For more information about these operations, see Operations on RFCs in SAP.

  • TRFC. This node contains the tRFCs exposed by the SAP system. tRFCs are not a conventional artifact in an SAP system, but rather a mechanism to invoke RFCs. tRFCs are categorized under a separate node because their metadata characteristics are different from RFCs. Specifically, RFCs also include export parameters. The adapter categorizes the tRFCs into multiple logical levels and exposes a hierarchical view to the adapter clients. A tRFC is at the lowest level of this hierarchy and is exposed as an operation that can be invoked by an external application.

    Other than surfacing the tRFCs as operations, the adapter also surfaces some specific operations such as RfcConfirmTransID. For more information about these operations, see Operations on tRFCs in SAP.

  • BAPI. This node contains the BAPIs exposed by the SAP system. The adapter categorizes the BAPIs into multiple logical levels and exposes a hierarchical view to the adapter clients. A BAPI is at the lowest level of this hierarchy and is exposed as an operation that can be invoked by an external application.

  • IDOC. This node contains the IDOCs exposed by an SAP system. The adapter categorizes the IDOCs into multiple logical levels and exposes a hierarchical view to the adapter clients. The operations that the adapter exposes for the IDOCs are:

    • Send and Receive. Adapter clients can use these operations to send and receive IDOCs from an SAP system using a strongly-typed schema.

    • SendIdoc and ReceiveIdoc. Adapter clients can use these operations to send and receive IDOCs from an SAP system using a weakly-typed schema.

      For more information about these operations, see Operations on IDOCs in SAP.

    For more information about how metadata is categorized, see Metadata Node IDs.

Searching Metadata

In the SAP adapter, adapter clients can search metadata in an SAP system by using search expressions that are dependent on the underlying RFCs that the SAP adapter uses. The following table lists the SAP artifacts and the metadata hierarchy under which adapter clients can search.

Artifact Searches under the node in GUI
RFC - /RFC
- /RFC/[Application Group]
tRFC - /TRFC
- /TRFC/[Application Group]
BAPI - /BAPI
IDOC - /IDOC

The following table lists the special characters that can be used for search and their interpretation by the SAP adapter.

Special character Interpretation
+ (plus) Matches exactly one character.

For example, A+ matches AB, AC, AD
* (asterisk) Matches zero or more characters.

For example, A* matches A, AB, ABC.

Retrieving Metadata

The SAP adapter enables adapter clients to retrieve metadata for the SAP system, including detailed metadata characteristics:

  • For an RFC, the SAP adapter retrieves the RFC name along with import, export, changing, and table parameters. The SAP adapter also retrieves the data types for parameters, field length of parameters, in addition to mandatory and optional parameters.

  • For a tRFC, the SAP adapter retrieves details similar to the RFC, with the exception of export parameters. Because tRFC calls are asynchronous, no output parameters are retrieved.

  • For a BAPI, the SAP adapter retrieves the business object name, business object method name, and other specific information similar to RFCs.

  • For an IDOC, the SAP adapter retrieves the IDOC type, the release number, the version, IDOC control records, IDOC data records, and other IDOC segment information.

    Note

    If metadata for IDOC contains both low and high values (range) for a data type, the SAP adapter exposes that as a string. If the metadata contains only low values, the SAP adapter exposes that as an enum.

Note

The SAP adapter exposes the SAP function parameters in an alphabetical order, irrespective of how the parameters are ordered in the SAP function definition. This is because of the following reasons:

  • Different versions of SAP RFC SDK return SAP function parameters in different orders. Hence, in order to provide a consistent experience to the adapter users, the SAP adapter exposes the parameters in an alphabetical order.
    • Same RFCs on different SAP servers could have different order of exposing function parameters. The SAP adapter makes this difference transparent to the users by exposing the parameters in a consistent alphabetical order.

Note

While retrieving data from the SAP system using the Windows Communication Foundation (WCF) service model, the SAP adapter does not deserialize messages having more than 65536 nodes. Make sure the response message has nodes less than or equal to 65536. You can work around this limitation by modifying the app.config file for your application. For instructions, see Troubleshoot Operational Issues.

For more information about browsing, searching, and retrieving metadata, see Get Metadata for SAP Operations in Visual Studio.

See Also

Architecture overview of BizTalk Adapter for mySAP Business Suite