How to Trigger a BizTalk Orchestration from SAP

Abhishek Nigam; Teekam Chand Goyal


Published: May 1 2005

Applies to: BizTalk Server 2004; BizTalk Server 2006

Summary: The How to Trigger a BizTalk Orchestration from SAP document describes the various processes, technologies, and tools involved in exchanging data between SAP and multiple applications. Detailed configuration scenarios are also provided. (6printed pages)

Today, SAP is one of the world’s most popular Enterprise Resource Planning (ERP) products. A large number of SAP customers are also dependent on a variety of complementary applications built on other platforms like Microsoft .NET and J2EE. These organizations also run a variety of other packaged products for specialized tasks. More often than not, these applications need to exchange data between themselves, and with SAP.

A SAP transaction often impacts a business process, which then spurs a related transaction in another system. Microsoft BizTalk Server 2004 can orchestrate such a business process, allowing transmission of messages to and from the SAP environment. To simplify the process of getting data in and out of SAP, developers can use the Microsoft BizTalk Adapter v2.0 for mySAP Business Suite, which does not require any custom code development.

This document addresses the process of "listening" to transactions in SAP, and describes the technologies that come into play, the various processes and tools involved in the configuration, as well as offering a detailed hands-on approach for actually doing the configuration for a specific scenario.

This white paper targets BizTalk Developers, Architects and Technical Managers with SAP in their application environments, who want to seamlessly exchange data from SAP into multiple applications. This could include corporate intranet portals, other packaged applications or even custom applications. The lowest common denominator for these applications is the capability to read and create XML or flat-files.

In order to complete the exercise defined in this white paper, you need a basic working knowledge of SAP (as an enterprise application). We assume you are familiar with Microsoft BizTalk Server 2004.

BAPI/RFC Interface

The RFC Library offers an interface to a SAP System. The RFC Library is the most commonly used and installed component of existing SAP Software. This interface provides the opportunity to call any RFC function in a SAP System from an external application. Moreover, the RFC Library offers the possibility to write a RFC Server Program, which is accessible from any SAP System or external application. Most SAP Connectors use the RFC Library as communication platform to SAP Systems.

SAP provides the RFC API in the form of C-routines, incorporated in the RFC Library. The RFC Library is available on all SAP Supported Platforms. The RFC Library is forward and backward compatible, i.e. e. an older release of the RFC Library can communicate with a SAP System at a higher version and vice versa.

ALE/IDOC Interface

Electronic Data Interchange (EDI) and Application Link Enabling (ALE) exchange business data between different systems.

For both these forms of data transfer, you need the IDoc interface. The IDoc interface consists of the definition of a data structure and a processing logic for this data structure.

The data structure is the IDoc. The exchange format is common to the communicating systems.

  • In EDI application scenarios, the processes involve two partners: The sender and the recipient of an EDI message.
  • ALE enables developers to integrate business processes across several SAP systems or non-SAP systems.

IDOC Interface

IDoc, or Intermediate Document, is a standard SAP document format that allows you to link different application systems via a message-based interface. The three main goals of IDocs are:

  • Structuring the exchange of business documents so they are automatically processed.
  • Reducing the structural complexity of different application systems to as simple a structure as possible.Example: The structure of an SAP application document and the structure of the corresponding EDI message under the UN/EDIFACT standard.
  • Extensive exception handling before posting data to the application.

IDocs are defined and considered on two levels, the technical and the business level. The former allows them to support application-independent functions, e. g. routing and handling technical exceptions.

  • Technical Level − Defined by the three record types compatible with the IDoc interface:
    • Control record
    • Data record
    • Status record
  • Business Level − Defined by the segments of an IDoc - segments are structures used to interpret field SDATA in the data record. An IDoc type is defined by the relevant:
    • Segments
    • Attributes of these segments
      (e. g. maximum usage, hierarchical sequence, segment status)

This scenario illustrates how to configure SAP, Microsoft BizTalk Server 2004, and the Microsoft BizTalk Server Adapter 2.0 for mySAP Business Suite, to respond to a SAP initiated transaction.

A SAP launches an orchestration in Microsoft BizTalk Server 2004. This action generates an IDoc, which Microsoft BizTalk Server 2004 receives via a Receive Port. With the receipt of this IDoc, Microsoft BizTalk Server 2004 can initiate an orchestration or any other action.

Step 1a. Creating a RFC Destination

To create an RFC destination
  1. Using transaction SM59, navigate to the Display and Maintain RFC Destinations page Click the Create button as shown in figure below.


  2. On the Create RFC Destination page, do the following:

    1. In the RFC destination field, type OrdersRFCDestination.
    2. In the Connection Type field, select Start an external program via TCP/IP (T).
    3. In the Description field, provide a description of RFC Destination as RFC Destination for sending order IDocs to BizTalk System in the Description text box, and then press the ENTER key.

    4. In the Activation Type field, select Registration.
    5. In the Program ID field, type ORDERSPROGID.

  3. Press CTRL + S to save the destination.

Step 1b. Creating a Transactional RFC Port

To create a transactional RFC port
  1. Using transaction WE21, navigate to the Ports in IDoc Processing page.

  2. Click Transactional RFC in the tree view and then click the Create button as shown in the following figure.


  3. A dialog box asking for port name appears. Select the own port name button, type BTSORDPORT in the text box and press the ENTER key as shown in the following figure.


  4. Provide port description and RFC destination name in the respective fields.


  5. Press CTRL + S to save the port.

Step 1c. Partner Profile Configuration

To configure the logical system
  1. To create a new logical partner, navigate to transaction SALE and then to Define Logical System as shown in the following figure.


  2. If required, you can define a new logical system or you can use an existing logical system from the list as shown in following figure.


To create a partner profile
  1. Using transaction WE20, navigate to the Partner Profiles page.

  2. Click Partner Type LS – Logical System in the tree view, and then click the Create button as shown in the following figure.


  3. Provide a Partner Number and press the Enter key.

  4. Save the Partner Profile by pressing CTRL + S.

  5. In the Outbound parmtrs field, click the plus button as shown in the following figure.


  6. Enter information for Message Type, Receiver Port, Output Mode, and Basic Type as shown in the following figure.


  7. Press the Enter key and save the details.

To create the BizTalk receive port
  1. In BizTalk Explorer, right-click the Receive Ports collection, and then select Add Receive Port.

  2. On the Create New Receive Port dialog box, accept One-Way Port from the drop-down list, and then click OK. Following is a sample screen.


  3. On the One-Way Receive Port Properties - Configurations - General dialog box, type IDocSAPReceivePort in the Name field, and then click OK. Following is a sample screen.


  4. In BizTalk Explorer, right-click the Receive Locations node, and select Add Receive Location.

  5. On the Receive Location Properties – Configurations- General dialog box, enter the following information.

    1. In the Name field, type IDoc SAP Receive Location. Following is a sample screen.

    2. In the Transport Type field, select SAP.
    3. In the Address (URI) field, click the ellipsis (...) button.
  6. The SAP Transport Properties dialog box appears. Specify the Client, Language, System, System ID, User Name, and Password. You can get this information from your SAP administrator.

    You must specify the Program ID provided by your SAP administrator. In the following example, the Program ID is ORDERSPROGID. This Program Id should be the same as the destination created previously.


  7. Click OK.

  8. Back on the Receive Location Properties – Configurations- General dialog box, in the Receive Handler field, select BizTalkServerApplication.

To test the RFC destination registration
  1. Using transaction SM59, navigate to Display and Maintain RFC Destinations.

  2. Under the TCP/IP connections node, select and double-click OrdersRFCDestination RFC Destination. The following screen appears:


  3. Click the Test Connection button as shown above.

  4. The following message displays, which shows that the Program ID is not registered in any external system.


  5. Now enable the IDoc SAP Receive Location receive location and test the connection after few seconds.

  6. You have now successfully tested the connection and the following screen should display.


BizTalk Server is now ready to receive the ORDERS01 IDocs from SAP delivered to BTSORDPORT port and 177 logical system as defined in the previous procedures.

You need to configure the SAP System to generate the ORDERS01 IDocs, according to the specific requirement e.g. on creation of a new order, which will be delivered to above logical system at the specified port.

Using the instructions provided in this document, SAP Basis Administrators and Microsoft BizTalk Server 2004 Developers could configure scenarios where an external system like SAP can trigger a workflow in BizTalk Server, potentially resulting in a transaction in another system.

This provides additional benefits for using Microsoft BizTalk Server 2004 in a heterogeneous IT environment, where SAP is an integral part of the enterprise line-of-business platform.